Search in sources :

Example 1 with Version

use of org.openforis.commons.versioning.Version in project collect by openforis.

the class CollectInfoService method getCompleteInfo.

public CollectCompleteInfo getCompleteInfo() {
    Version latestRelease = latestRelease();
    Version currentVersion = Collect.VERSION;
    CollectCompleteInfo info = new CollectCompleteInfo(currentVersion, latestRelease);
    return info;
}
Also used : Version(org.openforis.commons.versioning.Version) CollectCompleteInfo(org.openforis.collect.CollectCompleteInfo)

Example 2 with Version

use of org.openforis.commons.versioning.Version in project collect by openforis.

the class CollectInfoService method getCompleteInfo.

public CollectCompleteInfo getCompleteInfo(HttpServletRequest request) {
    Version latestRelease = latestRelease();
    Version currentVersion = Collect.VERSION;
    CollectCompleteInfo info = new CollectCompleteInfo(currentVersion, latestRelease);
    info.setSaikuUrl(determineSaikuUrl(request));
    return info;
}
Also used : Version(org.openforis.commons.versioning.Version) CollectCompleteInfo(org.openforis.collect.CollectCompleteInfo)

Example 3 with Version

use of org.openforis.commons.versioning.Version in project collect by openforis.

the class NewBackupFileExtractor method getInfo.

public SurveyBackupInfo getInfo() {
    if (info == null) {
        if (isOldFormat()) {
            info = new SurveyBackupInfo();
            info.setCollectVersion(new Version("3.9.0"));
        } else {
            info = extractInfo();
        }
    }
    return info;
}
Also used : Version(org.openforis.commons.versioning.Version)

Example 4 with Version

use of org.openforis.commons.versioning.Version in project collect by openforis.

the class SurveyBackupInfo method parse.

protected static SurveyBackupInfo parse(Properties props) {
    SurveyBackupInfo info = new SurveyBackupInfo();
    info.surveyUri = props.getProperty(SURVEY_URI_PROP);
    info.surveyName = props.getProperty(SURVEY_NAME_PROP);
    info.collectVersion = new Version(props.getProperty(COLLECT_VERSION_PROP));
    String timestampString = props.getProperty(TIMESTAMP_PROP);
    if (timestampString == null) {
        info.timestamp = Dates.parseDate(props.getProperty(DATE_PROP));
    } else {
        info.timestamp = Dates.parseDateTime(timestampString);
    }
    return info;
}
Also used : Version(org.openforis.commons.versioning.Version)

Example 5 with Version

use of org.openforis.commons.versioning.Version in project collect by openforis.

the class SurveyImportVM method onSummaryCreationComplete.

protected void onSummaryCreationComplete() {
    SurveyBackupInfo info = summaryJob.getInfo();
    Version version = VERSION;
    if (version != null && version.compareTo(info.getCollectVersion(), VERSION_SIGNIFICANCE) < 0) {
        MessageUtil.showError("survey.import_survey.error.outdated_system_version");
    } else {
        survey = summaryJob.getSurvey();
        uploadedSurveyUri = info.getSurveyUri();
        uploadedSurveyName = info.getSurveyName();
        summaryJob = null;
        notifyChange("uploadedSurveyUri");
        updateForm();
    }
}
Also used : SurveyBackupInfo(org.openforis.collect.io.SurveyBackupInfo) Version(org.openforis.commons.versioning.Version)

Aggregations

Version (org.openforis.commons.versioning.Version)11 CollectCompleteInfo (org.openforis.collect.CollectCompleteInfo)2 CollectSurvey (org.openforis.collect.model.CollectSurvey)2 IdmlParseException (org.openforis.idm.metamodel.xml.IdmlParseException)2 InputStream (java.io.InputStream)1 DocumentBuilder (javax.xml.parsers.DocumentBuilder)1 DocumentBuilderFactory (javax.xml.parsers.DocumentBuilderFactory)1 HttpEntity (org.apache.http.HttpEntity)1 CloseableHttpResponse (org.apache.http.client.methods.CloseableHttpResponse)1 HttpGet (org.apache.http.client.methods.HttpGet)1 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)1 SurveyBackupInfo (org.openforis.collect.io.SurveyBackupInfo)1 ApplicationInfo (org.openforis.collect.model.ApplicationInfo)1 CollectRecord (org.openforis.collect.model.CollectRecord)1 EntityDefinition (org.openforis.idm.metamodel.EntityDefinition)1 ModelVersion (org.openforis.idm.metamodel.ModelVersion)1 Schema (org.openforis.idm.metamodel.Schema)1 Entity (org.openforis.idm.model.Entity)1 ModelSerializer (org.openforis.idm.model.ModelSerializer)1 Document (org.w3c.dom.Document)1