|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.jscript.ScriptNode
public class ScriptNode
Script Node class implementation, specific for use by ScriptService as part of the object model.
The class exposes Node properties, children and assocs as dynamically populated maps and lists. The various collection classes are mirrored as JavaScript properties. So can be
accessed using standard JavaScript property syntax, such as node.children[0].properties.name
.
Various helper methods are provided to access common and useful node variables such as the content url and type information.
Nested Class Summary | |
---|---|
class |
ScriptNode.NodeValueConverter
Value converter with knowledge of Node specific value types |
class |
ScriptNode.ScriptContentData
Inner class wrapping and providing access to a ContentData property |
Field Summary | |
---|---|
protected java.util.Set |
aspects
The aspects applied to this node |
protected ScriptNode.NodeValueConverter |
converter
Node Value Converter |
protected java.lang.String |
id
|
protected TemplateImageResolver |
imageResolver
|
protected org.alfresco.service.cmr.repository.NodeRef |
nodeRef
Cached values |
protected ScriptNode |
parent
|
protected org.mozilla.javascript.Scriptable |
scope
Root scope for this object |
protected ServiceRegistry |
services
|
protected java.lang.String |
siteName
|
protected boolean |
siteNameResolved
|
Constructor Summary | |
---|---|
ScriptNode(FileInfo nodeInfo,
ServiceRegistry services,
org.mozilla.javascript.Scriptable scope)
Constructor |
|
ScriptNode(org.alfresco.service.cmr.repository.NodeRef nodeRef,
ServiceRegistry services)
Constructor |
|
ScriptNode(org.alfresco.service.cmr.repository.NodeRef nodeRef,
ServiceRegistry services,
org.mozilla.javascript.Scriptable scope)
|
Method Summary | |
---|---|
boolean |
addAspect(java.lang.String type)
Add an aspect to the Node. |
boolean |
addAspect(java.lang.String type,
java.lang.Object props)
Add an aspect to the Node. |
void |
addNode(ScriptNode node)
Creates a new secondary association between the current node and the specified child node. |
void |
addTag(java.lang.String tag)
Adds a tag to the node |
void |
addTags(java.lang.String[] tags)
Adds all the tags to the node |
ScriptNode |
cancelCheckout()
Cancel the check-out of a working copy document. |
ScriptNode |
checkin()
Check-in a working copy document. |
ScriptNode |
checkin(java.lang.String history)
Check-in a working copy document. |
ScriptNode |
checkin(java.lang.String history,
boolean majorVersion)
Check-in a working copy document. |
ScriptNode |
checkout()
Perform a check-out of this document into the current parent space. |
ScriptNode |
checkout(ScriptNode destination)
Perform a check-out of this document into the specified destination space. |
ScriptNode |
checkoutForUpload()
Performs a check-out of this document for the purposes of an upload |
ScriptNode |
childByNamePath(java.lang.String path)
childByNamePath returns the Node at the specified 'cm:name' based Path walking the children of this Node. |
org.mozilla.javascript.Scriptable |
childFileFolders()
|
org.mozilla.javascript.Scriptable |
childFileFolders(boolean files,
boolean folders)
|
org.mozilla.javascript.Scriptable |
childFileFolders(boolean files,
boolean folders,
java.lang.Object ignoreTypes)
|
ScriptPagingNodes |
childFileFolders(boolean files,
boolean folders,
java.lang.Object ignoreTypes,
int maxItems)
Deprecated. API for review (subject to change prior to release) |
ScriptPagingNodes |
childFileFolders(boolean files,
boolean folders,
java.lang.Object ignoreTypes,
int skipOffset,
int maxItems,
int requestTotalCountMax,
java.lang.String sortProp,
java.lang.Boolean sortAsc,
java.lang.String queryExecutionId)
|
ScriptNode[] |
childrenByTags(java.lang.String tag)
Gets all (deep) children of this node that have the tag specified. |
org.mozilla.javascript.Scriptable |
childrenByXPath(java.lang.String xpath)
|
void |
clearTags()
Clear the node's tags |
ScriptNode |
copy(ScriptNode destination)
Copy this Node to a new parent destination. |
ScriptNode |
copy(ScriptNode destination,
boolean deepCopy)
Copy this Node and potentially all child nodes to a new parent destination. |
Association |
createAssociation(ScriptNode target,
java.lang.String assocType)
Create an association between this node and the specified target node. |
ScriptNode |
createFile(java.lang.String name)
Create a new File (cm:content) node as a child of this node. |
ScriptNode |
createFile(java.lang.String name,
java.lang.String type)
Create a new File (cm:content) node as a child of this node. |
ScriptNode |
createFolder(java.lang.String name)
Create a new folder (cm:folder) node as a child of this node. |
ScriptNode |
createFolder(java.lang.String name,
java.lang.String type)
Create a new folder (cm:folder) node as a child of this node. |
ScriptNode |
createNode(java.lang.String name,
java.lang.String type)
Create a new Node of the specified type as a child of this node. |
ScriptNode |
createNode(java.lang.String name,
java.lang.String type,
java.lang.Object properties)
Create a new Node of the specified type as a child of this node. |
ScriptNode |
createNode(java.lang.String name,
java.lang.String type,
java.lang.Object properties,
java.lang.String assocType)
Create a new Node of the specified type as a child of this node. |
ScriptNode |
createNode(java.lang.String name,
java.lang.String type,
java.lang.Object properties,
java.lang.String assocType,
java.lang.String assocName)
Create a new Node of the specified type as a child of this node. |
ScriptNode |
createNode(java.lang.String name,
java.lang.String type,
java.lang.String assocType)
Create a new Node of the specified type as a child of this node. |
protected org.alfresco.service.namespace.QName |
createQName(java.lang.String s)
Helper to create a QName from either a fully qualified or short-name QName string |
ScriptThumbnail |
createThumbnail(java.lang.String thumbnailName)
Creates a thumbnail for the content property of the node. |
ScriptThumbnail |
createThumbnail(java.lang.String thumbnailName,
boolean async)
Creates a thumbnail for the content property of the node. |
protected ScriptNode.NodeValueConverter |
createValueConverter()
Constructs the node value converter |
ScriptVersion |
createVersion(java.lang.String history,
boolean majorVersion)
Create a version of this document. |
void |
ensureVersioningEnabled(boolean autoVersion,
boolean autoVersionProps)
Ensures that this document has the cm:versionable aspect applied to it, and that it has the initial version in the version store. |
boolean |
equals(java.lang.Object obj)
|
boolean |
exists()
Checks whether the ScriptNode exists in the repository. |
org.mozilla.javascript.Scriptable |
getActiveWorkflows()
Get active workflow instances this node belongs to |
org.mozilla.javascript.Scriptable |
getAspects()
|
java.util.Set |
getAspectsSet()
|
java.util.Map |
getAssociations()
|
java.util.Map |
getAssocs()
Return the target associations from this Node. |
java.util.Map |
getChildAssociations()
|
java.util.Map |
getChildAssocs()
Return the child associations from this Node. |
org.mozilla.javascript.Scriptable |
getChildAssocsByType(java.lang.String type)
Return an Array of the associations from this Node that match a specific object type. |
org.mozilla.javascript.Scriptable |
getChildren()
|
java.lang.String |
getContent()
|
protected CrossRepositoryCopy |
getCrossRepositoryCopyHelper()
|
org.mozilla.javascript.Scriptable |
getDirectPermissions()
|
java.lang.String |
getDisplayPath()
|
java.lang.String |
getDownloadUrl()
|
org.mozilla.javascript.Scriptable |
getFullPermissions()
|
boolean |
getHasChildren()
|
java.lang.String |
getIcon16()
|
java.lang.String |
getIcon32()
|
java.lang.String |
getId()
|
boolean |
getIsCategory()
|
boolean |
getIsContainer()
|
boolean |
getIsDocument()
|
boolean |
getIsLinkToContainer()
|
boolean |
getIsLinkToDocument()
|
boolean |
getIsLocked()
|
boolean |
getIsTagScope()
Gets whether this node is a tag scope |
boolean |
getIsVersioned()
Determines if this node is versioned |
java.lang.String |
getMimetype()
|
java.lang.String |
getName()
|
org.alfresco.service.namespace.NamespacePrefixResolver |
getNamespacePrefixResolver()
NamespacePrefixResolverProvider getter implementation |
org.alfresco.service.cmr.repository.NodeRef |
getNodeRef()
|
java.lang.String |
getOwner()
Get the owner of the node. |
ScriptNode |
getParent()
|
java.util.Map |
getParentAssociations()
|
java.util.Map |
getParentAssocs()
Return the parent associations to this Node. |
org.mozilla.javascript.Scriptable |
getParents()
|
org.mozilla.javascript.Scriptable |
getPermissions()
|
org.alfresco.service.cmr.repository.ChildAssociationRef |
getPrimaryParentAssoc()
|
java.util.Map |
getProperties()
Return all the properties known about this node. |
org.mozilla.javascript.Scriptable |
getPropertyNames(boolean useShortQNames)
Return all the property names defined for this node as an array. |
java.lang.String |
getQnamePath()
|
org.alfresco.service.namespace.QName |
getQNameType()
|
org.mozilla.javascript.Scriptable |
getSettablePermissions()
|
protected java.lang.String |
getShortQName(org.alfresco.service.namespace.QName longQName)
Given a long-form QName, this method uses the namespace service to create a short-form QName string. |
java.lang.String |
getSiteShortName()
Returns the short name of the site this node is located within. |
long |
getSize()
|
java.util.Map |
getSourceAssociations()
|
java.util.Map |
getSourceAssocs()
Return the source associations to this Node. |
java.lang.String |
getStoreId()
|
java.lang.String |
getStoreType()
|
java.lang.String[] |
getTags()
Get all the tags applied to this node |
TagScope |
getTagScope()
Gets the 'nearest' tag scope to this node by travesing up the parent hierarchy untill one is found. |
ScriptThumbnail |
getThumbnail(java.lang.String thumbnailName)
Get the given thumbnail for the content property |
java.lang.String[] |
getThumbnailDefintions()
Returns the names of the thumbnail defintions that can be applied to the content property of this node. |
ScriptThumbnail[] |
getThumbnails()
Get the all the thumbnails for a given node's content property. |
java.lang.String |
getType()
|
org.mozilla.javascript.Scriptable |
getTypePropertyNames()
Return all the property names defined for this node's type as an array of short QNames. |
org.mozilla.javascript.Scriptable |
getTypePropertyNames(boolean useShortQNames)
Return all the property names defined for this node's type as an array. |
java.lang.String |
getTypeShort()
|
java.lang.String |
getUrl()
|
protected ScriptNode.NodeValueConverter |
getValueConverter()
Gets the node value converter |
ScriptVersion |
getVersion(java.lang.String versionLabel)
Gets the version of this node specified by version label |
org.mozilla.javascript.Scriptable |
getVersionHistory()
Gets the version history |
java.lang.String |
getWebdavUrl()
|
boolean |
hasAspect(java.lang.String aspect)
|
int |
hashCode()
|
boolean |
hasPermission(java.lang.String permission)
Return true if the user has the specified permission on the node. |
boolean |
inheritsPermissions()
|
boolean |
isScriptContent(java.lang.Object o)
Helper to return true if the supplied property value is a ScriptContentData object |
boolean |
isSubType(java.lang.String type)
|
java.lang.String |
jsGet_downloadUrl()
|
boolean |
move(ScriptNode destination)
Move this Node to a new parent destination. |
boolean |
move(ScriptNode source,
ScriptNode destination)
Move this Node from specified parent to a new parent destination. |
ScriptNode |
newInstance(FileInfo nodeInfo,
ServiceRegistry services,
org.mozilla.javascript.Scriptable scope)
|
ScriptNode |
newInstance(org.alfresco.service.cmr.repository.NodeRef nodeRef,
ServiceRegistry services,
org.mozilla.javascript.Scriptable scope)
Factory method |
java.lang.String |
processTemplate(ScriptNode template)
Process a FreeMarker Template against the current node. |
java.lang.String |
processTemplate(ScriptNode template,
java.lang.Object args)
Process a FreeMarker Template against the current node. |
java.lang.String |
processTemplate(java.lang.String template)
Process a FreeMarker Template against the current node. |
java.lang.String |
processTemplate(java.lang.String template,
java.lang.Object args)
Process a FreeMarker Template against the current node. |
boolean |
remove()
Remove this node. |
boolean |
removeAspect(java.lang.String type)
Remove aspect from the node. |
void |
removeAssociation(ScriptNode target,
java.lang.String assocType)
Remove an association between this node and the specified target node. |
void |
removeNode(ScriptNode node)
Remove an existing child node of this node. |
void |
removePermission(java.lang.String permission)
Remove a permission for ALL user from the node. |
void |
removePermission(java.lang.String permission,
java.lang.String authority)
Remove a permission for the specified authority (e.g. |
void |
removeTag(java.lang.String tag)
Removes a tag from the node |
void |
removeTags(java.lang.String[] tags)
Removes all the tags from the node |
void |
reset()
Reset the Node cached state |
protected java.lang.Object[] |
retrieveAllSetPermissions(boolean direct,
boolean full)
Helper to construct the response object for the various getPermissions() calls. |
ScriptNode |
revert(java.lang.String history,
boolean majorVersion,
java.lang.String versionLabel)
Revert this Node to the specified version. |
ScriptNode |
revert(java.lang.String history,
boolean majorVersion,
java.lang.String versionLabel,
boolean deep)
Revert this Node to the specified version and potentially all child nodes. |
void |
save()
Persist the modified properties of this Node. |
void |
setContent(java.lang.String content)
Set the content for this node |
void |
setInheritsPermissions(boolean inherit)
Set whether this node should inherit permissions from the parent node. |
void |
setIsTagScope(boolean value)
Sets whether this node is a tag scope or not |
void |
setMimetype(java.lang.String mimetype)
Set the mimetype encoding for the content attached to the node from the default content property (@see ContentModel.PROP_CONTENT) |
void |
setName(java.lang.String name)
Helper to set the 'name' property for the node. |
void |
setOwner(java.lang.String userId)
Set the owner of the node |
void |
setPermission(java.lang.String permission)
Apply a permission for ALL users to the node. |
void |
setPermission(java.lang.String permission,
java.lang.String authority)
Apply a permission for the specified authority (e.g. |
void |
setScope(org.mozilla.javascript.Scriptable scope)
Set the Scriptable global scope |
void |
setTags(java.lang.String[] tags)
Set the tags applied to this node. |
boolean |
specializeType(java.lang.String type)
Re-sets the type of the node. |
void |
takeOwnership()
Take ownership of the node. |
java.lang.String |
toJSON()
Returns the JSON representation of this node. |
java.lang.String |
toJSON(boolean useShortQNames)
Returns the JSON representation of this node. |
java.lang.String |
toString()
Override Object.toString() to provide useful debug output |
ScriptNode |
transformDocument(java.lang.String mimetype)
Transform a document to a new document mimetype format. |
ScriptNode |
transformDocument(java.lang.String mimetype,
ScriptNode destination)
Transform a document to a new document mimetype format. |
ScriptNode |
transformImage(java.lang.String mimetype)
Transform an image to a new image format. |
ScriptNode |
transformImage(java.lang.String mimetype,
ScriptNode destination)
Transform an image to a new image mimetype format. |
ScriptNode |
transformImage(java.lang.String mimetype,
java.lang.String options)
Transform an image to a new image format. |
ScriptNode |
transformImage(java.lang.String mimetype,
java.lang.String options,
ScriptNode destination)
Transform an image to a new image mimetype format. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected org.mozilla.javascript.Scriptable scope
protected ScriptNode.NodeValueConverter converter
protected org.alfresco.service.cmr.repository.NodeRef nodeRef
protected java.lang.String id
protected java.lang.String siteName
protected boolean siteNameResolved
protected java.util.Set aspects
protected ServiceRegistry services
protected TemplateImageResolver imageResolver
protected ScriptNode parent
Constructor Detail |
---|
public ScriptNode(org.alfresco.service.cmr.repository.NodeRef nodeRef, ServiceRegistry services)
nodeRef
- The NodeRef this Node wrapper representsservices
- The ServiceRegistry the Node can use to access servicespublic ScriptNode(FileInfo nodeInfo, ServiceRegistry services, org.mozilla.javascript.Scriptable scope)
nodeRef
- The NodeRef this Node wrapper representsservices
- The ServiceRegistry the Node can use to access servicesscope
- Root scope for this Nodepublic ScriptNode(org.alfresco.service.cmr.repository.NodeRef nodeRef, ServiceRegistry services, org.mozilla.javascript.Scriptable scope)
Method Detail |
---|
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public ScriptNode newInstance(org.alfresco.service.cmr.repository.NodeRef nodeRef, ServiceRegistry services, org.mozilla.javascript.Scriptable scope)
public ScriptNode newInstance(FileInfo nodeInfo, ServiceRegistry services, org.mozilla.javascript.Scriptable scope)
public void setScope(org.mozilla.javascript.Scriptable scope)
Scopeable
setScope
in interface Scopeable
Scopeable.setScope(org.mozilla.javascript.Scriptable)
public java.lang.String getId()
public java.lang.String getStoreType()
public java.lang.String getStoreId()
public org.alfresco.service.cmr.repository.NodeRef getNodeRef()
public org.alfresco.service.namespace.QName getQNameType()
public java.lang.String getType()
public java.lang.String getTypeShort()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- Name to setpublic org.mozilla.javascript.Scriptable getChildren()
public boolean getHasChildren()
public ScriptNode childByNamePath(java.lang.String path)
mynode.childByNamePath("/QA/Testing/Docs");
is a leading / required? No, but it can be specified.
are wild-cards supported? Does not seem to be used anywhere
public org.mozilla.javascript.Scriptable childrenByXPath(java.lang.String xpath)
mynode.childrenByXPath("*[@cm:name='Testing']/*");
public org.mozilla.javascript.Scriptable childFileFolders()
public org.mozilla.javascript.Scriptable childFileFolders(boolean files, boolean folders)
files
- Return files extending from cm:contentfolders
- Return folders extending from cm:folder - ignoring sub-types of cm:systemfolder
public org.mozilla.javascript.Scriptable childFileFolders(boolean files, boolean folders, java.lang.Object ignoreTypes)
files
- Return files extending from cm:contentfolders
- Return folders extending from cm:folder - ignoring sub-types of cm:systemfolderignoreTypes
- Also optionally removes additional type qnames. The additional type can be
specified in short or long qname string form as a single string or an Array e.g. "fm:forum".
public ScriptPagingNodes childFileFolders(boolean files, boolean folders, java.lang.Object ignoreTypes, int maxItems)
files
- Return files extending from cm:contentfolders
- Return folders extending from cm:folder - ignoring sub-types of cm:systemfolderignoreTypes
- Also optionally removes additional type qnames. The additional type can be
specified in short or long qname string form as a single string or an Array e.g. "fm:forum".maxItems
- Max number of items
public ScriptPagingNodes childFileFolders(boolean files, boolean folders, java.lang.Object ignoreTypes, int skipOffset, int maxItems, int requestTotalCountMax, java.lang.String sortProp, java.lang.Boolean sortAsc, java.lang.String queryExecutionId)
public java.util.Map getAssocs()
node.assocs["translations"][0]
public java.util.Map getAssociations()
public java.util.Map getSourceAssocs()
node.sourceAssocs["translations"][0]
public java.util.Map getSourceAssociations()
public java.util.Map getChildAssocs()
node.childAssocs["contains"][0]
public java.util.Map getChildAssociations()
public org.mozilla.javascript.Scriptable getChildAssocsByType(java.lang.String type)
node.getChildAssocsByType("cm:folder")[0]
public java.util.Map getParentAssocs()
node.parentAssocs["contains"][0]
public java.util.Map getParentAssociations()
public boolean exists()
ScriptNode
exists in the repository.
public java.util.Map getProperties()
node.properties["name"]
public org.mozilla.javascript.Scriptable getTypePropertyNames()
public org.mozilla.javascript.Scriptable getTypePropertyNames(boolean useShortQNames)
useShortQNames
- if true short-form qnames will be returned, else long-form.
public org.mozilla.javascript.Scriptable getPropertyNames(boolean useShortQNames)
useShortQNames
- if true short-form qnames will be returned, else long-form.
public boolean getIsContainer()
public boolean getIsDocument()
public boolean getIsLinkToContainer()
public boolean getIsLinkToDocument()
public boolean getIsCategory()
public java.util.Set getAspectsSet()
public org.mozilla.javascript.Scriptable getAspects()
public boolean hasAspect(java.lang.String aspect)
aspect
- The aspect name to test for (fully qualified or short-name form)
public boolean isSubType(java.lang.String type)
type
- The qname type to test this object against (fully qualified or short-name form)
public java.lang.String getQnamePath()
public java.lang.String getDisplayPath()
public java.lang.String getIcon16()
public java.lang.String getIcon32()
public boolean getIsLocked()
public ScriptNode getParent()
public org.mozilla.javascript.Scriptable getParents()
public org.alfresco.service.cmr.repository.ChildAssociationRef getPrimaryParentAssoc()
public java.lang.String getContent()
public void setContent(java.lang.String content)
content
- Content string to setpublic java.lang.String getUrl()
For a container node, this method return the URL to browse to the folder in the web-client
public java.lang.String getDownloadUrl()
For a container node, this method returns an empty string
public java.lang.String jsGet_downloadUrl()
public java.lang.String getWebdavUrl()
public java.lang.String getMimetype()
public void setMimetype(java.lang.String mimetype)
mimetype
- Mimetype to setpublic long getSize()
public boolean hasPermission(java.lang.String permission)
The default permissions are found in org.alfresco.service.cmr.security.PermissionService
.
Most commonly used are "Write", "Delete" and "AddChildren".
permission
- as found in org.alfresco.service.cmr.security.PermissionService
public org.mozilla.javascript.Scriptable getPermissions()
public org.mozilla.javascript.Scriptable getDirectPermissions()
public org.mozilla.javascript.Scriptable getFullPermissions()
protected java.lang.Object[] retrieveAllSetPermissions(boolean direct, boolean full)
direct
- True to only retrieve direct permissions, false to get inherited alsofull
- True to retrieve full data string with [INHERITED|DIRECT] element
This exists to maintain backward compatibility with existing permission APIs.
public org.mozilla.javascript.Scriptable getSettablePermissions()
public boolean inheritsPermissions()
public void setInheritsPermissions(boolean inherit)
inherit
- True to inherit parent permissions, false otherwise.public void setPermission(java.lang.String permission)
permission
- Permission to applyPermissionService
public void setPermission(java.lang.String permission, java.lang.String authority)
permission
- Permission to apply @see org.alfresco.service.cmr.security.PermissionServiceauthority
- Authority (generally a username or group name) to apply the permission forpublic void removePermission(java.lang.String permission)
permission
- Permission to remove @see org.alfresco.service.cmr.security.PermissionServicepublic void removePermission(java.lang.String permission, java.lang.String authority)
permission
- Permission to remove @see org.alfresco.service.cmr.security.PermissionServiceauthority
- Authority (generally a username or group name) to apply the permission forpublic void setOwner(java.lang.String userId)
public void takeOwnership()
public java.lang.String getOwner()
public void save()
public boolean specializeType(java.lang.String type)
type
- Type to specialize the node
public ScriptNode createFile(java.lang.String name)
Once created the file should have content set using the content
property.
name
- Name of the file to create
public ScriptNode createFile(java.lang.String name, java.lang.String type)
Once created the file should have content set using the content
property.
name
- Name of the file to createtype
- Type of the file to create (if null, defaults to ContentModel.TYPE_CONTENT)
public ScriptNode createFolder(java.lang.String name)
name
- Name of the folder to create
public ScriptNode createFolder(java.lang.String name, java.lang.String type)
name
- Name of the folder to createtype
- Type of the folder to create (if null, defaults to ContentModel.TYPE_FOLDER)
public ScriptNode createNode(java.lang.String name, java.lang.String type)
name
- Name of the node to create (can be null for a node without a 'cm:name' property)type
- QName type (fully qualified or short form such as 'cm:content')
public ScriptNode createNode(java.lang.String name, java.lang.String type, java.lang.String assocType)
name
- Name of the node to create (can be null for a node without a 'cm:name' property)type
- QName type (fully qualified or short form such as 'cm:content')assocType
- QName of the child association type (fully qualified or short form e.g. 'cm:contains')
public ScriptNode createNode(java.lang.String name, java.lang.String type, java.lang.Object properties)
name
- Name of the node to create (can be null for a node without a 'cm:name' property)type
- QName type (fully qualified or short form such as 'cm:content')properties
- Associative array of the default properties for the node.
public ScriptNode createNode(java.lang.String name, java.lang.String type, java.lang.Object properties, java.lang.String assocType)
name
- Name of the node to create (can be null for a node without a 'cm:name' property)type
- QName type (fully qualified or short form such as 'cm:content')properties
- Associative array of the default properties for the node.assocType
- QName of the child association type (fully qualified or short form e.g. 'cm:contains')
public ScriptNode createNode(java.lang.String name, java.lang.String type, java.lang.Object properties, java.lang.String assocType, java.lang.String assocName)
name
- Name of the node to create (can be null for a node without a 'cm:name' property)type
- QName type (fully qualified or short form such as 'cm:content')properties
- Associative array of the default properties for the node.assocType
- QName of the child association type (fully qualified or short form e.g. 'cm:contains')assocName
- QName of the child association name (fully qualified or short form e.g. 'fm:discussion')
public void addNode(ScriptNode node)
node
- node to add as a child of this nodepublic void removeNode(ScriptNode node)
The child node will be cascade deleted if one of the associations was the primary association, i.e. the one with which the child node was created.
node
- child node to removepublic Association createAssociation(ScriptNode target, java.lang.String assocType)
target
- Destination node for the associationassocType
- Association type qname (short form or fully qualified)public void removeAssociation(ScriptNode target, java.lang.String assocType)
target
- Destination node on the end of the associationassocType
- Association type qname (short form or fully qualified)public boolean remove()
public ScriptNode copy(ScriptNode destination)
destination
- Node
public ScriptNode copy(ScriptNode destination, boolean deepCopy)
destination
- NodedeepCopy
- True for a deep copy, false otherwise.
public ScriptNode revert(java.lang.String history, boolean majorVersion, java.lang.String versionLabel)
versionLabel
- to revert from
null
otherwise
(if the version does not exist).public ScriptNode revert(java.lang.String history, boolean majorVersion, java.lang.String versionLabel, boolean deep)
history
- Version history notemajorVersion
- True to save as a major version increment, false for minor version.versionLabel
- to revert fromdeep
- true
for a deep revert, false
otherwise.
null
otherwise
(if the version does not exist).public boolean move(ScriptNode destination)
destination
- Node
public boolean move(ScriptNode source, ScriptNode destination)
source
- Nodedestination
- Node
public boolean addAspect(java.lang.String type)
type
- Type name of the aspect to add
public boolean addAspect(java.lang.String type, java.lang.Object props)
type
- Type name of the aspect to addprops
- ScriptableObject (generally an assocative array) providing the named properties for the aspect
- any mandatory properties for the aspect must be provided!
public boolean removeAspect(java.lang.String type)
type
- the aspect type
public void ensureVersioningEnabled(boolean autoVersion, boolean autoVersionProps)
autoVersion
- If the cm:versionable aspect is applied, should auto versioning be requested?autoVersionProps
- If the cm:versionable aspect is applied, should auto versioning of properties be requested?public ScriptVersion createVersion(java.lang.String history, boolean majorVersion)
history
- Version history notemajorVersion
- True to save as a major version increment, false for minor version.public boolean getIsVersioned()
public org.mozilla.javascript.Scriptable getVersionHistory()
public ScriptVersion getVersion(java.lang.String versionLabel)
versionLabel
- version label
public ScriptNode checkout()
public ScriptNode checkoutForUpload()
public ScriptNode checkout(ScriptNode destination)
destination
- Destination for the checked out document working copy Node.
public ScriptNode checkin()
public ScriptNode checkin(java.lang.String history)
history
- Version history note
public ScriptNode checkin(java.lang.String history, boolean majorVersion)
history
- Version history notemajorVersion
- True to save as a major version increment, false for minor version.
public ScriptNode cancelCheckout()
public ScriptNode transformDocument(java.lang.String mimetype)
mimetype
- Mimetype destination for the transformation
public ScriptNode transformDocument(java.lang.String mimetype, ScriptNode destination)
mimetype
- Mimetype destination for the transformationdestination
- Destination folder location
public ScriptNode transformImage(java.lang.String mimetype)
mimetype
- Mimetype destination for the transformation
public ScriptNode transformImage(java.lang.String mimetype, java.lang.String options)
mimetype
- Mimetype destination for the transformationoptions
- Image convert command options
public ScriptNode transformImage(java.lang.String mimetype, ScriptNode destination)
mimetype
- Mimetype destination for the transformationdestination
- Destination folder location
public ScriptNode transformImage(java.lang.String mimetype, java.lang.String options, ScriptNode destination)
mimetype
- Mimetype destination for the transformationoptions
- Image convert command optionsdestination
- Destination folder location
public java.lang.String processTemplate(ScriptNode template)
template
- Node of the template to execute
public java.lang.String processTemplate(ScriptNode template, java.lang.Object args)
template
- Node of the template to executeargs
- Scriptable object (generally an associative array) containing the name/value pairs of
arguments to be passed to the template
public java.lang.String processTemplate(java.lang.String template)
template
- The template to execute
public java.lang.String processTemplate(java.lang.String template, java.lang.Object args)
template
- The template to executeargs
- Scriptable object (generally an associative array) containing the name/value pairs of
arguments to be passed to the template
public ScriptThumbnail createThumbnail(java.lang.String thumbnailName)
thumbnailName
- the name of the thumbnail
public ScriptThumbnail createThumbnail(java.lang.String thumbnailName, boolean async)
thumbnailName
- the name of the thumbnailasync
- indicates whether the thumbnail is create asynchronously or not
public ScriptThumbnail getThumbnail(java.lang.String thumbnailName)
thumbnailName
- the thumbnail name
public ScriptThumbnail[] getThumbnails()
public java.lang.String[] getThumbnailDefintions()
Thumbanil defintions only appear in this list if they can produce a thumbnail for the content found in the content property. This will be determined by looking at the mimetype of the content and the destinatino mimetype of the thumbnail.
public void clearTags()
public void addTag(java.lang.String tag)
tag
- tag namepublic void addTags(java.lang.String[] tags)
tags
- array of tag namespublic void removeTag(java.lang.String tag)
tag
- tag namepublic void removeTags(java.lang.String[] tags)
tags
- array of tag namespublic java.lang.String[] getTags()
public void setTags(java.lang.String[] tags)
tags
- array of tagspublic void setIsTagScope(boolean value)
value
- true if this node is a tag scope, false otherwisepublic boolean getIsTagScope()
public TagScope getTagScope()
If none is found, null is returned.
public ScriptNode[] childrenByTags(java.lang.String tag)
tag
- tag name
public org.mozilla.javascript.Scriptable getActiveWorkflows()
public java.lang.String getSiteShortName()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toJSON(boolean useShortQNames)
useShortQNames
- if true short-form qnames will be returned, else long-form.
public java.lang.String toJSON()
protected java.lang.String getShortQName(org.alfresco.service.namespace.QName longQName)
longQName
-
protected org.alfresco.service.namespace.QName createQName(java.lang.String s)
s
- Fully qualified or short-name QName string
public void reset()
protected CrossRepositoryCopy getCrossRepositoryCopyHelper()
public boolean isScriptContent(java.lang.Object o)
o
- Object to test
protected ScriptNode.NodeValueConverter getValueConverter()
protected ScriptNode.NodeValueConverter createValueConverter()
public org.alfresco.service.namespace.NamespacePrefixResolver getNamespacePrefixResolver()
getNamespacePrefixResolver
in interface org.alfresco.service.namespace.NamespacePrefixResolverProvider
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |