AnsweredAssumed Answered

Impossible de récupérer la liste de valeurs avec CMIS

Question asked by elemaistre on Jan 7, 2011
Latest reply on Jan 21, 2011 by elemaistre
Bonjour,

j'utilise CMIS pour récupérer la liste des valeurs définies dans un modèle customisé sur une propriété. La liste retournée a la bonne taille mais toutes les valeurs sont nulles.

Extrait JUnit :

        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());
                }
            }
        }

Extrait logs :

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]]]

Extrait modèle :

        <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>


pour info,
OS: Linux Ubuntu 10-10 64 bits
Installation "standard" tomcat/MySql

Outcomes