Commit 98d79130 authored by Matija Obreza's avatar Matija Obreza

Using Api1Constants from genesys-client-api library

parent eedff62d
......@@ -28,6 +28,11 @@ import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
......@@ -39,6 +44,7 @@ import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Dialog;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
......@@ -53,20 +59,14 @@ import org.genesys2.anno.converter.RowConverter;
import org.genesys2.anno.model.OAuthSettings;
import org.genesys2.anno.model.Settings;
import org.genesys2.anno.parser.RowReader;
import org.genesys2.anno.predefined.Api1Constants;
import org.genesys2.client.oauth.GenesysApiException;
import org.genesys2.client.oauth.GenesysClient;
import org.genesys2.client.oauth.OAuthAuthenticationException;
import org.genesys2.client.oauth.PleaseRetryException;
import org.genesys2.client.oauth.api.accession.Api1Constants;
import org.springframework.beans.factory.annotation.Autowired;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import swing2swt.layout.BorderLayout;
import org.eclipse.swt.widgets.Control;
public class PushDialog extends Dialog {
private static final Logger _log = Logger.getLogger(PushDialog.class);
......
/**
* Copyright 2015 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package org.genesys2.anno.predefined;
/**
* @author mobreza
*/
public interface Api1Constants {
public static interface Accession {
/**
* WIEWS code of accession holding institute.
*/
public static final String INSTCODE = "instCode";
/**
* Accession number.
*/
public static final String ACCENUMB = "acceNumb";
/**
* Used to assign new ACCENUMB
*/
public static final String ACCENUMB_NEW = "newAcceNumb";
/**
* Reported genus of accession.
*/
public static final String GENUS = "genus";
/**
* May be used to assign a different genus.
*/
public static final String GENUS_NEW = "newGenus";
/**
* Specific epithet portion of the scientific name, in latin, in
* lowercase letters. Following abbreviation is allowed: ‘sp.’
*/
public static final String SPECIES = "species";
/**
* Corresponds to MCPD SPAUTHOR
*/
public static final String SPAUTHOR = "spauthor";
/**
* Corresponds to MCPD SUBTAXA
*/
public static final String SUBTAXA = "subtaxa";
/**
* Corresponds to MCPD SUBTAUTHOR
*/
public static final String SUBTAUTHOR = "subtauthor";
/**
* Universally Unique IDentifier for the accession, assigned by the
* first holding institute and immutable when accession is duplicated in
* another institute.
*/
public static final String UUID = "uuid";
/**
* ISO3 country code of country of origin.
*/
public static final String ORIGCTY = "orgCty";
/**
* Date on which the accession entered the collection as YYYYMMDD.
* Missing data (MM or DD) should be indicated with hyphens. Leading
* zeros are required.
*/
public static final String ACQDATE = "acqDate";
/**
* The status of an accession with regards to the Multilateral System
* (MLS) of the International Treaty on PlantGenetic Resources for Food
* and Agriculture.
*/
public static final String MLSSTAT = "mlsStat";
/**
* Is the accession “FAO In trust”
*/
public static final String INTRUST = "inTrust";
/**
* The general availability of the accession for distribution, but
* subject to current stock.
*/
public static final String AVAILABLE = "available";
/**
* MCPD Type of germplasm storage (Corresponds to MCPD STORAGE field).
*/
public static final String STORAGE = "storage";
/**
* MCPD Sample status
*/
public static final String SAMPSTAT = "sampStat";
/**
* FAO Institute Code (WIEWS code) of the institute where a safety
* duplicate of the accession is maintained.
*/
public static final String DUPLSITE = "duplSite";
/**
* Corresponds to BREDCODE.
*/
public static final String BREDCODE = "bredCode";
/**
* Corresponds to ANCEST.
*/
public static final String ANCEST = "ancest";
/**
* FAO WIEWS code of the donor institute
*/
public static final String DONORCODE = "donorCode";
/**
* Accession number at donor institute.
*/
public static final String DONORNUMB = "donorNumb";
/**
* Name of the donor institute (or person). Provide only when donorCode
* is not available.
*/
public static final String DONORNAME = "donorName";
/**
* Object containing the collecting data
*/
public static final String COLL = "coll";
/**
* Object containing georeference data
*/
public static final String GEO = "geo";
/**
* MCPD Remarks
*/
public static final String REMARKS = "remarks";
/**
* Marks if accession record is about a historic holding and the
* accession no longer exists.
*/
public static final String HISTORIC = "historic";
/**
* Accession name
*/
public static final String ACCENAME = "acceName";
/**
* Other numbers
*/
public static final String OTHERNUMB = "otherNumb";
/**
* Accession URL: direct link to accession in other on-line systems
*/
public static final String ACCEURL = "acceUrl";
/**
* Crop name as provided by the gene bank
*/
public static final String CROPNAME = "cropName";
}
public static interface Collecting {
/**
* Corresponds to COLLDATE
*/
public static final String COLLDATE = "collDate";
/**
* Corresponds to COLLSITE
*/
public static final String COLLSITE = "collSite";
/**
* Corresponds to MCPD COLLNUMB
*/
public static final String COLLNUMB = "collNumb";
/**
* Corresponds to MCPD COLLSRC
*/
public static final String COLLSRC = "collSrc";
/**
* FAO WIEWS code of collecting institute
*/
public static final String COLLCODE = "collCode";
/**
* The name of the collecting institute if collCode is not available.
*/
public static final String COLLNAME = "collName";
/**
* The address of the collecting institute if collCode is not available.
*/
public static final String COLLINSTADDRESS = "collInstAddress";
/**
* Corresponds to COLLMISSID
*/
public static final String COLLMISSID = "collMissId";
}
public static interface Geo {
/**
* Latitude
*/
public static final String LATITUDE = "latitude";
/**
* Longitude
*/
public static final String LONGITUDE = "longitude";
/**
* Elevation
*/
public static final String ELEVATION = "elevation";
/**
* COORDUNCERT (in meters)
*/
public static final String COORDUNCERT = "coordUncert";
/**
* Corresponds to COORDATUM
*/
public static final String COORDDATUM = "coordDatum";
/**
* Corresponds to GEOREFMETH
*/
public static final String GEOREFMETH = "georefMeth";
}
}
......@@ -25,6 +25,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.Predicate;
import org.genesys2.anno.util.CoordinateConversionException;
import org.genesys2.anno.util.GeoUtils;
import org.genesys2.client.oauth.api.accession.Api1Constants;
public class GenesysJSON {
public static class JsonField {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment