fr.ifremer.wao.ui.data
Class FiltersModel<F extends WaoFilter>

java.lang.Object
  extended by fr.ifremer.wao.ui.data.FiltersModel<F>

public class FiltersModel<F extends WaoFilter>
extends Object

Created: 24 juil. 2010

Version:
$Id: FiltersModel.java 809 2010-11-26 16:00:26Z tchemit $
Author:
fdesbois

Constructor Summary
FiltersModel(org.apache.tapestry5.ioc.services.PropertyAccess propertyAccess)
           
FiltersModel(org.apache.tapestry5.ioc.services.PropertyAccess propertyAccess, F filter)
           
 
Method Summary
 String getCompanyId()
           
 GenericSelectModel<Company> getCompanySelectModel()
          Retrieve Company SelectModel to used in page.
 F getFilter()
          Get the filter.
 org.apache.tapestry5.SelectModel getProgramSelectModel()
          Get select model for sampleRow program.
 String getSampleRowId()
           
 GenericSelectModel<SampleRow> getSampleRowSelectModel()
          Get select model for sampleRows.
protected  SamplingFilter getSamplingFilter()
           
protected  UserFilter getUserFilter()
           
 void setCompanyActive(boolean companyActive)
           
 void setCompanyId(String companyId)
          Set the company in filter from its companyId.
 void setSampleRowId(String sampleRowId)
           
 void setServiceSampling(ServiceSampling serviceSampling)
          ServiceSampling is used for filters : PROGRAM_NAME, SAMPLE_ROW.
 void setServiceUser(ServiceUser serviceUser)
          ServiceUser is used for filters : COMPANY.
 void update(F filter)
           
 void updateCompany(String companyId)
          Update company with companyId.
 void updateProgram(String programName)
          Update program with programName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FiltersModel

public FiltersModel(org.apache.tapestry5.ioc.services.PropertyAccess propertyAccess)

FiltersModel

public FiltersModel(org.apache.tapestry5.ioc.services.PropertyAccess propertyAccess,
                    F filter)
Method Detail

setServiceUser

public void setServiceUser(ServiceUser serviceUser)
ServiceUser is used for filters : COMPANY.

Parameters:
serviceUser - ServiceUser to set

setServiceSampling

public void setServiceSampling(ServiceSampling serviceSampling)
ServiceSampling is used for filters : PROGRAM_NAME, SAMPLE_ROW.

Parameters:
serviceSampling - ServiceSampling to set

setCompanyActive

public void setCompanyActive(boolean companyActive)

update

public void update(F filter)

getCompanySelectModel

public GenericSelectModel<Company> getCompanySelectModel()
                                                  throws IllegalStateException
Retrieve Company SelectModel to used in page.

Returns:
the GenericSelectModel for Company
Throws:
IllegalStateException - if ServiceUser is not defined
See Also:
ServiceUser.getCompanies(boolean)

setCompanyId

public void setCompanyId(String companyId)
                  throws IllegalStateException
Set the company in filter from its companyId. The company object will be retrieve from the Company SelectModel. If you want to set directly the company, do it directly on the filter using getFilter() method.

Parameters:
companyId - Id of the company to set
Throws:
IllegalStateException - if Company SelectModel is not defined

getCompanyId

public String getCompanyId()

updateCompany

public void updateCompany(String companyId)
Update company with companyId. Will reset dependent selects (PROGRAM_NAME, SAMPLE_ROW).

Parameters:
companyId - Company id to set

getProgramSelectModel

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

Returns:
the SelectModel for program names

updateProgram

public void updateProgram(String programName)
Update program with programName. Will reset dependent selects (SAMPLE_ROW).

Parameters:
programName - Name of the program to set

getSampleRowSelectModel

public GenericSelectModel<SampleRow> getSampleRowSelectModel()
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

setSampleRowId

public void setSampleRowId(String sampleRowId)

getSampleRowId

public String getSampleRowId()

getFilter

public F getFilter()
Get the filter.

Returns:
the current filter associated to this model.

getUserFilter

protected UserFilter getUserFilter()

getSamplingFilter

protected SamplingFilter getSamplingFilter()


Copyright © 2009-2010 Ifremer. All Rights Reserved.