是否可以将文档选择器默认为 alfresco 共享中的文档库?

编程入门 行业动态 更新时间:2024-10-14 18:19:08
本文介绍了是否可以将文档选择器默认为 alfresco 共享中的文档库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个association.ftl 的副本,我将其用于添加到共享的高级搜索表单中的控件.不幸的是,当打开默认显示是 companyhome 时,我宁愿将它默认为相关站点的文档库.我阅读了 this wiki 并尝试更改 parentNodeRef javascript 中的值至少要添加站点到不成功的路径.

共享表单配置控件:

<表格><!-- 搜索表单--><form id="搜索"><视野范围><show id="cm:name" force="true"/><show id="space" force="true"/></现场可见性><外观><field id="cm:name" label-id="prop.search.cm_name"/><field id="space" label-id="prop.search.cm_search_in_folder" ><控制模板="/org/alfresco/components/form/controls/space.ftl"><control-param name="startLocation">{doclib}</control-param></控制></field></外观></表单></表格></config>

freemarker 控制文件:

<#include "common/picker.inc.ftl"/><#assign controlId = fieldHtmlId + "-cntrl"><script type="text/javascript">//<![CDATA[(功能(){<@renderPickerJS 字段选择器"/>选择器.setOptions({<#if field.control.params.showTargetLink??>showLinkToTarget: ${field.control.params.showTargetLink},<#if 页面??&&page.url.templateArgs.site??>targetLinkTemplate: "${url.context}/page/site/${page.url.templateArgs.site!""}/document-details?nodeRef={nodeRef}",<#else>targetLinkTemplate: "${url.context}/page/document-details?nodeRef={nodeRef}",</#if></#if><#if field.control.params.allowNavigationToContentChildren??>allowNavigationToContentChildren: ${field.control.params.allowNavigationToContentChildren},</#if>项目类型:厘米:文件夹",多重选择模式:假,parentNodeRef: "alfresco://company/home/sites",//<== 不是默认路径<#if field.control.params.rootNode??>rootNode: "${field.control.params.rootNode}",</#if>itemFamily: "节点",displayMode: "${field.control.params.displayMode!"items"}"});})();//]]></script><div class="form-field"><#if form.mode == "view"><div id="${controlId}" class="viewmode-field"><span class="viewmode-label">${field.label?html}:</span><span id="${controlId}-currentValueDisplay" class="viewmode-value current-values"></span>

<#else><label for="${controlId}">${field.label?html}:</label><div id="${controlId}" class="object-finder"><div id="${controlId}-currentValueDisplay" class="current-values"></div><input type="hidden" id="${fieldHtmlId}" name="-" value="${field.value?html}"/><input type="hidden" id="${controlId}- added" name="${field.name}_ added"/><input type="hidden" id="${controlId}-removed" name="${field.name}_removed"/><div id="${controlId}-itemGroupActions" class="show-picker"></div><@renderPickerHTML controlId/>

</#if>

解决方案

维基很清楚如何做到这一点:

将 startLocation 作为参数提供给 forms-config 中的选择器,因为您想使用用户搜索的站点的 documentLibrary,我建议您按照 wiki 中的描述实现 NodeLocator:

wiki.alfresco/wiki/NodeLocatorService

事实上,这似乎已经为您实现,并且似乎驻留在露天源中:

svn.alfresco/repos/alfresco-open-mirror/alfresco/COMMUNITYTAGS/V4.2e/root/projects/repository/source/java/org/alfresco/repo/site/DocLibNodeLocator.java

但是我找不到 bean 声明,因此您可能必须将其添加到 spring-bean 定义中(或将源复制到自己的实现中)才能正确使用它.

I have a copy of association.ftl which I use for a control added to the advanced search form in share. Unfortunately when opened the default display is companyhome where as I'd rather have it default to the related site's document library. I read this wiki and also tried the changing the parentNodeRef value in the javascript to at least add sites to the path to no success.

The share form config control:

<config evaluator="model-type" condition="cm:content"> <forms> <!-- Search form --> <form id="search"> <field-visibility> <show id="cm:name" force="true" /> <show id="space" force="true" /> </field-visibility> <appearance> <field id="cm:name" label-id="prop.search.cm_name" /> <field id="space" label-id="prop.search.cm_search_in_folder" > <control template="/org/alfresco/components/form/controls/space.ftl"> <control-param name="startLocation">{doclib}</control-param> </control> </field> </appearance> </form> </forms> </config>

The freemarker control file :

<#include "common/picker.inc.ftl" /> <#assign controlId = fieldHtmlId + "-cntrl"> <script type="text/javascript">//<![CDATA[ (function() { <@renderPickerJS field "picker" /> picker.setOptions( { <#if field.control.params.showTargetLink??> showLinkToTarget: ${field.control.params.showTargetLink}, <#if page?? && page.url.templateArgs.site??> targetLinkTemplate: "${url.context}/page/site/${page.url.templateArgs.site!""}/document-details?nodeRef={nodeRef}", <#else> targetLinkTemplate: "${url.context}/page/document-details?nodeRef={nodeRef}", </#if> </#if> <#if field.control.params.allowNavigationToContentChildren??> allowNavigationToContentChildren: ${field.control.params.allowNavigationToContentChildren}, </#if> itemType: "cm:folder", multipleSelectMode: false, parentNodeRef: "alfresco://company/home/sites", //<== Not the default path <#if field.control.params.rootNode??> rootNode: "${field.control.params.rootNode}", </#if> itemFamily: "node", displayMode: "${field.control.params.displayMode!"items"}" }); })(); //]]></script> <div class="form-field"> <#if form.mode == "view"> <div id="${controlId}" class="viewmode-field"> <span class="viewmode-label">${field.label?html}:</span> <span id="${controlId}-currentValueDisplay" class="viewmode-value current-values"></span> </div> <#else> <label for="${controlId}">${field.label?html}:</label> <div id="${controlId}" class="object-finder"> <div id="${controlId}-currentValueDisplay" class="current-values"></div> <input type="hidden" id="${fieldHtmlId}" name="-" value="${field.value?html}" /> <input type="hidden" id="${controlId}-added" name="${field.name}_added" /> <input type="hidden" id="${controlId}-removed" name="${field.name}_removed" /> <div id="${controlId}-itemGroupActions" class="show-picker"></div> <@renderPickerHTML controlId /> </div> </#if> </div>

解决方案

The wiki is pretty clear on how to do this:

Supply a startLocation as parameter to the picker in the forms-config, since you want to go with the documentLibrary of the site the user searches from I would recommend you to implement a NodeLocator as described in the wiki:

wiki.alfresco/wiki/NodeLocatorService

In fact that seems to already have been implemented for you and seems to reside in the alfresco source:

svn.alfresco/repos/alfresco-open-mirror/alfresco/COMMUNITYTAGS/V4.2e/root/projects/repository/source/java/org/alfresco/repo/site/DocLibNodeLocator.java

However I cant find the bean declaration so you might have to add it to your spring-bean definitions (or copy the source to an own implementation) to be able to use it properly.

更多推荐

是否可以将文档选择器默认为 alfresco 共享中的文档库?

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

发布评论

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

>www.elefans.com

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