11-01-2016 11:16 AM
Hello, Alfresco Community!
I'm trying to implement hierarchical drop down list to classify custom business process.
I need something like this:
1. Some 1 level string
1.1 Some 2 level string
1.2 ......
2. Another 1 level string
2.1 ....
I've decided to create content model for this:
<type name="scr:catalogBase">
<title>Catalog Base</title>
<parent>dl:dataListItem</parent>
<properties>
<property name="scr:title">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="scr:ordering">
<type>d:int</type>
<mandatory>true</mandatory>
</property>
<property name="scr:isLeaf">
<type>d:boolean</type>
<mandatory>true</mandatory>
</property>
</properties>
<associations>
<child-association name="scr:catalogElements">
<title>childAssociation</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>scr:catalogBase</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</child-association>
</associations>
</type>
<type name="scr:catalogBase">
<title>Catalog Base</title>
<parent>dl:dataListItem</parent>
<properties>
<property name="scr:title">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="scr:ordering">
<type>d:int</type>
<mandatory>true</mandatory>
</property>
<property name="scr:isLeaf">
<type>d:boolean</type>
<mandatory>true</mandatory>
</property>
</properties>
<associations>
<child-association name="scr:catalogElements">
<title>childAssociation</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>scr:catalogBase</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</child-association>
</associations>
</type>
Some pseudo code to show how to I'm creating list:
var mySiteNode = s nodeService.getNode(noderef);
var node1 = mySiteNode.createNode("Some 1 level");
var node2 = mySiteNode.createNode("Another 1 level");
node1.createNode("some 2 level");
node2.createNode("another 2 level");
I can't find any solution how to make hierarchical drop down list for my content model. Is there any OOTB solution for this?
I'm beginner with alfresco. Maybe you could provide a better solution to create hierarchical drop down list against my.
Thanks
11-02-2016 04:50 AM
Maybe you can find some component ready for your requirements:
5 Alfresco picklist plugins you can’t miss • SoftwareLoop
Or you can inspect that projects source code to build your own.
11-03-2016 09:51 AM
you can use properties tag like this to get DropDown List
<property name="scr:typeOfDonation">
<type>d:text</type>
<default>Donation</default>
<constraints>
<constraint type="LIST">
<parameter name="allowedValues">
<list>
<value>Donation</value>
<value>Accomodation</value>
<value>Meeting</value>
</list>
</parameter>
</constraint>
</constraints>
</property>
11-09-2016 01:16 PM
This addon does exactly what you need
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.