GithubHelp home page GithubHelp logo

cuba-platform / cuba Goto Github PK

View Code? Open in Web Editor NEW
1.3K 85.0 221.0 79.84 MB

CUBA Platform is a high level framework for enterprise applications development

Home Page: https://www.cuba-platform.com

License: Apache License 2.0

Java 93.93% PLSQL 0.14% Batchfile 0.01% Shell 0.01% PLpgSQL 0.01% FreeMarker 0.02% Groovy 4.09% GAP 0.09% HTML 0.03% CSS 0.01% XSLT 0.29% SCSS 1.40%
java web-framework enterprise full-stack rad framework cuba cuba-platform enterprise-applications apache2-license

cuba's Introduction

CUBA Platform

Java RAD framework for enterprise web applications

license Build Status

CUBA Platform is a high level framework for rapid development of enterprise applications with rich web interface.

The simplest way to start using the platform is to download CUBA Studio and create a new project in it. A released version of the platform will be downloaded automatically from the artifact repository.

You can also build a snapshot version of the platform from the source code and use it in your project.

To contribute, first refer to Contributing Code for general instructions and requirements for contributing code to the platform.

Building from Source

In order to build the platform from source, you need to install the following:

Let's assume that you have cloned CUBA Gradle Plugin and CUBA into the following directories:

work/
    cuba/
    cuba-gradle-plugin/

Open terminal in the work directory and run the following command to build and install the plugin into your local Maven repository (~/.m2):

cd cuba-gradle-plugin
gradlew install

After that, go to the CUBA directory and build and install it with the same command:

cd ../cuba
gradlew install

Using Snapshot Version

Edit the build.gradle file of your project. Change the ext.cubaVersion property and add mavenLocal() to the repositories section, for example:

buildscript {
    ext.cubaVersion = '7.3-SNAPSHOT'
    repositories {
        mavenLocal()
        maven { ...

That's all. Now you can build and deploy your application based on the snapshot version of the platform from your local repository:

gradlew deploy

Third-party dependencies

The platform uses a number of forked third-party libraries. They can be found in the following source code repositories:

All dependencies are also located in our artifacts repository, so you don't have to build them from sources in order to build and use the platform.

cuba's People

Contributors

alexander-shustanov avatar alexbudarov avatar andreysubbotin avatar comru avatar daring2 avatar daxzel avatar dkz avatar dmtr-abramov avatar dtaimanov avatar flaurite avatar gasloff avatar genapavlov avatar gglcrash avatar glebfox avatar gorbunkov avatar ikuchmin avatar ilyachekashkin avatar jreznot avatar knstvk avatar linkinek avatar mariodavid avatar nikitashchienko avatar plakhov avatar pribavkindenis avatar sergey-sw avatar shakhovv avatar soraksh avatar sukhova avatar tinhol avatar web-devel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cuba's Issues

Previous user logins in log on scheduler execution

Имя предыдущего пользователя в журнале при логине системных пользователей для назначенных заданий

2014-04-18 10:21:42,566 INFO  [com.haulmont.cuba.security.app.LoginWorkerBean] [app-core] [event-engine] Logged in: c229bb4c-fbc2-bd39-a984-b713ac68bdbb [controllers-cache]
2014-04-18 10:21:42,571 INFO  [com.haulmont.cuba.security.app.LoginWorkerBean] [app-core] [taxi-system] Logged in: 586f2dce-34ef-4445-2350-a7b665c3a11f [RanksMonitorScheduler]
...
2014-04-18 10:22:00,341 INFO  [com.haulmont.cuba.security.app.LoginWorkerBean] [app-core] [RanksMonitorScheduler] Logged in: 156e1538-a000-c71d-8fcc-69f78003b146 [emailer]

Это все системные пользователи, под которыми работают scheduled tasks.

Выглядит странно. Видимо, там в момент логина в потоке присутствует контекст другого системного пользователя.


Original issue: https://youtrack.haulmont.com/issue/PL-3808

Rework FileUploadField API

Старый API был сделан как обертка вокруг ваадиновского компонента и сейчас, после изменения архитектуры CUBA-приложений, устарел. Закачка файлов на средний слой стала двухступенчатой и требует написания громоздкого кода в контроллере экрана.

Варианты использования FileUploadField
(возможно, есть и другие)

  1. Закачать файл на клиентский слой, обработать его прямо на клиентском слое (в контроллере экрана) и удалить.
    Пример: редактор отчетов

  2. Закачать файл на средний слой, обработать его в соответствии с какой-то бизнес-логикой и опять же удалить. Не сохранять его на постоянку в file storage.
    Примеры:

  • импорт данных из excel. Файл закачивается через форму, и вызывается какой-то сервис, который открывает файл через HSSF и импортирует данные. Файл после окончания импорта не нужен.
  • импорт отчетов.
  1. Закачать файл в file storage для постоянного хранения. Связанный с ним FileDescriptor связать с моделью данных проекта и сохранить в БД (возможно, по коммиту экрана).
    Пример: закачка всяких документов и картинок через CUBA-экраны для хранения и последующего просмотра / скачивания.

Возможности, которые должен предоставлять FileUploadField (мое ИМХО):

  • Встроенный показ прогресса, из коробки, без необходимости писать контроллере background tasks.
    -- отключаемый (пока что для веб-UI бесполезно)
    -- с возможностью отмены закачки

  • Встроенные нотификации пользователю в случае ошибок, как минимум:
    -- file is too big,
    -- ошибка закачки на клиент,
    -- ошибка закачки на сервер,
    -- закачка отменена пользователем

  • Для use-cases № 2 и 3 - автоматический и прозрачный аплоад на сервер, чтобы после завершения аплоада возвращался готовый FileDescriptor, который можно либо открывать как поток на среднем слое, либо сохранять в БД. Для этих вариантов использования какие-то промежуточные действия, оповещения на UI-слое не нужны.

  • Для use-case № 3 - интеграция с datasources

  • (Минорное) Возможность задавать лимит по объему для каждого поля отдельно

  • В далекой перспективе - показ прогресса и для web-закачки (может когда позволит HTML 5).


Original issue: https://youtrack.haulmont.com/issue/PL-1756

False positive log message for Table Column "changing editable in runtime not supported"

12:54:44,725 WARN [Table] Changing editable for column in runtime is not supported

В такси в редакторе тарифов это используется.
И работает без глюков - наверное последующими вызовами сбрасывается кэш ячеек или что-то в этом роде.


Original issue: https://youtrack.haulmont.com/issue/PL-3616

Desktop client network activity monitoring tool

Сейчас очень легко писать плохой код, который тормозит на десктоп клиенте. Отслеживать всех разработчиков нереально. Поэтому нужен инструмент для обнаружения потенциальных проблем с производительностью уже на продакшене.

  1. Слишком частые запросы с клиента на сервер - задержки UI.
    Подсчитывать запросы, сделанные с десктоп клиента на сервер из Event Dispatch Thread. Если за последние (M = 5) секунд было сделано больше чем (N = 15) запросов, писать предупреждение в журнал с указанием хотя бы последнего имени сервиса.

  2. С сервера на клиент гоняется слишком много данных (раздутые вьюхи, непроставленные где-то max results у датасорсов, разработчик не рассчитал объем данных на реальной системе).

Проверять все запросы на объем запроса и ответа, в байтах. Если он превышает (K = 500 Кб), писать предупреждение в журнал с указанием имени сервиса.

Такой мониторинг помог бы легче анализировать жалобы вида "десктоп клиент тормозит".


Original issue: https://youtrack.haulmont.com/issue/PL-2232

Support for Spring environment profiles

Sometimes it's necessary to instantiate different spring beans in depend on environment.
Spring has special mechanism for such cases. You can either declare profile dependent configuration in xml:

<beans profile="dev">
   ...
</beans>

<beans profile="production">
   ...
</beans>

or use Annotation:

@Profile

For further info see http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/

The following code adds profiles support. Active profile(s) could be declared via application property spring.profiles.active

    protected void initAppContext() {
        String configProperty = AppContext.getProperty(SPRING_CONTEXT_CONFIG);
        if (org.apache.commons.lang.StringUtils.isBlank(configProperty)) {
            throw new IllegalStateException("Missing " + SPRING_CONTEXT_CONFIG + " application property");
        }

        StrTokenizer tokenizer = new StrTokenizer(configProperty);
        String[] locations = tokenizer.getTokenArray();
        String[] environmentProfiles = StringUtils.commaDelimitedListToStringArray(
                AppContext.getProperty(AbstractEnvironment.ACTIVE_PROFILES_PROPERTY_NAME));

        ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext();
        appContext.setConfigLocations(locations);
        if (ArrayUtils.isNotEmpty(environmentProfiles)) {
            appContext.getEnvironment().setActiveProfiles(environmentProfiles);
        }
        appContext.afterPropertiesSet();

        AppContext.setApplicationContext(appContext);
    }

Original issue: https://youtrack.haulmont.com/issue/PL-2216

Components bound to datasource with compound property path do not receive value updates

Consider this micro-patch to refapp 5.1.

There are two fields for country now in the driver editor.

When you change value in the first field, second gets updated.
When you change second one - first does not receive value update.

That is, if you have
field.setDatasource(ds, "address.country")

If country changes - field does not receive an update.
If address changes - field does not receive an update.
Only if item in ds changes - then field receives an update.

This is a big API problem for developers.
After some experience with datasources, everyone strongly believes that datasources do always work.
In this property path case only half of functionality works, and half - does not.

This leads to most developers not being able to understand why field does not receive updates, without external advice.


Original issue: https://youtrack.haulmont.com/issue/PL-4075

Simultaneous firing of two events by user causes problems

look at attached refapp patch.

Open desktop client.
Go to color browser.
Select any color.
Go to text field and enter something there.
Then, without changing focus, press "Create".

In 50% of cases (not stable) two dialogs get opened.

This is because two events are fired subsequently:

  • text field value changed
  • button clicked

Logic implies that when value change listener opens a modal dialog, subsequent button click should be aborted. But it is not always the case.

There can be other use cases:
E.g. inputting an invalid string value into integer-typed text field and pressing OK in editor.
Intuitively, pressing OK should be aborted when validation error occurs.

The problem is pretty actual because real-world users often tend to act this way: change a field value and immediately press OK / Confirm / ... button, without pressing tab / enter or otherwise changing focused component.

🔗 Related links: {"relates to:": "https://youtrack.haulmont.com/issue/PL-1000"}


Original issue: https://youtrack.haulmont.com/issue/PL-3902

В window.xsd у filterComponent, дети следуют в определеном порядке

При открытие экрана в studio дети у фильтра сортируются по алфавиту.

window.xsd

<xs:complexType name="filterComponent">
        <xs:sequence>
            <xs:element name="properties" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                    <xs:attribute name="include" type="xs:string" use="required"/>
                    <xs:attribute name="exclude" type="xs:string"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="property" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="name" type="xs:string" use="required"/>
                    <xs:attribute name="caption" type="xs:string"/>
                    <xs:attribute name="paramWhere" type="xs:string"/>
                    <xs:attribute name="paramView" type="xs:string"/>
                </xs:complexType>
            </xs:element>
            <xs:element name="custom" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType mixed="true">
                    <xs:attribute name="name" type="xs:string" use="required"/>
                    <xs:attribute name="caption" type="xs:string"/>
                    <xs:attribute name="paramClass" type="xs:string"/>
                    <xs:attribute name="inExpr" type="xs:boolean"/>
                    <xs:attribute name="join" type="xs:string"/>
                    <xs:attribute name="paramWhere" type="xs:string"/>
                    <xs:attribute name="paramView" type="xs:string"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>

in project

<filter id="filter"
                datasource="newDs">
            <properties exclude="attr"
                        include=".*"/>
            <property caption="msg://FIlterPropertyCaption"
                      name="as"
                      paramView="_local"
                      paramWhere="Select"/>
            <property caption="msg://32"
                      name="createTs"
                      paramView="_minimal"
                      paramWhere="Where"/>
            <property caption="msg://DENY"
                      name="attrEmb"/>
            <custom name="a"
                    paramClass="java.lang.String"/>
            <custom name="c"
                    paramClass="java.lang.String"/>                        
        </filter>

after studio

<filter id="filter"
                datasource="newDs">
            <custom name="a"
                    paramClass="java.lang.String"/>
            <custom name="c"
                    paramClass="java.lang.String"/>
            <properties exclude="attr"
                        include=".*"/>
            <property caption="msg://FIlterPropertyCaption"
                      name="as"
                      paramView="_local"
                      paramWhere="Select"/>
            <property caption="msg://32"
                      name="createTs"
                      paramView="_minimal"
                      paramWhere="Where"/>
            <property caption="msg://DENY"
                      name="attrEmb"/>
        </filter>

Original issue: https://youtrack.haulmont.com/issue/PL-4356

Expand ratio for component

Now you can have only one component expanded to 100% in a container.
Vaadin supports expand ratio for each component separately.


Original issue: https://youtrack.haulmont.com/issue/PL-3780

Related issues:
Documentation: cuba-platform/documentation#179
Studio: STUDIO-4652

Changes

VBoxLayout and HBoxLayout supports expand ratio. For this created RatioLayout interface with following methods:

void setExpandRatio(Component component, float ratio);
float getExpandRatio(Component component);

Ratio must be greater than or equal to 0.

box.expandRatio attribute is added to the XML. It does not support validation and is absent in suggestion list in the IDE. Given attribute will work if an element is placed in vbox or hbox, because loader for these layouts checks each child for this attribute.

Usage example

<hbox width="500px" expand="button1" spacing="true">
    <button id="button1" caption="caption1" box.expandRatio="1"/>
    <button id="button2" caption="caption2" width="100%" box.expandRatio="3"/>
    <button id="button3" caption="caption3" width="100%" box.expandRatio="2"/>
</hbox>

OptionsGroup loses value which was not in option list

refapp 5.1 patch attached.

to reproduce:

  • create a driver group which has "active" = true
  • create a driver with this driver group
  • reopen driver for edit.

In web - option group looks ok.
In desktop - no option is selected.

buggy case:

  1. assign to DesktopOptionGroup a datasource with item and value in it
  2. assign an optionsDatasource which has no options
  3. refresh optionsDatasource to have the option

(not urgent, I have a workaround for it)


Original issue: https://youtrack.haulmont.com/issue/PL-4238

Cascade edit: use for reload nested entities merged view includes inner editor view and parent editor property view

Для работы вложенного редактора используется операция reload при открытии уже сохранённых данных. Для этой операции нужно использовать View учитывающее свойства из родительского редактора и из самого вложенного редактора. Конечное View будет объединением View свойства в родительском редакторе и View вложенного редактора.


Original issue: https://youtrack.haulmont.com/issue/PL-1917

Shortcuts API for Fields

Implement shortcut actions support for input fields: DateField, TextField, LookupField, etc.

Fire shortcut actions when a field is focused

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.