org.melati.admin
Class AdminUtils

Package class diagram package AdminUtils
java.lang.Object
  extended by org.melati.admin.AdminUtils

public class AdminUtils
extends Object

A utility object for placing in a ServletTemplateContext.


Constructor Summary
AdminUtils(Melati melati)
          Constructor.
 
Method Summary
 String AddURL(Table table)
           
 String BottomURL(Melati melati)
           
 JSStaticTree createForest(Table table)
          Create a forest of trees.
 JSStaticTree createTree(Treeable node)
          Create a tree.
static String csvEscaped(String in)
           
 String DsdURL()
           
 String EditFrameName(Melati melati)
           
 String EditHeaderURL(Melati melati)
           
 String EditURL(Melati melati)
           
 String EditURL(Persistent object)
           
 String getHomepageURL(Melati melati)
          Check if setting in db, provide default if not, do not write default to db.
static String getPrimaryDisplayTable(Melati melati)
           
 String getScreenStylesheetURL(Melati melati)
           
 String getSetupURL()
           
 String getStaticURL()
           
 String getURL(Melati melati, String name)
           
 String getURL(Table table, String name)
           
 String MainURL(Melati melati)
           
 String MainURL(String ld)
           
 String MainURL(Table table)
           
 String MainURL(Table table, Persistent p)
           
 String NavigationURL(Table table)
           
 String PopUpURL(Table table)
           
 String PrimarySelectURL(Melati melati)
           
 String RecordURL(Melati melati)
           
 String RecordURL(Persistent object)
           
 String RecordURL(Persistent object, String returnTarget, String returnURL)
           
 String SelectionRightURL(Table table)
           
 String SelectionURL(Melati melati)
           
 String SelectionURL(Melati melati, String returnTarget)
           
 String SelectionURL(Table table)
           
 String SelectionURL(Table table, String returnTarget)
           
 String SelectionURL(Table table, String targetPane, String returnTarget)
           
 String SelectionWindowPrimarySelectURL(Table table)
           
 String SelectionWindowSelectionURL(Table table)
           
 String SelectionWindowURL(Table table)
           
 String SessionURL()
           
static String simpleName(String qualifiedName)
           
 String specialFacilities(Melati melati, MarkupLanguage ml, Persistent object)
          Render the specials directly to the output.
 String StatusURL()
           
 String TableURL(Table table)
           
 String ToggledOrderSelectionURL(Melati melati, String field, String value)
          Toggle the sort order of column.
 String TopURL(Melati melati)
           
 String TreeURL(Persistent object)
           
 String TreeURL(Table table)
           
 String UploadHandlerURL(Table table, Persistent object, String field)
          Upload URL.
 String UploadURL(Table table, Persistent object, Field field)
          In an insert situation we will not have a Troid, so cannot pass it through.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdminUtils

public AdminUtils(Melati melati)
Constructor.

Method Detail

getPrimaryDisplayTable

public static String getPrimaryDisplayTable(Melati melati)
Returns:
the name of the default table to display

getScreenStylesheetURL

public String getScreenStylesheetURL(Melati melati)
Parameters:
melati - to get db from
Returns:
the stylesheet for screen media

getSetupURL

public String getSetupURL()
Returns:
the settings table setup url

getHomepageURL

public String getHomepageURL(Melati melati)
Check if setting in db, provide default if not, do not write default to db.

Parameters:
melati - to get db from
Returns:
the homepage URL for this databse

getURL

public String getURL(Melati melati,
                     String name)
Parameters:
melati - the melati
name - of template
Returns:
name prepended with ldb, table and troid if not null

getURL

public String getURL(Table table,
                     String name)
Returns:
name prepended with ldb and table name

MainURL

public String MainURL(String ld)
Returns:
The Main URL.

MainURL

public String MainURL(Melati melati)
Returns:
The Main URL.

MainURL

public String MainURL(Table table)
Returns:
The Main URL after deletion of a tableinfo

MainURL

public String MainURL(Table table,
                      Persistent p)
Returns:
The Main URL after creation of a tableinfo

TopURL

public String TopURL(Melati melati)
Returns:
The Top URL.

BottomURL

public String BottomURL(Melati melati)
Returns:
The Bottom URL.

TableURL

public String TableURL(Table table)
Returns:
The Left URL.

RecordURL

public String RecordURL(Persistent object)
                 throws AccessPoemException
Returns:
The Right URL.
Throws:
AccessPoemException

RecordURL

public String RecordURL(Persistent object,
                        String returnTarget,
                        String returnURL)
                 throws AccessPoemException
Returns:
The Right URL.
Throws:
AccessPoemException

RecordURL

public String RecordURL(Melati melati)
                 throws AccessPoemException
Returns:
The Right URL.
Throws:
AccessPoemException

PrimarySelectURL

public String PrimarySelectURL(Melati melati)
Returns:
The Primary Select URL.

SelectionURL

public String SelectionURL(Table table)
Returns:
The Selection URL.

SelectionURL

public String SelectionURL(Table table,
                           String returnTarget)
Returns:
The Selection URL.

SelectionURL

public String SelectionURL(Table table,
                           String targetPane,
                           String returnTarget)
Parameters:
table -
targetPane -
returnTarget -
Returns:
the url

ToggledOrderSelectionURL

public String ToggledOrderSelectionURL(Melati melati,
                                       String field,
                                       String value)
Toggle the sort order of column.

Returns:
the same url with the toggle field added or removed

SelectionURL

public String SelectionURL(Melati melati)
Parameters:
melati -
Returns:
The Selection URL.

SelectionURL

public String SelectionURL(Melati melati,
                           String returnTarget)
Returns:
The Selection URL.

SelectionRightURL

public String SelectionRightURL(Table table)
Returns:
The Selection Right URL.

NavigationURL

public String NavigationURL(Table table)
Returns:
The Navigation URL.

EditHeaderURL

public String EditHeaderURL(Melati melati)
                     throws AccessPoemException
Returns:
The Edit Header URL.
Throws:
AccessPoemException

EditURL

public String EditURL(Melati melati)
               throws AccessPoemException
Returns:
The Edit URL.
Throws:
AccessPoemException

EditURL

public String EditURL(Persistent object)
               throws AccessPoemException
Returns:
The Edit URL.
Throws:
AccessPoemException

EditFrameName

public String EditFrameName(Melati melati)
Parameters:
melati -
Returns:
the name of the Record Fields frame

TreeURL

public String TreeURL(Persistent object)
               throws AccessPoemException
Returns:
The Tree URL.
Throws:
AccessPoemException

TreeURL

public String TreeURL(Table table)
               throws AccessPoemException
Returns:
The Tree URL.
Throws:
AccessPoemException

AddURL

public String AddURL(Table table)
              throws AccessPoemException
Returns:
The Add URL.
Throws:
AccessPoemException

PopUpURL

public String PopUpURL(Table table)
Returns:
The Popup URL.

SelectionWindowURL

public String SelectionWindowURL(Table table)
Returns:
The Selection Window URL.

SelectionWindowPrimarySelectURL

public String SelectionWindowPrimarySelectURL(Table table)
Returns:
The Selection Window Primary Select URL.

SelectionWindowSelectionURL

public String SelectionWindowSelectionURL(Table table)
Returns:
The Selection Window Selection URL.

StatusURL

public String StatusURL()
Returns:
The Status URL.

SessionURL

public String SessionURL()
Returns:
The Session Analysis URL.

DsdURL

public String DsdURL()
Returns:
The URL for DSD generation.

UploadURL

public String UploadURL(Table table,
                        Persistent object,
                        Field field)
In an insert situation we will not have a Troid, so cannot pass it through. If your upload handler depends on having a persistent, then you should override your upload template so that it prevents uploading in an insert situation.

Parameters:
table - table object belongs to
object - the Persistent we are dealing with
field - the upload field
Returns:
Upload Url

UploadHandlerURL

public String UploadHandlerURL(Table table,
                               Persistent object,
                               String field)
Upload URL.

Parameters:
table - table object belongs to
object - the Persistent we are dealing with
field - the upload field
Returns:
Upload done URL

specialFacilities

public String specialFacilities(Melati melati,
                                MarkupLanguage ml,
                                Persistent object)
                         throws Exception
Render the specials directly to the output.

Parameters:
melati - the Melati
ml - The MarkupLanguage we are using
object - a Persistent to render the specials of
Returns:
an empty String
Throws:
Exception - maybe

getStaticURL

public String getStaticURL()
Returns:
Defaults to /MelatiStatic/admin

createTree

public JSStaticTree createTree(Treeable node)
Create a tree.

Parameters:
node - a tree node
Returns:
a tree with node as its root

createForest

public JSStaticTree createForest(Table table)
Create a forest of trees.

Parameters:
table - the table to tree
Returns:
a tree with node as its root

simpleName

public static String simpleName(String qualifiedName)
Parameters:
qualifiedName -
Returns:
text following the last dot

csvEscaped

public static String csvEscaped(String in)
Parameters:
in - the String to escape
Returns:
the escaped String


Copyright © 2000-2010 PanEris. All Rights Reserved.