如何从Freemarker和YUI javascript文件中的alfresco

编程入门 行业动态 更新时间:2024-10-25 16:18:37
本文介绍了如何从Freemarker和YUI javascript文件中的alfresco-global.properties访问值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想在Alfresco的alfresco-global.properties文件中有许多自定义变量,我希望在各种freemarker ftl文件以及各种YUI文件中使用这些自定义变量,这将大大改变Share的行为及其显示信息的方式。

I have numerous custom variables in Alfresco's alfresco-global.properties file that I'd like to use throughout various freemarker ftl files as well as the various YUI files, which will greatly alter the behavior of Share and how it displays information.

我具有可通过各种javascript调用访问的属性值(例如, getNetworkName()将返回自定义 appwork.name 在属性中设置的变量),但我不确定如何将这些javascript函数公开给freemarker或YUI文件,或者我是否需要

I have the property values accessible through various javascript calls (for example, getNetworkName() will return the custom appwork.name variable set in the properties), but I am uncertain of how I'd expose these javascript functions to either freemarker or the YUI files, or if I even need to, as opposed to just accessing the variables directly.

推荐答案

如果已定义了全局变量和函数,则不需要

If you have defined global variables and functions you don't need to do anything special to access them from YUI.

您可以选择执行类似的操作,以利用YUI的 sandboxing 功能,以便每个沙箱都可以通过更改全局配置不会影响其他配置

You can optionally do something like this to take advantage of YUI's sandboxing ability so that each sandbox can't affect the other by changing the global configuration:

YUI_config = { app: { network: { name: 'foo' // or getNetworkName() } } }; YUI().use('node', function (Y) { console.log(Y.config.appwork.name); // foo Y.config.appwork.name = 'bar'; }); YUI().use('tabview', function (Y) { console.log(Y.config.appwork.name); // still foo! });

更多推荐

如何从Freemarker和YUI javascript文件中的alfresco

本文发布于:2023-11-28 09:29:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641853.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件   YUI   Freemarker   alfresco   javascript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!