Class CodeListsVM
- java.lang.Object
-
- org.openforis.collect.designer.viewmodel.BaseVM
-
- org.openforis.collect.designer.viewmodel.SurveyBaseVM
-
- org.openforis.collect.designer.viewmodel.SurveyObjectBaseVM<CodeList>
-
- org.openforis.collect.designer.viewmodel.CodeListsVM
-
public class CodeListsVM extends SurveyObjectBaseVM<CodeList>
- Author:
- S. Ricci
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openforis.collect.designer.viewmodel.SurveyBaseVM
SurveyBaseVM.CanLeaveFormCompleteConfirmHandler, SurveyBaseVM.CanLeaveFormConfirmHandler, SurveyBaseVM.SurveyType
-
-
Field Summary
Fields Modifier and Type Field Description static StringCLOSE_CODE_LIST_IMPORT_POP_UP_COMMANDstatic StringCLOSE_CODE_LIST_ITEM_POP_UP_COMMANDstatic StringEDITING_ATTRIBUTE_PARAMstatic StringSELECTED_CODE_LIST_PARAM-
Fields inherited from class org.openforis.collect.designer.viewmodel.SurveyObjectBaseVM
APPLY_CHANGES_COMMAND, changed, COMMIT_CHANGES_COMMAND, commitChangesOnApply, editedItem, formObject, newItem, selectedItem, VALIDATE_COMMAND
-
Fields inherited from class org.openforis.collect.designer.viewmodel.SurveyBaseVM
currentLanguageCode, DATE_FORMAT, fieldLabelKeyPrefixes, NODE_CONVERTED_GLOBAL_COMMAND, SCHEMA_CHANGED_GLOBAL_COMMAND, schemaUpdater, survey, SURVEY_CHANGED_GLOBAL_COMMAND, SURVEY_SAVED_GLOBAL_COMMAND, UNDO_LAST_CHANGES_GLOBAL_COMMAND, VALIDATE_ALL_GLOBAL_COMMAND, VERSIONS_UPDATED_GLOBAL_COMMAND
-
Fields inherited from class org.openforis.collect.designer.viewmodel.BaseVM
COLLECT_EARTH_PROJECT_FILE_CREATOR_LOADER, jobManager, userGroupManager, userManager
-
-
Constructor Summary
Constructors Constructor Description CodeListsVM()
-
Method Summary
-
Methods inherited from class org.openforis.collect.designer.viewmodel.SurveyObjectBaseVM
applyChanges, currentLanguageChanged, deleteItem, dispatchApplyChangesCommand, dispatchValidateCommand, getConfirmDeleteMessageKey, getEditedItem, getFormObject, getItems, getNameTextbox, getSelectedItem, getSelectedItemIndex, isChanged, isCommitChangesOnApply, isEditingItem, isMoveSelectedItemDownDisabled, isMoveSelectedItemUpDisabled, isNewItem, moveSelectedItem, moveSelectedItem, moveSelectedItemDown, moveSelectedItemUp, newItem, performDeleteItem, resetEditedItem, selectionChanged, setCommitChangesOnApply, setFocusOnNameTextbox, setSelectedItem, suggestInternalName, suggestLabel, undoLastChanges, validate, validateAll, validateForm
-
Methods inherited from class org.openforis.collect.designer.viewmodel.SurveyBaseVM
checkCanLeaveForm, checkCanLeaveForm, checkCanLeaveForm, createBasicModuleParameters, currentFormValidated, dispatchCurrentFormValidatedCommand, dispatchCurrentFormValidatedCommand, dispatchCurrentFormValidatedCommand, dispatchCurrentFormValidatedCommand, dispatchNodeConvertedCommand, dispatchSchemaChangedCommand, dispatchSurveyChangedCommand, dispatchTaxonomiesUpdatedCommand, dispatchValidateAllCommand, getCodeLists, getCurrentLanguageCode, getDateFormat, getDefaultLanguageCode, getEditableRecordStepNames, getExpressionValidator, getFormVersionIdsWithEmptyOption, getFormVersions, getFormVersionsWithEmptyOption, getRootEntities, getRootVM, getSurvey, getSurveyId, getTaxonomyNames, getUnitLabel, getUnitLabelFromPrecision, getUnits, getVersionLabel, init, initSurvey, isCollectEarthSurvey, isCurrentEditedSurvey, isCurrentFormBlocking, isCurrentFormValid, isDefaultLanguage, isSingleRootEntityDefined, isSurveyChanged, isSurveyPublished, isSurveyRelatedToPublishedSurvey, isSurveyStored, sortByName, surveyChanged, surveySaved, tabSetsUpdated, taxonomiesUpdated, undoLastChanges, unitsUpdated, versionsUpdated
-
Methods inherited from class org.openforis.collect.designer.viewmodel.BaseVM
closePopUp, getComponentsPath, getDefaultPublicUserGroupItem, getFormFieldValue, getFormFieldValue, getInitParameter, getLoggedUser, getLoggedUsername, getSession, getSessionStatus, getUserGroupsModel, initUserGroupsModel, joinList, joinValues, notifyChange, openPopUp, openPopUp, prettyDateFormat, setFormFieldValue, setFormFieldValue
-
-
-
-
Field Detail
-
EDITING_ATTRIBUTE_PARAM
public static final String EDITING_ATTRIBUTE_PARAM
- See Also:
- Constant Field Values
-
SELECTED_CODE_LIST_PARAM
public static final String SELECTED_CODE_LIST_PARAM
- See Also:
- Constant Field Values
-
CLOSE_CODE_LIST_ITEM_POP_UP_COMMAND
public static final String CLOSE_CODE_LIST_ITEM_POP_UP_COMMAND
- See Also:
- Constant Field Values
-
CLOSE_CODE_LIST_IMPORT_POP_UP_COMMAND
public static final String CLOSE_CODE_LIST_IMPORT_POP_UP_COMMAND
- See Also:
- Constant Field Values
-
-
Method Detail
-
doAfterCompose
public void doAfterCompose(org.zkoss.zk.ui.Component view)
- Overrides:
doAfterComposein classSurveyObjectBaseVM<CodeList>
-
getItemsInternal
protected List<CodeList> getItemsInternal()
- Specified by:
getItemsInternalin classSurveyObjectBaseVM<CodeList>
-
addNewItemToSurvey
protected void addNewItemToSurvey()
- Specified by:
addNewItemToSurveyin classSurveyObjectBaseVM<CodeList>
-
deleteItemFromSurvey
protected void deleteItemFromSurvey(CodeList item)
- Specified by:
deleteItemFromSurveyin classSurveyObjectBaseVM<CodeList>
-
createFormObject
protected FormObject<CodeList> createFormObject()
- Specified by:
createFormObjectin classSurveyObjectBaseVM<CodeList>
-
dispatchCodeListsUpdatedCommand
public static void dispatchCodeListsUpdatedCommand()
-
performNewItemCreation
protected void performNewItemCreation(org.zkoss.bind.Binder binder)
- Overrides:
performNewItemCreationin classSurveyObjectBaseVM<CodeList>
-
createItemInstance
protected CodeList createItemInstance()
- Specified by:
createItemInstancein classSurveyObjectBaseVM<CodeList>
-
performItemSelection
protected void performItemSelection(CodeList item)
- Overrides:
performItemSelectionin classSurveyObjectBaseVM<CodeList>
-
moveSelectedItemInSurvey
protected void moveSelectedItemInSurvey(int indexTo)
- Specified by:
moveSelectedItemInSurveyin classSurveyObjectBaseVM<CodeList>
-
deleteCodeList
public void deleteCodeList(CodeList item)
-
closeReferencedNodesPopUp
protected void closeReferencedNodesPopUp()
-
getReferences
protected List<NodeDefinition> getReferences(CodeList item)
-
typeChanged
public void typeChanged(String type)
-
addLevel
public void addLevel()
-
removeLevel
public void removeLevel()
-
getHierarchyLevelNameValidationKey
public String getHierarchyLevelNameValidationKey(int levelIdx)
-
getHierarchyLevelNameValidator
public org.zkoss.bind.Validator getHierarchyLevelNameValidator(int levelIdx)
-
performRemoveLevel
protected void performRemoveLevel(int levelIndex)
-
addItemInLevel
public void addItemInLevel(int levelIndex)
-
createChildItem
protected CodeListItem createChildItem()
-
deleteCodeListItem
public void deleteCodeListItem(CodeListItem item)
-
isEnumeratingCodeList
protected boolean isEnumeratingCodeList()
-
performDeleteCodeListItem
protected void performDeleteCodeListItem(CodeListItem item)
-
moveChildItem
public void moveChildItem(org.zkoss.zk.ui.event.DropEvent event)
-
setEditedItem
public void setEditedItem(CodeList editedItem)
- Overrides:
setEditedItemin classSurveyObjectBaseVM<CodeList>
-
editCodeListItem
public void editCodeListItem(CodeListItem item)
-
batchImportFileUploaded
public void batchImportFileUploaded(org.zkoss.zk.ui.event.UploadEvent event)
-
batchExport
public void batchExport()
-
codeListsUpdated
public void codeListsUpdated()
- Overrides:
codeListsUpdatedin classSurveyBaseVM
-
generateItemCode
protected String generateItemCode(CodeListItem item)
-
openChildItemEditPopUp
public void openChildItemEditPopUp()
-
listItemSelected
public void listItemSelected(CodeListItem item, int levelIndex)
-
isMultipleLevelsPresent
public boolean isMultipleLevelsPresent()
-
deselectItemsAfterLevel
protected void deselectItemsAfterLevel(int levelIndex)
-
moveChildItem
protected void moveChildItem(CodeListItem item, int toIndex)
-
reloadSiblingsSortOrder
protected void reloadSiblingsSortOrder(PersistedCodeListItem item)
Reloads the siblings from the database. The sort order of these items changes after calling codeListManager.shiftItem method.- Parameters:
item-
-
getLevelIndex
protected int getLevelIndex(CodeListItem item)
-
getSiblings
protected List<CodeListItem> getSiblings(CodeListItem item)
-
getItemIndex
protected int getItemIndex(CodeListItem item)
-
closeCodeListItemPopUp
public void closeCodeListItemPopUp(boolean undoChanges, boolean imageModified, FileWrapper imageFileWrapper)
-
commitChanges
public void commitChanges(org.zkoss.bind.Binder binder)
- Overrides:
commitChangesin classSurveyObjectBaseVM<CodeList>
-
openCodeListImportPopUp
public void openCodeListImportPopUp()
-
exportCodeListToCsv
public void exportCodeListToCsv() throws IOException- Throws:
IOException
-
exportCodeListToExcel
public void exportCodeListToExcel() throws IOException- Throws:
IOException
-
closeReferenceDataImportErrorPopUp
public void closeReferenceDataImportErrorPopUp()
-
canImportCodeList
protected boolean canImportCodeList()
-
isCodeListInPublishedSurvey
protected boolean isCodeListInPublishedSurvey()
-
closeCodeListImportPopUp
public void closeCodeListImportPopUp()
-
closeCodeListsManagerPopUp
public void closeCodeListsManagerPopUp()
-
initItemsPerLevel
protected void initItemsPerLevel()
-
getListLevels
public List<CodeListLevel> getListLevels()
-
getSelectedItemsPerLevel
public List<CodeListItem> getSelectedItemsPerLevel()
-
getLastSelectedLevelIndex
public int getLastSelectedLevelIndex()
-
getItemsPerLevel
public List<List<CodeListItem>> getItemsPerLevel()
-
isCodeListItemSelected
public boolean isCodeListItemSelected(CodeListItem item)
-
hasChildItems
public boolean hasChildItems(CodeListItem item)
-
getCodeListItemLabel
public String getCodeListItemLabel(CodeListItem item)
-
isEditingAttribute
public boolean isEditingAttribute()
-
hasWarnings
public boolean hasWarnings(CodeList list)
-
close
public void close(org.zkoss.zk.ui.event.Event event)
-
closeJobStatusPopUp
protected void closeJobStatusPopUp()
-
-