fr.ifremer.suiviobsmer.ui.pages
Class Boats

java.lang.Object
  extended by fr.ifremer.suiviobsmer.ui.base.AbstractFilteredPage
      extended by fr.ifremer.suiviobsmer.ui.pages.Boats
All Implemented Interfaces:
SuiviObsmerPage

@IncludeStylesheet(value="context:css/boats.css")
public class Boats
extends AbstractFilteredPage
implements SuiviObsmerPage

Boats Created: 9 nov. 2009

Version:
$Revision: 294 $ Mise a jour: $Date: 2010-01-29 18:21:13 +0100 (ven., 29 janv. 2010) $ par : $Author: fdesbois $
Author:
fdesbois

Field Summary
protected static String GZIP_MIMETYPE
           
 
Constructor Summary
Boats()
           
 
Method Summary
 boolean canCreateNewContactFromElligibleBoat()
           
 boolean canCreateNewContactFromList()
           
 org.apache.tapestry5.Block getActiveBoatInfosBlock()
           
 Date getBoardingFromDate()
          Date for calculate boardings done for the selected boat.
 BoatInfos getBoatInfos()
           
 BoatDataSource getBoats()
          Get dataSource which contains current boats to show on the page.
 Boat getBoatSelected()
          Used to get the selected boat.
 GenericSelectModel<Company> getCompanies()
          Retrieve companies select model for admin user.
 Company getCompany()
          Get the current company.
 CompanyBoatInfos getCompanyBoatInfos()
           
 DateFormat getDateFormat()
           
 String getElligibleRowInfos()
          /////////////////////// FOR EACH ELLIGIBLEBOAT ROW /////////////////
 String getElligibleRowStyle()
           
 BoatFilter getFilter()
          Filters to apply on boats list.
 String getHiddenStyle()
           
 String getlastContactStyle()
          Get CSS style class to apply on lastContact depends on its state.
 GenericSelectModel<Profession> getProfessionSelectModel()
           
 String getRowStyle()
          Initialized row CSS style depends on selection in the list.
 SampleRow getSampleRow()
          Retrieve sampleRow from business with id from url context.
 boolean hasActivityCalendar()
           
 boolean isActivityCalendarImportRun()
          /////////////////////// GLOBAL TO THE BLOCK ///////////////////////
protected  boolean isAvailableDataForFiltersOnly()
          Used to show only active company and observers.
 boolean isElligibleBoatCompanyActiveFalse()
           
 boolean isFiltersHidden()
           
 boolean isLogFileExists()
           
 boolean isOnlyForAdmin()
           
 boolean isSampleRowExists()
           
 org.apache.tapestry5.StreamResponse onActionFromShowActivityCalendarLogFile()
           
 void onSelectedFromSearch()
          EVENT_SELECTED :: search sumit button for filtersForm.
 void setBoardingFromDate(Date boardingFromDate)
          Used by Tapestry to set the boardingFromDate from calculateBoardings form.
 
Methods inherited from class fr.ifremer.suiviobsmer.ui.base.AbstractFilteredPage
getCompanySelectModel, getFacadeSelectModel, getObserverSelectModel, getProgramSelectModel, getSampleRowSelectModel, getSectorSelectModel, initSelectFilters, isEdited, onProvideCompletionsFromBoatName, onSelectedFromRefreshByCompany, onSelectedFromRefreshByFacade, onSelectedFromRefreshByProgram, onSelectedFromRefreshBySector, resetFacadeSelect, resetSampleRowSelect, resetSectorSelect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GZIP_MIMETYPE

protected static final String GZIP_MIMETYPE
See Also:
Constant Field Values
Constructor Detail

Boats

public Boats()
Method Detail

isOnlyForAdmin

public boolean isOnlyForAdmin()
Specified by:
isOnlyForAdmin in interface SuiviObsmerPage

isLogFileExists

public boolean isLogFileExists()

onActionFromShowActivityCalendarLogFile

public org.apache.tapestry5.StreamResponse onActionFromShowActivityCalendarLogFile()

getFilter

public BoatFilter getFilter()
                     throws SuiviObsmerException
Filters to apply on boats list. Method used by AbstractFilteredPage superclass.

Specified by:
getFilter in class AbstractFilteredPage
Returns:
the current BoatFilter to apply
Throws:
SuiviObsmerException
See Also:
AbstractFilteredPage

isAvailableDataForFiltersOnly

protected boolean isAvailableDataForFiltersOnly()
Description copied from class: AbstractFilteredPage
Used to show only active company and observers.

Specified by:
isAvailableDataForFiltersOnly in class AbstractFilteredPage
Returns:
true if only active users will be showed, false otherwise

getSampleRow

public SampleRow getSampleRow()
                       throws SuiviObsmerException
Retrieve sampleRow from business with id from url context. The sampleRowId from context is set by SamplingPlan page. When the sampleRow is not null, the filters are disabled to optimize searching boats for this row.

Returns:
the sampleRow from business
Throws:
SuiviObsmerException

isSampleRowExists

public boolean isSampleRowExists()
                          throws SuiviObsmerException
Throws:
SuiviObsmerException

getProfessionSelectModel

public GenericSelectModel<Profession> getProfessionSelectModel()
                                                        throws SuiviObsmerException
Throws:
SuiviObsmerException

isFiltersHidden

public boolean isFiltersHidden()

getHiddenStyle

public String getHiddenStyle()

onSelectedFromSearch

public void onSelectedFromSearch()
                          throws SuiviObsmerException
EVENT_SELECTED :: search sumit button for filtersForm. Get profession from selectModel to add it in filters. Other filters are managed by AbstractFilteredPage superclass.

Overrides:
onSelectedFromSearch in class AbstractFilteredPage
Throws:
SuiviObsmerException - for business errors
See Also:
AbstractFilteredPage.onSelectedFromSearch()

getBoats

public BoatDataSource getBoats()
                        throws SuiviObsmerException
Get dataSource which contains current boats to show on the page. Depends on filters sets by user. BoatDataSource uses serviceBoat to retrieve boats with filters.

Returns:
the BoatDataSource which contains the boats map
Throws:
SuiviObsmerException
See Also:
BoatDataSource

getRowStyle

public String getRowStyle()
Initialized row CSS style depends on selection in the list. The style is also changed a line on two.

Returns:
the CSS style class to used for the current row in the Grid

getDateFormat

public DateFormat getDateFormat()

canCreateNewContactFromList

public boolean canCreateNewContactFromList()
                                    throws SuiviObsmerException
Throws:
SuiviObsmerException

isActivityCalendarImportRun

public boolean isActivityCalendarImportRun()
/////////////////////// GLOBAL TO THE BLOCK ///////////////////////


getActiveBoatInfosBlock

public org.apache.tapestry5.Block getActiveBoatInfosBlock()

getCompanyBoatInfos

public CompanyBoatInfos getCompanyBoatInfos()
                                     throws SuiviObsmerException
Throws:
SuiviObsmerException

getCompanies

public GenericSelectModel<Company> getCompanies()
                                         throws SuiviObsmerException
Retrieve companies select model for admin user. Only active companies will be used for this model.

Returns:
the GenericSelectModel
Throws:
SuiviObsmerException

getCompany

public Company getCompany()
                   throws SuiviObsmerException
Get the current company. The user one if it's not an admin or the selected one otherwise.

Returns:
the current Company
Throws:
SuiviObsmerException

getBoatSelected

public Boat getBoatSelected()
                     throws SuiviObsmerException
Used to get the selected boat.

Returns:
the selected boat from the grid
Throws:
SuiviObsmerException

getBoardingFromDate

public Date getBoardingFromDate()
Date for calculate boardings done for the selected boat. All boardings (number of contacts) will be calculated from this date. Initialized as 12 months from today, but can be set by user.

Returns:
the Date used to calculate boardings done on the selected boat

setBoardingFromDate

public void setBoardingFromDate(Date boardingFromDate)
Used by Tapestry to set the boardingFromDate from calculateBoardings form.

Parameters:
boardingFromDate - used to calculate boardings done on the selected boat

getBoatInfos

public BoatInfos getBoatInfos()
                       throws SuiviObsmerException
Throws:
SuiviObsmerException

getlastContactStyle

public String getlastContactStyle()
                           throws SuiviObsmerException
Get CSS style class to apply on lastContact depends on its state.

Returns:
the CSS style to apply on contact block
Throws:
SuiviObsmerException
See Also:
BusinessUtils.getContactStyle(Contact, boolean)

getElligibleRowInfos

public String getElligibleRowInfos()
/////////////////////// FOR EACH ELLIGIBLEBOAT ROW /////////////////


isElligibleBoatCompanyActiveFalse

public boolean isElligibleBoatCompanyActiveFalse()

canCreateNewContactFromElligibleBoat

public boolean canCreateNewContactFromElligibleBoat()
                                             throws SuiviObsmerException
Throws:
SuiviObsmerException

getElligibleRowStyle

public String getElligibleRowStyle()

hasActivityCalendar

public boolean hasActivityCalendar()
                            throws SuiviObsmerException
Throws:
SuiviObsmerException


Copyright © 2009-2010 Ifremer. All Rights Reserved.