Dynamic loading of property file
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2015 05:16 AM
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
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
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-15-2015 08:59 AM
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-21-2015 01:48 AM
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,
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,
