cancel
Showing results for 
Search instead for 
Did you mean: 

Adding extra properties to a space

nie
Champ in-the-making
Champ in-the-making
Hi,

Is it possible to add extra properties/metadata to a space?

I would like to make different space templates for projects, and give the project creator the possibility to add some general information about the project.
And auto-update the metadata of files uploaded to the space or created in the space, according to the information stored in the space properties.

Thanks in advance,

Nie
5 REPLIES 5

kevinr
Star Contributor
Star Contributor
Yes absolutely - the content model in Alfresco is designed to be extended. You can add your own model with types, aspects and properties defined by you. You can configure the web-client UI to display those properties and you can use rules and scripts to set values automatically or when specific actions occur.

There are lots of docs on the wiki, a good place to start would be here:
http://wiki.alfresco.com/wiki/Developer_Guide#Creating_new_Content_Models
http://wiki.alfresco.com/wiki/Data_Dictionary_Guide

Thanks,

Kevin

nie
Champ in-the-making
Champ in-the-making
Hey,

thanks for the answer Kevin, checked those guides on wiki, now i managed to create my own space and content model with the extra properties needed, still got some questions tho.

How can i make the new space properties show up in the advanced space wizard? I can choose the new space type, but i can only enter the usual properties, not the new ones i added. For the new content type it works fine, the new properties show up in the content wizard.

How can i modify the new properties of a content(the ones i added)?
Tried adding a rule with java script execution, but i can only modify the old usual properties. For example:
document.properties.title = "newtitle"; works fine, but
document.properties.myproperty = "something"; is just getting ignored.

Thanks,

Nie

kevinr
Star Contributor
Star Contributor
How can i modify the new properties of a content(the ones i added)?
Tried adding a rule with java script execution, but i can only modify the old usual properties. For example:
document.properties.title = "newtitle"; works fine, but
document.properties.myproperty = "something"; is just getting ignored.

The document.properties.<prop> syntax is a shortcut for:
document.properties["cmSmiley Tonguerop"] - which uses the 'cm' prefix content model by default. For your custom properties you need to specify the namespace prefix, so if your custom model uri prefix was called 'custom' then this will work:
document.properties["custom:myproperty"] = "something";

Thanks,

Kevin

gavinc
Champ in-the-making
Champ in-the-making
As for showing properties after the space wizard…..

You can't currently without writing some custom code. This new feature is already raised on JIRA: http://issues.alfresco.com/browse/AWC-888 but there's no time line for it at the moment.

To implement it yourself you'll need to override the advanced space wizard definition and make it immediately show the edit properties dialog after the wizard closes. As you say create content already does it and can therefore be used as an example, particularly CreateContentWizard.doPostCommitProcessing().

nie
Champ in-the-making
Champ in-the-making
Hi,

thanks for the answers Kevin and Gavin.

Gavin can u tell me where can i exactly find the definition of the advanced space wizard and the function to override?

And is it possible to change the content_type of content with a rule or somehow else? I can select my own content_type if i add or create content, but if i upload multiple files with an external webDAV client for example, they're created with the default content_type, so i would like to convert them to my own content_type.(talking about the type of the content object, not mimetype)

Thanks,

Nie