11-23-2016 02:40 PM
I have a question on how to get dynamic property value in aikau page .
Actually the scenario is , for my tabbed pane - I need to have the tab header names dynamically from a property file and also that I don't need to build amps for this.
For eg:
1. For aikau page:
/test-share-amp/src/main/amp/config/alfresco/web-extension/site-webscripts/com/test/share/pages/test-imp-custom/test-imp-custom.get.js
gets the property values from :
/test-share-amp/src/main/amp/config/alfresco/web-extension/site-webscripts/com/test/share/pages/test-imp-custom/test-imp-custom.get.properties
But need the values to be configured in a property at deployment time so that , i don't have to build the amp again at higher environment.
2. Similarly , For aikau Widget:
test-share-amp/src/main/amp/web/js/com/test/testcustom/alfresco/services/TestCustomService.js
gets the property values from :
/test-share-amp/src/main/amp/web/js/com/test/testcustom/alfresco/services/i18n/TestCustom.properties
But need the values to be configured in a property at deployment time so that , i don't have to build the amp again at higher environment.
Actually my widget - TestCustomService.js uses different urls to fetch content from different repositories.But I need to configure the urls in a property file to be pulled in widget at deployment time and not in the property file TestCustom.properties (above) since I will have to build the amps every time for different environment.
Also let us know any workaround if alfresco-global.properties can be used in my case.
Thanks in advance.
11-24-2016 04:30 AM
I think the best approach to solve this would be to create your properties file somewhere within the Repository (so that you can dynamically edit it) and then create a Repository-tier WebScript that provides a REST API that can be called from the JavaScript controller of your Share-tier that is building the model for your Aikau page.
Each time the page is loaded the properties file would be used to provide the headings for your tabs. By accessing a properties file that is within the Repository it would mean that you could dynamically make updates without restarting either server.
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.