com.waveset.ui
Class EditForm

java.lang.Object
  extended bycom.waveset.ui.EditForm
Direct Known Subclasses:
SearchFormBase

public abstract class EditForm
extends java.lang.Object

A bean providing a generic representation for a complex editing form.

This class defines the "widgets" support within the form, it is expected to be subclassed and given implementations of two methods: generate() for building the form's contents, and process() for handling the forms submitted data.

You only need to implement process() if you intend to post the form data to another page that will use the same EditForm class for processing. This is however recommended, as you keep the knowledge of the semantics of the post data in the same class that generated the form.


Nested Class Summary
static class EditForm.ActionAppletMultiSelect
           
static class EditForm.ActionCheckbox
           
static class EditForm.ActionLeftCheckbox
           
static class EditForm.ActionRadio
           
static class EditForm.ActionSelect
          A class describing the contents of a <select> element that will take an action when an item is selected.
static class EditForm.AppletMultiSelect
          A class describing a collection of HTML elements that provide a multi-select widget with a box on the left containing available items, a box on the right containing the selected items, and some buttons down the middle to control movment of items between the boxes.
static class EditForm.Button
           
static class EditForm.Checkbox
          A class describing a single checkbox element.
static class EditForm.CheckboxArray
          A class that builds a checkbox array with row and column labels.
static class EditForm.CheckboxTree
           
static class EditForm.DatePicker
          DatePicker.
static class EditForm.DateRange
          A class that builds a date range of the form: title from to Includes various helpers to get the initial date set and the form data back into a date.
static class EditForm.FileUpload
           
static class EditForm.FormTable
          A class that builds a table with rows of items
static class EditForm.HelpRef
          A base class for all of the various editing items that can appear in a form.
static class EditForm.Hidden
          A class describing a chunk of hidden data.
static class EditForm.HTMLItem
          A wrapper class to embed anything that generates its own html into a form (used for buttons in the user find form currently)
static class EditForm.Item
           
static class EditForm.Label
          An item that is rendered as a non-editable label.
static class EditForm.LeftCheckbox
          A class describing a single checkbox element with the title on the left.
static class EditForm.ListResult
           
static class EditForm.MultiSelectPicker
          MultiSelectPicker.
static class EditForm.PlainText
          This class is a shortcut to get text in columns 2 and 3 of an EditForm It is just like a label except there is no title and the value spans both the title and value columns
static class EditForm.Radio
          A class describing a set of elements.
static class EditForm.SectionHead
          In a form, this will be a section header.
static class EditForm.Select
          A class describing the contents of a <select> element.
static class EditForm.StringComparator
          Internal class that implenents the Comparator interface for sorting the rows in the table.
static class EditForm.Text
          A class describing the contents of an element.
static class EditForm.TextArea
          A class describing the contents of an <textarea> element.
 
Field Summary
protected static Catalog _mc
           
static java.lang.String code_id
           
static java.lang.String DEFAULT_OBJECT_ATTRIBUTE
          The HttpSession attribute name under which we store the object state.
static java.lang.String REQD_FIELD
           
protected static Trace trace
           
 
Constructor Summary
EditForm()
           
 
Method Summary
 PersistentObject createEditObject(javax.servlet.http.HttpSession hs, javax.servlet.ServletRequest req, Session ws, Type type)
          Obtain an object for use in generating the form.
abstract  void generate(javax.servlet.http.HttpSession httpSession, javax.servlet.http.HttpServletRequest req, Session wavesetSession)
          Form generation method.
static java.util.List generateRefs(Session s, java.lang.String[] names, Type type)
           
static java.lang.String genOptions(java.util.ArrayList list, boolean selected)
           
 java.lang.String getActiveControl()
           
 int getAdjacentTitleWidth()
          Gets the width of the adjacent title columns.
static java.lang.String[] getAdministrators(Session s, boolean addCurrentAdmin)
          Return a string array of Administrator names
 java.lang.String[] getAdminRoles(Session s)
          Build a list of the names of Admin Roles available
 java.lang.String[] getApplications(Session s)
          Build a list of the names of services (e.g.
static java.lang.String[] getApproverAdmins(Session s)
          Return a list of Administrator object names that can serve as approvers for an object.
static java.util.ArrayList getAssignedApprovers(Session s, java.util.List admins)
          Turn an arraylist of admin refs into an arraylist of strings - the names of the admins.
 java.lang.String getButtonCommand(int b)
          Return the form command when this button is selected.
 int getButtonCount()
          Return the number of buttons.
 java.lang.String getButtonHtml(int b, int tabindex, Session session)
           
 java.lang.String getButtonHtml(int b, Session session)
          Returns the HTML representation of a button.
 java.lang.String getButtonName(int b)
          Return the display name of a button.
 java.lang.String getButtonValue(int b)
          Return the form value when this button is selected.
 java.lang.String getCancelURL()
          Get the cancel URL for the form.
 java.lang.String[] getCapabilities(Session s)
          Build a list of the names of Capabilities available
 EditForm.ListResult getDefinitionNames(Session s)
          Get the available task definitions.
 PersistentObject getEditObject(javax.servlet.http.HttpSession hs, Session ws, Type type)
          Obtain an object for use in processing the form.
 java.lang.String getError()
          Get the form error message.
 java.lang.Throwable getException()
           
 java.lang.String getFocussedFieldName()
           
 java.lang.String getImageDir()
          Get the image directory.
 java.util.ArrayList getIndentedOrgList(Session s)
           
 java.lang.String getItemHelpHTML(EditForm.Item i, javax.servlet.http.HttpServletRequest req)
           
 java.lang.String getItemHelpHTML(java.lang.String title, javax.servlet.http.HttpServletRequest req, Session session)
          Get the HTML for an item level help, guessing at the help reference from the label string.
 java.lang.String getItemHelpPreHTML(java.lang.String itemName, javax.servlet.http.HttpServletRequest req, Session session)
          This returns all of the help item tag info, but does not put in the space and title.
 java.util.ArrayList getItems()
          Get the item list.
 java.lang.String getMessage()
          Get the optional information message.
 java.lang.String getNameParameter()
          Get the parameter name where we can find the name of the object to be edited.
 java.lang.String getObjectAttribute()
          Get the parameter name where we are to store the serialized object.
static java.util.List getOrganizations(Session s)
          Build a list of the names of organizations that may be assigned to the user.
 PageInformation getPageInformation()
          Get the PageInformation object for this page
 java.lang.String getParameter(javax.servlet.ServletRequest r, java.lang.String name)
          Return the value of a parameter, converting empty strings to null.
 java.lang.String getParentId(javax.servlet.ServletRequest req, Session session)
          Get the parent ID.
 java.lang.String getParentIdPath(javax.servlet.ServletRequest req, Session session)
          getParentIdPath gets the parent id from getParentId, then turns that into a path by getting the object and calling getPath.
static java.lang.String[] getPolicies(Session s, java.lang.String type)
          Return a string array of policy names of the specified type.
static java.lang.String[] getPolicies(Session s, java.lang.String type, java.lang.String currentPolicy)
          Special call to get the policies and if the current policy is not on the list, add it to the list.
 java.lang.String getPostURL()
          Get the post URL for the form.
static java.lang.String[] getRefNames(Session s, java.util.List refs)
           
static java.lang.String[] getRefNames(Session s, ObjectRef[] refs)
           
static java.util.List getResourceAccountAttributeNames(Resource res)
          Return a list of account attribute names in this resources schema map
 java.lang.String[] getResources(Session s)
          Build a list of the names of resources that may be assigned to the user.
static java.lang.String[] getResources(Session s, Attribute matchType, java.lang.String value)
          Build a list of the names of resources that match a particular type (like LDAP).
static java.util.Map getResourcesAndTypes(Session s)
          Return a map whose key is the resource name and whose value is the type of resource.
 java.lang.String[] getRoles(Session s)
          Build a list of the names of roles that may be assigned to the user.
static java.lang.String[] getRules(Session s, java.lang.String subtype)
          Return a string array of rule names of the specified subtype.
static java.lang.String[] getRules(Session s, java.lang.String subtype, java.lang.String currentRule)
          Special call to get the rules and if the current rule is not on the list, add it to the list.
 java.lang.String getSubTitle()
           
 java.lang.String getTitle()
          Get the title for the form.
 int getTitleWidth()
          Gets the width of the title column.
 ObjectGroup[] getTopmostOrganizations(Session s)
           
 java.lang.String getType()
          Gets the type of this form.
static java.lang.String[] getUserForms(Session s)
          Build a list of the names of user forms that may be assigned to orgs, admins, or users.
protected  java.util.Hashtable parseMultiPartFormData(javax.servlet.ServletRequest req)
          The meat of the request processing.
abstract  java.lang.String process(javax.servlet.http.HttpSession httpSession, javax.servlet.http.HttpServletRequest req, Session wavesetSession)
          Form processing method.
 void releaseEditObject(javax.servlet.http.HttpSession hs, Session ws)
          Release the object being edited.
 java.lang.String resolveHelpRef(EditForm.HelpRef h, javax.servlet.http.HttpServletRequest req)
           
 void saveAsOrRenameEditObject(javax.servlet.http.HttpSession httpsession, Session session, java.lang.String command, PersistentObject obj, java.lang.String newname)
          Process the edit object according to a given command.
 void saveEditObject(javax.servlet.http.HttpSession httpsession, Session session, java.lang.String command, PersistentObject obj)
          Process the edit object according to a given command.
 void setActiveControl(java.lang.String what)
           
 void setAdjacentTitleWidth(int w)
          Sets the width of the adjacent title columns.
 void setButtons(java.util.ArrayList buttons)
          Sets the button list.
 void setButtons(EditForm.Button[] buttons)
          Set the buttons.
 void setCancelURL(java.lang.String url)
          Set the URL that we will POST to when the generated form is canceled.
 void setError(java.lang.String msg)
          Set the error message.
 void setException(java.lang.Throwable th)
          Set an optional exception (so that the stack trace can be put in the page)
 void setFocussedFieldName(java.lang.String name)
           
 void setImageDir(java.lang.String dir)
          Set the image directory.
static void setInitialMemberObjectGroups(Session ws, PersistentObject obj, boolean allowMultipleOrgs)
          If the object has one member object group and it is Top, set it to the top organization (or organizations if allowMultipleOrgs is true) that the current administrator can control.
 void setItems(java.util.ArrayList items)
          Sets the item list.
 void setMessage(java.lang.String msg)
          Set the optional information message.
 void setNameParameter(java.lang.String name)
          Set the parameter name where we can find the name of the object to be edited.
 void setObjectAttribute(java.lang.String name)
          Set the parameter name where we are to store the serialized object.
 void setPageInformation(PageInformation pi)
          Set the PageInformation object for this page
 void setPostURL(java.lang.String url)
          Set the URL that we will POST to when the generated form is submitted.
 void setSubTitle(java.lang.String subTitle)
           
 void setTitle(java.lang.String title)
          Set the title for the form.
 void setTitleWidth(int w)
          Sets the width of the title column.
 void setType(java.lang.String type)
          Sets the type of this form.
static PersistentObject staticCreateEditObject(javax.servlet.http.HttpSession hs, javax.servlet.ServletRequest req, Session ws, Type type, java.lang.String attname, java.lang.String parmname)
           
static PersistentObject staticGetEditObject(javax.servlet.http.HttpSession hs, Session ws, Type type, java.lang.String attname)
           
static void staticReleaseEditObject(javax.servlet.http.HttpSession hs, Session ws, java.lang.String attname)
           
static void staticSaveEditObject(javax.servlet.http.HttpSession httpsession, Session session, java.lang.String command, PersistentObject obj, java.lang.String attname)
           
static void staticUpdateEditObject(javax.servlet.http.HttpSession httpsession, Session session, java.lang.String command, PersistentObject obj, java.lang.String attname)
           
 void updateEditObject(javax.servlet.http.HttpSession httpsession, Session session, java.lang.String command, PersistentObject obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

REQD_FIELD

public static final java.lang.String REQD_FIELD
See Also:
Constant Field Values

trace

protected static final Trace trace

_mc

protected static Catalog _mc

DEFAULT_OBJECT_ATTRIBUTE

public static final java.lang.String DEFAULT_OBJECT_ATTRIBUTE
The HttpSession attribute name under which we store the object state.

This will be initialized by the form object when it is used for the first time. Once set, all edits will be performed on this object, and the _nameParameter is ignored.

The default is usually ok, you might want to override it in the subclass just in case you need to two edits going on at the same time.

See Also:
Constant Field Values
Constructor Detail

EditForm

public EditForm()
Method Detail

getType

public java.lang.String getType()
Gets the type of this form.


getTitle

public java.lang.String getTitle()
Get the title for the form.


getPostURL

public java.lang.String getPostURL()
Get the post URL for the form.


getCancelURL

public java.lang.String getCancelURL()
Get the cancel URL for the form.


getItems

public java.util.ArrayList getItems()
Get the item list.


getImageDir

public java.lang.String getImageDir()
Get the image directory. We will default to "images" if nothing is specified.


setImageDir

public void setImageDir(java.lang.String dir)
Set the image directory.


getObjectAttribute

public java.lang.String getObjectAttribute()
Get the parameter name where we are to store the serialized object.


getNameParameter

public java.lang.String getNameParameter()
Get the parameter name where we can find the name of the object to be edited.


getError

public java.lang.String getError()
Get the form error message.


getMessage

public java.lang.String getMessage()
Get the optional information message.


getSubTitle

public java.lang.String getSubTitle()

getFocussedFieldName

public java.lang.String getFocussedFieldName()

setFocussedFieldName

public void setFocussedFieldName(java.lang.String name)

setActiveControl

public void setActiveControl(java.lang.String what)

getActiveControl

public java.lang.String getActiveControl()

getButtonCount

public int getButtonCount()
Return the number of buttons.


getButtonName

public java.lang.String getButtonName(int b)
Return the display name of a button.


getButtonValue

public java.lang.String getButtonValue(int b)
Return the form value when this button is selected.


getButtonCommand

public java.lang.String getButtonCommand(int b)
Return the form command when this button is selected.


getButtonHtml

public java.lang.String getButtonHtml(int b,
                                      Session session)
Returns the HTML representation of a button. If the button class implements the toHTML method, then it will be used to generate the HTML. Otherwise a generic button of the form will be generated.


getButtonHtml

public java.lang.String getButtonHtml(int b,
                                      int tabindex,
                                      Session session)
Parameters:
b - - the index of the button in the form's _buttons array.
tabindex - - the tabindex value of the button.
Returns:
the HTML representation of a button. If the button class implements the toHTML method, then it will be used to generate the HTML. Otherwise a generic button of the form will be generated.

getItemHelpHTML

public java.lang.String getItemHelpHTML(EditForm.Item i,
                                        javax.servlet.http.HttpServletRequest req)
                                 throws java.io.IOException,
                                        WavesetException
Throws:
java.io.IOException
WavesetException

getItemHelpHTML

public java.lang.String getItemHelpHTML(java.lang.String title,
                                        javax.servlet.http.HttpServletRequest req,
                                        Session session)
                                 throws java.io.IOException,
                                        WavesetException
Get the HTML for an item level help, guessing at the help reference from the label string. This returns the tag starting HTML, with the help string and the label string embedded in it. It includes the end tag. The HTML string is expected to go in the middle of a item. It can also be wrapped in a tag pair. If no help text is found, the label is returned unchanged.

Throws:
java.io.IOException
WavesetException

getItemHelpPreHTML

public java.lang.String getItemHelpPreHTML(java.lang.String itemName,
                                           javax.servlet.http.HttpServletRequest req,
                                           Session session)
                                    throws java.io.IOException,
                                           WavesetException
This returns all of the help item tag info, but does not put in the space and title. Used for things that want help, but not the title (e.g., left checkbox and multiselects).

Throws:
java.io.IOException
WavesetException

resolveHelpRef

public java.lang.String resolveHelpRef(EditForm.HelpRef h,
                                       javax.servlet.http.HttpServletRequest req)
                                throws java.io.IOException,
                                       WavesetException
Throws:
java.io.IOException
WavesetException

getPageInformation

public PageInformation getPageInformation()
Get the PageInformation object for this page


setType

public void setType(java.lang.String type)
Sets the type of this form.

Kludge, normally you would subclass EditForm and provide your own generate() method, but we'll wire in a few test forms here.


setPostURL

public void setPostURL(java.lang.String url)
Set the URL that we will POST to when the generated form is submitted. The URL is expected to have already been processed with encodeURL() if necessary.


setCancelURL

public void setCancelURL(java.lang.String url)
Set the URL that we will POST to when the generated form is canceled. The URL is expected to have already been processed with encodeURL() if necessary.


setTitle

public void setTitle(java.lang.String title)
Set the title for the form.


setItems

public void setItems(java.util.ArrayList items)
Sets the item list. Normally called only by the subclass.


setButtons

public void setButtons(java.util.ArrayList buttons)
Sets the button list. Normally called only by the subclass.


setButtons

public void setButtons(EditForm.Button[] buttons)
Set the buttons.

Normally only called by subclasses.


getTitleWidth

public int getTitleWidth()
Gets the width of the title column.


setTitleWidth

public void setTitleWidth(int w)
Sets the width of the title column.

Setting this to zero will make the column auto-size.


getAdjacentTitleWidth

public int getAdjacentTitleWidth()
Gets the width of the adjacent title columns.


setAdjacentTitleWidth

public void setAdjacentTitleWidth(int w)
Sets the width of the adjacent title columns.

Setting this to zero will make the adjacent title columns auto-size.


setObjectAttribute

public void setObjectAttribute(java.lang.String name)
Set the parameter name where we are to store the serialized object.


setNameParameter

public void setNameParameter(java.lang.String name)
Set the parameter name where we can find the name of the object to be edited.


setError

public void setError(java.lang.String msg)
Set the error message.


setMessage

public void setMessage(java.lang.String msg)
Set the optional information message.


setException

public void setException(java.lang.Throwable th)
Set an optional exception (so that the stack trace can be put in the page)


getException

public java.lang.Throwable getException()

setSubTitle

public void setSubTitle(java.lang.String subTitle)

setPageInformation

public void setPageInformation(PageInformation pi)
Set the PageInformation object for this page


generate

public abstract void generate(javax.servlet.http.HttpSession httpSession,
                              javax.servlet.http.HttpServletRequest req,
                              Session wavesetSession)
                       throws WavesetException
Form generation method.

Throws:
WavesetException

process

public abstract java.lang.String process(javax.servlet.http.HttpSession httpSession,
                                         javax.servlet.http.HttpServletRequest req,
                                         Session wavesetSession)
                                  throws WavesetException
Form processing method.

The method may return a string, which is treated as a URL fragment for the next page. The calling jsp is expected to obey this.

Throws:
WavesetException

createEditObject

public PersistentObject createEditObject(javax.servlet.http.HttpSession hs,
                                         javax.servlet.ServletRequest req,
                                         Session ws,
                                         Type type)
                                  throws WavesetException
Obtain an object for use in generating the form.

We will first for an object on the session, created by a previous pass through this form. If we don't find one, we'll look for a parameter specifing the name of an object, and store this object in the session. If we don't have an object or a name, we consider it an object creation case and start with an empty object.

Throws:
WavesetException

setInitialMemberObjectGroups

public static void setInitialMemberObjectGroups(Session ws,
                                                PersistentObject obj,
                                                boolean allowMultipleOrgs)
                                         throws WavesetException
If the object has one member object group and it is Top, set it to the top organization (or organizations if allowMultipleOrgs is true) that the current administrator can control. See the comment as to why this only takes action if there is one org and it is Top.

Throws:
WavesetException

staticCreateEditObject

public static PersistentObject staticCreateEditObject(javax.servlet.http.HttpSession hs,
                                                      javax.servlet.ServletRequest req,
                                                      Session ws,
                                                      Type type,
                                                      java.lang.String attname,
                                                      java.lang.String parmname)
                                               throws WavesetException
Throws:
WavesetException

getEditObject

public PersistentObject getEditObject(javax.servlet.http.HttpSession hs,
                                      Session ws,
                                      Type type)
                               throws WavesetException
Obtain an object for use in processing the form.

The object is expected to exist in the session. Not throwing if it isn't, but that may make sense.

We pass in the waveset session here too, so we can point the object's cache at the session cache. This is almost always what you want, so automatic reference resolution can happen.

Throws:
WavesetException

staticGetEditObject

public static PersistentObject staticGetEditObject(javax.servlet.http.HttpSession hs,
                                                   Session ws,
                                                   Type type,
                                                   java.lang.String attname)
                                            throws WavesetException
Throws:
WavesetException

releaseEditObject

public void releaseEditObject(javax.servlet.http.HttpSession hs,
                              Session ws)
Release the object being edited.

Called to process a "cancel" button on a form, might be called for other cleanup too.


staticReleaseEditObject

public static void staticReleaseEditObject(javax.servlet.http.HttpSession hs,
                                           Session ws,
                                           java.lang.String attname)

updateEditObject

public void updateEditObject(javax.servlet.http.HttpSession httpsession,
                             Session session,
                             java.lang.String command,
                             PersistentObject obj)

staticUpdateEditObject

public static void staticUpdateEditObject(javax.servlet.http.HttpSession httpsession,
                                          Session session,
                                          java.lang.String command,
                                          PersistentObject obj,
                                          java.lang.String attname)

saveEditObject

public void saveEditObject(javax.servlet.http.HttpSession httpsession,
                           Session session,
                           java.lang.String command,
                           PersistentObject obj)
                    throws WavesetException
Process the edit object according to a given command. Typically forms will have command buttons that post paramters named "cancel" and "commit".

If we see "commit", we'll create or checkin the object and remove it from the session.

If we see cancel, we'll unlock it and remove it from the session.

Anything else is considered to be some other transition event, and we store the new contents of the object.

Throws:
WavesetException

staticSaveEditObject

public static void staticSaveEditObject(javax.servlet.http.HttpSession httpsession,
                                        Session session,
                                        java.lang.String command,
                                        PersistentObject obj,
                                        java.lang.String attname)
                                 throws WavesetException
Throws:
WavesetException

saveAsOrRenameEditObject

public void saveAsOrRenameEditObject(javax.servlet.http.HttpSession httpsession,
                                     Session session,
                                     java.lang.String command,
                                     PersistentObject obj,
                                     java.lang.String newname)
                              throws WavesetException
Process the edit object according to a given command. This just handles the rename and saveas commands

Throws:
WavesetException

genOptions

public static java.lang.String genOptions(java.util.ArrayList list,
                                          boolean selected)

getParameter

public java.lang.String getParameter(javax.servlet.ServletRequest r,
                                     java.lang.String name)
Return the value of a parameter, converting empty strings to null.

This is the same as Table.getParameter() and should be moved to some common place.


getTopmostOrganizations

public ObjectGroup[] getTopmostOrganizations(Session s)
                                      throws WavesetException
Throws:
WavesetException

getIndentedOrgList

public java.util.ArrayList getIndentedOrgList(Session s)
                                       throws WavesetException
Throws:
WavesetException

getPolicies

public static java.lang.String[] getPolicies(Session s,
                                             java.lang.String type)
                                      throws WavesetException
Return a string array of policy names of the specified type. If type is null, return all policy names

Throws:
WavesetException

getAdministrators

public static java.lang.String[] getAdministrators(Session s,
                                                   boolean addCurrentAdmin)
                                            throws WavesetException
Return a string array of Administrator names

Throws:
WavesetException

getPolicies

public static java.lang.String[] getPolicies(Session s,
                                             java.lang.String type,
                                             java.lang.String currentPolicy)
                                      throws WavesetException
Special call to get the policies and if the current policy is not on the list, add it to the list. This is for the case of a resource administrator who does not have access to the policy referred to by the current resource.

Throws:
WavesetException

getRules

public static java.lang.String[] getRules(Session s,
                                          java.lang.String subtype)
                                   throws WavesetException
Return a string array of rule names of the specified subtype. If subtype is null, return all rule names.

Throws:
WavesetException

getRules

public static java.lang.String[] getRules(Session s,
                                          java.lang.String subtype,
                                          java.lang.String currentRule)
                                   throws WavesetException
Special call to get the rules and if the current rule is not on the list, add it to the list. This is for the case of a resource administrator who does not have access to the rule referred to by the current resource.

Throws:
WavesetException

getOrganizations

public static java.util.List getOrganizations(Session s)
                                       throws WavesetException
Build a list of the names of organizations that may be assigned to the user. This is determined by the roles the currently administrator has access to. We need to sort the name/value pairs since traditionally we displayed this in displayName order.

Throws:
WavesetException

getCapabilities

public java.lang.String[] getCapabilities(Session s)
                                   throws WavesetException
Build a list of the names of Capabilities available

Throws:
WavesetException

getAdminRoles

public java.lang.String[] getAdminRoles(Session s)
                                 throws WavesetException
Build a list of the names of Admin Roles available

Throws:
WavesetException

getDefinitionNames

public EditForm.ListResult getDefinitionNames(Session s)
                                       throws WavesetException
Get the available task definitions.

Returns:
Map key is name, value is id
Throws:
WavesetException

getRoles

public java.lang.String[] getRoles(Session s)
                            throws WavesetException
Build a list of the names of roles that may be assigned to the user. This is determined by the roles the currently administrator has access to.

Throws:
WavesetException

getApplications

public java.lang.String[] getApplications(Session s)
                                   throws WavesetException
Build a list of the names of services (e.g. resources and applications) that may be assigned to the user.

Throws:
WavesetException

getResources

public java.lang.String[] getResources(Session s)
                                throws WavesetException
Build a list of the names of resources that may be assigned to the user. This is determined by the roles the currently administrator has access to.

Throws:
WavesetException

getUserForms

public static java.lang.String[] getUserForms(Session s)
                                       throws WavesetException
Build a list of the names of user forms that may be assigned to orgs, admins, or users.

Throws:
WavesetException

getResources

public static java.lang.String[] getResources(Session s,
                                              Attribute matchType,
                                              java.lang.String value)
                                       throws WavesetException
Build a list of the names of resources that match a particular type (like LDAP).

Throws:
WavesetException

getResourcesAndTypes

public static java.util.Map getResourcesAndTypes(Session s)
                                          throws WavesetException
Return a map whose key is the resource name and whose value is the type of resource. The type string is the internal resource type name. Use ResourceManager.getTypeDisplayString() to get the display name for a given type.

Throws:
WavesetException

getResourceAccountAttributeNames

public static java.util.List getResourceAccountAttributeNames(Resource res)
                                                       throws WavesetException
Return a list of account attribute names in this resources schema map

Throws:
WavesetException

getApproverAdmins

public static java.lang.String[] getApproverAdmins(Session s)
                                            throws WavesetException
Return a list of Administrator object names that can serve as approvers for an object.

Throws:
WavesetException

getAssignedApprovers

public static java.util.ArrayList getAssignedApprovers(Session s,
                                                       java.util.List admins)
Turn an arraylist of admin refs into an arraylist of strings - the names of the admins. While we are at it, chase the refs to update the names. Always return an ArrayList, it will have zero size if something was null.


generateRefs

public static java.util.List generateRefs(Session s,
                                          java.lang.String[] names,
                                          Type type)

getRefNames

public static java.lang.String[] getRefNames(Session s,
                                             java.util.List refs)

getRefNames

public static java.lang.String[] getRefNames(Session s,
                                             ObjectRef[] refs)

getParentId

public java.lang.String getParentId(javax.servlet.ServletRequest req,
                                    Session session)
                             throws WavesetException
Get the parent ID. Handle two major cases, the "old" style ui where the parent id is passed in (or null), and the "new" style where there is a type and id of an object and we figure out what the parent should be. New style commands look like: pageContext.forward("admincreate.jsp?type="+type+"&id="+ids+"&NewMenu=NewMenu"); They can either refer to an object (administrator, user) or an object group. if it is an admin, we get the "parent" so that the newly created object can be a "peer"

Throws:
WavesetException

getParentIdPath

public java.lang.String getParentIdPath(javax.servlet.ServletRequest req,
                                        Session session)
                                 throws WavesetException
getParentIdPath gets the parent id from getParentId, then turns that into a path by getting the object and calling getPath.

Throws:
WavesetException

parseMultiPartFormData

protected java.util.Hashtable parseMultiPartFormData(javax.servlet.ServletRequest req)
                                              throws java.io.IOException,
                                                     WavesetException
The meat of the request processing. This method parses the input, and returns a hashtable of either String[] values (for parameters) or Hashtable values (for files uploaded). The values of the entries in the hashtable are name, filename, Content-Type, and Contents. Note that uploads should be capped in size by the calling method, since otherwise a denial of service attack on server memory becomes trivial. NOTE this function is not aware of text encodings and will probably fail in non-English environments. NOTE this function does not handle nested boundary strings such as those described for "multipart/mixed" content in the HTML 4.01 Specification. Therefore, it will not handle a file select control from which multiple files have been selected.

Throws:
java.io.IOException
WavesetException