how to add custom properties in alfresco
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2011 02:13 AM
While adding conetent in the UI we will see some default properties,
Now I want add some more properties, like FirstName,EmailID,Ph no,
address etc. . How to add these properties.
Thanks in advance,
ramesh
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2011 03:47 AM
You can use Aspects, maybe this blog entry can help you:
http://blogs.alfresco.com/wp/wabson/2010/02/25/adding-custom-aspect-support-in-alfresco-share/
Cheers,
Jordi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2011 08:04 AM
Thanks for your reply,
I created ramesh as user and ssdg_space for that user..
When ever ramesh(user) enters a document in this space
custom properties has also along with default properties.
I hope you understand my requirement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-26-2011 10:06 AM
First you should define your custom aspect, and then create a folder rule that applies that aspect to any document created in it.
You can create rules by clicking the "Manage Rules" in the folder details page.
Cheers,
Jordi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2011 02:38 AM
I am new buddy in alfresco,
I followed the blog posted by you, how to add custom properties.
I coppied that code into extention folder of my project, still I am
not getting the custom properties in alfresco explorer.
Could you please expalin me more about how to add custom properties.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2011 04:35 AM
As I understand it, there are two ways of adding new properties into Alfresco content model: Defining either a Type or an Aspect.
These concepts are very similar. Just that a node can have only one type but a lot of aspects.
So, to define a new aspect 3 files are involved:
- myModel.xml: Where your model is defined.
- myexample-model-context.xml: This file is to tell Alfresco about your model.
- mymodel.properties: Labels file.
<?xml version="1.0" encoding="UTF-8"?><model name="my:example" xmlns="http://www.alfresco.org/model/dictionary/1.0"> <description>Sample Model</description> <author>jordiv</author> <version>1.0</version> <imports> <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/> <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/> </imports> <namespaces> <namespace uri="http://www.jordiv.com/model/content/1.0" prefix="my"/> </namespaces> <aspects> <aspect name="my:sampleProps"> <title>Sample Aspect by jordiv</title> <properties> <property name="my:propOne"> <title>Property 1</title> <type>d:text</type> </property> <property name="my:propTwo"> <title>Property 2</title> <type>d:text</type> </property> </properties> </aspect> </aspects></model>
myexample-model-context.xml:
<?xml version='1.0' encoding='UTF-8'?><!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'><beans> <bean id="example.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap"> <property name="models"> <list> <value>alfresco/extension/myModel.xml</value> </list> </property> <property name="labels"> <list> <value>alfresco/extension/mymodel</value> </list> </property> </bean></beans>
mymodel.properties
my_model.description=Sample Model
These files should be placed in:
/tomcat/shared/classes/alfresco/extension/
Then check if you have a file named web-client-config-custom.xml in that folder. If you don't, create it. If you already have it, just add the following lines.
web-client-config-custom.xml
<alfresco-config> <config evaluator="aspect-name" condition="my:sampleProps"> <property-sheet> <show-property name="my:propOne"/> <show-property name="my:propTwo"/> </property-sheet> </config> <config evaluator="string-compare" condition="Action Wizards"> <aspects> <aspect name="my:sampleProps" /> </aspects> </config></alfresco-config>
Then restart Alfresco.
With this, your new Aspect will become available from the Explorer interface.
To try it, go to the details page of any document and click in "Run Action". Select the "Add aspect" action, and in the list you will find the 'Sample Aspect by jordiv' aspect.
Once you complete the action, your document will have the two new properties defined in the aspect.
Hope this helps.
Cheers,
Jordi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2011 05:18 AM
Your sample files are working, once again thanks. one small doubt, is our custom properties will store in alfresco database.(Do you have any idea about workflows)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-30-2011 07:34 AM
I don't know where exactly the properties are stored, maybe an Alfresco Engineer could answer that.
I have little experience with workflows. If you have any specific problem, you should post your question in the Workflow forum.
Cheers,
Jordi.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2011 01:57 AM
I am posting my custom workflow doubt in workflow forum, please check it once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2013 06:12 AM
can u provide snapshots for ur working files,iam using 4.2 version.
Thanks in advance.
