ccc.api.core
Class Resource

java.lang.Object
  extended by ccc.api.core.Res
      extended by ccc.api.core.Resource
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Alias, File, Folder, Page, Template

public class Resource
extends Res

A read-only snapshot of a resource.

Author:
Civic Computing Ltd.
See Also:
Serialized Form

Field Summary
static java.lang.String ABSOLUTE_PATH
          ABSOLUTE_PATH : String.
static java.lang.String ACL
          ACL : String.
static java.lang.String DELETE
          DELETE : String.
static java.lang.String DURATION
          DURATION : String.
static java.lang.String EXCLUDE_MM
          EXCLUDE_MM : String.
static java.lang.String INCLUDE_MM
          INCLUDE_MM : String.
static java.lang.String LIST
          LIST : String.
static java.lang.String LOCK
          LOCK : String.
static java.lang.String METADATA
          METADATA : String.
static java.lang.String NAME
          NAME : String.
static java.lang.String PARENT
          PARENT : String.
static java.lang.String PUBLISH
          PUBLISH : String.
static java.lang.String REVISIONS
          REVISIONS : String.
static java.lang.String SELF
          SELF : String.
static java.lang.String TEMPLATE
          TEMPLATE : String.
static java.lang.String WC
          WC_APPLY : String.
 
Constructor Summary
Resource()
          Constructor.
Resource(Duration cacheDuration)
          Deprecated. 
Resource(Duration cacheDuration, java.lang.Long revision, java.util.UUID templateId)
          Deprecated. 
Resource(java.lang.Long revision)
          Deprecated. 
Resource(java.util.UUID templateId)
          Deprecated. 
 
Method Summary
 Link duration()
          Link.
 java.lang.String getAbsolutePath()
          Accessor.
 Duration getCacheDuration()
          Compute the cache duration for this resource.
 java.util.Date getDateChanged()
          Accessor for the date the resource last changed.
 java.util.Date getDateCreated()
          Accessor for the date the resource was created.
 java.lang.String getDescription()
          Accessor for the file's description.
 java.util.UUID getId()
          Accessor.
 java.util.UUID getLockedBy()
          Accessor.
 java.util.Map<java.lang.String,java.lang.String> getMetadata()
          Accessor.
 java.lang.String getMetadatum(java.lang.String key)
          Retrieve metadata for this resource.
 ResourceName getName()
          Accessor for name.
 java.util.UUID getParent()
          Accessor.
 java.util.UUID getPublishedBy()
          Accessor.
 int getRevision()
          Accessor.
 java.util.Set<java.lang.String> getTags()
          Accessor for a resource's tags.
 java.util.UUID getTemplate()
          Compute the template for this resource.
 java.lang.String getTitle()
          Accessor for the title.
 ResourceType getType()
          Accessor.
 boolean isCacheable()
          Query.
 boolean isInMainMenu()
          Accessor for 'include in main menu' property.
 boolean isLocked()
          Accessor.
 boolean isPublished()
          Accessor.
 boolean isSecure()
          Accessor.
 boolean isVisible()
          Is the resource visible.
 boolean isWorkingCopy()
          Accessor.
 Link self()
          Link.
 void setAbsolutePath(java.lang.String absolutePath)
          Mutator.
 void setCacheDuration(Duration cacheDuration)
          Mutator.
 void setDateChanged(java.util.Date dateChanged)
          Mutator.
 void setDateCreated(java.util.Date dateCreated)
          Mutator.
 void setDescription(java.lang.String description)
          Mutator.
 void setId(java.util.UUID id)
          Mutator.
 void setInMainMenu(boolean inMainMenu)
          Mutator.
 void setLocked(boolean isLocked)
          Mutator.
 void setLockedBy(java.util.UUID lockedBy)
          Mutator.
 void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
          Mutator.
 void setName(ResourceName name)
          Mutator.
 void setParent(java.util.UUID parent)
          Mutator.
 void setPublished(boolean isPublished)
          Mutator.
 void setPublishedBy(java.util.UUID publishedBy)
          Mutator.
 void setRevision(int revision)
          Mutator.
 void setSecure(boolean isSecure)
          Mutator.
 void setTags(java.util.Set<java.lang.String> tags)
          Mutator.
 void setTags(java.lang.String tags)
          Mutator.
 void setTemplate(java.util.UUID template)
          Mutator.
 void setTitle(java.lang.String title)
          Mutator.
 void setType(ResourceType type)
          Mutator.
 void setVisible(boolean isVisible)
          Mutator.
 Link uriMetadata()
          Link.
 Link uriTemplate()
          Link.
 
Methods inherited from class ccc.api.core.Res
addLink, addLinks, getLink, getLinks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
NAME : String.

See Also:
Constant Field Values

WC

public static final java.lang.String WC
WC_APPLY : String.

See Also:
Constant Field Values

LIST

public static final java.lang.String LIST
LIST : String.

See Also:
Constant Field Values

REVISIONS

public static final java.lang.String REVISIONS
REVISIONS : String.

See Also:
Constant Field Values

ABSOLUTE_PATH

public static final java.lang.String ABSOLUTE_PATH
ABSOLUTE_PATH : String.

See Also:
Constant Field Values

INCLUDE_MM

public static final java.lang.String INCLUDE_MM
INCLUDE_MM : String.

See Also:
Constant Field Values

LOCK

public static final java.lang.String LOCK
LOCK : String.

See Also:
Constant Field Values

PARENT

public static final java.lang.String PARENT
PARENT : String.

See Also:
Constant Field Values

DURATION

public static final java.lang.String DURATION
DURATION : String.

See Also:
Constant Field Values

ACL

public static final java.lang.String ACL
ACL : String.

See Also:
Constant Field Values

PUBLISH

public static final java.lang.String PUBLISH
PUBLISH : String.

See Also:
Constant Field Values

EXCLUDE_MM

public static final java.lang.String EXCLUDE_MM
EXCLUDE_MM : String.

See Also:
Constant Field Values

METADATA

public static final java.lang.String METADATA
METADATA : String.

See Also:
Constant Field Values

TEMPLATE

public static final java.lang.String TEMPLATE
TEMPLATE : String.

See Also:
Constant Field Values

SELF

public static final java.lang.String SELF
SELF : String.

See Also:
Constant Field Values

DELETE

public static final java.lang.String DELETE
DELETE : String.

See Also:
Constant Field Values
Constructor Detail

Resource

public Resource()
Constructor.


Resource

@Deprecated
public Resource(Duration cacheDuration)
Deprecated. 

Constructor.

Parameters:
cacheDuration - The duration to set (may be NULL).

Resource

@Deprecated
public Resource(java.lang.Long revision)
Deprecated. 

Constructor.

Parameters:
revision - The revision used to create the working copy.

Resource

@Deprecated
public Resource(Duration cacheDuration,
                           java.lang.Long revision,
                           java.util.UUID templateId)
Deprecated. 

Constructor.

Parameters:
cacheDuration - The duration to set (may be NULL).
revision - The revision used to create the working copy.
templateId - The template id.

Resource

@Deprecated
public Resource(java.util.UUID templateId)
Deprecated. 

Constructor.

Parameters:
templateId - The template id.
Method Detail

getTemplate

public final java.util.UUID getTemplate()
Compute the template for this resource.

Returns:
The selected template.

isVisible

public final boolean isVisible()
Is the resource visible.

Returns:
True if the resource is visible, false otherwise.

getType

public final ResourceType getType()
Accessor.

Returns:
The resource's type.

getDescription

public final java.lang.String getDescription()
Accessor for the file's description.

Returns:
The description as a string.

getName

public final ResourceName getName()
Accessor for name.

Returns:
The name for this resource, as a ResourceName.

getCacheDuration

public final Duration getCacheDuration()
Compute the cache duration for this resource.

Returns:
The computed duration.

getDateChanged

public final java.util.Date getDateChanged()
Accessor for the date the resource last changed.

Returns:
The date the resource last changed.

getDateCreated

public final java.util.Date getDateCreated()
Accessor for the date the resource was created.

Returns:
The date of creation.

getMetadatum

public final java.lang.String getMetadatum(java.lang.String key)
Retrieve metadata for this resource.

Parameters:
key - The key with which the datum was stored.
Returns:
The value of the datum. NULL if the datum doesn't exist.

getId

public final java.util.UUID getId()
Accessor.

Returns:
The resource's id.

isInMainMenu

public final boolean isInMainMenu()
Accessor for 'include in main menu' property.

Returns:
True if the resource should be included, false otherwise.

isLocked

public final boolean isLocked()
Accessor.

Returns:
True if the resource is locked, false otherwise.

isPublished

public final boolean isPublished()
Accessor.

Returns:
True if the resource is published, false otherwise.

getLockedBy

public final java.util.UUID getLockedBy()
Accessor.

Returns:
The user that locked the resource or false if the resource is not locked.

getMetadata

public final java.util.Map<java.lang.String,java.lang.String> getMetadata()
Accessor.

Returns:
The resource's metadata, as a map.

getParent

public final java.util.UUID getParent()
Accessor.

Returns:
The parent folder for the resource.

getPublishedBy

public final java.util.UUID getPublishedBy()
Accessor.

Returns:
The user that published the resource or null if the resource isn't published.

getTags

public final java.util.Set<java.lang.String> getTags()
Accessor for a resource's tags.

Returns:
The tags for this resource as a list.

getTitle

public final java.lang.String getTitle()
Accessor for the title.

Returns:
The content's title, as a string.

getAbsolutePath

public final java.lang.String getAbsolutePath()
Accessor.

Returns:
The absolute path to the resource.

setTitle

public void setTitle(java.lang.String title)
Mutator.

Parameters:
title - The title to set.

setId

public void setId(java.util.UUID id)
Mutator.

Parameters:
id - The id to set.

setName

public void setName(ResourceName name)
Mutator.

Parameters:
name - The name to set.

setDescription

public void setDescription(java.lang.String description)
Mutator.

Parameters:
description - The description to set.

setParent

public void setParent(java.util.UUID parent)
Mutator.

Parameters:
parent - The parent to set.

setType

public void setType(ResourceType type)
Mutator.

Parameters:
type - The type to set.

isSecure

public boolean isSecure()
Accessor.

Returns:
True if the resource requires security privileges to access; false otherwise.

setSecure

public void setSecure(boolean isSecure)
Mutator.

Parameters:
isSecure - The isSecure to set.

setAbsolutePath

public void setAbsolutePath(java.lang.String absolutePath)
Mutator.

Parameters:
absolutePath - The absolutePath to set.

setTags

public void setTags(java.util.Set<java.lang.String> tags)
Mutator.

Parameters:
tags - The tags to set.

setTags

public void setTags(java.lang.String tags)
Mutator.

Parameters:
tags - The tags to set.

setPublishedBy

public void setPublishedBy(java.util.UUID publishedBy)
Mutator.

Parameters:
publishedBy - The publishedBy to set.

setMetadata

public void setMetadata(java.util.Map<java.lang.String,java.lang.String> metadata)
Mutator.

Parameters:
metadata - The metadata to set.

setPublished

public void setPublished(boolean isPublished)
Mutator.

Parameters:
isPublished - The isPublished to set.

setLockedBy

public void setLockedBy(java.util.UUID lockedBy)
Mutator.

Parameters:
lockedBy - The lockedBy to set.

setLocked

public void setLocked(boolean isLocked)
Mutator.

Parameters:
isLocked - The isLocked to set.

setDateCreated

public void setDateCreated(java.util.Date dateCreated)
Mutator.

Parameters:
dateCreated - The dateCreated to set.

setDateChanged

public void setDateChanged(java.util.Date dateChanged)
Mutator.

Parameters:
dateChanged - The dateChanged to set.

setVisible

public void setVisible(boolean isVisible)
Mutator.

Parameters:
isVisible - The isVisible to set.

setTemplate

public void setTemplate(java.util.UUID template)
Mutator.

Parameters:
template - The template to set.

setCacheDuration

public void setCacheDuration(Duration cacheDuration)
Mutator.

Parameters:
cacheDuration - The cacheDuration to set.

setInMainMenu

public void setInMainMenu(boolean inMainMenu)
Mutator.

Parameters:
inMainMenu - The inMainMenu to set.

setRevision

public void setRevision(int revision)
Mutator.

Parameters:
revision - The revision to set.

getRevision

public int getRevision()
Accessor.

Returns:
Returns the revision.

isWorkingCopy

public boolean isWorkingCopy()
Accessor.

Returns:
True if the snapshot is for a working copy, false otherwise.

isCacheable

public boolean isCacheable()
Query.

Returns:
True if the resource is cache-able, false otherwise.

uriMetadata

public Link uriMetadata()
Link.

Returns:
A link to this resource's metadata.

uriTemplate

public Link uriTemplate()
Link.

Returns:
A link to this resource's template.

duration

public Link duration()
Link.

Returns:
A link to this resource's duration.

self

public final Link self()
Link.

Returns:
A link to this resource.


Copyright © 2010. All Rights Reserved.