第一个问题:
我想以工作流的任务编辑的形式实现文档的预览...我该怎么做?我尝试将 document-details.xml 和 document-details.ftl 改编为 workflow-details.xml 和 workflow-details.ftl 但不起作用.我试图将具有文档详细信息文件的 Web 预览的组件复制到工作流详细信息.有什么提示吗?
我在 workflow-details.ftl 中有这个:
<#include "include/alfresco-template.ftl"/><@templateHeader><@script type="text/javascript" src="${url.context}/res/modules/documentlibrary/doclib-actions.js" group="document-details"/><@link rel="stylesheet" type="text/css" href="${url.context}/res/components/document-details/document-details-panel.css" group="document-details"/><@link rel="stylesheet" type="text/css" href="${url.context}/res/components/workflow/task-edit-header.css" group="workflow-details"/><@templateHtmlEditorAssets/></@><@templateBody><@markup id="alf-hd"><div id="alf-hd"><@region scope="global" id="share-header" chromeless="true"/><@region id="title" scope="template"/><#if page.url.args.nodeRef??><@region id="path" scope="template"/></#if></@><@markup id="bd"><div id="bd"><div class="share-form"><@region id="data-header" scope="page"/><div class="yui-gc"><div class="yui-u first"><#if (config.scoped['WorkflowDetails']['workflow-details'].getChildValue('display-web-preview') == "true")><@region id="web-preview" scope="template"/></#if>
<@region id="data-form" scope="page"/><@region id="data-actions" scope="page"/>
</@></@><@templateFooter><@markup id="alf-ft"><div id="alf-ft"><@region id="footer" scope="global"/><@region id="data-loader" scope="page"/>
</@></@>
在workflow-details.xml中我添加了这个组件:
<region-id>web-preview</region-id><子组件><子组件id="默认"><评价><评价><评价者><评估器类型="configponent.evaluator"><参数><element>WorkflowDetails/workflow-details/display-web-preview</element></参数></评估者></评估者><url>/components/preview/web-preview</url><属性><nodeRef>{nodeRef}</nodeRef><api>api</api><代理>户外</代理><dependencyGroup>工作流细节</dependencyGroup></属性></评估></评价></子组件></子组件></组件>这不显示网络预览,只创建:
<div id="template_x002e_web-preview_x002e_workflow-details"><div id="template_x002e_web-preview_x002e_workflow-details_x0023_default">我的错误是什么?
第二个问题:
在Aikau页面的预览中,在Mozilla Firefox的firebug控制台中得到:Warning: unimplemented annotation type: Widget signature 并显示文档没有数字签名...但是,例如,如果我上传带有数字签名的文档,我可以在文档的document-details 页面中看到带有签名的文档.这个页面的预览不一样?如何实施此预览?
解决方案使用 share (pdf.js) 中集成的 javascript 预览器会更容易.如果直接使用javascript库,打开预览应该不难.
项目官网有示例:pdf.js
您可以使用共享网页脚本来初始化带有附加到工作流程的文档的 url 列表的 javascript.如果随附的文档不是 pdf,您将需要使用其 pdf 格式.
First question:
I want to implement a preview of the document in the form of the task-edit of the workflows... How can I do this? I try to adapt the document-details.xml and document-details.ftl to workflow-details.xml and workflow-details.ftl but not works. I tried to copy the components that have web-preview of the document-details files to workflow-details. Any hint to make this?
I have this in workflow-details.ftl:
<#include "include/alfresco-template.ftl" /> <@templateHeader> <@script type="text/javascript" src="${url.context}/res/modules/documentlibrary/doclib-actions.js" group="document-details"/> <@link rel="stylesheet" type="text/css" href="${url.context}/res/components/document-details/document-details-panel.css" group="document-details"/> <@link rel="stylesheet" type="text/css" href="${url.context}/res/components/workflow/task-edit-header.css" group="workflow-details"/> <@templateHtmlEditorAssets /> </@> <@templateBody> <@markup id="alf-hd"> <div id="alf-hd"> <@region scope="global" id="share-header" chromeless="true"/> <@region id="title" scope="template"/> <#if page.url.args.nodeRef??> <@region id="path" scope="template"/> </#if> </div> </@> <@markup id="bd"> <div id="bd"> <div class="share-form"> <@region id="data-header" scope="page" /> <div class="yui-gc"> <div class="yui-u first"> <#if (config.scoped['WorkflowDetails']['workflow-details'].getChildValue('display-web-preview') == "true")> <@region id="web-preview" scope="template"/> </#if> </div> </div> <@region id="data-form" scope="page" /> <@region id="data-actions" scope="page" /> </div> </div> </@> </@> <@templateFooter> <@markup id="alf-ft"> <div id="alf-ft"> <@region id="footer" scope="global"/> <@region id="data-loader" scope="page" /> </div> </@> </@>In workflow-details.xml I add this component:
<component> <region-id>web-preview</region-id> <sub-components> <sub-component id="default"> <evaluations> <evaluation> <evaluators> <evaluator type="configponent.evaluator"> <params> <element>WorkflowDetails/workflow-details/display-web-preview</element> </params> </evaluator> </evaluators> <url>/components/preview/web-preview</url> <properties> <nodeRef>{nodeRef}</nodeRef> <api>api</api> <proxy>alfresco</proxy> <dependencyGroup>workflow-details</dependencyGroup> </properties> </evaluation> </evaluations> </sub-component> </sub-components> </component>This not shows the web-preview, only creates:
<div id="template_x002e_web-preview_x002e_workflow-details"> <div id="template_x002e_web-preview_x002e_workflow-details_x0023_default"> </div> </div>What's my error?
Second question:
In the preview of the Aikau page I get: Warning: unimplemented annotation type: Widget signature in the console of the firebug of the Mozilla Firefox and the document is displayed without the digital signatures... But, for example, if I upload a document with a digital signature, I can see the document with the signature in the page of document-details of the document. The preview of this page is different? How can I implement this preview?
解决方案It can be easier to just use the javascript previewer that is integrated in share (pdf.js). If you use directly the javascript library, it shouldn't be difficult to open a preview.
There are examples in the official site of the project: pdf.js
you can use the share webscript to initialise the javascript with the list of urls of the documents attached to the workflow. If the document attached is not a pdf, you will need to use its pdf rendition.
更多推荐
任务编辑文档预览组件 Alfresco
发布评论