| org.sakaiproject.content.api.ContentHostingService
All known Subclasses: org.sakaiproject.content.impl.BaseContentService,
ContentHostingService | public interface ContentHostingService extends EntityProducer(Code) | |
ContentHostingService is the Interface for Sakai Content Hosting services. This service is based on WebDAV for terminology and capability, although it may be implemented using some other content management framework.
The ContentHostingService manages shared content resources and collections. A resource is a file of some media type (MIME, such as image/gif, text/html, etc), with a resource id (a URI) and properties (name value pairs), as described in WebDAV.
Resources are organized in collections. A collection is a list of resource ids, and is itself a resource with a resource id. In the spirit of WebDAV, a resource must be placed into a collection, and the containing collection must exist before the
resource is added.
Resource ids used in the API with the service are relative to the root "/" collection of the service. The full URL to a resource can be accessed from the service or from a resource object.
Resources have any number of properties. A property is defined by a name, which includes an XML namespace, and a value, which is any string. Some properties are pre-defined (by the DAV: namespace), and are "live"; the value is generated by the service.
Other properties are "dead", the values are maintained by the users. Properties from namespaces other than "DAV:" are accepted.
TO DO:
- add copy, move to collection and resource
- add lock
- add version control
The ContentHostingService can be asked:
- access, create or delete a collection resource.
- access, create or delete a non-collection resource in a collection.
- access, add to or delete properties of a resource.
See the methods in this API for details.
Security is enforced and Usage Events are generated when there are these accesses:
- create a resource: content.new
- read a resource: content.read
- update the contents/properties of a resource: content.revise
- removing a resource: content.delete
|
Method Summary | |
public ContentResource | addAttachmentResource(String name, String type, byte[] content, ResourceProperties properties) Create a new resource as an attachment to some other resource in the system. | public ContentResource | addAttachmentResource(String name, String site, String tool, String type, byte[] content, ResourceProperties properties) Create a new resource as an attachment to some other resource in the system. | public ContentResourceEdit | addAttachmentResource(String name) Create a new resource as an attachment to some other resource in the system, locked for update. | public ContentCollection | addCollection(String id, ResourceProperties properties) Create a new collection with the given resource id.
Parameters: id - The id of the collection. Parameters: properties - A ResourceProperties object with the properties to add to the new collection. exception: IdUsedException - if the id is already in use. exception: IdInvalidException - if the id is invalid. exception: PermissionException - if the user does not have permission to add a collection, or add a member to a collection. exception: InconsistentException - if the containing collection does not exist. | public ContentCollection | addCollection(String id, ResourceProperties properties, Collection groups) Create a new collection with the given resource id.
Parameters: id - The id of the collection. Parameters: properties - A ResourceProperties object with the properties to add to the new collection. Parameters: groups - The (possibly empty) collection (String) of reference-strings for groups to be associated with this entity. exception: IdUsedException - if the id is already in use. exception: IdInvalidException - if the id is invalid. exception: PermissionException - if the user does not have permission to add a collection, or add a member to a collection. exception: InconsistentException - if the containing collection does not exist. | public ContentCollection | addCollection(String id, ResourceProperties properties, Collection groups, boolean hidden, Time releaseDate, Time retractDate) Create a new collection with the given resource id.
Parameters: id - The id of the collection. Parameters: properties - A ResourceProperties object with the properties to add to the new collection. Parameters: groups - The (possibly empty) collection (String) of reference-strings for groups to be associated with this entity. Parameters: hidden - A flag indicating that the entity should be hidden from users unless they created the entity or have permission to modify it. Parameters: releaseDate - The time at which the entity becomes available to most users. | public ContentCollectionEdit | addCollection(String id) Create a new collection with the given resource id, locked for update. | public ContentCollectionEdit | addCollection(String collectionId, String name) Parameters: collectionId - Parameters: name - exception: PermissionException - if the user does not have permission to add a resource to the containing collection. exception: TypeException - if the collectionId is not in the form to identify a collection. | public ResourceProperties | addProperty(String id, String name, String value) Add / update a property for a collection or resource.
Parameters: id - The id of the resource. Parameters: name - The properties name to add or update Parameters: value - The new value for the property. exception: PermissionException - if the user does not have premissions to write properties on this object or read through containing collections. exception: IdUnusedException - if the resource id is not found. exception: TypeException - if any property requested cannot be set (it may be live). exception: InUseException - if the resource is locked by someone else. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. | public ContentResource | addResource(String id, String type, byte[] content, ResourceProperties properties, int priority) Create a new resource with the given properties.
Parameters: id - The id of the new resource. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. Parameters: priority - The notification priority for this commit. exception: PermissionException - if the user does not have permission to add a resource to the containing collection. exception: IdUsedException - if the resource id is already in use. exception: IdInvalidException - if the resource id is invalid. exception: InconsistentException - if the containing collection does not exist. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. | public ContentResource | addResource(String name, String collectionId, int limit, String type, byte[] content, ResourceProperties properties, int priority) Create a new resource with the given resource name used as a resource id within the
specified collection or (if that id is already in use) with a resource id based on
a variation on the name to achieve a unique id, provided a unique id can be found
before a limit is reached on the number of attempts to achieve uniqueness.
Parameters: name - The name of the new resource (such as a filename). Parameters: collectionId - The id of the collection to which the resource should be added. Parameters: limit - The maximum number of attempts at finding a unique id based on the given id. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. Parameters: priority - The notification priority for this commit. exception: PermissionException - if the user does not have permission to add a resource to the containing collection. exception: IdUniquenessException - if a unique resource id cannot be found before the limit on the number of attempts is reached. exception: IdLengthException - if the resource id exceeds the maximum number of characters for a valid resource id. exception: IdInvalidException - if the resource id is invalid. exception: InconsistentException - if the containing collection does not exist. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. | public ContentResource | addResource(String id, String type, byte[] content, ResourceProperties properties, Collection groups, int priority) Create a new resource with the given id and attributes, including group awareness.
Parameters: id - The id of the new resource. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. Parameters: groups - A collection (String) of references to Group objects representing the site subgroups that should have access to this entity.May be empty to indicate access is not limited to a group or groups. Parameters: priority - The notification priority for this commit. exception: PermissionException - if the user does not have permission to add a resource to the containing collection. exception: IdUsedException - if the resource id is already in use. exception: IdInvalidException - if the resource id is invalid. exception: InconsistentException - if the containing collection does not exist. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. | public ContentResource | addResource(String name, String collectionId, int limit, String type, byte[] content, ResourceProperties properties, Collection groups, int priority) Create a new resource with the given resource name used as a resource id within the
specified collection or (if that id is already in use) with a resource id based on
a variation on the name to achieve a unique id, provided a unique id can be found
before a limit is reached on the number of attempts to achieve uniqueness.
Parameters: name - The name of the new resource (such as a filename). Parameters: collectionId - The id of the collection to which the resource should be added. Parameters: limit - The maximum number of attempts at finding a unique id based on the given id. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. Parameters: groups - A collection (String) of references to Group objects representing the site subgroups that should have access to this entity.May be empty to indicate access is not limited to a group or groups. Parameters: priority - The notification priority for this commit. exception: PermissionException - if the user does not have permission to add a resource to the containing collection. exception: IdUniquenessException - if a unique resource id cannot be found before the limit on the number of attempts is reached. exception: IdLengthException - if the resource id exceeds the maximum number of characters for a valid resource id. exception: IdInvalidException - if the resource id is invalid. exception: InconsistentException - if the containing collection does not exist. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. | public ContentResource | addResource(String name, String collectionId, int limit, String type, byte[] content, ResourceProperties properties, Collection groups, boolean hidden, Time releaseDate, Time retractDate, int priority) Create a new resource with the given resource name used as a resource id within the
specified collection or (if that id is already in use) with a resource id based on
a variation on the name to achieve a unique id, provided a unique id can be found
before a limit is reached on the number of attempts to achieve uniqueness.
Parameters: name - The name of the new resource (such as a filename). Parameters: collectionId - The id of the collection to which the resource should be added. Parameters: limit - The maximum number of attempts at finding a unique id based on the given id. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. Parameters: groups - A collection (String) of references to Group objects representing the site subgroups that should have access to this entity.May be empty to indicate access is not limited to a group or groups. Parameters: hidden - A flag indicating that the entity should be hidden from users unless they created the entity or have permission to modify it. Parameters: releaseDate - The time at which the entity becomes available to most users. | public ContentResourceEdit | addResource(String id) Create a new resource with the given resource id, locked for update. | public ContentResourceEdit | addResource(String collectionId, String basename, String extension, int maximum_tries) Attempt to create a new resource in a particular collection. | public boolean | allowAddAttachmentResource() check permissions for addAttachmentResource(). | public boolean | allowAddCollection(String id) check permissions for addCollection().
Parameters: channelId - The channel id. | public boolean | allowAddProperty(String id) check permissions for addProperty().
Parameters: id - The id of the new resource. | public boolean | allowAddResource(String id) check permissions for addResource().
Parameters: id - The id of the new resource. | public boolean | allowCopy(String id, String new_id) check permissions for copy().
Parameters: id - The id of the new resource. Parameters: new_id - The desired id of the new resource. | public boolean | allowGetCollection(String id) Check permissions for getCollection().
Parameters: id - The id of the collection. | public boolean | allowGetProperties(String id) check permissions for getProperties().
Parameters: id - The id of the new resource. | public boolean | allowGetResource(String id) check permissions for getResource().
Parameters: id - The id of the new resource. | public boolean | allowRemoveCollection(String id) check permissions for removeCollection().
Parameters: id - The id of the collection. | public boolean | allowRemoveProperty(String id) check permissions for removeProperty().
Parameters: id - The id of the new resource. | public boolean | allowRemoveResource(String id) check permissions for removeResource().
Parameters: id - The id of the new resource. | public boolean | allowRename(String id, String new_id) check permissions for rename().
Parameters: id - The id of the existing resource. | public boolean | allowUpdateCollection(String id) check permissions for editCollection()
Parameters: id - The id of the collection. | public boolean | allowUpdateResource(String id) check permissions for updateResource().
Parameters: id - The id of the new resource. | String | archiveResources(List resources, Document doc, Stack stack, String archivePath) Archive the specified list of resources.
Parameters: resources - A list of the resources to archive. Parameters: doc - The document to contain the xml. Parameters: stack - The stack of elements, the top of which will be the containing element of the "service.name" element. Parameters: archivePath - The path to the folder where we are writing auxilary files. | public void | cancelCollection(ContentCollectionEdit edit) Cancel the changes made object, and release the lock. | public void | cancelResource(ContentResourceEdit edit) Cancel the changes made object, and release the lock. | public void | checkCollection(String id) Check access to the collection with this local resource id. | public void | checkResource(String id) Check access to the resource with this local resource id. | public void | commitCollection(ContentCollectionEdit edit) Commit the changes made, and release the lock. | public void | commitResource(ContentResourceEdit edit) Commit the changes made, and release the lock. | public void | commitResource(ContentResourceEdit edit, int priority) Commit the changes made, and release the lock. | public boolean | containsLockedNode(String id) Returns true if this Collection or any of its contents has a lock. | public String | copy(String id, String new_id) Copy a resource.
Parameters: id - The id of the resource. Parameters: new_id - The desired id of the new resource. | public String | copyIntoFolder(String id, String folder_id) Copy a collection or resource from one location to another. | public void | createDropboxCollection() Create the current site's dropbox collection and one for each qualified user that the current user can make. | public void | createDropboxCollection(String siteId) Create the site's dropbox collection and one for each qualified user that the current user can make. | public void | createIndividualDropbox(String siteId) Create an individual dropbox collection for the current user if the site-level dropbox exists
and the current user has EVENT_DROPBOX_OWN permission for the site. | public ContentCollectionEdit | editCollection(String id) Access the collection with this local resource id, locked for update. | public ContentResourceEdit | editResource(String id) Access the resource with this resource id, locked for update. | public void | eliminateDuplicates(Collection resourceIds) Eliminate from the collection any duplicates as well as any items that are contained within another item whose resource-id is in the collection. | public List | findResources(String type, String primaryMimeType, String subMimeType) Find the resources this user has read access to from all worksites of the appropriate type.
Parameters: type - this is the ResourceProperties.PROP_STRUCTOBJ_TYPE for stuctured objects or ResourceProperties.FILE_TYPE for file resources or null for all resources. Parameters: primaryMimeType - The primary mime type (ie. | public List | getAllEntities(String id) Access a List of ContentEntities (resources and collections) objects in this path (and below) to which the current user has access.
Parameters: id - A collection id. | public List | getAllResources(String id) Access a List of all the ContentResource objects in this path (and below) which the current user has access.
Parameters: id - A collection id. | public ContentCollection | getCollection(String id) Access the collection with this local resource id. | public Map | getCollectionMap() Return a map of Worksite collections roots that the user has access to. | public int | getCollectionSize(String id) Count the number of (recursive) children for a given id. | public String | getContainingCollectionId(String id) Access the resource id of the collection which contains this collection or resource. | public int | getDepth(String resourceId, String baseCollectionId) | public String | getDropboxCollection() Access the default dropbox collection id for the current request.
If the current user is a dropbox maintainer for the current site, return the site's dropbox area.
Otherwis return the current user's collection within the site's dropbox. | public String | getDropboxCollection(String siteId) Access the default dropbox collection id for the current request.
If the current user is a dropbox maintainer for the current site, return the site's dropbox area.
Otherwis return the current user's collection within the site's dropbox.
Parameters: siteId - The site id. | public String | getDropboxDisplayName() Access the default dropbox collection display name for the current request. | public String | getDropboxDisplayName(String siteId) Access the default dropbox collection display name for the site. | public Collection | getGroupsWithAddPermission(String collectionId) Access a collection (Group) of groups to which this user has access and whose members have "content.new" permission in the collection. | public Collection | getGroupsWithReadAccess(String collectionId) Access a collection (Group) of groups to which this user has access and whose members have "content.read" permission in the collection. | public Collection | getGroupsWithRemovePermission(String collectionId) Access a collection (Group) of groups to which this user has access and whose members have "content.delete" permission in the collection. | Collection | getLocks(String id) Gets all locks set on the resource with this local resource id. | public ResourceProperties | getProperties(String id) Access the properties of a resource with this resource id, either collection or resource.
Parameters: id - The id of the resource. exception: PermissionException - if the user does not have permissions to read properties on this object or read through containing collections. exception: IdUnusedException - if the resource id is not found. | public long | getQuota(org.sakaiproject.content.api.ContentCollection collection) gets the quota for a site collection or for a user's my workspace collection
Parameters: collection - the collection on which to test for a quota. | public String | getReference(String id) Access the internal reference from a resource id.
Parameters: id - The resource id. | public ContentResource | getResource(String id) Access the resource with this resource id. | String | getSiteCollection(String siteId) Return the collection id of the root collection for this site id.
Parameters: siteId - The site id. | public String | getUrl(String id) Access the resource URL from a resource id.
Parameters: id - The resource id. | public String | getUrl(String id, String rootProperty) Access the alternate URL which can be used to access the entity.
Parameters: id - The resource id. Parameters: rootProperty - The name of the entity property whose value controls which alternate reference URL is requested. | public String | getUuid(String id) | public boolean | isAttachmentResource(String id) Check whether a resource id or collection id references an entity in the attachments collection. | public boolean | isAvailabilityEnabled() Access flag indicating whether entities can be hidden (scheduled or otherwise). | public boolean | isAvailable(String entityId) Determine whether an entity is available to this user at this time, taking into account whether the item is hidden and the user's
status with respect to viewing hidden entities in this context.
Parameters: entityId - true if the item is not hidden or it's hidden but the user has permissions to view hidden items in this context (site? folder? group?), and false otherwise. | public boolean | isCollection(String entityId) Determine whether the entityId parameter identifies a collection (as opposed to a resource). | public boolean | isDropboxMaintainer() Determine whether the default dropbox collection id for this user in this site is the site's entire dropbox collection or just the current user's collection within the site's dropbox. | public boolean | isDropboxMaintainer(String siteId) Determine whether the default dropbox collection id for this user in some site is the site's entire dropbox collection or just the current user's collection within the site's dropbox. | public boolean | isInDropbox(String entityId) Check whether an id would identify an entity in a dropbox. | public boolean | isInheritingPubView(String id) Does this resource inherit public view by having it set in a containing folder (not counting it's own setting)?
Parameters: id - The resource id to check. | public boolean | isLocked(String id) | public boolean | isPubView(String id) Does this resource support public view?
Parameters: id - The resource id to check. | public boolean | isRootCollection(String id) Test if this id (reference, or URL) refers to the root collection. | public boolean | isShortRefs() Access the shortRefs configuration. | public boolean | isSortByPriorityEnabled() Access flag indicating whether sorting by "priority" is enabled. | public void | lockObject(String id, String lockId, String subject, boolean system) Locks an object (resource or collection) with specified local resource id. | public String | moveIntoFolder(String id, String folder_id) Move a resource or collection to a (different) folder. | public Comparator | newContentHostingComparator(String property, boolean ascending) Construct a content hosting comparator. | public ResourcePropertiesEdit | newResourceProperties() Construct a stand-alone, not associated with any particular resource, ResourceProperties object. | public void | removeAllLocks(String id) | public void | removeCollection(String id) Remove a collection and all members of the collection, internal or deeper.
Parameters: id - The id of the collection. exception: IdUnusedException - if the id does not exist. exception: TypeException - if the resource exists but is not a collection. exception: PermissionException - if the user does not have permissions to remove this collection, read through any containing exception: InUseException - if the collection or a contained member is locked by someone else. | public void | removeCollection(ContentCollectionEdit edit) Remove just a collection. | public void | removeLock(String id, String lockId) Removes lock with given Id from object (resource or collection) specified by this local resource id. | public ResourceProperties | removeProperty(String id, String name) Remove a property from a collection or resource.
Parameters: id - The id of the resource. Parameters: name - The property name to be removed from the resource. exception: PermissionException - if the user does not have premissions to write properties on this object or read through containing collections. exception: IdUnusedException - if the resource id is not found. exception: TypeException - if the property named cannot be removed. exception: InUseException - if the resource is locked by someone else. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. | public void | removeResource(String id) Remove a resource. | public void | removeResource(ContentResourceEdit edit) Remove a resource that is locked for update. | public String | rename(String id, String new_id) Rename a resource or collection.
Parameters: id - The id of the resource or collection. Parameters: new_id - The desired id of the resource or collection. | public String | resolveUuid(String uuid) | public void | setPubView(String id, boolean pubview) Set this resource or collection to the pubview setting. | public void | setUuid(String id, String uuid) | public ContentResource | updateResource(String id, String type, byte[] content) Update the body and or content type of an existing resource with the given resource id.
Parameters: id - The id of the resource. Parameters: type - The mime type string of the resource (if null, no change). Parameters: content - An array containing the bytes of the resource's content (if null, no change). exception: PermissionException - if the user does not have permission to add a resource to the containing collection or write the resource. exception: IdUnusedException - if the resource id is not defined. exception: TypeException - if the resource is a collection. exception: InUseException - if the resource is locked by someone else. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. | public boolean | usingResourceTypeRegistry() |
APPLICATION_ID | final static String APPLICATION_ID(Code) | | The type string for this application: should not change over time as it may be stored in various parts of persistent entities.
|
ATTACHMENTS_COLLECTION | final public static String ATTACHMENTS_COLLECTION(Code) | | The collection id for the attachments collection
|
AUTH_DROPBOX_MAINTAIN | final public static String AUTH_DROPBOX_MAINTAIN(Code) | | Security function for those who may maintain dropboxes.
|
AUTH_DROPBOX_OWN | final public static String AUTH_DROPBOX_OWN(Code) | | Security function for those who may OWN a dropbox.
|
AUTH_GROUP_RESOURCE_READ | final public static String AUTH_GROUP_RESOURCE_READ(Code) | | Security function for accessing a resource belonging to a group.
|
AUTH_RESOURCE_ADD | final public static String AUTH_RESOURCE_ADD(Code) | | Security function for creating a resource.
|
AUTH_RESOURCE_ALL_GROUPS | final public static String AUTH_RESOURCE_ALL_GROUPS(Code) | | Security function granted to users who will then have membership in all site groups based on their site membership.
|
AUTH_RESOURCE_HIDDEN | final public static String AUTH_RESOURCE_HIDDEN(Code) | | Security function for accessing hidden entities
|
AUTH_RESOURCE_READ | final public static String AUTH_RESOURCE_READ(Code) | | Security function for reading a resource.
|
AUTH_RESOURCE_REMOVE_ANY | final public static String AUTH_RESOURCE_REMOVE_ANY(Code) | | Security function for removing any resource.
|
AUTH_RESOURCE_REMOVE_OWN | final public static String AUTH_RESOURCE_REMOVE_OWN(Code) | | Security function for removing own resource.
|
AUTH_RESOURCE_WRITE_ANY | final public static String AUTH_RESOURCE_WRITE_ANY(Code) | | Security function for writing any resource.
|
AUTH_RESOURCE_WRITE_OWN | final public static String AUTH_RESOURCE_WRITE_OWN(Code) | | Security function for writing own resource.
|
COLLECTION_DROPBOX | final public static String COLLECTION_DROPBOX(Code) | | The content root collection for dropboxes.
|
COLLECTION_MELETE_DOCS | final public static String COLLECTION_MELETE_DOCS(Code) | | The content root collection for meleteDocs
|
COLLECTION_PUBLIC | final public static String COLLECTION_PUBLIC(Code) | | The content root collection for items that are public.
|
COLLECTION_SITE | final public static String COLLECTION_SITE(Code) | | Collection id for the non-user sites.
|
COLLECTION_USER | final public static String COLLECTION_USER(Code) | | Collection id for the user sites.
|
CONTENT_RESOURCE_PRIORITY_OFFSET | final public static int CONTENT_RESOURCE_PRIORITY_OFFSET(Code) | | When assigning default priority (for "priority" sort) folders come before files,
so files get "priority" much higher than folders. Add the offset to folder priorities
to force all files to sort after folders
|
EVENT_RESOURCE_ADD | final public static String EVENT_RESOURCE_ADD(Code) | | Name of the event when creating a resource.
|
EVENT_RESOURCE_READ | final public static String EVENT_RESOURCE_READ(Code) | | Name of the event when reading a resource.
|
EVENT_RESOURCE_REMOVE | final public static String EVENT_RESOURCE_REMOVE(Code) | | Name of the event when removing a resource.
|
EVENT_RESOURCE_WRITE | final public static String EVENT_RESOURCE_WRITE(Code) | | Name of the event when writing a resource.
|
MAXIMUM_ATTEMPTS_FOR_UNIQUENESS | final public static int MAXIMUM_ATTEMPTS_FOR_UNIQUENESS(Code) | | Number of times to attempt to find a unique resource id when copying or moving a resource
|
MAXIMUM_RESOURCE_ID_LENGTH | final public static int MAXIMUM_RESOURCE_ID_LENGTH(Code) | | The maximum number of characters allowed in a new resource ID: make is so the reference, /content/, is 255 or less
|
PROP_ALTERNATE_REFERENCE | final public static String PROP_ALTERNATE_REFERENCE(Code) | | Property name on a Resource that will cause getUrl() and getRefernce() to return an alternal root reference.
|
REFERENCE_ROOT | final public static String REFERENCE_ROOT(Code) | | This string starts the references to resources in this service.
|
ROOT_COLLECTIONS | final public static Set<String> ROOT_COLLECTIONS(Code) | | A "list" of all root-level collections
|
addAttachmentResource | public ContentResource addAttachmentResource(String name, String type, byte[] content, ResourceProperties properties) throws IdInvalidException, InconsistentException, IdUsedException, PermissionException, OverQuotaException, ServerOverloadException(Code) | | Create a new resource as an attachment to some other resource in the system. The new resource will be placed
into a newly created collecion in the attachment collection, with an auto-generated id, and given the specified
resource name within this collection.
Parameters: name - The name of the new resource, i.e. a partial id relative to the collection where it will live. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. exception: IdUsedException - if the resource name is already in use (not likely, as the containing collection is auto-generated!) exception: IdInvalidException - if the resource name is invalid. exception: InconsistentException - if the containing collection (or it's containing collection...) does not exist. exception: PermissionException - if the user does not have permission to add a collection, or add a member to a collection. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. a new ContentResource object. |
addAttachmentResource | public ContentResource addAttachmentResource(String name, String site, String tool, String type, byte[] content, ResourceProperties properties) throws IdInvalidException, InconsistentException, IdUsedException, PermissionException, OverQuotaException, ServerOverloadException(Code) | | Create a new resource as an attachment to some other resource in the system. The new resource will be placed
into a newly created collection in the site collection within the attachment collection. The new collection
will have an auto-generated id, and it will be given the specified resource name within the site collection.
Parameters: name - The name of the new resource, i.e. a partial id relative to the collection where it will live. Parameters: site - The string identifier for the site where the attachment is being added within the attachments collection. Parameters: tool - The display-name for the tool through which the attachment is being added within the site's attachments collection. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. exception: IdUsedException - if the resource name is already in use (not likely, as the containing collection is auto-generated!) exception: IdInvalidException - if the resource name is invalid. exception: InconsistentException - if the containing collection (or it's containing collection...) does not exist. exception: PermissionException - if the user does not have permission to add a collection, or add a member to a collection. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. a new ContentResource object. |
addAttachmentResource | public ContentResourceEdit addAttachmentResource(String name) throws IdInvalidException, InconsistentException, IdUsedException, PermissionException, ServerOverloadException(Code) | | Create a new resource as an attachment to some other resource in the system, locked for update. Must commitResource()
to make official, or cancelResource() when done! The new resource will be placed into a newly created collecion in the
attachment collection, with an auto-generated id, and given the specified resource name within this collection.
Parameters: name - The name of the new resource, i.e. a partial id relative to the collection where it will live. exception: IdUsedException - if the resource name is already in use (not likely, as the containing collection is auto-generated!) exception: IdInvalidException - if the resource name is invalid. exception: InconsistentException - if the containing collection (or it's containing collection...) does not exist. exception: PermissionException - if the user does not have permission to add a collection, or add a member to a collection. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. a new ContentResource object. |
addCollection | public ContentCollection addCollection(String id, ResourceProperties properties, Collection groups, boolean hidden, Time releaseDate, Time retractDate) throws IdUsedException, IdInvalidException, PermissionException, InconsistentException(Code) | | Create a new collection with the given resource id.
Parameters: id - The id of the collection. Parameters: properties - A ResourceProperties object with the properties to add to the new collection. Parameters: groups - The (possibly empty) collection (String) of reference-strings for groups to be associated with this entity. Parameters: hidden - A flag indicating that the entity should be hidden from users unless they created the entity or have permission to modify it. Parameters: releaseDate - The time at which the entity becomes available to most users. The entity should be available immediately if this value is null. Parameters: retractDate - The date after which the entity is no longer available to most users. The entity should be available indefinitely if this value is null. exception: IdUsedException - if the id is already in use. exception: IdInvalidException - if the id is invalid. exception: PermissionException - if the user does not have permission to add a collection, or add a member to a collection. exception: InconsistentException - if the containing collection does not exist. a new ContentCollection object. throws: InconsistentException - throws: PermissionException - throws: IdInvalidException - throws: IdUsedException - ContentHostingService.addCollection(String)ContentHostingService.getPropertiesEdit()ContentHostingService.setGroupAccess(Collection)ContentHostingService.setAvailability(boolean,Time,Time)ContentHostingService.commitCollection(ContentCollectionEdit) |
addResource | public ContentResource addResource(String name, String collectionId, int limit, String type, byte[] content, ResourceProperties properties, int priority) throws PermissionException, IdUniquenessException, IdLengthException, IdInvalidException, InconsistentException, IdLengthException, OverQuotaException, ServerOverloadException(Code) | | Create a new resource with the given resource name used as a resource id within the
specified collection or (if that id is already in use) with a resource id based on
a variation on the name to achieve a unique id, provided a unique id can be found
before a limit is reached on the number of attempts to achieve uniqueness.
Parameters: name - The name of the new resource (such as a filename). Parameters: collectionId - The id of the collection to which the resource should be added. Parameters: limit - The maximum number of attempts at finding a unique id based on the given id. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. Parameters: priority - The notification priority for this commit. exception: PermissionException - if the user does not have permission to add a resource to the containing collection. exception: IdUniquenessException - if a unique resource id cannot be found before the limit on the number of attempts is reached. exception: IdLengthException - if the resource id exceeds the maximum number of characters for a valid resource id. exception: IdInvalidException - if the resource id is invalid. exception: InconsistentException - if the containing collection does not exist. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. a new ContentResource object. |
addResource | public ContentResource addResource(String id, String type, byte[] content, ResourceProperties properties, Collection groups, int priority) throws PermissionException, IdUsedException, IdInvalidException, InconsistentException, OverQuotaException, ServerOverloadException(Code) | | Create a new resource with the given id and attributes, including group awareness.
Parameters: id - The id of the new resource. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. Parameters: groups - A collection (String) of references to Group objects representing the site subgroups that should have access to this entity.May be empty to indicate access is not limited to a group or groups. Parameters: priority - The notification priority for this commit. exception: PermissionException - if the user does not have permission to add a resource to the containing collection. exception: IdUsedException - if the resource id is already in use. exception: IdInvalidException - if the resource id is invalid. exception: InconsistentException - if the containing collection does not exist. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. a new ContentResource object. |
addResource | public ContentResource addResource(String name, String collectionId, int limit, String type, byte[] content, ResourceProperties properties, Collection groups, int priority) throws PermissionException, IdUniquenessException, IdLengthException, IdInvalidException, InconsistentException, IdLengthException, OverQuotaException, ServerOverloadException(Code) | | Create a new resource with the given resource name used as a resource id within the
specified collection or (if that id is already in use) with a resource id based on
a variation on the name to achieve a unique id, provided a unique id can be found
before a limit is reached on the number of attempts to achieve uniqueness.
Parameters: name - The name of the new resource (such as a filename). Parameters: collectionId - The id of the collection to which the resource should be added. Parameters: limit - The maximum number of attempts at finding a unique id based on the given id. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. Parameters: groups - A collection (String) of references to Group objects representing the site subgroups that should have access to this entity.May be empty to indicate access is not limited to a group or groups. Parameters: priority - The notification priority for this commit. exception: PermissionException - if the user does not have permission to add a resource to the containing collection. exception: IdUniquenessException - if a unique resource id cannot be found before the limit on the number of attempts is reached. exception: IdLengthException - if the resource id exceeds the maximum number of characters for a valid resource id. exception: IdInvalidException - if the resource id is invalid. exception: InconsistentException - if the containing collection does not exist. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. a new ContentResource object. |
addResource | public ContentResource addResource(String name, String collectionId, int limit, String type, byte[] content, ResourceProperties properties, Collection groups, boolean hidden, Time releaseDate, Time retractDate, int priority) throws PermissionException, IdUniquenessException, IdLengthException, IdInvalidException, InconsistentException, IdLengthException, OverQuotaException, ServerOverloadException(Code) | | Create a new resource with the given resource name used as a resource id within the
specified collection or (if that id is already in use) with a resource id based on
a variation on the name to achieve a unique id, provided a unique id can be found
before a limit is reached on the number of attempts to achieve uniqueness.
Parameters: name - The name of the new resource (such as a filename). Parameters: collectionId - The id of the collection to which the resource should be added. Parameters: limit - The maximum number of attempts at finding a unique id based on the given id. Parameters: type - The mime type string of the resource. Parameters: content - An array containing the bytes of the resource's content. Parameters: properties - A ResourceProperties object with the properties to add to the new resource. Parameters: groups - A collection (String) of references to Group objects representing the site subgroups that should have access to this entity.May be empty to indicate access is not limited to a group or groups. Parameters: hidden - A flag indicating that the entity should be hidden from users unless they created the entity or have permission to modify it. Parameters: releaseDate - The time at which the entity becomes available to most users. The entity should be available immediately if this value is null. Parameters: retractDate - The date after which the entity is no longer available to most users. The entity should be available indefinitely if this value is null. Parameters: priority - The notification priority for this commit. exception: PermissionException - if the user does not have permission to add a resource to the containing collection. exception: IdUniquenessException - if a unique resource id cannot be found before the limit on the number of attempts is reached. exception: IdLengthException - if the resource id exceeds the maximum number of characters for a valid resource id. exception: IdInvalidException - if the resource id is invalid. exception: InconsistentException - if the containing collection does not exist. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. a new ContentResource object. |
addResource | public ContentResourceEdit addResource(String collectionId, String basename, String extension, int maximum_tries) throws PermissionException, IdUniquenessException, IdLengthException, IdInvalidException, IdUnusedException, OverQuotaException, ServerOverloadException(Code) | | Attempt to create a new resource in a particular collection. Ideally, this method will create
a new resource in the collection identified by the first parameter, collectionId, with a name
formed by concatenating the basename and the extension. If the extension is not null or empty
and does not start with a period ('.'), a period will be prepended to the extension. If the name
formed by concatenating the basename and the extension, some number of attempts may be made to
find a unique name for the resource in the collection by adding a dash ('-') and a number to the
basename. The fourth parameter, "maximum_tries", will determine the number of attempts to find
a unique name for the resource in the collection. The numbers appended to the basename will start
with '1' and increase by 1 until a unique name is found or the maximum value is reached.
Parameters: collectionId - Parameters: basename - Parameters: extension - Parameters: maximum_tries - exception: PermissionException - if the user does not have permission to add a resource to the containing collection. exception: IdUnusedException - if the collectionId does not identify an existing collection. exception: IdUniquenessException - if a unique resource id cannot be found before the limit on the number of attempts is reached. exception: IdLengthException - if the resource id exceeds the maximum number of characters for a valid resource id. exception: IdInvalidException - if the resource id is invalid. exception: InconsistentException - if the containing collection does not exist. exception: OverQuotaException - if this would result in being over quota. exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. |
allowAddAttachmentResource | public boolean allowAddAttachmentResource()(Code) | | check permissions for addAttachmentResource().
true if the user is allowed to addAttachmentResource(), false if not. |
allowAddCollection | public boolean allowAddCollection(String id)(Code) | | check permissions for addCollection().
Parameters: channelId - The channel id. true if the user is allowed to addCollection(id), false if not. |
allowAddProperty | public boolean allowAddProperty(String id)(Code) | | check permissions for addProperty().
Parameters: id - The id of the new resource. true if the user is allowed to addProperty(id), false if not. |
allowAddResource | public boolean allowAddResource(String id)(Code) | | check permissions for addResource().
Parameters: id - The id of the new resource. true if the user is allowed to addResource(id), false if not. |
allowCopy | public boolean allowCopy(String id, String new_id)(Code) | | check permissions for copy().
Parameters: id - The id of the new resource. Parameters: new_id - The desired id of the new resource. true if the user is allowed to copy(id,new_id), false if not. |
allowGetCollection | public boolean allowGetCollection(String id)(Code) | | Check permissions for getCollection().
Parameters: id - The id of the collection. true if the user is allowed to getCollection(id), false if not. |
allowGetProperties | public boolean allowGetProperties(String id)(Code) | | check permissions for getProperties().
Parameters: id - The id of the new resource. true if the user is allowed to getProperties(id), false if not. |
allowGetResource | public boolean allowGetResource(String id)(Code) | | check permissions for getResource().
Parameters: id - The id of the new resource. true if the user is allowed to getResource(id), false if not. |
allowRemoveCollection | public boolean allowRemoveCollection(String id)(Code) | | check permissions for removeCollection().
Parameters: id - The id of the collection. true if the user is allowed to removeCollection(id), false if not. |
allowRemoveProperty | public boolean allowRemoveProperty(String id)(Code) | | check permissions for removeProperty().
Parameters: id - The id of the new resource. true if the user is allowed to removeProperty(id), false if not. |
allowRemoveResource | public boolean allowRemoveResource(String id)(Code) | | check permissions for removeResource().
Parameters: id - The id of the new resource. true if the user is allowed to removeResource(id), false if not. |
allowRename | public boolean allowRename(String id, String new_id)(Code) | | check permissions for rename().
Parameters: id - The id of the existing resource. true if the user is allowed to rename(id), false if not. |
allowUpdateCollection | public boolean allowUpdateCollection(String id)(Code) | | check permissions for editCollection()
Parameters: id - The id of the collection. true if the user is allowed to update the collection, false if not. |
allowUpdateResource | public boolean allowUpdateResource(String id)(Code) | | check permissions for updateResource().
Parameters: id - The id of the new resource. true if the user is allowed to updateResource(id), false if not. |
archiveResources | String archiveResources(List resources, Document doc, Stack stack, String archivePath)(Code) | | Archive the specified list of resources.
Parameters: resources - A list of the resources to archive. Parameters: doc - The document to contain the xml. Parameters: stack - The stack of elements, the top of which will be the containing element of the "service.name" element. Parameters: archivePath - The path to the folder where we are writing auxilary files. A log of status messages from the archive. |
cancelCollection | public void cancelCollection(ContentCollectionEdit edit)(Code) | | Cancel the changes made object, and release the lock. The Object is disabled, and not to be used after this call.
Parameters: edit - The ContentCollectionEdit object to commit. |
cancelResource | public void cancelResource(ContentResourceEdit edit)(Code) | | Cancel the changes made object, and release the lock. The Object is disabled, and not to be used after this call.
Parameters: edit - The ContentResourceEdit object to commit. |
commitCollection | public void commitCollection(ContentCollectionEdit edit)(Code) | | Commit the changes made, and release the lock. The Object is disabled, and not to be used after this call.
Parameters: edit - The ContentCollectionEdit object to commit. throws: PermissionException - |
commitResource | public void commitResource(ContentResourceEdit edit, int priority) throws OverQuotaException, ServerOverloadException(Code) | | Commit the changes made, and release the lock. The Object is disabled, and not to be used after this call.
Parameters: edit - The ContentResourceEdit object to commit. Parameters: priority - The notification priority of this commit. exception: OverQuotaException - if this would result in being over quota (the edit is then cancled). exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. |
containsLockedNode | public boolean containsLockedNode(String id)(Code) | | Returns true if this Collection or any of its contents has a lock. It is likely much more efficient than recursively iterating through all of the contained resources.
Parameters: id - |
copyIntoFolder | public String copyIntoFolder(String id, String folder_id) throws PermissionException, IdUnusedException, TypeException, InUseException, OverQuotaException, IdUsedException, ServerOverloadException, InconsistentException, IdLengthException, IdUniquenessException(Code) | | Copy a collection or resource from one location to another. Creates a new collection with an id similar to new_folder_id and recursively copies all nested collections and resources within thisCollection to the new collection.
Parameters: id - The id of the resource. Parameters: folder_id - The id of the folder in which the copy should be created. The full id of the new copy of the resource. exception: PermissionException - if the user does not have permissions to read a containing collection, or to remove this resource. exception: IdUnusedException - if the resource id is not found. exception: TypeException - if the resource is a collection. exception: InUseException - if the resource is locked by someone else. exception: IdLengthException - if the new id of the copied item (or any nested item) is longer than the maximum length of an id. exception: IdUniquenessException - if a unique id cannot be found in the new folder. exception: InconsistentException - if the destination folder (folder_id) is contained within the source folder (id). exception: IdUsedException - if a unique resource id cannot be found after some arbitrary number of attempts (@see MAXIMUM_ATTEMPTS_FOR_UNIQUENESS). exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. |
createDropboxCollection | public void createDropboxCollection()(Code) | | Create the current site's dropbox collection and one for each qualified user that the current user can make.
|
createDropboxCollection | public void createDropboxCollection(String siteId)(Code) | | Create the site's dropbox collection and one for each qualified user that the current user can make.
Parameters: siteId - the Site id. |
createIndividualDropbox | public void createIndividualDropbox(String siteId)(Code) | | Create an individual dropbox collection for the current user if the site-level dropbox exists
and the current user has EVENT_DROPBOX_OWN permission for the site.
Parameters: siteId - the Site id. |
editCollection | public ContentCollectionEdit editCollection(String id) throws IdUnusedException, TypeException, PermissionException, InUseException(Code) | | Access the collection with this local resource id, locked for update. Must commitCollection() to make official, or cancelCollection() when done! The collection internal members and properties are accessible from the returned Collection object.
Parameters: id - The id of the collection. exception: IdUnusedException - if the id does not exist. exception: TypeException - if the resource exists but is not a collection. exception: PermissionException - if the user does not have permissions to see this collection (or read through containing collections). exception: InUseException - if the Collection is locked by someone else. The ContentCollection object found. |
editResource | public ContentResourceEdit editResource(String id) throws PermissionException, IdUnusedException, TypeException, InUseException(Code) | | Access the resource with this resource id, locked for update. For non-collection resources only. Must commitEdit() to make official, or cancelEdit() when done! The resource content and properties are accessible from the returned Resource object.
Parameters: id - The id of the resource. exception: PermissionException - if the user does not have permissions to read the resource or read through any containing collection. exception: IdUnusedException - if the resource id is not found. exception: TypeException - if the resource is a collection. exception: InUseException - if the resource is locked by someone else. the ContentResource object found. |
eliminateDuplicates | public void eliminateDuplicates(Collection resourceIds)(Code) | | Eliminate from the collection any duplicates as well as any items that are contained within another item whose resource-id is in the collection.
Parameters: resourceIds - A collection of strings (possibly empty) identifying items and/or collections. |
findResources | public List findResources(String type, String primaryMimeType, String subMimeType)(Code) | | Find the resources this user has read access to from all worksites of the appropriate type.
Parameters: type - this is the ResourceProperties.PROP_STRUCTOBJ_TYPE for stuctured objects or ResourceProperties.FILE_TYPE for file resources or null for all resources. Parameters: primaryMimeType - The primary mime type (ie. the "text" of "text/xml") This may be null to include all resources Parameters: subMimeType - The sub type (ie, the "xml" of "text/xml") This may be null to include all resources of the primary mime type if specified. List of ContentResource objects that match the search criteria |
getAllEntities | public List getAllEntities(String id)(Code) | | Access a List of ContentEntities (resources and collections) objects in this path (and below) to which the current user has access.
Parameters: id - A collection id. a List of the ContentEntity objects. |
getAllResources | public List getAllResources(String id)(Code) | | Access a List of all the ContentResource objects in this path (and below) which the current user has access.
Parameters: id - A collection id. a List of the ContentResource objects. |
getCollectionMap | public Map getCollectionMap()(Code) | | Return a map of Worksite collections roots that the user has access to.
Map of worksite resource root id (String) to worksite title (String) |
getCollectionSize | public int getCollectionSize(String id) throws IdUnusedException, TypeException, PermissionException(Code) | | Count the number of (recursive) children for a given id. examples: With a nested collection structure exactly like this: /a /a/b /a/b/1 /a/b/2 getCollectionSize(/a) returns 3 (due to these three children: /a/b /a/b/1 /a/b/2) getCollectionSize(/a/b)
returns 2 (due to these two children: /a/b/1 /a/b/2) getCollectionSize(/a/b/1) returns 0 (nothing falls below this collection)
Parameters: id - The id of the collection. exception: IdUnusedException - if the id does not exist. exception: TypeException - if the resource exists but is not a collection. exception: PermissionException - if the user does not have permissions to see this collection (or read through containing collections). The number of internal members |
getContainingCollectionId | public String getContainingCollectionId(String id)(Code) | | Access the resource id of the collection which contains this collection or resource.
Parameters: id - The resource id (reference, or URL) of the ContentCollection or ContentResource the resource id (reference, or URL, depending on the id parameter) of the collection which contains this resource. |
getDepth | public int getDepth(String resourceId, String baseCollectionId)(Code) | | Get the depth of the resource/collection object in the hireachy based on the given collection id
Parameters: resourceId - The Id of the resource/collection object to be tested Parameters: baseCollectionId - The Id of the collection as the relative root level the integer value reflecting the relative hierarchy depth of the test resource/collection object based on the given base collection level |
getDropboxCollection | public String getDropboxCollection()(Code) | | Access the default dropbox collection id for the current request.
If the current user is a dropbox maintainer for the current site, return the site's dropbox area.
Otherwis return the current user's collection within the site's dropbox.
The default dropbox collection id for the current request. |
getDropboxCollection | public String getDropboxCollection(String siteId)(Code) | | Access the default dropbox collection id for the current request.
If the current user is a dropbox maintainer for the current site, return the site's dropbox area.
Otherwis return the current user's collection within the site's dropbox.
Parameters: siteId - The site id. The default dropbox collection id for the site. |
getDropboxDisplayName | public String getDropboxDisplayName()(Code) | | Access the default dropbox collection display name for the current request. If the current user has permission to modify the site's dropbox collection, this is returned. Otherwise, the current user's collection within the site's dropbox is
returned.
The default dropbox collection display name for the current request. |
getDropboxDisplayName | public String getDropboxDisplayName(String siteId)(Code) | | Access the default dropbox collection display name for the site. If the current user has permission to modify the site's dropbox collection, this is returned. Otherwise, the current user's collection within the site's dropbox is returned.
Parameters: siteId - the Site id. The default dropbox collection display name for the site. |
getGroupsWithAddPermission | public Collection getGroupsWithAddPermission(String collectionId)(Code) | | Access a collection (Group) of groups to which this user has access and whose members have "content.new" permission in the collection.
In effect, this method returns a collection that identifies groups that are defined for the collection (locally or inherited) in which
this user has permission to add content entities. If access to the collection is determined by group-membership, the return is limited
to groups that have "add" permission in the specified collection. If access is not defined by groups (i.e. it is "site" access), the return
includes all groups defined in the site for which this user has add permission in this collection.
Parameters: collectionId - The id for the collection. |
getGroupsWithReadAccess | public Collection getGroupsWithReadAccess(String collectionId)(Code) | | Access a collection (Group) of groups to which this user has access and whose members have "content.read" permission in the collection.
In effect, this method returns a collection that identifies groups that are defined for the collection (locally or inherited) that
this user can access. If access to the collection is determined by group-membership, the return is limited to groups that have
access to the specified collection. If access is not defined by groups (i.e. it is "site" access), the return includes all groups
defined in the site for which this user has read permission.
Parameters: collectionId - The id for the collection. |
getGroupsWithRemovePermission | public Collection getGroupsWithRemovePermission(String collectionId)(Code) | | Access a collection (Group) of groups to which this user has access and whose members have "content.delete" permission in the collection.
In effect, this method returns a collection that identifies groups that are defined for the collection (locally or inherited) in which
this user has permission to remove content entities. If access to the collection is determined by group-membership, the return is limited
to groups that have "remove" permission in the specified collection. If access is not defined by groups (i.e. it is "site" access), the return
includes all groups defined in the site for which this user has remove permission in this collection.
Parameters: collectionId - The id for the collection. |
getLocks | Collection getLocks(String id)(Code) | | Gets all locks set on the resource with this local resource id.
Parameters: id - |
getQuota | public long getQuota(org.sakaiproject.content.api.ContentCollection collection)(Code) | | gets the quota for a site collection or for a user's my workspace collection
Parameters: collection - the collection on which to test for a quota. this can be the collection for a siteor a user's workspace collection the quota in kb |
getReference | public String getReference(String id)(Code) | | Access the internal reference from a resource id.
Parameters: id - The resource id. The internal reference from a resource id. |
getSiteCollection | String getSiteCollection(String siteId)(Code) | | Return the collection id of the root collection for this site id.
Parameters: siteId - The site id. The collection id which is the root collection for this site. |
getUrl | public String getUrl(String id)(Code) | | Access the resource URL from a resource id.
Parameters: id - The resource id. The resource URL. |
getUrl | public String getUrl(String id, String rootProperty)(Code) | | Access the alternate URL which can be used to access the entity.
Parameters: id - The resource id. Parameters: rootProperty - The name of the entity property whose value controls which alternate reference URL is requested. If null, the native 'raw' URL is requested. The resource URL. |
getUuid | public String getUuid(String id)(Code) | | For a given id, return its UUID (creating it if it does not already exist)
|
isAttachmentResource | public boolean isAttachmentResource(String id)(Code) | | Check whether a resource id or collection id references an entity in the attachments collection.
This method makes no guarantees that a resource actually exists with this id.
Parameters: id - Assumed to be a valid resource id or collection id. true if the id (assuming it is a valid id for an existing resource or collection) references an entity in the hidden attachments area created through one of this class's addAttachmentResource methods. |
isAvailabilityEnabled | public boolean isAvailabilityEnabled()(Code) | | Access flag indicating whether entities can be hidden (scheduled or otherwise).
true if the availability features are enabled, false otherwise. |
isAvailable | public boolean isAvailable(String entityId)(Code) | | Determine whether an entity is available to this user at this time, taking into account whether the item is hidden and the user's
status with respect to viewing hidden entities in this context.
Parameters: entityId - true if the item is not hidden or it's hidden but the user has permissions to view hidden items in this context (site? folder? group?), and false otherwise. |
isCollection | public boolean isCollection(String entityId)(Code) | | Determine whether the entityId parameter identifies a collection (as opposed to a resource).
This method does not necessarily verify that a ContentEntity with this id exists.
It merely determines whether the id could identify a collection.
Parameters: entityId - true if the entityId could identify a collection, false otherwise. |
isDropboxMaintainer | public boolean isDropboxMaintainer()(Code) | | Determine whether the default dropbox collection id for this user in this site is the site's entire dropbox collection or just the current user's collection within the site's dropbox.
True if user sees all dropboxes in the site, false otherwise. |
isDropboxMaintainer | public boolean isDropboxMaintainer(String siteId)(Code) | | Determine whether the default dropbox collection id for this user in some site is the site's entire dropbox collection or just the current user's collection within the site's dropbox.
True if user sees all dropboxes in the site, false otherwise. |
isInDropbox | public boolean isInDropbox(String entityId)(Code) | | Check whether an id would identify an entity in a dropbox. Does not determine existence of the entity,
just whether its id indicates it is a dropbox or contained within a dropbox.
true if the entity is a dropbox or in a dropbox, false otherwise. |
isInheritingPubView | public boolean isInheritingPubView(String id)(Code) | | Does this resource inherit public view by having it set in a containing folder (not counting it's own setting)?
Parameters: id - The resource id to check. true if this resource inherits public view, false if not. |
isLocked | public boolean isLocked(String id)(Code) | | Convenience method to determine whether any locks exist for the Resource or Collection with the given local resource id
Parameters: id - true when there are one or more locks on the given id |
isPubView | public boolean isPubView(String id)(Code) | | Does this resource support public view?
Parameters: id - The resource id to check. true if this resource supports public view, false if not. |
isRootCollection | public boolean isRootCollection(String id)(Code) | | Test if this id (reference, or URL) refers to the root collection.
Parameters: id - The resource id (reference, or URL) of a ContentCollection true if this is the root collection |
isShortRefs | public boolean isShortRefs()(Code) | | Access the shortRefs configuration. Short refs allow resource URLs without full prefix (may have "~" instead of /user/, or be missing /group/).
true if shortRefs is enabled, false if not. |
isSortByPriorityEnabled | public boolean isSortByPriorityEnabled()(Code) | | Access flag indicating whether sorting by "priority" is enabled.
true if the custom sort by priority is enabled, false otherwise. |
lockObject | public void lockObject(String id, String lockId, String subject, boolean system)(Code) | | Locks an object (resource or collection) with specified local resource id. Initially, the WebDAV concepts of expiration, exclusive vs shared, and inheritable are not supported; instead, all locks are exclusive. Programmatically created locks may be
designated as "system" locks, in which case, users may not remove them via WebDAV lock management tools. Since only exclusive locks are permitted, a user can only lock a resource if it is not already locked; however, multiple system locks can be
put in place, because system locks imply that no user is permitted to change the resource.
Parameters: id - Parameters: lockId - Parameters: subject - -the reason for this lock e.g. "being graded" Parameters: system - -when true, it is not possible for a user to remove this lock |
moveIntoFolder | public String moveIntoFolder(String id, String folder_id) throws PermissionException, IdUnusedException, TypeException, InUseException, OverQuotaException, IdUsedException, InconsistentException, ServerOverloadException(Code) | | Move a resource or collection to a (different) folder. This may be accomplished by renaming the resource or by recursively renaming the collection and all enclosed members (no matter how deep) to effectively change their locations. Alternatively,
it may be accomplished by copying the resource and recursively copying collections from their existing collection to the new collection and ultimately deleting the original resource(s) and/or collections(s).
Parameters: id - The id of the resource or collection to be moved. Parameters: folder_id - The id of the folder to which the resource should be moved. The full id of the resource after the move is completed. exception: PermissionException - if the user does not have permissions to read a containing collection, or to remove this resource. exception: IdUnusedException - if the resource id is not found. exception: TypeException - if the resource is a collection. exception: InUseException - if the resource is locked by someone else. exception: InconsistentException - if the containing collection does not exist. exception: InconsistentException - if the destination folder (folder_id) is contained within the source folder (id). exception: IdUsedException - if a unique resource id cannot be found after some arbitrary number of attempts (@see MAXIMUM_ATTEMPTS_FOR_UNIQUENESS). exception: ServerOverloadException - if the server is configured to write the resource body to the filesystem and the save fails. |
newContentHostingComparator | public Comparator newContentHostingComparator(String property, boolean ascending)(Code) | | Construct a content hosting comparator.
Parameters: property - The property name used for the sort. Parameters: asc - true if the sort is to be ascending (false for descending). |
newResourceProperties | public ResourcePropertiesEdit newResourceProperties()(Code) | | Construct a stand-alone, not associated with any particular resource, ResourceProperties object.
The new ResourceProperties object. |
removeAllLocks | public void removeAllLocks(String id)(Code) | | Convenience method that permanently removes any lock associated with qualifier
Parameters: id - |
removeLock | public void removeLock(String id, String lockId)(Code) | | Removes lock with given Id from object (resource or collection) specified by this local resource id. Note that other locks could exist, so it does not necessarily fully unlock the object.
Parameters: id - Parameters: lockId - |
removeResource | public void removeResource(ContentResourceEdit edit) throws PermissionException(Code) | | Remove a resource that is locked for update.
Parameters: edit - The ContentResourceEdit object to remove. exception: PermissionException - if the user does not have permissions to read a containing collection, or to remove this resource. |
resolveUuid | public String resolveUuid(String uuid)(Code) | | For a given UUID, attempt to lookup and return the corresponding id (URI)
|
setPubView | public void setPubView(String id, boolean pubview)(Code) | | Set this resource or collection to the pubview setting.
Parameters: id - The resource or collection id. Parameters: pubview - The desired public view setting. |
usingResourceTypeRegistry | public boolean usingResourceTypeRegistry()(Code) | | Access flag indicating whether the ResourceTypeRegistry is being used
|
|
|