Adding metadata to an existing folder

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2008 02:45 PM
Hello,
If I have many existing folders (of the plain cm:folder type) and I want to add meta-data to them later on, is there anyway I can do that without recreating the folders as a custom type that has the metadata fields?
If I have many existing folders (of the plain cm:folder type) and I want to add meta-data to them later on, is there anyway I can do that without recreating the folders as a custom type that has the metadata fields?
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2008 03:03 PM
Hello,
Maybe You can add aspect. http://wiki.alfresco.com/wiki/Aspect
You can automatize adding aspect with Alfresco Javascript API. http://wiki.alfresco.com/wiki/JavaScript_API
Example :
Add Aspects
Hope it helps you
Maybe You can add aspect. http://wiki.alfresco.com/wiki/Aspect
You can automatize adding aspect with Alfresco Javascript API. http://wiki.alfresco.com/wiki/JavaScript_API
Example :
Add Aspects
Adding several aspects to a document:var props = new Array(1);props["cm:template"] = document.nodeRef;document.addAspect("cm:templatable", props);props = new Array(1);props["cm:lockIsDeep"] = true;document.addAspect("cm:lockable", props);props = new Array(1);props["cm:hits"] = 1;document.addAspect("cm:countable", props);
Hope it helps you

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2008 07:32 PM
Hi JM,
Is it possible to add an aspect to a folder? I was under the impression that you could not.
Is it possible to add an aspect to a folder? I was under the impression that you could not.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2008 04:50 AM
Hey,
You can add what you want where you want if you have the right to modify the node.
Example :
This code add 2 properties (cm:lockIsDeep and cm:hits) to the cm:folder Test
BUT
you can't see this modification except in NodeBrowser!
Example
You have to modify the screen if you want to look this new properties.
For more information : http://wiki.alfresco.com/wiki/Displaying_Custom_Metadata
You can add what you want where you want if you have the right to modify the node.
Example :
var testingFolder = companyhome.childByNamePath("Test");props = new Array(1);props["cm:lockIsDeep"] = true;testingFolder.addAspect("cm:lockable", props);props = new Array(1);props["cm:hits"] = 1;testingFolder.addAspect("cm:countable", props);
This code add 2 properties (cm:lockIsDeep and cm:hits) to the cm:folder Test
BUT
you can't see this modification except in NodeBrowser!
Example
Node IdentifierPrimary Path: /{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1....Reference: workspace://SpacesStore/b7ecc8b1-5edb-11dd-afdd-79a008cbb404Type: {http://www.alfresco.org/model/content/1.0}folderParent: workspace://SpacesStore/4cdcf19f-6fee-11dc-8621-f597096320a0PropertiesName Value Property Type Value Type Residual{http://www.alfresco.org/model/content/1.0}description {http://www.alfresco.org/model/dictionary/1.0}mltext false{http://www.alfresco.org/model/application/1.0}icon space-icon-default {http://www.alfresco.org/model/dictionary/1.0}text false{http://www.alfresco.org/model/system/1.0}node-uuid b7ecc8b1-5edb-11dd-afdd-79a008cbb404 {http://www.alfresco.org/model/dictionary/1.0}text false{http://www.alfresco.org/model/system/1.0}node-dbid 577 {http://www.alfresco.org/model/dictionary/1.0}long false{http://www.alfresco.org/model/content/1.0}title {http://www.alfresco.org/model/dictionary/1.0}mltext false{http://www.alfresco.org/model/content/1.0}lockIsDeep true {http://www.alfresco.org/model/dictionary/1.0}boolean false{http://www.alfresco.org/model/content/1.0}created Thu Jul 31 10:36:06 CEST 2008 {http://www.alfresco.org/model/dictionary/1.0}datetime false{http://www.alfresco.org/model/content/1.0}modifier admin {http://www.alfresco.org/model/dictionary/1.0}text false{http://www.alfresco.org/model/content/1.0}modified Thu Jul 31 10:41:26 CEST 2008 {http://www.alfresco.org/model/dictionary/1.0}datetime false{http://www.alfresco.org/model/content/1.0}creator admin {http://www.alfresco.org/model/dictionary/1.0}text false{http://www.alfresco.org/model/content/1.0}hits 1 {http://www.alfresco.org/model/dictionary/1.0}int false{http://www.alfresco.org/model/system/1.0}store-protocol workspace {http://www.alfresco.org/model/dictionary/1.0}text false{http://www.alfresco.org/model/content/1.0}name Test {http://www.alfresco.org/model/dictionary/1.0}text false{http://www.alfresco.org/model/system/1.0}store-identifier SpacesStore {http://www.alfresco.org/model/dictionary/1.0}text falseAspects{http://www.alfresco.org/model/content/1.0}lockable{http://www.alfresco.org/model/content/1.0}auditable{http://www.alfresco.org/model/application/1.0}uifacets{http://www.alfresco.org/model/system/1.0}referenceable{http://www.alfresco.org/model/content/1.0}countable
You have to modify the screen if you want to look this new properties.
For more information : http://wiki.alfresco.com/wiki/Displaying_Custom_Metadata
