diff --git a/ccm-cms-types-formitem/web/themes/freemarker/ccm-cms-types-formitem.ftl b/ccm-cms-types-formitem/web/themes/freemarker/ccm-cms-types-formitem.ftl new file mode 100644 index 000000000..448f5c1c2 --- /dev/null +++ b/ccm-cms-types-formitem/web/themes/freemarker/ccm-cms-types-formitem.ftl @@ -0,0 +1,202 @@ +7<#ftl ns_prefixes={ +"bebop":"http://www.arsdigita.com/bebop/1.0", +"cms":"http://www.arsdigita.com/cms/1.0", +"nav":"http://ccm.redhat.com/navigation", +"ui": "http://www.arsdigita.com/ui/1.0"} +> + +<#function getDescription item> + <#return item["./form/description"]> + + +<#function getFormAction item> + <#if (item["./remote"] == "true")> + <#return item["./remoteURL"]> + <#else> + <#return item["./@formAction"]> + + + +<#function hasHoneypot item> + <#return (item["./honeypot"]?size > 0)> + + +<#function getHoneypotName item> + <#return item["./honeypot/@name"]> + + +<#function hasMinTimeCheck item> + <#return (item["./minTimeCheck"]?size > 0)> + + +<#function getMinTimeCheckValue item> + <#return item["./minTimeCheck/@generated"]> + + +<#function hasVisitedField item> + <#return (item["./remote"] != "true")> + + +<#function getVisitedFieldName item> + <#return item["./name"]> + + +<#function getPageStateFieldName item> + <#return item["./formbuilder:pageState/bebop:pageState/@name"]> + + +<#function getPageStateFieldValue item> + <#return item["./formbuilder:pageState/bebop:pageState/@value"]> + + +<#function getComponents item> + <#return item["./form/component[(objectType != 'com.arsdigita.formbuilder.Widget' and objectType != 'com.arsdigita.formbuilder.DataDrivenSelect' or (defaultDomainClass = 'com.arsdigita.formbuilder.PersistentSubmit' or defaultDomainClass = 'com.arsdigita.formbuilder.PersistentHidden' or defaultDomainClass = 'com.arsdigita.formbuilder.HiddenIDGenerator')]"]> + + +<#function getComponentName component> + <#return component["./parameterName"]> + + +<#function getComponentDefaultValue component> + <#return component["./defaultValue"]> + + +<#function getComponentDescription component> + <#return component["./description"]> + + +<#function getComponentParameterName component> + <#return component["./parameterName"]> + + +<#function getComponentType component> + <#return component["./defaultDomainClass"]> + + +<#function getFormSectionTitle formSection> + <#return formSection["./formSectionItem/title]> + + +<#function getFormSectionComponents formSection> + <#return formSection["./formSectionItem/formSection/component[(objectType != 'com.arsdigita.formbuilder.Widget' and objectType != 'com.arsdigita.formbuilder.DataDrivenSelect' or (defaultDomainClass = 'com.arsdigita.formbuilder.PersistentSubmit' or defaultDomainClass = 'com.arsdigita.formbuilder.PersistentHidden' or defaultDomainClass = 'com.arsdigita.formbuilder.HiddenIDGenerator')]"]> + + +<#function getLabelComponents label> + <#return label["./widget"]> + + +<#function getButtonGroupComponents buttonGroup> + <#return buttonGroup["./component"]> + + +<#function isMultipleSelect select> + <#return select["./multiple"] == "true"> + + +<#function isDataDrivenSelect select> + <#return (select["./defaultDomainClass"] == "com.arsdigita.formbuilder.DataDrivenSelect")> + + +<#function getDataOptions select> + <#return select["./selectOptions/option"]> + + +<#function getDataOptionLabel option> + <#return select["./@label"]> + + +<#function getDataOptionId option> + <#return select["./@id"]> + + +<#function getOptionComponents select> + <#return select["./component"]> + + +<#function hasOtherOption select> + <#return (select["./optiongroupother"] == "true")> + + +<#function getOtherOptionLabel select> + <#return select["./optiongroupotherlabel"]> + + +<#function getOtherOptionValue select> + <#return select["./optiongroupothervalue"]> + + +<#function hasMaxLength component> + <#return (component["./maxlength"]?size > 0)> + + +<#function getMaxLength component> + <#return component["./maxlength"]> + + +<#function hasSize component> + <#return (component["./size"]?size > 0)> + + +<#function getSize component> + <#return component["./size"]> + + +<#function isRequired component> + <#return (component["./widgetrequired"] == "true")> + + +<#function getDateFieldDayParamName component> + <#return component["./parameterName"] + ".day"> + + +<#function getDateFieldMonthParamName component> + <#return component["./parameterName"] + ".month"> + + +<#function getDateFieldYeaerParamName component> + <#return component["./parameterName"] + ".year"> + + +<#function getDateFieldDefaultValueDay component"> + <#return component["./defaultValue/day"]> + + +<#function getDateFieldDefaultValueMonth component"> + <#return component["./monthList/month[@selected='selected']"]> + + +<#function getDateFieldDefaultValueYear component"> + <#return component["./yearList/year[@selected='selected']"]> + + +<#function getDateFieldMonthList component> + <#return component["./monthList/month"]> + + +<#function getDateFieldYearList component> + <#return component["./yearList/year"]> + + +<#function getMonthLabel month> + <#return month["."]> + + +<#function getMonthValue month> + <#return month["./@value"]> + + +<#function getYearLabel year> + <#return year["."]> + + +<#function getYearValue year> + <#return year["./@value"]> + + +<#function getTextAreaRows textArea> + <#return textArea["./rows"]> + + +<#function getTextAreaCols textArea> + <#return textArea["./cols"]> +