如何根据环境从 FTL 访问 alfresco-global.properties
how to access alfresco-global.properties from FTL based on environments
我已经扩展了在 alfresco share[webapps/share/WEB-INF/lin/xx.jar] 中部署为单独 jar 的页脚页面,并尝试通过从 alfresco-[=30= 中读取值来显示 ftl 文件中的值] 放在下面 path.Is 是否可以显示全局属性文件中 ftl 文件中的值?此值应根据环境进行更改。
C:\Alfresco\tomcat\shared\classes
露天-global.properties
显示值=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>
</@>
</@>
页脚-extension.xml
<extension>
<modules>
<module>
<id>application Footer Extension</id>
<description>Display Value</description>
<auto-deploy>true</auto-deploy>
<customizations>
<customization>
<sourcePackageRoot>com.xxxts.components.footer</sourcePackageRoot>
<targetPackageRoot>org.alfresco.components.footer</targetPackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>
基本上,您无法像您尝试的那样从 FreeMarker 模板访问全局属性。这样做的根本原因是全局属性是为 Alfresco Repository 而不是 Share 配置的。
如果您想访问可配置属性,最好在 Share 使用的 XML 配置文件中定义它们。
在 Alfresco 论坛上 here 更详细地询问和回答了这个问题。
我已经扩展了在 alfresco share[webapps/share/WEB-INF/lin/xx.jar] 中部署为单独 jar 的页脚页面,并尝试通过从 alfresco-[=30= 中读取值来显示 ftl 文件中的值] 放在下面 path.Is 是否可以显示全局属性文件中 ftl 文件中的值?此值应根据环境进行更改。
C:\Alfresco\tomcat\shared\classes
露天-global.properties
显示值=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>
</@>
</@>
页脚-extension.xml
<extension>
<modules>
<module>
<id>application Footer Extension</id>
<description>Display Value</description>
<auto-deploy>true</auto-deploy>
<customizations>
<customization>
<sourcePackageRoot>com.xxxts.components.footer</sourcePackageRoot>
<targetPackageRoot>org.alfresco.components.footer</targetPackageRoot>
</customization>
</customizations>
</module>
</modules>
</extension>
基本上,您无法像您尝试的那样从 FreeMarker 模板访问全局属性。这样做的根本原因是全局属性是为 Alfresco Repository 而不是 Share 配置的。
如果您想访问可配置属性,最好在 Share 使用的 XML 配置文件中定义它们。
在 Alfresco 论坛上 here 更详细地询问和回答了这个问题。