Class SurveyBaseVM

java.lang.Object
org.openforis.collect.designer.viewmodel.BaseVM
org.openforis.collect.designer.viewmodel.SurveyBaseVM
Direct Known Subclasses:
AttributeConversionVM, BaseSurveyFileImportVM, CodeListsPopUpVM, CollectEarthPreviewPopUpVM, PreviewPopUpVM, PreviewPreferencesVM, SamplingPointDataVM, SchemaObjectSelectorPopUpVM, SchemaVM, SurveyEditVM, SurveyFileRandomGridGenerationParametersPopUpVM, SurveyObjectBaseVM

public abstract class SurveyBaseVM extends BaseVM
Author:
S. Ricci
  • Field Details

  • Constructor Details

    • SurveyBaseVM

      public SurveyBaseVM()
  • Method Details

    • init

      public void init()
    • versionsUpdated

      public void versionsUpdated()
    • codeListsUpdated

      public void codeListsUpdated()
    • unitsUpdated

      public void unitsUpdated()
    • tabSetsUpdated

      public void tabSetsUpdated()
    • taxonomiesUpdated

      public void taxonomiesUpdated()
    • currentFormValidated

      public void currentFormValidated(boolean valid, Boolean blocking, Map<String,List<String>> validationMessagesByField)
    • undoLastChanges

      public void undoLastChanges(org.zkoss.zk.ui.Component view)
    • undoLastChanges

      public void undoLastChanges()
    • dispatchCurrentFormValidatedCommand

      public void dispatchCurrentFormValidatedCommand()
    • dispatchCurrentFormValidatedCommand

      public void dispatchCurrentFormValidatedCommand(boolean valid)
    • dispatchCurrentFormValidatedCommand

      public void dispatchCurrentFormValidatedCommand(boolean valid, boolean blocking)
    • dispatchCurrentFormValidatedCommand

      public void dispatchCurrentFormValidatedCommand(boolean valid, boolean blocking, Map<String,List<String>> validationMessagesByField)
    • dispatchSurveyChangedCommand

      public void dispatchSurveyChangedCommand()
    • dispatchSchemaChangedCommand

      public void dispatchSchemaChangedCommand()
    • dispatchTaxonomiesUpdatedCommand

      public void dispatchTaxonomiesUpdatedCommand()
    • dispatchNodeConvertedCommand

      public void dispatchNodeConvertedCommand(NodeDefinition nodeDef)
    • dispatchValidateAllCommand

      protected void dispatchValidateAllCommand()
    • checkCanLeaveForm

      public boolean checkCanLeaveForm()
    • checkCanLeaveForm

      public boolean checkCanLeaveForm(SurveyBaseVM.CanLeaveFormConfirmHandler confirmHandler)
      If the current form is valid, execute the onOk method of the specified confirmHandler and returns true, otherwise shows a confirm message handled by the specified confirmHandler and returns false If the form is not valid and the confirmHandler is not specified, shows a warning message.
      Parameters:
      confirmHandler -
      Returns:
    • checkCanLeaveForm

      public boolean checkCanLeaveForm(SurveyBaseVM.CanLeaveFormConfirmHandler confirmHandler, String messageKey)
    • initSurvey

      protected void initSurvey()
    • getSurvey

      public CollectSurvey getSurvey()
    • getSurveyId

      public Integer getSurveyId()
    • isCollectEarthSurvey

      public boolean isCollectEarthSurvey()
    • isSurveyStored

      public boolean isSurveyStored()
    • isSurveyPublished

      public boolean isSurveyPublished()
    • isSurveyChanged

      public boolean isSurveyChanged()
    • getRootVM

      protected SurveyEditVM getRootVM()
    • currentLanguageChanged

      public void currentLanguageChanged()
    • surveyChanged

      public void surveyChanged()
    • surveySaved

      public void surveySaved()
    • getDateFormat

      public String getDateFormat()
    • getFormVersions

      public List<ModelVersion> getFormVersions()
    • getFormVersionsWithEmptyOption

      public List<Object> getFormVersionsWithEmptyOption()
    • getFormVersionIdsWithEmptyOption

      public List<Integer> getFormVersionIdsWithEmptyOption()
    • getVersionLabel

      public String getVersionLabel(int id)
    • getRootEntities

      public List<EntityDefinition> getRootEntities()
    • isSingleRootEntityDefined

      public boolean isSingleRootEntityDefined()
    • getCodeLists

      public List<CodeList> getCodeLists()
    • getTaxonomyNames

      public List<String> getTaxonomyNames()
    • getUnits

      public List<Unit> getUnits()
    • getUnitNames

      public List<String> getUnitNames()
    • getUnitLabelFromPrecision

      public String getUnitLabelFromPrecision(Precision precision)
    • getUnitLabelFromName

      public String getUnitLabelFromName(String name)
    • getUnitLabel

      public String getUnitLabel(Unit unit)
    • getUnitLabel

      public String getUnitLabel(UnitFormObject unitFormObject)
    • isDefaultLanguage

      public boolean isDefaultLanguage()
    • getDefaultLanguageCode

      public String getDefaultLanguageCode()
    • getCurrentLanguageCode

      public String getCurrentLanguageCode()
      Overrides:
      getCurrentLanguageCode in class BaseVM
    • isCurrentFormValid

      public boolean isCurrentFormValid()
    • isCurrentFormBlocking

      public boolean isCurrentFormBlocking()
    • getExpressionValidator

      public ExpressionValidator getExpressionValidator()
    • sortByName

      protected <T extends NamedObject> List<T> sortByName(List<T> items)
    • createBasicModuleParameters

      protected Map<String,String> createBasicModuleParameters()
    • isCurrentEditedSurvey

      public boolean isCurrentEditedSurvey(SurveySummary surveySummary)
    • getEditableRecordStepNames

      public List<String> getEditableRecordStepNames()
    • isSurveyRelatedToPublishedSurvey

      protected boolean isSurveyRelatedToPublishedSurvey()