|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.liquidsite.core.content.ContentManager
The content manager. This class provides an interface for retrieving objects from the database. The content manager guarantees that security considerations are taken into account before returning object (if a method comment does not explicitly say otherwise). The content manager also makes sure not to return unpublished content if it's policy does not allow that (only used by the web administration).
| Constructor Summary | |
ContentManager(ContentManager manager,
boolean admin)
Creates a new content manager. |
|
ContentManager(DatabaseConnector db,
java.io.File baseDir,
boolean admin)
Creates a new content manager. |
|
| Method Summary | |
void |
close()
Closes this content manager and frees all resources. |
ContentSite |
findSite(java.lang.String protocol,
java.lang.String hostname,
int port,
java.lang.String path)
Finds the site corresponding to a web request. |
java.io.File |
getBaseDir()
Returns the content base directory. |
Content |
getContent(User user,
int id)
Returns the content object with the specified identifier and highest revision readable by the user. |
Content |
getContentChild(User user,
Content parent,
java.lang.String name)
Returns the child content object with the specified name and highest revision readable by the user. |
Content |
getContentChild(User user,
Domain domain,
java.lang.String name)
Returns the domain root content object with the specified name and highest revision readable by the user. |
Content[] |
getContentChildren(User user,
Content parent)
Returns the user readable child content objects. |
Content[] |
getContentChildren(User user,
Content parent,
int category)
Returns the user readable child content objects in the specified category. |
Content[] |
getContentChildren(User user,
Domain domain)
Returns the user readable domain root content objects. |
Content[] |
getContentChildren(User user,
Domain domain,
int category)
Returns the user readable domain root content objects in the specified category. |
int |
getContentCount(ContentSelector selector)
Returns the number of content objects matching the selector. |
Content[] |
getContentObjects(User user,
ContentSelector selector)
Returns the user readable content objects matching the selector. |
DatabaseConnector |
getDatabase()
Returns the database connector for this content manager. |
Domain |
getDomain(User user,
java.lang.String name)
Returns a domain with the specified name readable by a user. |
Domain[] |
getDomains(User user)
Returns an array of all domains readable by a user. |
Group |
getGroup(Domain domain,
java.lang.String name)
Returns a group with a specified name. |
Group[] |
getGroups(Domain domain,
java.lang.String filter)
Returns an array of groups in a specified domain. |
PermissionList |
getPermissions(Content content,
boolean inherit)
Returns the permission list applicable to a content object. |
PermissionList |
getPermissions(Domain domain)
Returns the permission list applicable to a domain object. |
User |
getUser(Domain domain,
java.lang.String name)
Returns a user with a specified name. |
int |
getUserCount(Domain domain,
java.lang.String filter)
Returns the number of users in a specified domain. |
User[] |
getUsers(Domain domain,
java.lang.String filter,
int startPos,
int maxLength)
Returns an array of users in a specified domain. |
boolean |
isAdmin()
Checks if the admin flag is set. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ContentManager(DatabaseConnector db,
java.io.File baseDir,
boolean admin)
db - the database connectorbaseDir - the content base directoryadmin - the admin content manager flag
public ContentManager(ContentManager manager,
boolean admin)
manager - the content manager to modifyadmin - the admin content manager flag| Method Detail |
public boolean isAdmin()
public DatabaseConnector getDatabase()
public java.io.File getBaseDir()
public Domain[] getDomains(User user)
throws ContentException
user - the user requesting the list
ContentException - if the database couldn't be accessed
properly
public Domain getDomain(User user,
java.lang.String name)
throws ContentException,
ContentSecurityException
user - the user requesting the domainname - the domain name
ContentException - if the database couldn't be accessed
properly
ContentSecurityException - if the specified domain
wasn't readable by the user
public Content getContent(User user,
int id)
throws ContentException,
ContentSecurityException
user - the user requesting the contentid - the content identifier
ContentException - if the database couldn't be accessed
properly
ContentSecurityException - if the specified content
object wasn't readable by the user
public Content getContentChild(User user,
Domain domain,
java.lang.String name)
throws ContentException,
ContentSecurityException
user - the user requesting the contentdomain - the domainname - the child name
ContentException - if the database couldn't be accessed
properly
ContentSecurityException - if the specified content
object wasn't readable by the user
public Content getContentChild(User user,
Content parent,
java.lang.String name)
throws ContentException,
ContentSecurityException
user - the user requesting the contentparent - the content parentname - the child name
ContentException - if the database couldn't be accessed
properly
ContentSecurityException - if the specified content
object wasn't readable by the user
public Content[] getContentChildren(User user,
Domain domain)
throws ContentException
user - the user requesting the contentdomain - the domain
ContentException - if the database couldn't be accessed
properly
public Content[] getContentChildren(User user,
Domain domain,
int category)
throws ContentException
user - the user requesting the contentdomain - the domaincategory - the content category
ContentException - if the database couldn't be accessed
properly
public Content[] getContentChildren(User user,
Content parent)
throws ContentException
user - the user requesting the contentparent - the content parent
ContentException - if the database couldn't be accessed
properly
public Content[] getContentChildren(User user,
Content parent,
int category)
throws ContentException
user - the user requesting the contentparent - the content parentcategory - the content category
ContentException - if the database couldn't be accessed
properly
public int getContentCount(ContentSelector selector)
throws ContentException
selector - the content selector
ContentException - if the database couldn't be accessed
properly
public Content[] getContentObjects(User user,
ContentSelector selector)
throws ContentException
user - the user requesting the contentselector - the content selector
ContentException - if the database couldn't be accessed
properly
public PermissionList getPermissions(Domain domain)
throws ContentException
domain - the domain object
ContentException - if the database couldn't be accessed
properly
public PermissionList getPermissions(Content content,
boolean inherit)
throws ContentException
content - the content objectinherit - the search inherited permissions flag
ContentException - if the database couldn't be accessed
properly
public User getUser(Domain domain,
java.lang.String name)
throws ContentException
domain - the domainname - the user name
ContentException - if the database couldn't be accessed
properly
public int getUserCount(Domain domain,
java.lang.String filter)
throws ContentException
domain - the domain, or null for superusersfilter - the user search filter (empty for all)
ContentException - if the database couldn't be accessed
properly
public User[] getUsers(Domain domain,
java.lang.String filter,
int startPos,
int maxLength)
throws ContentException
domain - the domain, or null for superusersfilter - the user search filter (empty for all)startPos - the list interval start positionmaxLength - the list interval maximum length
ContentException - if the database couldn't be accessed
properly
public Group getGroup(Domain domain,
java.lang.String name)
throws ContentException
domain - the domainname - the group name
ContentException - if the database couldn't be accessed
properly
public Group[] getGroups(Domain domain,
java.lang.String filter)
throws ContentException
domain - the domainfilter - the search filter (empty for all)
ContentException - if the database couldn't be accessed
properly
public ContentSite findSite(java.lang.String protocol,
java.lang.String hostname,
int port,
java.lang.String path)
throws ContentException
protocol - the request protocol (i.e. "http")hostname - the request host nameport - the request port numberpath - the full request path
ContentException - if the database couldn't be accessed
properlypublic void close()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||