fr.ifremer.wao.ui.base
Class AbstractFilteredPage

java.lang.Object
  extended by fr.ifremer.wao.ui.base.AbstractFilteredPage
Direct Known Subclasses:
Boats, Contacts, Synthesis

public abstract class AbstractFilteredPage
extends Object

AbstractFilteredPage Created: 14 janv. 2010 This class uses the BoatFilter bean (also SamplingFilter and UserFilter which are supertypes). Known implementations are Synthesis and Contacts You must override the three abstract methods and call #initFilter() in the setupRender of the page.

 - BoatName uses an Autocomplete mixins :
      
 - SampleRow select value is sampleRowId :
      
 - Company select value is companyId :
      
 - Observer select value is observerId :
      

 Use submit button with specific ids to refresh data depends on select change:
 - id="refreshByCompany" : refresh facadeSelect, sectorSelect, sampleRowSelect 
   and observerSelect
 - id="refreshByFacade" : refresh sectorSelect and sampleRowSelect
 - id="refreshBySector" : refresh sampleRowSelect

 

Version:
$Revision: 355 $ Mise a jour: $Date: 2010-02-16 14:56:07 +0100 (mar., 16 févr. 2010) $ par : $Author$
Author:
fdesbois

Constructor Summary
AbstractFilteredPage()
           
 
Method Summary
 GenericSelectModel<Company> getCompanySelectModel()
          Get select model for companies.
 org.apache.tapestry5.SelectModel getFacadeSelectModel()
          Get select model for fishingZone facade.
protected abstract  BoatFilter getFilter()
           
 GenericSelectModel<WaoUser> getObserverSelectModel()
          Get the select model for observers.
 org.apache.tapestry5.SelectModel getProgramSelectModel()
          Get select model for sampleRow program.
 GenericSelectModel<SampleRow> getSampleRowSelectModel()
          Get select model for sampleRows.
 org.apache.tapestry5.SelectModel getSectorSelectModel()
          Get select model for fishingZone sector.
protected  void initSelectFilters(boolean companySelect, boolean observerSelect, boolean programSelect)
          Initialize all select for filters.
protected abstract  boolean isAvailableDataForFiltersOnly()
          Used to show only active company and observers.
protected  boolean isEdited()
          Used to indicate that a refresh as been triggered.
 String[] onProvideCompletionsFromBoatName(String input)
           
 void onSelectedFromRefreshByCompany()
          EVENT :: selected on refreshByCompany submit button.
 void onSelectedFromRefreshByFacade()
          EVENT :: selected on refreshByFacade submit button.
 void onSelectedFromRefreshByProgram()
          EVENT :: selected on refreshByProgram submit button.
 void onSelectedFromRefreshBySector()
          EVENT :: selected on refreshBySector submit button.
 void onSelectedFromSearch()
          Called when search submit button is pressed.
protected  void resetCompanySelect()
           
protected  void resetFacadeSelect()
           
protected  void resetSampleRowSelect()
           
protected  void resetSectorSelect()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFilteredPage

public AbstractFilteredPage()
Method Detail

initSelectFilters

protected void initSelectFilters(boolean companySelect,
                                 boolean observerSelect,
                                 boolean programSelect)
                          throws WaoException
Initialize all select for filters. By default, only facade, sector and sampleRow selects will be initialized.

Parameters:
companySelect - if true, company select will be initialized
observerSelect - if true, observer select will be initialized
Throws:
WaoException

resetCompanySelect

protected void resetCompanySelect()
                           throws WaoException
Throws:
WaoException

resetFacadeSelect

protected void resetFacadeSelect()
                          throws WaoException
Throws:
WaoException

resetSectorSelect

protected void resetSectorSelect()
                          throws WaoException
Throws:
WaoException

resetSampleRowSelect

protected void resetSampleRowSelect()
                             throws WaoException
Throws:
WaoException

getFacadeSelectModel

public org.apache.tapestry5.SelectModel getFacadeSelectModel()
                                                      throws WaoException
Get select model for fishingZone facade. Depends on company set in filter.

Returns:
the SelectModel for facade names
Throws:
WaoException

getSectorSelectModel

public org.apache.tapestry5.SelectModel getSectorSelectModel()
                                                      throws WaoException
Get select model for fishingZone sector. Depends on facadeName and company set in filter.

Returns:
the SelectModel for sector names
Throws:
WaoException

getSampleRowSelectModel

public GenericSelectModel<SampleRow> getSampleRowSelectModel()
                                                      throws WaoException
Get select model for sampleRows. Depends on filter (Sampling part only). The sampleRow set from filter is temporarly extracted to avoid returning only one element in the select.

Returns:
the GenericSelectModel for sampleRows
Throws:
WaoException

getCompanySelectModel

public GenericSelectModel<Company> getCompanySelectModel()
                                                  throws WaoException
Get select model for companies. Depends on #getAvailableDataForFiltersOnly() to return only activated companies. This select model is only used by admin users.

Returns:
the GenericSelectModel for companies
Throws:
WaoException

getObserverSelectModel

public GenericSelectModel<WaoUser> getObserverSelectModel()
                                                   throws WaoException
Get the select model for observers. Depends on #getAvailableDataForFiltersOnly() to return only activated companies.

Returns:
the GenericSelectModel for observers
Throws:
WaoException

getProgramSelectModel

public org.apache.tapestry5.SelectModel getProgramSelectModel()
                                                       throws WaoException
Get select model for sampleRow program. Depends on company set in filter.

Returns:
the SelectModel for program names
Throws:
WaoException

getFilter

protected abstract BoatFilter getFilter()
                                 throws WaoException
Throws:
WaoException

isAvailableDataForFiltersOnly

protected abstract boolean isAvailableDataForFiltersOnly()
Used to show only active company and observers.

Returns:
true if only active users will be showed, false otherwise

onProvideCompletionsFromBoatName

public String[] onProvideCompletionsFromBoatName(String input)
                                          throws WaoException
Throws:
WaoException

onSelectedFromSearch

public void onSelectedFromSearch()
                          throws WaoException
Called when search submit button is pressed. This method is useful to refresh all filters data from selects.

Throws:
WaoException

onSelectedFromRefreshByCompany

public void onSelectedFromRefreshByCompany()
                                    throws WaoException
EVENT :: selected on refreshByCompany submit button. Reset selects for company selected : programs, facades, sectors, sampleRows and observers. This method set the state to edited, you can use isEdited() method to test it.

Throws:
WaoException
See Also:
onSelectedFromRefreshByProgram()

onSelectedFromRefreshByProgram

public void onSelectedFromRefreshByProgram()
                                    throws WaoException
EVENT :: selected on refreshByProgram submit button. Reset selects for program selected : facades, sectors and sampleRows. This method set the state to edited, you can use isEdited() method to test it.

Throws:
WaoException
See Also:
onSelectedFromRefreshByFacade()

onSelectedFromRefreshByFacade

public void onSelectedFromRefreshByFacade()
                                   throws WaoException
EVENT :: selected on refreshByFacade submit button. Reset selects for facade selected : sectors and sampleRows. This method set the state to edited, you can use isEdited() method to test it.

Throws:
WaoException
See Also:
onSelectedFromRefreshBySector()

onSelectedFromRefreshBySector

public void onSelectedFromRefreshBySector()
                                   throws WaoException
EVENT :: selected on refreshBySector submit button. After refreshing data selected, reset selects for sector selected : sampleRows. This method set the state to edited, you can use isEdited() method to test it.

Throws:
WaoException
See Also:
onSelectedFromSearch()

isEdited

protected boolean isEdited()
Used to indicate that a refresh as been triggered.

Returns:
true if the page filter is in edited state.


Copyright © 2009-2010 Ifremer. All Rights Reserved.