AnsweredAssumed Answered

Custom Data List

Question asked by zazugue on May 6, 2016
Latest reply on May 11, 2016 by steven.okennedy
Hello everyone. So i am creating a custom data list to link many Accounts ID. Actually, i am on Alfresco Community 5.0d.
I followed this tutorial http://docs.alfresco.com/5.1/references/dev-extension-points-data-lists.html to make my custom data list but it doesn't show in the list of datalist. I added the two files custom_users_Datalist.xml and custom_users_Datalist_context.xml in the repetory : "\tomcat\shared\classes\alfresco\extension". Where did i made a mistake or mistakes?

So this is my file custom_users_Datalist.xml :

<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="cl:clCustomdatalist" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>Users Datalist</description>
<author></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="http://www.exersys.com/model/datalist/1.0" prefix="cl"/>
</namespaces>
<types>
<!– Data list defintions For this model go here –>
     <type name="cl:clListUsers">
         <title>Liste des utilisateurs</title>
         <description>Liste des utilisateurs Alfresco associés avec les comptes "Mon expert en Gestion" et "I-Suite Expert"</description>
         <parent>dl:dataListItem</parent>

        <properties>
            <property name="cl:clUsersAlf">
                 <title>Utilisateur Alfresco</title>
                 <type>d:text</type>
                 <mandatory>true</mandatory>
            </property>
         <property name="cl:clUsersMEG">
                 <title>Utilsateur MEG</title>
                 <type>d:text</type>
                 <mandatory>true</mandatory>
            </property>
         <property name="cl:clPasswordMEG">
                 <title>Mot de passe MEG </title>
                 <type>d:text</type>
                 <mandatory>true</mandatory>
            </property>
         <property name="cl:clUsersISE">
                 <title>Utilisateur ISE</title>
                 <type>d:text</type>
                 <mandatory>true</mandatory>
            </property>
         <property name="cl:clPasswordISE">
                 <title>Mot de passe ISE</title>
                 <type>d:text</type>
                 <mandatory>true</mandatory>
            </property>
        </properties>
      
      <associations>
             <association name="cl:clAttachments">
                 <title>Attachements</title>
                 <source>
                     <mandatory>false</mandatory>
                     <many>true</many>
                 </source>
                 <target>
                     <class>cm:content</class>
                     <mandatory>false</mandatory>
                     <many>true</many>
                 </target>
             </association>
         </associations>
     </type>
</types>
</model>


My file custom_users_Datalist_context.xml :

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
    <!– Registration of new models –>
    <bean id="org.alfresco.tutorial.customdatalist.dictionaryBootstrap"
          parent="dictionaryModelBootstrap"
          depends-on="dictionaryBootstrap">
    <property name="models">
        <list>
            <value>alfresco/extension/custom_users_Datalist</value>
        </list>
    </property>
</bean>
</beans>


And what i add in the file share-config-custom.xml :

<!– Custom –>
<config evaluator="model-type" condition="cl:clListUsers">
<!– Create item form –>
     <form>
         <field-visibility>
              <show id="cl:clUsersALF" />
              <show id="cl:clUsersMEG"/>
              <show id="cl:clPasswordMEG"/>
           <show id="cl:clUsersISE"/>
           <show id="cl:clPasswordISE"/>           
          </field-visibility>
         <create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
         <appearance>
         <field id="cl:clUsersALF">
                <control template="/org/alfresco/components/form/controls/textarea.ftl" />
            </field>
            <field id="cl:clUsersMEG">
                <control template="/org/alfresco/components/form/controls/textarea.ftl" />
            </field>
            <field id="cl:clPasswordMEG">
                <control>
                    <control-param name="startLocation">{doclib}</control-param>
                </control>
            </field>
         <field id="cl:clUsersISE">
                <control template="/org/alfresco/components/form/controls/textarea.ftl" />
            </field>
            <field id="cl:clPasswordISE">
                <control>
                    <control-param name="startLocation">{doclib}</control-param>
                </control>
            </field>
         </appearance>
     </form>

<!– Data Grid view –>
    <form id="datagrid">
        <field-visibility>
              <show id="cl:clUsersALF" />
              <show id="cl:clUsersMEG"/>
              <show id="cl:clPasswordMEG"/>
              <show id="cl:clUsersISE"/>
              <show id="cl:clPasswordISE"/>           
         </field-visibility>
    </form>
</forms>
</config>

<!– Edit view –>
<config evaluator="node-type" condition="cl:clListUsers">
<forms>
     <!– Edit marketing item form –>
     <form>
          <field-visibility>
              <show id="cl:clUsersALF" />
              <show id="cl:clUsersMEG"/>
              <show id="cl:clPasswordMEG"/>
           <show id="cl:clUsersISE"/>
           <show id="cl:clPasswordISE"/>           
          </field-visibility>
          <create-form template="/org/alfresco/components/data-lists/forms/dataitem.ftl" />
          <appearance>
              <field id="cl:clUsersALF">
                 <control template="/org/alfresco/components/form/controls/textarea.ftl" />
              </field>
              <field id="cl:clUsersMEG">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
              </field>
              <field id="cl:clPasswordMEG">
                  <control>
                      <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                  </control>
              </field>
           <field id="cl:clUsersISE">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
              </field>
              <field id="cl:clPasswordISE">
                  <control>
                      <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                  </control>
              </field>
          </appearance>
     </form>
</forms>
</config>

Outcomes