|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectccc.domain.Entity
ccc.domain.ResourceEntity
ccc.domain.FolderEntity
public final class FolderEntity
A folder that can contain other resources.
Constructor Summary | |
---|---|
protected |
FolderEntity()
Constructor: for persistence only. |
|
FolderEntity(java.lang.String title)
Constructor. |
Method Summary | ||
---|---|---|
void |
add(ResourceEntity resource)
Add a resource to this folder. |
|
void |
delete()
Mark this file as deleted. |
|
Folder |
forCurrentRevision()
Create a snapshot for the current revision. |
|
Folder |
forSpecificRevision(int revNo)
Create a snapshot for the specified revision. |
|
Folder |
forWorkingCopy()
Create a snapshot for the working copy. |
|
ResourceEntity |
getChild(java.util.UUID id)
Get a child element via its ID. |
|
java.util.List<ResourceEntity> |
getEntries()
Accessor for entries. |
|
|
getEntries(java.lang.Class<T> resourceType)
Retrieve the entries in this folder in a type-safe list. |
|
java.util.List<ResourceEntity> |
getEntries(int count,
int page,
java.lang.String sortOrder)
Accessor for entries. |
|
ResourceEntity |
getEntryWithName(ResourceName resourceName)
Retrieve an entry from this folder. |
|
ResourceEntity |
getEntryWithName2(ResourceName name)
Find the entry in this folder with the specified name. |
|
AliasEntity |
getFirstAlias()
Accessor method for the first alias in this folder. |
|
PageEntity |
getFirstPage()
Accessor method for the first page in this folder. |
|
int |
getFolderCount()
Query method - returns the number of folders that are children of this folder. |
|
java.util.List<FolderEntity> |
getFolders()
Retrieve a list of all the folders in this folder. |
|
PageEntity |
getIndexPage()
Accessor for the index page. |
|
java.util.List<PageEntity> |
getPages()
Retrieve a list of all the pages in this folder with sort order applied. |
|
ResourceType |
getType()
Query the type of this resource. |
|
boolean |
hasAliases()
Query method to determine if this folder contains any aliases. |
|
boolean |
hasEntryWithName(ResourceName resourceName)
Query whether this folder has an entry with the specified name. |
|
boolean |
hasPages()
Query method to determine if this folder contains any pages. |
|
boolean |
isAncestorOf(ResourceEntity resource)
Determine if this folder is an ancestor of the specified resource. |
|
ResourceEntity |
navigateTo(ResourcePath path)
Navigate from this folder to another resource described by the specified path. |
|
void |
remove(ResourceEntity resource)
Remove a resource from this folder. |
|
void |
setIndexPage(PageEntity indexPage)
Mutator for the index page. |
|
int |
size()
Accessor for size. |
|
void |
toJson(Json json)
Convert to JSON. |
|
void |
undelete()
Mark this file as un-deleted. |
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 |
---|
protected FolderEntity()
public FolderEntity(java.lang.String title)
title
- The title for this resource.Method Detail |
---|
public ResourceType getType()
getType
in class ResourceEntity
public int size()
public void add(ResourceEntity resource)
resource
- The resource to add.public boolean isAncestorOf(ResourceEntity resource)
resource
- The potential child.
public java.util.List<ResourceEntity> getEntries()
public java.util.List<ResourceEntity> getEntries(int count, int page, java.lang.String sortOrder)
For example, calling entries(10, 3) will return the resources with positions 20..29 in the list.
count
- The number of entries to return.page
- The page of entries to return.sortOrder
- The order in which the entries should be sorted.
public ResourceEntity navigateTo(ResourcePath path)
path
- The path to a resource, relative to this folder.
public ResourceEntity getEntryWithName2(ResourceName name)
name
- The name of the resource.
public int getFolderCount()
public boolean hasEntryWithName(ResourceName resourceName)
resourceName
- The name of the resource.
public ResourceEntity getEntryWithName(ResourceName resourceName)
resourceName
- The name of the resource to retrieve.
public <T extends ResourceEntity> java.util.List<T> getEntries(java.lang.Class<T> resourceType)
T
- The type of the resources in this folder.resourceType
- A class representing the type of resources in this
folder.
public boolean hasPages()
public PageEntity getFirstPage()
public void remove(ResourceEntity resource)
resource
- The resource to remove.public java.util.List<PageEntity> getPages()
public java.util.List<FolderEntity> getFolders()
public boolean hasAliases()
public AliasEntity getFirstAlias()
public PageEntity getIndexPage()
public void setIndexPage(PageEntity indexPage)
indexPage
- The index page to set.public void delete()
delete
in class ResourceEntity
public void undelete()
undelete
in class ResourceEntity
public void toJson(Json json)
toJson
in interface Jsonable
toJson
in class ResourceEntity
json
- The JSON object to write to.public ResourceEntity getChild(java.util.UUID id)
id
- The child's ID.
public Folder forWorkingCopy()
public Folder forCurrentRevision()
public Folder forSpecificRevision(int revNo)
revNo
- The revision to create a snapshot for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |