cancel
Showing results for 
Search instead for 
Did you mean: 

Display and edit custom metadata in Alfresco Share

ingdade
Champ in-the-making
Champ in-the-making
Hello to everybody,

i'm testing alfresco share becouse i'm searching to implement a new feature.
In simple word i need to display documents and edit metadata (reading from the document) in the same page.

I saw that it's possible to do it with SHARE but only for standard metadata.

It's possible to extend Share to have the possibilty to work also with custom metadata?

The best is that Share know which type of document is displayed and propose the corect metadata form with custom properties.

Anyone has done it or has some suggestions?

Thanks in advantage
22 REPLIES 22

protenus
Champ in-the-making
Champ in-the-making
yes, those are the problems we are facing looking at that.

Although it does not seem to difficult to work around, as we can see the ajax methods provided allow for success and failure postback configurations, that could be used with the messeging system to provide very basic "can"/"cant" error messaging. For some reason we can not convince that form to do an ajax post, even with basic custom data types like num, etc.

We can "fake" inline by using a pop-up to submit the form to the web script in a standard way, then we were thinking of extending the built in web script to provide slightly prettier output, and add a self closing js to it.

Its a hack, but our users are looking for speedy entry.

Also, we have refactored the mytasks code to dynamically display workflow transitions and on click to immediately display the next document which has a workflow attached to it.This allows for volume processing of documents in the document details page, which really makes the share platform a great interface for financial document processing.

We have also added "next/previous" functionality which loads the next document in the folder, similar to what the explorer interface does.
Its all pretty hacky, but eliminates at least 4 or 5 clicks when processing multiple documents.

Thanks for your replies, and great work! As a nearly decade long implementer of sharepoint solutions, I am now completely convinced that alfresco is the future of Document/Process management solutions.

mikeh
Star Contributor
Star Contributor
One other problem with inline edit we came across (that I've just remembered) is adding and removing aspects - and dealing with mandatory values. Inline edit tends to submit each field in turn, which the underlying model may not allow. Anyway, it sounds like you're on top of it.

Your other modifications sounds very interesting - are you in a position to contribute them back? You'd obviously get full credit for the additions.

Thanks,
Mike

P.S. Many thanks for recognising all the hard work our teams have put into Share - I'll pass it on!

baby77
Champ in-the-making
Champ in-the-making
Hey
i need more informations how to display my metadata in share. I found source under  projects/web-framework-commons/config/alfresco/web-framework-config-commons.xml. Can i copy this file and in forms tag just add my metadata and rename it to web-framework-config-custom.xml and copy it to tomcat/webapps/share/WEB-INF/classes/alfresco.
<form>
            <field-visibility>
               <<show id="mm:firstName" for-mode="view" />
               <show id="mm:lastName" for-mode="view" />
             </field-visibility>
</form>

Is this right or not?
Tnx in advance.

baby77
Champ in-the-making
Champ in-the-making
Hay
i succeed to add my metadata on pdf document.In folder share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/document-details is file document-info which have default metadata.But the problem now is that my metadata fields arent automatically completed with values like defaults are.
Can someone please help me how to do that, give me some instruction?
In web client u have icon modify and there u can simply add your values.How is these solved in share?

Thanks.

pim
Champ in-the-making
Champ in-the-making
Hi,

Here is a link with an answer to the original question: http://edlovesjava.blogspot.com/2009/07/alfresco-forms-engine-customization.html.

Good luck! (It is actually very simple).

Pim.

mikeh
Star Contributor
Star Contributor
Full Forms wiki page here (with examples linked): http://wiki.alfresco.com/wiki/Forms

Thanks,
Mike

sselvan
Champ in-the-making
Champ in-the-making
I have the following web-framework-config-custom.xml in shared/classes/alfresco/web-extension folder

<alfresco-config>
   <!– Document Library config section –>
   <config evaluator="string-compare" condition="DocumentLibrary" replace="true">

      <!–
         Whether the folder Tree component should enumerate child folders or not.
         This is a relatively expensive operation, so should be set to "false" for Repositories with broad folder structures.
      –>
      <tree>
         <evaluate-child-folders>false</evaluate-child-folders>
      </tree>

      <!–
         Used by the "Manage Aspects" action

         For custom aspects, remember to also add the relevant i18n string(s)
            cm_myaspect=My Aspect
      –>
      <aspects>
         <!– Aspects that a user can see –>
         <visible>
            <aspect name="cm:generalclassifiable" />
            <aspect name="cm:complianceable" />
            <aspect name="cm:dublincore" />
            <aspect name="cm:effectivity" />
            <aspect name="cm:summarizable" />
            <aspect name="cm:versionable" />
            <aspect name="cm:templatable" />
            <aspect name="cm:emailed" />
            <aspect name="emailserver:aliasable" />
            <aspect name="cm:taggable" />
         </visible>

         <!– Aspects that a user can add. Same as "visible" if left empty –>
         <addable>
         </addable>

         <!– Aspects that a user can remove. Same as "visible" if left empty –>
         <removeable>
         </removeable>
      </aspects>

      <!–
         Used by the "Change Type" action

         Define valid subtypes using the following example:
            <type name="cm:content">
               <subtype name="cm:mysubtype" />
            </type>

         Remember to also add the relevant i18n string(s):
            cm_mysubtype=My SubType
      –>
      <types>
         <type name="cm:content">
            <subtype name="cm:mycontentsubtype" />
         </type>

         <type name="cm:folder">
            <subtype name="cm:myfoldersubtype" />
         </type>
      </types>
   </config>

<config evaluator="node-type" condition="cm:content">
   <forms>
      <form>
    <field-visibility>
            <show id="cm:name" />
            <show id="cm:title" force="true" />
            <show id="cm:description" force="true" />
            <show id="mimetype" />
            <show id="cm:author" force="true" />
            <show id="size" for-mode="view" />
            <show id="cm:creator" for-mode="view" />
            <show id="cm:created" for-mode="view" />
            <show id="cm:modifier" for-mode="view" />
            <show id="cm:modified" for-mode="view" />

        <!– cm:effectivity aspect –>
            <show id="cm:from"/>
            <show id="cm:to"/>

      <!– MediaHub aspect –>
            <show id="hub:captionWho" for-mode="edit"/>
            <show id="hub:captionWhat" for-mode="edit"/>

         <!– dublin core –>

            <show id="cm:publisher" for-mode="edit"/>
            <show id="cm:contributor" for-mode="edit"/>
            <show id="cm:type" for-mode="edit"/>
            <show id="cm:identifier" for-mode="edit"/>
            <show id="cm:dcsource" for-mode="edit"/>
            <show id="cm:coverage" for-mode="edit"/>
            <show id="cm:rights" for-mode="edit"/>
            <show id="cm:subject" for-mode="edit"/>
         </field-visibility>

         <appearance>
         <field id="cm:from" label="From"/>
         <field id="cm:to" label="To"/>

         <field id="hub:captionWho" label="Caption Who"/>
         <field id="hub:captionWhat" label="Caption What"/>


            <set id="dublin-core" appearance="panel" template="/custom-set-dublincore.ftl" />
            <field id="cm:publisher" set="dublin-core" label="Publisher"/>
            <field id="cm:contributor" set="dublin-core"  label="Contributor"/>
            <field id="cm:type" set="dublin-core"  label="Type"/>
            <field id="cm:identifier" set="dublin-core"  label="Identifier"/>
            <field id="cm:dcsource" set="dublin-core"  label="DC Source"/>
            <field id="cm:coverage" set="dublin-core"  label="Coverage"/>
            <field id="cm:rights" set="dublin-core"  label="Rights"/>
            <field id="cm:subject" set="dublin-core"  label="Subject"/>

         </appearance>
      </form>
   </forms>
</config>
</alfresco-config>

I have custom-set-dublincore.ftl under web-extension/site-webscripts/ folder

<#if form.fields["cm:publisher"]??>
    <#if form.mode == "view">
        <@formLib.renderField field=form.fields["cm:publisher"] />
        <@formLib.renderField field=form.fields["cm:contributor"] />
        <@formLib.renderField field=form.fields["cm:type"] />
        <@formLib.renderField field=form.fields["cm:identifier"] />
        <@formLib.renderField field=form.fields["cm:dcsource"] />
        <@formLib.renderField field=form.fields["cm:coverage"] />
        <@formLib.renderField field=form.fields["cm:rights"] />
        <@formLib.renderField field=form.fields["cm:subject"] />
    <#else>
        <div class="yui-g">
            <div class="yui-u first">
                <@formLib.renderField field=form.fields["cm:publisher"] />
            </div>
            <div class="yui-u">
                <@formLib.renderField field=form.fields["cm:contributor"] />
            </div>
        </div>
        <div class="yui-g">
            <div class="yui-u first">
                <@formLib.renderField field=form.fields["cm:type"] />
            </div>
            <div class="yui-u">
                <@formLib.renderField field=form.fields["cm:identifier"] />
            </div>
        </div>
        <div class="yui-g">
            <div class="yui-u first">
                <@formLib.renderField field=form.fields["cm:dcsource"] />
            </div>
            <div class="yui-u">
                <@formLib.renderField field=form.fields["cm:coverage"] />
            </div>
        </div>
        <div class="yui-g">
            <div class="yui-u first">
                <@formLib.renderField field=form.fields["cm:rights"] />
            </div>
            <div class="yui-u">
                <@formLib.renderField field=form.fields["cm:subject"] />
            </div>
        </div>
       
        <div style="clear: both;"></div>
    </#if>
</#if>

I am not able to see any difference in Share user interface at all! I have spent so much time, but could not figure out.
I have been using http://wiki.alfresco.com/wiki/Forms_Examples#Providing_A_Custom_Set_Template and http://edlovesjava.blogspot.com/2009/07/alfresco-forms-engine-customization.html, but I am not able to shake anything in Share, though Alfresco interface shows up with new attributes, since I edited web-client-config-custom.xml.

If someone can tell me what is that I am missing. I have followed all the procedures mentioned in the links above, but no new metadata is showing in Share. FYI - I am trying to get only dublin-core metadata fields and effectivity aspect metadata fields. Nothing special. Smiley Sad

sselvan
Champ in-the-making
Champ in-the-making
By the way, I am using Alfresco Enterprise 3.2 version.

loftux
Star Contributor
Star Contributor
@sselvan
Maybe this can give you a hint, just posted this blog post http://loftux.se/en/2010/02/11/alfresco-forms-for-share/

sselvan
Champ in-the-making
Champ in-the-making
Thanks a lot Loftux. This was very very useful. Specifying "aspects" separately was the key to the solution.

For all others - in addition to the above blog by Loftux - please make sure you have the appropriate aspects applied in Alfresco to your particular Sites or documentLibrary spaces.
This was one of the things I missed too.