org.liquidsite.app.admin.view
Class AdminView

java.lang.Object
  extended byorg.liquidsite.app.admin.view.AdminView
Direct Known Subclasses:
ContentView, DialogView, SiteView, UserView

public class AdminView
extends java.lang.Object

A helper class for creating the HTML and JavaScript output for the administration application.


Field Summary
static AdminView BASE
          The base view class.
static ContentView CONTENT
          The content view helper.
static DialogView DIALOG
          The dialog view helper.
static HomeView HOME
          The home view helper.
static ScriptView SCRIPT
          The script view helper.
static SiteView SITE
          The site view helper.
static SystemView SYSTEM
          The system view helper.
static UserView USER
          The user view helper.
 
Method Summary
protected  java.util.ArrayList findDomains(User user)
          Finds all domains readable by a user.
protected  java.util.ArrayList findFolders(User user, ContentSite site, ContentFolder exclude, boolean translators)
          Finds all content folders in a site.
protected  java.util.ArrayList findForums(User user, Domain domain)
          Finds all content forums in a domain.
protected  java.util.ArrayList findGroups(Domain domain, java.lang.String filter)
          Finds the matching groups in a domain.
protected  java.util.ArrayList findSections(User user, Domain domain, ContentSection exclude)
          Finds all content sections in a domain.
protected  java.util.ArrayList findTemplates(User user, Domain domain, ContentTemplate exclude)
          Finds all content templates in a domain.
 void viewError(Request request, java.lang.String message, java.lang.String page)
          Shows the error message page.
 void viewInfo(Request request, java.lang.String message, java.lang.String detail, java.lang.String page)
          Shows the information message page.
 void viewRedirect(Request request, java.lang.String url)
          Shows the redirect page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE

public static final AdminView BASE
The base view class.


DIALOG

public static final DialogView DIALOG
The dialog view helper.


HOME

public static final HomeView HOME
The home view helper.


SITE

public static final SiteView SITE
The site view helper.


CONTENT

public static final ContentView CONTENT
The content view helper.


USER

public static final UserView USER
The user view helper.


SYSTEM

public static final SystemView SYSTEM
The system view helper.


SCRIPT

public static final ScriptView SCRIPT
The script view helper.

Method Detail

viewError

public void viewError(Request request,
                      java.lang.String message,
                      java.lang.String page)
Shows the error message page. When the user presses the confirmation button on the error page, the browser will be redirected to the specified page.

Parameters:
request - the request object
message - the error message
page - the redirect page

viewInfo

public void viewInfo(Request request,
                     java.lang.String message,
                     java.lang.String detail,
                     java.lang.String page)
Shows the information message page. When the user presses the confirmation button on the page, the browser will be redirected to the specified page.

Parameters:
request - the request object
message - the information message
detail - the detail information message
page - the redirect page

viewRedirect

public void viewRedirect(Request request,
                         java.lang.String url)
Shows the redirect page. This page is sometimes needed to compensate for erroneous 403 handling by some browsers (i.e. Internet Explorer).

Parameters:
request - the request object
url - the destination URL

findDomains

protected java.util.ArrayList findDomains(User user)
                                   throws ContentException
Finds all domains readable by a user. The domains will not be added directly to the result list, but rather only the domain names.

Parameters:
user - the user
Returns:
a list of domains found
Throws:
ContentException - if the database couldn't be accessed properly

findFolders

protected java.util.ArrayList findFolders(User user,
                                          ContentSite site,
                                          ContentFolder exclude,
                                          boolean translators)
                                   throws ContentException
Finds all content folders in a site. The folders will not be added directly to the result list, but rather a simplified hash map containing only the id and name of each folder will be added. This method will return the site as the base folder and may also include translators if the corresponding flag is set.

Parameters:
user - the user
site - the content site
exclude - the folder to exclude, or null
translators - the include translators flag
Returns:
the list of folders found (in maps)
Throws:
ContentException - if the database couldn't be accessed properly

findTemplates

protected java.util.ArrayList findTemplates(User user,
                                            Domain domain,
                                            ContentTemplate exclude)
                                     throws ContentException
Finds all content templates in a domain. The templates will not be added directly to the result list, but rather a simplified hash map containing only the id and name of each template will be added.

Parameters:
user - the user
domain - the domain
exclude - the template to exclude, or null
Returns:
the list of templates found (in maps)
Throws:
ContentException - if the database couldn't be accessed properly

findSections

protected java.util.ArrayList findSections(User user,
                                           Domain domain,
                                           ContentSection exclude)
                                    throws ContentException
Finds all content sections in a domain. The sections will not be added directly to the result list, but rather a simplified hash map containing only the id and name of each section will be added.

Parameters:
user - the user
domain - the domain
exclude - the section to exclude, or null
Returns:
the list of sections found (in maps)
Throws:
ContentException - if the database couldn't be accessed properly

findForums

protected java.util.ArrayList findForums(User user,
                                         Domain domain)
                                  throws ContentException
Finds all content forums in a domain. The forums will not be added directly to the result list, but rather a simplified hash map containing only the id and name of each forum will be added.

Parameters:
user - the user
domain - the domain
Returns:
the list of sections found (in maps)
Throws:
ContentException - if the database couldn't be accessed properly

findGroups

protected java.util.ArrayList findGroups(Domain domain,
                                         java.lang.String filter)
                                  throws ContentException
Finds the matching groups in a domain. The groups will not be added directly to the result list, but rather a simplified hash map containing only certain properties will be added.

Parameters:
domain - the domain
filter - the search filter (empty for all)
Returns:
the list of groups found (in maps)
Throws:
ContentException - if the database couldn't be accessed properly