cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot create Custom Data list

dobrolub
Champ in-the-making
Champ in-the-making
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
3 REPLIES 3

dzdarek
Champ in-the-making
Champ in-the-making
I have same issue of sample "Book List" not showing up in the list of Data Lists in Share.

I have used example from http://code.google.com/p/share-extras/wiki/DataLists

wattletimber
Champ in-the-making
Champ in-the-making
I have a similar issue as dobrolub. Tried to do follow link provided by dzdarek to no avail.Can anyone help, am running a production server but the challenge is ruuning the amps again may delete all the files running properly. If you encourage me to run it, how can i do it while preserving my data.

steven_okennedy
Star Contributor
Star Contributor
Hi WT,

First of all, don't attempt to do development on your production server - it will only end in tears.  Verify what you want to do on a development (and ideally, a controlled test) instance first (might just be an Alfresco install on your laptop, or using the Alfresco SDK) and when you're happy only put it into production

Custom data lists are reasonably straightforward things, there are two parts to them:
<li>A custom model with a type that inherits from dl:dataListItem</li>
<li>and some Share configuration that defines forms for viewing/creating list items and a pseudo form for showing which columns you want to display on the list itself</li>

Share will automatically pick up any types that exist in the system that have dl:dataListItem as a parent and use their names as a list of Data List types you can create in the New Data List dialog.

Generally problems people have with custom data lists fall into 2 types, the new data list type not being available at all in the New Data List dialog, or the create/edit item forms not showing the right data.

If it's the first problem, it generally means that your model is not being loaded correctly and you have the code deployed in the wrong place or an issue with the context file that bootstraps the model.

What have you actually deployed/installed and how have you installed it?

Regards

Steven