|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.api.jaxrs.JaxrsCollection
ccc.api.jaxrs.ResourcesImpl
public class ResourcesImpl
This class exposes parts of our public API using JAX-RS.
Field Summary |
---|
Fields inherited from interface ccc.api.core.Resources |
---|
NAME |
Constructor Summary | |
---|---|
ResourcesImpl(Resources resources)
Constructor. |
Method Summary | |
---|---|
ACL |
acl(java.util.UUID resourceId)
Get the access control list for a resource. |
void |
applyWorkingCopy(java.util.UUID resourceId)
Apply a resource's working copy. |
Duration |
cacheDuration(java.util.UUID resourceId)
Retrieve resource's cache duration. |
void |
changeAcl(java.util.UUID resourceId,
ACL acl)
Change the access control list for a resource. |
void |
clearWorkingCopy(java.util.UUID pageId)
Delete the working copy for a page. |
Template |
computeTemplate(java.util.UUID resourceId)
Returns summary of the template assigned for a resource. |
void |
createLogEntry(java.util.UUID resourceId,
java.lang.String action,
java.lang.String detail)
Create a new log entry for the resource. |
ResourceSummary |
createSearch(java.util.UUID parentId,
java.lang.String title)
Creates a new search. |
void |
createWorkingCopy(java.util.UUID resourceId,
Resource pu)
Create a working copy for the specified resource, using the specified revision. |
void |
delete(java.util.UUID resourceId)
Delete the resource located at the specified path. |
void |
deleteCacheDuration(java.util.UUID id)
Clear the cache duration for the specified resource. |
void |
excludeFromMainMenu(java.util.UUID resourceId)
Specify whether a resource should not be included in a site's main menu. |
boolean |
exists(java.util.UUID resourceId)
Does a resource with the specified ID exist. |
java.lang.String |
fileContentsFromPath(java.lang.String absolutePath,
java.lang.String charset)
Look up the contents of a file as a String. |
java.lang.String |
getAbsolutePath(java.util.UUID resourceId)
Determine the absolute path to a resource. |
PagedCollection<Revision> |
history(java.util.UUID resourceId)
Retrieve the history of a resource. |
void |
includeInMainMenu(java.util.UUID resourceId)
Specify that a resource should be included in a site's main menu. |
PagedCollection<ResourceSummary> |
list(ResourceCriteria criteria,
int pageNo,
int pageSize)
List existing resources. |
PagedCollection<ResourceSummary> |
list(java.util.UUID parent,
java.lang.String tag,
java.lang.Long before,
java.lang.Long after,
java.lang.String mainMenu,
java.lang.String type,
java.lang.String locked,
java.lang.String published,
java.lang.String sort,
SortOrder order,
int pageNo,
int pageSize)
List existing resources. |
void |
lock(java.util.UUID resourceId)
Lock the specified resource. |
java.util.Map<java.lang.String,java.lang.String> |
metadata(java.util.UUID resourceId)
Retrieve the metadata for a resource. |
void |
move(java.util.UUID resourceId,
java.util.UUID newParentId)
Changes a resource's parent. |
ResourceSummary |
publish(java.util.UUID resourceId)
Publish the specified resource. |
void |
rename(java.util.UUID resourceId,
java.lang.String name)
Rename resource. |
ResourceSummary |
resourceForLegacyId(java.lang.String legacyId)
Look up the resource for a specified legacy id. |
PagedCollection<ResourceSummary> |
resourceForMetadataKey(java.lang.String key)
Look up the resources for a specified metadata key. |
ResourceSummary |
resourceForPath(java.lang.String path)
Look up the resource for a specified path. |
Resource |
resourceForPathSecure(java.lang.String path)
Look up the resource for a specified path. |
ResourceSummary |
retrieve(java.util.UUID resourceId)
Get the resource located at the specified path. |
Resource |
revisionForPath(java.lang.String path,
int version)
Look up the resource for a specified path. |
void |
unlock(java.util.UUID resourceId)
Unlock the specified Resource. |
void |
unpublish(java.util.UUID resourceId)
Unpublish the specified resource. |
void |
updateCacheDuration(java.util.UUID resourceId,
Resource pu)
Update the period that a resource should be cached for. |
void |
updateMetadata(java.util.UUID resourceId,
Resource resource)
Update metadata of the resource. |
void |
updateResourceTemplate(java.util.UUID resourceId,
Resource pu)
Update the specified resource's template on the server. |
Resource |
workingCopyForPath(java.lang.String path)
Look up the working copy for a specified path. |
Methods inherited from class ccc.api.jaxrs.JaxrsCollection |
---|
convertException |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourcesImpl(Resources resources)
resources
- The resources implementation delegated to.Method Detail |
---|
public Duration cacheDuration(java.util.UUID resourceId)
cacheDuration
in interface Resources
resourceId
- The id of the resource.
public Template computeTemplate(java.util.UUID resourceId)
computeTemplate
in interface Resources
resourceId
- Id of the resource.
public java.lang.String getAbsolutePath(java.util.UUID resourceId)
getAbsolutePath
in interface Resources
resourceId
- The id of the resource.
public PagedCollection<Revision> history(java.util.UUID resourceId)
history
in interface Resources
resourceId
- The id of the resource whose history we will look up.
public java.util.Map<java.lang.String,java.lang.String> metadata(java.util.UUID resourceId)
metadata
in interface Resources
resourceId
- The id of the resource.
public ResourceSummary retrieve(java.util.UUID resourceId)
retrieve
in interface Resources
resourceId
- The id of the existing resource.
public ResourceSummary resourceForLegacyId(java.lang.String legacyId)
resourceForLegacyId
in interface Resources
legacyId
- The legacy id of the resource.
public PagedCollection<ResourceSummary> resourceForMetadataKey(java.lang.String key)
resourceForMetadataKey
in interface Resources
key
- The legacy id of the resource.
public ResourceSummary resourceForPath(java.lang.String path)
resourceForPath
in interface Resources
path
- The absolute path.
public ACL acl(java.util.UUID resourceId)
acl
in interface Resources
resourceId
- The resource's id.
public void updateCacheDuration(java.util.UUID resourceId, Resource pu)
updateCacheDuration
in interface Resources
resourceId
- The resource to update.pu
- DTO specifying the cache duration.public void lock(java.util.UUID resourceId)
lock
in interface Resources
resourceId
- The uuid of the resource to lock.public void applyWorkingCopy(java.util.UUID resourceId)
applyWorkingCopy
in interface Resources
resourceId
- The id of the resource.public void updateResourceTemplate(java.util.UUID resourceId, Resource pu)
updateResourceTemplate
in interface Resources
resourceId
- The id of the resource to update.pu
- DTO specifying the new template to set for the resource.public void changeAcl(java.util.UUID resourceId, ACL acl)
changeAcl
in interface Resources
resourceId
- The resource to update.acl
- The access control list for the specified resource.public void move(java.util.UUID resourceId, java.util.UUID newParentId)
move
in interface Resources
resourceId
- The id of the resource to move.newParentId
- The id of the folder to which the resource should be
moved.public ResourceSummary publish(java.util.UUID resourceId)
publish
in interface Resources
resourceId
- The id of the resource to update.public void rename(java.util.UUID resourceId, java.lang.String name)
rename
in interface Resources
resourceId
- The id of the resource to rename.name
- The new name.public void unlock(java.util.UUID resourceId)
unlock
in interface Resources
resourceId
- The resource to unlock.public void unpublish(java.util.UUID resourceId)
unpublish
in interface Resources
resourceId
- The id of the resource to update.public void excludeFromMainMenu(java.util.UUID resourceId)
excludeFromMainMenu
in interface Resources
resourceId
- The id of the resource to update.public void includeInMainMenu(java.util.UUID resourceId)
includeInMainMenu
in interface Resources
resourceId
- The id of the resource to update.public void updateMetadata(java.util.UUID resourceId, Resource resource)
updateMetadata
in interface Resources
resourceId
- The id of the resource to update.resource
- The resource containing new metadata.public void clearWorkingCopy(java.util.UUID pageId)
clearWorkingCopy
in interface Resources
pageId
- The id of the page with a working copy.public void createWorkingCopy(java.util.UUID resourceId, Resource pu)
createWorkingCopy
in interface Resources
resourceId
- The id of the resource.pu
- The DTO specifying the number of the revision to use.public void deleteCacheDuration(java.util.UUID id)
deleteCacheDuration
in interface Resources
id
- The id of the resource to update.public void delete(java.util.UUID resourceId)
delete
in interface Resources
resourceId
- The id of the existing resource.public void createLogEntry(java.util.UUID resourceId, java.lang.String action, java.lang.String detail)
createLogEntry
in interface Resources
resourceId
- The id of the resource to create log entry for.action
- The action for the log entry.detail
- The details for the log entry.public PagedCollection<ResourceSummary> list(java.util.UUID parent, java.lang.String tag, java.lang.Long before, java.lang.Long after, java.lang.String mainMenu, java.lang.String type, java.lang.String locked, java.lang.String published, java.lang.String sort, SortOrder order, int pageNo, int pageSize)
list
in interface Resources
parent
- Filter resources by parent.tag
- Filter resources by tag.before
- Include only resources created before this date.after
- Include only resources created after this date.mainMenu
- Filter resources by 'included in main menu'.type
- Filter resources by type.locked
- Filter resources by locked (true or null).published
- Filter resources by published (true or null).sort
- The field results be sorted on.order
- The order results be sorted in.pageNo
- The page of results to return.pageSize
- The number of results in a page.
public java.lang.String fileContentsFromPath(java.lang.String absolutePath, java.lang.String charset)
fileContentsFromPath
in interface Resources
absolutePath
- The absolute path to the resource.charset
- The character set for the file.
public Resource resourceForPathSecure(java.lang.String path)
resourceForPathSecure
in interface Resources
path
- The absolute path.
public Resource revisionForPath(java.lang.String path, int version)
revisionForPath
in interface Resources
path
- The absolute path.version
- The version number of the resource to retrieve.
public Resource workingCopyForPath(java.lang.String path)
workingCopyForPath
in interface Resources
path
- The absolute path.
public ResourceSummary createSearch(java.util.UUID parentId, java.lang.String title)
createSearch
in interface Resources
parentId
- The parent folder where the search should be created.title
- The title of the search.
public PagedCollection<ResourceSummary> list(ResourceCriteria criteria, int pageNo, int pageSize)
list
in interface Resources
criteria
- The criteria by which to filter resources.pageNo
- The page of results to return.pageSize
- The number of results in a page.
public boolean exists(java.util.UUID resourceId)
exists
in interface Resources
resourceId
- The id of the resource.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |