fr.ifremer.wao.ui.pages
Class Boats

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

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

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()
          RIGHT PANEL
 List<Company> getCompanies()
          Retrieve companies select model for admin user.
 Company getCompany()
          Get the current company.
 CompanyBoatInfos getCompanyBoatInfos()
           
 String[] getContextForShipOwner()
          Permet de construire l'URL pour le lien permettant de voir tous les navires d'un armateur.
 DateFormat getDateFormat()
           
 List<ElligibleBoat> getElligibleBoatsValues()
           
 String getElligibleRowInfos()
           
 String getElligibleRowStyle()
           
 BoatFilter getFilter()
          Filters to apply on boats list.
 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.
 List<SampleRow> getSampleRows()
          /////////////////////// FOR EACH ELLIGIBLEBOAT ROW /////////////////
 String getSummaryForSampleRowContext()
           
 boolean isElligibleBoatCompanyActiveFalse()
           
 boolean isFiltersVisible()
           
 boolean isSampleRowFinished()
          This method detect if the sampleRow from current elligibleBoat is finished.
 Object onActionFromCancelSelection()
           
protected  Object redirectAfterContactCreation(Contact newContact)
          Après avoir créé le contact, l'utilisateur doit être redirigé soit vers la liste des contacts, soit directement vers la formulaire de modification
 void setBoardingFromDate(Date boardingFromDate)
          Used by Tapestry to set the boardingFromDate from calculateBoardings form.
 void setBoatSelectedImmatriculation(Integer boatSelectedImmatriculation)
           
 void setCompany(Company company)
           
 
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

onActionFromCancelSelection

public Object onActionFromCancelSelection()

getSummaryForSampleRowContext

public String getSummaryForSampleRowContext()

getFilter

public BoatFilter getFilter()
                     throws WaoException
Filters to apply on boats list.

Returns:
the current BoatFilter to apply
Throws:
WaoException

getBoatFilter

public BoatFilter getBoatFilter()
                         throws WaoException
Throws:
WaoException

isFiltersVisible

public boolean isFiltersVisible()

getBoatSelectedImmatriculation

public Integer getBoatSelectedImmatriculation()
RIGHT PANEL


setBoatSelectedImmatriculation

public void setBoatSelectedImmatriculation(Integer boatSelectedImmatriculation)

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

setCompany

public void setCompany(Company company)

getContextForShipOwner

public String[] getContextForShipOwner()
Permet de construire l'URL pour le lien permettant de voir tous les navires d'un armateur.


getActiveBoatInfosBlock

public org.apache.tapestry5.Block getActiveBoatInfosBlock()

getCompanyBoatInfos

public CompanyBoatInfos getCompanyBoatInfos()
                                     throws WaoException
Throws:
WaoException

getCompanies

public List<Company> getCompanies()
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()
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)

getSampleRows

public List<SampleRow> getSampleRows()
/////////////////////// FOR EACH ELLIGIBLEBOAT ROW /////////////////


getElligibleBoatsValues

public List<ElligibleBoat> getElligibleBoatsValues()

getElligibleRowInfos

public String getElligibleRowInfos()

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

redirectAfterContactCreation

protected Object redirectAfterContactCreation(Contact newContact)
Après avoir créé le contact, l'utilisateur doit être redirigé soit vers la liste des contacts, soit directement vers la formulaire de modification

Parameters:
newContact - le contact qui vient d'être créé
Returns:
la page à retourner


Copyright © 2009-2012 Ifremer. All Rights Reserved.