Session s = sessionFactory.createSession(parameter);
RepositoryInfo info = s.getRepositoryInfo();
ObjectType ot = s.getTypeDefinition("D:toto:doc");
for (Map.Entry<String, PropertyDefinition<?>> entry : ot.getPropertyDefinitions().entrySet()) {
if (entry.getKey().startsWith("toto:")) {
PropertyDefinition<?> pd = entry.getValue();
List<?> choices = pd.getChoices();
for (Object o : choices) {
Choice c = (Choice) o;
System.out.println(c.getDisplayName() + " = " + c.getValue());
}
}
}
toto:media = Property Definition [id=toto:media, display name=Media, description=Media, local name=media, local namespace=http://www.toto.fr/model/toto/1.0, query name=toto:media, property type=STRING, cardinality=SINGLE, choice list=[color=#FF0000][][/color], default value=null, is inherited=false, is open choice=false, is queryable=true, is required=false, updatability=READWRITE][extensions=[[cmis:choiceString: null], [cmis:choiceString: null], [cmis:choiceString: null]]]
toto:sens = Property Definition [id=toto:sens, display name=Sens, description=Sens, local name=sens, local namespace=http://www.toto.fr/model/toto/1.0, query name=toto:sens, property type=STRING, cardinality=SINGLE, choice list=[], default value=null, is inherited=false, is open choice=false, is queryable=true, is required=false, updatability=READWRITE][extensions=[[cmis:choiceString: null], [cmis:choiceString: null], [cmis:choiceString: null]]]
<constraint name="toto:media_constraint" type="LIST">
<parameter name="allowedValues">
<list>
<value />
<value>Courrier</value>
<value>Email</value>
</list>
</parameter>
</constraint>
<constraint name="toto:sens_constraint" type="LIST">
<parameter name="allowedValues">
<list>
<value />
<value>Entrant</value>
<value>Sortant</value>
</list>
</parameter>
</constraint>
…
<type name="toto:doc">
<title>Document</title>
<parent>cm:content</parent>
<properties>
<property name="toto:media">
<title>Media</title>
<type>d:text</type>
<mandatory>false</mandatory>
<constraints>
<constraint ref="toto:media_constraint" />
</constraints>
</property>
<property name="toto:sens">
<title>Sens</title>
<type>d:text</type>
<mandatory>false</mandatory>
<constraints>
<constraint ref="toto:sens_constraint" />
</constraints>
</property>
</properties>
<associations>
<association name="toto:relatedDocument">
<title>Related Documents</title>
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>toto:doc</class>
<mandatory>false</mandatory>
<many>true</many>
</target>
</association>
</associations>
</type>
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.