在 Alfresco Share 中存储和使用配置值
我有一个自定义开发的共享小面板,它具有正在使用的硬编码值(例如用作默认值的工作空间的名称)。
我宁愿将值放入配置文件中,并让小面板在服务器启动时读取文件并从那里开始工作。我有两个问题:
- 我可以使用哪个文件以及我可以将文件放在哪里?
- 如何让共享小面板读取文件内容并将数据加载到局部变量中?
I have a custom developed share dashlet that has hardcoded values in use (For example the name of a Workspace to use as a default).
I would rather have the values placed into a configuration file and have the dashlet read the fileup at server start and work from there. I have two questions:
- Which file can I use and where can I place the file?
- How can I get the share dashlet to read the file contents and load the data into local variables?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议您利用 PreferenceService,可以通过使用存储库公开的以下 API 从共享 Web 脚本进行访问:
通过这种方式,您可能需要定义一些硬编码的有意义的默认值,然后让用户自定义他的体验并存储自定义设置作为用户偏好。
I would advise you to leverage the PreferenceService, which can be accessed from a Share Web Script by consuming the following API exposed by the repository:
In this way you will probably need to define some hard coded meaningful defaults, then let the user customize his experience and store the customized settings as user preferences.