The following is an example of liquibase code to populate a large portion of the Advanced CMS Content Zone related data. This entry sets up all data that can be set up through liquibase inserts, leaving the admin configuration portion to the user.
<comment>This first entry creates the field group that our field definitions</comment>
<comment>will all be grouped by.</comment>
<insert tableName="BLC_FLD_GROUP">
<column name="FLD_GROUP_ID" valueNumeric="10000" />
<column name="NAME" value="Field Group Example" />
</insert>
<comment>The field template here is created to connect multiple groups of </comment>
<comment>field groups. Think of a field template as a group of field groups.</comment>
<insert tableName="BLC_SC_FLD_TMPLT">
<column name="SC_FLD_TMPLT_ID" valueNumeric="10001" />
<column name="NAME" value="Field Template Example" />
</insert>
<comment>This entry connects our "Field Group Example" Field Group to "Field</comment>
<comment> Template Example" Field Template.</comment>
<insert tableName="BLC_SC_FLDGRP_XREF">
<column name="SC_FLD_TMPLT_ID" valueNumeric="10001" />
<column name="FLD_GROUP_ID" valueNumeric="10000" />
</insert>
<comment>This first field definition is setup to hold an Html code block. </comment>
<comment>Since we are storing Html, a text field will be used for easier </comment>
<comment>reading and editing of entered code.</comment>
<comment>Also note that each of the following field definitions all belong</comment>
<comment> to the same field group, 10000.</comment>
<insert tableName="BLC_FLD_DEF">
<column name="FLD_DEF_ID" valueNumeric="250" />
<column name="ALLOW_MULTIPLES" valueBoolean="FALSE" />
<column name="COLUMN_WIDTH" value="*" />
<column name="FLD_TYPE" value="HTML" />
<column name="FLD_ORDER" valueNumeric="1" />
<column name="FRIENDLY_NAME" value="Example Field Definition HTML" />
<column name="HIDDEN_FLAG" valueBoolean="FALSE" />
<column name="MAX_LENGTH" valueNumeric="NULL" />
<column name="NAME" value="fieldDefinitionHtmlExample" />
<column name="TEXT_AREA_FLAG" valueBoolean="TRUE" />
<column name="FLD_GROUP_ID" valueNumeric="10000" />
</insert>
<comment>This field definition is set up to store a boolean, and as such </comment>
<comment>doesn't require many extended properties such as a text area or </comment>
<comment>a max length for the input.</comment>
<insert tableName="BLC_FLD_DEF">
<column name="FLD_DEF_ID" valueNumeric="251" />
<column name="ALLOW_MULTIPLES" valueBoolean="FALSE" />
<column name="COLUMN_WIDTH" value="*" />
<column name="FLD_TYPE" value="BOOLEAN" />
<column name="FLD_ORDER" valueNumeric="2" />
<column name="FRIENDLY_NAME" value="Example Field Definition Boolean" />
<column name="HIDDEN_FLAG" valueBoolean="FALSE" />
<column name="MAX_LENGTH" valueNumeric="NULL" />
<column name="NAME" value="fieldDefinitionBooleanExample" />
<column name="TEXT_AREA_FLAG" valueBoolean="FALSE" />
<column name="FLD_GROUP_ID" valueNumeric="10000" />
</insert>
<comment>This final field definition is set up to allow a user in the admin</comment>
<comment> to look up an asset (usually an image) and store the reference to</comment>
<comment> that asset. This is displayed as a "Lookup" button so we don't </comment>
<comment>need a text area, however, there should be a max length to the </comment>
<comment>input as this is still a url reference to the image.</comment>
<insert tableName="BLC_FLD_DEF">
<column name="FLD_DEF_ID" valueNumeric="252" />
<column name="ALLOW_MULTIPLES" valueBoolean="FALSE" />
<column name="COLUMN_WIDTH" value="*" />
<column name="FLD_TYPE" value="ASSET_LOOKUP" />
<column name="FLD_ORDER" valueNumeric="3" />
<column name="FRIENDLY_NAME" value="Example Field Definition Asset Lookup" />
<column name="HIDDEN_FLAG" valueBoolean="FALSE" />
<column name="MAX_LENGTH" valueNumeric="150" />
<column name="NAME" value="fieldDefinitionAssetLookupExample" />
<column name="TEXT_AREA_FLAG" valueBoolean="FALSE" />
<column name="FLD_GROUP_ID" valueNumeric="10000" />
</insert>
<comment>This entry is used to link our "Field Template Example" Field</comment>
<comment> Template to our "Widget Example" Widget. </content>
<insert tableName="BLC_SC_TYPE">
<column name="SC_TYPE_ID" valueNumeric="301" />
<column name="NAME" value="SC Type Example" />
<column name="DESCRIPTION" value="A Structured Content Type created for use in Documentation." />
<column name="SC_FLD_TMPLT_ID" valueNumeric="10001" />
</insert>
<comment>This content zone is created to bind our "Widget Example" Widget </comment>
<comment>to our "Thymeleaf Reference Name" Content Zone. Do note, however,</comment>
<comment> that you could link other Widgets and Content Zones together </comment>
<comment>through this Content Zone Definition.</comment>
<insert tableName="BLC_CONTENT_ZONE_DEF">
<column name="ZONE_DEF_ID" valueNumeric="700" />
<column name="NAME" value="Example Content Zone Definition" />
</insert>
<comment>This content zone is used to be a sort of placeholder for content </comment>
<comment>to be replaced in a Thymeleaf template. To do so, you would </comment>
<comment>reference this using </comment>
<comment>'<blc:content-zone>name="Thymeleaf Reference Name" deepLinks="deepLinks" />'</comment>
<comment> in your template. Also in this entry you can see that we link </comment>
<comment> this Content Zone to our "Example Content Zone Definition" </comment>
<comment>Content Zone Definition (using the CONTENT_ZONE_DEF property).</comment>
<insert tableName="BLC_CONTENT_ZONE">
<column name="CONTENT_ZONE_ID" valueNumeric="800" />
<column name="DESCRIPTION" value="A Content Zone created for use in Documentation." />
<column name="NAME" value="Thymeleaf Reference Name" />
<column name="DEFAULT_CONTENT_ITEM" value="NULL" />
<column name="CONTENT_ZONE_DEF" valueNumeric="700" />
</insert>
<comment>This Widget is a pretty simple one as it is only going to have a </comment>
<comment>single Content Type related to it. (insert comment about the html</comment>
<comment>, css, and js).</comment>
<insert tableName="BLC_WIDGET">
<column name="WIDGET_ID" valueNumeric="400" />
<column name="CSS_CONTENTS" value="Widget CSS" />
<column name="DESCRIPTION" value="A Widget created for use in Documentation." />
<column name="HANDLE_MULTIPLE_ITEMS" valueBoolean="FALSE" />
<column name="HTML_CONTENTS" value="Widget HTML" />
<column name="JS_CONTENTS" value="Widget JS" />
<column name="NAME" value="Widget Example" />
</insert>
<comment>This entry connects our "Widget Example" Widget to our "Example</comment>
<comment> Content Zone Definition" Content Definition. This Content Zone</comment>
<comment> Definition will appear under the "Zone Definitions" table of </comment>
<comment>the Widget in the Admin.</comment>
<insert tableName="BLC_CON_ZONE_DEF_WDGT_XREF">
<column name="CONTENT_ZONE_DEF_XREF_ID" valueNumeric="900" />
<column name="ZONE_DEF_ID" valueNumeric="700" />
<column name="WIDGET_ID" valueNumeric="400" />
</insert>
<comment>This entry links our "SC Type Example" Structured Content Type</comment>
<comment> to our "Widget Example" Widget. This Structured Content Type </comment>
<comment> appear under the "Allowed Content Types" table of this Widget</comment>
<comment>in the Admin.</comment>
<insert tableName="BLC_SC_TYPE_WIDGET_XREF">
<column name="SC_TYPE_WIDGET_XREF_ID" valueNumeric="8500" />
<column name="WIDGET_ID" valueNumeric="400" />
<column name="SC_TYPE_ID" valueNumeric="301" />
</insert>