Alfresco Share Aikau PathTree 显示文档而不仅仅是文件夹
Alfresco Share Aikau PathTree to show documents not just folders
我正在开发一个 Aikau 共享页面,其中一个侧边栏使用的是 Alfresco 共享文档库树选择器。选择器允许我将 nodeRef 发布到另一个将显示信息的小部件。我想使用树视图,但我在显示文档时遇到问题,它只显示 containers/folders。任何人都知道我需要做什么才能解决这个问题?
这是我使用的爱酷代码:
{
align: "sidebar",
name: "alfresco/layout/Twister",
config: {
label: "twister.library.label",
additionalCssClasses: "no-borders",
widgets: [
{
name: "alfresco/navigation/PathTree",
config: {
showRoot: true,
rootLabel: "Repository",
rootNode: "/app:company_home",
publishTopic: "ALF_ITEM_SELECTED"
}
}
]
}
}
我想知道我是否需要为 CoreXhr 编写一个扩展,或者要执行哪些步骤才能完成这项工作。
如有任何帮助,我们将不胜感激
我想通了。问题来自露天资源管理器端 "treenode.get.js" 中的存储库脚本。解决方案是执行以下操作
- 在 alfresco 资源管理器中创建一个新的 webscript 并将 treenode.get.js 代码复制到新的 webscript 中。我最终调用了我的 customtreenode.get.js。
- 去掉新建webscript中IsContainer的逻辑检查
创建扩展 PathTree 的新 Aikau 文件。下面是代码
define(["dojo/_base/declare",
"alfresco/navigation/PathTree",
"alfresco/documentlibrary/_AlfDocumentListTopicMixin",
"service/constants/Default",
"dojo/_base/lang",
"dojo/_base/array",
"dojo/dom-class",
"dojo/query",
"dojo/NodeList-dom"],
function(declare, PathTree, _AlfDocumentListTopicMixin, AlfConstants, lang, array, domClass, query) {
return declare([PathTree, _AlfDocumentListTopicMixin], {
useHash: true,
getTargetUrl: function alfresco_navigation_Tree__getTargetUrl() {
var url = null;
if (this.siteId && this.containerId)
{
url = AlfConstants.PROXY_URI + "slingshot/doclib/treenodeCustom/site/" + this.siteId + "/documentlibrary";
}
else if (this.rootNode)
{
url = AlfConstants.PROXY_URI + "slingshot/doclib/treenodeCustom/node/alfresco/company/home";
}
else if (!this.childRequestPublishTopic)
{
this.alfLog("error", "Cannot create a tree without 'siteId' and 'containerId' or 'rootNode' attributes", this);
}
return url;
}
});
});
更改您的代码以使用新的 CustomPathTree
{
align: "sidebar",
name: "alfresco/layout/Twister",
config: {
label: "twister.library.label",
additionalCssClasses: "no-borders",
widgets: [
{
name: "CustomWidgets/widgets/CustomTreeNode",
config: {
showRoot: true,
rootLabel: "Repository",
rootNode: "/app:company_home",
publishTopic: "ALF_ITEM_SELECTED"
}
}
]
}
}
之后就可以了。我仍然需要将图标从文件夹更改为文档。
我正在开发一个 Aikau 共享页面,其中一个侧边栏使用的是 Alfresco 共享文档库树选择器。选择器允许我将 nodeRef 发布到另一个将显示信息的小部件。我想使用树视图,但我在显示文档时遇到问题,它只显示 containers/folders。任何人都知道我需要做什么才能解决这个问题?
这是我使用的爱酷代码:
{
align: "sidebar",
name: "alfresco/layout/Twister",
config: {
label: "twister.library.label",
additionalCssClasses: "no-borders",
widgets: [
{
name: "alfresco/navigation/PathTree",
config: {
showRoot: true,
rootLabel: "Repository",
rootNode: "/app:company_home",
publishTopic: "ALF_ITEM_SELECTED"
}
}
]
}
}
我想知道我是否需要为 CoreXhr 编写一个扩展,或者要执行哪些步骤才能完成这项工作。
如有任何帮助,我们将不胜感激
我想通了。问题来自露天资源管理器端 "treenode.get.js" 中的存储库脚本。解决方案是执行以下操作
- 在 alfresco 资源管理器中创建一个新的 webscript 并将 treenode.get.js 代码复制到新的 webscript 中。我最终调用了我的 customtreenode.get.js。
- 去掉新建webscript中IsContainer的逻辑检查
创建扩展 PathTree 的新 Aikau 文件。下面是代码
define(["dojo/_base/declare", "alfresco/navigation/PathTree", "alfresco/documentlibrary/_AlfDocumentListTopicMixin", "service/constants/Default", "dojo/_base/lang", "dojo/_base/array", "dojo/dom-class", "dojo/query", "dojo/NodeList-dom"], function(declare, PathTree, _AlfDocumentListTopicMixin, AlfConstants, lang, array, domClass, query) { return declare([PathTree, _AlfDocumentListTopicMixin], { useHash: true, getTargetUrl: function alfresco_navigation_Tree__getTargetUrl() { var url = null; if (this.siteId && this.containerId) { url = AlfConstants.PROXY_URI + "slingshot/doclib/treenodeCustom/site/" + this.siteId + "/documentlibrary"; } else if (this.rootNode) { url = AlfConstants.PROXY_URI + "slingshot/doclib/treenodeCustom/node/alfresco/company/home"; } else if (!this.childRequestPublishTopic) { this.alfLog("error", "Cannot create a tree without 'siteId' and 'containerId' or 'rootNode' attributes", this); } return url; } }); });
更改您的代码以使用新的 CustomPathTree
{ align: "sidebar", name: "alfresco/layout/Twister", config: { label: "twister.library.label", additionalCssClasses: "no-borders", widgets: [ { name: "CustomWidgets/widgets/CustomTreeNode", config: { showRoot: true, rootLabel: "Repository", rootNode: "/app:company_home", publishTopic: "ALF_ITEM_SELECTED" } } ] } }
之后就可以了。我仍然需要将图标从文件夹更改为文档。