cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic loading of property file

shubhada
Champ in-the-making
Champ in-the-making
I am working on alfresco 4.0.2.9
My requirement is , I have an aspect with dropdown values. Say Country. This dropdown values are fetched from a property file.The property file is loading on bootstrap of alfresco. I want to add some additional entries to county list and get it reflected without restarting alfresco. 

1.action-context.xml
<bean id="metadataResourceBundle"
      class="org.springframework.extensions.surf.util.ResourceBundleBootstrapComponent">
      <property name="resourceBundles">
         <list>
            <value>alfresco.extension.messages.countryList</value>
         </list>
      </property>
</bean>

2. countryList.properties
country=Andorra~AD|United Arab Emirates~AE|Afghanistan~AF|Antigua and Barbuda~AG|Anguilla~AI|Albania~AL|Armenia~AM|Netherlands Antilles~AN|Angola~AO|Antarctica~AQ|Argentina~AR|American Samoa~AS|Austria~AT|Australia~AU|Aruba~AW|Azerbaijan~AZ|Bosnia Herzegowina~BA|South Africa~ZA

3. Attaching the screenshot of content with dropdown.

I have added a test value at the end
country=Andorra~AD|United Arab Emirates~AE|Afghanistan~AF|Antigua and Barbuda~AG|Anguilla~AI|Albania~AL|Armenia~AM|Netherlands Antilles~AN|Angola~AO|Antarctica~AQ|Argentina~AR|American Samoa~AS|Austria~AT|Australia~AU|Aruba~AW|Azerbaijan~AZ|Bosnia Herzegowina~BA|South Africa~ZA|Test~tst

Unless I restart server, it is not reflecting in the dropdown. Is there any way to dynamically load it ?

Thanks,
Shubhada
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
One way to achieve that upload that property file in alfresco and read values from that property file.By that way you can always edit it from alfresco and it will be reflected straight away.

shubhada
Champ in-the-making
Champ in-the-making
Thanks for the reply mitpatoliya,


I have placed it in Path, Path= ""/app:company_home/cm:countryList""
On startup of alfresco I am trying to search this node ,but search service is not available at that point of time as server is not yet up. It tries to search and get stuck on startup.
Any other suggestions for this implementation ?

Thanks,