Step 1: Entry Types
Start a new Kickstarter project
umkickstarter -n de.pinuts.tutorial
cd umkickstarter
# Copy your partner license file to env/devel/cmsbs-conf/cmsbs.license
gradle setup run
Entry Types
The data model is to contain at least four different domain objects or Entry Types:
employees
customers
partnering shipping companies
trucks of that shipping companies
Custom attributes
Employees, customers and shipping companies can be represented by UM entries utilizing only standard attributes. Only trucks seem to stand out; here we need to create a few extra attributes to adequately represent them:
cmsbs-conf/conf.d/truck.attributes
:
registration_number.type = STRING
registration_number.title = Registration number
additional.attributes[] = registration_number
max_payload.type = INTEGER
max_payload.title = Max. payload in kg
additional.attributes[] = max_payload
attribute.groups[] = truck
grp.truck.members = registration_number max_payload
grp.truck.title = Truck
Entry Types
Now we can setup a magic attribute named entrytype
.
cmsbs-conf/conf.d/entrytype.attributes
:
entrytype.values[] = employee
entrytype.values[] = shipping_company
entrytype.values[] = customer
entrytype.values[] = truck
entrytype.value.employee = Employee
entrytype.value.shipping_company = Shipping Company
entrytype.value.customer = Customer
entrytype.value.truck = Truck
Customize Entry views
Now, we’ll customize the Entry views for our four different Entry Types.
cmsbs-conf/entryTypes/type_shipping_company.properties
:
cmsbs-conf/entryTypes/type_employee.properties
:
cmsbs-conf/entryTypes/type_customer.properties
:
cmsbs-conf/entryTypes/type_truck.properties
:
Before we can use our new Entry Types we have to comment in one line in build.gradle
so the builder knows where to put our entryTypes
After dropping the database and restarting we should be able to create an Entry of each of these four Entry Types and see the customized view and edit pages in action: