ccc.domain
Class PageEntity

java.lang.Object
  extended by ccc.domain.Entity
      extended by ccc.domain.ResourceEntity
          extended by ccc.domain.HistoricalResource<U,T>
              extended by ccc.domain.WorkingCopySupport<PageRevision,Page,PageWorkingCopy>
                  extended by ccc.domain.PageEntity
All Implemented Interfaces:
Lockable, SnapshotSupport<Resource>, WCAware<Page>, Jsonable, java.io.Serializable

public class PageEntity
extends WorkingCopySupport<PageRevision,Page,PageWorkingCopy>

A page resource.

Author:
Civic Computing Ltd.
See Also:
Serialized Form

Constructor Summary
protected PageEntity()
          Constructor: for persistence only.
  PageEntity(ResourceName name, java.lang.String title, TemplateEntity template, RevisionMetadata metadata, Paragraph... paragraphs)
          Constructor.
 
Method Summary
protected  PageWorkingCopy createWorkingCopy(Page delta)
          Create a working copy from a delta.
 Page deltaPage()
          Create a delta for a page.
 Page forCurrentRevision()
          Create a snapshot for the current revision.
 Page forSpecificRevision(int revNo)
          Create a snapshot for the specified revision.
 Page forWorkingCopy()
          Create a snapshot for the working copy.
 ResourceType getType()
          Query the type of this resource.
protected  void update(Page delta, RevisionMetadata metadata)
          Update the resource from the specified delta.
 
Methods inherited from class ccc.domain.WorkingCopySupport
applyWorkingCopy, clearWorkingCopy, getOrCreateWorkingCopy, getWorkingCopy, hasWorkingCopy, setOrUpdateWorkingCopy, setWorkingCopy, setWorkingCopyFromRevision
 
Methods inherited from class ccc.domain.HistoricalResource
addRevision, currentRevision, currentRevisionNo, revision, revisions, toJson
 
Methods inherited from class ccc.domain.ResourceEntity
addGroupPermission, addMetadata, addMetadatum, addUserPermission, as, canUnlock, clearGroupAcl, clearMetadata, clearMetadatum, clearUserAcl, computeCache, computeMetadata, computeTemplate, confirmLock, delete, getAbsolutePath, getAcl, getCacheDuration, getChangedBy, getCreatedBy, getDateChanged, getDateCreated, getDescription, getGroupAcl, getIndex, getLockedBy, getMetadata, getMetadatum, getName, getParent, getPublishedBy, getRoot, getTags, getTemplate, getTitle, getUserAcl, isDeleted, isIncludedInMainMenu, isIndexable, isLocked, isPublished, isReadableBy, isSecure, isVisible, isWriteableBy, lock, mapResource, mapResources, publish, setCacheDuration, setDateChanged, setDateCreated, setDescription, setDtoProps, setIncludedInMainMenu, setIndexPosition, setName, setTags, setTemplate, setTitle, undelete, unlock, unpublish
 
Methods inherited from class ccc.domain.Entity
equals, getId, getVersion, hashCode, setId, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PageEntity

protected PageEntity()
Constructor: for persistence only.


PageEntity

public PageEntity(ResourceName name,
                  java.lang.String title,
                  TemplateEntity template,
                  RevisionMetadata metadata,
                  Paragraph... paragraphs)
Constructor.

Parameters:
name - The name of the resource.
title - The title of the resource.
template - The page's template.
metadata - The metadata for the revision.
paragraphs - The page's paragraphs.
Method Detail

getType

public ResourceType getType()
Query the type of this resource.

Specified by:
getType in class ResourceEntity
Returns:
The ResourceType that describes this resource.

createWorkingCopy

protected PageWorkingCopy createWorkingCopy(Page delta)
Create a working copy from a delta.

Specified by:
createWorkingCopy in class WorkingCopySupport<PageRevision,Page,PageWorkingCopy>
Parameters:
delta - The delta for the working copy.
Returns:
The new working copy.

update

protected void update(Page delta,
                      RevisionMetadata metadata)
Update the resource from the specified delta.

Specified by:
update in class WorkingCopySupport<PageRevision,Page,PageWorkingCopy>
Parameters:
delta - The delta to apply.
metadata - The metadata for the update.

forWorkingCopy

public final Page forWorkingCopy()
Create a snapshot for the working copy.

Returns:
A read-only snapshot of the resource.

forCurrentRevision

public final Page forCurrentRevision()
Create a snapshot for the current revision.

Returns:
A read-only snapshot of the resource.

forSpecificRevision

public final Page forSpecificRevision(int revNo)
Create a snapshot for the specified revision.

Parameters:
revNo - The revision to create a snapshot for.
Returns:
A read-only snapshot of the resource.

deltaPage

public Page deltaPage()
Create a delta for a page.

Returns:
The corresponding delta.


Copyright © 2010. All Rights Reserved.