Search in sources :

Example 36 with ModelVersion

use of org.openforis.idm.metamodel.ModelVersion in project collect by openforis.

the class CollectRecordSummary method fromRecord.

public static CollectRecordSummary fromRecord(CollectRecord r) {
    CollectSurvey survey = (CollectSurvey) r.getSurvey();
    ModelVersion version = r.getVersion();
    CollectRecordSummary summary = new CollectRecordSummary();
    summary.setCreatedBy(r.getCreatedBy());
    summary.setCreationDate(r.getCreationDate());
    summary.setId(r.getId());
    summary.setModifiedBy(r.getModifiedBy());
    summary.setModifiedDate(r.getModifiedDate());
    summary.setSurvey(survey);
    summary.setVersion(version);
    summary.setOwner(r.getOwner());
    summary.setRootEntityDefinitionId(r.getRootEntityDefinitionId());
    summary.setStep(r.getStep());
    summary.setWorkflowSequenceNumber(r.getWorkflowSequenceNumber());
    StepSummary stepSummary = new StepSummary(r.getStep());
    stepSummary.setSequenceNumber(r.getDataWorkflowSequenceNumber());
    stepSummary.setState(r.getState());
    stepSummary.setCompletionPercent(r.calculateCompletionPercent());
    stepSummary.setEntityCounts(r.getEntityCounts());
    stepSummary.setTotalErrors(r.getTotalErrors());
    stepSummary.setErrors(r.getErrors());
    stepSummary.setFilledAttributesCount(r.countTotalFilledAttributes());
    stepSummary.setMissing(r.getMissing());
    stepSummary.setMissingErrors(r.getMissingErrors());
    stepSummary.setMissingWarnings(r.getMissingWarnings());
    stepSummary.setRootEntityKeyValues(r.getRootEntityKeyValues());
    stepSummary.setSkipped(r.getSkipped());
    stepSummary.setTotalErrors(r.getTotalErrors());
    stepSummary.setWarnings(r.getWarnings());
    summary.addStepSummary(stepSummary);
    return summary;
}
Also used : ModelVersion(org.openforis.idm.metamodel.ModelVersion)

Example 37 with ModelVersion

use of org.openforis.idm.metamodel.ModelVersion in project collect by openforis.

the class VersioningVM method getItemsInternal.

@Override
protected List<ModelVersion> getItemsInternal() {
    CollectSurvey survey = getSurvey();
    List<ModelVersion> versions = survey.getSortedVersions();
    return versions;
}
Also used : ModelVersion(org.openforis.idm.metamodel.ModelVersion) CollectSurvey(org.openforis.collect.model.CollectSurvey)

Example 38 with ModelVersion

use of org.openforis.idm.metamodel.ModelVersion in project collect by openforis.

the class VersioningVM method isVersionInUse.

protected boolean isVersionInUse(ModelVersion version, VersionableSurveyObject object) {
    ModelVersion sinceVersion = object.getSinceVersion();
    ModelVersion deprecatedVersion = object.getDeprecatedVersion();
    return version.equals(sinceVersion) || version.equals(deprecatedVersion);
}
Also used : ModelVersion(org.openforis.idm.metamodel.ModelVersion)

Example 39 with ModelVersion

use of org.openforis.idm.metamodel.ModelVersion 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 40 with ModelVersion

use of org.openforis.idm.metamodel.ModelVersion in project collect by openforis.

the class TabsGroupPanelVM method getFormVersion.

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

Aggregations

ModelVersion (org.openforis.idm.metamodel.ModelVersion)40 ArrayList (java.util.ArrayList)9 NodeDefinition (org.openforis.idm.metamodel.NodeDefinition)9 Record (org.openforis.idm.model.Record)9 CollectSurvey (org.openforis.collect.model.CollectSurvey)7 CodeAttributeDefinition (org.openforis.idm.metamodel.CodeAttributeDefinition)7 CodeListItem (org.openforis.idm.metamodel.CodeListItem)7 CodeList (org.openforis.idm.metamodel.CodeList)5 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)5 ExternalCodeListItem (org.openforis.idm.metamodel.ExternalCodeListItem)5 PersistedCodeListItem (org.openforis.idm.metamodel.PersistedCodeListItem)5 CodeAttribute (org.openforis.idm.model.CodeAttribute)5 Code (org.openforis.idm.model.Code)4 Entity (org.openforis.idm.model.Entity)4 SessionStatus (org.openforis.collect.designer.session.SessionStatus)2 UIOptions (org.openforis.collect.metamodel.ui.UIOptions)2 Survey (org.openforis.idm.metamodel.Survey)2 NodePointer (org.openforis.idm.model.NodePointer)2 Command (org.zkoss.bind.annotation.Command)2 GlobalCommand (org.zkoss.bind.annotation.GlobalCommand)2