You are here

addAspect

The addAspect methods are used to add new aspects to nodes.

Note: Any unsaved property changes will be lost when this method is called. To preserve property changes call save() first.

addAspect(aspect)

This method adds a new aspect and properties to the node allowing mandatory aspect properties to be supplied when the new aspect is applied.

Parameters

aspect
The aspect to add

Returns

True if the aspect was added successfully, false otherwise.

Example

document.addAspect("cm:translatable");

addAspect(aspect, properties)

This method adds a new aspect and properties to the node allowing mandatory aspect properties to be supplied when the new aspect is applied.

Parameters

aspect
The aspect to add
properties
An associative array of QName keyed properties. Any mandatory properties for the aspect must be provided.

Returns

True if the aspect was added successfully, false otherwise.

Example

var props = new Array(); 
props["cm:template"] = myTemplateNode.nodeRef; 
document.addAspect("cm:templatable", props);

Sending feedback to the Alfresco documentation team

You don't appear to have JavaScript enabled in your browser. With JavaScript enabled, you can provide feedback to us using our simple form. Here are some instructions on how to enable JavaScript in your web browser.