Alfresco forms for Share
Alfresco Share now has support for presentation of custom metadata using a forms engine. I have recently tried and implemented this for a customer. Here are some of my experiences (the examples requires some previous knowledge of Alfresco configuration).
Start by reading the Alfresco documentation for forms. You will find most thing on how to configure form there, and links to sample customizations. I have put my customized forms in share-config-custom.xml, that you place in web-extension folder. One thing that is not obvious from the Wiki documentation is how you add the confguration for aspects. What you do is to put it in its own aspect evaluator
<config evaluator="aspect" condition="my:customaspect"> <forms> <form> <appearance> <field id="my:customtextfield" set="mycustomset" mandatory="true"> <control template="/org/alfresco/components/form/controls/autocomplete.ftl"> <control-param name="ds">/share/service/ds/autocomplete/alfrescoperson /> </control> </field> </appearance> </form> </forms> </config>
Now you have the looks of you aspect defined, now you will have to add when to display your custom aspect.
> <config evaluator="node-type" condition="my:customtype"> <forms> <form> <field-visibility> <show id="sys:node-dbid" /> <show id="my:customaspect" /> ...
It will display if you add that aspect to your document for that particular custom type. As you can see it should not go into the appearence tag in node-type evaluator. For properties specific for that document type on the other hand, appearance should be placed there. As you can see I also use a custom set to group and to put a label for the aspect above (mycustomset). You will have to assign it under the aspect-evaluator. What you will have to do is for each document type create an appearance tag for the custom set you want to use.
<set id="mycustomset" appearance="bordered-panel" label="Company Inc. - My Custom Type" />
I have used the label to clearly identify what type of document you current document is (My Custom Type in this case).
As you can see i’ve used sys:node-dbid, that is the internal number sequence Alfresco assigns a document, and works perfectly as a dokument-id. However, we need a better label than the default one. You can get that by adding to your node-type evaluator for you custom type
<appearance>
<field id="sys:node-dbid" read-only="true" set="mycustomset" label="Document ID" />
The forms enginge uses the data models message resource bundle to know what labels to put for each metadata field. So create this file together with you model file if you want you property sheet to be multi-lingual. It should be possible to create resource bundles that is used by the forms engine so that you dont need to hardcode for example “Document ID” as I did. I have yet to find out where to put those files, have to come back to that.
The end result could be something like this:

5 Responses to Alfresco forms for Share
Twitter
- Cool! “@richardnystrom: Just released a very simple web app to manage notes written in Markdown: https://t.co/InRsT7E4 #rails #html5
- RT @mikehatfield: #Alfresco Enterprise 4.0 and Community 4.0.d both released today - enjoy! :-) #Alfresco4
- Is there a limit on max Alfresco cifs mappings from one server? Win 2008 Terminal server seems to max out around 40 users
English
Svenska 





Thanks for the post, very useful info.
This is very useful. I have been breaking my head last week.
Specifying “aspects” separately was key.
thanks again Loftux!
Hello Guys,
I did all this i managed to make an aspect work fine
but i have the problem that when i search for a value of a custom property it returns 0 results,
is there any solution?
Hi, you may be seeing this issue, https://issues.alfresco.com/jira/browse/ALF-706
Try changing the tokenization in you content model, and reindex to see if it works.
thanx peter i will check it