├── extra.gradle ├── modules ├── core │ ├── db │ │ ├── init │ │ │ └── hsql │ │ │ │ ├── 30.create-db.sql │ │ │ │ ├── 42.create-db.sql │ │ │ │ ├── 50.create-db.sql │ │ │ │ ├── 40.create-db.sql │ │ │ │ ├── 20.create-db.sql │ │ │ │ ├── 60.create-db.sql │ │ │ │ ├── 51.create-db.sql │ │ │ │ ├── 10.create-db.sql │ │ │ │ ├── 71.create-db.sql │ │ │ │ └── 41.create-db.sql │ │ └── update │ │ │ └── hsql │ │ │ └── 18 │ │ │ ├── 180403-2-updateProduct.sql │ │ │ ├── 180322-2-createOrder.sql │ │ │ ├── 180322-2-createAddress.sql │ │ │ ├── 180403-2-updateProduct01.sql │ │ │ ├── 180417-2-updateCustomer.sql │ │ │ ├── 180322-2-createDocument.sql │ │ │ ├── 180322-2-createLineItem.sql │ │ │ ├── 180322-1-createProduct.sql │ │ │ ├── 180417-1-createTenant.sql │ │ │ ├── 180403-1-createProductCategory.sql │ │ │ ├── 180322-1-createCustomer.sql │ │ │ ├── 180322-1-createOrder.sql │ │ │ ├── 180322-1-createDocument.sql │ │ │ ├── 180322-1-createAddress.sql │ │ │ └── 180322-1-createLineItem.sql │ ├── src │ │ └── com │ │ │ └── roadtocubaandbeyond │ │ │ └── ordermanagement │ │ │ ├── spring.xml │ │ │ ├── listener │ │ │ └── OrderIdCreator.java │ │ │ ├── service │ │ │ └── ReportLoadServiceBean.java │ │ │ ├── app.properties │ │ │ └── fts.xml │ ├── web │ │ ├── META-INF │ │ │ └── context.xml │ │ └── WEB-INF │ │ │ └── web.xml │ └── test │ │ └── com │ │ └── roadtocubaandbeyond │ │ └── ordermanagement │ │ ├── core │ │ └── SampleIntegrationTest.java │ │ └── RtcaboTestContainer.java ├── web │ ├── src │ │ └── com │ │ │ └── roadtocubaandbeyond │ │ │ └── ordermanagement │ │ │ ├── web │ │ │ ├── address │ │ │ │ ├── messages.properties │ │ │ │ ├── messages_de.properties │ │ │ │ ├── AddressEdit.java │ │ │ │ └── address-edit.xml │ │ │ ├── document │ │ │ │ ├── messages.properties │ │ │ │ ├── messages_de.properties │ │ │ │ ├── DocumentEdit.java │ │ │ │ └── document-edit.xml │ │ │ ├── lineitem │ │ │ │ ├── messages.properties │ │ │ │ ├── messages_de.properties │ │ │ │ ├── LineItemEdit.java │ │ │ │ └── line-item-edit.xml │ │ │ ├── product │ │ │ │ ├── messages.properties │ │ │ │ ├── messages_de.properties │ │ │ │ ├── ProductBrowse.java │ │ │ │ ├── ProductEdit.java │ │ │ │ ├── product-edit.xml │ │ │ │ └── product-browse.xml │ │ │ ├── tenant │ │ │ │ ├── messages.properties │ │ │ │ ├── TenantBrowse.java │ │ │ │ ├── TenantEdit.java │ │ │ │ ├── tenant-edit.xml │ │ │ │ └── tenant-browse.xml │ │ │ ├── productcategory │ │ │ │ ├── messages.properties │ │ │ │ ├── ProductCategoryBrowse.java │ │ │ │ ├── ProductCategoryEdit.java │ │ │ │ ├── product-category-edit.xml │ │ │ │ └── product-category-browse.xml │ │ │ ├── customer │ │ │ │ ├── messages.properties │ │ │ │ ├── messages_de.properties │ │ │ │ ├── CustomerBrowse.java │ │ │ │ ├── CustomerEdit.java │ │ │ │ ├── customer-browse.xml │ │ │ │ └── customer-edit.xml │ │ │ ├── order │ │ │ │ ├── messages.properties │ │ │ │ ├── messages_de.properties │ │ │ │ ├── OrderBrowse.java │ │ │ │ ├── order-browse.xml │ │ │ │ ├── OrderEdit.java │ │ │ │ └── order-edit.xml │ │ │ ├── messages_de.properties │ │ │ └── messages.properties │ │ │ ├── web-dispatcher-spring.xml │ │ │ ├── web-permissions.xml │ │ │ ├── web-menu.xml │ │ │ ├── web-spring.xml │ │ │ ├── web-app.properties │ │ │ └── web-screens.xml │ ├── web │ │ ├── META-INF │ │ │ └── context.xml │ │ └── WEB-INF │ │ │ └── web.xml │ └── test │ │ ├── features │ │ └── login.feature │ │ └── com │ │ └── roadtocubaandbeyond │ │ └── ordermanagement │ │ └── web │ │ ├── CucumberRunner.java │ │ ├── service │ │ └── UserService.java │ │ ├── steps │ │ └── LoginSteps.java │ │ └── screens │ │ └── LoginWindow.java ├── gui │ └── src │ │ └── com │ │ └── roadtocubaandbeyond │ │ └── ordermanagement │ │ └── screens.xml └── global │ └── src │ └── com │ └── roadtocubaandbeyond │ └── ordermanagement │ ├── metadata.xml │ ├── service │ └── ReportLoadService.java │ ├── entity │ ├── DocumentType.java │ ├── messages_de.properties │ ├── ProductCategory.java │ ├── Tenant.java │ ├── messages.properties │ ├── StandardTenantEntity.java │ ├── Product.java │ ├── Address.java │ ├── Document.java │ ├── LineItem.java │ ├── Customer.java │ └── Order.java │ ├── persistence.xml │ └── views.xml ├── img ├── domain-model.png └── domain-model.yuml ├── reports └── Order Invoice.zip ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── .idea ├── vcs.xml ├── encodings.xml ├── misc.xml ├── gradle.xml ├── cuba-project.xml └── workspace.xml ├── .travis.yml ├── studio-intellij.xml ├── studio-settings.xml ├── settings.gradle ├── README.md ├── gradlew.bat └── gradlew /extra.gradle: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /modules/core/db/init/hsql/30.create-db.sql: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /img/domain-model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariodavid/rtcab-ordermanagement/HEAD/img/domain-model.png -------------------------------------------------------------------------------- /reports/Order Invoice.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariodavid/rtcab-ordermanagement/HEAD/reports/Order Invoice.zip -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/address/messages.properties: -------------------------------------------------------------------------------- 1 | editorCaption = Address editor 2 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180403-2-updateProduct.sql: -------------------------------------------------------------------------------- 1 | alter table RTCABO_PRODUCT add column CATEGORY_ID varchar(36) ; 2 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/document/messages.properties: -------------------------------------------------------------------------------- 1 | editorCaption = Document editor 2 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/lineitem/messages.properties: -------------------------------------------------------------------------------- 1 | editorCaption = LineItem editor 2 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/address/messages_de.properties: -------------------------------------------------------------------------------- 1 | editorCaption = Adresse bearbeiten 2 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/document/messages_de.properties: -------------------------------------------------------------------------------- 1 | editorCaption = Dokument bearbeiten 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mariodavid/rtcab-ordermanagement/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/lineitem/messages_de.properties: -------------------------------------------------------------------------------- 1 | editorCaption = Bestellposition bearbeiten 2 | -------------------------------------------------------------------------------- /img/domain-model.yuml: -------------------------------------------------------------------------------- 1 | [Customer]<>-->[Order] 2 | [Order]-[note: Aggregate Root{bg:cornsilk}] 3 | [Order]<>-->[LineItem] 4 | [LineItem]-->[Product] -------------------------------------------------------------------------------- /modules/web/web/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/product/messages.properties: -------------------------------------------------------------------------------- 1 | browseCaption = Product browser 2 | editorCaption = Product editor 3 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/product/messages_de.properties: -------------------------------------------------------------------------------- 1 | browseCaption = Produkte 2 | editorCaption = Produkt bearbeiten 3 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/tenant/messages.properties: -------------------------------------------------------------------------------- 1 | browseCaption = Tenant browser 2 | editorCaption = Tenant editor 3 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/productcategory/messages.properties: -------------------------------------------------------------------------------- 1 | browseCaption = ProductCategory browser 2 | editorCaption = ProductCategory editor 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .studio 3 | *.ipr 4 | *.iml 5 | *.iws 6 | build/* 7 | deploy/* 8 | modules/*/build/* 9 | out 10 | test-run 11 | 12 | .DS_Store 13 | modules/*/test-home/* -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/gui/src/com/roadtocubaandbeyond/ordermanagement/screens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web-dispatcher-spring.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/customer/messages.properties: -------------------------------------------------------------------------------- 1 | browseCaption = Customer browser 2 | editorCaption = Customer editor 3 | customerData=Customer data 4 | orders=Orders 5 | addresses=Addresses 6 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/order/messages.properties: -------------------------------------------------------------------------------- 1 | browseCaption = Order browser 2 | editorCaption = Order editor 3 | dataTab=Order Data 4 | documents=Documents 5 | generateInvoice=Generate Invoice 6 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web-permissions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/customer/messages_de.properties: -------------------------------------------------------------------------------- 1 | browseCaption = Kunden 2 | editorCaption = Kunde bearbeiten 3 | customerData= Kundeninformationen 4 | orders= Bestellungen 5 | addresses= Adressen 6 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/order/messages_de.properties: -------------------------------------------------------------------------------- 1 | browseCaption = Bestellungen 2 | editorCaption = Bestellung bearbeiten 3 | dataTab= Bestelldaten 4 | documents= Dokumente 5 | generateInvoice= Rechnung erzeugen 6 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180322-2-createOrder.sql: -------------------------------------------------------------------------------- 1 | alter table RTCABO_ORDER add constraint FK_RTCABO_ORDER_CUSTOMER foreign key (CUSTOMER_ID) references RTCABO_CUSTOMER(ID); 2 | create index IDX_RTCABO_ORDER_CUSTOMER on RTCABO_ORDER (CUSTOMER_ID); 3 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: groovy 2 | jdk: 3 | - oraclejdk8 4 | cache: 5 | directories: 6 | - $HOME/.gradle/caches/ 7 | - $HOME/.gradle/wrapper/ 8 | 9 | before_install: 10 | - chmod +x ./gradlew 11 | 12 | script: 13 | - ./gradlew assemble 14 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180322-2-createAddress.sql: -------------------------------------------------------------------------------- 1 | alter table RTCABO_ADDRESS add constraint FK_RTCABO_ADDRESS_CUSTOMER foreign key (CUSTOMER_ID) references RTCABO_CUSTOMER(ID); 2 | create index IDX_RTCABO_ADDRESS_CUSTOMER on RTCABO_ADDRESS (CUSTOMER_ID); 3 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/order/OrderBrowse.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.order; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractLookup; 4 | 5 | public class OrderBrowse extends AbstractLookup { 6 | } -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180403-2-updateProduct01.sql: -------------------------------------------------------------------------------- 1 | alter table RTCABO_PRODUCT add constraint FK_RTCABO_PRODUCT_CATEGORY foreign key (CATEGORY_ID) references RTCABO_PRODUCT_CATEGORY(ID); 2 | create index IDX_RTCABO_PRODUCT_CATEGORY on RTCABO_PRODUCT (CATEGORY_ID); 3 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/product/ProductBrowse.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.product; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractLookup; 4 | 5 | public class ProductBrowse extends AbstractLookup { 6 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/tenant/TenantBrowse.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.tenant; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractLookup; 4 | 5 | public class TenantBrowse extends AbstractLookup { 6 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/customer/CustomerBrowse.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.customer; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractLookup; 4 | 5 | public class CustomerBrowse extends AbstractLookup { 6 | } -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180417-2-updateCustomer.sql: -------------------------------------------------------------------------------- 1 | alter table RTCABO_CUSTOMER add column TENANT_ID varchar(36) ^ 2 | update RTCABO_CUSTOMER set TENANT_ID = '00000000-0000-0000-0000-000000000000' where TENANT_ID is null ; 3 | alter table RTCABO_CUSTOMER alter column TENANT_ID set not null ; 4 | -------------------------------------------------------------------------------- /modules/web/test/features/login.feature: -------------------------------------------------------------------------------- 1 | Feature: Login 2 | 3 | Scenario: An existing user can login into the system 4 | Given there is a user "admin" in the system 5 | When I log in as the user "admin" with password "admin" 6 | Then I am logged in and can navigate through the application 7 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/productcategory/ProductCategoryBrowse.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.productcategory; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractLookup; 4 | 5 | public class ProductCategoryBrowse extends AbstractLookup { 6 | } -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/tenant/TenantEdit.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.tenant; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractEditor; 4 | import com.roadtocubaandbeyond.ordermanagement.entity.Tenant; 5 | 6 | public class TenantEdit extends AbstractEditor { 7 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/address/AddressEdit.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.address; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractEditor; 4 | import com.roadtocubaandbeyond.ordermanagement.entity.Address; 5 | 6 | public class AddressEdit extends AbstractEditor
{ 7 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/product/ProductEdit.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.product; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractEditor; 4 | import com.roadtocubaandbeyond.ordermanagement.entity.Product; 5 | 6 | public class ProductEdit extends AbstractEditor { 7 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/customer/CustomerEdit.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.customer; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractEditor; 4 | import com.roadtocubaandbeyond.ordermanagement.entity.Customer; 5 | 6 | public class CustomerEdit extends AbstractEditor { 7 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/document/DocumentEdit.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.document; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractEditor; 4 | import com.roadtocubaandbeyond.ordermanagement.entity.Document; 5 | 6 | public class DocumentEdit extends AbstractEditor { 7 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/lineitem/LineItemEdit.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.lineitem; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractEditor; 4 | import com.roadtocubaandbeyond.ordermanagement.entity.LineItem; 5 | 6 | public class LineItemEdit extends AbstractEditor { 7 | } -------------------------------------------------------------------------------- /studio-intellij.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/service/ReportLoadService.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.service; 2 | 3 | 4 | import com.haulmont.reports.entity.Report; 5 | 6 | public interface ReportLoadService { 7 | String NAME = "rtcabo_ReportLoadService"; 8 | 9 | Report loadReportBySystemcode(String systemCode); 10 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/productcategory/ProductCategoryEdit.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.productcategory; 2 | 3 | import com.haulmont.cuba.gui.components.AbstractEditor; 4 | import com.roadtocubaandbeyond.ordermanagement.entity.ProductCategory; 5 | 6 | public class ProductCategoryEdit extends AbstractEditor { 7 | } -------------------------------------------------------------------------------- /modules/core/src/com/roadtocubaandbeyond/ordermanagement/spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180322-2-createDocument.sql: -------------------------------------------------------------------------------- 1 | alter table RTCABO_DOCUMENT add constraint FK_RTCABO_DOCUMENT_FILE foreign key (FILE_ID) references SYS_FILE(ID); 2 | alter table RTCABO_DOCUMENT add constraint FK_RTCABO_DOCUMENT_ORDER foreign key (ORDER_ID) references RTCABO_ORDER(ID); 3 | create index IDX_RTCABO_DOCUMENT_FILE on RTCABO_DOCUMENT (FILE_ID); 4 | create index IDX_RTCABO_DOCUMENT_ORDER on RTCABO_DOCUMENT (ORDER_ID); 5 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180322-2-createLineItem.sql: -------------------------------------------------------------------------------- 1 | alter table RTCABO_LINE_ITEM add constraint FK_RTCABO_LINE_ITEM_PRODUCT foreign key (PRODUCT_ID) references RTCABO_PRODUCT(ID); 2 | alter table RTCABO_LINE_ITEM add constraint FK_RTCABO_LINE_ITEM_ORDER foreign key (ORDER_ID) references RTCABO_ORDER(ID); 3 | create index IDX_RTCABO_LINE_ITEM_PRODUCT on RTCABO_LINE_ITEM (PRODUCT_ID); 4 | create index IDX_RTCABO_LINE_ITEM_ORDER on RTCABO_LINE_ITEM (ORDER_ID); 5 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180322-1-createProduct.sql: -------------------------------------------------------------------------------- 1 | create table RTCABO_PRODUCT ( 2 | ID varchar(36) not null, 3 | VERSION integer not null, 4 | CREATE_TS timestamp, 5 | CREATED_BY varchar(50), 6 | UPDATE_TS timestamp, 7 | UPDATED_BY varchar(50), 8 | DELETE_TS timestamp, 9 | DELETED_BY varchar(50), 10 | -- 11 | NAME varchar(255) not null, 12 | CODE varchar(255), 13 | -- 14 | primary key (ID) 15 | ); 16 | -------------------------------------------------------------------------------- /studio-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 8 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180417-1-createTenant.sql: -------------------------------------------------------------------------------- 1 | create table RTCABO_TENANT ( 2 | ID varchar(36) not null, 3 | VERSION integer not null, 4 | CREATE_TS timestamp, 5 | CREATED_BY varchar(50), 6 | UPDATE_TS timestamp, 7 | UPDATED_BY varchar(50), 8 | DELETE_TS timestamp, 9 | DELETED_BY varchar(50), 10 | -- 11 | NAME varchar(255) not null, 12 | CODE varchar(255) not null, 13 | -- 14 | primary key (ID) 15 | ); 16 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180403-1-createProductCategory.sql: -------------------------------------------------------------------------------- 1 | create table RTCABO_PRODUCT_CATEGORY ( 2 | ID varchar(36) not null, 3 | VERSION integer not null, 4 | CREATE_TS timestamp, 5 | CREATED_BY varchar(50), 6 | UPDATE_TS timestamp, 7 | UPDATED_BY varchar(50), 8 | DELETE_TS timestamp, 9 | DELETED_BY varchar(50), 10 | -- 11 | NAME varchar(255) not null, 12 | CODE varchar(255), 13 | -- 14 | primary key (ID) 15 | ); 16 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180322-1-createCustomer.sql: -------------------------------------------------------------------------------- 1 | create table RTCABO_CUSTOMER ( 2 | ID varchar(36) not null, 3 | VERSION integer not null, 4 | CREATE_TS timestamp, 5 | CREATED_BY varchar(50), 6 | UPDATE_TS timestamp, 7 | UPDATED_BY varchar(50), 8 | DELETE_TS timestamp, 9 | DELETED_BY varchar(50), 10 | -- 11 | NAME varchar(255) not null, 12 | FIRST_NAME varchar(255), 13 | BIRTHDAY date not null, 14 | -- 15 | primary key (ID) 16 | ); 17 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/messages_de.properties: -------------------------------------------------------------------------------- 1 | application.caption = CUBA Application 2 | application.logoImage = branding/app-icon-menu.png 3 | 4 | loginWindow.caption = CUBA Login 5 | loginWindow.welcomeLabel = Willkommen bei CUBA! 6 | loginWindow.logoImage = branding/app-icon-login.png 7 | 8 | menu-config.application-rtcabo = Anwendung 9 | menu-config.rtcabo$Customer.browse = Kunden 10 | menu-config.rtcabo$Product.browse = Produkte 11 | menu-config.rtcabo$Order.browse = Bestellungen 12 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180322-1-createOrder.sql: -------------------------------------------------------------------------------- 1 | create table RTCABO_ORDER ( 2 | ID varchar(36) not null, 3 | VERSION integer not null, 4 | CREATE_TS timestamp, 5 | CREATED_BY varchar(50), 6 | UPDATE_TS timestamp, 7 | UPDATED_BY varchar(50), 8 | DELETE_TS timestamp, 9 | DELETED_BY varchar(50), 10 | -- 11 | CUSTOMER_ID varchar(36) not null, 12 | ORDER_ID varchar(255), 13 | ORDER_DATE date not null, 14 | DELIVERY_DATE date not null, 15 | -- 16 | primary key (ID) 17 | ); 18 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'rtcab-ordermanagement' 2 | def modulePrefix = 'app' 3 | include(":${modulePrefix}-global", ":${modulePrefix}-core", ":${modulePrefix}-gui", ":${modulePrefix}-web") 4 | project(":${modulePrefix}-global").projectDir = new File(settingsDir, 'modules/global') 5 | project(":${modulePrefix}-core").projectDir = new File(settingsDir, 'modules/core') 6 | project(":${modulePrefix}-gui").projectDir = new File(settingsDir, 'modules/gui') 7 | project(":${modulePrefix}-web").projectDir = new File(settingsDir, 'modules/web') -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180322-1-createDocument.sql: -------------------------------------------------------------------------------- 1 | create table RTCABO_DOCUMENT ( 2 | ID varchar(36) not null, 3 | VERSION integer not null, 4 | CREATE_TS timestamp, 5 | CREATED_BY varchar(50), 6 | UPDATE_TS timestamp, 7 | UPDATED_BY varchar(50), 8 | DELETE_TS timestamp, 9 | DELETED_BY varchar(50), 10 | -- 11 | NAME varchar(255) not null, 12 | FILE_ID varchar(36) not null, 13 | TYPE_ varchar(50), 14 | ORDER_ID varchar(36) not null, 15 | -- 16 | primary key (ID) 17 | ); 18 | -------------------------------------------------------------------------------- /modules/web/test/com/roadtocubaandbeyond/ordermanagement/web/CucumberRunner.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web; 2 | 3 | import org.junit.runner.RunWith; 4 | import cucumber.api.CucumberOptions; 5 | import cucumber.api.junit.Cucumber; 6 | 7 | @RunWith(Cucumber.class) 8 | @CucumberOptions( 9 | features = "classpath:features", 10 | glue = "com.roadtocubaandbeyond.ordermanagement.web.steps", 11 | plugin = {"pretty"}, 12 | tags = {"not @Ignore"} 13 | ) 14 | public class CucumberRunner { 15 | 16 | } -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180322-1-createAddress.sql: -------------------------------------------------------------------------------- 1 | create table RTCABO_ADDRESS ( 2 | ID varchar(36) not null, 3 | VERSION integer not null, 4 | CREATE_TS timestamp, 5 | CREATED_BY varchar(50), 6 | UPDATE_TS timestamp, 7 | UPDATED_BY varchar(50), 8 | DELETE_TS timestamp, 9 | DELETED_BY varchar(50), 10 | -- 11 | STREET varchar(255) not null, 12 | POST_CODE varchar(255) not null, 13 | CITY varchar(255) not null, 14 | CUSTOMER_ID varchar(36) not null, 15 | -- 16 | primary key (ID) 17 | ); 18 | -------------------------------------------------------------------------------- /modules/core/db/update/hsql/18/180322-1-createLineItem.sql: -------------------------------------------------------------------------------- 1 | create table RTCABO_LINE_ITEM ( 2 | ID varchar(36) not null, 3 | VERSION integer not null, 4 | CREATE_TS timestamp, 5 | CREATED_BY varchar(50), 6 | UPDATE_TS timestamp, 7 | UPDATED_BY varchar(50), 8 | DELETE_TS timestamp, 9 | DELETED_BY varchar(50), 10 | -- 11 | PRODUCT_ID varchar(36) not null, 12 | PRICE decimal(19, 2) not null, 13 | QUANTITY integer not null, 14 | ORDER_ID varchar(36) not null, 15 | -- 16 | primary key (ID) 17 | ); 18 | -------------------------------------------------------------------------------- /modules/core/web/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web-menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /modules/web/test/com/roadtocubaandbeyond/ordermanagement/web/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.service; 2 | 3 | import com.haulmont.cuba.security.entity.User; 4 | import okhttp3.ResponseBody; 5 | import retrofit2.Call; 6 | import retrofit2.http.Body; 7 | import retrofit2.http.GET; 8 | import retrofit2.http.POST; 9 | 10 | import java.util.List; 11 | 12 | public interface UserService { 13 | @GET("entities/sec$User") 14 | Call> all(); 15 | 16 | @POST("entities/sec$User") 17 | Call create(@Body User user); 18 | } -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 13 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/messages.properties: -------------------------------------------------------------------------------- 1 | application.caption = CUBA Application 2 | application.logoImage = branding/app-icon-menu.png 3 | 4 | loginWindow.caption = CUBA Login 5 | loginWindow.welcomeLabel = Welcome to CUBA! 6 | loginWindow.logoImage = branding/app-icon-login.png 7 | 8 | menu-config.application-rtcabo = Application 9 | menu-config.rtcabo$Customer.browse = Customers 10 | menu-config.rtcabo$Product.browse = Products 11 | menu-config.rtcabo$Order.browse = Orders 12 | menu-config.rtcabo$ProductCategory.browse = Product Categories 13 | menu-config.rtcabo$Tenant.browse = Tenants 14 | -------------------------------------------------------------------------------- /modules/core/src/com/roadtocubaandbeyond/ordermanagement/listener/OrderIdCreator.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.listener; 2 | 3 | import com.haulmont.cuba.core.app.UniqueNumbersAPI; 4 | import org.springframework.stereotype.Component; 5 | import com.haulmont.cuba.core.listener.BeforeInsertEntityListener; 6 | import com.haulmont.cuba.core.EntityManager; 7 | import com.roadtocubaandbeyond.ordermanagement.entity.Order; 8 | 9 | import javax.inject.Inject; 10 | 11 | @Component("rtcabo_OrderIdCreator") 12 | public class OrderIdCreator implements BeforeInsertEntityListener { 13 | 14 | @Inject 15 | protected UniqueNumbersAPI uniqueNumbersAPI; 16 | 17 | @Override 18 | public void onBeforeInsert(Order entity, EntityManager entityManager) { 19 | 20 | 21 | entity.setOrderId("" + uniqueNumbersAPI.getNextNumber("orderId")); 22 | } 23 | 24 | 25 | } -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/entity/DocumentType.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.entity; 2 | 3 | import com.haulmont.chile.core.datatypes.impl.EnumClass; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | 8 | public enum DocumentType implements EnumClass { 9 | 10 | INVOICE("INVOICE"), 11 | SHIPMENT_NOTE("SHIPMENT_NOTE"), 12 | REMINDER("REMINDER"); 13 | 14 | private String id; 15 | 16 | DocumentType(String value) { 17 | this.id = value; 18 | } 19 | 20 | public String getId() { 21 | return id; 22 | } 23 | 24 | @Nullable 25 | public static DocumentType fromId(String id) { 26 | for (DocumentType at : DocumentType.values()) { 27 | if (at.getId().equals(id)) { 28 | return at; 29 | } 30 | } 31 | return null; 32 | } 33 | } -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 23 | -------------------------------------------------------------------------------- /modules/core/db/init/hsql/42.create-db.sql: -------------------------------------------------------------------------------- 1 | 2 | -- Users 3 | insert into SEC_USER 4 | (ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, LOGIN, LOGIN_LC, PASSWORD, NAME, FIRST_NAME, LAST_NAME, MIDDLE_NAME, POSITION_, EMAIL, LANGUAGE_, TIME_ZONE, TIME_ZONE_AUTO, ACTIVE, CHANGE_PASSWORD_AT_LOGON, GROUP_ID, IP_MASK) 5 | values ('ae9f257a-c287-d9b8-90c7-110fbe9b09a7', 1, '2018-04-03 13:12:05', 'admin', '2018-04-03 13:12:05', null, null, null, 'jesse', 'jesse', '84943970a2df8c80b7d98ae39adab1c295dd9234', 'Jesse ', 'Jesse', null, null, null, null, 'en', null, null, true, false, '0fa2b1a5-1d68-4d69-9fbd-dff348347f93', null); 6 | 7 | 8 | -- UserRoles 9 | insert into SEC_USER_ROLE 10 | (ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, USER_ID, ROLE_ID) 11 | values ('d932d5a6-512a-cc4b-3468-45813d5cda1c', 1, '2018-04-03 13:12:05', 'admin', '2018-04-03 13:12:05', null, null, null, 'ae9f257a-c287-d9b8-90c7-110fbe9b09a7', '2aa8f801-492b-7a61-60c0-2d013e799450'); 12 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 10 | 11 | 12 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/entity/messages_de.properties: -------------------------------------------------------------------------------- 1 | Customer.birthday = Geburtsdatum 2 | Customer.name = Name 3 | Customer.firstName = Vorname 4 | Customer = Kunde 5 | Customer.addresses = Adressen 6 | Customer.orders = Bestellungen 7 | Address.city = Ort 8 | Address.street = Straße 9 | Address.postCode = PLZ 10 | Address = Adresse 11 | Address.customer = Kunde 12 | Product.code = Code 13 | Product.name = Name 14 | Product = Produkt 15 | LineItem.price = Preis 16 | LineItem.quantity = Anzahl 17 | LineItem.product = Produkt 18 | LineItem = Bestellposition 19 | LineItem.order = Bestellung 20 | Order.orderDate = Bestelldatum 21 | Order.deliveryDate = Lieferdatum 22 | Order.orderId = Bestellnummer 23 | Order.customer = Kunde 24 | Order.lineItems = Bestellpositionen 25 | Order = Bestellung 26 | Order.documents = Dokumente 27 | Document.file = Datei 28 | Document.name = Name 29 | Document = Dokument 30 | Document.type = Typ 31 | Document.order = Bestellung 32 | DocumentType.INVOICE = Rechnung 33 | DocumentType.SHIPMENT_NOTE = Lieferschein 34 | DocumentType.REMINDER = Mahnung 35 | -------------------------------------------------------------------------------- /modules/core/src/com/roadtocubaandbeyond/ordermanagement/service/ReportLoadServiceBean.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.service; 2 | 3 | import com.haulmont.cuba.core.global.DataManager; 4 | import com.haulmont.cuba.core.global.LoadContext; 5 | import com.haulmont.reports.entity.Report; 6 | import org.springframework.stereotype.Service; 7 | 8 | import javax.inject.Inject; 9 | import java.util.List; 10 | 11 | @Service(ReportLoadService.NAME) 12 | public class ReportLoadServiceBean implements ReportLoadService { 13 | 14 | 15 | @Inject 16 | protected DataManager dataManager; 17 | 18 | @Override 19 | public Report loadReportBySystemcode(String systemCode) { 20 | 21 | LoadContext loadContext = LoadContext.create(Report.class) 22 | .setQuery(LoadContext.createQuery("select e from report$Report e where e.code = :systemCode") 23 | .setParameter("systemCode", systemCode)) 24 | .setView("report.view"); 25 | List allReports = dataManager.loadList(loadContext); 26 | 27 | return allReports.get(0); 28 | } 29 | } -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | com.roadtocubaandbeyond.ordermanagement.entity.Customer 7 | com.roadtocubaandbeyond.ordermanagement.entity.Address 8 | com.roadtocubaandbeyond.ordermanagement.entity.Product 9 | com.roadtocubaandbeyond.ordermanagement.entity.LineItem 10 | com.roadtocubaandbeyond.ordermanagement.entity.Order 11 | com.roadtocubaandbeyond.ordermanagement.entity.Document 12 | com.roadtocubaandbeyond.ordermanagement.entity.ProductCategory 13 | com.roadtocubaandbeyond.ordermanagement.entity.StandardTenantEntity 14 | com.roadtocubaandbeyond.ordermanagement.entity.Tenant 15 | 16 | 17 | -------------------------------------------------------------------------------- /modules/core/db/init/hsql/50.create-db.sql: -------------------------------------------------------------------------------- 1 | -- Product Categories 2 | insert into RTCABO_PRODUCT_CATEGORY 3 | (ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, NAME, CODE) 4 | values ('0e64cc13-739f-e917-0ad9-6409d18283ac', 1, '2018-04-03 13:04:38', 'admin', '2018-04-03 13:04:38', null, null, null, 'Leftorium', null); 5 | insert into RTCABO_PRODUCT_CATEGORY 6 | (ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, NAME, CODE) 7 | values ('eb9f23c1-da3a-e228-3df4-60c879a2b7fd', 1, '2018-04-03 13:04:47', 'admin', '2018-04-03 13:04:47', null, null, null, 'Food', null); 8 | insert into RTCABO_PRODUCT_CATEGORY 9 | (ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, NAME, CODE) 10 | values ('16e94cde-727c-54f5-3cd5-15a378234afc', 1, '2018-04-03 13:04:50', 'admin', '2018-04-03 13:04:50', null, null, null, 'Stuff', null); 11 | insert into RTCABO_PRODUCT_CATEGORY 12 | (ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, NAME, CODE) 13 | values ('cd8c67ed-bbd5-2fb6-a1d6-b4aa240a1422', 1, '2018-04-03 13:04:42', 'admin', '2018-04-03 13:04:42', null, null, null, 'Beer', null); -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/entity/ProductCategory.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.entity; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | import javax.persistence.Column; 6 | import javax.validation.constraints.NotNull; 7 | import com.haulmont.cuba.core.entity.StandardEntity; 8 | import com.haulmont.chile.core.annotations.NamePattern; 9 | 10 | @NamePattern("%s|name") 11 | @Table(name = "RTCABO_PRODUCT_CATEGORY") 12 | @Entity(name = "rtcabo$ProductCategory") 13 | public class ProductCategory extends StandardEntity { 14 | private static final long serialVersionUID = 4930505662638424L; 15 | 16 | @NotNull 17 | @Column(name = "NAME", nullable = false) 18 | protected String name; 19 | 20 | @Column(name = "CODE") 21 | protected String code; 22 | 23 | public void setName(String name) { 24 | this.name = name; 25 | } 26 | 27 | public String getName() { 28 | return name; 29 | } 30 | 31 | public void setCode(String code) { 32 | this.code = code; 33 | } 34 | 35 | public String getCode() { 36 | return code; 37 | } 38 | 39 | 40 | } -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/entity/Tenant.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.entity; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | import javax.persistence.Column; 6 | import javax.validation.constraints.NotNull; 7 | import com.haulmont.cuba.core.entity.StandardEntity; 8 | import com.haulmont.chile.core.annotations.NamePattern; 9 | 10 | @NamePattern("%s|name") 11 | @Table(name = "RTCABO_TENANT") 12 | @Entity(name = "rtcabo$Tenant") 13 | public class Tenant extends StandardEntity { 14 | private static final long serialVersionUID = -6213800796238754110L; 15 | 16 | @NotNull 17 | @Column(name = "NAME", nullable = false) 18 | protected String name; 19 | 20 | @NotNull 21 | @Column(name = "CODE", nullable = false) 22 | protected String code; 23 | 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | public void setCode(String code) { 33 | this.code = code; 34 | } 35 | 36 | public String getCode() { 37 | return code; 38 | } 39 | 40 | 41 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/address/address-edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/tenant/tenant-edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 15 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/document/document-edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 15 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/productcategory/product-category-edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 15 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /modules/core/db/init/hsql/40.create-db.sql: -------------------------------------------------------------------------------- 1 | -- Config 2 | insert into SYS_CONFIG 3 | (ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, NAME, VALUE) 4 | values ('a2856777-3d69-212a-ac5a-fedb35e00851', 1, '2018-04-01 20:36:31', 'admin', '2018-04-01 20:36:31', null, 'fts.enabled', 'true'); 5 | insert into SYS_CONFIG 6 | (ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, NAME, VALUE) 7 | values ('9dd02ff0-8ebb-6ad5-181e-7dd295157ede', 1, '2018-04-01 20:36:38', 'admin', '2018-04-01 20:36:38', null, 'cuba.schedulingActive', 'true'); 8 | 9 | -- Scheduled Tasks 10 | insert into SYS_SCHEDULED_TASK 11 | (ID, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, DEFINED_BY, BEAN_NAME, METHOD_NAME, CLASS_NAME, SCRIPT_NAME, USER_NAME, IS_SINGLETON, IS_ACTIVE, PERIOD, TIMEOUT, START_DATE, CRON, SCHEDULING_TYPE, TIME_FRAME, START_DELAY, PERMITTED_SERVERS, LOG_START, LOG_FINISH, LAST_START_TIME, LAST_START_SERVER, METHOD_PARAMS, DESCRIPTION) 12 | values ('3c7eaf4b-b5fa-5ef3-e1e8-d03cd91c3d56', '2018-04-01 20:37:02', 'admin', '2018-04-01 20:37:03', 'admin', null, null, 'B', 'cuba_FtsManager', 'processQueue', null, null, null, null, true, 60, null, null, null, 'P', null, null, null, true, true, null, null, ' 13 | 14 | 15 | ', null); 16 | -------------------------------------------------------------------------------- /modules/core/src/com/roadtocubaandbeyond/ordermanagement/app.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Configuration # 3 | ############################################################################### 4 | 5 | cuba.dbmsType = hsql 6 | 7 | cuba.springContextConfig = +com/roadtocubaandbeyond/ordermanagement/spring.xml 8 | 9 | cuba.persistenceConfig = +com/roadtocubaandbeyond/ordermanagement/persistence.xml 10 | 11 | cuba.metadataConfig = +com/roadtocubaandbeyond/ordermanagement/metadata.xml 12 | 13 | cuba.viewsConfig = +com/roadtocubaandbeyond/ordermanagement/views.xml 14 | 15 | cuba.mainMessagePack = +com.roadtocubaandbeyond.ordermanagement.core 16 | 17 | cuba.keyForSecurityTokenEncryption = knMxH5wqQ8wlTIp9 18 | 19 | cuba.anonymousSessionId = dc22f5b1-7284-2e6d-8d2c-3f9876e004b6 20 | 21 | ############################################################################### 22 | # Other # 23 | ############################################################################### 24 | 25 | cuba.webContextName = app-core 26 | cuba.availableLocales = English|en;German|de 27 | cuba.localeSelectVisible = true 28 | cuba.ftsConfig = +com/roadtocubaandbeyond/ordermanagement/fts.xml 29 | -------------------------------------------------------------------------------- /modules/core/src/com/roadtocubaandbeyond/ordermanagement/fts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/entity/messages.properties: -------------------------------------------------------------------------------- 1 | Customer.birthday = Birthday 2 | Customer.name = Name 3 | Customer.firstName = First name 4 | Customer = Customer 5 | Customer.addresses = Addresses 6 | Customer.orders = Orders 7 | Address.city = City 8 | Address.street = Street 9 | Address.postCode = Post code 10 | Address = Address 11 | Address.customer = Customer 12 | Product.code = Code 13 | Product.name = Name 14 | Product = Product 15 | Product.category = Category 16 | LineItem.price = Price 17 | LineItem.quantity = Quantity 18 | LineItem.product = Product 19 | LineItem = Line Item 20 | LineItem.order = Order 21 | Order.orderDate = Order date 22 | Order.deliveryDate = Delivery date 23 | Order.orderId = Order ID 24 | Order.customer = Customer 25 | Order.lineItems = Line items 26 | Order = Order 27 | Order.documents = Documents 28 | Document.file = File 29 | Document.name = Name 30 | Document = Document 31 | Document.type = Type 32 | Document.order = Order 33 | DocumentType.INVOICE = Invoice 34 | DocumentType.SHIPMENT_NOTE = Shipment note 35 | DocumentType.REMINDER = Reminder 36 | ProductCategory.code = Code 37 | ProductCategory.name = Name 38 | ProductCategory = Product Category 39 | StandardTenantEntity.tenantId = Tenant id 40 | StandardTenantEntity = Standard Tenant Entity 41 | Tenant.name = Name 42 | Tenant.code = Code 43 | Tenant = Tenant 44 | -------------------------------------------------------------------------------- /modules/core/web/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | appPropertiesConfig 9 | classpath:com/roadtocubaandbeyond/ordermanagement/app.properties 10 | /WEB-INF/local.app.properties 11 | "file:${catalina.base}/conf/app-core/local.app.properties" 12 | 13 | 14 | 15 | appComponents 16 | com.haulmont.cuba com.haulmont.reports com.haulmont.fts de.balvi.cuba.translationde 17 | 18 | 19 | com.haulmont.cuba.core.sys.AppContextLoader 20 | 21 | 22 | remoting 23 | com.haulmont.cuba.core.sys.remoting.RemotingServlet 24 | 1 25 | 26 | 27 | remoting 28 | /remoting/* 29 | 30 | 31 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/product/product-edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 15 | 16 | 18 | 20 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /modules/core/test/com/roadtocubaandbeyond/ordermanagement/core/SampleIntegrationTest.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.core; 2 | 3 | import com.roadtocubaandbeyond.ordermanagement.RtcaboTestContainer; 4 | import com.haulmont.cuba.core.EntityManager; 5 | import com.haulmont.cuba.core.Persistence; 6 | import com.haulmont.cuba.core.Transaction; 7 | import com.haulmont.cuba.core.TypedQuery; 8 | import com.haulmont.cuba.core.global.AppBeans; 9 | import com.haulmont.cuba.core.global.DataManager; 10 | import com.haulmont.cuba.core.global.Metadata; 11 | import com.haulmont.cuba.security.entity.User; 12 | import org.junit.After; 13 | import org.junit.Before; 14 | import org.junit.ClassRule; 15 | import org.junit.Test; 16 | 17 | import java.util.List; 18 | 19 | import static org.junit.Assert.assertEquals; 20 | import static org.junit.Assert.assertTrue; 21 | 22 | public class SampleIntegrationTest { 23 | 24 | @ClassRule 25 | public static RtcaboTestContainer cont = RtcaboTestContainer.Common.INSTANCE; 26 | 27 | private Metadata metadata; 28 | private Persistence persistence; 29 | private DataManager dataManager; 30 | 31 | @Before 32 | public void setUp() throws Exception { 33 | metadata = cont.metadata(); 34 | persistence = cont.persistence(); 35 | dataManager = AppBeans.get(DataManager.class); 36 | } 37 | 38 | @After 39 | public void tearDown() throws Exception { 40 | } 41 | 42 | @Test 43 | public void testLoadUser() { 44 | assertTrue(true); 45 | } 46 | } -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/entity/StandardTenantEntity.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.entity; 2 | 3 | import javax.annotation.PostConstruct; 4 | import javax.persistence.MappedSuperclass; 5 | import java.util.UUID; 6 | import javax.persistence.Column; 7 | import javax.validation.constraints.NotNull; 8 | import com.haulmont.cuba.core.entity.StandardEntity; 9 | import com.haulmont.cuba.core.global.AppBeans; 10 | import com.haulmont.cuba.core.global.UserSessionSource; 11 | import com.haulmont.cuba.security.app.UserSessionService; 12 | 13 | @MappedSuperclass 14 | public class StandardTenantEntity extends StandardEntity { 15 | private static final long serialVersionUID = -3799879781351079930L; 16 | 17 | @NotNull 18 | @Column(name = "TENANT_ID", nullable = false) 19 | protected UUID tenantId; 20 | 21 | public void setTenantId(UUID tenantId) { 22 | this.tenantId = tenantId; 23 | } 24 | 25 | public UUID getTenantId() { 26 | return tenantId; 27 | } 28 | 29 | 30 | @PostConstruct 31 | protected void initTenantId() { 32 | 33 | UserSessionSource uss = AppBeans.get(UserSessionSource.NAME); 34 | 35 | UUID sessionTenantId = uss.getUserSession().getAttribute("tenantId"); 36 | 37 | 38 | if (sessionTenantId == null) { 39 | throw new IllegalArgumentException("User has currently no tenant assigned. Entity instance cannot be created"); 40 | } 41 | 42 | 43 | setTenantId(sessionTenantId); 44 | 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/lineitem/line-item-edit.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/views.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | 10 | 11 | 14 | 16 | 17 | 20 | 22 | 24 | 26 | 27 | 30 | 32 | 33 | 36 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /modules/core/db/init/hsql/20.create-db.sql: -------------------------------------------------------------------------------- 1 | -- begin RTCABO_ADDRESS 2 | alter table RTCABO_ADDRESS add constraint FK_RTCABO_ADDRESS_CUSTOMER foreign key (CUSTOMER_ID) references RTCABO_CUSTOMER(ID)^ 3 | create index IDX_RTCABO_ADDRESS_CUSTOMER on RTCABO_ADDRESS (CUSTOMER_ID)^ 4 | -- end RTCABO_ADDRESS 5 | -- begin RTCABO_LINE_ITEM 6 | alter table RTCABO_LINE_ITEM add constraint FK_RTCABO_LINE_ITEM_PRODUCT foreign key (PRODUCT_ID) references RTCABO_PRODUCT(ID)^ 7 | alter table RTCABO_LINE_ITEM add constraint FK_RTCABO_LINE_ITEM_ORDER foreign key (ORDER_ID) references RTCABO_ORDER(ID)^ 8 | create index IDX_RTCABO_LINE_ITEM_PRODUCT on RTCABO_LINE_ITEM (PRODUCT_ID)^ 9 | create index IDX_RTCABO_LINE_ITEM_ORDER on RTCABO_LINE_ITEM (ORDER_ID)^ 10 | -- end RTCABO_LINE_ITEM 11 | -- begin RTCABO_ORDER 12 | alter table RTCABO_ORDER add constraint FK_RTCABO_ORDER_CUSTOMER foreign key (CUSTOMER_ID) references RTCABO_CUSTOMER(ID)^ 13 | create index IDX_RTCABO_ORDER_CUSTOMER on RTCABO_ORDER (CUSTOMER_ID)^ 14 | -- end RTCABO_ORDER 15 | -- begin RTCABO_DOCUMENT 16 | alter table RTCABO_DOCUMENT add constraint FK_RTCABO_DOCUMENT_FILE foreign key (FILE_ID) references SYS_FILE(ID)^ 17 | alter table RTCABO_DOCUMENT add constraint FK_RTCABO_DOCUMENT_ORDER foreign key (ORDER_ID) references RTCABO_ORDER(ID)^ 18 | create index IDX_RTCABO_DOCUMENT_FILE on RTCABO_DOCUMENT (FILE_ID)^ 19 | create index IDX_RTCABO_DOCUMENT_ORDER on RTCABO_DOCUMENT (ORDER_ID)^ 20 | -- end RTCABO_DOCUMENT 21 | -- begin RTCABO_PRODUCT 22 | alter table RTCABO_PRODUCT add constraint FK_RTCABO_PRODUCT_CATEGORY foreign key (CATEGORY_ID) references RTCABO_PRODUCT_CATEGORY(ID)^ 23 | create index IDX_RTCABO_PRODUCT_CATEGORY on RTCABO_PRODUCT (CATEGORY_ID)^ 24 | -- end RTCABO_PRODUCT 25 | -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/entity/Product.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.entity; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | import javax.persistence.Column; 6 | import javax.validation.constraints.NotNull; 7 | import com.haulmont.cuba.core.entity.StandardEntity; 8 | import com.haulmont.chile.core.annotations.NamePattern; 9 | import com.haulmont.cuba.core.entity.annotation.Lookup; 10 | import com.haulmont.cuba.core.entity.annotation.LookupType; 11 | import javax.persistence.FetchType; 12 | import javax.persistence.JoinColumn; 13 | import javax.persistence.ManyToOne; 14 | 15 | @NamePattern("%s|name") 16 | @Table(name = "RTCABO_PRODUCT") 17 | @Entity(name = "rtcabo$Product") 18 | public class Product extends StandardEntity { 19 | private static final long serialVersionUID = -2053662418539889040L; 20 | 21 | @NotNull 22 | @Column(name = "NAME", nullable = false) 23 | protected String name; 24 | 25 | @Column(name = "CODE") 26 | protected String code; 27 | 28 | @Lookup(type = LookupType.DROPDOWN, actions = {"lookup", "clear"}) 29 | @ManyToOne(fetch = FetchType.LAZY) 30 | @JoinColumn(name = "CATEGORY_ID") 31 | protected ProductCategory category; 32 | 33 | public void setCategory(ProductCategory category) { 34 | this.category = category; 35 | } 36 | 37 | public ProductCategory getCategory() { 38 | return category; 39 | } 40 | 41 | 42 | public void setName(String name) { 43 | this.name = name; 44 | } 45 | 46 | public String getName() { 47 | return name; 48 | } 49 | 50 | public void setCode(String code) { 51 | this.code = code; 52 | } 53 | 54 | public String getCode() { 55 | return code; 56 | } 57 | 58 | 59 | } -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/entity/Address.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.entity; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | import javax.persistence.Column; 6 | import javax.validation.constraints.NotNull; 7 | import com.haulmont.cuba.core.entity.StandardEntity; 8 | import com.haulmont.chile.core.annotations.NamePattern; 9 | import javax.persistence.FetchType; 10 | import javax.persistence.JoinColumn; 11 | import javax.persistence.ManyToOne; 12 | 13 | @NamePattern("%s, %s %s|street,postCode,city") 14 | @Table(name = "RTCABO_ADDRESS") 15 | @Entity(name = "rtcabo$Address") 16 | public class Address extends StandardEntity { 17 | private static final long serialVersionUID = -8428991748490450321L; 18 | 19 | @NotNull 20 | @Column(name = "STREET", nullable = false) 21 | protected String street; 22 | 23 | @NotNull 24 | @Column(name = "POST_CODE", nullable = false) 25 | protected String postCode; 26 | 27 | @NotNull 28 | @Column(name = "CITY", nullable = false) 29 | protected String city; 30 | 31 | @ManyToOne(fetch = FetchType.LAZY, optional = false) 32 | @JoinColumn(name = "CUSTOMER_ID") 33 | protected Customer customer; 34 | 35 | public void setCustomer(Customer customer) { 36 | this.customer = customer; 37 | } 38 | 39 | public Customer getCustomer() { 40 | return customer; 41 | } 42 | 43 | 44 | public void setStreet(String street) { 45 | this.street = street; 46 | } 47 | 48 | public String getStreet() { 49 | return street; 50 | } 51 | 52 | public void setPostCode(String postCode) { 53 | this.postCode = postCode; 54 | } 55 | 56 | public String getPostCode() { 57 | return postCode; 58 | } 59 | 60 | public void setCity(String city) { 61 | this.city = city; 62 | } 63 | 64 | public String getCity() { 65 | return city; 66 | } 67 | 68 | 69 | } -------------------------------------------------------------------------------- /modules/web/test/com/roadtocubaandbeyond/ordermanagement/web/steps/LoginSteps.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.web.steps; 2 | 3 | import com.roadtocubaandbeyond.ordermanagement.web.service.UserService; 4 | import com.roadtocubaandbeyond.ordermanagement.web.screens.LoginWindow; 5 | import com.haulmont.cuba.security.entity.User; 6 | import com.haulmont.masquerade.Connectors; 7 | import com.haulmont.masquerade.components.AppMenu; 8 | import cucumber.api.PendingException; 9 | import cucumber.api.java.en.Given; 10 | import cucumber.api.java.en.Then; 11 | import cucumber.api.java.en.When; 12 | 13 | 14 | import java.util.List; 15 | 16 | import static com.codeborne.selenide.Selenide.open; 17 | import static com.haulmont.masquerade.Components._$; 18 | import static org.junit.Assert.assertTrue; 19 | 20 | public class LoginSteps { 21 | @Given("^there is a user \"([^\"]*)\" in the system$") 22 | public void thereIsAUserInTheSystem(String username) throws Throwable { 23 | UserService userService = Connectors.restApi(UserService.class); 24 | 25 | List allUsers = userService.all().execute().body(); 26 | assertTrue(allUsers.stream().anyMatch(user -> user.getLogin().equals(username))); 27 | } 28 | 29 | @When("^I log in as the user \"([^\"]*)\" with password \"([^\"]*)\"$") 30 | public void iLogInAsTheUserWithPassword(String username, String password) throws Throwable { 31 | open("http://localhost:8080/app"); 32 | 33 | LoginWindow loginWindow = _$(LoginWindow.class); 34 | loginWindow.getLoginField().setValue(username); 35 | loginWindow.getPasswordField().setValue(password); 36 | 37 | _$(LoginWindow.class).getLoginButton().click(); 38 | 39 | } 40 | 41 | @Then("^I am logged in and can navigate through the application$") 42 | public void iAmLoggedInAndCanNavigateThroughTheApplication() throws Throwable { 43 | 44 | _$(AppMenu.class).openItem("administration", "sec$User.browse"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /modules/global/src/com/roadtocubaandbeyond/ordermanagement/entity/Document.java: -------------------------------------------------------------------------------- 1 | package com.roadtocubaandbeyond.ordermanagement.entity; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Table; 5 | import com.haulmont.cuba.core.entity.FileDescriptor; 6 | import javax.persistence.Column; 7 | import javax.persistence.FetchType; 8 | import javax.persistence.JoinColumn; 9 | import javax.persistence.ManyToOne; 10 | import javax.validation.constraints.NotNull; 11 | import com.haulmont.cuba.core.entity.StandardEntity; 12 | import com.haulmont.chile.core.annotations.NamePattern; 13 | 14 | @NamePattern("%s|name") 15 | @Table(name = "RTCABO_DOCUMENT") 16 | @Entity(name = "rtcabo$Document") 17 | public class Document extends StandardEntity { 18 | private static final long serialVersionUID = -7919115810258492166L; 19 | 20 | @NotNull 21 | @Column(name = "NAME", nullable = false) 22 | protected String name; 23 | 24 | @NotNull 25 | @ManyToOne(fetch = FetchType.LAZY, optional = false) 26 | @JoinColumn(name = "FILE_ID") 27 | protected FileDescriptor file; 28 | 29 | @Column(name = "TYPE_") 30 | protected String type; 31 | 32 | @ManyToOne(fetch = FetchType.LAZY, optional = false) 33 | @JoinColumn(name = "ORDER_ID") 34 | protected Order order; 35 | 36 | public void setOrder(Order order) { 37 | this.order = order; 38 | } 39 | 40 | public Order getOrder() { 41 | return order; 42 | } 43 | 44 | 45 | public void setType(DocumentType type) { 46 | this.type = type == null ? null : type.getId(); 47 | } 48 | 49 | public DocumentType getType() { 50 | return type == null ? null : DocumentType.fromId(type); 51 | } 52 | 53 | 54 | public void setName(String name) { 55 | this.name = name; 56 | } 57 | 58 | public String getName() { 59 | return name; 60 | } 61 | 62 | public void setFile(FileDescriptor file) { 63 | this.file = file; 64 | } 65 | 66 | public FileDescriptor getFile() { 67 | return file; 68 | } 69 | 70 | 71 | } -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web-app.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Configuration # 3 | ############################################################################### 4 | 5 | cuba.springContextConfig = +com/roadtocubaandbeyond/ordermanagement/web-spring.xml 6 | 7 | cuba.dispatcherSpringContextConfig = +com/roadtocubaandbeyond/ordermanagement/web-dispatcher-spring.xml 8 | 9 | cuba.persistenceConfig = +com/roadtocubaandbeyond/ordermanagement/persistence.xml 10 | 11 | cuba.metadataConfig = +com/roadtocubaandbeyond/ordermanagement/metadata.xml 12 | 13 | cuba.viewsConfig = +com/roadtocubaandbeyond/ordermanagement/views.xml 14 | 15 | cuba.windowConfig = +com/roadtocubaandbeyond/ordermanagement/web-screens.xml 16 | 17 | cuba.menuConfig = +com/roadtocubaandbeyond/ordermanagement/web-menu.xml 18 | 19 | cuba.permissionConfig = +com/roadtocubaandbeyond/ordermanagement/web-permissions.xml 20 | 21 | cuba.mainMessagePack = +com.roadtocubaandbeyond.ordermanagement.web 22 | 23 | cuba.anonymousSessionId = dc22f5b1-7284-2e6d-8d2c-3f9876e004b6 24 | 25 | cuba.creditsConfig = + 26 | 27 | ############################################################################### 28 | # Other # 29 | ############################################################################### 30 | 31 | # Middleware connection 32 | cuba.connectionUrlList = http://localhost:8080/app-core 33 | 34 | # Set to false if the middleware works on different JVM 35 | cuba.useLocalServiceInvocation = true 36 | 37 | cuba.webContextName = app 38 | cuba.availableLocales = English|en;German|de 39 | cuba.localeSelectVisible = true 40 | 41 | cuba.testMode = true 42 | cuba.web.theme = halo 43 | cuba.themeConfig=com/haulmont/cuba/havana-theme.properties com/haulmont/cuba/halo-theme.properties com/haulmont/cuba/hover-theme.properties 44 | cuba.web.loginScreenId=loginWindow 45 | cuba.web.mainScreenId=mainWindow 46 | cuba.gui.genericFilterApplyImmediately=false 47 | -------------------------------------------------------------------------------- /modules/web/src/com/roadtocubaandbeyond/ordermanagement/web/tenant/tenant-browse.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 21 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 41 |