cancel
Showing results for 
Search instead for 
Did you mean: 

Showing edit metada and document preview together

leftright
Champ on-the-rise
Champ on-the-rise
Hello,
is it possible to show in share, the edit metada form and the document previewer(for PDF documents),on the same page at the same time?
So that when I would fill in the document metadata, I could look on the document preview at the same time,
in order to read the data  from the document, that I need to write in metadata form(my custom defined aspects).
Is this possible and if it is, any suggestions how to do this?
Thank you for your answers
3 REPLIES 3

croc
Champ in-the-making
Champ in-the-making
Hi,

Thought I don't know why you need that.
I think you should check this file document-details.ftl, you might need to inclide the code below:
<@region id=doclibType + "edit-metadata" scope="template" protected=true />
to whereever you want your results to be displayed. FYI, I haven't tested it.

Regards,
Croc

leftright
Champ on-the-rise
Champ on-the-rise
Thank you for your help.
Yes, it is just as you wrote you have to add that code to document-details.ftl.

Also you have to add in folder tomcat\webapps\share\WEB-INF\classes\alfresco\site-data\template-instances
to the file document-details.xml, components for edit-metadata(you find them from edit-metadata.xml )

It is the following code:

      
<component>
         <region-id>edit-metadata</region-id>
         <url>/components/form</url>
         <properties>
            <itemKind>node</itemKind>
            <itemId>{nodeRef}</itemId>
            <mode>edit</mode>
            <submitType>json</submitType>
            <showCaption>true</showCaption>
            <showCancelButton>true</showCancelButton>
         </properties>
      </component>
      <component>
         <region-id>repo-edit-metadata</region-id>
         <url>/components/form</url>
         <properties>
            <itemKind>node</itemKind>
            <itemId>{nodeRef}</itemId>
            <mode>edit</mode>
            <submitType>json</submitType>
            <showCaption>true</showCaption>
            <showCancelButton>true</showCancelButton>
         </properties>
      </component>

ekimnosneb
Champ in-the-making
Champ in-the-making
I attempted this coding and found additional steps were necessary.  I hope no one minds my adding a comment to this older solved post in case it can help someone else.

Here is my resulting code that gave the result of having the document preview display on the left side of the Edit Metadata form in Share.
file:   tomcat/webapps/share/WEB-INF/classes/alfresco/site-data/template-instances/edit-metadata.xml
      
<?xml version='1.0' encoding='UTF-8'?>
<template-instance>
   <template-type>org/alfresco/edit-metadata</template-type>
   <properties>
      <pageFamily>documentlibrary</pageFamily>
      <container>documentLibrary</container>
   </properties>
   <components>
      <!– title: normal, portlet, repository & portlet+repository –>
      <component>
         <region-id>title</region-id>
         <url>/components/title/collaboration-title</url>
      </component>
      <component>
         <region-id>portlet-title</region-id>
         <url>/components/title/portlet-collaboration-title</url>
      </component>
      <component>
         <region-id>repo-title</region-id>
         <url>/components/title/simple-title</url>
         <properties>
            <title>title.repository</title>
            <subtitle>title.browser</subtitle>
         </properties>
      </component>
      <component>
         <region-id>portlet-repo-title</region-id>
         <url>/components/title/simple-title</url>
         <properties>
            <title>title.repository</title>
            <subtitle>title.browser</subtitle>
         </properties>
      </component>
      <component>
         <region-id>navigation</region-id>
         <url>/components/navigation/collaboration-navigation</url>
      </component>
      <!– web-preview: normal & repository –>
      <component>
         <region-id>web-preview</region-id>
         <url>/components/preview/web-preview</url>
         <properties>
            <nodeRef>{nodeRef}</nodeRef>
         </properties>
      </component>
      <component>
         <region-id>repo-web-preview</region-id>
         <url>/components/preview/web-preview</url>
         <properties>
            <nodeRef>{nodeRef}</nodeRef>
         </properties>
      </component>
      <!– edit-metadata-mgr: normal & repository –>
      <component>
         <region-id>edit-metadata-mgr</region-id>
         <url>/components/edit-metadata/edit-metadata-mgr</url>
      </component>
      <component>
         <region-id>repo-edit-metadata-mgr</region-id>
         <url>/components/edit-metadata/edit-metadata-mgr</url>
      </component>
      <!– edit-metadata: normal & repository –>
      <component>
         <region-id>edit-metadata</region-id>
         <url>/components/form</url>
         <properties>
            <itemKind>node</itemKind>
            <itemId>{nodeRef}</itemId>
            <mode>edit</mode>
            <submitType>json</submitType>
            <showCaption>true</showCaption>
            <showCancelButton>true</showCancelButton>
         </properties>
      </component>
      <component>
         <region-id>repo-edit-metadata</region-id>
         <url>/components/form</url>
         <properties>
            <itemKind>node</itemKind>
            <itemId>{nodeRef}</itemId>
            <mode>edit</mode>
            <submitType>json</submitType>
            <showCaption>true</showCaption>
            <showCancelButton>true</showCancelButton>
         </properties>
      </component>
   </components>
</template-instance>

file: tomcat/webapps/share/WEB-INF/classes/alfresco/templates/org/alfresco/edit-metadata.ftl
<#include "include/alfresco-template.ftl" />
<@templateHeader />

<@templateBody>
   <div id="alf-hd">
      <@region id=appType + "header" scope="global" protected=true />
      <@region id=appType + doclibType + "title" scope="template" protected=true />
      <@region id=appType + doclibType + "navigation" scope="template" protected=true />
   </div>
   <div id="bd">
      <div class="yui-g">
         <div class="yui-g first">
         <#if (config.scoped['DocumentDetails']['document-details'].getChildValue('display-web-preview') == "true")>
            <@region id=doclibType + "web-preview" scope="template" protected=true />
         </#if>
       </div>
       <div class="yui-u">
         <@region id=doclibType + "edit-metadata-mgr" scope="template" protected=true />
         <@region id=doclibType + "edit-metadata" scope="template" protected=true />
       </div>
      </div>
   </div>
  
</@>

<@templateFooter>
   <div id="alf-ft">
      <@region id="footer" scope="global" protected=true />
   </div>
</@>

Of course, then restart alfresco to see the changes.