Order property
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2008 08:46 AM
Hi all,
it's posible get the list of the property in the defined (xml) order?
Eg:
At this point i get the properties map with:
Map<QName, PropertyDefinition> propertyDefsMap = typeDef.getProperties();
This is a map and i lost the sorting.
I want to have this order: Prop1,Prop2,Prop3.
It's possible???
Best regards
Robert.
it's posible get the list of the property in the defined (xml) order?
Eg:
<type name="prfix:Type"> <title>Title</title> <parent>cm:content</parent> <properties> <property name="xxx"> <title>Prop1</title> <type>d:text</type> </property> <property name="yyy"> <title>Prop2</title> <type>d:date</type> </property> <property name="zzz"> <title>Prop3</title> <type>d:text</type> <mandatory>true</mandatory> </property> </properties></type>
At this point i get the properties map with:
Map<QName, PropertyDefinition> propertyDefsMap = typeDef.getProperties();
This is a map and i lost the sorting.
I want to have this order: Prop1,Prop2,Prop3.
It's possible???
Best regards
Robert.
Labels:
- Labels:
-
Archive
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2008 08:57 AM
Is't possible write smth like:
Associated to xml:
All suggestions are welcome!!
Robert.
ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance());Config wizardCfg = svc.getConfig("prfix:Type");ConfigElement typesCfg = wizardCfg.getConfigElement("show-property");
Associated to xml:
<config evaluator="node-type" condition="prfix:Type"> <property-sheet> <show-property name="Prop1" /> <show-property name="Prop2" /> <show-property name="Prop3" /></config>
All suggestions are welcome!!
Robert.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2008 06:05 AM
No, only the config will return the properties in a guaranteed order, getting the property definitions from the model will not necessarily come back in the order defined in the model (as Maps are used)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2008 06:13 AM
I want to get the properties list in config order but i can't do that.
It's possible or not???
It's possible or not???

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2008 09:14 AM
Sorry, I misunderstood your question, yes you can get the properties in config order.
With the config example you provide you must pass an instance of a Node object (org.alfresco.web.bean.repository.Node) to getConfig() not a String, if you want to access the config by string you would have to change the evaluator to be "string-compare".
Presuming you are using a Node you can do the following:
This will return you a list of the properties (in order) that are configured to be displayed.
Hope this helps.
With the config example you provide you must pass an instance of a Node object (org.alfresco.web.bean.repository.Node) to getConfig() not a String, if you want to access the config by string you would have to change the evaluator to be "string-compare".
Presuming you are using a Node you can do the following:
ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance()); Config wizardCfg = svc.getConfig(yourNode); PropertySheetConfigElement props = (PropertySheetConfigElement)wizardCfg.getConfigElement("property-sheet");List<String> propsToShow = props.getItemNamesToShow();
This will return you a list of the properties (in order) that are configured to be displayed.
Hope this helps.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2008 09:24 AM
Ok, it's clear..
But i don't have the node object…
I want to retrive the property list using the content type name (Eg: cm:MyType). This because the node object dosn't exists.
The user chose a type, after the choice, I display a form with the associated properties…
My problem is only the property sorting… :roll: :roll: :roll:
Robert….
But i don't have the node object…
I want to retrive the property list using the content type name (Eg: cm:MyType). This because the node object dosn't exists.
The user chose a type, after the choice, I display a form with the associated properties…
My problem is only the property sorting… :roll: :roll: :roll:
Robert….
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2008 09:47 AM
OK,
i've changed
Now with:
I get all sorted properties list.
Thank's!
Robert.
i've changed
<config evaluator="node-type" condition="ecm:TypeName">
with:<config evaluator="string-compare" condition="ecm:TypeName">
Now with:
ConfigService svc = Application.getConfigService(FacesContext.getCurrentInstance()); Config wizardCfg = svc.getConfig("ecm:TypeName"); PropertySheetConfigElement props = (PropertySheetConfigElement)wizardCfg.getConfigElement("property-sheet"); List<String> propsToShow = props.getItemNamesToShow();
I get all sorted properties list.
Thank's!
Robert.
