com.waveset.ui
Class SearchTableBase

java.lang.Object
  extended bycom.waveset.ui.Table
      extended bycom.waveset.ui.SearchTableBase

public class SearchTableBase
extends Table

An implementation of the Table class that does a repository search and displays the results. The constraints for the search are posted to this page and the results of that search are displayed.


Nested Class Summary
 
Nested classes inherited from class com.waveset.ui.Table
Table.ActionButton, Table.AppletCell, Table.Button, Table.Cell, Table.ColorTextCell, Table.Column, Table.CompoundCell, Table.DateCell, Table.GridCell, Table.GridSpanCell, Table.IconCell, Table.JavascriptButton, Table.JavascriptSelectButton, Table.LinkCell, Table.Row, Table.SelectButton, Table.SubmitCommandButton, Table.SubmitSelectButton, Table.TextCell
 
Field Summary
 int _resultLimit
          These can be used to control the maximum number of rows returned.
static java.lang.String code_id
           
static java.lang.String SIMPLE
           
 
Fields inherited from class com.waveset.ui.Table
_columns, _descendingSort, _headerLinks, _mc, _rows, _sortColumn, trace
 
Constructor Summary
SearchTableBase()
           
 
Method Summary
protected  java.lang.String appendCondition(Session s, java.lang.String fullDescription, java.lang.String currentDescription)
           
 java.lang.String buildAdminRoleSearchAttributes(Session s, java.util.ArrayList conditions, javax.servlet.ServletRequest req)
          Build conditions matching the named edit field & criteria.
 java.lang.String buildApplicationSearchAttributes(Session s, java.util.List conditions, javax.servlet.ServletRequest req)
          Build conditions matching the Application (aka Resource Group).
 java.lang.String buildApproverSearchAttributes(Session s, java.util.List conditions, javax.servlet.ServletRequest req)
          Build conditions matching the named edit field & criteria.
 java.lang.String buildCapabilitySearchAttributes(Session s, java.util.List conditions, javax.servlet.ServletRequest req)
          Build conditions matching the named edit field & criteria.
static RepositoryResult buildConstrainedObjectList(Type type, java.util.List orTogetherConditions, java.util.List containedOrgs, AttributeCondition[] inConds, Session s, int limit)
          Return an RepositoryResult of all of the objects in an organization.
 java.lang.String buildControlledOrganizationSearchAttributes(Session s, java.util.ArrayList conditions, javax.servlet.ServletRequest req)
          Build conditions matching the named edit field & criteria.
 java.lang.String buildNameSearchAttributes(java.util.List conditions, javax.servlet.ServletRequest req, Session s)
          Build conditions matching the named edit field & criteria.
 void buildOrganizationOrgList(javax.servlet.ServletRequest req, Session s, java.util.List names)
          Return a list of the object groups that are a part of this request.
 java.lang.String buildResourceSearchAttributes(Session s, java.util.List conditions, javax.servlet.ServletRequest req)
          Build conditions matching the named edit field & criteria.
 void generate(javax.servlet.http.HttpSession hs, javax.servlet.ServletRequest req, Session s, javax.servlet.http.HttpServletResponse response)
          We can ignore the type, we have only one table to generate.
 int getResultLimit()
           
 void getSearchParamsFromRequest(javax.servlet.ServletRequest req, Session s, java.lang.StringBuffer urlParams, java.lang.StringBuffer searchDescription, java.util.List conditions, java.util.List orgsInOrg, java.util.List controlledOrgConditions)
           
 java.lang.String listAvailableOrganizationSearchAttributes(Session s, java.util.List orgsInOrg, javax.servlet.ServletRequest req)
          Build a list of conditions matching the named edit field & criteria.
 java.lang.String listControlledOrganizationSearchAttributes(Session s, java.util.List conditions, javax.servlet.ServletRequest req)
          Build a list of conditions matching the named edit field & criteria.
 void SearchTableBase()
          All the interesting constrution happens after setting property values and calling the generate() method.
 void setResultLimit(int resultLimit)
           
 void sort()
          Called by generate() after building up a _rows matrix.
 
Methods inherited from class com.waveset.ui.Table
addMessageParams, addParameter, encodeURLParameter, getAppletHTML, getButtonCount, getButtonHtml, getButtonHtml, getButtonName, getButtonValue, getCellHtml, getColumnCount, getColumnIndex, getColumnIsWrap, getColumnLabel, getColumnName, getColumnNameNoColon, getError, getHiddenFormData, getLinkColumn, getLinkURL, getMessage, getObjectName, getObjectNames, getPageInformation, getParameter, getPostURL, getRowCount, getRowHasCheckbox, getRowNeedsLink, getRowTypeName, getSelectValue, getSortColumn, getSortEnable, getSortOrder, getSortURL, getSortURLParams, getSubTitle, getTableName, getTableNameHTML, getTitle, getTopButtonCount, getTopButtonName, getTopButtonValue, getType, implementsToHTML, isGenerateLinks, isMultiSelect, setApplet, setButtons, setColumns, setError, setGenerateLinks, setHiddenFormData, setLinkColumn, setLinkURL, setMessage, setMultiSelect, setPageInformation, setPostURL, setRouteURLParams, setRowHasCheckbox, setRows, setRowTypeName, setSortColumn, setSortEnable, setSortOrder, setSortURL, setSortURLParams, setSubTitle, setTableName, setTitle, setTopButtons, setType, Table
 
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

SIMPLE

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

_resultLimit

public int _resultLimit
These can be used to control the maximum number of rows returned.

Constructor Detail

SearchTableBase

public SearchTableBase()
Method Detail

setResultLimit

public void setResultLimit(int resultLimit)

getResultLimit

public int getResultLimit()

SearchTableBase

public void SearchTableBase()
All the interesting constrution happens after setting property values and calling the generate() method.


buildNameSearchAttributes

public java.lang.String buildNameSearchAttributes(java.util.List conditions,
                                                  javax.servlet.ServletRequest req,
                                                  Session s)
                                           throws WavesetException
Build conditions matching the named edit field & criteria. Add them to the passed in array list.

Throws:
WavesetException

buildCapabilitySearchAttributes

public java.lang.String buildCapabilitySearchAttributes(Session s,
                                                        java.util.List conditions,
                                                        javax.servlet.ServletRequest req)
                                                 throws WavesetException
Build conditions matching the named edit field & criteria. Add them to the passed in array list.

Throws:
WavesetException

buildAdminRoleSearchAttributes

public java.lang.String buildAdminRoleSearchAttributes(Session s,
                                                       java.util.ArrayList conditions,
                                                       javax.servlet.ServletRequest req)
                                                throws WavesetException
Build conditions matching the named edit field & criteria. Add them to the passed in array list.

Throws:
WavesetException

buildApproverSearchAttributes

public java.lang.String buildApproverSearchAttributes(Session s,
                                                      java.util.List conditions,
                                                      javax.servlet.ServletRequest req)
                                               throws WavesetException
Build conditions matching the named edit field & criteria. Add them to the passed in array list.

Throws:
WavesetException

buildResourceSearchAttributes

public java.lang.String buildResourceSearchAttributes(Session s,
                                                      java.util.List conditions,
                                                      javax.servlet.ServletRequest req)
                                               throws WavesetException
Build conditions matching the named edit field & criteria. Add them to the passed in array list.

Throws:
WavesetException

buildApplicationSearchAttributes

public java.lang.String buildApplicationSearchAttributes(Session s,
                                                         java.util.List conditions,
                                                         javax.servlet.ServletRequest req)
                                                  throws WavesetException
Build conditions matching the Application (aka Resource Group). Add them to the passed in array list.

Throws:
WavesetException

buildControlledOrganizationSearchAttributes

public java.lang.String buildControlledOrganizationSearchAttributes(Session s,
                                                                    java.util.ArrayList conditions,
                                                                    javax.servlet.ServletRequest req)
                                                             throws WavesetException
Build conditions matching the named edit field & criteria. Add them to the passed in array list.

Throws:
WavesetException

listControlledOrganizationSearchAttributes

public java.lang.String listControlledOrganizationSearchAttributes(Session s,
                                                                   java.util.List conditions,
                                                                   javax.servlet.ServletRequest req)
                                                            throws WavesetException
Build a list of conditions matching the named edit field & criteria. These will be used repeatedly to generate an "or" search of controlled organizations - If you are searching for people who control org B, and B is in A which is in top, we want to match anyone who controls B, A, or Top.

Throws:
WavesetException

listAvailableOrganizationSearchAttributes

public java.lang.String listAvailableOrganizationSearchAttributes(Session s,
                                                                  java.util.List orgsInOrg,
                                                                  javax.servlet.ServletRequest req)
                                                           throws WavesetException
Build a list of conditions matching the named edit field & criteria. These will be used repeatedly to generate an "or" search of available organizations - This builds a list of organizations that are contained by the passed- in organization. The idea is that if an administrator controlls an organization, all objects available to organizations below that one should be included

Throws:
WavesetException

buildConstrainedObjectList

public static RepositoryResult buildConstrainedObjectList(Type type,
                                                          java.util.List orTogetherConditions,
                                                          java.util.List containedOrgs,
                                                          AttributeCondition[] inConds,
                                                          Session s,
                                                          int limit)
                                                   throws WavesetException
Return an RepositoryResult of all of the objects in an organization. Filter by any passed in conditions and by possible controlled organizations. Organizations are passed in by name, translated to an id, and then a search for each is done and the values merged (simulating an or search). Controlled organizations are passed in by attributeCondition, a search for each is done, and they are merged. This makes n*m searches where n = number of organizations and m = number of controlled orgs

Parameters:
type - type to search for
orTogetherConditions - List AttributeConditions to "or" together
containedOrgs - List of String Organization names to "or" together
inConds - array of AttributeCondition to "and" together
limit - limit of objects to return
Throws:
WavesetException

buildOrganizationOrgList

public void buildOrganizationOrgList(javax.servlet.ServletRequest req,
                                     Session s,
                                     java.util.List names)
                              throws WavesetException
Return a list of the object groups that are a part of this request.

Throws:
WavesetException

appendCondition

protected java.lang.String appendCondition(Session s,
                                           java.lang.String fullDescription,
                                           java.lang.String currentDescription)
Returns:
the localized concatenation of currentDescription onto fullDescription.

getSearchParamsFromRequest

public void getSearchParamsFromRequest(javax.servlet.ServletRequest req,
                                       Session s,
                                       java.lang.StringBuffer urlParams,
                                       java.lang.StringBuffer searchDescription,
                                       java.util.List conditions,
                                       java.util.List orgsInOrg,
                                       java.util.List controlledOrgConditions)
                                throws WavesetException
Throws:
WavesetException

generate

public void generate(javax.servlet.http.HttpSession hs,
                     javax.servlet.ServletRequest req,
                     Session s,
                     javax.servlet.http.HttpServletResponse response)
              throws WavesetException
We can ignore the type, we have only one table to generate.

Specified by:
generate in class Table
Throws:
WavesetException

sort

public void sort()
Called by generate() after building up a _rows matrix. sort the rows according to the sort column if set.

Overrides:
sort in class Table