org.rivetlogic.scar.util
Class RaarUtil

java.lang.Object
  extended by org.rivetlogic.scar.util.RaarUtil

public class RaarUtil
extends java.lang.Object

Utility class used as a gateway to use RAAr services.

Author:
Rivet Logic Corporation

Constructor Summary
RaarUtil()
           
 
Method Summary
static com.rivetlogic.core.cma.repo.Ticket authenticate(RaarServices raarServices, java.lang.String userName, java.lang.String password)
          Authenticate user with Alfresco repository.
static org.alfresco.service.cmr.repository.NodeRef cancelCheckOut(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Undo check out for a node.
static org.alfresco.service.cmr.repository.NodeRef checkIn(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String revisionHistory, boolean majorVersion)
          Check in a node.
static org.alfresco.service.cmr.repository.NodeRef checkOut(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef destination)
          Check out a node.
static org.alfresco.service.cmr.repository.NodeRef copyNode(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeToCopy, org.alfresco.service.cmr.repository.NodeRef destinationContainer)
          Copy the specified node to the destination node reference.
static org.alfresco.service.cmr.repository.NodeRef createFolder(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, java.lang.String folderName, org.alfresco.service.cmr.repository.NodeRef container, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> properties)
          Create a folder.
static org.alfresco.service.cmr.repository.ChildAssociationRef createNode(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef parentRef, org.alfresco.service.namespace.QName assocTypeQName, org.alfresco.service.namespace.QName assocQName, org.alfresco.service.namespace.QName nodeTypeQName, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> nodeProperties)
          Create a node.
static org.alfresco.service.cmr.repository.NodeRef deleteNode(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          delete the node represented by the specified node reference.
static java.util.Map<org.alfresco.service.cmr.security.AccessPermission,java.lang.Boolean> getAllUserNodePermissions(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Get all the permissions the current user has on the provided node.
static java.util.List<com.rivetlogic.core.cma.repo.Node> getAllUsers(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket)
          Get a list of all users.
static org.alfresco.service.cmr.repository.NodeRef getArchiveStoreRoot(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket)
          Get the node reference of the archive store root node
static java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> getCategories(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket)
          Get all categories.
static java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssocs(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Returns child associations of the given node.
static org.alfresco.service.cmr.repository.NodeRef getChildRefByName(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef parentRef, java.lang.String name)
          Gets the NodeRef of the node with the supplied name within the context of the node represented by parentRef.
static java.lang.String getMimeType(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef fileRef)
          Get the MIME type of the given node reference.
static com.rivetlogic.core.cma.repo.Node getNode(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.List<org.alfresco.service.namespace.QName> properties, boolean returnPeerAssocs, boolean returnChildAssocs, boolean returnAspects, boolean returnPermissions, java.util.List<java.lang.String> permissionsToCheckFor)
          Get the node represented by the given node reference.
static java.util.Map<org.alfresco.service.cmr.repository.NodeRef,java.lang.String> getNodeCategories(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Get all the child associations representing the categories of the given node.
static java.lang.String getNodeName(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Gets a node's name in Alfresco using the node's reference.
static org.alfresco.service.cmr.repository.NodeRef getParentRef(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Get the parent node reference for a given node.
static org.alfresco.service.cmr.repository.Path getPath(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Get a Path object for the given node reference.
static java.lang.String getPathFromNodeRef(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef ref)
          Generate a search XPATH pointing to the specified node.
static java.util.Set<org.alfresco.service.cmr.security.AccessPermission> getPermissions(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Get all the permissions that are granted/denied to the current authentication on the given node.
static java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> getProperties(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Returns the Alfresco properties map for the given node.
static java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> getRootCategories(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket)
          Get all root categories.
static java.util.List<com.rivetlogic.core.cma.repo.Node> getStandardFoldersRef(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket)
          Get standard folder nodes (Alfresco space templates).
static org.alfresco.service.cmr.repository.NodeRef getUserNodeRef(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, java.lang.String username)
          Get the node reference that represents the current user.
static org.alfresco.service.cmr.version.VersionHistory getVersionHistory(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Get the version history of the specified node.
static boolean hasCreatePermission(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef ref)
          Check if the current user has create permissions on the given node (should be a folder).
static boolean hasDeletePermission(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef ref)
          Check if the current user has delete permissions on the given node.
static boolean hasWritePropertiesPermission(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef ref)
          Check if the current user has permissions to change the given node's meta data.
static void invalidateTicket(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket)
          Invalidate a ticket.
static org.alfresco.service.cmr.repository.NodeRef moveNode(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeToMove, org.alfresco.service.cmr.repository.NodeRef destinationContainer)
          Move the specified node to the destination node reference.
static void readContentIntoStream(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef fileRef, java.io.OutputStream outStream)
          Download content from the specified node into an output stream.
static void removeAspect(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef ref, org.alfresco.service.namespace.QName aspect)
          Remove an aspect from the given node.
static void removePermission(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String authority, java.lang.String permission)
          Find and delete an access control entry by node, authentication and permission.
static org.alfresco.service.cmr.repository.NodeRef restoreNode(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Restore a node to its original location.
static org.alfresco.service.cmr.repository.NodeRef restoreNode(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.NodeRef destinationRef)
          Restore a node to the specified location.
static void saveCategories(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, java.util.List<org.alfresco.service.cmr.repository.NodeRef> categories, org.alfresco.service.cmr.repository.NodeRef nodeRef)
          Associates the supplied categories with the node identified by nodeRef.
static java.util.List<com.rivetlogic.core.cma.repo.Node> search(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.StoreRef store, java.lang.String query, java.util.List<org.alfresco.service.namespace.QName> properties, boolean returnPeerAssocs, boolean returnChildAssocs, boolean returnAspects, boolean returnPermissions, java.util.List<java.lang.String> permissionsToCheckFor, int maxResults, java.util.List<com.rivetlogic.core.cma.repo.SortDefinition> sortDefinitions)
          General search method used to query the specified store in Alfresco based on the supplied Lucene query and return nodes containing the properties selected.
static java.util.List<com.rivetlogic.core.cma.repo.Node> searchDeletedItems(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, java.lang.String query, java.util.List<org.alfresco.service.namespace.QName> properties)
          Searches the Archive Store in Alfresco based on the supplied Lucene query and returns nodes containing the selected meta-data.
static java.util.List<com.rivetlogic.core.cma.repo.Node> searchSpacesStore(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, java.lang.String query, java.util.List<org.alfresco.service.namespace.QName> properties, boolean returnPeerAssocs, boolean returnChildAssocs, boolean returnAspects, boolean returnPermissions, java.util.List<java.lang.String> permissionsToCheckFor, int maxResults)
          Searches the Spaces Store in Alfresco based on the supplied Lucene query and returns nodes containing the selected meta-data.
static void setPermission(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String authority, java.lang.String permission, boolean allow)
          Set a specific permission on a node.
static void setProperties(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> props)
          Sets properties of a given node.
static void writeContentFromStream(RaarServices raarServices, com.rivetlogic.core.cma.repo.Ticket ticket, org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.namespace.QName property, java.io.InputStream inputStream)
          Write content from the input stream to the specified node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RaarUtil

public RaarUtil()
Method Detail

searchSpacesStore

public static java.util.List<com.rivetlogic.core.cma.repo.Node> searchSpacesStore(RaarServices raarServices,
                                                                                  com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                                  java.lang.String query,
                                                                                  java.util.List<org.alfresco.service.namespace.QName> properties,
                                                                                  boolean returnPeerAssocs,
                                                                                  boolean returnChildAssocs,
                                                                                  boolean returnAspects,
                                                                                  boolean returnPermissions,
                                                                                  java.util.List<java.lang.String> permissionsToCheckFor,
                                                                                  int maxResults)
                                                                           throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                  com.rivetlogic.core.cma.exception.CmaRuntimeException
Searches the Spaces Store in Alfresco based on the supplied Lucene query and returns nodes containing the selected meta-data.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
query - the Lucene query to use.
properties - a list of properties to return with each node that matches the query.
returnPeerAssocs - return peer associations with each node.
returnChildAssocs - return child associations with each node.
returnAspects - return aspects with each node.
returnPermissions - return a list of this user's permissions to each node returned.
permissionsToCheckFor - List of permissions to check against the current authentication.
maxResults - maximum results to return (can not exceed 1000).
Returns:
a list of nodes that match the supplied query and contain the requested properties, associations, aspects, and permissions.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

searchDeletedItems

public static java.util.List<com.rivetlogic.core.cma.repo.Node> searchDeletedItems(RaarServices raarServices,
                                                                                   com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                                   java.lang.String query,
                                                                                   java.util.List<org.alfresco.service.namespace.QName> properties)
                                                                            throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                   com.rivetlogic.core.cma.exception.CmaRuntimeException
Searches the Archive Store in Alfresco based on the supplied Lucene query and returns nodes containing the selected meta-data.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
query - the Lucene query to use.
properties - a list of properties to return with each node that matches the query.
Returns:
a list of nodes that match the supplied query and contain the requested properties, associations, aspects, and permissions.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

search

public static java.util.List<com.rivetlogic.core.cma.repo.Node> search(RaarServices raarServices,
                                                                       com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                       org.alfresco.service.cmr.repository.StoreRef store,
                                                                       java.lang.String query,
                                                                       java.util.List<org.alfresco.service.namespace.QName> properties,
                                                                       boolean returnPeerAssocs,
                                                                       boolean returnChildAssocs,
                                                                       boolean returnAspects,
                                                                       boolean returnPermissions,
                                                                       java.util.List<java.lang.String> permissionsToCheckFor,
                                                                       int maxResults,
                                                                       java.util.List<com.rivetlogic.core.cma.repo.SortDefinition> sortDefinitions)
                                                                throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                       com.rivetlogic.core.cma.exception.CmaRuntimeException
General search method used to query the specified store in Alfresco based on the supplied Lucene query and return nodes containing the properties selected.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
store - the Alfresco StoreRef to search in.
query - the Lucene query to use.
properties - a list of properties to return with each node that matches the query.
returnPeerAssocs - return peer associations with each node.
returnChildAssocs - return child associations with each node.
returnAspects - return aspects with each node.
returnPermissions - return a list of this user's permissions to each node returned.
permissionsToCheckFor - List of permissions to check against the current authentication.
maxResults - maximum results to return (can not exceed 1000).
sortDefinitions - List of SortDefinition.
Returns:
a list of nodes that match the supplied query and contain the requested properties, associations, aspects, and permissions.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getArchiveStoreRoot

public static org.alfresco.service.cmr.repository.NodeRef getArchiveStoreRoot(RaarServices raarServices,
                                                                              com.rivetlogic.core.cma.repo.Ticket ticket)
                                                                       throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                              com.rivetlogic.core.cma.exception.CmaRuntimeException
Get the node reference of the archive store root node

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
Returns:
the NodeRef of the Archive Store root node.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

restoreNode

public static org.alfresco.service.cmr.repository.NodeRef restoreNode(RaarServices raarServices,
                                                                      com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                      org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                               throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                      com.rivetlogic.core.cma.exception.CmaRuntimeException
Restore a node to its original location.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - the nodeRef of the node to restore.
Returns:
the nodeRef of the restored node.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

restoreNode

public static org.alfresco.service.cmr.repository.NodeRef restoreNode(RaarServices raarServices,
                                                                      com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                      org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                      org.alfresco.service.cmr.repository.NodeRef destinationRef)
                                                               throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                      com.rivetlogic.core.cma.exception.CmaRuntimeException
Restore a node to the specified location.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - the nodeRef of the node to restore.
destinationRef - the nodeRef of the destination container. If null, the node's original location is used.
Returns:
the nodeRef of the restored node.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getChildRefByName

public static org.alfresco.service.cmr.repository.NodeRef getChildRefByName(RaarServices raarServices,
                                                                            com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                            org.alfresco.service.cmr.repository.NodeRef parentRef,
                                                                            java.lang.String name)
                                                                     throws org.alfresco.service.cmr.repository.InvalidNodeRefException,
                                                                            com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                            com.rivetlogic.core.cma.exception.CmaRuntimeException
Gets the NodeRef of the node with the supplied name within the context of the node represented by parentRef. The name is case-insensitive.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
parentRef - the NodeRef of the node to search within.
name - the name of the node to search for (the property cm:name).
Returns:
the NodeRef of the child node or null if not found.
Throws:
org.alfresco.service.cmr.repository.InvalidNodeRefException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

saveCategories

public static void saveCategories(RaarServices raarServices,
                                  com.rivetlogic.core.cma.repo.Ticket ticket,
                                  java.util.List<org.alfresco.service.cmr.repository.NodeRef> categories,
                                  org.alfresco.service.cmr.repository.NodeRef nodeRef)
                           throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                  com.rivetlogic.core.cma.exception.CmaRuntimeException
Associates the supplied categories with the node identified by nodeRef.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
categories - List of categories to associate to the specified node.
nodeRef - the node to associate categories to.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getRootCategories

public static java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> getRootCategories(RaarServices raarServices,
                                                                                                              com.rivetlogic.core.cma.repo.Ticket ticket)
                                                                                                       throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                                              com.rivetlogic.core.cma.exception.CmaRuntimeException
Get all root categories.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
Returns:
a list of categories identified by their ChildAssociationRefs.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getCategories

public static java.util.Collection<org.alfresco.service.cmr.repository.ChildAssociationRef> getCategories(RaarServices raarServices,
                                                                                                          com.rivetlogic.core.cma.repo.Ticket ticket)
                                                                                                   throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                                          com.rivetlogic.core.cma.exception.CmaRuntimeException
Get all categories.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
Returns:
a list of categories identified by their ChildAssociationRefs.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getNodeCategories

public static java.util.Map<org.alfresco.service.cmr.repository.NodeRef,java.lang.String> getNodeCategories(RaarServices raarServices,
                                                                                                            com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                                                            org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                                                                     throws org.alfresco.service.cmr.repository.InvalidNodeRefException,
                                                                                                            com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                                            com.rivetlogic.core.cma.exception.CmaRuntimeException
Get all the child associations representing the categories of the given node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - the node to get categories for.
Returns:
a map of the node's categories NodeRefs to the categories names.
Throws:
org.alfresco.service.cmr.repository.InvalidNodeRefException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getParentRef

public static org.alfresco.service.cmr.repository.NodeRef getParentRef(RaarServices raarServices,
                                                                       com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                       org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                                throws org.alfresco.service.cmr.repository.InvalidNodeRefException,
                                                                       com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                       com.rivetlogic.core.cma.exception.CmaRuntimeException
Get the parent node reference for a given node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - the node to get the parent of.
Returns:
the node reference of the parent node
Throws:
org.alfresco.service.cmr.repository.InvalidNodeRefException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getPathFromNodeRef

public static java.lang.String getPathFromNodeRef(RaarServices raarServices,
                                                  com.rivetlogic.core.cma.repo.Ticket ticket,
                                                  org.alfresco.service.cmr.repository.NodeRef ref)
                                           throws org.alfresco.service.cmr.repository.InvalidNodeRefException,
                                                  com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                  com.rivetlogic.core.cma.exception.CmaRuntimeException
Generate a search XPATH pointing to the specified node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
ref - the NodeRef of the node to get the path for.
Returns:
XPATH to the supplied node.
Throws:
org.alfresco.service.cmr.repository.InvalidNodeRefException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getStandardFoldersRef

public static java.util.List<com.rivetlogic.core.cma.repo.Node> getStandardFoldersRef(RaarServices raarServices,
                                                                                      com.rivetlogic.core.cma.repo.Ticket ticket)
                                                                               throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                      com.rivetlogic.core.cma.exception.CmaRuntimeException
Get standard folder nodes (Alfresco space templates).

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
Returns:
the list of Alfresco spaces in the ScarConfig.STANDARD_FOLDERS_LOCATION
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getPath

public static org.alfresco.service.cmr.repository.Path getPath(RaarServices raarServices,
                                                               com.rivetlogic.core.cma.repo.Ticket ticket,
                                                               org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                        throws org.alfresco.service.cmr.repository.InvalidNodeRefException,
                                                               com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                               com.rivetlogic.core.cma.exception.CmaRuntimeException
Get a Path object for the given node reference.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - the node to get the path to.
Returns:
the Path of the specified node.
Throws:
org.alfresco.service.cmr.repository.InvalidNodeRefException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getChildAssocs

public static java.util.List<org.alfresco.service.cmr.repository.ChildAssociationRef> getChildAssocs(RaarServices raarServices,
                                                                                                     com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                                                     org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                                                              throws org.alfresco.service.cmr.repository.InvalidNodeRefException,
                                                                                                     com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                                     com.rivetlogic.core.cma.exception.CmaRuntimeException
Returns child associations of the given node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - the node to get the child associations for.
Returns:
a list of child associations of the given node.
Throws:
org.alfresco.service.cmr.repository.InvalidNodeRefException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getProperties

public static java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> getProperties(RaarServices raarServices,
                                                                                                     com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                                                     org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                                                              throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                                     com.rivetlogic.core.cma.exception.CmaRuntimeException
Returns the Alfresco properties map for the given node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - the node to get its properties.
Returns:
the given node's properties map.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

setProperties

public static void setProperties(RaarServices raarServices,
                                 com.rivetlogic.core.cma.repo.Ticket ticket,
                                 org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                 java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> props)
                          throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                 com.rivetlogic.core.cma.exception.CmaRuntimeException
Sets properties of a given node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - the node to set properties for.
props - the properties map to set.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

createNode

public static org.alfresco.service.cmr.repository.ChildAssociationRef createNode(RaarServices raarServices,
                                                                                 com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                                 org.alfresco.service.cmr.repository.NodeRef parentRef,
                                                                                 org.alfresco.service.namespace.QName assocTypeQName,
                                                                                 org.alfresco.service.namespace.QName assocQName,
                                                                                 org.alfresco.service.namespace.QName nodeTypeQName,
                                                                                 java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> nodeProperties)
                                                                          throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                 com.rivetlogic.core.cma.exception.CmaRuntimeException
Create a node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
parentRef - reference of the container for the new node.
assocTypeQName - the type of the association to create.
assocQName - the qualified name of the association.
nodeTypeQName - the qualified name of the node type.
nodeProperties - initial properties to set (can be null if no properties are to be set).
Returns:
child association of the parent node to the newly created node.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

createFolder

public static org.alfresco.service.cmr.repository.NodeRef createFolder(RaarServices raarServices,
                                                                       com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                       java.lang.String folderName,
                                                                       org.alfresco.service.cmr.repository.NodeRef container,
                                                                       java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> properties)
                                                                throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                       com.rivetlogic.core.cma.exception.CmaRuntimeException
Create a folder.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
folderName - name of the folder to create.
container - node reference of the container node.
properties - map of properties to set for the new folder.
Returns:
reference to the newly created folder.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

deleteNode

public static org.alfresco.service.cmr.repository.NodeRef deleteNode(RaarServices raarServices,
                                                                     com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                     org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                              throws org.alfresco.service.cmr.lock.NodeLockedException,
                                                                     com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                     com.rivetlogic.core.cma.exception.CmaRuntimeException
delete the node represented by the specified node reference.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference of the node to delete.
Returns:
the node reference of the deleted node.
Throws:
org.alfresco.service.cmr.lock.NodeLockedException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

writeContentFromStream

public static void writeContentFromStream(RaarServices raarServices,
                                          com.rivetlogic.core.cma.repo.Ticket ticket,
                                          org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                          org.alfresco.service.namespace.QName property,
                                          java.io.InputStream inputStream)
                                   throws org.alfresco.service.cmr.lock.NodeLockedException,
                                          com.rivetlogic.core.cma.exception.InvalidTicketException,
                                          com.rivetlogic.core.cma.exception.CmaRuntimeException
Write content from the input stream to the specified node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - node to write content to.
property - qualified name of the property to write content to.
inputStream - input stream to get the content from.
Throws:
org.alfresco.service.cmr.lock.NodeLockedException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

readContentIntoStream

public static void readContentIntoStream(RaarServices raarServices,
                                         com.rivetlogic.core.cma.repo.Ticket ticket,
                                         org.alfresco.service.cmr.repository.NodeRef fileRef,
                                         java.io.OutputStream outStream)
                                  throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                         com.rivetlogic.core.cma.exception.CmaRuntimeException
Download content from the specified node into an output stream.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
fileRef - the node to get content from.
outStream - the output stream to use.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getMimeType

public static java.lang.String getMimeType(RaarServices raarServices,
                                           com.rivetlogic.core.cma.repo.Ticket ticket,
                                           org.alfresco.service.cmr.repository.NodeRef fileRef)
                                    throws org.alfresco.service.cmr.dictionary.InvalidTypeException,
                                           org.alfresco.service.cmr.repository.InvalidNodeRefException,
                                           com.rivetlogic.core.cma.exception.InvalidTicketException,
                                           com.rivetlogic.core.cma.exception.CmaRuntimeException
Get the MIME type of the given node reference.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
fileRef - file to get the MIME type for.
Returns:
the content MIME type of the node represented by the given node reference.
Throws:
org.alfresco.service.cmr.dictionary.InvalidTypeException
org.alfresco.service.cmr.repository.InvalidNodeRefException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

authenticate

public static com.rivetlogic.core.cma.repo.Ticket authenticate(RaarServices raarServices,
                                                               java.lang.String userName,
                                                               java.lang.String password)
                                                        throws com.rivetlogic.core.cma.exception.AuthenticationFailure
Authenticate user with Alfresco repository.

Parameters:
userName -
password -
Returns:
a com.rivetlogic.core.cma.repo.Ticket object representing the authentication ticket returned from Alfresco.
Throws:
com.rivetlogic.core.cma.exception.AuthenticationFailure

checkOut

public static org.alfresco.service.cmr.repository.NodeRef checkOut(RaarServices raarServices,
                                                                   com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                   org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                   org.alfresco.service.cmr.repository.NodeRef destination)
                                                            throws org.alfresco.service.cmr.lock.NodeLockedException,
                                                                   com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                   com.rivetlogic.core.cma.exception.CmaRuntimeException
Check out a node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference of the node to check out.
destination - reference of the container to create the working copy in.
Returns:
node reference of the working copy.
Throws:
org.alfresco.service.cmr.lock.NodeLockedException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

checkIn

public static org.alfresco.service.cmr.repository.NodeRef checkIn(RaarServices raarServices,
                                                                  com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                  org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                  java.lang.String revisionHistory,
                                                                  boolean majorVersion)
                                                           throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                  org.alfresco.service.cmr.repository.AspectMissingException,
                                                                  com.rivetlogic.core.cma.exception.CmaRuntimeException
Check in a node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference of the working copy to check in.
revisionHistory - comment to attach to the checked in version.
majorVersion - flag to indicate if this is a major revision (updates the major version number instead of the minor).
Returns:
reference to the original check out file.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
org.alfresco.service.cmr.repository.AspectMissingException
com.rivetlogic.core.cma.exception.CmaRuntimeException

cancelCheckOut

public static org.alfresco.service.cmr.repository.NodeRef cancelCheckOut(RaarServices raarServices,
                                                                         com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                         org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                                  throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                         org.alfresco.service.cmr.repository.AspectMissingException,
                                                                         com.rivetlogic.core.cma.exception.CmaRuntimeException
Undo check out for a node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference of the working copy to cancel check out for.
Returns:
reference to the original check out file.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
org.alfresco.service.cmr.repository.AspectMissingException
com.rivetlogic.core.cma.exception.CmaRuntimeException

invalidateTicket

public static void invalidateTicket(RaarServices raarServices,
                                    com.rivetlogic.core.cma.repo.Ticket ticket)
                             throws com.rivetlogic.core.cma.exception.CmaRuntimeException
Invalidate a ticket.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
Throws:
com.rivetlogic.core.cma.exception.CmaRuntimeException

getVersionHistory

public static org.alfresco.service.cmr.version.VersionHistory getVersionHistory(RaarServices raarServices,
                                                                                com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                                org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                                         throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                com.rivetlogic.core.cma.exception.CmaRuntimeException,
                                                                                org.alfresco.service.cmr.repository.AspectMissingException
Get the version history of the specified node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference of the node to get the version history for.
Returns:
version history of the specified node.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException
org.alfresco.service.cmr.repository.AspectMissingException

getPermissions

public static java.util.Set<org.alfresco.service.cmr.security.AccessPermission> getPermissions(RaarServices raarServices,
                                                                                               com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                                               org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                                                        throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                               com.rivetlogic.core.cma.exception.CmaRuntimeException
Get all the permissions that are granted/denied to the current authentication on the given node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference of the node to get the permissions for.
Returns:
the permissions set on the specified node for the current authentication.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

setPermission

public static void setPermission(RaarServices raarServices,
                                 com.rivetlogic.core.cma.repo.Ticket ticket,
                                 org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                 java.lang.String authority,
                                 java.lang.String permission,
                                 boolean allow)
                          throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                 com.rivetlogic.core.cma.exception.CmaRuntimeException
Set a specific permission on a node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference of the node to set the permission on.
authority - user/group name to set the permission for.
permission - the permission to set.
allow - true means allow, and false means deny.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

removePermission

public static void removePermission(RaarServices raarServices,
                                    com.rivetlogic.core.cma.repo.Ticket ticket,
                                    org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                    java.lang.String authority,
                                    java.lang.String permission)
                             throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                    com.rivetlogic.core.cma.exception.CmaRuntimeException
Find and delete an access control entry by node, authentication and permission. It is possible to delete:
  1. 1. a specific permission,
  2. 2. all permissions for an authority (if the permission is null),
  3. 3. entries for all authorities that have a specific permission (if the authority is null), and
  4. 4. all permissions set for the node (if both the permission and authority are null).

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference to the node that the entry applies to.
authority - the user/group name (if null then this will match all authorities).
permission - the permission to remove (if null then this will match all permissions).
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getAllUserNodePermissions

public static java.util.Map<org.alfresco.service.cmr.security.AccessPermission,java.lang.Boolean> getAllUserNodePermissions(RaarServices raarServices,
                                                                                                                            com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                                                                            org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                                                                                                     throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                                                                            com.rivetlogic.core.cma.exception.CmaRuntimeException
Get all the permissions the current user has on the provided node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference to the node whose permissions are being queried.
Returns:
a map of user permissions associated with the specified node
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

hasCreatePermission

public static boolean hasCreatePermission(RaarServices raarServices,
                                          com.rivetlogic.core.cma.repo.Ticket ticket,
                                          org.alfresco.service.cmr.repository.NodeRef ref)
                                   throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                          com.rivetlogic.core.cma.exception.CmaRuntimeException
Check if the current user has create permissions on the given node (should be a folder).

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
ref - reference of the node to check the "AddChildren" permission on.
Returns:
true if the user has create ("AddChildren") permission on the given node which should be a folder, otherwise the return value is false.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

hasDeletePermission

public static boolean hasDeletePermission(RaarServices raarServices,
                                          com.rivetlogic.core.cma.repo.Ticket ticket,
                                          org.alfresco.service.cmr.repository.NodeRef ref)
                                   throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                          com.rivetlogic.core.cma.exception.CmaRuntimeException
Check if the current user has delete permissions on the given node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
ref - reference of the node to check the "Delete" permission on.
Returns:
true if the user has delete permission on the given node, otherwise the return value is false.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

hasWritePropertiesPermission

public static boolean hasWritePropertiesPermission(RaarServices raarServices,
                                                   com.rivetlogic.core.cma.repo.Ticket ticket,
                                                   org.alfresco.service.cmr.repository.NodeRef ref)
                                            throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                   com.rivetlogic.core.cma.exception.CmaRuntimeException
Check if the current user has permissions to change the given node's meta data.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
ref - reference of the node to check the "WriteProperties" permission on.
Returns:
true if the user has permissions to change the given node's meta data, otherwise the return value is false.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getUserNodeRef

public static org.alfresco.service.cmr.repository.NodeRef getUserNodeRef(RaarServices raarServices,
                                                                         com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                         java.lang.String username)
                                                                  throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                         com.rivetlogic.core.cma.exception.AuthorityNotFoundException,
                                                                         com.rivetlogic.core.cma.exception.CmaRuntimeException
Get the node reference that represents the current user.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
username - the Alfresco username to get the reference for.
Returns:
the node reference that represents the current user.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.AuthorityNotFoundException
com.rivetlogic.core.cma.exception.CmaRuntimeException

removeAspect

public static void removeAspect(RaarServices raarServices,
                                com.rivetlogic.core.cma.repo.Ticket ticket,
                                org.alfresco.service.cmr.repository.NodeRef ref,
                                org.alfresco.service.namespace.QName aspect)
                         throws org.alfresco.service.cmr.dictionary.InvalidAspectException,
                                org.alfresco.service.cmr.repository.InvalidNodeRefException,
                                com.rivetlogic.core.cma.exception.InvalidTicketException,
                                com.rivetlogic.core.cma.exception.CmaRuntimeException
Remove an aspect from the given node.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
ref - reference to the node to remove the aspect from.
aspect - the aspect to remove.
Throws:
org.alfresco.service.cmr.dictionary.InvalidAspectException
org.alfresco.service.cmr.repository.InvalidNodeRefException
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

moveNode

public static org.alfresco.service.cmr.repository.NodeRef moveNode(RaarServices raarServices,
                                                                   com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                   org.alfresco.service.cmr.repository.NodeRef nodeToMove,
                                                                   org.alfresco.service.cmr.repository.NodeRef destinationContainer)
                                                            throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                   com.rivetlogic.core.cma.exception.CmaRuntimeException
Move the specified node to the destination node reference.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeToMove - reference to the node being moved.
destinationContainer - reference to the node that will become the new container of the moved node.
Returns:
node reference to the moved node.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

copyNode

public static org.alfresco.service.cmr.repository.NodeRef copyNode(RaarServices raarServices,
                                                                   com.rivetlogic.core.cma.repo.Ticket ticket,
                                                                   org.alfresco.service.cmr.repository.NodeRef nodeToCopy,
                                                                   org.alfresco.service.cmr.repository.NodeRef destinationContainer)
                                                            throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                   com.rivetlogic.core.cma.exception.CmaRuntimeException
Copy the specified node to the destination node reference.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeToCopy - reference to the node being copied.
destinationContainer - reference to the node that will become the container of the copied node.
Returns:
node reference to the newly created copy of the node.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getNodeName

public static java.lang.String getNodeName(RaarServices raarServices,
                                           com.rivetlogic.core.cma.repo.Ticket ticket,
                                           org.alfresco.service.cmr.repository.NodeRef nodeRef)
                                    throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                           com.rivetlogic.core.cma.exception.CmaRuntimeException
Gets a node's name in Alfresco using the node's reference.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference to the node to get the name property for.
Returns:
the value of the property cm:name as returned in the Alfresco properties map.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getNode

public static com.rivetlogic.core.cma.repo.Node getNode(RaarServices raarServices,
                                                        com.rivetlogic.core.cma.repo.Ticket ticket,
                                                        org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                        java.util.List<org.alfresco.service.namespace.QName> properties,
                                                        boolean returnPeerAssocs,
                                                        boolean returnChildAssocs,
                                                        boolean returnAspects,
                                                        boolean returnPermissions,
                                                        java.util.List<java.lang.String> permissionsToCheckFor)
                                                 throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                        com.rivetlogic.core.cma.exception.CmaRuntimeException
Get the node represented by the given node reference.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
nodeRef - reference to the node to get.
properties - a list of the properties to get with the node.
returnPeerAssocs - return peer associations with the node.
returnChildAssocs - return child associations with the node.
returnAspects - return aspects with the node.
returnPermissions - return a list of this user's permissions to the node returned.
permissionsToCheckFor - List of permissions to check against the current authentication.
Returns:
the node represented by the given node reference.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException

getAllUsers

public static java.util.List<com.rivetlogic.core.cma.repo.Node> getAllUsers(RaarServices raarServices,
                                                                            com.rivetlogic.core.cma.repo.Ticket ticket)
                                                                     throws com.rivetlogic.core.cma.exception.InvalidTicketException,
                                                                            com.rivetlogic.core.cma.exception.CmaRuntimeException
Get a list of all users.

Parameters:
raarServices - the collection of RAAr services to use.
ticket - the ticket obtained post authentication with Alfresco.
Returns:
a list of nodes where each node represents a user.
Throws:
com.rivetlogic.core.cma.exception.InvalidTicketException
com.rivetlogic.core.cma.exception.CmaRuntimeException


Copyright 2008, Rivet Logic Corporation.