cancel
Showing results for 
Search instead for 
Did you mean: 

how to display value in ftl by reading alfresco share global properties

chaituu
Champ in-the-making
Champ in-the-making
I have extended the footer page that is deployed as a separate jar in alfresco share[webapps/share/WEB-INF/lin/xx.jar] and try to display the value in ftl file  by reading the value from alfresco-global.properties that is placed in the below path.Is it possible to display the value in ftl file from global properties file?

C:\Alfresco\tomcat\shared\classes

alfresco-global.properties
**************************
displayValue=xyz

footer.get.html.ftl
*******************

<@markup id="footer-extension-html" target="html" action="replace" scope="global">
   <@uniqueIdDiv>
      <div class="footer ${fc.getChildValue("css-class")!"footer-com"}">
         <span class="copyright">
            <a href="#" onclick="Alfresco.module.getAboutShareInstance().show(); return false;"><img src="${url.context}/res/components/images/${fc.getChildValue("logo")!"alfresco-share-logo.png"}" alt="${fc.getChildValue("alt-text")!"Alfresco Community"}" border="0"/></a>
            <#if licenseHolder != "" && licenseHolder != "UNKNOWN">
               <span class="licenseHolder">${msg("label.licensedTo")} ${licenseHolder}</span><br>
            </#if>
            <span>${msg(fc.getChildValue("label")!"label.copyright")}</span><br><br>
         <span style='margin-left:175px;'><font size="1">Display Value*******</font>:<b><font face="verdana" color="green">${displayValue}</font></b></span>
         </span>
      </div>
   </@>
</@>


footer-extension.xml
*********************

<extension>
    <modules>
        <module>
            <id> Footer Extension</id>
            <description>version</description>
            <auto-deploy>true</auto-deploy>
            <customizations>
                <customization>
                    <sourcePackageRoot>com.components.footer</sourcePackageRoot>
                    <targetPackageRoot>org.alfresco.components.footer</targetPackageRoot>
                </customization>
            </customizations>
        </module>
    </modules>
</extension>

2 REPLIES 2

niketapatel
Star Contributor
Star Contributor
No, You can not access alfresco-global.properties values directly in Share side FTL or js.

Possible option is Create Repository level java backed web-script and inject global property as dependency and then get value in Share script by calling repo web-script.

Not sure about your requirement but better you can use footer.get.properties file.

chaituu
Champ in-the-making
Champ in-the-making
My requirement is I need to access the value in share side FTL from alfresco-global.properties.As you said I can keep the value in footer.get.properties but if i want to change the value then I need the give the build for every environment.this value should be changed based on the environment(UAT,QA,PROD).
Getting started

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.