I recently setup Alfresco 3.1 Community for internal usage. I was able to get everything running with LDAP and NTLM integration. The Share application however, needed some tweaking as I had added some custom types and Share does not display custom metadata as of 3.1. So instead for going for the 3.2 Preview, which has forms support I decided to stick to the more stable 3.0 and tweak it. In this post I will describe the changes required. Please note that this post applies only to Alfresco 3.1 Community. Alfresco 3.2 adds forms support which provides support for any custom metadata to be displayed/edited with very minimal configuration.
<config evaluator=”string-compare” condition=”my:customtype”>
<form>
<field-visibility>
<show id=”my:prop1? />
<show id=”my:prop2? />
</field-visibility>
<appearance>
<field id=”my:prop1? />
<field id=”my:prop2? />
</appearance>
</form>
</config>
<div class=”info-section” id=”${args.htmlid}-customtype”>
<div class=”heading”>Custom Metadata</div>
<div class=”info”>
<span class=”meta-label”>Prop1:</span>
<span id=”${args.htmlid}-prop1? class=”meta-value”></span>
</div>
<div class=”info”>
<span class=”meta-label”>Prop2:</span>
<span id=”${args.htmlid}-prop2? class=”meta-value”></span>
</div>
</div>
</div>
if (!docData.customtype)
{
var customTypeDiv = Dom.get(this.id + “-customtype”);
customTypeDiv.innerHTML = “”;
}
else
{
Dom.get(this.id + “-prop1?).innerHTML = $html(docData.customtype.prop1);
Dom.get(this.id + “-prop2?).innerHTML = $html(docData.customtype.prop2);
}
<#if item.customtype?exists>
“customtype”:
{
“prop1″: “${item.customtype.prop1}”,
“prop2″: “${item.customtype.prop2}”
},
var customtype = null;
if (assetType == “document” && asset.type == “{myuri}customtype”)
{
var prop1 = “”;
if (asset.properties["{myuri}prop1"])
{
prop1 = asset.properties["{myuri}prop1"];
}
var prop2 = “”;
if (asset.properties["{myuri}prop2"])
{
prop2 = asset.properties["{myuri}prop2"];
}
customtype =
{
prop1:prop1,
prop2: prop2
}
}
Tibor Burda
July 7, 2009 at 5:35 am
Thanks!
It helped me a lot!
Amarendra Thakur
November 11, 2009 at 1:14 pm
gr8 Article,
I Hope you remember me.
I am creating a space in alfresco and assigning Users to that space by applying association through my custom model.xml.
Now i also have to display the “Status” of the user (Active or Inactive).something like below
userMembershipInfo
Status
d:text
true
Member List
false
true
cm:person
false
true
But the problem is that in the above case,the assoc “km:spaceMembers” and and the property “km:memberStatus” are not bind to each other,they are rather individual
I want to display the users and their status in that space.
Can you tell me how can i do that
Thanks & Regards
Amarendra Thakur
Amarendra Thakur
November 11, 2009 at 1:15 pm
userMembershipInfo
Status
d:text
true
Member List
false
true
cm:person
false
true
Atish Dipankar
January 6, 2010 at 11:40 am
Hi Aniruddh,
Thanks, for this help, i want toask u want thing that i want to customize alfresco share particulary i want to add a advanced search option where i can put my custom metadata in that and make it searchablae thorugh share UI.
Can you please put a light on this?
Thanks,
Atish
Milad
February 13, 2010 at 4:07 pm
Hi,
I have followed your instructions, and it works well, but i badly need your next post regarding this inorder to edit and put data for those fields…
waiting for your soon reply on this matter…
aniruddhchitre
June 14, 2010 at 7:25 pm
Milad,
I am really sorry I could not post further. However, you can now try Alfresco 3.3 Community. The Share application in it supports custom meta data editing.
Kelley
May 3, 2013 at 12:27 pm
WOW just what I was searching for. Came here by searching for network