Document preview in Edit Task page

cancel
Showing results for 
Search instead for 
Did you mean: 
upforsin
Senior Member

Document preview in Edit Task page

Hello,

As i am filling information about the attached document I would like to simultaneously preview it. Especially because the whole right side of my browser page in totally empty.

Is there a simple way to achieve it?

I know it is possible to obtain a URL to the content (but how?) so i could just insert it to the HTML iframe tag and then  modify edit task page Freemarker Template (but where is it?) by creating second column (which will fill the right side of the Edit-Task page).

I am using Alfresco 6.1

I thing it should be very common thing to do but i did not find any simple, complimentary & up-to-date guildlines.

Regards,

Mike

howkymike
Alfresco Developer
1 Reply
prachi_shah_c2
Active Member II

Re: Document preview in Edit Task page

Hi,

To add document ‘s preview and its actions in edit task you have to edit workflow-details page .ftl file which is OOTB available at

share/src/main/amp/config/alfresco/templates/org/alfresco/workflow-details.ftl

  1. First import ftl, js, css files in template header which are available in actual preview of documents.
  2. In body part of template add like this,

    <#if page.url.args.nodeRef??>

    <br>

    <hr/>

    <br>

    <div>

    <div class="yui-gc">

    <div class="yui-u first">

    <@region id="metadata-web-preview" scope="template" />

    <@region id="metadata-comments" scope="template"/>

    </div>

    <div class="yui-u">

    <@region id="metadata-document-actions" scope="template" />

    <@region id="metadata-document-links" scope="template" />

    <@region id="metadata-document-metadata" scope="template" />

    <@region id="metadata-document-workflow" scope="template" />

    <@region id="metadata-document-versions" scope="template" />

    </div>

    </div>

    <@region id="metadata-html-upload" scope="template"/>

    <@region id="metadata-flash-upload" scope="template"/>

    <@region id="metadata-file-upload" scope="template"/>

    <@region id="metadata-dnd-upload" scope="template"/>

    </div>

    </#if>

  3. customize my-task.js file to pass noderef of attached document during opening task edit page at
share/src/main/amp/web/components/dashlets/my-tasks.js
 Like:
 http://localhost:8081/share/page/task-edit?taskId=XXXX&nodeRef=workspace://SpacesStore/514fe37b-6032-4220-9e07-cacbc2f895e0

Thanks,

Prachi Shah