AnsweredAssumed Answered

Cannot create Custom Data list

Question asked by dobrolub on Mar 5, 2014
Latest reply on Jun 21, 2016 by steven.okennedy
Hi,

I am fighting with Alfresco 4.2.0 and creating of custom datalists. And followed many tutorials, but nothing is working.

I updated /tomcat/shared/classes/alfresco/web-extension/share-config-custom.xml like this (I added this code on the end of file)


   <!– MyCompany 22 list –>
   <config evaluator="model-type" condition="MyCompany:simpleList2">
      <forms>
         <!– Create item form –>
         <form>
            <field-visibility>
               <!– for the form creation we are showing everything except approved date –>
               <show id="MyCompany:ID" />
               <show id="MyCompany:customerNumber" />               
            </field-visibility>
            <create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
            <appearance>
               <field id="MyCompany:ID">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
               </field>
               <field id="MyCompany:customerNumber">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
               </field>
            </appearance>
         </form>
         
         <!– Data Grid view –>
         <form id="datagrid">
            <field-visibility>
               <show id="MyCompany:ID" />
               <show id="MyCompany:customerNumber" />
            </field-visibility>
         </form>
      </forms>
   </config>

   <config evaluator="node-type" condition="MyCompany:simpleList">
      <forms>

         <!– Edit marketing item form –>
         <form>
            <field-visibility>
               <show id="MyCompany:ID" />
               <show id="MyCompany:customerNumber" />
            </field-visibility>
            <create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
            <appearance>
               <field id="MyCompany:ID">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
               </field>
               <field id="MyCompany:customerNumber">
                  <control template="/org/alfresco/components/form/controls/textfield.ftl" />
               </field>                           
            </appearance>
         </form>
      </forms>
   </config>
   
   <!– MyCompany 22 list –>


Then I Created file:
/tomcat/shared/classes/alfresco/extension/myCompany2DatalistModel.xml

<?xml version="1.0" encoding="UTF-8"?>

<!– Definition of new Model –>

<model name="MyCompany:MyCompany2Datalist" xmlns="http://www.alfresco.org/model/dictionary/1.0" xmlns:MyCompany="http:/MyCompany.com">

   <!– Optional meta-data about the model –>
   <description>MyCompany22 custom datalist</description>
   <author>Maryniak</author>
   <version>1.0</version>

   <!– Imports are required to allow references to definitions in other models –>
   <imports>
      <!– Import Alfresco Dictionary Definitions –>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <!– Import Alfresco Content Domain Model Definitions –>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
      <!– Import Alfresco Data List Model Definitions –>
      <import uri="http://www.alfresco.org/model/datalist/1.0" prefix="dl" />
   </imports>

   <!– Introduction of new namespaces defined by this model –>
   <namespaces>
      <namespace uri="MyCompany.customlists.com" prefix="MyCompany" />
   </namespaces>


   <!– T Y P E D E F I N I T I O N S –>
   <types>
      <!– Data list defintions For this model go here –>
      <type name="MyCompany:simpleList2">
         <title>MyCompany 222 simple list</title>
         <description>MyCompany simple list</description>
         <parent>dl:dataListItem</parent>
         <properties>
            <property name="MyCompany:ID">
               <title>Id</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="MyCompany:customerNumber">
               <title>Customer number</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
            </property>            
         </properties>
         
         
      </type>
   </types>
</model>


And the file  /tomcat/shared/classes/alfresco/extension/MyCompany2DatalistModel.xml

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>

   
   <bean id="extension.MyCompany2.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/extension/MyCompany2DatalistModel.xml</value>
            </list>
        </property>
    </bean>   

</beans>


Then I restarted TomCat, then I investigated logs. No error. Everything looks ok. BUt when I click to "New list", my list is not there.

Thank you very much.

BR.

Lubomir

Outcomes