org.jaffa.components.finder
Class FinderComponent2

java.lang.Object
  extended byorg.jaffa.presentation.portlet.component.Component
      extended byorg.jaffa.components.finder.FinderComponent2
All Implemented Interfaces:
IComponent
Direct Known Subclasses:
LookupComponent2

public abstract class FinderComponent2
extends Component

This is the base class for all Finder components created by using the object_finder_2_0 pattern. It has the following properties - 1- displayResultsScreen : If set to true, then the Results screen will be directly brought up, bypassing the Criteria screen. 2- consolidatedCriteriaAndResults : If set to true, then the Criteria and Results screen will be shown together 3- sortDropDown : The sort criteria to use for the inquiry 4- exportType : The export option to use for the inquiry (initialized to regular Web Pages) 5- maxRecords: The maximum number of records to retrieve. All records will be retrieved, if no value is specified. A Finder class will have to provide an implementation for the doInquiry(), getCriteriaFormName(), getResultsFormName() and getConsolidatedCriteriaAndResultsFormName() methods.

Author:
GautamJ

Field Summary
static String ATTRIBUTE_EXPORT_TYPE_XML
          This request stream attribute is set after a query if the exportType is XML.
static String EXPORT_TYPE_EXCEL
          A global constant for the Excel export option.
static String EXPORT_TYPE_WEB_PAGE
          A global constant for the Web Page export option.
static String EXPORT_TYPE_XML
          A global constant for the XML export option.
 
Constructor Summary
FinderComponent2()
           
 
Method Summary
protected  void addSortCriteria(FinderInDto inputDto)
          Interprets the value of the 'sortDropDown' property adding suitable values to the input Dto.
 FormKey display()
          If the displayResultsScreen property has not been set or has been set to false, it will return the FormKey for the Criteria screen.
 FormKey displayCriteria()
          Invoked the initializeCriteriaScreen() method and then returns the FormKey for the Criteria screen.
 FormKey displayResults()
          Invokes the performInquiry() method and then returns the FormKey for the Results screen.
protected abstract  FinderOutDto doInquiry()
          The Component should provide an implementation for this method to perform the actual query to obtain the FinderOutDto.
 Boolean getConsolidatedCriteriaAndResults()
          Getter for property consolidatedCriteriaAndResults.
protected abstract  String getConsolidatedCriteriaAndResultsFormName()
          The Component should provide an implementation for this method to return the Struts GlobalForward for the ConsolidatedCriteriaAndResults screen.
 FormKey getCriteriaFormKey()
          Getter for the Criteria screen's FormKey.
protected abstract  String getCriteriaFormName()
          The Component should provide an implementation for this method to return the Struts GlobalForward for the Criteria screen.
 Boolean getDisplayResultsScreen()
          Getter for property displayResultsScreen.
protected abstract  String getExcelFormName()
          The Component should provide an implementation for this method to return the Struts GlobalForward for the screen displaying the results as an Excel spreadsheet.
 String getExportType()
          Getter for property exportType.
 FinderOutDto getFinderOutDto()
          Getter for property finderOutDto.
protected  HeaderDto getHeaderDto()
          Returns the HeaderDto.
 Integer getMaxRecords()
          Getter for property maxRecords.
 FormKey getResultsFormKey()
          Getter for the Results screen's FormKey.
protected abstract  String getResultsFormName()
          The Component should provide an implementation for this method to return the Struts GlobalForward for the Results screen.
 String getSortDropDown()
          Getter for property sortDropDown.
protected abstract  String getXmlFormName()
          The Component should provide an implementation for this method to return the Struts GlobalForward for the screen displaying the results in XML format.
 void incrementMaxRecords()
          This will set the property 'maxRecords' to the value following the current one, in the list of values returned by CriteriaDropDownOptions.getMaxRecordsDropDownOptions().
protected  void initializeCriteriaScreen()
          The Component should override this method to retrieve the set of codes for dropdowns in criteria screen, if any are required.
 void performInquiry()
          Invokes the doInquiry() method and then removes the "rows" GridModel object from the cache.
 void setConsolidatedCriteriaAndResults(Boolean consolidatedCriteriaAndResults)
          Setter for property consolidatedCriteriaAndResults.
 void setDisplayResultsScreen(Boolean displayResultsScreen)
          Setter for property displayResultsScreen.
 void setExportType(String exportType)
          Setter for property exportType.
 void setMaxRecords(Integer maxRecords)
          Setter for property maxRecords.
 void setSortDropDown(String sortDropDown)
          Setter for property sortDropDown.
protected  void uncacheRowsModel()
          Removes the 'rows' GridModel from the WidgetCache.
protected  void updateMaxRecordsModel()
          Update the DropDownModel for the MaxRecords field, if one already exists.
 
Methods inherited from class org.jaffa.presentation.portlet.component.Component
addChildComponent, addFormKeyChangeListener, getComponentDefinition, getComponentId, getContainerFormKey, getFormKeyChangeListeners, getReturnToFormKey, getToken, getUserSession, isActive, quit, quitAndReturnToCallingScreen, reflectAndSetParms, removeFormKeyChangeListener, returnChildComponents, returnLastActivityDate, run, setContainerFormKey, setReturnToFormKey, setToken, updateLastActivityDate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPORT_TYPE_WEB_PAGE

public static final String EXPORT_TYPE_WEB_PAGE
A global constant for the Web Page export option.

See Also:
Constant Field Values

EXPORT_TYPE_EXCEL

public static final String EXPORT_TYPE_EXCEL
A global constant for the Excel export option.

See Also:
Constant Field Values

EXPORT_TYPE_XML

public static final String EXPORT_TYPE_XML
A global constant for the XML export option.

See Also:
Constant Field Values

ATTRIBUTE_EXPORT_TYPE_XML

public static final String ATTRIBUTE_EXPORT_TYPE_XML
This request stream attribute is set after a query if the exportType is XML. The ResultsJsp will use display the XML stored by this attribute.

See Also:
Constant Field Values
Constructor Detail

FinderComponent2

public FinderComponent2()
Method Detail

getDisplayResultsScreen

public Boolean getDisplayResultsScreen()
Getter for property displayResultsScreen.

Returns:
Value of property displayResultsScreen.

setDisplayResultsScreen

public void setDisplayResultsScreen(Boolean displayResultsScreen)
Setter for property displayResultsScreen.

Parameters:
displayResultsScreen - New value of property displayResultsScreen.

getConsolidatedCriteriaAndResults

public Boolean getConsolidatedCriteriaAndResults()
Getter for property consolidatedCriteriaAndResults.

Returns:
Value of property consolidatedCriteriaAndResults.

setConsolidatedCriteriaAndResults

public void setConsolidatedCriteriaAndResults(Boolean consolidatedCriteriaAndResults)
Setter for property consolidatedCriteriaAndResults.

Parameters:
consolidatedCriteriaAndResults - New value of property consolidatedCriteriaAndResults.

getSortDropDown

public String getSortDropDown()
Getter for property sortDropDown.

Returns:
Value of property sortDropDown.

setSortDropDown

public void setSortDropDown(String sortDropDown)
Setter for property sortDropDown.

Parameters:
sortDropDown - New value of property sortDropDown.

getExportType

public String getExportType()
Getter for property exportType.

Returns:
Value of property exportType.

setExportType

public void setExportType(String exportType)
Setter for property exportType.

Parameters:
exportType - New value of property exportType.

getMaxRecords

public Integer getMaxRecords()
Getter for property maxRecords.

Returns:
Value of property maxRecords.

setMaxRecords

public void setMaxRecords(Integer maxRecords)
Setter for property maxRecords.

Parameters:
maxRecords - New value of property maxRecords.

display

public FormKey display()
                throws ApplicationExceptions,
                       FrameworkException
If the displayResultsScreen property has not been set or has been set to false, it will return the FormKey for the Criteria screen. If the displayResultsScreen property has been set to true, then a Search will be performed & the FormKey for the Results screen will be returned.

Specified by:
display in interface IComponent
Specified by:
display in class Component
Returns:
The FormKey for the Criteria screen.
Throws:
ApplicationExceptions - This will be thrown in case any invalid data has been set.
FrameworkException - Indicates some system error.

displayCriteria

public FormKey displayCriteria()
                        throws ApplicationExceptions,
                               FrameworkException
Invoked the initializeCriteriaScreen() method and then returns the FormKey for the Criteria screen.

Returns:
The FormKey for the Criteria screen.
Throws:
ApplicationExceptions - This will be thrown in case any invalid data has been set.
FrameworkException - Indicates some system error.

displayResults

public FormKey displayResults()
                       throws ApplicationExceptions,
                              FrameworkException
Invokes the performInquiry() method and then returns the FormKey for the Results screen. If the consolidatedCriteriaAndResults property has been set to true, then the FormKey for consolidatedCriteriaAndResults screen will be returned.

Returns:
The FormKey for the Results screen.
Throws:
ApplicationExceptions - This will be thrown in case any invalid data has been set.
FrameworkException - Indicates some system error.

performInquiry

public void performInquiry()
                    throws ApplicationExceptions,
                           FrameworkException
Invokes the doInquiry() method and then removes the "rows" GridModel object from the cache.

Throws:
ApplicationExceptions - This will be thrown in case any invalid data has been set.
FrameworkException - Indicates some system error.

getCriteriaFormKey

public FormKey getCriteriaFormKey()
Getter for the Criteria screen's FormKey.

Returns:
the FormKey for the Criteria screen.

getResultsFormKey

public FormKey getResultsFormKey()
Getter for the Results screen's FormKey.

Returns:
the FormKey for the Results screen.

getFinderOutDto

public FinderOutDto getFinderOutDto()
Getter for property finderOutDto.

Returns:
Value of property finderOutDto.

incrementMaxRecords

public void incrementMaxRecords()
This will set the property 'maxRecords' to the value following the current one, in the list of values returned by CriteriaDropDownOptions.getMaxRecordsDropDownOptions().


initializeCriteriaScreen

protected void initializeCriteriaScreen()
                                 throws ApplicationExceptions,
                                        FrameworkException
The Component should override this method to retrieve the set of codes for dropdowns in criteria screen, if any are required.

Throws:
ApplicationExceptions - This will be thrown in case any invalid data has been set.
FrameworkException - Indicates some system error.

getHeaderDto

protected HeaderDto getHeaderDto()
Returns the HeaderDto. This can be used for passing the header info to the Tx, where required.

Returns:
the HeaderDto.

addSortCriteria

protected void addSortCriteria(FinderInDto inputDto)
Interprets the value of the 'sortDropDown' property adding suitable values to the input Dto.

Parameters:
inputDto - The Dto to which the orderby fields will be added.

updateMaxRecordsModel

protected void updateMaxRecordsModel()
Update the DropDownModel for the MaxRecords field, if one already exists.


uncacheRowsModel

protected void uncacheRowsModel()
Removes the 'rows' GridModel from the WidgetCache.


doInquiry

protected abstract FinderOutDto doInquiry()
                                   throws ApplicationExceptions,
                                          FrameworkException
The Component should provide an implementation for this method to perform the actual query to obtain the FinderOutDto.

Returns:
the FinderOutDto object.
Throws:
ApplicationExceptions - This will be thrown in case any invalid data has been set.
FrameworkException - Indicates some system error.

getCriteriaFormName

protected abstract String getCriteriaFormName()
The Component should provide an implementation for this method to return the Struts GlobalForward for the Criteria screen.

Returns:
the Struts GlobalForward for the Criteria screen.

getResultsFormName

protected abstract String getResultsFormName()
The Component should provide an implementation for this method to return the Struts GlobalForward for the Results screen.

Returns:
the Struts GlobalForward for the Results screen.

getConsolidatedCriteriaAndResultsFormName

protected abstract String getConsolidatedCriteriaAndResultsFormName()
The Component should provide an implementation for this method to return the Struts GlobalForward for the ConsolidatedCriteriaAndResults screen.

Returns:
the Struts GlobalForward for the ConsolidatedCriteriaAndResults screen.

getExcelFormName

protected abstract String getExcelFormName()
The Component should provide an implementation for this method to return the Struts GlobalForward for the screen displaying the results as an Excel spreadsheet.

Returns:
the Struts GlobalForward for the screen displaying the results as an Excel spreadsheet.

getXmlFormName

protected abstract String getXmlFormName()
The Component should provide an implementation for this method to return the Struts GlobalForward for the screen displaying the results in XML format.

Returns:
the Struts GlobalForward for the screen displaying the results in XML format.


Copyright © 2002-2004 JAFFA Project.