org.liquidsite.core.content
Class ContentSelector

java.lang.Object
  extended byorg.liquidsite.core.content.ContentSelector

public class ContentSelector
extends java.lang.Object

A content selector. This class controls the selection of content objects when making database queries.


Constructor Summary
ContentSelector(Domain domain)
          Creates a new content selector for the specified domain.
 
Method Summary
 void limitResults(int start, int count)
          Sets the result start and count limitations.
 void requireCategory(int category)
          Sets the content category requirement.
 void requireParent(Content parent)
          Adds a content parent requirement.
 void requireRootParent()
          Adds a content parent requirement.
 void sortByAuthor(boolean ascending)
          Adds a content modified author sort key to the query.
 void sortByCategory(boolean ascending)
          Adds a content category sort key to the query.
 void sortByDocumentProperty(java.lang.String property, boolean ascending)
          Adds a document property sort key to the query.
 void sortById(boolean ascending)
          Adds a content identifier sort key to the query.
 void sortByModified(boolean ascending)
          Adds a content modified date sort key to the query.
 void sortByName(boolean ascending)
          Adds a content name sort key to the query.
 void sortByOnline(boolean ascending)
          Adds a content online date sort key to the query.
 void sortByParent(boolean ascending)
          Adds a content parent identifier sort key to the query.
 void sortByRevision(boolean ascending)
          Adds a content revision sort key to the query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentSelector

public ContentSelector(Domain domain)
Creates a new content selector for the specified domain. Note that this content selector cannot return content objects from another domain.

Parameters:
domain - the domain
Method Detail

requireRootParent

public void requireRootParent()
Adds a content parent requirement. By default any content parent will be accepted. By calling this method several times with different parents, a set of content parents will be accepted.


requireParent

public void requireParent(Content parent)
Adds a content parent requirement. By default any content parent will be accepted. By calling this method several times with different parents, a set of content parents will be accepted.

Parameters:
parent - the parent content object

requireCategory

public void requireCategory(int category)
Sets the content category requirement. By default any content category will be accepted.

Parameters:
category - the content category required

sortById

public void sortById(boolean ascending)
Adds a content identifier sort key to the query. Several sort keys can be added, giving priority to the first ones added.

Parameters:
ascending - the ascending sort order flag

sortByRevision

public void sortByRevision(boolean ascending)
Adds a content revision sort key to the query. Several sort keys can be added, giving priority to the first ones added.

Parameters:
ascending - the ascending sort order flag

sortByCategory

public void sortByCategory(boolean ascending)
Adds a content category sort key to the query. Several sort keys can be added, giving priority to the first ones added.

Parameters:
ascending - the ascending sort order flag

sortByName

public void sortByName(boolean ascending)
Adds a content name sort key to the query. Several sort keys can be added, giving priority to the first ones added.

Parameters:
ascending - the ascending sort order flag

sortByParent

public void sortByParent(boolean ascending)
Adds a content parent identifier sort key to the query. Several sort keys can be added, giving priority to the first ones added.

Parameters:
ascending - the ascending sort order flag

sortByOnline

public void sortByOnline(boolean ascending)
Adds a content online date sort key to the query. Several sort keys can be added, giving priority to the first ones added.

Parameters:
ascending - the ascending sort order flag

sortByModified

public void sortByModified(boolean ascending)
Adds a content modified date sort key to the query. Several sort keys can be added, giving priority to the first ones added.

Parameters:
ascending - the ascending sort order flag

sortByAuthor

public void sortByAuthor(boolean ascending)
Adds a content modified author sort key to the query. Several sort keys can be added, giving priority to the first ones added.

Parameters:
ascending - the ascending sort order flag

sortByDocumentProperty

public void sortByDocumentProperty(java.lang.String property,
                                   boolean ascending)
Adds a document property sort key to the query. Several sort keys can be added, giving priority to the first ones added.

Parameters:
property - the document property name
ascending - the ascending sort order flag

limitResults

public void limitResults(int start,
                         int count)
Sets the result start and count limitations. By default a maximum of 100 objects are retrieved, starting from index zero (0).

Parameters:
start - the index of the first result object
count - the maximum number of result objects