use of org.zkoss.bind.annotation.Init in project collect by openforis.
the class NewSurveyParametersPopUpVM method init.
@Init(superclass = false)
public void init() {
super.init();
form = new HashMap<String, Object>();
nameValidator = new SurveyNameValidator(surveyManager, SURVEY_NAME_FIELD, true);
initLanguageModel();
initTemplatesModel();
initUserGroupsModel();
form.put(USER_GROUP_FIELD_NAME, getDefaultPublicUserGroupItem());
}
use of org.zkoss.bind.annotation.Init in project collect by openforis.
the class PreviewPopUpVM method init.
@Init(superclass = false)
public void init(@ExecutionArgParam("surveyId") String surveyId, @ExecutionArgParam("work") String work, @ExecutionArgParam("rootEntityId") String rootEntityId, @ExecutionArgParam("versionId") String versionId, @ExecutionArgParam("locale") String locale, @ExecutionArgParam("recordStep") String recordStep) throws URISyntaxException {
super.init();
URIBuilder uriBuilder = new URIBuilder(Resources.Page.PREVIEW_PATH.getLocation());
uriBuilder.addParameter("preview", "true");
uriBuilder.addParameter("surveyId", surveyId);
uriBuilder.addParameter("work", work);
uriBuilder.addParameter("rootEntityId", rootEntityId);
uriBuilder.addParameter("locale", locale);
if (StringUtils.isNotBlank(versionId)) {
uriBuilder.addParameter("versionId", versionId);
}
uriBuilder.addParameter("recordStep", recordStep);
this.uri = uriBuilder.build().toString();
}
use of org.zkoss.bind.annotation.Init in project collect by openforis.
the class SurveyExportParametersVM method init.
@Init
public void init(@ExecutionArgParam("survey") SurveySummary survey) {
this.surveySummary = survey;
this.formObject = new SurveyExportParametersFormObject();
String outputFormat = (survey.getTarget() == COLLECT_EARTH ? EARTH : DESKTOP).name();
this.formObject.setOutputFormat(outputFormat);
this.formObject.setType((survey.isNotLinkedToPublishedSurvey() ? TEMPORARY : PUBLISHED).name());
this.formObject.setRdbDialect(RdbDialect.STANDARD.name());
this.formObject.setRdbDateTimeFormat(DEFAULT_DATE_TIME_FORMAT);
this.formObject.setRdbTargetSchemaName(survey.getName());
this.formObject.setLanguageCode(survey.getDefaultLanguage());
this.tempForm = new SimpleForm();
}
use of org.zkoss.bind.annotation.Init in project collect by openforis.
the class SurveyLanguageVM method init.
@Init
public void init() {
languages = new ArrayList<LabelledItem>();
List<String> codes = Languages.getCodes(Standard.ISO_639_1);
for (String code : codes) {
LabelledItem item = new LabelledItem(code, Labels.getLabel(code));
languages.add(item);
}
Collections.sort(languages, new LabelComparator());
assignedLanguages = getSurveyAssignedLanguages();
}
use of org.zkoss.bind.annotation.Init in project collect by openforis.
the class SchemaTreePopUpVM method init.
@Init(superclass = false)
public void init(@ExecutionArgParam("rootEntity") EntityDefinition rootEntity, @ExecutionArgParam("version") ModelVersion version, @ExecutionArgParam("includedNodePredicate") Predicate<SurveyObject> includedNodePredicate, @ExecutionArgParam("includeRootEntity") boolean includeRootEntity, @ExecutionArgParam("includeEmptyNodes") boolean includeEmtptyNodes, @ExecutionArgParam("disabledNodePredicate") Predicate<SurveyObject> disabledNodePredicate, @ExecutionArgParam("selectableNodePredicate") Predicate<SurveyObject> selectableNodePredicate, @ExecutionArgParam("selection") SurveyObject selection, @ExecutionArgParam("allowEmptySelection") boolean allowEmptySelection) {
super.init();
SurveyObjectTreeModelCreator modelCreator = new UITreeModelCreator(version, disabledNodePredicate, includedNodePredicate, includeRootEntity, includeEmtptyNodes, currentLanguageCode);
this.treeModel = modelCreator.createModel(rootEntity);
this.treeModel.openAllItems();
this.selectableNodePredicate = selectableNodePredicate;
this.disabledNodePredicate = disabledNodePredicate;
this.allowEmptySelection = allowEmptySelection;
if (selection != null) {
this.selectedNode = selection;
this.treeModel.select(selection);
this.treeModel.showSelectedNode();
}
}
Aggregations