fr.ifremer.wao.ui.pages
Class Boats

java.lang.Object
  extended by fr.ifremer.wao.ui.base.AbstractFilteredPage
      extended by fr.ifremer.wao.ui.pages.Boats

@RequiresAuthentication(allowedRoles={ADMIN,COORDINATOR,OBSERVER,PROFESSIONAL})
@Import(stylesheet="context:css/boats.css")
public class Boats
extends AbstractFilteredPage

Boats Created: 9 nov. 2009

Author:
fdesbois

Constructor Summary
Boats()
           
 
Method Summary
 boolean canCreateNewContactFromElligibleBoat()
           
 boolean canCreateNewContactFromList()
           
 boolean canEditBoatInfos()
          Only user with no readOnly rights can edit BoatInfos.
 org.apache.tapestry5.Block getActiveBoatInfosBlock()
           
 Date getBoardingFromDate()
          Date for calculate boardings done for the selected boat.
 BoatFilter getBoatFilter()
           
 String getBoatInactive()
           
 BoatInfos getBoatInfos()
           
 BoatDataSource getBoats()
          Get dataSource which contains current boats to show on the page.
 Boat getBoatSelected()
          Used to get the selected boat.
 Integer getBoatSelectedImmatriculation()
           
 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()
           
 SamplingFilter getFilter()
          Filters to apply on boats list.
 String getHiddenStyle()
           
 String getLabelForEnum(Enum value)
           
 String getlastContactStyle()
          Get CSS style class to apply on lastContact depends on its state.
 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()
           
protected  boolean isAvailableDataForFiltersOnly()
          Used to show only active company and observers.
 boolean isElligibleBoatCompanyActiveFalse()
           
 boolean isFiltersHidden()
           
 boolean isSampleRowExists()
           
 boolean isSampleRowFinished()
          This method detect if the sampleRow from current elligibleBoat is finished.
 String[] onProvideCompletionsFromShipOwnerName(String input)
           
 void onSelectedFromSearch()
          EVENT_SELECTED :: search sumit button for filtersForm.
protected  void resetFilter()
           
 void setBoardingFromDate(Date boardingFromDate)
          Used by Tapestry to set the boardingFromDate from calculateBoardings form.
 void setBoatSelectedImmatriculation(Integer boatSelectedImmatriculation)
           
 
Methods inherited from class fr.ifremer.wao.ui.base.AbstractFilteredPage
getCompanyId, getCompanySelectModel, getDcfGearSelectModel, getDcfSpeciesSelectModel, getFacadeSelectModel, getFishingGearDCFId, getObserverId, getObserverSelectModel, getOptionModels, getProgramSelectModel, getSampleRowId, getSampleRowSelectModel, getSectorSelectModel, getTargetSpeciesDCFId, getTerrestrialDistrictId, getTerrestrialDistrictSelectModel, initCompagnyFilter, initCompanyFilter, initSelectFilters, isEdited, isObserverSelect, isProgramSelect, onProvideCompletionsFromBoatName, onSelectedFromAddSampleRowCode, onSelectedFromRefreshByCompany, onSelectedFromRefreshByFacade, onSelectedFromRefreshByProgram, onSelectedFromRefreshBySector, onSelectedFromRemoveSampleRowCode, resetCompanySelectModel, resetFacadeSelectModel, resetFishingGearDCFModel, resetModels, resetObserverSelectModel, resetProgramSelectModel, resetSampleRowSelectModel, resetSectorSelectModel, resetTargetSpeciesDCFModel, resetTerrestrialDistrictModel, setCompanyId, setFishingGearDCFId, setObserverId, setSampleRowId, setTargetSpeciesDCFId, setTerrestrialDistrictId, updateLocation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Boats

public Boats()
Method Detail

getBoatSelectedImmatriculation

public Integer getBoatSelectedImmatriculation()

setBoatSelectedImmatriculation

public void setBoatSelectedImmatriculation(Integer boatSelectedImmatriculation)

getFilter

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

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

getBoatFilter

public BoatFilter getBoatFilter()
                         throws WaoException
Throws:
WaoException

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

resetFilter

protected void resetFilter()
Specified by:
resetFilter in class AbstractFilteredPage

getSampleRow

public SampleRow getSampleRow()
                       throws WaoException
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:
WaoException

isSampleRowExists

public boolean isSampleRowExists()
                          throws WaoException
Throws:
WaoException

isFiltersHidden

public boolean isFiltersHidden()

getHiddenStyle

public String getHiddenStyle()

onProvideCompletionsFromShipOwnerName

public String[] onProvideCompletionsFromShipOwnerName(String input)

onSelectedFromSearch

public void onSelectedFromSearch()
                          throws WaoException
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:
WaoException - for business errors
See Also:
AbstractFilteredPage.onSelectedFromSearch()

getBoats

public BoatDataSource getBoats()
                        throws WaoException
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:
WaoException
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

getBoatInactive

public String getBoatInactive()

getDateFormat

public DateFormat getDateFormat()

canCreateNewContactFromList

public boolean canCreateNewContactFromList()
                                    throws WaoException
Throws:
WaoException

isActivityCalendarImportRun

public boolean isActivityCalendarImportRun()

getActiveBoatInfosBlock

public org.apache.tapestry5.Block getActiveBoatInfosBlock()

getCompanyBoatInfos

public CompanyBoatInfos getCompanyBoatInfos()
                                     throws WaoException
Throws:
WaoException

getCompanies

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

Returns:
the GenericSelectModel
Throws:
WaoException

getCompany

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

Returns:
the current Company
Throws:
WaoException

getBoatSelected

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

Returns:
the selected boat from the grid
Throws:
WaoException

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 WaoException
Throws:
WaoException

getlastContactStyle

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

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

getElligibleRowInfos

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


isElligibleBoatCompanyActiveFalse

public boolean isElligibleBoatCompanyActiveFalse()

canCreateNewContactFromElligibleBoat

public boolean canCreateNewContactFromElligibleBoat()
                                             throws WaoException
Throws:
WaoException

isSampleRowFinished

public boolean isSampleRowFinished()
This method detect if the sampleRow from current elligibleBoat is finished. This condition is necessary for confirm message dialog, only this condition is needed to display the dialog message to be sure user is aware about this sampleRow state.

Returns:
true if the sampleRow from current elligibleBoat is finished

getElligibleRowStyle

public String getElligibleRowStyle()

canEditBoatInfos

public boolean canEditBoatInfos()
Only user with no readOnly rights can edit BoatInfos.

Returns:
true if BoatInfos can be edited

hasActivityCalendar

public boolean hasActivityCalendar()
                            throws WaoException
Throws:
WaoException

getLabelForEnum

public String getLabelForEnum(Enum value)


Copyright © 2009-2011 Ifremer. All Rights Reserved.