cancel
Showing results for 
Search instead for 
Did you mean: 

Reading aspect values externally

ljanda
Champ in-the-making
Champ in-the-making
Hello,

I have the following aspect which lists the company's products:


  <aspect name="com:products">
      <title>Our Company Products</title>
      <properties>
   <property name="com:productName">
     <type>d:text</type>
     <mandatory>true</mandatory>
     <constraints>
       <constraint ref="com:productList" />
     </constraints>
   </property>
      </properties>
    </aspect>

But I would like to get values for "comSmiley TongueroductList" dynamically, meaning from an external, if possible XML file.

Do you think it's possible?

Thanks in advance for any help.
2 REPLIES 2

ljanda
Champ in-the-making
Champ in-the-making
I got the following answer on #alfresco channel:

<fufler> ljanda, afaik, it's not possible yet. It's possible to fill this list once (at server startup for example) and then use it as a constraint.
<ljanda> fufler, so in this case I would need to restart the server every time I need to update the list?
<ljanda> fufler, the list of constraint values needs to be included in the content model xml file? Or there's a way hot to connect this content model xml with an external file?

<fufler> ljanda, yes, you need.
<fufler> ljanda, http://blogs.alfresco.com/wp/jbarmash/2008/08/08/dynamic-data-driven-drop-downs-for-list-properties/

mitpatoliya
Star Collaborator
Star Collaborator
Yes, This is what you have to follow.
You have to create your own constrain list which is nothing but a class which extends ListOfValuesConstraint class.
Then override the method getAllowedValues() there you need to have your busineess logic to fetch the list of product from where ever you like.
then you can follow this one
https://forums.alfresco.com/en/viewtopic.php?f=4&t=11687