vendredi 24 juin 2016

Checkbox not showing at custom datalist in Alfresco

I've been trying to help one of my colleagues with an issue with Alfresco custom datalists. We are using Alfresco Community 5.0.d

We have a custom datalist in which there is a checkbox in one of the fields.

The code in both sides looks the same to us... The file checkbox.ftl is inside the same place in both places, and it is exactly the same file. We have also rebuilt the indices just in case which as far as I have understood it won't be necessary in this case. All the datalist works correctly except the checkbox. We have seen that the 'input type="checkbox"' is not in the view generated at the production side. We have no clue where to look. I'm about to copy all the modified/added file for this matter. If you need any extra information just tell me and I will gladly provide it.

In the test environment, we have managed to make it work using the following code:

<model name="datos:datosModel"
xmlns="http://ift.tt/Ug9ed4">
<!-- Optional meta-data about the model -->
<description>Custom Datalist</description>
<author>Maria Royo</author>
<version>1.0</version>
<imports>
    <!-- Import Alfresco Dictionary Definitions -->
    <import uri="http://ift.tt/Ug9ed4" prefix="d"/>
    <!-- Import Alfresco Content Domain Model Definitions -->
    <import uri="http://ift.tt/YEoK2B" prefix="cm"/>
    <!--Import Alfresco Data List Model Definitions -->
    <import uri="http://ift.tt/28X0J1m" prefix="dl"/>
</imports>
<!-- Introduction of new namespaces defined by this model -->
<!-- NOTE: The following namespace custom.model should be changed to reflect your own namespace -->
<namespaces>
    <namespace uri="datos.datosModel" prefix="datos"/>
</namespaces>
<!-- Tipo de dato combobox -->
<!-- Scope-->
<constraints>
    <constraint name="datos:Scope" type="LIST">
        <parameter name="allowedValues">
            <list>
                <value>ESA</value>
                <value>IOT</value>
                <value>Internal</value>
            </list>
        </parameter>
    </constraint>
</constraints>
<types>
    <!-- Data list defintions For this model go here -->
    <type name="datos:datosTabla">
        <title>Document Library</title>
        <description>Document Library del EMIS</description>
        <parent>dl:dataListItem</parent>
        <properties>
            <property name="datos:datosID">
                <title>Reference</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosTitle">
                <title>Title</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosVersions">
                <title>Versions</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosIncr">
                <title>Increment</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosUpdate">
                <title>Last Update</title>
                <type>d:date</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosDRD">
                <title>DRD Reference</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosScope">
                <title>Scope</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
                <constraints>
                    <constraint ref="datos:Scope" />
                </constraints>
            </property>
            <property name="datos:datosRemarks">
                <title>Remarks</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <!-- Type Checkbox -->
            <property name="datos:datosDel">
                <title>Delivered</title>
                <description>Active</description>
                <type>d:boolean</type>
            </property>
        </properties>
        <associations>
            <association name="datos:datosAttachments">
                <title>Link</title>
                <source>
                    <mandatory>false</mandatory>
                    <many>true</many>
                </source>
                <target>
                    <class>cm:cmobject</class>
                    <mandatory>false</mandatory>
                    <many>true</many>
                </target>
            </association>
        </associations>
    </type>
</types>

This is the code we have at the production environment:

<model name="datos:datosModel"
xmlns="http://ift.tt/Ug9ed4">
<!-- Optional meta-data about the model -->
<description>Custom Datalist</description>
<author>Maria Royo</author>
<version>1.0</version>
<imports>
    <!-- Import Alfresco Dictionary Definitions -->
    <import uri="http://ift.tt/Ug9ed4" prefix="d"/>
    <!-- Import Alfresco Content Domain Model Definitions -->
    <import uri="http://ift.tt/YEoK2B" prefix="cm"/>
    <!--Import Alfresco Data List Model Definitions -->
    <import uri="http://ift.tt/28X0J1m" prefix="dl"/>
</imports>
<!-- Introduction of new namespaces defined by this model -->
<!-- NOTE: The following namespace custom.model should be changed to reflect your own namespace -->
<namespaces>
    <namespace uri="datos.datosModel" prefix="datos"/>
</namespaces>
<!-- Tipo de dato combobox -->
<!-- Scope-->
<constraints>
    <constraint name="datos:Scope" type="LIST">
        <parameter name="allowedValues">
            <list>
                <value>ESA</value>
                <value>IOT</value>
                <value>Internal</value>
            </list>
        </parameter>
    </constraint>
</constraints>
<types>
    <!-- Data list defintions For this model go here -->
    <type name="datos:datosTabla">
        <title>E-USOC Document Library</title>
        <description>E-USOC Document Library</description>
        <parent>dl:dataListItem</parent>
        <properties>
            <property name="datos:datosID">
                <title>Reference</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosTitle">
                <title>Title</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosVersions">
                <title>Versions</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosIncr">
                <title>Increment</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosUpdate">
                <title>Last Update</title>
                <type>d:date</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosDRD">
                <title>DRD Reference</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <property name="datos:datosScope">
                <title>Scope</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
                <constraints>
                    <constraint ref="datos:Scope" />
                </constraints>
            </property>
            <property name="datos:datosRemarks">
                <title>Remarks</title>
                <type>d:text</type>
                <mandatory>false</mandatory>
            </property>
            <!-- Type Checkbox  -->
            <property name="datos:datosDel">
                <title>Delivered</title>
                <description>Delivered</description>
                <type>d:boolean</type>
            </property>
        </properties>
        <associations>
            <association name="datos:datosAttachments">
                <title>Link</title>
                <source>
                    <mandatory>false</mandatory>
                    <many>true</many>
                </source>
                <target>
                    <class>cm:cmobject</class>
                    <mandatory>false</mandatory>
                    <many>true</many>
                </target>
            </association>
        </associations>
    </type>
</types>

Both files are inside the same directory which is:

/alfresco-5.0.d/tomcat/shared/classes/alfresco/extension

Also, we have this code inside the:

/alfresco-5.0.d/tomcat/shared/classes/alfresco/web-extension/share_config_custom.xml

At test environment the code is as follow:

<config evaluator="model-type" condition="datos:datosTabla">
    <forms>
        <!-- Create item form -->
        <form>
            <field-visibility>
                <show id="datos:datosID" />
                <show id="datos:datosTitle" />
                <show id="datos:datosAttachments" />
                <show id="datos:datosVersions" />
                <show id="datos:datosIncr" />
                <show id="datos:datosUpdate" />
                <show id="datos:datosDRD" />
                <show id="datos:datosScope" />
                <show id="datos:datosDel" />
                <show id="datos:datosRemarks" />
            </field-visibility>
            <create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
            <appearance>
                <field id="datos:datosID">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosTitle">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosAttachments">
                    <control>
                        <control-param name="startLocation">{doclib}</control-param>
                    </control>
                </field>
                <field id="datos:datosVersions">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosIncr">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosUpdates">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosDRD">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosScope">
                    <control template="/org/alfresco/components/form/controls/selectone.ftl" />
                </field>
                <field id="datos:datosDel">
                    <control template="/org/alfresco/components/form/controls/checkbox.ftl" />
                </field>
                <field id="datos:datosRemarks">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
            </appearance>
        </form>
        <!--Data Grid view-->
        <form id="datagrid">
            <field-visibility>
                <show id="datos:datosID" />
                <show id="datos:datosTitle" />
                <show id="datos:datosAttachments" />
                <show id="datos:datosVersions" />
                <show id="datos:datosIncr" />
                <show id="datos:datosUpdate" />
                <show id="datos:datosDRD" />
                <show id="datos:datosScope" />
                <show id="datos:datosDel" />
                <show id="datos:datosRemarks" />
            </field-visibility>
        </form>
    </forms>
</config>
<!-- Edit view -->
<config evaluator="node-type" condition="datos:datosTabla">
    <forms>
     Edit marketing item form 

        <form>
            <field-visibility>
                <show id="datos:datosID" />
                <show id="datos:datosTitle" />
                <show id="datos:datosAttachments" />
                <show id="datos:datosVersions" />
                <show id="datos:datosIncr" />
                <show id="datos:datosUpdate" />
                <show id="datos:datosDRD" />
                <show id="datos:datosScope" />
                <show id="datos:datosDel" />
                <show id="datos:datosRemarks" />
            </field-visibility>
            <create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
            <appearance>
                <field id="datos:datosID">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosTitle">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosAttachments">
                    <control>
                        <control-param name="startLocation">{doclib}</control-param>
                    </control>
                </field>
                <field id="datos:datosVersions">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosIncr">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosUpdates">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosDRD">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosScope">
                    <control template="/org/alfresco/components/form/controls/selectone.ftl" />
                </field>
                <field id="datos:datosDel">
                    <control template="/org/alfresco/components/form/controls/checkbox.ftl" />
                </field>
                <field id="datos:datosRemarks">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
            </appearance>
        </form>
    </forms>
</config>

And finally the code in the production environment:

<config evaluator="model-type" condition="datos:datosTabla">
    <forms>
        <!-- Create item form -->
        <form>
            <field-visibility>
                <show id="datos:datosID" />
                <show id="datos:datosTitle" />
                <show id="datos:datosAttachments" />
                <show id="datos:datosVersions" />
                <show id="datos:datosIncr" />
                <show id="datos:datosUpdate" />
                <show id="datos:datosDRD" />
                <show id="datos:datosScope" />
                <show id="datos:datosDel" />
                <show id="datos:datosRemarks" />
            </field-visibility>
            <create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
            <appearance>
                <field id="datos:datosID">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosTitle">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosAttachments">
                    <control>
                        <control-param name="startLocation">{doclib}</control-param>
                    </control>
                </field>
                <field id="datos:datosVersions">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosIncr">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosUpdates">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosDRD">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosScope">
                    <control template="/org/alfresco/components/form/controls/selectone.ftl" />
                </field>
                <field id="datos:datosDel">
                    <control template="/org/alfresco/components/form/controls/checkbox.ftl" />
                </field>
                <field id="datos:datosRemarks">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
            </appearance>
        </form>
        <!--Data Grid view-->
        <form id="datagrid">
            <field-visibility>
                <show id="datos:datosID" />
                <show id="datos:datosTitle" />
                <show id="datos:datosAttachments" />
                <show id="datos:datosVersions" />
                <show id="datos:datosIncr" />
                <show id="datos:datosUpdate" />
                <show id="datos:datosDRD" />
                <show id="datos:datosScope" />
                <show id="datos:datosDel" />
                <show id="datos:datosRemarks" />
            </field-visibility>
        </form>
    </forms>
</config>
<!-- Edit view -->
<config evaluator="node-type" condition="datos:datosTabla">
    <forms>
        <!-- Edit marketing item form -->
        <form>
            <field-visibility>
                <show id="datos:datosID" />
                <show id="datos:datosTitle" />
                <show id="datos:datosAttachments" />
                <show id="datos:datosVersions" />
                <show id="datos:datosIncr" />
                <show id="datos:datosUpdate" />
                <show id="datos:datosDRD" />
                <show id="datos:datosScope" />
                <show id="datos:datosDel" />
                <show id="datos:datosRemarks" />
            </field-visibility>
            <create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
            <appearance>
                <field id="datos:datosID">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosTitle">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosAttachments">
                    <control>
                        <control-param name="startLocation">{doclib}</control-param>
                    </control>
                </field>
                <field id="datos:datosVersions">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosIncr">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosUpdates">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosDRD">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
                <field id="datos:datosScope">
                    <control template="/org/alfresco/components/form/controls/selectone.ftl" />
                </field>
                <field id="datos:datosDel">
                    <control template="/org/alfresco/components/form/controls/checkbox.ftl" />
                </field>
                <field id="datos:datosRemarks">
                    <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                </field>
            </appearance>
        </form>
    </forms>
</config>




Aucun commentaire:

Enregistrer un commentaire