Java Doc for ContentHostingService.java in  » ERP-CRM-Financial » sakai » org » sakaiproject » content » api » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » sakai » org.sakaiproject.content.api 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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



Field Summary
final static  StringAPPLICATION_ID
     The type string for this application: should not change over time as it may be stored in various parts of persistent entities.
final public static  StringATTACHMENTS_COLLECTION
    
final public static  StringAUTH_DROPBOX_MAINTAIN
     Security function for those who may maintain dropboxes.
final public static  StringAUTH_DROPBOX_OWN
     Security function for those who may OWN a dropbox.
final public static  StringAUTH_GROUP_RESOURCE_READ
     Security function for accessing a resource belonging to a group.
final public static  StringAUTH_RESOURCE_ADD
     Security function for creating a resource.
final public static  StringAUTH_RESOURCE_ALL_GROUPS
     Security function granted to users who will then have membership in all site groups based on their site membership.
final public static  StringAUTH_RESOURCE_HIDDEN
    
final public static  StringAUTH_RESOURCE_READ
     Security function for reading a resource.
final public static  StringAUTH_RESOURCE_REMOVE_ANY
     Security function for removing any resource.
final public static  StringAUTH_RESOURCE_REMOVE_OWN
     Security function for removing own resource.
final public static  StringAUTH_RESOURCE_WRITE_ANY
     Security function for writing any resource.
final public static  StringAUTH_RESOURCE_WRITE_OWN
     Security function for writing own resource.
final public static  StringCOLLECTION_DROPBOX
     The content root collection for dropboxes.
final public static  StringCOLLECTION_MELETE_DOCS
    
final public static  StringCOLLECTION_PUBLIC
     The content root collection for items that are public.
final public static  StringCOLLECTION_SITE
     Collection id for the non-user sites.
final public static  StringCOLLECTION_USER
     Collection id for the user sites.
final public static  intCONTENT_RESOURCE_PRIORITY_OFFSET
     When assigning default priority (for "priority" sort) folders come before files, so files get "priority" much higher than folders.
final public static  StringEVENT_RESOURCE_ADD
     Name of the event when creating a resource.
final public static  StringEVENT_RESOURCE_READ
     Name of the event when reading a resource.
final public static  StringEVENT_RESOURCE_REMOVE
     Name of the event when removing a resource.
final public static  StringEVENT_RESOURCE_WRITE
     Name of the event when writing a resource.
final public static  intMAXIMUM_ATTEMPTS_FOR_UNIQUENESS
    
final public static  intMAXIMUM_RESOURCE_ID_LENGTH
    
final public static  StringPROP_ALTERNATE_REFERENCE
     Property name on a Resource that will cause getUrl() and getRefernce() to return an alternal root reference.
final public static  StringREFERENCE_ROOT
     This string starts the references to resources in this service.
final public static  Set<String>ROOT_COLLECTIONS
    


Method Summary
public  ContentResourceaddAttachmentResource(String name, String type, byte[] content, ResourceProperties properties)
     Create a new resource as an attachment to some other resource in the system.
public  ContentResourceaddAttachmentResource(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  ContentResourceEditaddAttachmentResource(String name)
     Create a new resource as an attachment to some other resource in the system, locked for update.
public  ContentCollectionaddCollection(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  ContentCollectionaddCollection(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  ContentCollectionaddCollection(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  ContentCollectionEditaddCollection(String id)
     Create a new collection with the given resource id, locked for update.
public  ContentCollectionEditaddCollection(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  ResourcePropertiesaddProperty(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  ContentResourceaddResource(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  ContentResourceaddResource(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  ContentResourceaddResource(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  ContentResourceaddResource(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  ContentResourceaddResource(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  ContentResourceEditaddResource(String id)
     Create a new resource with the given resource id, locked for update.
public  ContentResourceEditaddResource(String collectionId, String basename, String extension, int maximum_tries)
     Attempt to create a new resource in a particular collection.
public  booleanallowAddAttachmentResource()
     check permissions for addAttachmentResource().
public  booleanallowAddCollection(String id)
     check permissions for addCollection().
Parameters:
  channelId - The channel id.
public  booleanallowAddProperty(String id)
     check permissions for addProperty().
Parameters:
  id - The id of the new resource.
public  booleanallowAddResource(String id)
     check permissions for addResource().
Parameters:
  id - The id of the new resource.
public  booleanallowCopy(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  booleanallowGetCollection(String id)
     Check permissions for getCollection().
Parameters:
  id - The id of the collection.
public  booleanallowGetProperties(String id)
     check permissions for getProperties().
Parameters:
  id - The id of the new resource.
public  booleanallowGetResource(String id)
     check permissions for getResource().
Parameters:
  id - The id of the new resource.
public  booleanallowRemoveCollection(String id)
     check permissions for removeCollection().
Parameters:
  id - The id of the collection.
public  booleanallowRemoveProperty(String id)
     check permissions for removeProperty().
Parameters:
  id - The id of the new resource.
public  booleanallowRemoveResource(String id)
     check permissions for removeResource().
Parameters:
  id - The id of the new resource.
public  booleanallowRename(String id, String new_id)
     check permissions for rename().
Parameters:
  id - The id of the existing resource.
public  booleanallowUpdateCollection(String id)
     check permissions for editCollection()
Parameters:
  id - The id of the collection.
public  booleanallowUpdateResource(String id)
     check permissions for updateResource().
Parameters:
  id - The id of the new resource.
 StringarchiveResources(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  voidcancelCollection(ContentCollectionEdit edit)
     Cancel the changes made object, and release the lock.
public  voidcancelResource(ContentResourceEdit edit)
     Cancel the changes made object, and release the lock.
public  voidcheckCollection(String id)
     Check access to the collection with this local resource id.
public  voidcheckResource(String id)
     Check access to the resource with this local resource id.
public  voidcommitCollection(ContentCollectionEdit edit)
     Commit the changes made, and release the lock.
public  voidcommitResource(ContentResourceEdit edit)
     Commit the changes made, and release the lock.
public  voidcommitResource(ContentResourceEdit edit, int priority)
     Commit the changes made, and release the lock.
public  booleancontainsLockedNode(String id)
     Returns true if this Collection or any of its contents has a lock.
public  Stringcopy(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  StringcopyIntoFolder(String id, String folder_id)
     Copy a collection or resource from one location to another.
public  voidcreateDropboxCollection()
     Create the current site's dropbox collection and one for each qualified user that the current user can make.
public  voidcreateDropboxCollection(String siteId)
     Create the site's dropbox collection and one for each qualified user that the current user can make.
public  voidcreateIndividualDropbox(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  ContentCollectionEditeditCollection(String id)
     Access the collection with this local resource id, locked for update.
public  ContentResourceEditeditResource(String id)
     Access the resource with this resource id, locked for update.
public  voideliminateDuplicates(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  ListfindResources(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  ListgetAllEntities(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  ListgetAllResources(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  ContentCollectiongetCollection(String id)
     Access the collection with this local resource id.
public  MapgetCollectionMap()
     Return a map of Worksite collections roots that the user has access to.
public  intgetCollectionSize(String id)
     Count the number of (recursive) children for a given id.
public  StringgetContainingCollectionId(String id)
     Access the resource id of the collection which contains this collection or resource.
public  intgetDepth(String resourceId, String baseCollectionId)
    
public  StringgetDropboxCollection()
     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  StringgetDropboxCollection(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  StringgetDropboxDisplayName()
     Access the default dropbox collection display name for the current request.
public  StringgetDropboxDisplayName(String siteId)
     Access the default dropbox collection display name for the site.
public  CollectiongetGroupsWithAddPermission(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  CollectiongetGroupsWithReadAccess(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  CollectiongetGroupsWithRemovePermission(String collectionId)
     Access a collection (Group) of groups to which this user has access and whose members have "content.delete" permission in the collection.
 CollectiongetLocks(String id)
     Gets all locks set on the resource with this local resource id.
public  ResourcePropertiesgetProperties(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  longgetQuota(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  StringgetReference(String id)
     Access the internal reference from a resource id.
Parameters:
  id - The resource id.
public  ContentResourcegetResource(String id)
     Access the resource with this resource id.
 StringgetSiteCollection(String siteId)
     Return the collection id of the root collection for this site id.
Parameters:
  siteId - The site id.
public  StringgetUrl(String id)
     Access the resource URL from a resource id.
Parameters:
  id - The resource id.
public  StringgetUrl(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  StringgetUuid(String id)
    
public  booleanisAttachmentResource(String id)
     Check whether a resource id or collection id references an entity in the attachments collection.
public  booleanisAvailabilityEnabled()
     Access flag indicating whether entities can be hidden (scheduled or otherwise).
public  booleanisAvailable(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  booleanisCollection(String entityId)
     Determine whether the entityId parameter identifies a collection (as opposed to a resource).
public  booleanisDropboxMaintainer()
     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  booleanisDropboxMaintainer(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  booleanisInDropbox(String entityId)
     Check whether an id would identify an entity in a dropbox.
public  booleanisInheritingPubView(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  booleanisLocked(String id)
    
public  booleanisPubView(String id)
     Does this resource support public view?
Parameters:
  id - The resource id to check.
public  booleanisRootCollection(String id)
     Test if this id (reference, or URL) refers to the root collection.
public  booleanisShortRefs()
     Access the shortRefs configuration.
public  booleanisSortByPriorityEnabled()
     Access flag indicating whether sorting by "priority" is enabled.
public  voidlockObject(String id, String lockId, String subject, boolean system)
     Locks an object (resource or collection) with specified local resource id.
public  StringmoveIntoFolder(String id, String folder_id)
     Move a resource or collection to a (different) folder.
public  ComparatornewContentHostingComparator(String property, boolean ascending)
     Construct a content hosting comparator.
public  ResourcePropertiesEditnewResourceProperties()
     Construct a stand-alone, not associated with any particular resource, ResourceProperties object.
public  voidremoveAllLocks(String id)
    
public  voidremoveCollection(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  voidremoveCollection(ContentCollectionEdit edit)
     Remove just a collection.
public  voidremoveLock(String id, String lockId)
     Removes lock with given Id from object (resource or collection) specified by this local resource id.
public  ResourcePropertiesremoveProperty(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  voidremoveResource(String id)
     Remove a resource.
public  voidremoveResource(ContentResourceEdit edit)
     Remove a resource that is locked for update.
public  Stringrename(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  StringresolveUuid(String uuid)
    
public  voidsetPubView(String id, boolean pubview)
     Set this resource or collection to the pubview setting.
public  voidsetUuid(String id, String uuid)
    
public  ContentResourceupdateResource(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  booleanusingResourceTypeRegistry()
    

Field Detail
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





Method Detail
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) 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.
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.ContentHostingService.addCollection(String)ContentHostingService.getPropertiesEdit()ContentHostingService.commitCollection(ContentCollectionEdit)



addCollection
public ContentCollection addCollection(String id, ResourceProperties properties, Collection groups) 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.
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.commitCollection(ContentCollectionEdit)



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)



addCollection
public ContentCollectionEdit addCollection(String id) throws IdUsedException, IdInvalidException, PermissionException, InconsistentException(Code)
Create a new collection with the given resource id, locked for update. Must commitCollection() to make official, or cancelCollection() when done!
Parameters:
  id - The id of the 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. a new ContentCollection object.



addCollection
public ContentCollectionEdit addCollection(String collectionId, String name) throws PermissionException, IdUnusedException, IdUsedException, IdLengthException, IdInvalidException, TypeException(Code)

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.
exception:
  IdUnusedException - if the collectionId does not identify an existing collection.
exception:
  IdUnusedException - if the collection id for the proposed name already exists in this collection.
exception:
  IdLengthException - if the new collection id exceeds the maximum number of characters for a valid collection id.
exception:
  IdInvalidException - if the resource id is invalid.



addProperty
public ResourceProperties addProperty(String id, String name, String value) throws PermissionException, IdUnusedException, TypeException, InUseException, ServerOverloadException(Code)
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. the ResourceProperties object for this resource.



addResource
public ContentResource addResource(String id, String type, byte[] content, ResourceProperties properties, int priority) throws PermissionException, IdUsedException, IdInvalidException, InconsistentException, OverQuotaException, ServerOverloadException(Code)
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. a new ContentResource object.



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 id) throws PermissionException, IdUsedException, IdInvalidException, InconsistentException, ServerOverloadException(Code)
Create a new resource with the given resource id, locked for update. Must commitResource() to make official, or cancelResource() when done!
Parameters:
  id - The id of the new resource.
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:
  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.



checkCollection
public void checkCollection(String id) throws IdUnusedException, TypeException, PermissionException(Code)
Check access to the collection with this local resource id.
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).



checkResource
public void checkResource(String id) throws PermissionException, IdUnusedException, TypeException(Code)
Check access to the resource with this local resource id. For non-collection resources only.
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.



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) 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.
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.



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 -



copy
public String copy(String id, String new_id) throws PermissionException, IdUnusedException, TypeException, InUseException, OverQuotaException, IdUsedException, ServerOverloadException(Code)
Copy a resource.
Parameters:
  id - The id of the resource.
Parameters:
  new_id - The desired id of the new resource. 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:
  IdUsedException - if copied item is a collection and the new id is already in use or if the copied item is not a collection and a unique id cannot be found in 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.



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.



getCollection
public ContentCollection getCollection(String id) throws IdUnusedException, TypeException, PermissionException(Code)
Access the collection with this local resource id. 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). The ContentCollection object found.



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 -



getProperties
public ResourceProperties getProperties(String id) throws PermissionException, IdUnusedException(Code)
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. the ResourceProperties object for this resource.



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.



getResource
public ContentResource getResource(String id) throws PermissionException, IdUnusedException, TypeException(Code)
Access the resource with this resource id. For non-collection resources only. 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. the ContentResource object found.



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 -



removeCollection
public void removeCollection(String id) throws IdUnusedException, TypeException, PermissionException, InUseException, ServerOverloadException(Code)
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. collections, or remove any members of the collection.
exception:
  ServerOverloadException - if the server is configured to write the resource body to the filesystem and an attempt to access the resource body of any collection member fails.



removeCollection
public void removeCollection(ContentCollectionEdit edit) throws TypeException, PermissionException, InconsistentException, ServerOverloadException(Code)
Remove just a collection. It must be empty.
Parameters:
  collection - The collection to remove.
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:
  InconsistentException - if the collection has members, so that the removal would leave things in an inconsistent state.
exception:
  ServerOverloadException - if the server is configured to write the resource body to the filesystem and an attempt to access the resource body of any collection member fails.



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 -



removeProperty
public ResourceProperties removeProperty(String id, String name) throws PermissionException, IdUnusedException, TypeException, InUseException, ServerOverloadException(Code)
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. the ResourceProperties object for this resource.



removeResource
public void removeResource(String id) throws PermissionException, IdUnusedException, TypeException, InUseException(Code)
Remove a resource. For non-collection resources only.
Parameters:
  id - The id 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.



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.



rename
public String rename(String id, String new_id) throws PermissionException, IdUnusedException, TypeException, InUseException, OverQuotaException, InconsistentException, IdUsedException, ServerOverloadException(Code)
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. The full id of the resource after the rename is completed.
exception:
  PermissionException - if the user does not have permissions to read a containing collection, or to rename 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:
  IdUsedException - if copied item is a collection and the new id is already in use or if the copied item is not a collection and a unique id cannot be found in 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.



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.



setUuid
public void setUuid(String id, String uuid) throws IdInvalidException(Code)

Parameters:
  id - id of the resource to set the UUID for
Parameters:
  uuid - the new UUID of the resource
throws:
  IdInvalidException - if the given resource already has a UUID set



updateResource
public ContentResource updateResource(String id, String type, byte[] content) throws PermissionException, IdUnusedException, TypeException, InUseException, OverQuotaException, ServerOverloadException(Code)
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. a new ContentResource object.



usingResourceTypeRegistry
public boolean usingResourceTypeRegistry()(Code)
Access flag indicating whether the ResourceTypeRegistry is being used



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.