com.plumtree.portaluiinfrastructure.search
Class SearchResultControl

java.lang.Object
  extended by com.plumtree.portaluiinfrastructure.search.SearchResultControl
All Implemented Interfaces:
IControl, IManagedObject, IMVCObject
Direct Known Subclasses:
BreadcrumbControl, DrilldownControl, PaginationControl, ReconstructSearchControl, ReorganizationControl, SaveSearchControl, SearchWithinResultsControl, StartSearchControl, TypeFilterControl, UpdateSortOrderControl

public abstract class SearchResultControl
extends java.lang.Object
implements IControl

Author:
CraigS Superclass for all search result activity space controls.

Field Summary
protected  ISearchResultModel _model
           
protected  AActivitySpace _parent
           
static java.lang.String BASIC_FIELDS
           
static java.lang.String KEY_DATA
           
static java.lang.String PARTIAL_SEARCH
           
static java.lang.String RECONSTRUCTION_ARGS_PREFIX
           
static int RECONSTRUCTION_PREFIX_LENGTH
           
static java.lang.String USER_QUERY
           
 
Constructor Summary
SearchResultControl()
           
 
Method Summary
protected static void addCommonData(ISearchResultModelRO model, ILink url)
          Most subclasses of SearchResultControl have a makeURL() method to generate a link that activates the control; makeURL() should call this method to set common superclass data.
 Redirect CheckActionSecurityAndExecute(XPHashtable args)
          Execute the control business logic and optionally return a Redirect object pointing to another AActivitySpace.
abstract  java.lang.Object Create()
          This method is used by the ASManager to return new instances of managed objects.
protected abstract  Redirect ExecuteSearchControl(XPHashtable args, java.lang.String key)
          Execute method that subclasses should implement; unlike Execute() it's allowed to throw a SearchExecutionException.
protected  boolean expectModelInitialized()
          Subclasses should override this method and return false if they don't mind the model being uninitialized on entry.
abstract  java.lang.String GetName()
          Return the name of the MVC object.
 void Init(IModel model, AActivitySpace space)
          Initialize the control with the model it should use and it's parent AActivitySpace.
protected  QueryArguments parseQueryArgs(XPHashtable args, java.lang.String prefix)
          Helper method to grab query parameters out of the provided arguments and return them in a temporary QueryArguments structure.
static boolean SpaceNeedsPassthruURL(AActivitySpace space)
          Utility function to figure out whether we're in a space that requires a "passthru url" (i.e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_DATA

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

RECONSTRUCTION_ARGS_PREFIX

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

RECONSTRUCTION_PREFIX_LENGTH

public static final int RECONSTRUCTION_PREFIX_LENGTH
See Also:
Constant Field Values

USER_QUERY

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

PARTIAL_SEARCH

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

BASIC_FIELDS

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

_parent

protected AActivitySpace _parent

_model

protected ISearchResultModel _model
Constructor Detail

SearchResultControl

public SearchResultControl()
Method Detail

CheckActionSecurityAndExecute

public Redirect CheckActionSecurityAndExecute(XPHashtable args)
Description copied from interface: IControl
Execute the control business logic and optionally return a Redirect object pointing to another AActivitySpace. Returning null means that the user should return to the parent AActivitySpace's current page. This method is designed to check that the user has access to perform the actions with the given parameters. If the user does not, a redirect object which has had Redirect.SetRedirectToLogin(true) called on it. If the user is the Guest, this will bounce to the login page and back to the Redirect after the user has logged on. If the user is already logged on, they will be redirected to an error page. In general, the error redirect that is returned should contain all of the query string parameters that made up the URL that originally led to the control. Checking whether or not a particular user ever has any access to the space, page, and control should be done in IPTActivitySpace.CheckBasicAccess().

Specified by:
CheckActionSecurityAndExecute in interface IControl
Returns:
Redirect where to redirect to after the control is finished executing. This will go to the login page or an error page if Redirect.SetRedirectToLogin(true) has been called.
See Also:
com.plumtree.portaluiinfrastructure.activityspace.IControl#Execute()

Create

public abstract java.lang.Object Create()
This method is used by the ASManager to return new instances of managed objects.

Specified by:
Create in interface IManagedObject
Returns:
A new instance of the managed class (i.e. return new Foo();)

GetName

public abstract java.lang.String GetName()
Description copied from interface: IMVCObject
Return the name of the MVC object.

Specified by:
GetName in interface IMVCObject
Returns:
the name of the object.
See Also:
com.plumtree.xpshared.activityspace.IControl#GetName()

Init

public void Init(IModel model,
                 AActivitySpace space)
Description copied from interface: IControl
Initialize the control with the model it should use and it's parent AActivitySpace. This method needs to be called before any other methods. This method also clears all internal data so the control can be used again without fear of mixing data.

Specified by:
Init in interface IControl
See Also:
com.plumtree.portaluiinfrastructure.activityspace.IControl#Init(IModel, AActivitySpace)

addCommonData

protected static void addCommonData(ISearchResultModelRO model,
                                    ILink url)
Most subclasses of SearchResultControl have a makeURL() method to generate a link that activates the control; makeURL() should call this method to set common superclass data.


ExecuteSearchControl

protected abstract Redirect ExecuteSearchControl(XPHashtable args,
                                                 java.lang.String key)
Execute method that subclasses should implement; unlike Execute() it's allowed to throw a SearchExecutionException. The key argument indicates the page on which this control's URL was located; this lets us handle the case where the user hits BACK before clicking on something, and (for example) drills down into a different set of categories than the set being displayed on the current page.


expectModelInitialized

protected boolean expectModelInitialized()
Subclasses should override this method and return false if they don't mind the model being uninitialized on entry.


parseQueryArgs

protected QueryArguments parseQueryArgs(XPHashtable args,
                                        java.lang.String prefix)
Helper method to grab query parameters out of the provided arguments and return them in a temporary QueryArguments structure. The argument names may be prepended with the provided prefix. If no args were found or the query could not be reconstructed, this method should return null.


SpaceNeedsPassthruURL

public static boolean SpaceNeedsPassthruURL(AActivitySpace space)
Utility function to figure out whether we're in a space that requires a "passthru url" (i.e. a link that is actually javascript to direct the request through the repost control, so that the page gets saved before the search link is followed).




Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.