cancel
Showing results for 
Search instead for 
Did you mean: 

Create custom datalist in alfresco community 5.2

anandhan
Star Contributor
Star Contributor

Hi,

I am getting error while creating custom Custom Datalist in alfresco community 5.2

Steps followed :

Step 1: Created CustomDataListModel.xml and put it inside the directory "\alfresco-community\tomcat\shared\classes\alfresco\extension\".

Step 2: Created CustomDataListModel-context.xml and put it inside the directory "\alfresco-community\tomcat\shared\classes\alfresco\extension\".

Step 3: Created CustomDataListModel.properties and put it inside the directory "\alfresco-community\tomcat\shared\classes\alfresco\extension\".

Step 4: Added below code in share-config-custom and put it inside the directory "\alfresco-community\tomcat\shared\classes\alfresco\web-extension\".

    <config evaluator="node-type" condition="CU:CustomDataListModel">
        <forms>
            <form>
                <field-visibility>
                    <show id="CU:id" />
                    <show id="CUSmiley FrustratediteName" />
                    <show id="CUSmiley FrustratediteDescription" />
                </field-visibility>
                <edit-form template="../data-lists/forms/dataitem.ftl" />
                <appearance>
                    <field id="CU:id">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl"/>                       
                    </field>
                    <field id="CUSmiley FrustratediteName">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl"/>                       
                    </field>
                    <field id="CUSmiley FrustratediteDescription">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl"/>                       
                    </field>
                </appearance>
            </form>
        </forms>
    </config>

<!-- Task List Datalist Model -->
    <config evaluator="model-type" condition="CU:CustomDataListModel">
        <forms>
            <form>
                <field-visibility>
                    <show id="CU:id" />
                    <show id="CUSmiley FrustratediteName" />
                    <show id="CUSmiley FrustratediteDescription" />
                </field-visibility>
                <create-form template="../data-lists/forms/dataitem.ftl" />
                <appearance>
                    <field id="CU:id">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl"/>                       
                    </field>
                    <field id="CUSmiley FrustratediteName">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl"/>                       
                    </field>
                    <field id="CUSmiley FrustratediteDescription">
                        <control template="/org/alfresco/components/form/controls/textfield.ftl"/>                       
                    </field>
                </appearance>
            </form>
 
            <form id="datagrid">
                <field-visibility>
                    <show id="CU:id" />
                    <show id="CUSmiley FrustratediteName" />
                    <show id="CUSmiley FrustratediteDescription" />
                </field-visibility>
            </form>
        </forms>
    </config>


Step 5: Finally restarted the alfresco server. I am getting the error and I am not able to login. I am getting the below error while trying to login.

After revert the code from share-config-custom in step 4. I am able to login.

Here I have attached all the files. Can you please verify it. Please let me know, if I made any mistake.

1 ACCEPTED ANSWER

alxgomz
Employee
Employee

You are copying you properties file to "\alfresco-community\tomcat\shared\classes\alfresco\extension\" while your context file defines:

<property name="labels">
    <list>
        <value>alfresco.extension.messages.CustomDataListModel</value>
    </list>
</property>

move your properties file to "\alfresco-community\tomcat\shared\classes\alfresco\messages\" and fix your context file as follow:

<property name="labels">
    <list>
        <value>alfresco.messages.CustomDataListModel</value>
    </list>
</property>

View answer in original post

2 REPLIES 2

alxgomz
Employee
Employee

You are copying you properties file to "\alfresco-community\tomcat\shared\classes\alfresco\extension\" while your context file defines:

<property name="labels">
    <list>
        <value>alfresco.extension.messages.CustomDataListModel</value>
    </list>
</property>

move your properties file to "\alfresco-community\tomcat\shared\classes\alfresco\messages\" and fix your context file as follow:

<property name="labels">
    <list>
        <value>alfresco.messages.CustomDataListModel</value>
    </list>
</property>

anandhan
Star Contributor
Star Contributor

Thanks you very much Alexandre Chapellon. Issue got resolved.