org.liquidsite.app.admin.view
Class ScriptView

java.lang.Object
  extended byorg.liquidsite.app.admin.view.ScriptView

public class ScriptView
extends java.lang.Object

A helper class for creating JavaScript code to the administration application.


Method Summary
 java.lang.String getObjectView(User user, Content content, java.lang.String view)
          Returns the JavaScript for presenting an object view.
 java.lang.String getObjectView(User user, Domain domain, java.lang.String view)
          Returns the JavaScript for presenting an object view.
 java.lang.String getTemplateElements(ContentTemplate template)
          Returns the JavaScript for setting all the inherited template page elements.
 java.lang.String getTreeView(Content parent, Content[] children, boolean open)
          Returns the JavaScript for presenting a tree view.
 java.lang.String getTreeView(Domain[] domains)
          Returns the JavaScript for presenting a tree view.
 java.lang.String getTreeView(Domain domain, Content[] children, boolean open)
          Returns the JavaScript for presenting a tree view.
 java.lang.String getTreeViewSelect(Content content)
          Returns the JavaScript for selecting an item in a tree view.
 java.lang.String getTreeViewSelect(Domain domain)
          Returns the JavaScript for selecting an item in a tree view.
 boolean isContainer(Content content)
          Checks if the specified content object is a container.
 void viewReload(Request request)
          Sends a page reload script.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

viewReload

public void viewReload(Request request)
Sends a page reload script.

Parameters:
request - the request object

getTreeViewSelect

public java.lang.String getTreeViewSelect(Domain domain)
Returns the JavaScript for selecting an item in a tree view.

Parameters:
domain - the domain object to select
Returns:
the JavaScript for selecting the item

getTreeViewSelect

public java.lang.String getTreeViewSelect(Content content)
Returns the JavaScript for selecting an item in a tree view.

Parameters:
content - the content object to select
Returns:
the JavaScript for selecting the item

getTreeView

public java.lang.String getTreeView(Domain[] domains)
Returns the JavaScript for presenting a tree view.

Parameters:
domains - the root domain objects
Returns:
the JavaScript for presenting a tree view

getTreeView

public java.lang.String getTreeView(Domain domain,
                                    Content[] children,
                                    boolean open)
                             throws ContentException
Returns the JavaScript for presenting a tree view.

Parameters:
domain - the domain object
children - the child content objects
open - the open (domain) object flag
Returns:
the JavaScript for presenting a tree view
Throws:
ContentException - if the database couldn't be accessed properly

getTreeView

public java.lang.String getTreeView(Content parent,
                                    Content[] children,
                                    boolean open)
                             throws ContentException
Returns the JavaScript for presenting a tree view.

Parameters:
parent - the parent content object
children - the child content objects
open - the open content object flag
Returns:
the JavaScript for presenting a tree view
Throws:
ContentException - if the database couldn't be accessed properly

getObjectView

public java.lang.String getObjectView(User user,
                                      Domain domain,
                                      java.lang.String view)
                               throws ContentException
Returns the JavaScript for presenting an object view.

Parameters:
user - the current user
domain - the domain object
view - the view name
Returns:
the JavaScript for presenting an object view
Throws:
ContentException - if the database couldn't be accessed properly

getObjectView

public java.lang.String getObjectView(User user,
                                      Content content,
                                      java.lang.String view)
                               throws ContentException
Returns the JavaScript for presenting an object view.

Parameters:
user - the current user
content - the content object
view - the view name
Returns:
the JavaScript for presenting an object view
Throws:
ContentException - if the database couldn't be accessed properly

getTemplateElements

public java.lang.String getTemplateElements(ContentTemplate template)
                                     throws ContentException
Returns the JavaScript for setting all the inherited template page elements.

Parameters:
template - the content template, or null
Returns:
the JavaScript for setting the page elements
Throws:
ContentException - if the database couldn't be accessed properly

isContainer

public boolean isContainer(Content content)
Checks if the specified content object is a container. I.e. if the content object supports having child content objects.

Parameters:
content - the content object to check
Returns:
true if the content object is a container, or false otherwise