cancel
Showing results for 
Search instead for 
Did you mean: 

No Constraints in PropertyList

ddanninger
Champ in-the-making
Champ in-the-making
Hi,

i try to get a list of a custom Content model. It works so far, but if i want to know the Constraints of a Property its just blank. How comes? Did i do something wrong or is it a bug?

So if i get the JSON Result of the WebScript: "http://192.168.254.128:8080/alfresco/service/api/classes/cx_doc/property/cx_language"

It returns me :

{

    * name: "cx:language"
    * title: "Language"
    * defaultValues: ""
    * dataType: "d:text"
    * multiValued: true
    * mandatory: false
    * enforced: false
    * protected: false
    * indexed: true
    * indexedAtomically: true
    * constraints: [ ]
    * url: "/api/property/cx_language"

}

But i added some Constraints to the Custom Content Model see my Snippets:


…..
…..
…..
<constraint name="cx:languageList" type="LIST">
            <parameter name="allowedValues">
                <list>
                    <value>German</value>
                    <value>English</value>
                    <value>Russian</value>
          <value>Italian</value>
          <value>Turkish</value>
          <value>Czech</value>
          <value>Slovak</value>
          <value>Hungarian</value>
                    <value>Serb</value>
                    <value>Uzbek</value>
                    <value>Spanish</value>
                </list>
            </parameter>
        </constraint>

….
….
….

<property name="cx:language">
               <title>Language</title>
               <type>d:text</type>
               <multiple>true</multiple>
               <constraints>
                  <constraint ref="cx:languageList" />
               </constraints>
            </property>


Does anybody have an idea whats going on in here?

Best regards
Dominik


I use the Alfresco 3.3 Community Version on Debian Lenny
12 REPLIES 12

scouil
Star Contributor
Star Contributor
Same here I'm currently running it without any problem for now.
To remember to edit with upgrade I got a README.txt in my application folder.

But as ddanninger said, the fix will hopefully make its way to a community version soon so you won't need to patch that file anymore. (a few modifications will be needed in your webservice though since the json won't be exactly the same)

ddelapasse
Champ in-the-making
Champ in-the-making
So 4 years later…this section is still commented.  Scouil's solution works great, but why is it STILL commented?  Can anyone tell if there is an existing issue for this?

ddelapasse
Champ in-the-making
Champ in-the-making
Can I add the correction to my amp to overwrite the built-in version?  It seems to work just fine.  I don't understand why it's commented out.

Can someone tell me the magical folder hierarchy where it must be placed in the amp to overwrite this script?  I know this is improper, but I really need the GET /classes functionality to return the correct constraints along with the constrained properties!  What is the best way?