cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Custom Data Lists

lemmy
Champ in-the-making
Champ in-the-making
Hi,

I was really struggling to create a custom data list in share. I was trying to implement the demo at http://ecmarchitect.com/archives/2010/04/25/1156. I didn't get correctly where which file had to be deployed so I'm documenting it here for the next one… This documentation is just the first shot. You should implement it as Jeff has described it in the video. But you might not be able to do this without a first idea of what to place where.

You need to create the following files.

tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\IssuesDataList\module.properties
tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\IssuesDataList\module-context.xml
tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\IssuesDataList\messages\issues-data-list-model.properties
tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\IssuesDataList\model\issuesDataListModel.xml

tomcat\webapps\share\WEB-INF\classes\share\web-extension\fdk-config-custom.xml

module.properties
# module properties
module.id=IssuesDataList
#module.aliases=none
module.version=0.1
module.title=Issues Data List
module.description=Provides a custom data list type

# The following optional properties can be used to prevent the module from being added
# to inappropriate versions of the WAR file.
module.repo.version.min=3.3
#module.repo.version.max=2.1

module-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>
   
   <bean id="custom.issues.datalist.bootstrapExtraBundlesBean" class="org.alfresco.web.app.ResourceBundleBootstrap">
      <property name="resourceBundles">
         <list>
            <value>alfresco.module.IssuesDataList.messages.issues-data-list-model</value>
         </list>
      </property>
   </bean>
  
    <!– Registration of new models –>
    <bean id="custom.issues.datalist.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
        <property name="models">
            <list>
                <value>alfresco/module/IssuesDataList/model/issuesDataListModel.xml</value>
            </list>
        </property>
    </bean>   
</beans>

issues-data-list-model.properties
scidl_issuesDataListModel.type.scidl_issuesList.title=Issues List
scidl_issuesDataListModel.type.scidl_issuesList.description=A simple issues list with status and optional assignee.
scidl_issuesDataListModel.property.scidl_issueTitle.title=Title
scidl_issuesDataListModel.property.scidl_issueDueDate.title=Due Date
scidl_issuesDataListModel.property.scidl_issueStatus.title=Status
scidl_issuesDataListModel.property.scidl_issueType.title=Type
scidl_issuesDataListModel.property.scidl_issuePriority.title=Priority
scidl_issuesDataListModel.property.scidl_issueNotes.title=Notes
scidl_issuesDataListModel.property.scidl_issueResolution.title=Resolution
scidl_issuesDataListModel.association.scidl_assignee.title=Assignee

issuesDataListModel.xml
<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="scidl:issuesDataListModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>Issues Data List Model</description>
   <author>Jeff Potts</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 uri="http://www.alfresco.org/model/system/1.0" prefix="sys" />
      <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.someco.com/model/issuesDataList/1.0" prefix="scidl" />
   </namespaces>
   
   <constraints>
        <constraint name="scidl:issueStatusList" type="LIST">
         <parameter name="allowedValues">
            <list>
                    <value>New</value>
                    <value>Accepted</value>
                    <value>Started</value>
                    <value>Blocked</value>
                    <value>Resolved</value>
                    <value>Invalid</value>
            </list>
           </parameter>
      </constraint>
        <constraint name="scidl:issueTypeList" type="LIST">
         <parameter name="allowedValues">
            <list>
                    <value>Enhancement</value>
                    <value>Defect</value>
                    <value>Task</value>
            </list>
           </parameter>
      </constraint>
    </constraints>

   <types>
      <type name="scidl:issuesList">
         <title>Issues List</title>
         <parent>dl:dataListItem</parent>
         <properties>
            <property name="scidl:issueTitle">
               <title>Title</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
              </property>
              <property name="scidl:issueDueDate">
               <title>Due Date</title>
               <type>d:datetime</type>
               <mandatory>false</mandatory>
              </property>
              <property name="scidl:issueStatus">
               <title>Status</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="scidl:issueStatusList" />
               </constraints>
            </property>
              <property name="scidl:issueType">
               <title>Type</title>
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="scidl:issueTypeList" />
               </constraints>
              </property>
              <property name="scidl:issuePriority">
               <title>Priority</title>
               <type>d:int</type>
               <mandatory>false</mandatory>
              </property>
              <property name="scidl:issueNotes">
               <title>Notes</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
              </property>
              <property name="scidl:issueResolution">
               <title>Resolution</title>
               <type>d:text</type>
               <mandatory>false</mandatory>
              </property>
         </properties>
         <associations>
            <association name="scidl:assignee">
               <title>Assignee</title>
               <source>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </source>
               <target>
                  <class>cm:person</class>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </target>
            </association>
            <association name="scidl:attachments">
               <title>Attachments</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>
</model>

fdk-config-custom.xml
<alfresco-config>
   <!– scidl:issuesList type –>
   <config evaluator="model-type" condition="scidl:issuesList">
      <forms>
         <!– Create item form –>
         <form>
            <field-visibility>
               <show id="scidl:issueTitle" />
               <show id="scidl:issueType" />
               <show id="scidl:issueDueDate" />
               <show id="scidl:issueStatus" />
               <show id="scidl:issuePriority" />
               <show id="scidl:issueNotes" />
               <show id="scidl:issueResolution" />
               <show id="scidl:assignee" />
               <show id="scidl:attachments" />
            </field-visibility>
            <create-form template="../data-lists/forms/row-new.ftl" />
            <appearance>
               <field id="scidl:issueNotes">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
               </field>
               <field id="scidl:issueResolution">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
               </field>
            </appearance>
         </form>

         <!– Data Grid view –>
         <form id="datagrid">
            <field-visibility>
               <show id="scidl:issueTitle" />
               <show id="scidl:issueType" />
               <show id="scidl:issueStatus" />
               <show id="scidl:issueDueDate" />
               <show id="scidl:issuePriority" />
               <show id="scidl:assignee" />               
            </field-visibility>
         </form>
      </forms>
   </config>

   <!– scidl_issuesList type (existing nodes) –>
   <config evaluator="node-type" condition="scidl:issuesList">
      <forms>
         <!– Data List pop-up edit form –>
         <form>
            <field-visibility>
               <show id="scidl:issueTitle" />
               <show id="scidl:issueStatus" />
               <show id="scidl:issueDueDate" />
               <show id="scidl:issuePriority" />
               <show id="scidl:issueNotes" />
               <show id="scidl:assignee" />
               <show id="scidl:attachments" />
            </field-visibility>
            <edit-form template="../data-lists/forms/row-edit.ftl" />
            <appearance>
               <field id="scidl:issueNotes">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl" />
               </field>
            </appearance>
         </form>
      </forms>
   </config>

</alfresco-config>

Restart the server. You'll find the custom data list 'Issues List' in Share -> Data Lists -> New List.

Hope this help,
Lemmy
3 REPLIES 3

ben
Champ in-the-making
Champ in-the-making
Lemmy, I have moved this post to the Share development Forum as I see it as a more appropriate forum that the Web Quick Start.

Ben.

katchem
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to create custom data list in Alfresco Share 3.4d.
I install alfresco alfresco-community-fdk-3.4.d.amp and alfresco-fdk-3.4.d.jar like tutorials describe http://wiki.alfresco.com/wiki/Forms_Development_Kit#Examples
Then I copy the files that we can find in the example http://forums.alfresco.com/en/viewtopic.php?f=48&t=38553
If I want to create a new dataList into site, appear a new list "issue data list" and I can create one.
That's it's ok so far.
But if I try to create one item for my new list, appear a popUp with this error:

Could not load dialog template from '/share/service/components/form?itemKind=type&itemId=scidl:issuesList&destination=workspace://SpacesStore/a5b0223f-7948-47be-95a0-7c4edb284e47&mode=create&submitType=json&showCancelButton=true'.

Some idea?

Thanks in advance

cjimenez2581
Champ in-the-making
Champ in-the-making
Hi,

I was really struggling to create a custom data list in share. I was trying to implement the demo at http://ecmarchitect.com/archives/2010/04/25/1156. I didn't get correctly where which file had to be deployed so I'm documenting it here for the next one… This documentation is just the first shot. You should implement it as Jeff has described it in the video. But you might not be able to do this without a first idea of what to place where.

You need to create the following files.

tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\IssuesDataList\module.properties
tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\IssuesDataList\module-context.xml
tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\IssuesDataList\messages\issues-data-list-model.properties
tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\IssuesDataList\model\issuesDataListModel.xml

tomcat\webapps\share\WEB-INF\classes\share\web-extension\fdk-config-custom.xml


Hope this help,
Lemmy


I cant change the way the form is shown!! Im seeing others fields like :
Modificador, creator, creation date and more