Search in sources :

Example 16 with SessionStatus

use of org.openforis.collect.designer.session.SessionStatus in project collect by openforis.

the class SurveyLanguageVM method getSurveyAssignedLanguageCodes.

protected List<String> getSurveyAssignedLanguageCodes() {
    SessionStatus sessionStatus = getSessionStatus();
    CollectSurvey survey = sessionStatus.getSurvey();
    if (survey == null) {
        return null;
    } else {
        return survey.getLanguages();
    }
}
Also used : SessionStatus(org.openforis.collect.designer.session.SessionStatus) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 17 with SessionStatus

use of org.openforis.collect.designer.session.SessionStatus in project collect by openforis.

the class SurveyLanguageVM method performLanguageUpdate.

private void performLanguageUpdate(CollectSurvey survey, List<String> newLanguageCodes) {
    surveyManager.updateLanguages(survey, newLanguageCodes);
    if (assignedLanguages.isEmpty()) {
        MessageUtil.showWarning("survey.language.error.select_at_least_one_language");
    } else {
        SessionStatus sessionStatus = getSessionStatus();
        sessionStatus.setCurrentLanguageCode(survey.getDefaultLanguage());
        BindUtils.postGlobalCommand(null, null, SURVEY_LANGUAGES_CHANGED_COMMAND, null);
        BindUtils.postGlobalCommand(null, null, CURRENT_LANGUAGE_CHANGED_COMMAND, null);
    }
}
Also used : SessionStatus(org.openforis.collect.designer.session.SessionStatus)

Example 18 with SessionStatus

use of org.openforis.collect.designer.session.SessionStatus in project collect by openforis.

the class EditableListOfNodesVM method getLayoutFormVersion.

public ModelVersion getLayoutFormVersion() {
    SessionStatus sessionStatus = getSessionStatus();
    ModelVersion version = sessionStatus.getLayoutFormVersion();
    return version;
}
Also used : SessionStatus(org.openforis.collect.designer.session.SessionStatus) ModelVersion(org.openforis.idm.metamodel.ModelVersion)

Example 19 with SessionStatus

use of org.openforis.collect.designer.session.SessionStatus in project collect by openforis.

the class EditableListOfNodesVM method getSurvey.

protected CollectSurvey getSurvey() {
    SessionStatus sessionStatus = super.getSessionStatus();
    CollectSurvey survey = sessionStatus.getSurvey();
    return survey;
}
Also used : SessionStatus(org.openforis.collect.designer.session.SessionStatus) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 20 with SessionStatus

use of org.openforis.collect.designer.session.SessionStatus in project collect by openforis.

the class TabsGroupPanelVM method getSurvey.

protected CollectSurvey getSurvey() {
    SessionStatus sessionStatus = super.getSessionStatus();
    CollectSurvey survey = sessionStatus.getSurvey();
    return survey;
}
Also used : SessionStatus(org.openforis.collect.designer.session.SessionStatus) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Aggregations

SessionStatus (org.openforis.collect.designer.session.SessionStatus)21 CollectSurvey (org.openforis.collect.model.CollectSurvey)9 Command (org.zkoss.bind.annotation.Command)3 CodeList (org.openforis.idm.metamodel.CodeList)2 ModelVersion (org.openforis.idm.metamodel.ModelVersion)2 NodeDefinition (org.openforis.idm.metamodel.NodeDefinition)2 GlobalCommand (org.zkoss.bind.annotation.GlobalCommand)2 NotifyChange (org.zkoss.bind.annotation.NotifyChange)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 MessageUtil (org.openforis.collect.designer.util.MessageUtil)1 ConfirmParams (org.openforis.collect.designer.util.MessageUtil.ConfirmParams)1 CodeListImportProcess (org.openforis.collect.manager.codelistimport.CodeListImportProcess)1 CodeListImportStatus (org.openforis.collect.manager.codelistimport.CodeListImportStatus)1 UIOptions (org.openforis.collect.metamodel.ui.UIOptions)1 UITabSet (org.openforis.collect.metamodel.ui.UITabSet)1 Schema (org.openforis.idm.metamodel.Schema)1 Secured (org.springframework.security.access.annotation.Secured)1 Init (org.zkoss.bind.annotation.Init)1