How To Add New Concept - AdaptableApps/cornerstone GitHub Wiki
How To
Add a new Concept
In your Systems Cornerstone Workbook:
Add a new row to the CsConcept sheet with the properties for the concept
Ensure to choose a unique Id and Code for it
Add new row(s) to the CsConceptAspect sheet for each aspect/property of the concept
Ensure to choose a unique Id and Code for each aspect
Ensure the AspectName is unique and the AspectDisplayName is a friendly name for the aspect that the user will see
Ensure the CsAspectTypeCode is set to the Code of the CsConceptAspectType that you want to use for this aspect
Choose one ending in ReadOnly if you want the aspect to be read only in the UI at all times (e.g. use for Id and Code fields)
Data type:
AspectCodeDataType allows for the data type of the aspect to be set that is used in the generated C# code
AspectParameterDataType allows for the data type of the parameter to be set that is used in the generated migration version class
the reason this can be different is because the migration version class is generated in C# and the default value is a string
Ensure the ParentCsConceptCode is set to the Code of the CsConcept that you this aspect belongs to
Ensure the IsRequired is set to true if you want this aspect to be required
Ensure the IsUiVisible is set to true if you want this aspect to be able to be visible in the Ui
Default values can be set:
ParameterDefaultValue allows for the default value for the aspect to be set to when the concept is created by the generated migration version class
DefaultValue allows for the default value for the aspect to be set when creating the concept in the Ui
If the aspect being added is linked to another CsConcept (i.e. a foreign key in database speak) then you need to:
Ensure the RelatedCsConceptCode aspect is set to the Code of the CsConcept that you want to link to
Ensure the RelatedCsConceptAspectCode aspect is to the Code of the CsConceptAspect that you want to link to
Add a new row to the CsView sheet:
Ensure to choose a unique Id and Code for it
Ensure to PrimaryCsConceptCode is set to the Code of the CsConcept being added
AppViewName is the name the user will see in the Ui
AppMultipleViewName is the name the user will see in the Ui when there are multiple rows of this type
AppNavigationName is the name of the view in the navigation system - so on web targets you will see in the url bar
AppViewBackgroundImageUrl is the url to the image that will be used as the background for the view
IsPreGeneratedView determines whether the view will be automatically generated by the default Source Dynamo code generation template for generated views
IsDynamicView determines whether the view will be rendered using the Dynamic View rendering system on supported platforms (currently on supported on Xamarin targets and in-future MAUI targets will support this once its released)
IsInitialView determines whether the view is the first view the user is navigated to after the index page initialises the system
IsPostLoginView determines whether the view is the first view the user is navigated to after a successful login
IsAppBarAvailable determines whether the App Bar is shown when on this view
IsAppMenuAvailable determines whether the App Menu is shown when on this view
IsLoginRequiredToAccess determines whether you have to be logged in to see this view
CsUiMaxWidthEnum determines the maximum width of the view when rendered on the Ui according to responsive design - possible values are:
ExtraSmall
Small
Medium
Large
ExtraLarge
ExtraExtraLarge
IsActive determines if the view is active or not - if not active then it will not be shown in the Ui regardless of other settings
IsNew determines if the row is new to to the system in this version or not - if this is false it will generate a update call in the version migration rather than a create call
Add new row(s) to the CsViewSection sheet for each section you want your view to have:
Ensure to choose a unique Id for it
The code column is already pre-configured with a formula to create a unique code for it
CsViewCode should have the Code of the CsView added above so that the section is linked to the view
CsViewSectionTypeEnum should be set to define what type of section it is - possible values are:
Aspects
This is used for sections that are used to display aspects of the concept - either for viewing or creation or editing purposes
Relation
This is used for sections that used to display related concepts to the concept being viewed e.g. invoice items on an invoice
CsViewSectionCsConceptCode is used to link the section to the concept that it is displaying information for. For Aspects sections this is the same CsConceptCode as the CsViewCode but for Relation sections this is the CsConceptCode of the related concept
Aspects only relevant for Relation sections:
LayoutCsViewSectionRelationTClassName - this is the name of the class that will be used to render the related concepts in the section
FilterCsViewSectionCsConceptAspectCode - this is the name of the CsConceptAspectCode that will be filtered on when displaying the related concepts in the section e.g. for invoice items this would be the {{SystemCode}}InvoiceItem_InvoiceId if that is the Code of the relevant CsConceptAspect
FilterCsDataQueryKey - this is the of the CsDataQuery that will be used to filter the related concepts in the section which can be used instead of FilterCsViewSectionCsConceptAspectCode if the filter is more complex
IsMultiSelectionEnabled determines if a checkbox is shown next to each row in the section to allow for multiple rows to be selected at once which can then be used by an action.
ViewSectionName is the name of the section that will be displayed in the Ui
ViewSectionOrder is the order that the section will be displayed in the Ui
IsActive determines if the section is active or not - if not active then it will not be shown in the Ui regardless of other settings
IsNew determines if the row is new to to the system in this version or not - if this is false it will generate a update call in the version migration rather than a create call
Add new row(s) to the CsViewSectionAspect sheet for each aspect you want your view to have:
Note: this is only currently relevant for Aspects sections
Ensure to choose a unique Id for it
The code column is already pre-configured with a formula to create a unique code for it
CsViewSectionCode should have the Code of the CsViewSection added above so that the aspect is linked to the section
AppViewSectionCsConceptAspectCode is used to link the aspect to the concept aspect that it is displaying information for
IsCsActionButtonVisible is used to determine if the action button is visible for the aspect
CsActionCode determines the action that will be called when the action button is tapped/clicked (only relevant if IsCsActionButtonVisible is true)
OverridedCsActionName determines the overrided action name that will be shown on action button (only relevant if IsCsActionButtonVisible is true)
AppViewSectionAspectColumnNo can be used to split up aspects into multiple columns if required - Note this will only work if you customise your code generation template for the view to use this to do that
AppViewSectionAspectOrder is the order that the aspect will be displayed in the Ui
IsShownOnView determines if the aspect is shown on the view or not
IsShownOnRelationView determines if the aspect is shown on the relation view or not (note this is currently not being used - Note this is a future feature to be used in AdvancedDataGridLayoutCsViewSectionRelationT view)
IsActive determines if the aspect is active or not - if not active then it will not be shown in the Ui regardless of other settings
IsNew determines if the row is new to to the system in this version or not - if this is false it will generate a update call in the version migration rather than a create call
Add new row(s) to CsViewSectionCsAction sheet
Ensure to choose a unique Id for it
The code column is already pre-configured with a formula to create a unique code for it
CsViewSectionCode should have the Code of the CsViewSection added above so that the action is linked to the section
CsActionCode determines the action that will be called when the action button is tapped/clicked
OverridedCsActionName determines the overrided action name that will be shown on action button
CsActionHorizontalPositionEnum determines the horizonal position of the action button - possible values are:
LayoutCsPageTopLeft
LayoutCsPageTopRight
LayoutCsViewTopLeft
LayoutCsViewTopRight
LayoutCsViewBottomLeft
LayoutCsViewBottomRight
LayoutCsViewSectionTopLeft
LayoutCsViewSectionTopRight
LayoutCsViewSectionBottomLeft
LayoutCsViewSectionBottomRight
AppViewSectionCsActionOrder determines the order that the action appears on the Ui within its section
RestrictForCsActionCode determines the action that must be the current action before this action is shown e.g. for the Edit action this would be View because you can't edit if you're not already viewing
IsActive determines if the action is active or not - if not active then it will not be shown in the Ui regardless of other settings
IsNew determines if the row is new to to the system in this version or not - if this is false it will generate a update call in the version migration rather than a create call
Run your systems Source Dynamo script to generate the code for all the above