Add custom aspect as a rule

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-06-2013 12:12 PM
HI, my goal is to add to a folder a rule that automatically add an aspect to all the item in that folder. I'm using Alfresco 4.2.c .
So the point is how to add to the combobox(refer to the this image: http://goo.gl/R630G ) of the available aspect the one i've created.
Here is my code for my custom model:
And here is the share-config-custom:
So the point is how to add to the combobox(refer to the this image: http://goo.gl/R630G ) of the available aspect the one i've created.
Here is my code for my custom model:
<namespaces> <namespace uri="http://www.mymodel.com/model/content/1.0" prefix="myCustom" /></namespaces> <types> <!– Enterprise-wide generic document type –> <type name="myCustom:docContentType"> <parent>cm:content</parent> <mandatory-aspects> <aspect>myCustom:productContentAspect</aspect> </mandatory-aspects> </type> </types> <aspects> <!– Generic Aspect –> <aspect name="myCustom:aspect"> </aspect> <!– Product Content Aspect –> <aspect name="myCustom:productContentAspect"> <parent>myCustom:aspect</parent> <properties> <property name="myCustom:annoEsercizio"> <type>d:int</type> <mandatory>false</mandatory> </property> </properties> </aspect> </aspects>
And here is the share-config-custom:
<share-config> <config evaluator="string-compare" condition="DocumentLibrary"> <aspects> <visible> <aspect name="myCustom:productContentAspect"/> </visible> </aspects> <types> <type name="cm:content"> <subtype name="myCustom:productContentType"/> </type> </types> </config> <config evaluator="aspect" condition="myCustom:productContentAspect"> <forms> <form> <field-visibility> <show id="myCustom:annoEsercizio"/> </field-visibility> <appearance> <set id="myCustom_productContentPropertySet" appearance="bordered-panel" label-id="aspect.myCustom_productContentAspect"/> <field id="myCustom:annoEsercizio" set="myCustom_productContentPropertySet" label-id="prop.myCustom_annoEsercizio"> <control template="/org/alfresco/components/form/controls/number.ftl" /> </field> </appearance> </form> </forms> </config> </share-config>
Labels:
- Labels:
-
Archive
4 REPLIES 4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2013 05:09 AM
You seem to have made your aspect mandatory. This means it always gets added automatically to documents of type myCustom:docContentType when they are created. If thats what you want you should not need a rule, but you will get the aspects on all documents of type myCustom:docContentType regardless of the folder they are in.
If you want the aspect only on documents in the folder, do not make it a mandatory aspect.
I'm not immediately sure why it isn't on your list but you have not given your aspect a title so it is possible that Alfresco just won't list it until you do. Your model definintion should look like
Bob Johnson
If you want the aspect only on documents in the folder, do not make it a mandatory aspect.
I'm not immediately sure why it isn't on your list but you have not given your aspect a title so it is possible that Alfresco just won't list it until you do. Your model definintion should look like
<aspects> <aspect name="???????"> <title>Description you want to display here</title> <properties> ……. </properties> </aspect> </aspects>
Bob Johnson
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2014 08:35 AM
Dear Bob,
I am new in alfresco I have alfresco 4.2.f I tried to add new aspect but I can't success please please can you help me.
I am new in alfresco I have alfresco 4.2.f I tried to add new aspect but I can't success please please can you help me.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2014 04:18 AM
I'm on 4.2e but it won't have changed much. Whats your problem?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2013 06:20 AM
BOB, you're simply great!!!!
