01-19-2010 07:51 AM
01-19-2010 09:11 AM
01-19-2010 10:34 AM
Consult the Javascript API on the Alfresco wiki. It has a list of functions that can be called from Javascript to affect the node repository.
You can specialize a content type (change to a subtype) by using node.specializeType("my:newsubtype"). You can also use node.addAspect("my:newAspect").
01-20-2010 04:10 AM
01-20-2010 08:02 AM
01-21-2010 10:51 AM
01-27-2010 02:51 PM
01-27-2011 08:20 AM
<type name="ct:customFolder">
<title>Custom</title>
<parent>cm:folder</parent>
<properties>
<property name="ct:code">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="ct:year">
<type>d:int</type>
<mandatory>true</mandatory>
<constraints>
<constraint ref="ct:yearValidate"/>
</constraints>
</property>
</properties>
<mandatory-aspects>
<aspect>ct:customAspect</aspect>
</mandatory-aspects>
</type>
And now I need change my model and add a new aspect,
<type name="ct:customFolder">
<title>Custom</title>
<parent>cm:folder</parent>
<properties>
<property name="ct:code">
<type>d:text</type>
<mandatory>true</mandatory>
</property>
<property name="ct:year">
<type>d:int</type>
<mandatory>true</mandatory>
<constraints>
<constraint ref="ct:yearValidate"/>
</constraints>
</property>
</properties>
<mandatory-aspects>
<aspect>ct:customAspect</aspect>
<aspect>ct:newAspect</aspect>
</mandatory-aspects>
</type>
The problem is in the folders created with my old model.01-31-2011 02:49 AM
var addAspect = actions.create("add-features");
addAspect.parameters["aspect-name"] = "ct:newAspect";
nodes = search.luceneSearch("TYPE:\"ct:customFolder\"");
for each (var node in nodes)
{
addAspect.execute(node);
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.