*/
public class DynamicBatch {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
- int batchSize;
- int batchItemCount = -1;
- Long batchMinFreeHeap = null;
- List<Integer> items = null;
+ private int batchSize;
+ private int batchItemCount = -1;
+ private Long batchMinFreeHeap = null;
+ private List<Integer> items = null;
- int gcTimeIncreaseCount = 0;
+ private int gcTimeIncreaseCount = 0;
private int allowedGcIncreases = -1;
private int itemWhereLimitsTouched = 0;
-
- List<Integer> unprocessedIds = new ArrayList<>(batchSize);
+ private List<Integer> unprocessedIds = new ArrayList<>(batchSize);
private final JvmMonitor jvmMonitor = new JvmMonitor();
}
/**
- *
* @param allowedGcIncreases the amount of continuously observed increases of the gc time
*/
public void setMaxAllowedGcIncreases(int allowedGcIncreases) {
*/
public class JvmMonitor {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private long gcTimeLast = 0;
/**
* @author a.kohlbecker
* @since 16.12.2010
- *
*/
public class StreamUtils {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
+
private static final int BUFFER_SIZE = 4096;
/**
public abstract class MediaInfo {
@SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private String formatName;
private String mimeType;
/**
* @author a.kohlbecker
* @since Jul 1, 2016
- *
*/
public class JvmMonitorTest extends Assert{
-
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Test
public void testGcTime() {
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.cdm.ext.bci;\r
-\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import javax.xml.parsers.ParserConfigurationException;\r
-import javax.xml.parsers.SAXParser;\r
-import javax.xml.parsers.SAXParserFactory;\r
-\r
-import org.xml.sax.Attributes;\r
-import org.xml.sax.SAXException;\r
-import org.xml.sax.helpers.DefaultHandler;\r
-\r
-import eu.etaxonomy.cdm.common.URI;\r
-import eu.etaxonomy.cdm.ext.common.SchemaAdapterBase;\r
-import eu.etaxonomy.cdm.model.agent.Team;\r
-import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;\r
-import eu.etaxonomy.cdm.model.reference.Reference;\r
-import eu.etaxonomy.cdm.model.reference.ReferenceFactory;\r
-import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;\r
-\r
-/**\r
- * @author a.kohlbecker\r
- * @since 25.08.2010\r
- */\r
-public class BciSchemaAdapter extends SchemaAdapterBase<Reference>{\r
-\r
- static URI identifier = null;\r
-\r
- static String nameSpace = "http://purl.org/dc/elements/1.1/";\r
-\r
- static {\r
- identifier = URI.create("info:srw/schema/1/dc-v1.1");\r
- }\r
-\r
- @Override\r
- public URI getIdentifier() {\r
- return identifier;\r
- }\r
-\r
- @Override\r
- public String getShortName() {\r
- return "dc";\r
- }\r
-\r
- @Override\r
- public List<Reference> getCmdEntities(InputStream inputStream) {\r
-\r
- SAXParserFactory factory = SAXParserFactory.newInstance();\r
- factory.setNamespaceAware(true);\r
- SAXParser parser = null;\r
- try {\r
- parser = factory.newSAXParser();\r
- } catch (ParserConfigurationException e) {\r
- logger.error(e);\r
- } catch (SAXException e) {\r
- logger.error(e);\r
- }\r
-\r
- DcSaxHandler handler = new DcSaxHandler();\r
-\r
- try {\r
- if(parser != null){\r
- parser.parse(inputStream, handler);\r
- } else {\r
- logger.error("parser is null");\r
- }\r
- } catch (SAXException e) {\r
- logger.error(e);\r
- } catch (IOException e) {\r
- logger.error(e);\r
- }\r
-\r
- return handler.referenceList;\r
- }\r
-\r
- class DcSaxHandler extends DefaultHandler {\r
-\r
- private static final String DC_DC = "dc:dc";\r
-\r
- private static final String DC_TITLE = "dc:title";\r
- private static final String DC_CREATOR = "dc:creator";\r
- private static final String DC_PUBLISHER = "dc:publisher";\r
- private static final String DC_DATE = "dc:date";\r
-\r
- private List<Reference> referenceList = new ArrayList<>();\r
-\r
- private Reference reference = null;\r
-\r
- private String dcFieldName = null;\r
-\r
- @Override\r
- public void startElement(String uri, String localName,\r
- String qName, Attributes attributes) throws SAXException {\r
-\r
- if (uri.equals(nameSpace)) {\r
- logger.debug("Start Element :" + qName + "; " + uri);\r
-\r
- if (qName.equals(DC_DC)) {\r
- reference = ReferenceFactory.newGeneric();\r
- } else {\r
- dcFieldName = qName;\r
- }\r
- }\r
- }\r
-\r
- @Override\r
- public void endElement(String uri, String localName, String qName)\r
- throws SAXException {\r
-\r
- if (uri.equals(nameSpace)) {\r
- if(reference != null) {\r
- logger.debug("End Element :" + qName + "; " + uri);\r
-\r
- if (qName.equals(DC_DC)) {\r
- referenceList.add(reference);\r
- reference = null;\r
- } else {\r
- dcFieldName = null;\r
- }\r
- }\r
- }\r
- }\r
-\r
- @Override\r
- public void characters(char ch[], int start, int length)\r
- throws SAXException {\r
-\r
- if(reference != null && dcFieldName != null){\r
- String text = new String(ch, start, length);\r
- logger.debug("Characters : " + text);\r
- if(dcFieldName.equals(DC_TITLE)){\r
- reference.setTitleCache(text, true);\r
- }\r
- if(dcFieldName.equals(DC_DATE)){\r
- reference.setDatePublished(TimePeriodParser.parseStringVerbatim(text));\r
- }\r
- if(dcFieldName.equals(DC_PUBLISHER)){\r
- reference.setPublisher(text);\r
- }\r
- if(dcFieldName.equals(DC_CREATOR)){\r
- TeamOrPersonBase<?> authorship = new Team();\r
- authorship.setTitleCache(text, true);\r
- reference.setAuthorship(authorship);\r
- }\r
- }\r
- }\r
- }\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.ext.bci;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import eu.etaxonomy.cdm.common.URI;
+import eu.etaxonomy.cdm.ext.common.SchemaAdapterBase;
+import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
+import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
+
+/**
+ * @author a.kohlbecker
+ * @since 25.08.2010
+ */
+public class BciSchemaAdapter extends SchemaAdapterBase<Reference>{
+
+ private static final Logger logger = LogManager.getLogger();
+
+ private static URI identifier = null;
+
+ private static String nameSpace = "http://purl.org/dc/elements/1.1/";
+
+ static {
+ identifier = URI.create("info:srw/schema/1/dc-v1.1");
+ }
+
+ @Override
+ public URI getIdentifier() {
+ return identifier;
+ }
+
+ @Override
+ public String getShortName() {
+ return "dc";
+ }
+
+ @Override
+ public List<Reference> getCmdEntities(InputStream inputStream) {
+
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setNamespaceAware(true);
+ SAXParser parser = null;
+ try {
+ parser = factory.newSAXParser();
+ } catch (ParserConfigurationException e) {
+ logger.error(e);
+ } catch (SAXException e) {
+ logger.error(e);
+ }
+
+ DcSaxHandler handler = new DcSaxHandler();
+
+ try {
+ if(parser != null){
+ parser.parse(inputStream, handler);
+ } else {
+ logger.error("parser is null");
+ }
+ } catch (SAXException e) {
+ logger.error(e);
+ } catch (IOException e) {
+ logger.error(e);
+ }
+
+ return handler.referenceList;
+ }
+
+ class DcSaxHandler extends DefaultHandler {
+
+ private static final String DC_DC = "dc:dc";
+
+ private static final String DC_TITLE = "dc:title";
+ private static final String DC_CREATOR = "dc:creator";
+ private static final String DC_PUBLISHER = "dc:publisher";
+ private static final String DC_DATE = "dc:date";
+
+ private List<Reference> referenceList = new ArrayList<>();
+
+ private Reference reference = null;
+
+ private String dcFieldName = null;
+
+ @Override
+ public void startElement(String uri, String localName,
+ String qName, Attributes attributes) throws SAXException {
+
+ if (uri.equals(nameSpace)) {
+ logger.debug("Start Element :" + qName + "; " + uri);
+
+ if (qName.equals(DC_DC)) {
+ reference = ReferenceFactory.newGeneric();
+ } else {
+ dcFieldName = qName;
+ }
+ }
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+
+ if (uri.equals(nameSpace)) {
+ if(reference != null) {
+ logger.debug("End Element :" + qName + "; " + uri);
+
+ if (qName.equals(DC_DC)) {
+ referenceList.add(reference);
+ reference = null;
+ } else {
+ dcFieldName = null;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void characters(char ch[], int start, int length)
+ throws SAXException {
+
+ if(reference != null && dcFieldName != null){
+ String text = new String(ch, start, length);
+ logger.debug("Characters : " + text);
+ if(dcFieldName.equals(DC_TITLE)){
+ reference.setTitleCache(text, true);
+ }
+ if(dcFieldName.equals(DC_DATE)){
+ reference.setDatePublished(TimePeriodParser.parseStringVerbatim(text));
+ }
+ if(dcFieldName.equals(DC_PUBLISHER)){
+ reference.setPublisher(text);
+ }
+ if(dcFieldName.equals(DC_CREATOR)){
+ TeamOrPersonBase<?> authorship = new Team();
+ authorship.setTitleCache(text, true);
+ reference.setAuthorship(authorship);
+ }
+ }
+ }
+ }
}
\ No newline at end of file
*/
public abstract class SchemaAdapterBase<T extends CdmBase> {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
/**
* @return the identifier e.g. "info:srw/schema/1/dc-v1.1" for DublinCore
*/
public abstract String getShortName();
- /**
- * @param inputStream
- * @return
- */
public abstract List<T> getCmdEntities(InputStream inputStream) throws IOException;
}
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.cdm.ext.common;\r
-\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
-import java.net.MalformedURLException;\r
-import java.net.URISyntaxException;\r
-import java.net.URL;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.apache.http.HttpEntity;\r
-import org.apache.http.HttpResponse;\r
-import org.apache.http.NameValuePair;\r
-import org.apache.http.client.ClientProtocolException;\r
-import org.apache.http.message.BasicNameValuePair;\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-import eu.etaxonomy.cdm.common.URI;\r
-import eu.etaxonomy.cdm.common.UriUtils;\r
-import eu.etaxonomy.cdm.common.UriUtils.HttpMethod;\r
-import eu.etaxonomy.cdm.model.common.CdmBase;\r
-\r
-/**\r
- * @author a.kohlbecker\r
- * @since 24.08.2010\r
- */\r
-public class ServiceWrapperBase<T extends CdmBase> {\r
-\r
- public static final Logger logger = LogManager.getLogger(ServiceWrapperBase.class);\r
-\r
- private URL baseUrl;\r
-\r
- private final boolean followRedirects = true;\r
-\r
- protected Map<String, SchemaAdapterBase<T>> schemaAdapterMap;\r
-\r
- /**\r
- * @param baseUrl the baseUrl to set\r
- */\r
- public void setBaseUrl(String baseUrl) {\r
- try {\r
- this.baseUrl = new URL(baseUrl);\r
- } catch (MalformedURLException e) {\r
- logger.error(e);\r
- }\r
- }\r
-\r
- /**\r
- * @return the baseUrl\r
- */\r
- public String getBaseUrl() {\r
- return baseUrl.toString();\r
- }\r
-\r
- /**\r
- * @param schemaAdapterMap the schemaAdapterMap to set\r
- */\r
- public void setSchemaAdapterMap(Map<String, SchemaAdapterBase<T>> schemaAdapterMap) {\r
- this.schemaAdapterMap = schemaAdapterMap;\r
- }\r
-\r
- public void addSchemaAdapter(SchemaAdapterBase schemaAdapter){\r
- if(schemaAdapterMap == null){\r
- schemaAdapterMap = new HashMap<>();\r
- }\r
- schemaAdapterMap.put(schemaAdapter.getShortName(), schemaAdapter);\r
- }\r
-\r
- public Map<String, SchemaAdapterBase<T>> getSchemaAdapterMap() {\r
- return schemaAdapterMap;\r
- }\r
-\r
- /**\r
- * Send an HTTP GET request to the given URI.\r
- * @param uri the URI of this HTTP request\r
- * @param requestHeaders the parameters (name-value pairs) of the connection added to the header of the request\r
- * @return the response as an {@link InputStream}\r
- * @throws ClientProtocolException\r
- * @throws IOException\r
- */\r
- protected InputStream executeHttpGet(URI uri, Map<String, String> requestHeaders) throws ClientProtocolException, IOException{\r
- return executeHttp(uri, requestHeaders, HttpMethod.GET, null);\r
- }\r
-\r
- /**\r
- * Send an HTTP POST request to the given URI.\r
- * @param uri the URI of this HTTP request\r
- * @param requestHeaders the parameters (name-value pairs) of the connection added to the header of the request\r
- * @param entity the {@link HttpEntity} attached to a HTTP POST request\r
- * @return the response as an {@link InputStream}\r
- * @throws ClientProtocolException\r
- * @throws IOException\r
- */\r
- protected InputStream executeHttpPost(URI uri, Map<String, String> requestHeaders, HttpEntity httpEntity) throws ClientProtocolException, IOException{\r
- return executeHttp(uri, requestHeaders, HttpMethod.POST, httpEntity);\r
- }\r
-\r
- /**\r
- * @param uri the URI of this HTTP request\r
- * @param requestHeaders the parameters (name-value pairs) of the connection added to the header of the request\r
- * @param httpMethod defines if method is POST or GET\r
- * @param entity the {@link HttpEntity} attached to a HTTP POST request\r
- * @return the response as an {@link InputStream}\r
- * @throws IOException\r
- * @throws ClientProtocolException\r
- */\r
- private InputStream executeHttp(URI uri, Map<String, String> requestHeaders, HttpMethod httpMethod, HttpEntity entity) throws IOException, ClientProtocolException {\r
- logger.debug("sending "+httpMethod+" request: " + uri);\r
-\r
- HttpResponse response = UriUtils.getResponseByType(uri, requestHeaders, httpMethod, entity);\r
-\r
- if(UriUtils.isOk(response)){\r
- InputStream stream = response.getEntity().getContent();\r
- return stream;\r
- } else {\r
- logger.error("HTTP Reponse code is not = 200 (OK): " + UriUtils.getStatus(response));\r
- return null;\r
- }\r
- }\r
-\r
- /**\r
- * Adds a {@link BasicNameValuePair} to the given {@link List}.\r
- * @param listOfPairs the list to add the name-value pair to\r
- * @param name the name\r
- * @param value the value\r
- */\r
- public static void addNameValuePairTo(List<NameValuePair> listOfPairs, String name, String value){\r
- if(value != null){\r
- listOfPairs.add(new BasicNameValuePair(name, value));\r
- }\r
- }\r
-\r
- /**\r
- * Adds a {@link BasicNameValuePair} to the given {@link List}.\r
- * @param listOfPairs the list to add the name-value pair to\r
- * @param name the name\r
- * @param value the String representation of the object (toString())\r
- */\r
- public static void addNameValuePairTo(List<NameValuePair> listOfPairs, String name, Object value){\r
- if(value != null){\r
- listOfPairs.add(new BasicNameValuePair(name, value.toString()));\r
- }\r
- }\r
-\r
- /**\r
- * Creates a {@link URI} based on the {@link ServiceWrapperBase#baseUrl} and the given subPath and qParams\r
- * @param subPath the sub path of the URI to be created\r
- * @param qparams the parameters added as GET parameters to the URI\r
- * @return a URI consisting of the baseURL, the subPath and qParams\r
- * @throws URISyntaxException\r
- */\r
- protected URI createUri(String subPath, List<NameValuePair> qparams) throws URISyntaxException {\r
-\r
- return UriUtils.createUri(baseUrl, subPath, qparams, null);\r
-\r
-// String path = baseUrl.getPath();\r
-// if(subPath != null){\r
-// if(!path.endsWith("/")){\r
-// path += "/";\r
-// }\r
-// if(subPath.startsWith("/")){\r
-// subPath = subPath.substring(1);\r
-// }\r
-// path += subPath;\r
-// }\r
-//\r
-// URI uri = URIUtils.createURI(baseUrl.getProtocol(),\r
-// baseUrl.getHost(), baseUrl.getPort(), path, URLEncodedUtils.format(qparams, "UTF-8"), null);\r
-//\r
-// return uri;\r
- }\r
-}\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.ext.common;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.NameValuePair;
+import org.apache.http.client.ClientProtocolException;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import eu.etaxonomy.cdm.common.URI;
+import eu.etaxonomy.cdm.common.UriUtils;
+import eu.etaxonomy.cdm.common.UriUtils.HttpMethod;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author a.kohlbecker
+ * @since 24.08.2010
+ */
+public class ServiceWrapperBase<T extends CdmBase> {
+
+ private static final Logger logger = LogManager.getLogger();
+
+ private URL baseUrl;
+
+ protected Map<String, SchemaAdapterBase<T>> schemaAdapterMap;
+
+ public void setBaseUrl(String baseUrl) {
+ try {
+ this.baseUrl = new URL(baseUrl);
+ } catch (MalformedURLException e) {
+ logger.error(e);
+ }
+ }
+ public String getBaseUrl() {
+ return baseUrl.toString();
+ }
+
+ public void setSchemaAdapterMap(Map<String, SchemaAdapterBase<T>> schemaAdapterMap) {
+ this.schemaAdapterMap = schemaAdapterMap;
+ }
+
+ public void addSchemaAdapter(SchemaAdapterBase schemaAdapter){
+ if(schemaAdapterMap == null){
+ schemaAdapterMap = new HashMap<>();
+ }
+ schemaAdapterMap.put(schemaAdapter.getShortName(), schemaAdapter);
+ }
+
+ public Map<String, SchemaAdapterBase<T>> getSchemaAdapterMap() {
+ return schemaAdapterMap;
+ }
+
+ /**
+ * Send an HTTP GET request to the given URI.
+ * @param uri the URI of this HTTP request
+ * @param requestHeaders the parameters (name-value pairs) of the connection added to the header of the request
+ * @return the response as an {@link InputStream}
+ * @throws ClientProtocolException
+ * @throws IOException
+ */
+ protected InputStream executeHttpGet(URI uri, Map<String, String> requestHeaders) throws ClientProtocolException, IOException{
+ return executeHttp(uri, requestHeaders, HttpMethod.GET, null);
+ }
+
+ /**
+ * Send an HTTP POST request to the given URI.
+ * @param uri the URI of this HTTP request
+ * @param requestHeaders the parameters (name-value pairs) of the connection added to the header of the request
+ * @param entity the {@link HttpEntity} attached to a HTTP POST request
+ * @return the response as an {@link InputStream}
+ * @throws ClientProtocolException
+ * @throws IOException
+ */
+ protected InputStream executeHttpPost(URI uri, Map<String, String> requestHeaders, HttpEntity httpEntity) throws ClientProtocolException, IOException{
+ return executeHttp(uri, requestHeaders, HttpMethod.POST, httpEntity);
+ }
+
+ /**
+ * @param uri the URI of this HTTP request
+ * @param requestHeaders the parameters (name-value pairs) of the connection added to the header of the request
+ * @param httpMethod defines if method is POST or GET
+ * @param entity the {@link HttpEntity} attached to a HTTP POST request
+ * @return the response as an {@link InputStream}
+ * @throws IOException
+ * @throws ClientProtocolException
+ */
+ private InputStream executeHttp(URI uri, Map<String, String> requestHeaders, HttpMethod httpMethod, HttpEntity entity) throws IOException, ClientProtocolException {
+ logger.debug("sending "+httpMethod+" request: " + uri);
+
+ HttpResponse response = UriUtils.getResponseByType(uri, requestHeaders, httpMethod, entity);
+
+ if(UriUtils.isOk(response)){
+ InputStream stream = response.getEntity().getContent();
+ return stream;
+ } else {
+ logger.error("HTTP Reponse code is not = 200 (OK): " + UriUtils.getStatus(response));
+ return null;
+ }
+ }
+
+ /**
+ * Adds a {@link BasicNameValuePair} to the given {@link List}.
+ * @param listOfPairs the list to add the name-value pair to
+ * @param name the name
+ * @param value the value
+ */
+ public static void addNameValuePairTo(List<NameValuePair> listOfPairs, String name, String value){
+ if(value != null){
+ listOfPairs.add(new BasicNameValuePair(name, value));
+ }
+ }
+
+ /**
+ * Adds a {@link BasicNameValuePair} to the given {@link List}.
+ * @param listOfPairs the list to add the name-value pair to
+ * @param name the name
+ * @param value the String representation of the object (toString())
+ */
+ public static void addNameValuePairTo(List<NameValuePair> listOfPairs, String name, Object value){
+ if(value != null){
+ listOfPairs.add(new BasicNameValuePair(name, value.toString()));
+ }
+ }
+
+ /**
+ * Creates a {@link URI} based on the {@link ServiceWrapperBase#baseUrl} and the given subPath and qParams
+ * @param subPath the sub path of the URI to be created
+ * @param qparams the parameters added as GET parameters to the URI
+ * @return a URI consisting of the baseURL, the subPath and qParams
+ * @throws URISyntaxException
+ */
+ protected URI createUri(String subPath, List<NameValuePair> qparams) throws URISyntaxException {
+
+ return UriUtils.createUri(baseUrl, subPath, qparams, null);
+
+// String path = baseUrl.getPath();
+// if(subPath != null){
+// if(!path.endsWith("/")){
+// path += "/";
+// }
+// if(subPath.startsWith("/")){
+// subPath = subPath.substring(1);
+// }
+// path += subPath;
+// }
+//
+// URI uri = URIUtils.createURI(baseUrl.getProtocol(),
+// baseUrl.getHost(), baseUrl.getPort(), path, URLEncodedUtils.format(qparams, "UTF-8"), null);
+//
+// return uri;
+ }
+}
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.cdm.ext.dc;\r
-\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import javax.xml.parsers.ParserConfigurationException;\r
-import javax.xml.parsers.SAXParser;\r
-import javax.xml.parsers.SAXParserFactory;\r
-\r
-import org.xml.sax.Attributes;\r
-import org.xml.sax.SAXException;\r
-import org.xml.sax.helpers.DefaultHandler;\r
-\r
-import eu.etaxonomy.cdm.common.URI;\r
-import eu.etaxonomy.cdm.ext.common.SchemaAdapterBase;\r
-import eu.etaxonomy.cdm.model.agent.Team;\r
-import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;\r
-import eu.etaxonomy.cdm.model.reference.Reference;\r
-import eu.etaxonomy.cdm.model.reference.ReferenceFactory;\r
-import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;\r
-\r
-\r
-\r
-/**\r
- * @author a.kohlbecker\r
- * @since 25.08.2010\r
- */\r
-public class DublinCoreSchemaAdapter extends SchemaAdapterBase<Reference>{\r
-\r
- private static URI identifier = null;\r
-\r
- static String nameSpace = "http://purl.org/dc/elements/1.1/";\r
-\r
- static {\r
- identifier = URI.create("info:srw/schema/1/dc-v1.1");\r
- }\r
-\r
- @Override\r
- public URI getIdentifier() {\r
- return identifier;\r
- }\r
-\r
- @Override\r
- public String getShortName() {\r
- return "dc";\r
- }\r
-\r
- @Override\r
- public List<Reference> getCmdEntities(InputStream inputStream) {\r
-\r
- SAXParserFactory factory = SAXParserFactory.newInstance();\r
- factory.setNamespaceAware(true);\r
- SAXParser parser = null;\r
- try {\r
- parser = factory.newSAXParser();\r
- } catch (ParserConfigurationException e) {\r
- logger.error(e);\r
- } catch (SAXException e) {\r
- logger.error(e);\r
- }\r
-\r
- DcSaxHandler handler = new DcSaxHandler();\r
-\r
- try {\r
- if(parser != null){\r
- parser.parse(inputStream, handler);\r
- } else {\r
- logger.error("parser is null");\r
- }\r
- } catch (SAXException e) {\r
- logger.error(e);\r
- } catch (IOException e) {\r
- logger.error(e);\r
- }\r
-\r
- return handler.referenceList;\r
- }\r
-\r
- class DcSaxHandler extends DefaultHandler {\r
-\r
- private static final String DC_DC = "dc:dc";\r
-\r
- private static final String DC_TITLE = "dc:title";\r
- private static final String DC_CREATOR = "dc:creator";\r
- private static final String DC_PUBLISHER = "dc:publisher";\r
- private static final String DC_DATE = "dc:date";\r
- private static final String DC_IDENTIFIER = "dc:identifier"; //TODO map this\r
-\r
- List<Reference> referenceList = new ArrayList<Reference>();\r
-\r
- Reference reference = null;\r
-\r
- String dcFieldName = null;\r
-\r
- @Override\r
- public void startElement(String uri, String localName,\r
- String qName, Attributes attributes) throws SAXException {\r
-\r
- if (uri.equals(nameSpace)) {\r
- logger.debug("Start Element :" + qName + "; " + uri);\r
-\r
- if (qName.equals(DC_DC)) {\r
- reference = ReferenceFactory.newGeneric();\r
- } else {\r
- dcFieldName = qName;\r
- }\r
- }\r
- }\r
-\r
- @Override\r
- public void endElement(String uri, String localName, String qName)\r
- throws SAXException {\r
-\r
- if (uri.equals(nameSpace)) {\r
- if(reference != null) {\r
- logger.debug("End Element :" + qName + "; " + uri);\r
-\r
- if (qName.equals(DC_DC)) {\r
- referenceList.add(reference);\r
- reference = null;\r
- } else {\r
- dcFieldName = null;\r
- }\r
- }\r
- }\r
- }\r
-\r
- @Override\r
- public void characters(char ch[], int start, int length)\r
- throws SAXException {\r
-\r
- if(reference != null && dcFieldName != null){\r
- String text = new String(ch, start, length);\r
- logger.debug("Characters : " + text);\r
- if(dcFieldName.equals(DC_TITLE)){\r
- reference.setTitleCache(text, true);\r
- }\r
- if(dcFieldName.equals(DC_DATE)){\r
- reference.setDatePublished(TimePeriodParser.parseStringVerbatim(text));\r
- }\r
- if(dcFieldName.equals(DC_PUBLISHER)){\r
- reference.setPublisher(text);\r
- }\r
- if(dcFieldName.equals(DC_CREATOR)){\r
- TeamOrPersonBase<?> authorship = new Team();\r
- authorship.setTitleCache(text, true);\r
- reference.setAuthorship(authorship);\r
- }\r
- }\r
- }\r
- }\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.ext.dc;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import eu.etaxonomy.cdm.common.URI;
+import eu.etaxonomy.cdm.ext.common.SchemaAdapterBase;
+import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+import eu.etaxonomy.cdm.model.reference.ReferenceFactory;
+import eu.etaxonomy.cdm.strategy.parser.TimePeriodParser;
+
+/**
+ * @author a.kohlbecker
+ * @since 25.08.2010
+ */
+public class DublinCoreSchemaAdapter extends SchemaAdapterBase<Reference>{
+
+ private static final Logger logger = LogManager.getLogger();
+
+ private static URI identifier = null;
+
+ private static String nameSpace = "http://purl.org/dc/elements/1.1/";
+
+ static {
+ identifier = URI.create("info:srw/schema/1/dc-v1.1");
+ }
+
+ @Override
+ public URI getIdentifier() {
+ return identifier;
+ }
+
+ @Override
+ public String getShortName() {
+ return "dc";
+ }
+
+ @Override
+ public List<Reference> getCmdEntities(InputStream inputStream) {
+
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setNamespaceAware(true);
+ SAXParser parser = null;
+ try {
+ parser = factory.newSAXParser();
+ } catch (ParserConfigurationException e) {
+ logger.error(e);
+ } catch (SAXException e) {
+ logger.error(e);
+ }
+
+ DcSaxHandler handler = new DcSaxHandler();
+
+ try {
+ if(parser != null){
+ parser.parse(inputStream, handler);
+ } else {
+ logger.error("parser is null");
+ }
+ } catch (SAXException e) {
+ logger.error(e);
+ } catch (IOException e) {
+ logger.error(e);
+ }
+
+ return handler.referenceList;
+ }
+
+ class DcSaxHandler extends DefaultHandler {
+
+ private static final String DC_DC = "dc:dc";
+
+ private static final String DC_TITLE = "dc:title";
+ private static final String DC_CREATOR = "dc:creator";
+ private static final String DC_PUBLISHER = "dc:publisher";
+ private static final String DC_DATE = "dc:date";
+ private static final String DC_IDENTIFIER = "dc:identifier"; //TODO map this
+
+ List<Reference> referenceList = new ArrayList<Reference>();
+
+ Reference reference = null;
+
+ String dcFieldName = null;
+
+ @Override
+ public void startElement(String uri, String localName,
+ String qName, Attributes attributes) throws SAXException {
+
+ if (uri.equals(nameSpace)) {
+ logger.debug("Start Element :" + qName + "; " + uri);
+
+ if (qName.equals(DC_DC)) {
+ reference = ReferenceFactory.newGeneric();
+ } else {
+ dcFieldName = qName;
+ }
+ }
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String qName)
+ throws SAXException {
+
+ if (uri.equals(nameSpace)) {
+ if(reference != null) {
+ logger.debug("End Element :" + qName + "; " + uri);
+
+ if (qName.equals(DC_DC)) {
+ referenceList.add(reference);
+ reference = null;
+ } else {
+ dcFieldName = null;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void characters(char ch[], int start, int length)
+ throws SAXException {
+
+ if(reference != null && dcFieldName != null){
+ String text = new String(ch, start, length);
+ logger.debug("Characters : " + text);
+ if(dcFieldName.equals(DC_TITLE)){
+ reference.setTitleCache(text, true);
+ }
+ if(dcFieldName.equals(DC_DATE)){
+ reference.setDatePublished(TimePeriodParser.parseStringVerbatim(text));
+ }
+ if(dcFieldName.equals(DC_PUBLISHER)){
+ reference.setPublisher(text);
+ }
+ if(dcFieldName.equals(DC_CREATOR)){
+ TeamOrPersonBase<?> authorship = new Team();
+ authorship.setTitleCache(text, true);
+ reference.setAuthorship(authorship);
+ }
+ }
+ }
+ }
}
\ No newline at end of file
public class EditGeoService implements IEditGeoService {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(EditGeoService.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private IDescriptionDao dao;
* @since 17.11.2008
*/
public class EditGeoServiceUtilities {
- private static final Logger logger = LogManager.getLogger(EditGeoServiceUtilities.class);
+
+ private static final Logger logger = LogManager.getLogger();
private static final int INT_MAX_LENGTH = String.valueOf(Integer.MAX_VALUE).length();
* @since 11.08.2011
*/
public class GeoServiceArea {
+
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(GeoServiceArea.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String VALUE = "value";
private static final String FIELD = "field";
* This class implements {@link IGeoServiceAreaMapping}. The mapping
* is stored as a technical annotation of the area.
* The area is saved while the mapping is set.
+ *
* @author a.mueller
* @since 15.08.2011
- *
*/
@Component
public class GeoServiceAreaAnnotatedMapping implements IGeoServiceAreaMapping {
+
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(GeoServiceAreaAnnotatedMapping.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ITermService termService;
*/
public class ShpAttributesToNamedAreaMapper {
- public static final Logger logger = LogManager.getLogger(ShpAttributesToNamedAreaMapper.class);
+ private static final Logger logger = LogManager.getLogger();
private static final char COMMA = ',';
*/
public class GeometryBuilder {
- private final static Logger logger = LogManager.getLogger(GeometryBuilder.class);
+ private static final Logger logger = LogManager.getLogger();
public enum CircleMethod {
circle, simpleCircleSmall, simpleCircle, reprojectedCircle;
*/
public class KMLDocumentBuilder {
- private final static Logger logger = LogManager.getLogger(KMLDocumentBuilder.class);
+ private static final Logger logger = LogManager.getLogger();
private Set<SpecimenOrObservationBase> occSet = new HashSet<>();
*/
@Component
public class IpniService implements IIpniService{
- private static final Logger logger = LogManager.getLogger(IpniService.class);
+
+ private static final Logger logger = LogManager.getLogger();
//TYPE
-package eu.etaxonomy.cdm.ext.ipni;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-public class IpniServiceAuthorConfigurator extends IpniServiceConfiguratorBase implements IIpniServiceConfigurator {\r
- public static final Logger logger = LogManager.getLogger(IpniServiceAuthorConfigurator.class);\r
-\r
-}\r
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.cdm.ext.ipni;
+
+public class IpniServiceAuthorConfigurator
+ extends IpniServiceConfiguratorBase {
+
+}
\ No newline at end of file
-/**\r
- *\r
- */\r
-package eu.etaxonomy.cdm.ext.ipni;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-/**\r
- * Configurator for IPNI name service import / mapping.\r
- * @author a.mueller\r
- */\r
-public class IpniServiceNamesConfigurator extends IpniServiceConfiguratorBase implements IIpniServiceConfigurator {\r
- public static final Logger logger = LogManager.getLogger(IpniServiceNamesConfigurator.class);\r
-\r
- //by default we do not include basionym import\r
- boolean doBasionyms = false; //includes replaced synonyms\r
- public boolean isDoBasionyms() {return doBasionyms;}\r
- public void setDoBasionyms(boolean doBasionyms){this.doBasionyms = doBasionyms;}\r
-\r
- boolean doType = true;\r
- public boolean isDoType() {return doType;}\r
- public void setDoType(boolean doType){this.doType = doType;}\r
-\r
- boolean doApni = true;\r
- public boolean isDoApni() {return doApni;}\r
- public void setDoApni(boolean doApni){this.doApni = doApni;}\r
-\r
- boolean doIk = true;\r
- public boolean isDoIk() {return doIk;}\r
- public void setDoIk(boolean doIk){this.doIk = doIk;}\r
-\r
- boolean doGci = true;\r
- public boolean isDoGci() {return doGci;}\r
- public void setDoGci(boolean doGci){this.doGci = doGci;}\r
-\r
- boolean sortByFamily = true;\r
- public boolean isSortByFamily() {return sortByFamily;}\r
- public void setSortByFamily(boolean sortByFamily){this.sortByFamily = sortByFamily;}\r
-\r
- boolean includePublicationAuthors = true;\r
- public boolean isIncludePublicationAuthors() {return includePublicationAuthors;}\r
- public void setIncludePublicationAuthors(boolean includePublicationAuthors){this.includePublicationAuthors = includePublicationAuthors;}\r
-\r
- boolean includeBasionymAuthors = true;\r
- public boolean isIncludeBasionymAuthors() {return includeBasionymAuthors;}\r
- public void setIncludeBasionymAuthors(boolean includeBasionymAuthors){this.includeBasionymAuthors = includeBasionymAuthors;}\r
-\r
-\r
- /**\r
- * @return\r
- */\r
- public static IpniServiceNamesConfigurator NewInstance() {\r
- return new IpniServiceNamesConfigurator();\r
- }\r
-\r
-}\r
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.ext.ipni;
+
+/**
+ * Configurator for IPNI name service import / mapping.
+ * @author a.mueller
+ */
+public class IpniServiceNamesConfigurator extends IpniServiceConfiguratorBase implements IIpniServiceConfigurator {
+
+ //by default we do not include basionym import
+ boolean doBasionyms = false; //includes replaced synonyms
+ public boolean isDoBasionyms() {return doBasionyms;}
+ public void setDoBasionyms(boolean doBasionyms){this.doBasionyms = doBasionyms;}
+
+ boolean doType = true;
+ public boolean isDoType() {return doType;}
+ public void setDoType(boolean doType){this.doType = doType;}
+
+ boolean doApni = true;
+ public boolean isDoApni() {return doApni;}
+ public void setDoApni(boolean doApni){this.doApni = doApni;}
+
+ boolean doIk = true;
+ public boolean isDoIk() {return doIk;}
+ public void setDoIk(boolean doIk){this.doIk = doIk;}
+
+ boolean doGci = true;
+ public boolean isDoGci() {return doGci;}
+ public void setDoGci(boolean doGci){this.doGci = doGci;}
+
+ boolean sortByFamily = true;
+ public boolean isSortByFamily() {return sortByFamily;}
+ public void setSortByFamily(boolean sortByFamily){this.sortByFamily = sortByFamily;}
+
+ boolean includePublicationAuthors = true;
+ public boolean isIncludePublicationAuthors() {return includePublicationAuthors;}
+ public void setIncludePublicationAuthors(boolean includePublicationAuthors){this.includePublicationAuthors = includePublicationAuthors;}
+
+ boolean includeBasionymAuthors = true;
+ public boolean isIncludeBasionymAuthors() {return includeBasionymAuthors;}
+ public void setIncludeBasionymAuthors(boolean includeBasionymAuthors){this.includeBasionymAuthors = includeBasionymAuthors;}
+
+
+ /**
+ * @return
+ */
+ public static IpniServiceNamesConfigurator NewInstance() {
+ return new IpniServiceNamesConfigurator();
+ }
+
+}
-/**\r
- *\r
- */\r
-package eu.etaxonomy.cdm.ext.ipni;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-\r
-/**\r
- * @author a.mueller\r
- *\r
- */\r
-public class IpniServicePublicationConfigurator extends IpniServiceConfiguratorBase implements IIpniServiceConfigurator{\r
- public static final Logger logger = LogManager.getLogger(IpniServicePublicationConfigurator.class);\r
-\r
- /**\r
- * If true the abbreviation is used as title instead of the title\r
- */\r
- private boolean useAbbreviationAsTitle = false;\r
-\r
-\r
-\r
- public void setUseAbbreviationAsTitle(boolean useAbbreviationAsTitle) {\r
- this.useAbbreviationAsTitle = useAbbreviationAsTitle;\r
- }\r
-\r
- public boolean isUseAbbreviationAsTitle() {\r
- return useAbbreviationAsTitle;\r
- }\r
-\r
-}\r
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.ext.ipni;
+
+/**
+ * @author a.mueller
+ */
+public class IpniServicePublicationConfigurator extends IpniServiceConfiguratorBase {
+
+ /**
+ * If true the abbreviation is used as title instead of the title
+ */
+ private boolean useAbbreviationAsTitle = false;
+
+ public void setUseAbbreviationAsTitle(boolean useAbbreviationAsTitle) {
+ this.useAbbreviationAsTitle = useAbbreviationAsTitle;
+ }
+
+ public boolean isUseAbbreviationAsTitle() {
+ return useAbbreviationAsTitle;
+ }
+
+}
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.jdom.Document;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
@Transactional(readOnly = true)
public class BioCaseQueryServiceWrapper extends ServiceWrapperBase<SpecimenOrObservationBase<?>>{
+ private static final Logger logger = LogManager.getLogger();
+
private static final BasicNameValuePair SUBMIT_PARAM = new BasicNameValuePair("Submit", "Submit");
private static final String QUERY_PARAM_NAME = "query";
private static final BasicNameValuePair CAPABILITY_TEST_PARAM = new BasicNameValuePair("capabilities", "1");
*/
public class GbifJsonOccurrenceParser {
- private static final Logger logger = LogManager.getLogger(GbifJsonOccurrenceParser.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String DATASET_KEY = "datasetKey";
private static final String DATASET_PROTOCOL = "protocol";
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.utils.URIBuilder;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.URI;
import eu.etaxonomy.cdm.common.UriUtils;
*/
public class GbifQueryServiceWrapper extends ServiceWrapperBase<SpecimenOrObservationBase<?>>{
+ private static final Logger logger = LogManager.getLogger();
+
protected static final String BASE_URL = "https://api.gbif.org";
private static final String SUB_PATH = "/v1/occurrence/search";
-
+
/**
* Constructs a new GbifQueryServiceWrapper
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.cdm.ext.openurl;\r
-\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
-import java.io.InputStreamReader;\r
-import java.io.Reader;\r
-import java.net.URISyntaxException;\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import javax.xml.parsers.ParserConfigurationException;\r
-import javax.xml.parsers.SAXParser;\r
-import javax.xml.parsers.SAXParserFactory;\r
-\r
-import org.xml.sax.Attributes;\r
-import org.xml.sax.InputSource;\r
-import org.xml.sax.SAXException;\r
-import org.xml.sax.helpers.DefaultHandler;\r
-\r
-import eu.etaxonomy.cdm.common.URI;\r
-import eu.etaxonomy.cdm.ext.common.SchemaAdapterBase;\r
-import eu.etaxonomy.cdm.model.agent.Person;\r
-import eu.etaxonomy.cdm.model.agent.Team;\r
-import eu.etaxonomy.cdm.model.common.VerbatimTimePeriod;\r
-import eu.etaxonomy.cdm.model.reference.Reference;\r
-\r
-/**\r
- * @author a.kohlbecker\r
- * @since 25.08.2010\r
- */\r
-public class MobotOpenUrlResponseSchemaAdapter extends SchemaAdapterBase<Reference>{\r
-\r
- static URI identifier = null;\r
-\r
- @Override\r
- public URI getIdentifier() {\r
- return identifier;\r
- }\r
-\r
- @Override\r
- public String getShortName() {\r
- return "MOBOT.OpenUrl.Utilities.OpenUrlResponse";\r
- }\r
-\r
- @Override\r
- public List<Reference> getCmdEntities(InputStream inputStream) throws IOException {\r
-\r
- SAXParserFactory factory = SAXParserFactory.newInstance();\r
- factory.setNamespaceAware(true);\r
- SAXParser parser = null;\r
- try {\r
- parser = factory.newSAXParser();\r
- } catch (ParserConfigurationException e) {\r
- logger.error(e);\r
- } catch (SAXException e) {\r
- logger.error(e);\r
- }\r
-\r
- OpenUrlResponseHandler handler = new OpenUrlResponseHandler();\r
-\r
- try {\r
- if(parser != null){\r
- Reader reader = new InputStreamReader(inputStream, "UTF-8");\r
- InputSource inputSource = new InputSource(reader);\r
- parser.parse(inputSource, handler);\r
- if(handler.status != ResponseStatus.Success){\r
- throw new IOException("MOBOT.OpenUrl.Utilities.OpenUrlResponse - Status:" + handler.status.toString() + (handler.message != null ? handler.message : ""));\r
- }\r
- } else {\r
- logger.error("parser is null");\r
- }\r
- } catch (SAXException e) {\r
- logger.error(e);\r
- }\r
-\r
-\r
- return handler.referenceList;\r
- }\r
-\r
- class OpenUrlResponseHandler extends DefaultHandler {\r
-\r
- /*\r
- * Fields of OpenUrlResponse\r
- * see http://code.google.com/p/bhl-bits/source/browse/trunk/portal/OpenUrlUtilities/OpenUrlResponse.cs\r
- */\r
- private static final String OPENURL_RESPONSE = "OpenUrlResponse";\r
- private static final String STATUS = "Status";\r
- private static final String MESSAGE = "Message";\r
- private static final String CITATIONS = "citations";\r
- private static final String OPENURL_RESPONSE_CITATION = "OpenUrlResponseCitation";\r
-\r
- /*\r
- * Fields of OpenUrlResponseCitation\r
- * see http://code.google.com/p/bhl-bits/source/browse/trunk/portal/OpenUrlUtilities/OpenUrlResponseCitation.cs\r
- */\r
-\r
- /**\r
- * references the specific page in the title\r
- */\r
- private static final String URL = "Url";\r
- /**\r
- * references the according entry in the bibliography\r
- */\r
- private static final String ITEM_URL = "ItemUrl";\r
-\r
- /**\r
- * references the specific book or journal, that is to the front page\r
- */\r
- private static final String TITLE_URL = "TitleUrl";\r
- private static final String TITLE = "Title";\r
- private static final String STITLE = "STitle";\r
- /**\r
- * seems to contain the type of the reference : book\r
- */\r
- private static final String GENRE = "Genre";\r
- private static final String AUTHORS = "Authors";\r
- private static final String SUBJECTS = "Subjects";\r
- private static final String PUBLISHER_NAME = "PublisherName";\r
- private static final String PUBLISHER_PLACE = "PublisherPlace";\r
- private static final String DATE = "Date";\r
- private static final String VOLUME = "Volume";\r
- private static final String EDITION = "Edition";\r
- private static final String PUBLICATION_FREQUENCY = "PublicationFrequency";\r
- private static final String LANGUAGE = "Language";\r
- private static final String OCLC = "Oclc";\r
- private static final String LCCN = "Lccn";\r
- private static final String ISSN = "Issn";\r
- private static final String ATITLE = "ATitle";\r
- private static final String SPAGE = "SPage";\r
- private static final String EPAGE = "EPage";\r
- private static final String PAGES = "Pages";\r
-\r
- List<Reference> referenceList = new ArrayList<>();\r
-\r
- OpenUrlReference reference = null;\r
-\r
- ResponseStatus status = null;\r
- Team authorship = null;\r
- String message = null;\r
-\r
- String elementName = null;\r
- private String elementNameToStore;\r
- private StringBuilder textBuffer = new StringBuilder();\r
-\r
- @Override\r
- public void startElement(String uri, String localName,\r
- String qName, Attributes attributes) throws SAXException {\r
-\r
- if (qName.equals(OPENURL_RESPONSE)) {\r
- logger.debug("Start " + OPENURL_RESPONSE + "; ");\r
- status = ResponseStatus.Undefined; // indicates that the OPENURL_RESPONSE element has ben detected\r
- } else if (status != null && qName.equals(OPENURL_RESPONSE_CITATION)) {\r
- reference = new OpenUrlReference();\r
- } else if (reference != null && qName.equals(AUTHORS)) {\r
- authorship = Team.NewInstance();\r
- } else if (reference != null && qName.equals(SUBJECTS)) {\r
- //TODO implement, but no equivalent in the cdm model\r
- } else {\r
- elementName = qName;\r
- }\r
- }\r
-\r
- @Override\r
- public void endElement(String uri, String localName, String qName) throws SAXException {\r
-\r
- if (qName.equals(OPENURL_RESPONSE)) {\r
-\r
- } else if (qName.equals(OPENURL_RESPONSE_CITATION)) {\r
- referenceList.add(reference);\r
- reference = null;\r
- } else if (reference != null && qName.equals(AUTHORS)) {\r
- reference.setAuthorship(authorship);\r
- authorship = null;\r
- } else if (reference != null && qName.equals(SUBJECTS)) {\r
- //TODO implement, but no equivalent in the cdm model\r
- }else {\r
- elementNameToStore = elementName;\r
- elementName = null;\r
- }\r
-\r
- }\r
-\r
- @Override\r
- public void characters(char ch[], int start, int length)\r
- throws SAXException {\r
-\r
- if(elementNameToStore == null){\r
- textBuffer.append(new String(ch, start, length));\r
- } else {\r
-\r
- logger.debug("Characters [" + elementNameToStore + "]: " + textBuffer);\r
- String trimmedText = textBuffer.toString().trim();\r
- // empty the text buffer\r
- textBuffer.delete(0, textBuffer.length());\r
-\r
- // --- Reference --- //\r
- if(reference != null){\r
-\r
- if(elementNameToStore.equals(URL)){\r
- try {\r
- reference.setUri(new URI(trimmedText));\r
- } catch (URISyntaxException e) {\r
- logger.warn(e.getMessage());\r
- }\r
- }\r
- if(elementNameToStore.equals(ITEM_URL)){\r
- try {\r
- reference.setItemUri(new URI(trimmedText));\r
- } catch (URISyntaxException e) {\r
- logger.warn(e.getMessage());\r
- }\r
- }\r
- if(elementNameToStore.equals(TITLE_URL)){\r
- try {\r
- reference.setTitleUri(new URI(trimmedText));\r
- } catch (URISyntaxException e) {\r
- logger.warn(e.getMessage());\r
- }\r
- }\r
- if(elementNameToStore.equals(TITLE)){\r
- reference.setTitleCache(trimmedText, true);\r
- }\r
- if(elementNameToStore.equals(STITLE)){\r
- logger.debug(elementNameToStore + " not yet implemented!");//TODO\r
- }\r
- if(elementNameToStore.equals(ATITLE)){\r
- logger.debug(elementNameToStore + " not yet implemented!");//TODO\r
- }\r
- if(elementNameToStore.equals(PUBLISHER_NAME)){\r
- reference.setPublisher(trimmedText);\r
- }\r
- if(elementNameToStore.equals(PUBLISHER_PLACE)){\r
- reference.setPlacePublished(trimmedText);\r
- }\r
- if(elementNameToStore.equals(DATE)){\r
- /* may be a single year or a range of years 1797-1830 */\r
- Integer startYear = null;\r
- Integer endYear = null;\r
- if(trimmedText.length() == 9 && trimmedText.indexOf("-") == 4){\r
- try {\r
- startYear = Integer.valueOf(trimmedText.substring(0, 4));\r
- endYear = Integer.valueOf(trimmedText.substring(5));\r
- reference.setDatePublished(VerbatimTimePeriod.NewVerbatimInstance(startYear, endYear));\r
- } catch (NumberFormatException e) {\r
- logger.error("date can not be parsed: "+ trimmedText);\r
- }\r
- } else if(trimmedText.length() == 4) {\r
- try {\r
- startYear = Integer.valueOf(trimmedText);\r
- } catch (NumberFormatException e) {\r
- logger.error("date can not be parsed: "+ trimmedText);\r
- }\r
- reference.setDatePublished(VerbatimTimePeriod.NewVerbatimInstance(startYear));\r
- }\r
- }\r
- if(elementNameToStore.equals(VOLUME)){\r
- reference.setVolume(trimmedText);\r
- }\r
- if(elementNameToStore.equals(EDITION)){\r
- reference.setEdition(trimmedText);\r
- }\r
- if(elementNameToStore.equals(SPAGE)){\r
- reference.setPages(trimmedText);\r
- }\r
- if(elementNameToStore.equals(EPAGE)){\r
- logger.debug(elementNameToStore + " not yet implemented!");//TODO\r
- }\r
- if(elementNameToStore.equals(PAGES)){\r
- // IGNORE we rather need the start page value SPAGE\r
- }\r
- if(elementNameToStore.equals(PUBLICATION_FREQUENCY)){\r
- logger.debug(elementNameToStore + " not yet implemented!");//TODO\r
- }\r
- if(elementNameToStore.equals(LANGUAGE)){\r
- logger.debug(elementNameToStore + " not yet implemented!");//TODO\r
- }\r
- if(elementNameToStore.equals(OCLC)){\r
- logger.debug(elementNameToStore + " not yet implemented!");//TODO\r
- }\r
- if(elementNameToStore.equals(LCCN)){\r
- logger.debug(elementNameToStore + " not yet implemented!");//TODO\r
- }\r
- if(elementNameToStore.equals(ISSN)){\r
- reference.setIssn(trimmedText);\r
- }\r
- }\r
-\r
- // --- Reference.authorship --- //\r
- if(authorship != null && reference != null){\r
- if(elementNameToStore.equals("String")){\r
- authorship.addTeamMember(Person.NewTitledInstance(trimmedText));\r
- }\r
- }\r
-\r
- // openUrlResponse //\r
- if(reference == null){\r
- if(elementNameToStore.equals(STATUS)){\r
- status = ResponseStatus.valueOf(trimmedText);\r
- }\r
- }\r
-\r
- elementNameToStore = null;\r
- }\r
- }\r
-\r
- }\r
-\r
- /**\r
- * @see http://code.google.com/p/bhl-bits/source/browse/trunk/portal/OpenUrlUtilities/IOpenUrlResponse.cs\r
- */\r
- public enum ResponseStatus {\r
- Undefined, // Query not submitted\r
- Success, Error\r
- }\r
-\r
-\r
-}\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.ext.openurl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import eu.etaxonomy.cdm.common.URI;
+import eu.etaxonomy.cdm.ext.common.SchemaAdapterBase;
+import eu.etaxonomy.cdm.model.agent.Person;
+import eu.etaxonomy.cdm.model.agent.Team;
+import eu.etaxonomy.cdm.model.common.VerbatimTimePeriod;
+import eu.etaxonomy.cdm.model.reference.Reference;
+
+/**
+ * @author a.kohlbecker
+ * @since 25.08.2010
+ */
+public class MobotOpenUrlResponseSchemaAdapter extends SchemaAdapterBase<Reference>{
+
+ private static final Logger logger = LogManager.getLogger();
+
+ private static URI identifier = null;
+
+ @Override
+ public URI getIdentifier() {
+ return identifier;
+ }
+
+ @Override
+ public String getShortName() {
+ return "MOBOT.OpenUrl.Utilities.OpenUrlResponse";
+ }
+
+ @Override
+ public List<Reference> getCmdEntities(InputStream inputStream) throws IOException {
+
+ SAXParserFactory factory = SAXParserFactory.newInstance();
+ factory.setNamespaceAware(true);
+ SAXParser parser = null;
+ try {
+ parser = factory.newSAXParser();
+ } catch (ParserConfigurationException e) {
+ logger.error(e);
+ } catch (SAXException e) {
+ logger.error(e);
+ }
+
+ OpenUrlResponseHandler handler = new OpenUrlResponseHandler();
+
+ try {
+ if(parser != null){
+ Reader reader = new InputStreamReader(inputStream, "UTF-8");
+ InputSource inputSource = new InputSource(reader);
+ parser.parse(inputSource, handler);
+ if(handler.status != ResponseStatus.Success){
+ throw new IOException("MOBOT.OpenUrl.Utilities.OpenUrlResponse - Status:" + handler.status.toString() + (handler.message != null ? handler.message : ""));
+ }
+ } else {
+ logger.error("parser is null");
+ }
+ } catch (SAXException e) {
+ logger.error(e);
+ }
+
+
+ return handler.referenceList;
+ }
+
+ class OpenUrlResponseHandler extends DefaultHandler {
+
+ /*
+ * Fields of OpenUrlResponse
+ * see http://code.google.com/p/bhl-bits/source/browse/trunk/portal/OpenUrlUtilities/OpenUrlResponse.cs
+ */
+ private static final String OPENURL_RESPONSE = "OpenUrlResponse";
+ private static final String STATUS = "Status";
+ private static final String MESSAGE = "Message";
+ private static final String CITATIONS = "citations";
+ private static final String OPENURL_RESPONSE_CITATION = "OpenUrlResponseCitation";
+
+ /*
+ * Fields of OpenUrlResponseCitation
+ * see http://code.google.com/p/bhl-bits/source/browse/trunk/portal/OpenUrlUtilities/OpenUrlResponseCitation.cs
+ */
+
+ /**
+ * references the specific page in the title
+ */
+ private static final String URL = "Url";
+ /**
+ * references the according entry in the bibliography
+ */
+ private static final String ITEM_URL = "ItemUrl";
+
+ /**
+ * references the specific book or journal, that is to the front page
+ */
+ private static final String TITLE_URL = "TitleUrl";
+ private static final String TITLE = "Title";
+ private static final String STITLE = "STitle";
+ /**
+ * seems to contain the type of the reference : book
+ */
+ private static final String GENRE = "Genre";
+ private static final String AUTHORS = "Authors";
+ private static final String SUBJECTS = "Subjects";
+ private static final String PUBLISHER_NAME = "PublisherName";
+ private static final String PUBLISHER_PLACE = "PublisherPlace";
+ private static final String DATE = "Date";
+ private static final String VOLUME = "Volume";
+ private static final String EDITION = "Edition";
+ private static final String PUBLICATION_FREQUENCY = "PublicationFrequency";
+ private static final String LANGUAGE = "Language";
+ private static final String OCLC = "Oclc";
+ private static final String LCCN = "Lccn";
+ private static final String ISSN = "Issn";
+ private static final String ATITLE = "ATitle";
+ private static final String SPAGE = "SPage";
+ private static final String EPAGE = "EPage";
+ private static final String PAGES = "Pages";
+
+ List<Reference> referenceList = new ArrayList<>();
+
+ OpenUrlReference reference = null;
+
+ ResponseStatus status = null;
+ Team authorship = null;
+ String message = null;
+
+ String elementName = null;
+ private String elementNameToStore;
+ private StringBuilder textBuffer = new StringBuilder();
+
+ @Override
+ public void startElement(String uri, String localName,
+ String qName, Attributes attributes) throws SAXException {
+
+ if (qName.equals(OPENURL_RESPONSE)) {
+ logger.debug("Start " + OPENURL_RESPONSE + "; ");
+ status = ResponseStatus.Undefined; // indicates that the OPENURL_RESPONSE element has ben detected
+ } else if (status != null && qName.equals(OPENURL_RESPONSE_CITATION)) {
+ reference = new OpenUrlReference();
+ } else if (reference != null && qName.equals(AUTHORS)) {
+ authorship = Team.NewInstance();
+ } else if (reference != null && qName.equals(SUBJECTS)) {
+ //TODO implement, but no equivalent in the cdm model
+ } else {
+ elementName = qName;
+ }
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String qName) throws SAXException {
+
+ if (qName.equals(OPENURL_RESPONSE)) {
+
+ } else if (qName.equals(OPENURL_RESPONSE_CITATION)) {
+ referenceList.add(reference);
+ reference = null;
+ } else if (reference != null && qName.equals(AUTHORS)) {
+ reference.setAuthorship(authorship);
+ authorship = null;
+ } else if (reference != null && qName.equals(SUBJECTS)) {
+ //TODO implement, but no equivalent in the cdm model
+ }else {
+ elementNameToStore = elementName;
+ elementName = null;
+ }
+
+ }
+
+ @Override
+ public void characters(char ch[], int start, int length)
+ throws SAXException {
+
+ if(elementNameToStore == null){
+ textBuffer.append(new String(ch, start, length));
+ } else {
+
+ logger.debug("Characters [" + elementNameToStore + "]: " + textBuffer);
+ String trimmedText = textBuffer.toString().trim();
+ // empty the text buffer
+ textBuffer.delete(0, textBuffer.length());
+
+ // --- Reference --- //
+ if(reference != null){
+
+ if(elementNameToStore.equals(URL)){
+ try {
+ reference.setUri(new URI(trimmedText));
+ } catch (URISyntaxException e) {
+ logger.warn(e.getMessage());
+ }
+ }
+ if(elementNameToStore.equals(ITEM_URL)){
+ try {
+ reference.setItemUri(new URI(trimmedText));
+ } catch (URISyntaxException e) {
+ logger.warn(e.getMessage());
+ }
+ }
+ if(elementNameToStore.equals(TITLE_URL)){
+ try {
+ reference.setTitleUri(new URI(trimmedText));
+ } catch (URISyntaxException e) {
+ logger.warn(e.getMessage());
+ }
+ }
+ if(elementNameToStore.equals(TITLE)){
+ reference.setTitleCache(trimmedText, true);
+ }
+ if(elementNameToStore.equals(STITLE)){
+ logger.debug(elementNameToStore + " not yet implemented!");//TODO
+ }
+ if(elementNameToStore.equals(ATITLE)){
+ logger.debug(elementNameToStore + " not yet implemented!");//TODO
+ }
+ if(elementNameToStore.equals(PUBLISHER_NAME)){
+ reference.setPublisher(trimmedText);
+ }
+ if(elementNameToStore.equals(PUBLISHER_PLACE)){
+ reference.setPlacePublished(trimmedText);
+ }
+ if(elementNameToStore.equals(DATE)){
+ /* may be a single year or a range of years 1797-1830 */
+ Integer startYear = null;
+ Integer endYear = null;
+ if(trimmedText.length() == 9 && trimmedText.indexOf("-") == 4){
+ try {
+ startYear = Integer.valueOf(trimmedText.substring(0, 4));
+ endYear = Integer.valueOf(trimmedText.substring(5));
+ reference.setDatePublished(VerbatimTimePeriod.NewVerbatimInstance(startYear, endYear));
+ } catch (NumberFormatException e) {
+ logger.error("date can not be parsed: "+ trimmedText);
+ }
+ } else if(trimmedText.length() == 4) {
+ try {
+ startYear = Integer.valueOf(trimmedText);
+ } catch (NumberFormatException e) {
+ logger.error("date can not be parsed: "+ trimmedText);
+ }
+ reference.setDatePublished(VerbatimTimePeriod.NewVerbatimInstance(startYear));
+ }
+ }
+ if(elementNameToStore.equals(VOLUME)){
+ reference.setVolume(trimmedText);
+ }
+ if(elementNameToStore.equals(EDITION)){
+ reference.setEdition(trimmedText);
+ }
+ if(elementNameToStore.equals(SPAGE)){
+ reference.setPages(trimmedText);
+ }
+ if(elementNameToStore.equals(EPAGE)){
+ logger.debug(elementNameToStore + " not yet implemented!");//TODO
+ }
+ if(elementNameToStore.equals(PAGES)){
+ // IGNORE we rather need the start page value SPAGE
+ }
+ if(elementNameToStore.equals(PUBLICATION_FREQUENCY)){
+ logger.debug(elementNameToStore + " not yet implemented!");//TODO
+ }
+ if(elementNameToStore.equals(LANGUAGE)){
+ logger.debug(elementNameToStore + " not yet implemented!");//TODO
+ }
+ if(elementNameToStore.equals(OCLC)){
+ logger.debug(elementNameToStore + " not yet implemented!");//TODO
+ }
+ if(elementNameToStore.equals(LCCN)){
+ logger.debug(elementNameToStore + " not yet implemented!");//TODO
+ }
+ if(elementNameToStore.equals(ISSN)){
+ reference.setIssn(trimmedText);
+ }
+ }
+
+ // --- Reference.authorship --- //
+ if(authorship != null && reference != null){
+ if(elementNameToStore.equals("String")){
+ authorship.addTeamMember(Person.NewTitledInstance(trimmedText));
+ }
+ }
+
+ // openUrlResponse //
+ if(reference == null){
+ if(elementNameToStore.equals(STATUS)){
+ status = ResponseStatus.valueOf(trimmedText);
+ }
+ }
+
+ elementNameToStore = null;
+ }
+ }
+
+ }
+
+ /**
+ * @see http://code.google.com/p/bhl-bits/source/browse/trunk/portal/OpenUrlUtilities/IOpenUrlResponse.cs
+ */
+ public enum ResponseStatus {
+ Undefined, // Query not submitted
+ Success, Error
+ }
+
+
+}
-/**\r
- * Copyright (C) 2009 EDIT\r
- * European Distributed Institute of Taxonomy\r
- * http://www.e-taxonomy.eu\r
- *\r
- * The contents of this file are subject to the Mozilla Public License Version 1.1\r
- * See LICENSE.TXT at the top of this package for the full license terms.\r
- */\r
-package eu.etaxonomy.cdm.ext.openurl;\r
-\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
-import java.net.URISyntaxException;\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.apache.http.NameValuePair;\r
-import org.apache.http.message.BasicNameValuePair;\r
-\r
-import eu.etaxonomy.cdm.common.URI;\r
-import eu.etaxonomy.cdm.ext.common.SchemaAdapterBase;\r
-import eu.etaxonomy.cdm.ext.common.ServiceWrapperBase;\r
-import eu.etaxonomy.cdm.model.reference.Reference;\r
-\r
-/**\r
- * Generic ServiceWrapper for OpenUrl 1.0 services, initially implemented to be\r
- * used with the BHL OpenUrl resolver\r
- * (http://www.biodiversitylibrary.org/openurl) but might also work with other\r
- * resolvers which meet the Z39.88-2004 (=OpenURL 1.0) specification\r
- * <p>\r
- * For references see:\r
- * <ul>\r
- * <li>BHL OpenUrl resolver reference:\r
- * http://www.biodiversitylibrary.org/openurlhelp.aspx</li>\r
- * <li>ANSI/NISO Z39.88-2004 (=OpenURL 1.0) specification:\r
- * http://www.niso.org/kst/reports/standards?step=2&gid=&project_key=\r
- * d5320409c5160be4697dc046613f71b9a773cd9e</li>\r
- * </ul>\r
- *\r
- * @author a.kohlbecker\r
- * @since 24.08.2010\r
- *\r
- */\r
-public class MobotOpenUrlServiceWrapper extends ServiceWrapperBase<OpenUrlReference> {\r
-\r
- private String urlVersion = "Z39.88-2004";\r
-\r
- public MobotOpenUrlServiceWrapper(){\r
- addSchemaAdapter(new MobotOpenUrlResponseSchemaAdapter());\r
- }\r
-\r
- /**\r
- * BHL uses the response format as specified in the\r
- * http://code.google.com/p/\r
- * bhl-bits/source/browse/trunk/portal/OpenUrlUtilities\r
- * /OpenUrlResponse.cs?r=17 there seems to be no xml schema available\r
- * though.\r
- * @param query the MobotOpenUrlQuery object\r
- * @return\r
- */\r
- public List<OpenUrlReference> doResolve(MobotOpenUrlQuery query) {\r
-\r
- List<NameValuePair> pairs = new ArrayList<>();\r
-\r
- // find the appropriate schemadapter using the schemaShortName\r
- if(query.schemaShortName == null){\r
- query.schemaShortName = "MOBOT.OpenUrl.Utilities.OpenUrlResponse";\r
- }\r
- SchemaAdapterBase<OpenUrlReference> schemaAdapter = schemaAdapterMap.get(query.schemaShortName);\r
- if (schemaAdapter == null) {\r
- logger.error("No SchemaAdapter found for " + query.schemaShortName);\r
- }\r
-\r
- addNameValuePairTo(pairs, "format", "xml");\r
- addNameValuePairTo(pairs, "url_ver", urlVersion);\r
- /* info:ofi/fmt:kev:mtx:book or info:ofi/fmt:kev:mtx:journal */\r
- addNameValuePairTo(pairs, "rft_val_fmt", "info:ofi/fmt:kev:mtx:" + query.refType);\r
- /* Book title */\r
- addNameValuePairTo(pairs, "rft.btitle", query.bookTitle);\r
- /* Journal title */\r
- addNameValuePairTo(pairs, "rft.jtitle", query.journalTitle);\r
- /* Author name ("last, first" or "corporation") */\r
- addNameValuePairTo(pairs, "rft.au", query.authorName);\r
- /* Author last name */\r
- addNameValuePairTo(pairs, "rft.aulast", query.authorLastName);\r
- /* Author first name */\r
- addNameValuePairTo(pairs, "rft.aufirst", query.authorFirstName);\r
- /* Author name (corporation) */\r
- addNameValuePairTo(pairs, "rft.aucorp", query.authorNameCorporation);\r
- /* Publication details */\r
- addNameValuePairTo(pairs, "rft.publisher", query.publicationDetails);\r
- /* Publisher name */\r
- addNameValuePairTo(pairs, "rft.pub", query.publisherName);\r
- /* Publication place */\r
- addNameValuePairTo(pairs, "rft.place", query.publicationPlace);\r
- /* Publication date (YYYY or YYYY-MM or YYYY-MM-DD) */\r
- addNameValuePairTo(pairs, "rft.date", query.publicationDate);\r
- /* ISSN */\r
- addNameValuePairTo(pairs, "rft.issn", query.ISSN);\r
- /* ISBN */\r
- addNameValuePairTo(pairs, "rft.isbn", query.ISBN);\r
- /* CODEN */\r
- addNameValuePairTo(pairs, "rft.coden", query.CODEN);\r
- /* Abbreviation = abbreviated Title */\r
- addNameValuePairTo(pairs, "rft.stitle", query.abbreviation);\r
- /* Volume */\r
- addNameValuePairTo(pairs, "rft.volume", query.volume);\r
- /* Issue */\r
- addNameValuePairTo(pairs, "rft.issue", query.issue);\r
- /* Start page */\r
- if(query.startPage != null){\r
- Integer page = parsePageNumber(query.startPage);\r
- addNameValuePairTo(pairs, "rft.spage", page.toString());\r
- }\r
- /* BHL title ID (where XXXX is the ID value)*/\r
- addNameValuePairTo(pairs, "rft_id" , query.bhlTitleURI);\r
- /* BHL page ID (where XXXX is the ID value)*/\r
- addNameValuePairTo(pairs, "rft_id", query.bhlPageURI);\r
-\r
- /* OCLC number (where XXXX is the ID value)*/\r
- if(query.oclcNumber != null){\r
- pairs.add(new BasicNameValuePair("rft_id", "info:oclcnum/" +query.oclcNumber));\r
- }\r
- /* Lib. of Congress ID (where XXXX is the ID value)*/\r
- if(query.libofCongressID != null){\r
- pairs.add(new BasicNameValuePair("rft_id", "info:lccn/" +query.libofCongressID));\r
- }\r
-\r
- Map<String, String> requestHeaders = new HashMap<>();\r
- requestHeaders.put("Accept-Charset", "UTF-8");\r
-\r
- try {\r
- URI requestUri = createUri(null, pairs);\r
-\r
- InputStream stream = executeHttpGet(requestUri, requestHeaders);\r
-// String search = "utf-16";\r
-// String replace = "UTF-8";\r
-//// stream = StreamUtils.streamReplace(stream, search, replace);\r
- // fix the "org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1) was found" problem\r
-// stream = StreamUtils.streamReplaceAll(stream, "[\\x00-\\x10]", " ");\r
-\r
- List<OpenUrlReference> referenceList = schemaAdapter.getCmdEntities(stream);\r
- // TODO : we need to set ReferenceType here unless we know that the field Genre returns the reference type\r
- for(OpenUrlReference ref : referenceList){\r
- ref.setReferenceType(query.refType);\r
- }\r
- return referenceList;\r
-\r
- } catch (IOException e) {\r
- // thrown by doHttpGet\r
- logger.error(e);\r
- } catch (URISyntaxException e) {\r
- // thrown by createUri\r
- logger.error(e);\r
- }\r
-\r
- return null;\r
-\r
- }\r
-\r
- private Integer parsePageNumber(String startPage) {\r
- String pageIndices = startPage.replaceAll("(?i)page|pages|p|p\\.|pp\\.|pp", "");\r
- String[] pageIndexTokens = pageIndices.split("[,-]", 1);\r
- Integer page = null;\r
- try {\r
- if(pageIndexTokens[0] != null){\r
- pageIndexTokens[0] = pageIndexTokens[0].trim();\r
- } else {\r
- throw new NumberFormatException();\r
- }\r
- page = Integer.valueOf(pageIndexTokens[0]);\r
- } catch (NumberFormatException e) {\r
- logger.warn("First page number token of " + startPage + " is not a Number", e);\r
- throw e;\r
- }\r
- return page;\r
- }\r
-\r
-\r
- /**\r
- * @param reference\r
- * the OpenUrlReference instance as a starting point for paging.\r
- * @param forward\r
- * integer indicating the number of pages to page forward. An\r
- * negative integer will page backwards\r
- * @return\r
- * @throws IllegalArgumentException\r
- * if the requested page number is not existent or if the field\r
- * or if OpenUrlReference.pages is not parsable\r
- */\r
- public List<OpenUrlReference> doPage(OpenUrlReference reference, int forward) throws IllegalArgumentException{\r
-\r
- Integer pageIndex = null;\r
- try{\r
- if(reference.getPages() != null){\r
- pageIndex = parsePageNumber(reference.getPages());\r
- pageIndex += forward;\r
- }\r
- }catch(NumberFormatException e){\r
- String errorMessage = "Reference has no page number or the field 'pages' is not parsable";\r
- logger.warn(errorMessage);\r
- throw new IllegalArgumentException(errorMessage);\r
- }\r
-\r
- MobotOpenUrlQuery query = new MobotOpenUrlQuery();\r
- query.bhlTitleURI = reference.getTitleUri();\r
- if(pageIndex != null){\r
- query.startPage = pageIndex.toString();\r
- }\r
- query.refType = reference.getReferenceType();\r
- return doResolve(query);\r
- }\r
-\r
- public enum ReferenceType{\r
- book, journal;\r
-\r
- public static ReferenceType getReferenceType(Reference reference){\r
- if(eu.etaxonomy.cdm.model.reference.ReferenceType.Book.equals(reference.getType())){\r
- return book;\r
- }\r
- else if(eu.etaxonomy.cdm.model.reference.ReferenceType.Journal.equals(reference.getType())){\r
- return journal;\r
- }\r
- else {\r
- return null;\r
- }\r
- }\r
- }\r
-\r
-}\r
+/**
+ * Copyright (C) 2009 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.cdm.ext.openurl;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.NameValuePair;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import eu.etaxonomy.cdm.common.URI;
+import eu.etaxonomy.cdm.ext.common.SchemaAdapterBase;
+import eu.etaxonomy.cdm.ext.common.ServiceWrapperBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+
+/**
+ * Generic ServiceWrapper for OpenUrl 1.0 services, initially implemented to be
+ * used with the BHL OpenUrl resolver
+ * (http://www.biodiversitylibrary.org/openurl) but might also work with other
+ * resolvers which meet the Z39.88-2004 (=OpenURL 1.0) specification
+ * <p>
+ * For references see:
+ * <ul>
+ * <li>BHL OpenUrl resolver reference:
+ * http://www.biodiversitylibrary.org/openurlhelp.aspx</li>
+ * <li>ANSI/NISO Z39.88-2004 (=OpenURL 1.0) specification:
+ * http://www.niso.org/kst/reports/standards?step=2&gid=&project_key=
+ * d5320409c5160be4697dc046613f71b9a773cd9e</li>
+ * </ul>
+ *
+ * @author a.kohlbecker
+ * @since 24.08.2010
+ *
+ */
+public class MobotOpenUrlServiceWrapper extends ServiceWrapperBase<OpenUrlReference> {
+
+ private static final Logger logger = LogManager.getLogger();
+
+ private String urlVersion = "Z39.88-2004";
+
+ public MobotOpenUrlServiceWrapper(){
+ addSchemaAdapter(new MobotOpenUrlResponseSchemaAdapter());
+ }
+
+ /**
+ * BHL uses the response format as specified in the
+ * http://code.google.com/p/
+ * bhl-bits/source/browse/trunk/portal/OpenUrlUtilities
+ * /OpenUrlResponse.cs?r=17 there seems to be no xml schema available
+ * though.
+ * @param query the MobotOpenUrlQuery object
+ * @return
+ */
+ public List<OpenUrlReference> doResolve(MobotOpenUrlQuery query) {
+
+ List<NameValuePair> pairs = new ArrayList<>();
+
+ // find the appropriate schemadapter using the schemaShortName
+ if(query.schemaShortName == null){
+ query.schemaShortName = "MOBOT.OpenUrl.Utilities.OpenUrlResponse";
+ }
+ SchemaAdapterBase<OpenUrlReference> schemaAdapter = schemaAdapterMap.get(query.schemaShortName);
+ if (schemaAdapter == null) {
+ logger.error("No SchemaAdapter found for " + query.schemaShortName);
+ }
+
+ addNameValuePairTo(pairs, "format", "xml");
+ addNameValuePairTo(pairs, "url_ver", urlVersion);
+ /* info:ofi/fmt:kev:mtx:book or info:ofi/fmt:kev:mtx:journal */
+ addNameValuePairTo(pairs, "rft_val_fmt", "info:ofi/fmt:kev:mtx:" + query.refType);
+ /* Book title */
+ addNameValuePairTo(pairs, "rft.btitle", query.bookTitle);
+ /* Journal title */
+ addNameValuePairTo(pairs, "rft.jtitle", query.journalTitle);
+ /* Author name ("last, first" or "corporation") */
+ addNameValuePairTo(pairs, "rft.au", query.authorName);
+ /* Author last name */
+ addNameValuePairTo(pairs, "rft.aulast", query.authorLastName);
+ /* Author first name */
+ addNameValuePairTo(pairs, "rft.aufirst", query.authorFirstName);
+ /* Author name (corporation) */
+ addNameValuePairTo(pairs, "rft.aucorp", query.authorNameCorporation);
+ /* Publication details */
+ addNameValuePairTo(pairs, "rft.publisher", query.publicationDetails);
+ /* Publisher name */
+ addNameValuePairTo(pairs, "rft.pub", query.publisherName);
+ /* Publication place */
+ addNameValuePairTo(pairs, "rft.place", query.publicationPlace);
+ /* Publication date (YYYY or YYYY-MM or YYYY-MM-DD) */
+ addNameValuePairTo(pairs, "rft.date", query.publicationDate);
+ /* ISSN */
+ addNameValuePairTo(pairs, "rft.issn", query.ISSN);
+ /* ISBN */
+ addNameValuePairTo(pairs, "rft.isbn", query.ISBN);
+ /* CODEN */
+ addNameValuePairTo(pairs, "rft.coden", query.CODEN);
+ /* Abbreviation = abbreviated Title */
+ addNameValuePairTo(pairs, "rft.stitle", query.abbreviation);
+ /* Volume */
+ addNameValuePairTo(pairs, "rft.volume", query.volume);
+ /* Issue */
+ addNameValuePairTo(pairs, "rft.issue", query.issue);
+ /* Start page */
+ if(query.startPage != null){
+ Integer page = parsePageNumber(query.startPage);
+ addNameValuePairTo(pairs, "rft.spage", page.toString());
+ }
+ /* BHL title ID (where XXXX is the ID value)*/
+ addNameValuePairTo(pairs, "rft_id" , query.bhlTitleURI);
+ /* BHL page ID (where XXXX is the ID value)*/
+ addNameValuePairTo(pairs, "rft_id", query.bhlPageURI);
+
+ /* OCLC number (where XXXX is the ID value)*/
+ if(query.oclcNumber != null){
+ pairs.add(new BasicNameValuePair("rft_id", "info:oclcnum/" +query.oclcNumber));
+ }
+ /* Lib. of Congress ID (where XXXX is the ID value)*/
+ if(query.libofCongressID != null){
+ pairs.add(new BasicNameValuePair("rft_id", "info:lccn/" +query.libofCongressID));
+ }
+
+ Map<String, String> requestHeaders = new HashMap<>();
+ requestHeaders.put("Accept-Charset", "UTF-8");
+
+ try {
+ URI requestUri = createUri(null, pairs);
+
+ InputStream stream = executeHttpGet(requestUri, requestHeaders);
+// String search = "utf-16";
+// String replace = "UTF-8";
+//// stream = StreamUtils.streamReplace(stream, search, replace);
+ // fix the "org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1) was found" problem
+// stream = StreamUtils.streamReplaceAll(stream, "[\\x00-\\x10]", " ");
+
+ List<OpenUrlReference> referenceList = schemaAdapter.getCmdEntities(stream);
+ // TODO : we need to set ReferenceType here unless we know that the field Genre returns the reference type
+ for(OpenUrlReference ref : referenceList){
+ ref.setReferenceType(query.refType);
+ }
+ return referenceList;
+
+ } catch (IOException e) {
+ // thrown by doHttpGet
+ logger.error(e);
+ } catch (URISyntaxException e) {
+ // thrown by createUri
+ logger.error(e);
+ }
+
+ return null;
+
+ }
+
+ private Integer parsePageNumber(String startPage) {
+ String pageIndices = startPage.replaceAll("(?i)page|pages|p|p\\.|pp\\.|pp", "");
+ String[] pageIndexTokens = pageIndices.split("[,-]", 1);
+ Integer page = null;
+ try {
+ if(pageIndexTokens[0] != null){
+ pageIndexTokens[0] = pageIndexTokens[0].trim();
+ } else {
+ throw new NumberFormatException();
+ }
+ page = Integer.valueOf(pageIndexTokens[0]);
+ } catch (NumberFormatException e) {
+ logger.warn("First page number token of " + startPage + " is not a Number", e);
+ throw e;
+ }
+ return page;
+ }
+
+
+ /**
+ * @param reference
+ * the OpenUrlReference instance as a starting point for paging.
+ * @param forward
+ * integer indicating the number of pages to page forward. An
+ * negative integer will page backwards
+ * @return
+ * @throws IllegalArgumentException
+ * if the requested page number is not existent or if the field
+ * or if OpenUrlReference.pages is not parsable
+ */
+ public List<OpenUrlReference> doPage(OpenUrlReference reference, int forward) throws IllegalArgumentException{
+
+ Integer pageIndex = null;
+ try{
+ if(reference.getPages() != null){
+ pageIndex = parsePageNumber(reference.getPages());
+ pageIndex += forward;
+ }
+ }catch(NumberFormatException e){
+ String errorMessage = "Reference has no page number or the field 'pages' is not parsable";
+ logger.warn(errorMessage);
+ throw new IllegalArgumentException(errorMessage);
+ }
+
+ MobotOpenUrlQuery query = new MobotOpenUrlQuery();
+ query.bhlTitleURI = reference.getTitleUri();
+ if(pageIndex != null){
+ query.startPage = pageIndex.toString();
+ }
+ query.refType = reference.getReferenceType();
+ return doResolve(query);
+ }
+
+ public enum ReferenceType{
+ book, journal;
+
+ public static ReferenceType getReferenceType(Reference reference){
+ if(eu.etaxonomy.cdm.model.reference.ReferenceType.Book.equals(reference.getType())){
+ return book;
+ }
+ else if(eu.etaxonomy.cdm.model.reference.ReferenceType.Journal.equals(reference.getType())){
+ return journal;
+ }
+ else {
+ return null;
+ }
+ }
+ }
+
+}
public class OpenUrlReference extends Reference {
private static final long serialVersionUID = 5523159432429746682L;
- public static final Logger logger = LogManager.getLogger(OpenUrlReference.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String PAGETHUMB_BASE_URI = "http://www.biodiversitylibrary.org/pagethumb/";
import eu.etaxonomy.cdm.common.URI;
import eu.etaxonomy.cdm.common.UriUtils;
-
/**
* @author l.morris
* @since Jul 2, 2013
- *
*/
public class ScratchpadsService {
- private static final Logger logger = LogManager.getLogger(ScratchpadsService.class);
+ private static final Logger logger = LogManager.getLogger();
- public static final String SCRATCHPADS_JSON_ENDPOINT = "http://scratchpads.eu/explore/sites-list/json";
+ private static final String SCRATCHPADS_JSON_ENDPOINT = "http://scratchpads.eu/explore/sites-list/json";
private static final char[] ILLEGAL_CHARACTERS = { '/', '\n', '\r', '\t', '\0', '\f', '`', '?', '*', '\\', '<', '>', '|', '\"', ':', '.' };
- private static final String dir = "C:\\Users\\l.morris\\Downloads\\dwca_scratchpads\\";
-
public void harvest(){
InputStream inputStream = null;
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-package eu.etaxonomy.cdm.ext.sru;\r
-\r
-import java.io.IOException;\r
-import java.io.InputStream;\r
-import java.net.URISyntaxException;\r
-import java.util.ArrayList;\r
-import java.util.HashMap;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.apache.http.NameValuePair;\r
-import org.apache.http.message.BasicNameValuePair;\r
-\r
-import eu.etaxonomy.cdm.common.URI;\r
-import eu.etaxonomy.cdm.ext.common.SchemaAdapterBase;\r
-import eu.etaxonomy.cdm.ext.common.ServiceWrapperBase;\r
-import eu.etaxonomy.cdm.model.reference.Reference;\r
-\r
-/**\r
- * @author a.kohlbecker\r
- * @since 24.08.2010\r
- */\r
-public class SruServiceWrapper extends ServiceWrapperBase<Reference> {\r
-\r
- private String sruVersion = "1.1";\r
-\r
- /**\r
- * The GRIB sru service is available at "http://gso.gbv.de/sru/DB=1.83/"\r
- * The documentation is found at http://bhleurope.gbv.de/#sru from where the following text has been retrieved:\r
- * <p>\r
- * General information about Search/Retrieve via URL (SRU) is available in\r
- * the official SRU specification (http://www.loc.gov/standards/sru/). The SRU-Interface of GRIB supports some\r
- * specific search keys. Please do not use the (dc) fields but only the\r
- * (pica) search fields:\r
- * <dl>\r
- * <dt>PPN</dt>\r
- * <dd>Internal record id without prefix 'grib:ppn:' (This may change)</dd>\r
- * <dt>DST</dt>\r
- * <dd>Digitization status (8300-8305: 8300=not digitized, 8301=should be digitized, 8302=will be digitized, 8305=document available)</dd>\r
- * <dt>URL</dt>\r
- * <dd>URL of a digitized object</dd>\r
- * <dt>??? (not defined yet)</td>\r
- * <dd>Stable identifier of a record (PICA+ field 006Y)</dd>\r
- * </dl>\r
- * </p>\r
- * @param cqlQuery\r
- * an <b>URL encoded</b> CQL Query string see\r
- * {@link http://www.loc.gov/standards/sru/specs/cql.html} for documentation\r
- * @param recordSchema\r
- * @return\r
- */\r
- public List<Reference> doSearchRetrieve(String cqlQuery, String recordSchema){\r
-\r
- List<NameValuePair> pairs = new ArrayList<NameValuePair>();\r
-\r
- SchemaAdapterBase<Reference> schemaAdapter = schemaAdapterMap.get(recordSchema);\r
- if(schemaAdapter == null){\r
- logger.error("No SchemaAdapter found for " + recordSchema);\r
- }\r
-\r
- String sruOperation = "searchRetrieve";\r
-\r
- pairs.add(new BasicNameValuePair("operation", sruOperation));\r
- pairs.add(new BasicNameValuePair("version", sruVersion));\r
- pairs.add(new BasicNameValuePair("query", cqlQuery));\r
- pairs.add(new BasicNameValuePair("recordSchema", recordSchema));\r
-\r
- Map<String, String> requestHeaders = new HashMap<>();\r
- requestHeaders.put("Accept-Charset", "UTF-8");\r
-\r
- try {\r
- URI requestUri = createUri(null, pairs);\r
-\r
- InputStream stream = executeHttpGet(requestUri, requestHeaders);\r
- return schemaAdapter.getCmdEntities(stream);\r
-\r
- } catch (IOException e) {\r
- // thrown by doHttpGet\r
- logger.error(e);\r
- } catch (URISyntaxException e) {\r
- // thrown by createUri\r
- logger.error(e);\r
- }\r
-\r
- return null;\r
- }\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.ext.sru;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.http.NameValuePair;
+import org.apache.http.message.BasicNameValuePair;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+import eu.etaxonomy.cdm.common.URI;
+import eu.etaxonomy.cdm.ext.common.SchemaAdapterBase;
+import eu.etaxonomy.cdm.ext.common.ServiceWrapperBase;
+import eu.etaxonomy.cdm.model.reference.Reference;
+
+/**
+ * @author a.kohlbecker
+ * @since 24.08.2010
+ */
+public class SruServiceWrapper extends ServiceWrapperBase<Reference> {
+
+ private static final Logger logger = LogManager.getLogger();
+
+ private String sruVersion = "1.1";
+
+ /**
+ * The GRIB sru service is available at "http://gso.gbv.de/sru/DB=1.83/"
+ * The documentation is found at http://bhleurope.gbv.de/#sru from where the following text has been retrieved:
+ * <p>
+ * General information about Search/Retrieve via URL (SRU) is available in
+ * the official SRU specification (http://www.loc.gov/standards/sru/). The SRU-Interface of GRIB supports some
+ * specific search keys. Please do not use the (dc) fields but only the
+ * (pica) search fields:
+ * <dl>
+ * <dt>PPN</dt>
+ * <dd>Internal record id without prefix 'grib:ppn:' (This may change)</dd>
+ * <dt>DST</dt>
+ * <dd>Digitization status (8300-8305: 8300=not digitized, 8301=should be digitized, 8302=will be digitized, 8305=document available)</dd>
+ * <dt>URL</dt>
+ * <dd>URL of a digitized object</dd>
+ * <dt>??? (not defined yet)</td>
+ * <dd>Stable identifier of a record (PICA+ field 006Y)</dd>
+ * </dl>
+ * </p>
+ * @param cqlQuery
+ * an <b>URL encoded</b> CQL Query string see
+ * {@link http://www.loc.gov/standards/sru/specs/cql.html} for documentation
+ * @param recordSchema
+ * @return
+ */
+ public List<Reference> doSearchRetrieve(String cqlQuery, String recordSchema){
+
+ List<NameValuePair> pairs = new ArrayList<NameValuePair>();
+
+ SchemaAdapterBase<Reference> schemaAdapter = schemaAdapterMap.get(recordSchema);
+ if(schemaAdapter == null){
+ logger.error("No SchemaAdapter found for " + recordSchema);
+ }
+
+ String sruOperation = "searchRetrieve";
+
+ pairs.add(new BasicNameValuePair("operation", sruOperation));
+ pairs.add(new BasicNameValuePair("version", sruVersion));
+ pairs.add(new BasicNameValuePair("query", cqlQuery));
+ pairs.add(new BasicNameValuePair("recordSchema", recordSchema));
+
+ Map<String, String> requestHeaders = new HashMap<>();
+ requestHeaders.put("Accept-Charset", "UTF-8");
+
+ try {
+ URI requestUri = createUri(null, pairs);
+
+ InputStream stream = executeHttpGet(requestUri, requestHeaders);
+ return schemaAdapter.getCmdEntities(stream);
+
+ } catch (IOException e) {
+ // thrown by doHttpGet
+ logger.error(e);
+ } catch (URISyntaxException e) {
+ // thrown by createUri
+ logger.error(e);
+ }
+
+ return null;
+ }
}
\ No newline at end of file
* @since 08.10.2008
*/
public class EditGeoServiceTest extends CdmTransactionalIntegrationTest {
- private static final Logger logger = LogManager.getLogger(EditGeoServiceTest.class);
+
+ private static final Logger logger = LogManager.getLogger();
private static final String EDIT_MAPSERVICE_URI_STING = "http://edit.africamuseum.be/edit_wp5/v1.2/rest_gen.php";
private static URI editMapServiceUri;
*/
public class GeoServiceAreaTest {
- private static final Logger logger = LogManager.getLogger(GeoServiceAreaTest.class);
+ private static final Logger logger = LogManager.getLogger();
// ********************************** TESTS ****************************************
public class IpniServiceTest extends TermTestBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(IpniServiceTest.class);
+ private static final Logger logger = LogManager.getLogger();
private IpniService service1;
private static boolean internetIsAvailable = true;
public class KmlJaxbMarshallerTest {
- private Kml kml;
-
- private static final Logger logger = LogManager.getLogger(KmlJaxbMarshallerTest.class);
+ private static final Logger logger = LogManager.getLogger();
+ private Kml kml;
@Before
public void makeKML() {
kml = builder.build();
}
-
@Test
public void marshallTest() throws JAXBException, IOException {
assertTrue(kml.contains("<kml:coordinates>-112.292238941097,36.09520916122063</kml:coordinates>"));
assertTrue(kml.contains("<kml:altitudeMode>absolute</kml:altitudeMode>"));
}
-
-}
+}
\ No newline at end of file
*/
public class BioCaseQueryServiceWrapperTest {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static final int MAX_LINES_TO_READ = 1000;
private static final int TIMEOUT = 60000;
*/
public class MobotOpenUrlServiceWrapperTest {
- public static final Logger logger = LogManager.getLogger(MobotOpenUrlServiceWrapperTest.class);
- public static final String baseUrl = "http://www.biodiversitylibrary.org/openurl";
+ private static final Logger logger = LogManager.getLogger();
+
+ public static final String baseUrl = "http://www.biodiversitylibrary.org/openurl";
private MobotOpenUrlServiceWrapper openUrlServiceWrapper;
private static boolean internetIsAvailable = true;
-/**\r
- *\r
- */\r
-package eu.etaxonomy.cdm.ext.sru;\r
-\r
-import java.util.List;\r
-\r
-import org.apache.logging.log4j.LogManager;\r
-import org.apache.logging.log4j.Logger;\r
-import org.junit.Assert;\r
-import org.junit.Before;\r
-import org.junit.BeforeClass;\r
-import org.junit.Ignore;\r
-import org.junit.Test;\r
-\r
-import eu.etaxonomy.cdm.common.UriUtils;\r
-import eu.etaxonomy.cdm.ext.dc.DublinCoreSchemaAdapter;\r
-import eu.etaxonomy.cdm.model.reference.Reference;\r
-\r
-/**\r
- * @author a.mueller\r
- *\r
- */\r
-public class SruServiceWrapperTest {\r
- public static final Logger logger = LogManager.getLogger(SruServiceWrapperTest.class);\r
-\r
- private static final String baseUrl = "http://gso.gbv.de/sru/DB=1.83/";\r
-\r
-\r
- private SruServiceWrapper sruServiceWrapper;\r
-\r
- private static boolean internetIsAvailable = true;\r
-\r
- @BeforeClass\r
- public static void setUpClass() throws Exception {\r
- internetIsAvailable = true;\r
- }\r
-\r
- /**\r
- * @throws java.lang.Exception\r
- */\r
- @Before\r
- public void setUp() throws Exception {\r
- sruServiceWrapper = new SruServiceWrapper();\r
- sruServiceWrapper.setBaseUrl(baseUrl);\r
- sruServiceWrapper.addSchemaAdapter(new DublinCoreSchemaAdapter());\r
- }\r
-\r
-// ******************************* TESTS ******************************************************/\r
-\r
- @Test\r
- @Ignore // ignoring since Global References Index to Biodiversity has problems\r
- public void testDoSearchRetrieve(){\r
-\r
- List<Reference> refList_1 = sruServiceWrapper.doSearchRetrieve("pica.tit=\"Linnaei Species Plantarum\"", "dc");\r
- // -> http://gso.gbv.de/sru/DB=2.1/?version=1.1&operation=searchRetrieve&query=pica.tit%3D%22Species+Plantarum%22&recordSchema=dc\r
-\r
- if (testInternetConnectivity(refList_1)){\r
-\r
- Assert.assertEquals("There should be exactly 5 results for 'Linnaei Species Plantarum'", 5, refList_1.size());\r
- Reference reference_1 = refList_1.get(0);\r
- logger.info(reference_1.toString());\r
- //title cache\r
- Assert.assertEquals("Title of first entry should be 'Caroli Linnaei species plantarum'", "Caroli Linnaei species plantarum", reference_1.getTitleCache());\r
-\r
- //--------------------------\r
-\r
- List<Reference> refList_2 = sruServiceWrapper.doSearchRetrieve("pica.all = \"Species+plantarum\" and pica.dst = \"8305\"", "dc");\r
- // -> http://gso.gbv.de/sru/DB=2.1/?version=1.1&operation=searchRetrieve&query=pica.tit%3D%22Species+Plantarum%22&recordSchema=dc\r
-\r
- Assert.assertTrue("There should be at least 1 result for 'species+plantarum' and digitized", refList_2.size() > 0);\r
- Reference reference_2 = refList_2.get(0);\r
- logger.info(reference_2.toString());\r
- }\r
- }\r
-\r
- private boolean testInternetConnectivity(List<?> list) {\r
- if (list == null || list.isEmpty()){\r
- boolean result = internetIsAvailable && UriUtils.isInternetAvailable(null);\r
- internetIsAvailable = result;\r
- return result;\r
-\r
- }\r
- return true;\r
- }\r
-\r
-\r
-}\r
+/**
+ *
+ */
+package eu.etaxonomy.cdm.ext.sru;
+
+import java.util.List;
+
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+import eu.etaxonomy.cdm.common.UriUtils;
+import eu.etaxonomy.cdm.ext.dc.DublinCoreSchemaAdapter;
+import eu.etaxonomy.cdm.model.reference.Reference;
+
+/**
+ * @author a.mueller
+ *
+ */
+public class SruServiceWrapperTest {
+
+ private static final Logger logger = LogManager.getLogger();
+
+ private static final String baseUrl = "http://gso.gbv.de/sru/DB=1.83/";
+
+
+ private SruServiceWrapper sruServiceWrapper;
+
+ private static boolean internetIsAvailable = true;
+
+ @BeforeClass
+ public static void setUpClass() throws Exception {
+ internetIsAvailable = true;
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ sruServiceWrapper = new SruServiceWrapper();
+ sruServiceWrapper.setBaseUrl(baseUrl);
+ sruServiceWrapper.addSchemaAdapter(new DublinCoreSchemaAdapter());
+ }
+
+// ******************************* TESTS ******************************************************/
+
+ @Test
+ @Ignore // ignoring since Global References Index to Biodiversity has problems
+ public void testDoSearchRetrieve(){
+
+ List<Reference> refList_1 = sruServiceWrapper.doSearchRetrieve("pica.tit=\"Linnaei Species Plantarum\"", "dc");
+ // -> http://gso.gbv.de/sru/DB=2.1/?version=1.1&operation=searchRetrieve&query=pica.tit%3D%22Species+Plantarum%22&recordSchema=dc
+
+ if (testInternetConnectivity(refList_1)){
+
+ Assert.assertEquals("There should be exactly 5 results for 'Linnaei Species Plantarum'", 5, refList_1.size());
+ Reference reference_1 = refList_1.get(0);
+ logger.info(reference_1.toString());
+ //title cache
+ Assert.assertEquals("Title of first entry should be 'Caroli Linnaei species plantarum'", "Caroli Linnaei species plantarum", reference_1.getTitleCache());
+
+ //--------------------------
+
+ List<Reference> refList_2 = sruServiceWrapper.doSearchRetrieve("pica.all = \"Species+plantarum\" and pica.dst = \"8305\"", "dc");
+ // -> http://gso.gbv.de/sru/DB=2.1/?version=1.1&operation=searchRetrieve&query=pica.tit%3D%22Species+Plantarum%22&recordSchema=dc
+
+ Assert.assertTrue("There should be at least 1 result for 'species+plantarum' and digitized", refList_2.size() > 0);
+ Reference reference_2 = refList_2.get(0);
+ logger.info(reference_2.toString());
+ }
+ }
+
+ private boolean testInternetConnectivity(List<?> list) {
+ if (list == null || list.isEmpty()){
+ boolean result = internetIsAvailable && UriUtils.isInternetAvailable(null);
+ internetIsAvailable = result;
+ return result;
+
+ }
+ return true;
+ }
+
+
+}
+++ /dev/null
-/**
- * Copyright (C) 2007 EDIT
- * European Distributed Institute of Taxonomy
- * http://www.e-taxonomy.eu
- *
- * The contents of this file are subject to the Mozilla Public License Version 1.1
- * See LICENSE.TXT at the top of this package for the full license terms.
- */
-
-package eu.etaxonomy.cdm.test.suite;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
- {
-// TaxonServiceImplTest.class
- //,CreateDataTest.class
- }
- )
-public class CdmTestSuite {
- static Logger logger = LogManager.getLogger();
-
- // the class remains completely empty,
- // being used only as a holder for the above annotations
-
- //console test //TODO test
- public static void consoleRun() {
- org.junit.runner.JUnitCore.runClasses(
-// TaxonServiceImplTest.class
- //,CreateDataTest.class
- );
- }
-}
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.io.common;\r
-\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 17.02.2010\r
- * @version 1.0\r
- */\r
-public interface IOValidator<STATE extends IoStateBase> {\r
- \r
- \r
- public boolean validate(STATE state);\r
-}\r
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.io.common;
+
+/**
+ * @author a.mueller
+ * @since 17.02.2010
+ */
+public interface IOValidator<STATE extends IoStateBase> {
+
+ public boolean validate(STATE state);
+}
\ No newline at end of file
*
*/
public class ImportHelper {
- private static final Logger logger = LogManager.getLogger(ImportHelper.class);
+
+ private static final Logger logger = LogManager.getLogger();
public static final boolean OVERWRITE = true;
public static final boolean NO_OVERWRITE = false;
extends IIoConfigurator, IO extends ICdmIO, RESULT extends IoResultBase> {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(IoStateBase.class);
+ private static final Logger logger = LogManager.getLogger();
private IO currentIO;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.common.mapping;
import java.sql.ResultSet;
/**
* @author a.mueller
* @since 12.05.2009
- * @version 1.0
- */
-/**
- * @author a.mueller
- * @since 02.03.2010
- * @version 1.0
- * @param <CDM_BASE>
- * @param <STATE>
*/
public class DbImportNameTypeDesignationMapper<STATE extends DbImportStateBase<?,?>, T extends IDbImportTransformed> extends DbImportMultiAttributeMapperBase<CdmBase, STATE> {
- private static final Logger logger = LogManager.getLogger(DbImportNameTypeDesignationMapper.class);
+
+ private static final Logger logger = LogManager.getLogger();
//******************************** FACTORY METHOD ***************************************************/
//********************************* CONSTRUCTOR ****************************************/
- /**
- * @param relatedObjectNamespace
- * @param mappingImport
- */
+
protected DbImportNameTypeDesignationMapper(String fromAttribute, String toAttribute, NameTypeDesignationStatus designationStatus, String relatedObjectNamespace, String desigStatusAttribute) {
super();
//TODO make it a single attribute mapper
//************************************ METHODS *******************************************/
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.io.common.mapping.IDbImportMapper#invoke(java.sql.ResultSet, eu.etaxonomy.cdm.model.common.CdmBase)
- */
@Override
public CdmBase invoke(ResultSet rs, CdmBase cdmBase) throws SQLException {
STATE state = importMapperHelper.getState();
designationStatusValue = rs.getObject(designationStatusAttribute);
}
-
if (fromObject == null){
String warning = "Higher rank name could not be found. Name type not added to higher rank name";
logger.warn(warning);
/**
* //TODO copied from DbImportObjectMapper. Maybe these can be merged again in future
- * @param rs
- * @param dbAttribute
- * @return
- * @throws SQLException
*/
protected CdmBase getRelatedObject(ResultSet rs, String dbAttribute) throws SQLException {
CdmBase result = null;
/**
* Checks if cdmBase is of type Taxon
- * @param fromObject
*/
private TaxonName checkTaxonNameType(CdmBase cdmBase) {
if (! cdmBase.isInstanceOf(TaxonName.class)){
}
return (cdmBase.deproxy(cdmBase, TaxonName.class));
}
-
-
-}
+}
\ No newline at end of file
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.io.common.mapping;\r
-\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 02.03.2010\r
- * @version 1.0\r
- */\r
-public interface IDbImportTransformed {\r
- \r
- public IDbImportTransformer getTransformer();\r
-\r
-}\r
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.io.common.mapping;
+
+/**
+ * @author a.mueller
+ * @since 02.03.2010
+ */
+public interface IDbImportTransformed {
+
+ public IDbImportTransformer getTransformer();
+
+}
\ No newline at end of file
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.io.common.mapping;\r
-\r
-import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus;\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 02.03.2010\r
- * @version 1.0\r
- */\r
-public interface IDbImportTransformer {\r
-\r
- public NameTypeDesignationStatus transformNameTypeDesignationStatus(Object statusId);\r
-\r
- \r
- \r
- \r
-}\r
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.io.common.mapping;
+
+import eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus;
+
+/**
+ * @author a.mueller
+ * @since 02.03.2010
+ */
+public interface IDbImportTransformer {
+
+ public NameTypeDesignationStatus transformNameTypeDesignationStatus(Object statusId);
+}
\ No newline at end of file
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.io.common.mapping;\r
-\r
-import java.sql.ResultSet;\r
-import java.sql.SQLException;\r
-\r
-import eu.etaxonomy.cdm.io.common.ImportStateBase;\r
-import eu.etaxonomy.cdm.model.common.CdmBase;\r
-\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 23.02.2010\r
- * @version 1.0\r
- */\r
-public interface IMappingImport<T extends CdmBase, STATE extends ImportStateBase> {\r
- \r
- \r
- public T createObject(ResultSet rs, STATE state) throws SQLException;\r
-}\r
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.io.common.mapping;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import eu.etaxonomy.cdm.io.common.ImportStateBase;
+import eu.etaxonomy.cdm.model.common.CdmBase;
+
+/**
+ * @author a.mueller
+ * @since 23.02.2010
+ */
+public interface IMappingImport<T extends CdmBase, STATE extends ImportStateBase> {
+
+ public T createObject(ResultSet rs, STATE state) throws SQLException;
+}
\ No newline at end of file
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.io.common.mapping;\r
-\r
-import org.jdom.Content;\r
-import org.jdom.Element;\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 24.03.2009\r
- * @version 1.0\r
- */\r
-public interface IXmlMapper {\r
-\r
- \r
- /**\r
- * @param content\r
- * @param parentElement\r
- * @return\r
- */\r
- public boolean mapsSource(Content content, Element parentElement);\r
-}\r
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.io.common.mapping;
+
+import org.jdom.Content;
+import org.jdom.Element;
+
+/**
+ * @author a.mueller
+ * @since 24.03.2009
+ */
+public interface IXmlMapper {
+
+ public boolean mapsSource(Content content, Element parentElement);
+}
\ No newline at end of file
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.io.common.mapping.berlinModel;\r
-\r
-import eu.etaxonomy.cdm.io.common.mapping.CdmSingleAttributeMapperBase;\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 20.03.2008\r
- * @version 1.0\r
- */\r
-public class CdmBooleanMapper extends CdmSingleAttributeMapperBase {\r
-\r
- /**\r
- * @param dbAttributString\r
- * @param cdmAttributeString\r
- */\r
- public CdmBooleanMapper(String dbAttributString, String cdmAttributeString) {\r
- super(dbAttributString, cdmAttributeString);\r
- }\r
-\r
- public Class getTypeClass(){\r
- return Boolean.class;\r
- }\r
-}\r
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.io.common.mapping.berlinModel;
+
+import eu.etaxonomy.cdm.io.common.mapping.CdmSingleAttributeMapperBase;
+
+/**
+ * @author a.mueller
+ * @since 20.03.2008
+ */
+public class CdmBooleanMapper extends CdmSingleAttributeMapperBase {
+
+ public CdmBooleanMapper(String dbAttributString, String cdmAttributeString) {
+ super(dbAttributString, cdmAttributeString);
+ }
+
+ @Override
+ public Class getTypeClass(){
+ return Boolean.class;
+ }
+}
\ No newline at end of file
public class CdmOneToManyMapper<ONE extends CdmBase, MANY extends CdmBase, SINGLE_MAPPER extends CdmSingleAttributeMapperBase> extends MultipleAttributeMapperBase<SINGLE_MAPPER> {
@SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private Class<MANY> manyClass;
private Class<ONE> oneClass;
public class CdmStringMapper extends CdmSingleAttributeMapperBase {
@SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
public CdmStringMapper(String dbAttributeString, String cdmAttributeString) {
super(dbAttributeString, cdmAttributeString);
extends CdmImportBase<StructureTreeOwlImportConfigurator, StructureTreeOwlImportState> {
private static final long serialVersionUID = -3659780404413458511L;
-
- private final static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Override
protected boolean doCheck(StructureTreeOwlImportState state) {
*/
public class OwlImportUtil {
- private final static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static void addFeatureProperties(Feature feature, Resource termResource, ICdmRepository repo, Model model, StructureTreeOwlImportState state){
if(termResource.hasProperty(OwlUtil.propFeatureIsCategorical)){
private static final long serialVersionUID = -3659780404413458511L;
- private final static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Override
protected boolean doCheck(StructureTreeOwlImportState state) {
private static final long serialVersionUID = -3659780404413458511L;
- private final static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Override
protected boolean doCheck(StructureTreeOwlImportState state) {
extends ExcelImportBase<ExcelDistributionUpdateState, ExcelDistributionUpdateConfigurator, ExcelRowBase>{
private static final long serialVersionUID = 621338661492857764L;
- private static final Logger logger = LogManager.getLogger(ExcelDistributionUpdate.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String AREA_MAP = "AreaMap";
extends PartitionableConverterBase<DwcaDataImportConfiguratorBase, DwcaDataImportStateBase<DwcaDataImportConfiguratorBase>>
implements IPartitionableConverter<StreamItem, IReader<CdmBase>, String> {
+ private static final Logger logger = LogManager.getLogger();
+
private static final String SINGLE_CLASSIFICATION_ID = "1";
private static final String SINGLE_CLASSIFICATION = "Single Classification";
- private static Logger logger = LogManager.getLogger(DwcTaxonCsv2CdmTaxonRelationConverter.class);
-
private static final String ID = "id";
public DwcTaxonCsv2CdmTaxonRelationConverter(DwcaDataImportStateBase state) {
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.dwca.out;
import java.io.FileNotFoundException;
private static final long serialVersionUID = -4033439569151252697L;
- private static final Logger logger = LogManager.getLogger(DwcaMetaDataExport.class);
+ private static final Logger logger = LogManager.getLogger();
protected static final String fileName = "meta.xml";
writeFieldLine(writer, fieldEntry.index, fieldEntry.term, fieldEntry.defaultValue);
}
}
-
writer.writeEndElement();
}
}
writer.writeAttribute("term", term.toString());
writer.writeEndElement();
-
}
private void writeId(XMLStreamWriter writer, boolean isCore) throws XMLStreamException {
writer.writeEndElement();
}
-
private void writeFiles(XMLStreamWriter writer, String filename) throws XMLStreamException {
writer.writeStartElement("files");
writer.writeStartElement("location");
writer.writeCharacters(filename);
writer.writeEndElement();
writer.writeEndElement();
-
}
- /**
- * @param writer
- * @param encoding
- * @param linesTerminatedBy
- * @param fieldsEnclosedBy
- * @param ignoreHeaderLines
- * @param rowType
- * @param elementName
- * @throws XMLStreamException
- */
private void writeElementStart(XMLStreamWriter writer, String elementName, String encoding,
String linesTerminatedBy, String fieldsEnclosedBy, String fieldsTerminatedBy,
String ignoreHeaderLines, String rowType)
writer.writeAttribute("rowType", rowType);
}
-
-
@Override
protected boolean doCheck(DwcaTaxExportState state) {
boolean result = true;
protected boolean isIgnore(DwcaTaxExportState state) {
return ! state.getConfig().isDoMetaData();
}
-
-
-}
+}
\ No newline at end of file
private static final long serialVersionUID = -1657568483721887287L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DwcaDescriptionExport.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
protected void doInvoke(DwcaTaxExportState state) {
state.getProcessor().createFinalResult();
}
- /**
- * @param state
- */
protected void addReport(DwcaTaxExportState state) {
if (state.getConfig().getDestination() != null){
try {
public class DwcaTaxExport extends DwcaExportBase {
private static final long serialVersionUID = -3770976064909193441L;
- private static final Logger logger = LogManager.getLogger(DwcaTaxExport.class);
-
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ITaxonNodeService taxonNodeService;
}
return;
-
}
- /**
- * @param taxonExport
- * @param state
- */
private void closeWriter(DwcaDataExportBase export, DwcaTaxExportState state) {
if (!export.isIgnore(state)){
export.closeWriter(state);
}
}
-
@Override
protected boolean doCheck(DwcaTaxExportState state) {
boolean result = true;
return result;
}
-
@Override
public boolean isIgnore(DwcaTaxExportState state) {
return ! state.getConfig().isDoTaxa();
}
-
-}
+}
\ No newline at end of file
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.dwca.out;
import java.io.FileNotFoundException;
public class DwcaTaxonExport extends DwcaDataExportBase {
private static final long serialVersionUID = -3770976064909193441L;
- private static final Logger logger = LogManager.getLogger(DwcaTaxonExport.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String ROW_TYPE = "http://rs.tdwg.org/dwc/terms/Taxon";
protected static final String fileName = "coreTax.txt";
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.dwca.out;
import java.io.FileNotFoundException;
public class DwcaVernacularExport extends DwcaDataExportBase {
private static final long serialVersionUID = 3169086545830374918L;
- private static final Logger logger = LogManager.getLogger(DwcaVernacularExport.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String ROW_TYPE = "http://rs.gbif.org/terms/1.0/VernacularName";
protected static final String fileName = "vernacular.txt";
}
}
-
-
-
private void handleCommonTaxonName(DwcaTaxExportState state, DwcaVernacularRecord record, CommonTaxonName commonTaxonName, Taxon taxon, DwcaTaxExportConfigurator config) {
record.setId(taxon.getId());
record.setUuid(taxon.getUuid());
public boolean isIgnore(DwcaTaxExportState state) {
return ! state.getConfig().isDoVernacularNames();
}
-}
+}
\ No newline at end of file
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.excel.taxa;
import java.net.MalformedURLException;
* @author a.babadshanjan
* @since 08.01.2009
*/
-
@Component
public class NormalExplicitImport extends TaxonExcelImportBase {
- private static final long serialVersionUID = 3642423349766191160L;
- private static final Logger logger = LogManager.getLogger(NormalExplicitImport.class);
+ private static final long serialVersionUID = 3642423349766191160L;
+ private static final Logger logger = LogManager.getLogger();
- public static Set<String> validMarkers = new HashSet<>(Arrays.asList(new String[]{"", "valid", "accepted", "a", "v", "t", "!"}));
- public static Set<String> synonymMarkers = new HashSet<>(Arrays.asList(new String[]{"**","invalid", "synonym", "s", "i"}));
- public static Set<String> nameStatusMarkers = new HashSet<>(Arrays.asList(new String[]{"illegitimate", "nom. rej.", "nom. cons."}));
- public static final UUID uuidRefExtension = UUID.fromString("a46533df-7a78-448f-9b80-36d087fbdf2a");
+ private static Set<String> validMarkers = new HashSet<>(Arrays.asList(new String[]{"", "valid", "accepted", "a", "v", "t", "!"}));
+ private static Set<String> synonymMarkers = new HashSet<>(Arrays.asList(new String[]{"**","invalid", "synonym", "s", "i"}));
+ private static Set<String> nameStatusMarkers = new HashSet<>(Arrays.asList(new String[]{"illegitimate", "nom. rej.", "nom. cons."}));
+ private static final UUID uuidRefExtension = UUID.fromString("a46533df-7a78-448f-9b80-36d087fbdf2a");
private static final Object NOM_ILLEG = "illegitimate";
private static final Object NOM_REJ = "nom. rej.";
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.io.excel.taxa;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-import java.util.TreeMap;\r
-\r
-import eu.etaxonomy.cdm.io.excel.common.ExcelRowBase;\r
-\r
-/**\r
- * @author a.babadshanjan\r
- * @since 13.01.2009\r
- * @version 1.0\r
- */\r
-public class NormalExplicitRow extends ExcelRowBase {\r
-\r
-
- private String id;\r
- private String parentId;\r
- private String rank;\r
- private String scientificName;\r
- private String author;\r
- private String basionymAuthor;\r
- private String publishingAuthor;\r
- private String nameStatus;\r
- private String commonName;\r
- private String language;\r
- private String reference;\r
- private String date;\r
- private String family;\r
- private String infraFamily;\r
- private String genus;\r
- private String infraGenus;\r
- private String species;\r
- private String infraSpecies;\r
- private String infraSpecies_rank;\r
-\r
- private String collation;\r
- private String page;\r
- private String publicationYear;\r
- private String remarks;\r
-\r
- private String synonym;\r
- private String basionym;\r
- private String accepted_id;\r
- private String taxonomicStatus;\r
-\r
- private String version;\r
-\r
-\r
- private String ipni_id;\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.io.excel.taxa;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.TreeMap;
+
+import eu.etaxonomy.cdm.io.excel.common.ExcelRowBase;
+
+/**
+ * @author a.babadshanjan
+ * @since 13.01.2009
+ */
+public class NormalExplicitRow extends ExcelRowBase {
+
+ private String id;
+ private String parentId;
+ private String rank;
+ private String scientificName;
+ private String author;
+ private String basionymAuthor;
+ private String publishingAuthor;
+ private String nameStatus;
+ private String commonName;
+ private String language;
+ private String reference;
+ private String date;
+ private String family;
+ private String infraFamily;
+ private String genus;
+ private String infraGenus;
+ private String species;
+ private String infraSpecies;
+ private String infraSpecies_rank;
+
+ private String collation;
+ private String page;
+ private String publicationYear;
+ private String remarks;
+
+ private String synonym;
+ private String basionym;
+ private String accepted_id;
+ private String taxonomicStatus;
+
+ private String version;
+
+ private String ipni_id;
private String source;
- private String source_Id;\r
- //Sets\r
- private TreeMap<Integer, String> distributions = new TreeMap<Integer, String>();\r
-\r
- private TreeMap<Integer, String> protologues = new TreeMap<Integer, String>();\r
-\r
- private TreeMap<Integer, String> images = new TreeMap<Integer, String>();\r
-\r
- public NormalExplicitRow() {\r
-
- this.id = "0";\r
- this.parentId = "0";\r
-
- this.rank = "";\r
- this.scientificName = "";\r
- this.author = "";\r
- this.nameStatus = "";\r
- this.commonName = "";\r
- this.language = "";\r
- this.reference = "";\r
- this.setDate("");\r
- this.setFamily("");\r
- }\r
-\r
- public NormalExplicitRow(String name, String parentId) {\r
- this(name, parentId, null);\r
- }\r
-\r
- public NormalExplicitRow(String scientificName, String parentId, String reference) {\r
- this.parentId = parentId;\r
- this.scientificName = scientificName;\r
- this.reference = reference;\r
- }\r
-\r
-// **************************** GETTER / SETTER *********************************/\r
-\r
- /**\r
- * @return the parentId\r
- */\r
- public String getParentId() {\r
- return parentId;\r
- }\r
- /**\r
- * @param parentId the parentId to set\r
- */\r
- public void setParentId(String parentId) {\r
- this.parentId = parentId;\r
- }\r
- /**\r
- * @return the name\r
- */\r
- public String getScientificName() {\r
- return scientificName;\r
- }\r
- /**\r
- * @param name the name to set\r
- */\r
- public void setScientificName(String scientificName) {\r
- this.scientificName = scientificName;\r
- }\r
- /**\r
- * @return the reference\r
- */\r
- public String getReference() {\r
- return reference;\r
- }\r
- /**\r
- * @param reference the reference to set\r
- */\r
- public void setReference(String reference) {\r
- this.reference = reference;\r
- }\r
-\r
- /**\r
- * @return the id\r
- */\r
- public String getId() {\r
- return id;\r
- }\r
-\r
- /**\r
- * @param id the id to set\r
- */\r
- public void setId(String id) {\r
- this.id = id;\r
- }\r
-\r
- /**\r
- * @return the rank\r
- */\r
- public String getRank() {\r
- return rank;\r
- }\r
-\r
- /**\r
- * @param rank the rank to set\r
- */\r
- public void setRank(String rank) {\r
- this.rank = rank;\r
- }\r
-\r
- /**\r
- * @return the author\r
- */\r
- public String getAuthor() {\r
- return author;\r
- }\r
-\r
- /**\r
- * @param author the author to set\r
- */\r
- public void setAuthor(String author) {\r
- this.author = author;\r
- }\r
-\r
- /**\r
- * @return the nameStatus\r
- */\r
- public String getNameStatus() {\r
- return nameStatus;\r
- }\r
-\r
- /**\r
- * @param nameStatus the nameStatus to set\r
- */\r
- public void setNameStatus(String nameStatus) {\r
- this.nameStatus = nameStatus;\r
- }\r
-\r
- /**\r
- * @return the commonName\r
- */\r
- public String getCommonName() {\r
- return commonName;\r
- }\r
-\r
- /**\r
- * @param commonName the commonName to set\r
- */\r
- public void setCommonName(String commonName) {\r
- this.commonName = commonName;\r
- }\r
-\r
- /**\r
- * @return the language\r
- */\r
- public String getLanguage() {\r
- return language;\r
- }\r
-\r
- /**\r
- * @param language the language to set\r
- */\r
- public void setLanguage(String language) {\r
- this.language = language;\r
- }\r
-\r
- public void putDistribution(int key, String distribution){\r
- this.distributions.put(key, distribution);\r
- }\r
-\r
- public List<String> getDistributions() {\r
- return getOrdered(distributions);\r
- }\r
-\r
- public void putProtologue(int key, String protologue){\r
- this.protologues.put(key, protologue);\r
- }\r
-\r
- public List<String> getProtologues() {\r
- return getOrdered(protologues);\r
- }\r
-\r
- public void putImage(int key, String image){\r
- this.images.put(key, image);\r
- }\r
-\r
- public List<String> getImages() {\r
- return getOrdered(images);\r
- }\r
-\r
-\r
- private List<String> getOrdered(TreeMap<Integer, String> tree) {\r
- List<String> result = new ArrayList<String>();\r
- for (String distribution : tree.values()){\r
- result.add(distribution);\r
- }\r
- return result;\r
- }\r
-\r
- /**\r
- * @return the date\r
- */\r
- public String getDate() {\r
- return date;\r
- }\r
-\r
- /**\r
- * @param date the date to set\r
- */\r
- public void setDate(String date) {\r
- this.date = date;\r
- }\r
-\r
- /**\r
- * @return the family\r
- */\r
- public String getFamily() {\r
- return family;\r
- }\r
-\r
- /**\r
- * @param family the family to set\r
- */\r
- public void setFamily(String family) {\r
- this.family = family;\r
- }\r
-\r
- /**\r
- * @return the basionymAuthor\r
- */\r
- public String getBasionymAuthor() {\r
- return basionymAuthor;\r
- }\r
-\r
- /**\r
- * @param basionymAuthor the basionymAuthor to set\r
- */\r
- public void setBasionymAuthor(String basionymAuthor) {\r
- this.basionymAuthor = basionymAuthor;\r
- }\r
-\r
- /**\r
- * @return the infraFamily\r
- */\r
- public String getInfraFamily() {\r
- return infraFamily;\r
- }\r
-\r
- /**\r
- * @param infraFamily the infraFamily to set\r
- */\r
- public void setInfraFamily(String infraFamily) {\r
- this.infraFamily = infraFamily;\r
- }\r
-\r
- /**\r
- * @return the genus\r
- */\r
- public String getGenus() {\r
- return genus;\r
- }\r
-\r
- /**\r
- * @param genus the genus to set\r
- */\r
- public void setGenus(String genus) {\r
- this.genus = genus;\r
- }\r
-\r
- /**\r
- * @return the infraGenus\r
- */\r
- public String getInfraGenus() {\r
- return infraGenus;\r
- }\r
-\r
- /**\r
- * @param infraGenus the infraGenus to set\r
- */\r
- public void setInfraGenus(String infraGenus) {\r
- this.infraGenus = infraGenus;\r
- }\r
-\r
- /**\r
- * @return the species\r
- */\r
- public String getSpecies() {\r
- return species;\r
- }\r
-\r
- /**\r
- * @param species the species to set\r
- */\r
- public void setSpecies(String species) {\r
- this.species = species;\r
- }\r
-\r
- /**\r
- * @return the infraSpecies\r
- */\r
- public String getInfraSpecies() {\r
- return infraSpecies;\r
- }\r
-\r
- /**\r
- * @param infraSpecies the infraSpecies to set\r
- */\r
- public void setInfraSpecies(String infraSpecies) {\r
- this.infraSpecies = infraSpecies;\r
- }\r
-\r
- /**\r
- * @return the collation\r
- */\r
- public String getCollation() {\r
- return collation;\r
- }\r
-\r
- /**\r
- * @param collation the collation to set\r
- */\r
- public void setCollation(String collation) {\r
- this.collation = collation;\r
- }\r
-\r
- /**\r
- * @return the publicationYear\r
- */\r
- public String getPublicationYear() {\r
- return publicationYear;\r
- }\r
-\r
- /**\r
- * @param publicationYear the publicationYear to set\r
- */\r
- public void setPublicationYear(String publicationYear) {\r
- this.publicationYear = publicationYear;\r
- }\r
-\r
- /**\r
- * @return the remarks\r
- */\r
- public String getRemarks() {\r
- return remarks;\r
- }\r
-\r
- /**\r
- * @param remarks the remarks to set\r
- */\r
- public void setRemarks(String remarks) {\r
- this.remarks = remarks;\r
- }\r
-\r
- /**\r
- * @return the synonym\r
- */\r
- public String getSynonym() {\r
- return synonym;\r
- }\r
-\r
- /**\r
- * @param synonym the synonym to set\r
- */\r
- public void setSynonym(String synonym) {\r
- this.synonym = synonym;\r
- }\r
-\r
- /**\r
- * @return the basionym\r
- */\r
- public String getBasionym() {\r
- return basionym;\r
- }\r
-\r
- /**\r
- * @param basionym the basionym to set\r
- */\r
- public void setBasionym(String basionym) {\r
- this.basionym = basionym;\r
- }\r
-\r
- /**\r
- * @return the publishingAuthor\r
- */\r
- public String getPublishingAuthor() {\r
- return publishingAuthor;\r
- }\r
-\r
- /**\r
- * @param publishingAuthor the publishingAuthor to set\r
- */\r
- public void setPublishingAuthor(String publishingAuthor) {\r
- this.publishingAuthor = publishingAuthor;\r
- }\r
-\r
- /**\r
- * @return the version\r
- */\r
- public String getVersion() {\r
- return version;\r
- }\r
-\r
- /**\r
- * @param version the version to set\r
- */\r
- public void setVersion(String version) {\r
- this.version = version;\r
- }\r
-\r
-\r
- public void setPage(String value) {\r
- this.page = value;\r
-\r
- }\r
- public String getPage() {\r
- return this.page;\r
-\r
- }\r
-\r
-\r
- public void setAccepted_id(String value) {\r
- this.accepted_id = value;\r
- }\r
-\r
- public String getAccepted_id(){\r
- return accepted_id;\r
- }\r
-\r
- public void setInfraSpecies_Rank(String value) {\r
- this.infraSpecies_rank = value;\r
- }\r
-
- public String getInfraSpecies_Rank() {\r
- return this.infraSpecies_rank;\r
- }\r
-\r
- public String getTaxonomicStatus() {\r
- return this.taxonomicStatus;\r
- }\r
-\r
- public void setTaxonomicStatus(String value) {\r
- this.taxonomicStatus = value;\r
- }\r
-\r
- public String getIpni_id() {\r
- return ipni_id;\r
- }\r
-\r
- public void setIpni_id(String ipni_id) {\r
- this.ipni_id = ipni_id;\r
- }\r
-\r
- public void setSource(String value) {\r
- this.source = value;\r
-\r
- }\r
- public String getSource() {\r
- return this.source ;\r
-\r
- }\r
- public void setSource_Id(String value) {\r
- this.source_Id= value;\r
- }\r
- public String getSource_Id() {\r
- return this.source_Id;\r
- }\r
-\r
-\r
-}\r
+ private String source_Id;
+ //Sets
+ private TreeMap<Integer, String> distributions = new TreeMap<Integer, String>();
+
+ private TreeMap<Integer, String> protologues = new TreeMap<Integer, String>();
+
+ private TreeMap<Integer, String> images = new TreeMap<Integer, String>();
+
+ public NormalExplicitRow() {
+
+ this.id = "0";
+ this.parentId = "0";
+
+ this.rank = "";
+ this.scientificName = "";
+ this.author = "";
+ this.nameStatus = "";
+ this.commonName = "";
+ this.language = "";
+ this.reference = "";
+ this.setDate("");
+ this.setFamily("");
+ }
+
+ public NormalExplicitRow(String name, String parentId) {
+ this(name, parentId, null);
+ }
+
+ public NormalExplicitRow(String scientificName, String parentId, String reference) {
+ this.parentId = parentId;
+ this.scientificName = scientificName;
+ this.reference = reference;
+ }
+
+// **************************** GETTER / SETTER *********************************/
+
+ public String getParentId() {
+ return parentId;
+ }
+ public void setParentId(String parentId) {
+ this.parentId = parentId;
+ }
+
+ public String getScientificName() {
+ return scientificName;
+ }
+ public void setScientificName(String scientificName) {
+ this.scientificName = scientificName;
+ }
+
+ public String getReference() {
+ return reference;
+ }
+ public void setReference(String reference) {
+ this.reference = reference;
+ }
+
+ public String getId() {
+ return id;
+ }
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getRank() {
+ return rank;
+ }
+ public void setRank(String rank) {
+ this.rank = rank;
+ }
+
+ public String getAuthor() {
+ return author;
+ }
+ public void setAuthor(String author) {
+ this.author = author;
+ }
+
+ public String getNameStatus() {
+ return nameStatus;
+ }
+ public void setNameStatus(String nameStatus) {
+ this.nameStatus = nameStatus;
+ }
+
+ public String getCommonName() {
+ return commonName;
+ }
+ public void setCommonName(String commonName) {
+ this.commonName = commonName;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+ public void setLanguage(String language) {
+ this.language = language;
+ }
+
+ public void putDistribution(int key, String distribution){
+ this.distributions.put(key, distribution);
+ }
+
+ public List<String> getDistributions() {
+ return getOrdered(distributions);
+ }
+
+ public void putProtologue(int key, String protologue){
+ this.protologues.put(key, protologue);
+ }
+
+ public List<String> getProtologues() {
+ return getOrdered(protologues);
+ }
+
+ public void putImage(int key, String image){
+ this.images.put(key, image);
+ }
+
+ public List<String> getImages() {
+ return getOrdered(images);
+ }
+
+
+ private List<String> getOrdered(TreeMap<Integer, String> tree) {
+ List<String> result = new ArrayList<String>();
+ for (String distribution : tree.values()){
+ result.add(distribution);
+ }
+ return result;
+ }
+
+ public String getDate() {
+ return date;
+ }
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ public String getFamily() {
+ return family;
+ }
+ public void setFamily(String family) {
+ this.family = family;
+ }
+
+ public String getBasionymAuthor() {
+ return basionymAuthor;
+ }
+ public void setBasionymAuthor(String basionymAuthor) {
+ this.basionymAuthor = basionymAuthor;
+ }
+
+
+ public String getInfraFamily() {
+ return infraFamily;
+ }
+ public void setInfraFamily(String infraFamily) {
+ this.infraFamily = infraFamily;
+ }
+
+ /**
+ * @return the genus
+ */
+ public String getGenus() {
+ return genus;
+ }
+
+ /**
+ * @param genus the genus to set
+ */
+ public void setGenus(String genus) {
+ this.genus = genus;
+ }
+
+ /**
+ * @return the infraGenus
+ */
+ public String getInfraGenus() {
+ return infraGenus;
+ }
+
+ /**
+ * @param infraGenus the infraGenus to set
+ */
+ public void setInfraGenus(String infraGenus) {
+ this.infraGenus = infraGenus;
+ }
+
+ /**
+ * @return the species
+ */
+ public String getSpecies() {
+ return species;
+ }
+
+ /**
+ * @param species the species to set
+ */
+ public void setSpecies(String species) {
+ this.species = species;
+ }
+
+ /**
+ * @return the infraSpecies
+ */
+ public String getInfraSpecies() {
+ return infraSpecies;
+ }
+
+ /**
+ * @param infraSpecies the infraSpecies to set
+ */
+ public void setInfraSpecies(String infraSpecies) {
+ this.infraSpecies = infraSpecies;
+ }
+
+ /**
+ * @return the collation
+ */
+ public String getCollation() {
+ return collation;
+ }
+
+ /**
+ * @param collation the collation to set
+ */
+ public void setCollation(String collation) {
+ this.collation = collation;
+ }
+
+ /**
+ * @return the publicationYear
+ */
+ public String getPublicationYear() {
+ return publicationYear;
+ }
+
+ /**
+ * @param publicationYear the publicationYear to set
+ */
+ public void setPublicationYear(String publicationYear) {
+ this.publicationYear = publicationYear;
+ }
+
+ /**
+ * @return the remarks
+ */
+ public String getRemarks() {
+ return remarks;
+ }
+
+ /**
+ * @param remarks the remarks to set
+ */
+ public void setRemarks(String remarks) {
+ this.remarks = remarks;
+ }
+
+ /**
+ * @return the synonym
+ */
+ public String getSynonym() {
+ return synonym;
+ }
+
+ /**
+ * @param synonym the synonym to set
+ */
+ public void setSynonym(String synonym) {
+ this.synonym = synonym;
+ }
+
+ /**
+ * @return the basionym
+ */
+ public String getBasionym() {
+ return basionym;
+ }
+
+ /**
+ * @param basionym the basionym to set
+ */
+ public void setBasionym(String basionym) {
+ this.basionym = basionym;
+ }
+
+ /**
+ * @return the publishingAuthor
+ */
+ public String getPublishingAuthor() {
+ return publishingAuthor;
+ }
+
+ /**
+ * @param publishingAuthor the publishingAuthor to set
+ */
+ public void setPublishingAuthor(String publishingAuthor) {
+ this.publishingAuthor = publishingAuthor;
+ }
+
+ /**
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * @param version the version to set
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+
+ public void setPage(String value) {
+ this.page = value;
+
+ }
+ public String getPage() {
+ return this.page;
+
+ }
+
+
+ public void setAccepted_id(String value) {
+ this.accepted_id = value;
+ }
+
+ public String getAccepted_id(){
+ return accepted_id;
+ }
+
+ public void setInfraSpecies_Rank(String value) {
+ this.infraSpecies_rank = value;
+ }
+
+ public String getInfraSpecies_Rank() {
+ return this.infraSpecies_rank;
+ }
+
+ public String getTaxonomicStatus() {
+ return this.taxonomicStatus;
+ }
+
+ public void setTaxonomicStatus(String value) {
+ this.taxonomicStatus = value;
+ }
+
+ public String getIpni_id() {
+ return ipni_id;
+ }
+
+ public void setIpni_id(String ipni_id) {
+ this.ipni_id = ipni_id;
+ }
+
+ public void setSource(String value) {
+ this.source = value;
+
+ }
+ public String getSource() {
+ return this.source ;
+
+ }
+ public void setSource_Id(String value) {
+ this.source_Id= value;
+ }
+ public String getSource_Id() {
+ return this.source_Id;
+ }
+
+
+}
private static final long serialVersionUID = -961438861319456892L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(MarkupDocumentImport.class);
+ private static final Logger logger = LogManager.getLogger();
// TODO make part of state, but state is renewed when invoking the import a
*/
public class MarkupDocumentImportNoComponent extends MarkupImportBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(MarkupDocumentImportNoComponent.class);
+ private static final Logger logger = LogManager.getLogger();
private final MarkupKeyImport keyImport;
import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
import eu.etaxonomy.cdm.model.common.Annotation;
import eu.etaxonomy.cdm.model.common.AnnotationType;
-import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.IntextReference;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.common.LanguageString;
public class MarkupFeatureImport extends MarkupImportBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(MarkupFeatureImport.class);
+ private static final Logger logger = LogManager.getLogger();
protected static final String MODS_TITLEINFO = "titleInfo";
* @since 04.08.2008
*/
public abstract class MarkupImportBase {
- private static final Logger logger = LogManager.getLogger(MarkupImportBase.class);
+
+ private static final Logger logger = LogManager.getLogger();
//Base
protected static final String ALTITUDE = "altitude";
public class MarkupNomenclatureImport extends MarkupImportBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(MarkupNomenclatureImport.class);
+ private static final Logger logger = LogManager.getLogger();
private final MarkupSpecimenImport specimenImport;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.markup;
import java.util.ArrayList;
/**
* @author a.mueller
* @since 30.05.2012
- *
*/
public class MarkupSpecimenImport extends MarkupImportBase {
+
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(MarkupSpecimenImport.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String ALTERNATIVE_COLLECTION_TYPE_STATUS = "alternativeCollectionTypeStatus";
private static final String ALTERNATIVE_COLLECTOR = "alternativeCollector";
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.markup;
import java.util.UUID;
* @since 01.03.2010
*/
public class MarkupTransformer extends InputTransformerBase {
- private static final long serialVersionUID = -3910080152461421047L;
+ private static final long serialVersionUID = -3910080152461421047L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(MarkupTransformer.class);
+ private static final Logger logger = LogManager.getLogger();
//preliminary
public static final UUID uuidKalimantan = UUID.fromString("05c6bce3-2e55-48cb-a414-707e936066d1");
public class IkeyPlusImport extends CdmImportBase<IkeyPlusImportConfigurator, IkeyPlusImportState>{
private static final long serialVersionUID = -6817762818458834785L;
-
- public static final Logger logger = LogManager.getLogger(IkeyPlusImport.class);
+ private static final Logger logger = LogManager.getLogger();
private TermVocabulary<Feature> featureVoc;
implements IImportConfigurator, IMatchingImportConfigurator {
private static final long serialVersionUID = -960998183005112130L;
- private static final Logger logger = LogManager.getLogger(SDDImportConfigurator.class);
+ private static final Logger logger = LogManager.getLogger();
//TODO
private static IInputTransformer defaultTransformer = new SDDTransformer();
//xml xmlNamespace
Namespace sddNamespace;
- @Override
+ @SuppressWarnings("unchecked")
+ @Override
protected void makeIoClassList(){
ioClassList = new Class[]{
SDDImport.class
};
- };
+ }
public static SDDImportConfigurator NewInstance(URI uri, ICdmDataSource destination){
return new SDDImportConfigurator(uri, destination);
}
-
- /**
- * @param berlinModelSource
- * @param sourceReference
- * @param destination
- */
private SDDImportConfigurator(URI uri, ICdmDataSource destination) {
super(defaultTransformer);
setSource(uri);
setDestination(destination);
}
-
@Override
public SDDImportState getNewState() {
return new SDDImportState(this);
}
-
- /**
- * @return
- */
public Element getSourceRoot(){
try {
URL url;
this.sddNamespace = xmlNamespace;
}
- /**
- * @param doMatchTaxa the doMatchTaxa to set
- */
@Override
public void setReuseExistingTaxaWhenPossible(boolean doMatchTaxa) {
this.doMatchTaxa = doMatchTaxa;
}
-
- /**
- * @return the doMatchTaxa
- */
@Override
public boolean isReuseExistingTaxaWhenPossible() {
return doMatchTaxa;
}
-}
+}
\ No newline at end of file
import java.util.Map;
import java.util.Set;
-import javax.xml.bind.Marshaller;
-
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.xerces.dom.DocumentImpl;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import org.springframework.util.ResourceUtils;
-import org.xml.sax.SAXException;
-import eu.etaxonomy.cdm.io.jaxb.CdmMarshallerListener;
import eu.etaxonomy.cdm.model.agent.AgentBase;
import eu.etaxonomy.cdm.model.agent.Person;
import eu.etaxonomy.cdm.model.agent.Team;
private final Language defaultLanguage = Language.DEFAULT();
- private static final Logger logger = LogManager.getLogger(SDDDocumentBuilder.class);
+ private static final Logger logger = LogManager.getLogger();
- public SDDDocumentBuilder() throws SAXException, IOException {
+ public SDDDocumentBuilder() {
document = new DocumentImpl();
}
throws IOException {
this.cdmSource = cdmSource;
- Marshaller marshaller;
- CdmMarshallerListener marshallerListener = new CdmMarshallerListener();
logger.info("Start marshalling");
writeCDMtoSDD(sddDestination);
-
}
public void marshal(SDDDataSet cdmSource, String sddDestinationFileName)
throws IOException {
this.cdmSource = cdmSource;
- Marshaller marshaller;
- CdmMarshallerListener marshallerListener = new CdmMarshallerListener();
logger.info("Start marshalling");
writeCDMtoSDD(ResourceUtils.getFile(sddDestinationFileName));
-
}
public void marshal(SDDDataSet dataSet, OutputStream stream) throws IOException {
writer.close();
}
+
/**
* Write the DOM document.
*
public class SpecimenUserInteraction implements ItemListener, Serializable {
private static final long serialVersionUID = 6384263183459028523L;
-
@SuppressWarnings("unused")
- private static Logger log = LogManager.getLogger(SpecimenUserInteraction.class);
+ private static final Logger log = LogManager.getLogger();
public Classification askForClassification(Map<String, Classification> classMap){
List<String> possibilities = new ArrayList<String>(classMap.keySet());
extends CdmImportBase<TaxonXImportConfigurator, TaxonXImportState> {
private static final long serialVersionUID = 796115831082828758L;
- private static final Logger logger = LogManager.getLogger(TaxonXNomenclatureImport.class);
+ private static final Logger logger = LogManager.getLogger();
@SuppressWarnings("unused")
private static int modCount = 10000;
public class TcsRdfTaxonRelationsImport extends TcsRdfImportBase implements ICdmIO<TcsRdfImportState> {
private static final long serialVersionUID = 7473543276142564219L;
- private static final Logger logger = LogManager.getLogger(TcsRdfTaxonRelationsImport.class);
-
- private static int modCount = 30000;
+ private static final Logger logger = LogManager.getLogger();
public TcsRdfTaxonRelationsImport(){
super();
boolean result = true;
logger.warn("Checking for TaxonRelations not yet implemented");
logger.warn("Creation of homotypic relations is still problematic");
- //result &= checkArticlesWithoutJournal(bmiConfig);
- //result &= checkPartOfJournal(bmiConfig);
-
return result;
}
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.tcsrdf;
import org.apache.logging.log4j.LogManager;
* @since 29.05.2008
*/
public final class TcsRdfTransformer {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TcsRdfTransformer.class);
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
//TypeDesignation
public static SpecimenTypeDesignationStatus typeStatusId2TypeStatus (int typeStatusId) throws UnknownCdmTypeException{
}
}
-
-
-
/** Creates an cdm-Rank by the tcs rank
*/
public static Rank rankString2Rank (String strRank) throws UnknownCdmTypeException{
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.tcsxml;
import org.apache.logging.log4j.LogManager;
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
public final class TcsXmlTransformer {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TcsXmlTransformer.class);
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
//TypeDesignation
public static SpecimenTypeDesignationStatus typeStatusId2TypeStatus (int typeStatusId) throws UnknownCdmTypeException{
public class TcsXmlTaxonNameImport extends TcsXmlImportBase implements ICdmIO<TcsXmlImportState> {
private static final long serialVersionUID = -1978871518114999061L;
- private static final Logger logger = LogManager.getLogger(TcsXmlTaxonNameImport.class);
+ private static final Logger logger = LogManager.getLogger();
private static int modCount = 5000;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.io.tcsxml.in;
import java.io.InputStream;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
import eu.etaxonomy.cdm.strategy.exceptions.UnknownCdmTypeException;
-
/**
* @author a.mueller
- *
*/
@Component
public class TcsXmlTaxonRelationsImport extends TcsXmlImportBase implements ICdmIO<TcsXmlImportState> {
private static final long serialVersionUID = 6632990505515905663L;
- private static final Logger logger = LogManager.getLogger(TcsXmlTaxonRelationsImport.class);
+ private static final Logger logger = LogManager.getLogger();
private static int modCount = 30000;
public TcsXmlTaxonRelationsImport(){
super();
-
}
@Override
boolean result = true;
logger.warn("Checking for TaxonRelations not yet implemented");
logger.warn("Creation of homotypic relations is still problematic");
- //result &= checkArticlesWithoutJournal(bmiConfig);
- //result &= checkPartOfJournal(bmiConfig);
return result;
}
public class DwcaExportTest extends CdmTransactionalIntegrationTest{
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DwcaExportTest.class);
+ private static final Logger logger = LogManager.getLogger();
private static final UUID UUID_SUBSPEC_NODE = UUID.fromString("f8c9933a-fe3a-42ce-8a92-000e27bfdfac");
private static final String UUID_UNPUBLISHED_TAXON = "e5cdc392-4e0b-49ad-84e9-8c4b22d1827c";
+++ /dev/null
-/**
-* Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy
-* http://www.e-taxonomy.eu
-*
-* The contents of this file are subject to the Mozilla Public License Version 1.1
-* See LICENSE.TXT at the top of this package for the full license terms.
-*/
-package eu.etaxonomy.cdm.test.suite;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-
-import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportTest;
-import eu.etaxonomy.cdm.io.jaxb.CdmImporterTest;
-import eu.etaxonomy.cdm.io.sdd.in.SDDImportTest;
-import eu.etaxonomy.cdm.io.specimen.abcd206.in.SpecimenImportConfiguratorTest;
-import eu.etaxonomy.cdm.io.specimen.excel.in.ExcelImportConfiguratorTest;
-import eu.etaxonomy.cdm.io.specimen.excel.in.ExcelSpecimenImportExampleTest;
-
-@RunWith(Suite.class)
-@Suite.SuiteClasses(
- {
- NormalExplicitImportTest.class,
- CdmImporterTest.class,
- SDDImportTest.class,
- SpecimenImportConfiguratorTest.class,
- ExcelImportConfiguratorTest.class,
- ExcelSpecimenImportExampleTest.class
- }
- )
-public class CdmTestSuite {
-
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger();
-
- // the class remains completely empty,
- // being used only as a holder for the above annotations
-}
private static final long serialVersionUID = -6263443499465634548L;
- private static final Logger logger = LogManager.getLogger(NomenclaturalSourceFormatter.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String EMPTY_TITLE = "-";
private static final String beforeMicroReference = ": ";
private static final long serialVersionUID = 1060802925284271666L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(EnumSetUserType.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String SEP = "#";
public class HibernateProxyHelper {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(HibernateProxyHelper.class);
+ private static final Logger logger = LogManager.getLogger();
// ************************** Hibernate proxies *******************/
/**
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.jaxb;\r
-\r
-import java.util.Map;\r
-import java.util.concurrent.ConcurrentHashMap;\r
-\r
-import javax.xml.bind.annotation.adapters.XmlAdapter;\r
-\r
-import eu.etaxonomy.cdm.model.common.Language;\r
-import eu.etaxonomy.cdm.model.common.LanguageString;\r
-\r
-/**\r
- * @author a.babadshanjan\r
- * @version 1.0\r
- */\r
-public class MultilanguageTextAdapter extends XmlAdapter<MultilanguageTextElement, Map<Language, LanguageString>> {\r
-\r
- @Override\r
- public MultilanguageTextElement marshal(Map<Language, LanguageString> value)\r
- throws Exception {\r
-\r
- MultilanguageTextElement multilanguageTextElement = new MultilanguageTextElement();\r
-\r
- for(Language l : value.keySet()) {\r
- multilanguageTextElement.getLanguageString().add(value.get(l));\r
- }\r
- return multilanguageTextElement;\r
- }\r
-\r
- @Override\r
- public Map<Language, LanguageString> unmarshal(MultilanguageTextElement value)\r
- throws Exception {\r
-\r
- Map<Language,LanguageString> map = new ConcurrentHashMap<>();\r
-\r
- for(LanguageString l : value.getLanguageString()) {\r
- map.put(l.getLanguage(), l);\r
- }\r
- return map;\r
- }\r
-}\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.jaxb;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import eu.etaxonomy.cdm.model.common.Language;
+import eu.etaxonomy.cdm.model.common.LanguageString;
+
+/**
+ * @author a.babadshanjan
+ */
+public class MultilanguageTextAdapter extends XmlAdapter<MultilanguageTextElement, Map<Language, LanguageString>> {
+
+ @Override
+ public MultilanguageTextElement marshal(Map<Language, LanguageString> value)
+ throws Exception {
+
+ MultilanguageTextElement multilanguageTextElement = new MultilanguageTextElement();
+
+ for(Language l : value.keySet()) {
+ multilanguageTextElement.getLanguageString().add(value.get(l));
+ }
+ return multilanguageTextElement;
+ }
+
+ @Override
+ public Map<Language, LanguageString> unmarshal(MultilanguageTextElement value)
+ throws Exception {
+
+ Map<Language,LanguageString> map = new ConcurrentHashMap<>();
+
+ for(LanguageString l : value.getLanguageString()) {
+ map.put(l.getLanguage(), l);
+ }
+ return map;
+ }
+}
-/**\r
-* Copyright (C) 2009 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.jaxb;\r
-\r
-import java.util.Map;\r
-import java.util.concurrent.ConcurrentHashMap;\r
-\r
-import javax.xml.bind.annotation.adapters.XmlAdapter;\r
-\r
-import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;\r
-\r
-/**\r
- * @author a.babadshanjan\r
- * @version 1.0\r
- */\r
-public class NamespacesAdapter extends XmlAdapter<NamespacesElement, Map<String,Class<? extends IIdentifiableEntity>>> {\r
-\r
- @Override\r
- public NamespacesElement marshal(Map<String,Class<? extends IIdentifiableEntity>> value)\r
- throws Exception {\r
- \r
- NamespacesElement namespacesElement = new NamespacesElement();\r
- \r
- for(String s : value.keySet()) {\r
- Namespace namespace = new Namespace();\r
- namespace.setNSpace(s);\r
- namespace.setClazz(value.get(s));\r
- namespacesElement.getNamespace().add(namespace);\r
- }\r
- return namespacesElement;\r
- }\r
-\r
- @Override\r
- public Map<String,Class<? extends IIdentifiableEntity>> unmarshal(NamespacesElement value)\r
- throws Exception {\r
- \r
- Map<String, Class<? extends IIdentifiableEntity>> map = new ConcurrentHashMap<String, Class<? extends IIdentifiableEntity>>();\r
- \r
- for(Namespace n : value.getNamespace()) {\r
- map.put(n.getNSpace(),n.getClazz());\r
- }\r
- return map;\r
- }\r
-}\r
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.jaxb;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
+
+/**
+ * @author a.babadshanjan
+ */
+public class NamespacesAdapter extends XmlAdapter<NamespacesElement, Map<String,Class<? extends IIdentifiableEntity>>> {
+
+ @Override
+ public NamespacesElement marshal(Map<String,Class<? extends IIdentifiableEntity>> value)
+ throws Exception {
+
+ NamespacesElement namespacesElement = new NamespacesElement();
+
+ for(String s : value.keySet()) {
+ Namespace namespace = new Namespace();
+ namespace.setNSpace(s);
+ namespace.setClazz(value.get(s));
+ namespacesElement.getNamespace().add(namespace);
+ }
+ return namespacesElement;
+ }
+
+ @Override
+ public Map<String,Class<? extends IIdentifiableEntity>> unmarshal(NamespacesElement value)
+ throws Exception {
+
+ Map<String, Class<? extends IIdentifiableEntity>> map = new ConcurrentHashMap<String, Class<? extends IIdentifiableEntity>>();
+
+ for(Namespace n : value.getNamespace()) {
+ map.put(n.getNSpace(),n.getClazz());
+ }
+ return map;
+ }
+}
public class Person extends TeamOrPersonBase<Person>{
private static final long serialVersionUID = 4153566493065539763L;
- public static final Logger logger = LogManager.getLogger(Person.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name="NomenclaturalTitle")
@Field(index=Index.YES)
public class Team extends TeamOrPersonBase<Team> {
private static final long serialVersionUID = 97640416905934622L;
- public static final Logger logger = LogManager.getLogger(Team.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "ProtectedNomenclaturalTitleCache")
private boolean protectedNomenclaturalTitleCache = false;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.hibernate.envers.Audited;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
implements INomenclaturalAuthor {
private static final long serialVersionUID = 5216821307314001961L;
- public static final Logger logger = LogManager.getLogger(TeamOrPersonBase.class);
//under construction #4311
@XmlElement(name="CollectorTitleCache")
*
* @author n.hoffmann
* @since Dec 2, 2010
- * @version 1.0
*/
public interface IMultiLanguageTextHolder {
-
-
}
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy\r
-* http://www.e-taxonomy.eu\r
-*\r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.model.common;\r
-\r
-import java.util.List;\r
-\r
-import eu.etaxonomy.cdm.strategy.parser.ParserProblem;\r
-\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 21.05.2008\r
- * @version 1.0\r
- */\r
-public interface IParsable {\r
-\r
- /**\r
- * Returns an integer value indicating whether the used parser\r
- * method was able to parse a string successfully into this object (<code>0</code>)\r
- * or not (<code>!=0</code>). The the parsing was not successful the value returned\r
- * defines in more detail what the problem was. The definition of these values depends\r
- * on the parser that has been used for parsing.\r
- *\r
- * @return the int value parsingProblem\r
- */\r
- public int getParsingProblem();\r
-\r
- /**\r
- * @see #getParsingProblem()\r
- */\r
- public void setParsingProblem(int hasProblem);\r
-\r
- /**\r
- * Returns true if any parsing problem (warning or error) exists.\r
- *\r
- * @see #getHasProblem()\r
- */\r
- public boolean hasProblem();\r
-\r
- /**\r
- * Returns true, if the specified problem exists. False otherwise.\r
- * @param problem\r
- * @return\r
- */\r
- public boolean hasProblem(ParserProblem problem);\r
-\r
-\r
- /**\r
- * Returns a list of all warnings and errors that have been recognized during the parsing\r
- * and not yet handled.\r
- * @return\r
- */\r
- public List<ParserProblem> getParsingProblems();\r
-\r
- /**\r
- * Adds a parsing problem to the list of parsing problems\r
- * @param problem\r
- */\r
- public void addParsingProblem(ParserProblem problem);\r
-\r
- /**\r
- * Removes a parsing problem from the list of parsing problems.\r
- * If the problem is not in the list or is <code>null</code>, nothing happens.\r
- * @param warning\r
- */public void removeParsingProblem(ParserProblem problem);\r
-\r
-\r
- /**\r
- * Returns the integer value of the position where a parsing problem starts.\r
- * If no problem exists -1 is returned.\r
- * Default: -1\r
- * @deprecated This method will be removed by a more sophisticated method in future versions,\r
- * therefore it is deprecated.<BR>\r
- * @see #getHasProblem()\r
- */\r
- @Deprecated\r
- public int getProblemStarts();\r
-\r
- /**\r
- * Returns the integer value of the position where a parsing problem ends.\r
- * If no problem exists -1 is returned.\r
- * Default: -1\r
- * @deprecated This method will be removed by a more sophisticated method in future versions,\r
- * therefore it is deprecated. <BR>\r
- * @see #getHasProblem()\r
- */\r
- @Deprecated\r
- public int getProblemEnds();\r
-\r
- /**\r
- * @deprecated This method will be removed by a more sophisticated method in future versions,\r
- * therefore it is deprecated. <BR>\r
- * @see #getProblemStarts()\r
- */\r
- @Deprecated\r
- public void setProblemStarts(int start);\r
-\r
- /**\r
- * @deprecated This method will be removed by a more sophisticated method in future versions,\r
- * therefore it is deprecated. <BR>\r
- * @see #getProblemEnds()\r
- */\r
- @Deprecated\r
- public void setProblemEnds(int end);\r
-\r
-}\r
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.model.common;
+
+import java.util.List;
+
+import eu.etaxonomy.cdm.strategy.parser.ParserProblem;
+
+
+/**
+ * @author a.mueller
+ * @since 21.05.2008
+ */
+public interface IParsable {
+
+ /**
+ * Returns an integer value indicating whether the used parser
+ * method was able to parse a string successfully into this object (<code>0</code>)
+ * or not (<code>!=0</code>). The the parsing was not successful the value returned
+ * defines in more detail what the problem was. The definition of these values depends
+ * on the parser that has been used for parsing.
+ *
+ * @return the int value parsingProblem
+ */
+ public int getParsingProblem();
+
+ /**
+ * @see #getParsingProblem()
+ */
+ public void setParsingProblem(int hasProblem);
+
+ /**
+ * Returns true if any parsing problem (warning or error) exists.
+ *
+ * @see #getHasProblem()
+ */
+ public boolean hasProblem();
+
+ /**
+ * Returns true, if the specified problem exists. False otherwise.
+ * @param problem
+ * @return
+ */
+ public boolean hasProblem(ParserProblem problem);
+
+
+ /**
+ * Returns a list of all warnings and errors that have been recognized during the parsing
+ * and not yet handled.
+ * @return
+ */
+ public List<ParserProblem> getParsingProblems();
+
+ /**
+ * Adds a parsing problem to the list of parsing problems
+ * @param problem
+ */
+ public void addParsingProblem(ParserProblem problem);
+
+ /**
+ * Removes a parsing problem from the list of parsing problems.
+ * If the problem is not in the list or is <code>null</code>, nothing happens.
+ * @param warning
+ */public void removeParsingProblem(ParserProblem problem);
+
+
+ /**
+ * Returns the integer value of the position where a parsing problem starts.
+ * If no problem exists -1 is returned.
+ * Default: -1
+ * @deprecated This method will be removed by a more sophisticated method in future versions,
+ * therefore it is deprecated.<BR>
+ * @see #getHasProblem()
+ */
+ @Deprecated
+ public int getProblemStarts();
+
+ /**
+ * Returns the integer value of the position where a parsing problem ends.
+ * If no problem exists -1 is returned.
+ * Default: -1
+ * @deprecated This method will be removed by a more sophisticated method in future versions,
+ * therefore it is deprecated. <BR>
+ * @see #getHasProblem()
+ */
+ @Deprecated
+ public int getProblemEnds();
+
+ /**
+ * @deprecated This method will be removed by a more sophisticated method in future versions,
+ * therefore it is deprecated. <BR>
+ * @see #getProblemStarts()
+ */
+ @Deprecated
+ public void setProblemStarts(int start);
+
+ /**
+ * @deprecated This method will be removed by a more sophisticated method in future versions,
+ * therefore it is deprecated. <BR>
+ * @see #getProblemEnds()
+ */
+ @Deprecated
+ public void setProblemEnds(int end);
+
+}
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.model.common;
import org.joda.time.DateTime;
/**
* @author n.hoffmann
* @since Sep 15, 2010
- * @version 1.0
*/
public interface IVersionableEntity extends ICdmBase {
public User getUpdatedBy();
- /**
- *
- * @param updatedBy updatedBy
- */
public void setUpdatedBy(User updatedBy);
- /**
- *
- * @return
- */
public DateTime getUpdated();
- /**
- *
- * @param updated updated
- */
public void setUpdated(DateTime updated);
-
-}
+
+}
\ No newline at end of file
implements IIdentifiableEntity /*, ISourceable<IdentifiableSource> */ {
private static final long serialVersionUID = 7912083412108359559L;
- private static final Logger logger = LogManager.getLogger(IdentifiableEntity.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlTransient
public static final boolean PROTECTED = true;
private static final long serialVersionUID = -8487673428764273806L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(IdentifiableSource.class);
+ private static final Logger logger = LogManager.getLogger();
//********************************* FACTORY ********************************************************/
*/
public class LSIDWSDLLocator implements WSDLLocator {
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private Reader baseReader = null;
private Reader importReader = null;
static final long serialVersionUID = 2035568689268762760L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SingleSourcedEntityBase.class);
+ private static final Logger logger = LogManager.getLogger();
//the source for this single sourced entity
@XmlElement(name = "source")
public class TimePeriod implements Cloneable, Serializable, ICheckEmpty {
private static final long serialVersionUID = 3405969418194981401L;
- private static final Logger logger = LogManager.getLogger(TimePeriod.class);
+ private static final Logger logger = LogManager.getLogger();
public static final DateTimeFieldType YEAR_TYPE = DateTimeFieldType.year();
public static final DateTimeFieldType MONTH_TYPE = DateTimeFieldType.monthOfYear();
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.model.description;
import java.util.EnumSet;
implements ICdmTarget{
private static final long serialVersionUID = 5504218413819040193L;
- private static final Logger logger = LogManager.getLogger(DescriptionBase.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement( name = "DescribedSpecimenOrObservation")
@ManyToOne(fetch = FetchType.LAZY)
implements IIdentificationKey, IIntextReferenceTarget {
private static final long serialVersionUID = -3368243754557343942L;
- private static final Logger logger = LogManager.getLogger(PolytomousKey.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElementWrapper(name = "CoveredTaxa")
@XmlElement(name = "CoveredTaxon")
@Audited
public class PolytomousKeyNode extends VersionableEntity implements IMultiLanguageTextHolder {
- private static final Logger logger = LogManager.getLogger(PolytomousKeyNode.class);
+ private static final Logger logger = LogManager.getLogger();
// This is the main key a node belongs to. Although other keys may also
// reference <code>this</code> node, a node usually belongs to a given key.
public class PresenceAbsenceTerm extends DefinedTermBase<PresenceAbsenceTerm> {
private static final long serialVersionUID = 1036807546935584396L;
- private static final Logger logger = LogManager.getLogger(PresenceAbsenceTerm.class);
+ private static final Logger logger = LogManager.getLogger();
//presence base
public static final UUID uuidPresent = UUID.fromString("cef81d25-501c-48d8-bbea-542ec50de2c2");
private static final long serialVersionUID = -5014025677925668627L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TaxonInteraction.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "Description")
@XmlJavaTypeAdapter(MultilanguageTextAdapter.class)
implements IMultiLanguageTextHolder, Cloneable{
private static final long serialVersionUID = -2165015581278282615L;
- private static final Logger logger = LogManager.getLogger(TextData.class);
+ private static final Logger logger = LogManager.getLogger();
//@XmlElement(name = "MultiLanguageText", type = MultilanguageText.class)
@XmlElement(name = "MultiLanguageText")
extends DefinedTermBase<NamedAreaType> {
private static final long serialVersionUID = 8280172429797206548L;
- private static final Logger logger = LogManager.getLogger(NamedAreaType.class);
-
- protected static Map<UUID, NamedAreaType> termMap = null;
+ private static final Logger logger = LogManager.getLogger();
private static final UUID uuidNaturalArea = UUID.fromString("cc33167c-d366-4030-b984-6b14e4f5fd22");
private static final UUID uuidAdministrationArea = UUID.fromString("1799f581-f425-40d6-a4db-ec2c638c0e92");
+ private static Map<UUID, NamedAreaType> termMap = null;
+
/**
* Factory method
*/
@Entity
@Audited
public class MediaRepresentationPart extends VersionableEntity {
+
private static final long serialVersionUID = -1674422508643785796L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(MediaRepresentationPart.class);
+ private static final Logger logger = LogManager.getLogger();
// where the media file is stored
@XmlElement(name = "URI")
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.hibernate.envers.Audited;
import eu.etaxonomy.cdm.model.term.DefinedTermBase;
public class RightsType extends DefinedTermBase<RightsType> {
private static final long serialVersionUID = -5823263624000932116L;
- private static final Logger logger = LogManager.getLogger(RightsType.class);
- protected static Map<UUID, RightsType> termMap = null;
+ private static Map<UUID, RightsType> termMap = null;
//************************** FACTORY METHODS **********************************/
private static final long serialVersionUID = -2978411330023671805L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DnaSample.class);
+ private static final Logger logger = LogManager.getLogger();
// ****************** FACTORY METHOD *****************/
public class Primer extends AnnotatableEntity {
private static final long serialVersionUID = 6179007910988646989L;
- private static final Logger logger = LogManager.getLogger(Primer.class);
+ private static final Logger logger = LogManager.getLogger();
/** @see #getLabel() */
@XmlElement(name = "Label")
public class SingleRead extends EventBase {
private static final long serialVersionUID = 1735535003073536132L;
- private static final Logger logger = LogManager.getLogger(SingleRead.class);
+ private static final Logger logger = LogManager.getLogger();
/** @see #getAmplificationResult() */
@XmlElement(name = "AmplificationResult")
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.hibernate.annotations.Type;
import org.hibernate.envers.Audited;
implements INomenclaturalStanding {
private static final long serialVersionUID = 8504916205254159334L;
- static Logger logger = LogManager.getLogger(NameRelationshipType.class);
private static final UUID uuidOrthographicVariant = UUID.fromString("eeaea868-c4c1-497f-b9fe-52c9fc4aca53");
private static final UUID uuidMisspelling = UUID.fromString("c6f9afcb-8287-4a2b-a6f6-4da3a073d5de");
extends TypeDesignationBase<NameTypeDesignationStatus> {
private static final long serialVersionUID = 8478663508862210879L;
- final static Logger logger = LogManager.getLogger(NameTypeDesignation.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "IsRejectedType")
private boolean rejectedType;
private static final long serialVersionUID = 1337101678484153972L;
- private static Logger logger = LogManager.getLogger(NomenclaturalStatusType.class);
+ private static final Logger logger = LogManager.getLogger();
//Botanical uuids
public static final UUID uuidIcnafpNomStatusVocabulary = UUID.fromString("bb28cdca-2f8a-4f11-9c21-517e9ae87f1f");
REJECTED(UUID.fromString("0960e14a-a6b1-41b4-92a9-0d6d1b9e0159"), "Unknown unit type","REJ"),
;
- private final Logger logger = LogManager.getLogger(RegistrationStatus.class);
+ private final Logger logger = LogManager.getLogger();
private RegistrationStatus(UUID uuid, String defaultString, String key){
extends TypeDesignationBase<SpecimenTypeDesignationStatus> {
private static final long serialVersionUID = 6481627446997275007L;
- private static final Logger logger = LogManager.getLogger(SpecimenTypeDesignation.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "TypeSpecimen")
@XmlIDREF
INomenclaturalStanding {
private static final long serialVersionUID = -791164269603409712L;
- private static final Logger logger = LogManager.getLogger(TaxonName.class);
+ private static final Logger logger = LogManager.getLogger();
/**
* The {@link NomenclaturalCode nomenclatural code} this taxon name is ruled by.
public class DerivationEvent extends EventBase {
private static final long serialVersionUID = 3661673673962819395L;
- private static final Logger logger = LogManager.getLogger(DerivationEvent.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElementWrapper(name = "Originals")
@XmlElement(name = "Original")
private static final long serialVersionUID = 6895093454763415279L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DerivationEventType.class);
+ private static final Logger logger = LogManager.getLogger();
private static final UUID uuidAccessioning = UUID.fromString("3c7c0929-0528-493e-9e5f-15e0d9585fa1");
private static final UUID uuidDnaExtraction = UUID.fromString("f9f957b6-88c0-4531-9a7f-b5fb1c9daf66");
extends SpecimenOrObservationBase<IIdentifiableEntityCacheStrategy<? extends DerivedUnit>> {
private static final long serialVersionUID = -3525746216270843517L;
- private static final Logger logger = LogManager.getLogger(DerivedUnit.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "Collection")
@XmlIDREF
private static final long serialVersionUID = 5065341354427569773L;
- private static final Logger logger = LogManager.getLogger(DeterminationEvent.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "IdentifiedUnit")
@XmlIDREF
public class FieldUnit extends SpecimenOrObservationBase<IIdentifiableEntityCacheStrategy<FieldUnit>> implements Cloneable{
private static final long serialVersionUID = -7586670941559035171L;
- private static final Logger logger = LogManager.getLogger(FieldUnit.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "FieldNumber")
@Field
//@Indexed disabled to reduce clutter in indexes, since this type is not used by any search
//@Indexed
public class GatheringEvent extends EventBase {
+
private static final long serialVersionUID = 7980806082366532180L;
- private static final Logger logger = LogManager.getLogger(GatheringEvent.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "Locality")
@OneToOne(fetch = FetchType.LAZY, orphanRemoval=true)
*
* @author a.mueller
* @since 2013-07-08
- *
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MaterialOrMethod", propOrder = {
public class MaterialOrMethodEvent extends EventBase {
private static final long serialVersionUID = -4799205199942053585L;
- private static final Logger logger = LogManager.getLogger(MaterialOrMethodEvent.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "DefinedMaterialOrMethod")
@XmlIDREF
private static final long serialVersionUID = -5717424451590705378L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(MediaSpecimen.class);
-
+ private static final Logger logger = LogManager.getLogger();
// ************** ATTRIBUTES ****************************/
extends SingleSourcedEntityBase {
private static final long serialVersionUID = 623891726208046243L;
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "OccurrenceStatusType")
@XmlIDREF
private static final long serialVersionUID = 2366116167028862401L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(PreservationMethod.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "Medium")
@XmlIDREF
implements IMultiLanguageTextHolder, IIntextReferenceTarget, IDescribable<DescriptionBase<S>>, IPublishable {
private static final long serialVersionUID = 6932680139334408031L;
- private static final Logger logger = LogManager.getLogger(SpecimenOrObservationBase.class);
+ private static final Logger logger = LogManager.getLogger();
/**
* An indication of what the unit record describes.
;
@SuppressWarnings("unused")
- private final Logger logger = LogManager.getLogger(SpecimenOrObservationType.class);
+ private final Logger logger = LogManager.getLogger();
private SpecimenOrObservationType(UUID uuid, String defaultString, String key){
public class GrantedAuthorityImpl extends CdmBase implements GrantedAuthority {
private static final long serialVersionUID = 2651969425860655040L;
- private static final Logger logger = LogManager.getLogger(GrantedAuthority.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "Authority")
@Column(unique = true)
public class Group extends CdmBase {
private static final long serialVersionUID = 7216686200093054648L;
- private static final Logger logger = LogManager.getLogger(Group.class);
+ private static final Logger logger = LogManager.getLogger();
public final static UUID GROUP_EDITOR_UUID = UUID.fromString("22e5e8af-b99c-4884-a92f-71978efd3770");
public final static UUID GROUP_EDITOR_EXTENDED_CREATE_UUID = UUID.fromString("89a7f47f-6f2b-45ac-88d4-a99a4cf29f07");
USER("User"),
;
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private PermissionClass(String key){
//we have no UUIDs defined yet, but needed for tests
IIntextReferenceTarget {
private static final long serialVersionUID = -2034764545042691295L;
- private static final Logger logger = LogManager.getLogger(Reference.class);
+ private static final Logger logger = LogManager.getLogger();
// from E+M import (still needed?)
// @Column(length=255)
;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(ReferenceType.class);
+ private static final Logger logger = LogManager.getLogger();
private ReferenceType(UUID uuid, String defaultString, String key, ReferenceType parent){
implements IRelated<RelationshipBase>, IDescribable<TaxonDescription>, ICdmTarget{
private static final long serialVersionUID = -584946869762749006L;
- private static final Logger logger = LogManager.getLogger(Taxon.class);
+ private static final Logger logger = LogManager.getLogger();
private static final TaxonComparator defaultTaxonComparator = new TaxonComparator();
implements IPublishable, IIntextReferenceTarget{
private static final long serialVersionUID = -3589185949928938529L;
- private static final Logger logger = LogManager.getLogger(TaxonBase.class);
+ private static final Logger logger = LogManager.getLogger();
public static final String ACC_TAXON_BRIDGE_PREFIX = "accTaxon";
implements ITaxonTreeNode, ITreeNode<TaxonNode>{
private static final long serialVersionUID = -4743289894926587693L;
- private static final Logger logger = LogManager.getLogger(TaxonNode.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "taxon")
@XmlIDREF
@Audited
public class TaxonNodeAgentRelation extends AnnotatableEntity {
private static final long serialVersionUID = -1476342569350403356L;
- private static final Logger logger = LogManager.getLogger(TaxonNodeAgentRelation.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "TaxonNode")
@XmlIDREF
// **************** END ENUM **********************/
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TaxonNodeStatus.class);
+ private static final Logger logger = LogManager.getLogger();
private String shortLabel;
private String symbol;
extends RelationshipBase<Taxon, Taxon, TaxonRelationshipType> {
private static final long serialVersionUID = 1378437971941534653L;
- static private final Logger logger = LogManager.getLogger(TaxonRelationship.class);
+ static private final Logger logger = LogManager.getLogger();
@XmlElement(name = "RelatedFrom")
@XmlIDREF
//@Indexed(index = "eu.etaxonomy.cdm.model.term.Representation")
@Audited
public class Representation extends LanguageStringBase {
+
private static final long serialVersionUID = -4202420199587324532L;
- private static final Logger logger = LogManager.getLogger(Representation.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "Label")
@Field(store=Store.YES)
private static final long serialVersionUID = 1471561531632115822L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TermBase.class);
+ private static final Logger logger = LogManager.getLogger();
@XmlElement(name = "URI")
@Field(analyze = Analyze.NO)
private static final long serialVersionUID = 8375295443642690479L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TeamDefaultCacheStrategy.class);
+ private static final Logger logger = LogManager.getLogger();
public static final String FINAL_TEAM_CONCATINATION = " & ";
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.strategy.cache.name;\r
-\r
-import static java.lang.annotation.ElementType.FIELD;\r
-import static java.lang.annotation.RetentionPolicy.RUNTIME;\r
-\r
-import java.lang.annotation.Retention;\r
-import java.lang.annotation.Target;\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 03.08.2009\r
- * @version 1.0\r
- */\r
-@Target({FIELD}) \r
-@Retention(RUNTIME)\r
-public @interface CacheUpdate {\r
- String[] value() default {};\r
- String[] noUpdate() default {};\r
- \r
-}
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.strategy.cache.name;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * @author a.mueller
+ * @since 03.08.2009
+ */
+@Target({FIELD})
+@Retention(RUNTIME)
+public @interface CacheUpdate {
+ String[] value() default {};
+ String[] noUpdate() default {};
+
+}
\ No newline at end of file
extends NameCacheStrategyBase
implements INonViralNameCacheStrategy {
- private static final Logger logger = LogManager.getLogger(TaxonNameDefaultCacheStrategy.class);
+ private static final Logger logger = LogManager.getLogger();
private static final long serialVersionUID = -6577757501563212669L;
final static UUID uuid = UUID.fromString("1cdda0d1-d5bc-480f-bf08-40a510a2f223");
protected String basionymEnd = ")";
protected String exAuthorSeperator = " ex ";
private static String NOTHO = "notho";
- protected CharSequence basionymAuthorCombinationAuthorSeperator = " ";
+ private CharSequence basionymAuthorCombinationAuthorSeperator = " ";
- protected String zooAuthorYearSeperator = ", ";
+ private String zooAuthorYearSeperator = ", ";
private String cultivarStart = "'";
private String cultivarEnd = "'";
private static final long serialVersionUID = 6773742298840407263L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(ReferenceDefaultCacheStrategy.class);
+ private static final Logger logger = LogManager.getLogger();
private final static UUID uuid = UUID.fromString("63e669ca-c6be-4a8a-b157-e391c22580f9");
*/
public class PolytomousKeyGenerator {
- private static final Logger logger = LogManager.getLogger(PolytomousKeyGenerator.class);
+ private static final Logger logger = LogManager.getLogger();
/**
* Strings used for generating the statements of the key.
-/**\r
- * Copyright (C) 2007 EDIT\r
- * European Distributed Institute of Taxonomy \r
- * http://www.e-taxonomy.eu\r
- * \r
- * The contents of this file are subject to the Mozilla Public License Version 1.1\r
- * See LICENSE.TXT at the top of this package for the full license terms.\r
- */\r
-\r
-package eu.etaxonomy.cdm.strategy.merge;\r
-\r
-import eu.etaxonomy.cdm.model.common.ICdmBase;\r
-\r
-\r
-/**\r
- * This is an interface to tag all those classes which can be merged via an \r
- * <code>eu.etaxonomy.cdm.strategy.merge.IMergeStrategy</code>.\r
- * @author a.mueller\r
- * @since 31.07.2009\r
- * @version 1.0\r
- */\r
-public interface IMergable extends ICdmBase{\r
-\r
-\r
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.cdm.strategy.merge;
+
+import eu.etaxonomy.cdm.model.common.ICdmBase;
+
+
+/**
+ * This is an interface to tag all those classes which can be merged via an
+ * <code>eu.etaxonomy.cdm.strategy.merge.IMergeStrategy</code>.
+ * @author a.mueller
+ * @since 31.07.2009
+ */
+public interface IMergable extends ICdmBase{
+
}
-/**\r
- * Copyright (C) 2007 EDIT\r
- * European Distributed Institute of Taxonomy \r
- * http://www.e-taxonomy.eu\r
- * \r
- * The contents of this file are subject to the Mozilla Public License Version 1.1\r
- * See LICENSE.TXT at the top of this package for the full license terms.\r
- */\r
-\r
-package eu.etaxonomy.cdm.strategy.merge;\r
-\r
-import java.util.Set;\r
-\r
-import eu.etaxonomy.cdm.model.common.ICdmBase;\r
-\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 31.07.2009\r
- * @version 1.0\r
- */\r
-public interface IMergeStrategy {\r
-\r
- public MergeMode getMergeMode(String propertyName);\r
-\r
- /**\r
- * Sets the merge mode for property propertyName\r
- * @param propertyName\r
- * @param mergeMode\r
- * @throws MergeException \r
- */\r
- public void setMergeMode(String propertyName, MergeMode mergeMode) throws MergeException;\r
- \r
- /**\r
- * Sets the default merge mode for all properties.\r
- * The default merge mode is used if no more specific merge mode is defined for a certain property.\r
- * @param mergeMode\r
- */\r
- public void setDefaultMergeMode(MergeMode defaultMergeMode);\r
- \r
- /**\r
- * Sets the default merge mode for all collection properties.\r
- * The default collection merge mode is used if no specific merge mode is defined for a certain collection property.\r
- * @param mergeMode\r
- */\r
- public void setDefaultCollectionMergeMode(MergeMode defaultCollectionMergeMode);\r
-\r
- \r
- /**\r
- * Merges mergeSecond into mergeFirst.\r
- * Returns a set of CdmBases that became orphant during the merge process and\r
- * therefore must be deleted from a persistent context.\r
- * @param <T>\r
- * @param mergeFirst\r
- * @param mergeSecond\r
- * @throws MergeException\r
- */\r
- public <T extends IMergable> Set<ICdmBase> invoke(T mergeFirst, T mergeSecond) throws MergeException;\r
-\r
- /**\r
- * Merges mergeSecond into mergeFirst.\r
- * Returns a set of CdmBases that became orphant during the merge process and\r
- * therefore must be deleted from a persistent context.\r
- * @param <T>\r
- * @param mergeFirst\r
- * @param mergeSecond\r
- * @param clonedObjects a set of objects that needed to be cloned during merge. \r
- * This set will be filled during merge and should preferably be empty at the beginning \r
- * @throws MergeException\r
- */\r
- public <T extends IMergable> Set<ICdmBase> invoke(T mergeFirst, T mergeSecond, Set<ICdmBase> clonedObjects) throws MergeException;\r
-\r
- /**\r
- * If set to true the merge will only reallocate all references that point\r
- * to the second entity to the first entity. All data attached to the \r
- * second entity will be completely lost. All data attached to the first \r
- * entity will be saved as it is. All other {@link MergeMode} information will\r
- * be neglected.<BR>\r
- * The second entity will finally be deleted.\r
- * \r
- * #see {@link #setOnlyReallocateLinks(boolean)}\r
- */\r
- public boolean isOnlyReallocateReferences(); \r
- \r
-// Removed as this is not yet implemented in underlying classes\r
-// /**\r
-// * Sets the onlyReallocateReferences parameter. See {@link #isOnlyReallocateReferences()}\r
-// * for the parameters semantics.\r
-// * @see #isOnlyReallocateReferences()\r
-// * @param onlyReallocateReferences\r
-// */\r
-// public void setOnlyReallocateLinks(boolean onlyReallocateReferences);\r
- \r
-}
+/**
+ * Copyright (C) 2007 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.cdm.strategy.merge;
+
+import java.util.Set;
+
+import eu.etaxonomy.cdm.model.common.ICdmBase;
+
+/**
+ * @author a.mueller
+ * @since 31.07.2009
+ */
+public interface IMergeStrategy {
+
+ public MergeMode getMergeMode(String propertyName);
+
+ /**
+ * Sets the merge mode for property propertyName
+ * @param propertyName
+ * @param mergeMode
+ * @throws MergeException
+ */
+ public void setMergeMode(String propertyName, MergeMode mergeMode) throws MergeException;
+
+ /**
+ * Sets the default merge mode for all properties.
+ * The default merge mode is used if no more specific merge mode is defined for a certain property.
+ * @param mergeMode
+ */
+ public void setDefaultMergeMode(MergeMode defaultMergeMode);
+
+ /**
+ * Sets the default merge mode for all collection properties.
+ * The default collection merge mode is used if no specific merge mode is defined for a certain collection property.
+ * @param mergeMode
+ */
+ public void setDefaultCollectionMergeMode(MergeMode defaultCollectionMergeMode);
+
+
+ /**
+ * Merges mergeSecond into mergeFirst.
+ * Returns a set of CdmBases that became orphant during the merge process and
+ * therefore must be deleted from a persistent context.
+ * @param <T>
+ * @param mergeFirst
+ * @param mergeSecond
+ * @throws MergeException
+ */
+ public <T extends IMergable> Set<ICdmBase> invoke(T mergeFirst, T mergeSecond) throws MergeException;
+
+ /**
+ * Merges mergeSecond into mergeFirst.
+ * Returns a set of CdmBases that became orphant during the merge process and
+ * therefore must be deleted from a persistent context.
+ * @param <T>
+ * @param mergeFirst
+ * @param mergeSecond
+ * @param clonedObjects a set of objects that needed to be cloned during merge.
+ * This set will be filled during merge and should preferably be empty at the beginning
+ * @throws MergeException
+ */
+ public <T extends IMergable> Set<ICdmBase> invoke(T mergeFirst, T mergeSecond, Set<ICdmBase> clonedObjects) throws MergeException;
+
+ /**
+ * If set to true the merge will only reallocate all references that point
+ * to the second entity to the first entity. All data attached to the
+ * second entity will be completely lost. All data attached to the first
+ * entity will be saved as it is. All other {@link MergeMode} information will
+ * be neglected.<BR>
+ * The second entity will finally be deleted.
+ *
+ * #see {@link #setOnlyReallocateLinks(boolean)}
+ */
+ public boolean isOnlyReallocateReferences();
+
+// Removed as this is not yet implemented in underlying classes
+// /**
+// * Sets the onlyReallocateReferences parameter. See {@link #isOnlyReallocateReferences()}
+// * for the parameters semantics.
+// * @see #isOnlyReallocateReferences()
+// * @param onlyReallocateReferences
+// */
+// public void setOnlyReallocateLinks(boolean onlyReallocateReferences);
+
+}
\ No newline at end of file
extends NonViralNameParserImplRegExBase
implements INonViralNameParser<INonViralName> {
- private static final Logger logger = LogManager.getLogger(NonViralNameParserImpl.class);
+ private static final Logger logger = LogManager.getLogger();
// good intro: http://java.sun.com/docs/books/tutorial/essential/regex/index.html
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.aspectj;
import static org.junit.Assert.assertEquals;
import eu.etaxonomy.cdm.model.name.TaxonNameFactory;
public class PropertyChangeTest implements PropertyChangeListener {
- static Logger logger = LogManager.getLogger(PropertyChangeTest.class);
+ private static final Logger logger = LogManager.getLogger();
private Object lastPropValue;
@Override
public class RankTest extends EntityTestBase {
- private static Logger logger = LogManager.getLogger(RankTest.class);
+ private static final Logger logger = LogManager.getLogger();
private static final UUID uuidEmpire = UUID.fromString("ac470211-1586-4b24-95ca-1038050b618d");
private static final UUID uuidDomain = UUID.fromString("ffca6ec8-8b88-417b-a6a0-f7c992aac19b");
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.model.rights;
import static org.junit.Assert.assertEquals;
/**
* @author n.hoffmann
* @since Mar 9, 2011
- * @version 1.0
*/
public class GroupTest {
private GrantedAuthority grantedAuthority;
private User user;
- /**
- * @throws java.lang.Exception
- */
@Before
public void setUp() throws Exception {
group = Group.NewInstance(groupName);
public class OrderedTermVocabularyTest extends EntityTestBase {
@SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private OrderedTerm otb1;
private OrderedTerm otb2;
public class TermVocabularyTest extends EntityTestBase {
@SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private DefinedTermBase<?> dtb1;
private DefinedTermBase<?> dtb2;
public class TaxonBaseDefaultCacheStrategyTest extends TermTestBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TaxonBaseDefaultCacheStrategyTest.class);
+ private static final Logger logger = LogManager.getLogger();
private final String expectedNameTitleCache = "Abies alba (L.) Mill.";
private final String expectedNameCache = "Abies alba";
public class PolytomousKeyGeneratorTest extends TermTestBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(PolytomousKeyGeneratorTest.class);
+ private static final Logger logger = LogManager.getLogger();
private static final boolean debug = false;
public class DefaultMatchStrategyTest extends TermTestBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DefaultMatchStrategyTest.class);
+ private static final Logger logger = LogManager.getLogger();
private DefaultMatchStrategy matchStrategy;
private IBook book1;
public class DefaultMergeStrategyTest extends TermTestBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DefaultMergeStrategyTest.class);
+ private static final Logger logger = LogManager.getLogger();
private DefaultMergeStrategy bookMergeStrategy;
private Reference book1;
)
public class CdmTestSuite {
+ @SuppressWarnings("unused")
private static final Logger logger = LogManager.getLogger();
// the class remains completely empty,
*/
public abstract class EntityTestBase extends TermTestBase {
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
protected Class<CdmBase> clazzToTest = clazzToTest();
protected Class<CdmBase> clazzToTest(){
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
package eu.etaxonomy.cdm.database;
import java.util.HashMap;
import java.util.Map;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.FileSystemResource;
// @Component
public class DataSourceBeanLoader {
- private static final Logger logger = LogManager.getLogger(DataSourceBeanLoader.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String DATASOURCE_BEANDEF_FILE = "datasources.xml";
// see #8506 private static final String DATASOURCE_BEANDEF_PATH = ConfigFileUtil.getCdmHomeDir().getPath();
userdefinedBeanDefinitionFile = filename;
}
-
- /**
- * @return
- */
public static <T> Map<String, T> loadDataSources(final Class<T> requiredType) {
- Map<String, T> dataSources = new HashMap<String, T>();
+ Map<String, T> dataSources = new HashMap<>();
String path = ""; // commented to avoid compile problems see #8506// DATASOURCE_BEANDEF_PATH + (userdefinedBeanDefinitionFile == null ? DATASOURCE_BEANDEF_FILE : userdefinedBeanDefinitionFile);
logger.info("loading DataSourceBeans from: " + path);
}
return dataSources;
}
-
-}
+}
\ No newline at end of file
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
/**
* @author a.mueller
- *
*/
public class DataSourceNotFoundException extends Exception {
+
private static final long serialVersionUID = 5269129655671736295L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DataSourceNotFoundException.class);
-
- /**
- * @param message
- */
+ private static final Logger logger = LogManager.getLogger();
+
public DataSourceNotFoundException() {
super();
}
-
- /**
- * @param message
- */
+
public DataSourceNotFoundException(String message) {
super(message);
}
- /**
- * @param cause
- */
public DataSourceNotFoundException(Throwable cause) {
super(cause);
}
- /**
- * @param message
- * @param cause
- */
public DataSourceNotFoundException(String message, Throwable cause) {
super(message, cause);
}
-
-}
+}
\ No newline at end of file
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database;
import java.util.Map;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
@Component
public class DataSourceReloader {
- static final Logger logger = LogManager.getLogger(DataSourceReloader.class);
-
private SessionFactory factory;
@Autowired
Map<String, DataSourceInfo> dataSourceInfos = getDataSource().testDataSources(dataSources);
return dataSourceInfos;
}
-
-}
+}
\ No newline at end of file
/**
* Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
package eu.etaxonomy.cdm.database;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
/**
* @author e.-m.lee
* @since 12.01.2010
- *
*/
public class DatabaseSchemaMismatchException extends Exception {
- private static final Logger logger = LogManager.getLogger(DatabaseSchemaMismatchException.class);
-
- /**
- * @param message
- */
- public DatabaseSchemaMismatchException() {
+
+ private static final long serialVersionUID = 4751507323905867076L;
+
+ public DatabaseSchemaMismatchException() {
super();
}
-
- /**
- * @param message
- */
+
public DatabaseSchemaMismatchException(String message) {
super(message);
}
- /**
- * @param cause
- */
public DatabaseSchemaMismatchException(Throwable cause) {
super(cause);
}
- /**
- * @param message
- * @param cause
- */
public DatabaseSchemaMismatchException(String message, Throwable cause) {
super(message, cause);
}
-
-}
+}
\ No newline at end of file
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database;
import java.sql.DatabaseMetaData;
/**
* @author a.mueller
- *
*/
public enum DatabaseTypeEnum {
MySQL(1),
MariaDB(11), //not yet tested
;
+ private static final Logger logger = LogManager.getLogger();
+
// /**
// *
// */
// private static final String P6SPY_DRIVER_CLASS_NAME = "com.p6spy.engine.spy.P6SpyDriver";
- /**
- * Constructor
- * @param i
- */
private DatabaseTypeEnum(int i) {
switch(i)
{
this.dbType = new PostgreSQLDatabaseType(); break;
case 4:
this.dbType = new OracleDatabaseType(); break;
-// case 5:
-// this.dbType = new SqlServer2000DatabaseType(); break;
case 6:
this.dbType = new SqlServer2005DatabaseType(); break;
case 7:
return dbType;
}
- //Logger
- private static final Logger logger = LogManager.getLogger(DatabaseTypeEnum.class);
protected IDatabaseType dbType;
-
- /**
- * @return
- */
public String getName(){
return dbType.getName();
}
- /**
- * @return
- */
public String getDriverClassName(){
// if(useP6Spy){
// return P6SPY_DRIVER_CLASS_NAME;
return dbType.getDataSourceClass();
}
- /**
- * @return
- */
public String getUrl(){
return dbType.getUrlString();
}
- /**
- * @return
- */
public String getHibernateDialectCanonicalName(){
return dbType.getHibernateDialectCanonicalName();
}
- /**
- * @return
- */
public int getDefaultPort(){
return dbType.getDefaultPort();
}
return null;
}
- /**
- * @param metaData
- * @return
- */
public static DatabaseTypeEnum byDatabaseMetaData(DatabaseMetaData metaData) {
if (metaData == null){
return null;
}
return null;
}
-
-
-}
-
+}
\ No newline at end of file
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
/**
* @author AM
* @since 09.06.2008
- * @version 1.0
*/
public enum H2Mode {
EMBEDDED,
IN_MEMORY,
TCP;
- private static final Logger logger = LogManager.getLogger(H2Mode.class);
-
-
+
+ private static final Logger logger = LogManager.getLogger();
+
private static final String embedded = "embedded";
private static final String inMemory = "inMemory";
private static final String tcp = "tcp";
- public String toString(){
+ @Override
+ public String toString(){
if (this.equals(H2Mode.EMBEDDED)){
return embedded;
}else if (this.equals(H2Mode.IN_MEMORY)){
logger.warn("toString for mode not yet implemented");
return "";
}
-
+
}
-
+
public static H2Mode fromString(String modeString){
if (modeString == null){
return null;
return null;
}
}
-
+
}
*
*/
public class LocalH2 extends BasicDataSource {
- private static final Logger logger = LogManager.getLogger(LocalH2.class);
+
+ private static final Logger logger = LogManager.getLogger();
private final String sep = System.getProperty("file.separator");
import java.util.EnumSet;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.HibernateException;
import org.springframework.security.core.Authentication;
* @since Sep 4, 2012
*/
public class PermissionDeniedException extends HibernateException {
+
private static final long serialVersionUID = 6993452039967589921L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(PermissionDeniedException.class);
+ private static final Logger logger = LogManager.getLogger();
- /**
- * @param message
- */
public PermissionDeniedException(String message) {
super(message);
}
+ "' on " + entity.getClass().getSimpleName() + "[uuid:" + entity.getUuid() + "', toString:'" + entity.toString() + "']");
}
- /**
- * @param authentication
- * @param roles
- */
public PermissionDeniedException(Authentication authentication, Role[] roles) {
super("Permission denied for '" + authentication.getName()
+ "' none of the roles '" + roles + "' found in authentication.");
}
- /**
- * @param cause
- */
public PermissionDeniedException(Throwable cause) {
super(cause);
}
- /**
- * @param message
- * @param cause
- */
public PermissionDeniedException(String message, Throwable cause) {
super(message, cause);
}
-
-}
+}
\ No newline at end of file
*/
@Component
public class PersistentTermInitializer extends DefaultTermInitializer {
- private static final Logger logger = LogManager.getLogger(PersistentTermInitializer.class);
+
+ private static final Logger logger = LogManager.getLogger();
private boolean omit = false;
- protected ITermVocabularyDao vocabularyDao;
+ private ITermVocabularyDao vocabularyDao;
- protected PlatformTransactionManager transactionManager;
- protected DefaultTransactionDefinition txDefinition = new DefaultTransactionDefinition();
+ private PlatformTransactionManager transactionManager;
+ private DefaultTransactionDefinition txDefinition = new DefaultTransactionDefinition();
public PersistentTermInitializer() {
txDefinition.setName("PersistentTermInitializer.initialize()");
import javax.sql.DataSource;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.cache.spi.RegionFactory;
import org.springframework.beans.factory.config.BeanDefinition;
//FIXME this class replicates lots of code in CdmDataSourceBase, we may want to merge it
//in a common helper class to avoid redundant code
public class WrappedCdmDataSource implements ICdmDataSource {
- private static final Logger logger = LogManager.getLogger(WrappedCdmDataSource.class);
+ private static final Logger logger = LogManager.getLogger();
private final DataSource datasource;
private Connection connection;
-
public WrappedCdmDataSource(DataSource datasource) {
if (datasource == null){
throw new NullPointerException("datasource must not be null for WrappedCdmDataSource");
this.datasource = datasource;
}
- /**
- * {@inheritDoc}
- */
@Override
public Connection getConnection() throws SQLException {
if (this.connection == null){
throw new UnsupportedOperationException("getHibernatePropertiesBean() not supported by WrappedCdmDataSource");
}
- /**
- * {@inheritDoc}
- */
@Override
public BeanDefinition getHibernatePropertiesBean(DbSchemaValidation hbm2dll,
HibernateConfiguration hibernateConfig) {
}
}
- /**
- * @param dbType
- * @param jdbcUrl
- * @return
- * @throws URISyntaxException
- */
private String getDatabaseFrom(String jdbcUrl) throws URISyntaxException {
DatabaseTypeEnum type = DatabaseTypeEnum.byConnectionString(jdbcUrl);
if (type == null){
throw new RuntimeException(e);
}
}
-
-}
+}
\ No newline at end of file
*/
public class H2DatabaseType extends DatabaseTypeBase {
- private static final Logger logger = LogManager.getLogger(H2DatabaseType.class);
+ private static final Logger logger = LogManager.getLogger();
//typeName
private final String typeName = "H2 Database";
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.database.types;\r
-\r
-import javax.sql.DataSource;\r
-\r
-import org.hibernate.dialect.Dialect;\r
-\r
-import eu.etaxonomy.cdm.database.ICdmDataSource;\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 17.12.2008\r
- * @version 1.0\r
- */\r
-public interface IDatabaseType {\r
- /**\r
- * @return\r
- */\r
- public String getName();\r
- /**\r
- * @return\r
- */\r
- public String getClassString();\r
- /**\r
- * @return\r
- */\r
- public String getUrlString();\r
- /**\r
- * @return\r
- */\r
- public int getDefaultPort();\r
- \r
- /**\r
- * Returns the {@link Dialect hibernate dialect}\r
- * @return\r
- */\r
- public Dialect getHibernateDialect();\r
- \r
- /**\r
- * Returns the canoncial (full path) name of the {@link Dialect hibernate dialect} class\r
- * @return\r
- */\r
- public String getHibernateDialectCanonicalName();\r
- \r
- /**\r
- * Returns the connection String for the given parameters, using default port\r
- * @param cdmDataSource represents a datasource\r
- * @return the connection String\r
- */\r
- public String getConnectionString(ICdmDataSource cdmDataSource);\r
-\r
-\r
- /**\r
- * Returns the DataSource class that that the datasource needs to create a spring bean\r
- * @return the DataSource class\r
- */\r
- public Class<? extends DataSource> getDataSourceClass();\r
- \r
- \r
- /**\r
- * Returns the Name of the initialization method to be used when a hibernate datasource is created for this database\r
- * @return String name of the init method\r
- */\r
- public String getInitMethod();\r
- \r
- /**\r
- * Returns the Name of the destroying method to be used when a hibernate datasource representing this database is destroyed\r
- * @return String name of the destroy method\r
- */\r
- public String getDestroyMethod();\r
-\r
- /**\r
- * Returns the server name for a given connection string. Null or empty string is returned if the \r
- * connection string is invalid\r
- * @param connectionString the connection string\r
- * @return string representing the server\r
- */\r
- public String getServerNameByConnectionString(String connectionString);\r
- \r
- \r
- /**\r
- * Returns the port for a given connection string. If no port is defined the default port is returned.\r
- * If connection string is <code>null</code> or unvalid -1 is returned \r
- * @param connectionString the connection string\r
- * @return int representing the port number\r
- */\r
- public int getPortByConnectionString(String connectionString);\r
- \r
- \r
- /**\r
- * Returns the database name for a given connection string. Null or empty string is returned if the \r
- * connection string is invalid\r
- * @param connectionString the connection string\r
- * @return string representing the database\r
- */\r
- public abstract String getDatabaseNameByConnectionString(String connectionString);\r
-}
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+
+package eu.etaxonomy.cdm.database.types;
+
+import javax.sql.DataSource;
+
+import org.hibernate.dialect.Dialect;
+
+import eu.etaxonomy.cdm.database.ICdmDataSource;
+
+/**
+ * @author a.mueller
+ * @since 17.12.2008
+
+ */
+public interface IDatabaseType {
+
+ public String getName();
+
+ public String getClassString();
+
+ public String getUrlString();
+
+ public int getDefaultPort();
+
+ /**
+ * Returns the {@link Dialect hibernate dialect}
+ */
+ public Dialect getHibernateDialect();
+
+ /**
+ * Returns the canoncial (full path) name of the {@link Dialect hibernate dialect} class
+ */
+ public String getHibernateDialectCanonicalName();
+
+ /**
+ * Returns the connection String for the given parameters, using default port
+ * @param cdmDataSource represents a datasource
+ * @return the connection String
+ */
+ public String getConnectionString(ICdmDataSource cdmDataSource);
+
+
+ /**
+ * Returns the DataSource class that that the datasource needs to create a spring bean
+ * @return the DataSource class
+ */
+ public Class<? extends DataSource> getDataSourceClass();
+
+
+ /**
+ * Returns the Name of the initialization method to be used when a hibernate datasource is created for this database
+ * @return String name of the init method
+ */
+ public String getInitMethod();
+
+ /**
+ * Returns the Name of the destroying method to be used when a hibernate datasource representing this database is destroyed
+ * @return String name of the destroy method
+ */
+ public String getDestroyMethod();
+
+ /**
+ * Returns the server name for a given connection string. Null or empty string is returned if the
+ * connection string is invalid
+ * @param connectionString the connection string
+ * @return string representing the server
+ */
+ public String getServerNameByConnectionString(String connectionString);
+
+ /**
+ * Returns the port for a given connection string. If no port is defined the default port is returned.
+ * If connection string is <code>null</code> or unvalid -1 is returned
+ * @param connectionString the connection string
+ * @return int representing the port number
+ */
+ public int getPortByConnectionString(String connectionString);
+
+ /**
+ * Returns the database name for a given connection string. Null or empty string is returned if the
+ * connection string is invalid
+ * @param connectionString the connection string
+ * @return string representing the database
+ */
+ public abstract String getDatabaseNameByConnectionString(String connectionString);
+}
\ No newline at end of file
import java.util.List;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
* @since 2016-10-18
*/
public class IndexAdder extends SchemaUpdaterStepBase {
- private static final Logger logger = LogManager.getLogger(IndexAdder.class);
+
+ private static final Logger logger = LogManager.getLogger();
private String tableName;
import java.sql.SQLException;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
*
*/
public class IndexRenamer extends SchemaUpdaterStepBase {
- private static final Logger logger = LogManager.getLogger(IndexRenamer.class);
+
+ private static final Logger logger = LogManager.getLogger();
private String tableName;
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
*/
public class RelationSwapper extends AuditedSchemaUpdaterStepBase {
- private static final Logger logger = LogManager.getLogger(RelationSwapper.class);
+ private static final Logger logger = LogManager.getLogger();
private static final int PLACEHOLDER = -987;
import java.sql.SQLException;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
implements ISchemaUpdater {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdaterBase.class);
+ private static final Logger logger = LogManager.getLogger();
public static final boolean INCLUDE_AUDIT = true;
protected static final boolean INCLUDE_CDM_BASE = true;
import java.util.UUID;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.joda.time.DateTime;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
* @since 13.09.2010
*/
public abstract class SchemaUpdaterStepBase implements ISchemaUpdaterStep {
- private static final Logger logger = LogManager.getLogger(SchemaUpdaterStepBase.class);
+
+ private static final Logger logger = LogManager.getLogger();
protected String stepName;
*
*/
public class SimpleSchemaUpdaterStep extends SchemaUpdaterStepBase {
- private static final Logger logger = LogManager.getLogger(SimpleSchemaUpdaterStep.class);
+ private static final Logger logger = LogManager.getLogger();
private final Map<DatabaseTypeEnum, String> queryMap = new HashMap<>();
private final Map<DatabaseTypeEnum, String> auditQueryMap = new HashMap<>();
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
public class SingleTermUpdater extends SchemaUpdaterStepBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SingleTermUpdater.class);
+ private static final Logger logger = LogManager.getLogger();
// **************************** FACTORY METHODS ********************************/
*/
public class SortIndexUpdater extends SchemaUpdaterStepBase {
- private static final Logger logger = LogManager.getLogger(SortIndexUpdater.class);
+ private static final Logger logger = LogManager.getLogger();
private final String tableName;
private final String sortIndexColumn;
import java.util.List;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
* @since 16.09.2010
*/
public class TableCreator extends AuditedSchemaUpdaterStepBase {
- private static final Logger logger = LogManager.getLogger(TableCreator.class);
+
+ private static final Logger logger = LogManager.getLogger();
private static final boolean IS_LIST = true;
private static final boolean IS_1_TO_M = true;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
public class TableDropper
extends AuditedSchemaUpdaterStepBase{
- private static final Logger logger = LogManager.getLogger(TableDropper.class);
+ private static final Logger logger = LogManager.getLogger();
private boolean ifExists = true;
import java.sql.SQLException;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
public class TableNameChanger
extends SchemaUpdaterStepBase{
- private static final Logger logger = LogManager.getLogger(TableNameChanger.class);
+ private static final Logger logger = LogManager.getLogger();
private String oldName;
private String newName;
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
*/
public class TermMover extends SchemaUpdaterStepBase{
- private static final Logger logger = LogManager.getLogger(TermMover.class);
+ private static final Logger logger = LogManager.getLogger();
public static final TermMover NewInstance(List<ISchemaUpdaterStep> stepList, String stepName, UUID newVocabulary, String uuidTerm){
List<String> terms = new ArrayList<>();
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
public class TermRepresentationAdder
extends SchemaUpdaterStepBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TermRepresentationAdder.class);
-
public static final TermRepresentationAdder NewInstance(List<ISchemaUpdaterStep> stepList, String stepName, UUID uuidTerm, String description, String label, String abbrev, UUID uuidLanguage){
return new TermRepresentationAdder(stepList, stepName, uuidTerm, description, label, abbrev, uuidLanguage, false);
}
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
public class TermRepresentationUpdater
extends SchemaUpdaterStepBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TermRepresentationUpdater.class);
-
public static final TermRepresentationUpdater NewInstance(List<ISchemaUpdaterStep> stepList,
String stepName, UUID uuidTerm, String description, String label, String abbrev,
UUID uuidLanguage){
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
public class TreeIndexUpdater
extends AuditedSchemaUpdaterStepBase {
- private static final Logger logger = LogManager.getLogger(TreeIndexUpdater.class);
+ private static final Logger logger = LogManager.getLogger();
private String indexColumnName = "treeIndex";
private final String treeIdColumnName;
import java.sql.SQLException;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.DatabaseTypeEnum;
*/
public class UniqueIndexDropper extends AuditedSchemaUpdaterStepBase {
- private static final Logger logger = LogManager.getLogger(UniqueIndexDropper.class);
+ private static final Logger logger = LogManager.getLogger();
private final String indexColumn;
import java.sql.SQLException;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
public abstract class UpdaterBase<T extends ISchemaUpdaterStep, U extends IUpdater<U>>
implements IUpdater<U> {
- private static final Logger logger = LogManager.getLogger(UpdaterBase.class);
+ private static final Logger logger = LogManager.getLogger();
protected List<T> list;
protected String startVersion;
import java.util.UUID;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
public class VocabularyCreator extends SchemaUpdaterStepBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(VocabularyCreator.class);
+ private static final Logger logger = LogManager.getLogger();
// **************************** STATIC METHODS ********************************/
* @since 25.04.2016
*/
public class ReferencedObjTypeUpdater extends SchemaUpdaterStepBase{
- private static final Logger logger = LogManager.getLogger(ReferencedObjTypeUpdater.class);
+
+ private static final Logger logger = LogManager.getLogger();
private static final String stepName = "Update referenced obj_type";
*/
public class SchemaUpdater_31_33 extends SchemaUpdaterBase {
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_31_33.class);
+ private static final Logger logger = LogManager.getLogger();
+
private static final String startSchemaVersion = "3.0.1.0.201104190000";
private static final String endSchemaVersion = "3.3.0.0.201309240000";
import java.sql.SQLException;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.CaseType;
*
*/
public class NomStatusInvalidUpdater extends SchemaUpdaterStepBase{
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(NomStatusInvalidUpdater.class);
- /**
- * @return
- */
+ private static final String stepName = "Update 'invalid' status with wrong nomenclatural code";
+
public static NomStatusInvalidUpdater NewInstance(List<ISchemaUpdaterStep> stepList) {
return new NomStatusInvalidUpdater(stepList);
}
- private static final String stepName = "Update 'invalid' status with wrong nomenclatural code";
-
- /**
- * @param stepName
- */
protected NomStatusInvalidUpdater(List<ISchemaUpdaterStep> stepList) {
super(stepList, stepName);
}
-
-
@Override
public void invoke(ICdmDataSource datasource, IProgressMonitor monitor,
CaseType caseType, SchemaUpdateResult result) throws SQLException {
String botIdSql = String.format(statusSql, defTerm, botUuid);
Number botId = (Number)datasource.getSingleValue(botIdSql);
-
String sqlUpdate = "UPDATE @@NomenclaturalStatus@@ " +
" SET type_id = %d " +
" WHERE id IN ( " +
String zooUpdate = String.format(sqlUpdate, zooId, botUuid, "= 'ZoologicalName'");
n = n + datasource.executeUpdate(zooUpdate);
}
-
-
} catch (Exception e) {
String message = e.getMessage();
monitor.warning(message, e);
return;
}
-
-}
+}
\ No newline at end of file
import java.sql.SQLException;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.SchemaUpdaterStepBase;
import eu.etaxonomy.cdm.model.name.NomenclaturalCode;
-
/**
* Updates the CdmPreference NomenclaturalCode #3658
*
* @since 13.10.2016
*/
public class NomenclaturalCodeUpdater extends SchemaUpdaterStepBase {
- private static final Logger logger = LogManager.getLogger(NomenclaturalCodeUpdater.class);
+
+ private static final Logger logger = LogManager.getLogger();
private static final String stepName = "Update nomenclatural code";
import java.sql.SQLException;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.CaseType;
*
*/
public class OrphanedKeyStatementRemover extends SchemaUpdaterStepBase{
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(OrphanedKeyStatementRemover.class);
- /**
- * @return
- */
+ private static final String stepName = "Remove orphaned key statements";
+
public static OrphanedKeyStatementRemover NewInstance(List<ISchemaUpdaterStep> stepList) {
return new OrphanedKeyStatementRemover(stepList);
}
- private static final String stepName = "Remove orphaned key statements";
-
- /**
- * @param stepName
- */
protected OrphanedKeyStatementRemover(List<ISchemaUpdaterStep> stepList) {
super(stepList, stepName);
}
int id = rs.getInt("id");
handleSingleStatement(id, datasource, monitor, caseType, result);
}
-
-
} catch (Exception e) {
String message = e.getMessage();
monitor.warning(message, e);
return;
}
- /**
- * @param id
- * @param datasource
- * @param monitor
- * @param caseType
- * @param result
- * @throws SQLException
- */
private void handleSingleStatement(int keyStatementId, ICdmDataSource datasource, IProgressMonitor monitor, CaseType caseType,
SchemaUpdateResult result) throws SQLException {
String selectSQL = " SELECT MN.label_id id" +
String deleteKeyStatement = "DELETE FROM @@KeyStatement@@ WHERE id = " + keyStatementId;
deleteKeyStatement = caseType.replaceTableNames(deleteKeyStatement);
datasource.executeUpdate(deleteKeyStatement);
-
}
-
-}
+}
\ No newline at end of file
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.CaseType;
import eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType;
import eu.etaxonomy.cdm.model.term.TermType;
-
/**
* Updates the pro parte and partial synonyms. Makes them real concept relationships
* #7334
* @since 11.05.2018
*/
public class ProParteSynonymUpdater extends SchemaUpdaterStepBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(ProParteSynonymUpdater.class);
private static final String stepName = "Make pro parte synonyms concept relationships";
-
// **************************** STATIC METHODS ********************************/
public static final ProParteSynonymUpdater NewInstance(List<ISchemaUpdaterStep> stepList){
return createRelType(datasource, monitor, caseType, result,
uuidTerm, symbol, description, uuidAfterTerm,
reverseDescription, reverseAbbrev);
-
}
private int createRelType(ICdmDataSource datasource, IProgressMonitor monitor, CaseType caseType,
return id;
}
-
private void invokeSingle(boolean isPartial, int typeId, ICdmDataSource datasource, IProgressMonitor monitor,
CaseType caseType, SchemaUpdateResult result){
result.addException(e, "Error occurred when trying to update proParte/partial synonyms",
this, "invokeSingle");
}
-
}
-
- /**
- * @param titleCache
- * @return
- */
private String normalizeTitleCache(String titleCache) {
if(titleCache == null){
return "";
query = query.replaceAll("@TRUE@", getBoolean(true, datasource));
return query;
}
-
-}
+}
\ No newline at end of file
public class SchemaUpdater_40_41 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_40_41.class);
+ private static final Logger logger = LogManager.getLogger();
+
private static final String endSchemaVersion = "4.1.0.0.201607300000";
private static final String startSchemaVersion = "4.0.0.0.201604200000";
public class SchemaUpdater_41_47 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_41_47.class);
+ private static final Logger logger = LogManager.getLogger();
+
private static final String startSchemaVersion = "4.1.0.0.201607300000";
private static final String endSchemaVersion = "4.7.0.0.201710040000";
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.update.v40_50;
import java.util.ArrayList;
import eu.etaxonomy.cdm.database.update.TableNameChanger;
import eu.etaxonomy.cdm.database.update.TermRepresentationUpdater;
-/**
/**
* @author a.mueller
* @date 09.06.2017
- *
*/
public class SchemaUpdater_47_50 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_47_50.class);
+ private static final Logger logger = LogManager.getLogger();
+
private static final String endSchemaVersion = "5.0.0.0.20180514";
private static final String startSchemaVersion = "4.7.0.0.201710040000";
return new SchemaUpdater_47_50();
}
- /**
- * @param startSchemaVersion
- * @param endSchemaVersion
- */
protected SchemaUpdater_47_50() {
super(startSchemaVersion, endSchemaVersion);
}
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.CaseType;
public class SynonymDeduplicator
extends SchemaUpdaterStepBase{
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SynonymDeduplicator.class);
+ private static final String stepName = "Deduplicate synonyms code";
- /**
- * @return
- */
public static SynonymDeduplicator NewInstance(List<ISchemaUpdaterStep> stepList) {
return new SynonymDeduplicator(stepList);
}
- private static final String stepName = "Deduplicate synonyms code";
-
- /**
- * @param stepList
- * @param stepName
- */
protected SynonymDeduplicator(List<ISchemaUpdaterStep> stepList) {
super(stepList, stepName);
}
Integer oldExtensionId = rs.getInt(1);
cloneExtension(newSynonymId, oldExtensionId, mnTableName, mnCol, datasource, caseType, tableName, specificParams, withSortIndex ? sortIndex : null);
}
-
}
- /**
- * @param id
- * @param caseType
- * @throws SQLException
- */
private void cloneExtension(Integer newSynonymId, Integer oldExtensionId, String mnTableName, String mnCol, ICdmDataSource datasource, CaseType caseType,
String tableName, String specificParams, Integer sortIndex) throws SQLException {
.replace("@sortIndexValue", sortIndexValueStr)
;
datasource.executeUpdate(insertMNSql);
-
}
-}
+}
\ No newline at end of file
* @since 05.05.2018
*/
public class VocabularyOrderUpdater extends SchemaUpdaterStepBase {
+
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(VocabularyOrderUpdater.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String stepName = "Update vocabulary order";
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
public class FeatureTreeMover extends SchemaUpdaterStepBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(FeatureTreeMover.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String stepName = "Move FeatureTree to TermCollection";
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.update.v505_508;
import java.util.ArrayList;
public class SchemaUpdater_55_58 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_55_58.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String startSchemaVersion = "5.5.0.0.20190221";
private static final String endSchemaVersion = "5.8.0.0.201906020";
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ColumnAdder;
import eu.etaxonomy.cdm.database.update.ColumnNameChanger;
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
*/
public class SchemaUpdater_581_582 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_581_582.class);
-
private static final String endSchemaVersion = "5.8.2.0.20190815";
private static final String startSchemaVersion = "5.8.1.0.20190813";
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ColumnAdder;
import eu.etaxonomy.cdm.database.update.ColumnNameChanger;
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
*/
public class SchemaUpdater_58_581 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_58_581.class);
-
private static final String endSchemaVersion = "5.8.1.0.20190813";
private static final String startSchemaVersion = "5.8.0.0.201906020";
return new SchemaUpdater_58_581();
}
- /**
- * @param startSchemaVersion
- * @param endSchemaVersion
- */
protected SchemaUpdater_58_581() {
super(startSchemaVersion, endSchemaVersion);
}
return stepList;
}
- /**
- * @param stepList
- * @param string
- */
private void addExternalDataHandler(List<ISchemaUpdaterStep> stepList, String tableName) {
//Add "lastRetrieved"
String stepName = "Add 'lastRetrieved' to " + tableName;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
/**
* @author a.mueller
* @since 12.08.2019
- *
*/
public class UsernameRegexAdapter extends SchemaUpdaterStepBase {
-
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(UsernameRegexAdapter.class);
-
private static final String stepName = "Adapt username to username regex";
-
public static final UsernameRegexAdapter NewInstance(List<ISchemaUpdaterStep> stepList){
UsernameRegexAdapter result = new UsernameRegexAdapter(stepList);
return result;
doForTable(datasource, monitor, caseType, result, "PermissionGroup", "name");
}
- /**
- * @param datasource
- * @param monitor
- * @param caseType
- * @param result
- * @param tableName
- * @param attribute
- * @throws SQLException
- */
private void doForTable(ICdmDataSource datasource, IProgressMonitor monitor, CaseType caseType,
SchemaUpdateResult result, String tableName, String attribute) throws SQLException {
tableName = caseType.transformTo(tableName);
}
}
}
-
-}
+}
\ No newline at end of file
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ColumnAdder;
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
*/
public class SchemaUpdater_5111_5112 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5111_5112.class);
-
private static final String startSchemaVersion = "5.11.1.0.20191108";
private static final String endSchemaVersion = "5.11.2.0.20191109";
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.update.v508_511;
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ColumnAdder;
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
*/
public class SchemaUpdater_511_5111 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_511_5111.class);
-
private static final String startSchemaVersion = "5.11.0.0.20191104";
private static final String endSchemaVersion = "5.11.1.0.20191108";
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.update.v508_511;
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ColumnAdder;
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
*/
public class SchemaUpdater_582_511 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_582_511.class);
-
private static final String endSchemaVersion = "5.11.0.0.20191104";
private static final String startSchemaVersion = "5.8.2.0.20190815";
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.update.v50_55;
import java.util.ArrayList;
import eu.etaxonomy.cdm.database.update.v40_50.SchemaUpdater_47_50;
import eu.etaxonomy.cdm.model.term.TermType;
-/**
/**
* @author a.mueller
* @date 09.06.2017
public class SchemaUpdater_50_55 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_50_55.class);
+ private static final Logger logger = LogManager.getLogger();
+
private static final String startSchemaVersion = "5.0.0.0.20180514";
private static final String endSchemaVersion = "5.5.0.0.20190221";
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ColumnTypeChanger;
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
*/
public class SchemaUpdater_5112_5120 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5112_5120.class);
-
private static final String endSchemaVersion = "5.12.0.0.20191202";
private static final String startSchemaVersion = "5.11.2.0.20191109";
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.CaseType;
*/
public class Reference2SourceMover extends SchemaUpdaterStepBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(Reference2SourceMover.class);
-
private final String tableName;
private final String citationsIdAttr;
private final String detailAttr;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.update.v512_515;
import java.util.ArrayList;
public class SchemaUpdater_5120_5150 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5120_5150.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_12_00;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_15_00;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.update.v512_515;
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ColumnRemover;
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
*/
public class SchemaUpdater_5150_5151 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5150_5151.class);
-
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_15_00;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_15_01;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.update.v512_515;
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ColumnAdder;
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
*/
public class SchemaUpdater_5151_5152 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5151_5152.class);
-
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_15_01;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_15_02;
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.CaseType;
*/
public class OriginalSpellingMover extends SchemaUpdaterStepBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(OriginalSpellingMover.class);
-
private static final String stepName = "Move original spelling to nomenclatural source";
public static final OriginalSpellingMover NewInstance(List<ISchemaUpdaterStep> stepList){
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.CaseType;
*/
public class ProtologMover extends SchemaUpdaterStepBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(ProtologMover.class);
-
private static final String stepName = "Move protologues to nomenclatural source";
public static final ProtologMover NewInstance(List<ISchemaUpdaterStep> stepList){
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.CaseType;
*/
public class RecommendedMeasurementUnitAdder extends SchemaUpdaterStepBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(RecommendedMeasurementUnitAdder.class);
-
private final UUID uuidFeature;
private final UUID uuidUnit;
public class SchemaUpdater_5152_5180 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5152_5180.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_15_02;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_18_00;
public class SchemaUpdater_5180_5181 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5180_5181.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_18_00;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_18_01;
public class SchemaUpdater_5181_5182 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5181_5182.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_18_01;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_18_02;
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
*/
public class SchemaUpdater_5182_5183 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5182_5183.class);
-
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_18_02;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_18_03;
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
*/
public class SchemaUpdater_5183_5184 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5183_5184.class);
-
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_18_03;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_18_04;
public class SchemaUpdater_5184_5185 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5184_5185.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_18_04;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_18_05;
public class SchemaUpdater_5185_5186 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5185_5186.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_18_05;
//FIXME
public class SchemaUpdater_5186_5220 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5186_5220.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_18_06;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_22_00;
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
import eu.etaxonomy.cdm.database.ICdmDataSource;
import eu.etaxonomy.cdm.database.update.CaseType;
*/
public class SecReference2SourceMover extends SchemaUpdaterStepBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SecReference2SourceMover.class);
-
private final String tableName;
private final String citationsIdAttr;
private final String detailAttr;
public class SchemaUpdater_5220_5230 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5220_5230.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_22_00;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_23_00;
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ColumnAdder;
import eu.etaxonomy.cdm.database.update.ColumnTypeChanger;
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
*/
public class SchemaUpdater_5230_5250 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5230_5250.class);
-
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_23_00;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_25_00;
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ColumnAdder;
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
*/
public class SchemaUpdater_5250_5251 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5250_5251.class);
-
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_25_00;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_25_01;
public class SchemaUpdater_5251_5270 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5251_5270.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_25_01;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_27_00;
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
*/
public class SchemaUpdater_5270_5271 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5270_5271.class);
-
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_27_00;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_27_01;
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.database.update.ISchemaUpdater;
import eu.etaxonomy.cdm.database.update.ISchemaUpdaterStep;
import eu.etaxonomy.cdm.database.update.SchemaUpdaterBase;
*/
public class SchemaUpdater_5271_5290 extends SchemaUpdaterBase {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5271_5290.class);
-
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_27_01;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_29_00;
public class SchemaUpdater_5290_5320 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5290_5320.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_29_00;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_32_00;
public class SchemaUpdater_5320_5330 extends SchemaUpdaterBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SchemaUpdater_5320_5330.class);
+ private static final Logger logger = LogManager.getLogger();
private static final CdmVersion startSchemaVersion = CdmVersion.V_05_32_00;
private static final CdmVersion endSchemaVersion = CdmVersion.V_05_33_00;
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.persistence.dao;
import java.lang.reflect.Method;
-
/**
* @author n.hoffmann
* @since Mar 11, 2010
- * @version 1.0
*/
public interface IMethodCache {
/**
* Returns the method that is suitable for the given class and parameter type or
* null if no such method exists.
- *
- * @param clazz
- * @param methodName
- * @param parameterType
- * @return
*/
public Method getMethod(Class clazz, String methodName, Class parameterType);
-}
+}
\ No newline at end of file
/**
* A read-only interface to allow querying across all IIdentificationKey instances, regardless of type
* @author ben.clark
- * @version 1.0
* @since 21-Dec-2009 13:48:10
*/
public interface IIdentificationKeyDao {
-
/**
* Returns a sublist of IIdentificationKey instances stored in the database. A maximum
* of 'limit' objects are returned, starting at object with index 'start'.
-/**\r
-* Copyright (C) 2007 EDIT\r
-* European Distributed Institute of Taxonomy \r
-* http://www.e-taxonomy.eu\r
-* \r
-* The contents of this file are subject to the Mozilla Public License Version 1.1\r
-* See LICENSE.TXT at the top of this package for the full license terms.\r
-*/\r
-\r
-package eu.etaxonomy.cdm.persistence.dao.description;\r
-\r
-import java.util.List;\r
-\r
-import eu.etaxonomy.cdm.model.description.PolytomousKey;\r
-import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;\r
-import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;\r
-\r
-/**\r
- * @author a.mueller\r
- * @since 08.11.2010\r
- * @version 1.0\r
- */\r
-public interface IPolytomousKeyDao extends IIdentifiableDao<PolytomousKey> {\r
- \r
- public List<PolytomousKey> list();\r
- \r
- public void loadNodes(PolytomousKeyNode root, List<String> nodePaths);\r
-}\r
+/**
+* Copyright (C) 2007 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
+package eu.etaxonomy.cdm.persistence.dao.description;
+
+import java.util.List;
+
+import eu.etaxonomy.cdm.model.description.PolytomousKey;
+import eu.etaxonomy.cdm.model.description.PolytomousKeyNode;
+import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;
+
+/**
+ * @author a.mueller
+ * @since 08.11.2010
+ */
+public interface IPolytomousKeyDao extends IIdentifiableDao<PolytomousKey> {
+
+ public List<PolytomousKey> list();
+
+ public void loadNodes(PolytomousKeyNode root, List<String> nodePaths);
+}
\ No newline at end of file
*/
package eu.etaxonomy.cdm.persistence.dao.hibernate;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.collection.spi.PersistentCollection;
import org.hibernate.envers.internal.entities.mapper.relation.lazy.proxy.CollectionProxy;
public class HibernateBeanInitializer<CDM extends CdmBase> extends AbstractBeanInitializer<CDM>{
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(HibernateBeanInitializer.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public Object initializeInstance(Object bean) {
implements IAnnotatableDao<T> {
@SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
public AnnotatableDaoBaseImpl(Class<T> type) {
super(type);
import java.util.Optional;
import java.util.Set;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.lucene.search.Sort;
import org.apache.lucene.search.SortField;
import org.hibernate.Criteria;
public abstract class DaoBase {
- final static Logger logger = LogManager.getLogger(DaoBase.class);
+ private static final Logger logger = LogManager.getLogger();
public final static boolean NO_UNPUBLISHED = false; //constant for unpublished
public final static boolean INCLUDE_UNPUBLISHED = true; //constant for unpublished
* @author a.mueller
*/
public class DeduplicationHelper {
- private static final Logger logger = LogManager.getLogger(DeduplicationHelper.class);
+
+ private static final Logger logger = LogManager.getLogger();
private final SessionImpl session;
private final CdmGenericDaoImpl genericDao;
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
implements IIdentifiableDao<T>{
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(IdentifiableDaoBase.class);
+ private static final Logger logger = LogManager.getLogger();
protected String defaultField = "titleCache_tokenized";
protected Class<? extends T> indexedClasses[];
/**
* Copyright (C) 2008 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
*/
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Criteria;
import org.springframework.stereotype.Repository;
* @since 12.09.2008
*/
@Repository
-public class LanguageStringDaoImpl
+public class LanguageStringDaoImpl
extends LanguageStringBaseDaoImpl<LanguageString> implements ILanguageStringDao {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(LanguageStringDaoImpl.class);
+
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
public LanguageStringDaoImpl() {
- super(LanguageString.class);
+ super(LanguageString.class);
}
- public List<LanguageString> getAllLanguageStrings(Integer limit, Integer start) {
+ @Override
+ public List<LanguageString> getAllLanguageStrings(Integer limit, Integer start) {
Criteria crit = getSession().createCriteria(LanguageString.class);
List<LanguageString> results = crit.list();
return results;
import java.util.UUID;
import org.apache.commons.lang3.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.query.Query;
import org.springframework.stereotype.Repository;
public class RightsDaoImpl extends LanguageStringBaseDaoImpl<Rights> implements IRightsDao {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(RightsDaoImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public RightsDaoImpl(Class rightsClass) {
super(rightsClass);
import java.util.Set;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.criterion.Criterion;
import org.hibernate.envers.query.AuditEntity;
import org.hibernate.envers.query.AuditQuery;
import eu.etaxonomy.cdm.persistence.query.MatchMode;
import eu.etaxonomy.cdm.persistence.query.OrderHint;
-public abstract class VersionableDaoBase<T extends VersionableEntity> extends CdmEntityDaoBase<T> implements IVersionableDao<T> {
- private static final Logger logger = LogManager.getLogger(VersionableDaoBase.class);
+public abstract class VersionableDaoBase<T extends VersionableEntity>
+ extends CdmEntityDaoBase<T>
+ implements IVersionableDao<T> {
+
+ private static final Logger logger = LogManager.getLogger();
public VersionableDaoBase(Class<T> type) {
super(type);
extends IdentifiableDaoBase<DescriptionBase>
implements IDescriptionDao{
- private static final Logger logger = LogManager.getLogger(DescriptionDaoImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public DescriptionDaoImpl() {
super(DescriptionBase.class);
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import eu.etaxonomy.cdm.persistence.query.OrderHint;
@Repository
-public class DescriptionElementDaoImpl extends AnnotatableDaoBaseImpl<DescriptionElementBase> implements IDescriptionElementDao {
+public class DescriptionElementDaoImpl
+ extends AnnotatableDaoBaseImpl<DescriptionElementBase>
+ implements IDescriptionElementDao {
+
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DescriptionElementDaoImpl.class);
+ private static final Logger logger = LogManager.getLogger();
private final String defaultField = "multilanguageText.text";
import java.util.Set;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
extends IdentifiableDaoBase<DescriptiveDataSet>
implements IDescriptiveDataSetDao {
- private static final Logger logger = LogManager.getLogger(DescriptiveDataSetDao.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ITermTreeDao termTreeDao;
private List<UUID> getNodeUuidsForDescriptiveDataSet(UUID uuid) {
Session session = getSession();
-
+
String queryString = "SELECT t.uuid FROM DescriptiveDataSet a JOIN a.taxonSubtreeFilter as t WHERE a.uuid = :uuid";
Query<UUID> query = session.createQuery(queryString, UUID.class);
query.setParameter("uuid", uuid);
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.query.Query;
public class PrimerDaoHibernateImpl extends AnnotatableDaoBaseImpl<Primer> implements IPrimerDao{
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(PrimerDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public PrimerDaoHibernateImpl() {
super(Primer.class);
*/
package eu.etaxonomy.cdm.persistence.dao.hibernate.molecular;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Repository;
import eu.etaxonomy.cdm.model.molecular.Sequence;
/**
* @author pplitzner
* @since 11.03.2014
- *
*/
@Repository
public class SequenceDaoHibernateImpl extends AnnotatableDaoBaseImpl<Sequence> implements ISequenceDao{
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SequenceDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
- /**
- * @param type
- */
public SequenceDaoHibernateImpl() {
super(Sequence.class);
}
-
-}
+}
\ No newline at end of file
*/
package eu.etaxonomy.cdm.persistence.dao.hibernate.molecular;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Repository;
import eu.etaxonomy.cdm.model.molecular.SingleRead;
/**
* @author pplitzner
* @since 11.03.2014
- *
*/
@Repository
public class SingleReadDaoHibernateImpl extends AnnotatableDaoBaseImpl<SingleRead> implements ISingleReadDao{
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SingleReadDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
- /**
- * @param type
- */
public SingleReadDaoHibernateImpl() {
super(SingleRead.class);
}
-
-}
+}
\ No newline at end of file
* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
*/
-
package eu.etaxonomy.cdm.persistence.dao.hibernate.name;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.query.Query;
import org.springframework.stereotype.Repository;
public class HomotypicalGroupDaoHibernateImpl extends CdmEntityDaoBase<HomotypicalGroup> implements IHomotypicalGroupDao {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(HomotypicalGroupDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public HomotypicalGroupDaoHibernateImpl() {
super(HomotypicalGroup.class);
*/
package eu.etaxonomy.cdm.persistence.dao.hibernate.name;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Repository;
import eu.etaxonomy.cdm.model.name.NomenclaturalStatus;
implements INomenclaturalStatusDao {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(NomenclaturalStatusDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public NomenclaturalStatusDaoHibernateImpl() {
super(NomenclaturalStatus.class);
}
-
-}
+}
\ No newline at end of file
implements IRegistrationDao {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(RegistrationDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public RegistrationDaoHibernateImpl() {
super(Registration.class);
@Qualifier("taxonNameDaoHibernateImpl")
public class TaxonNameDaoHibernateImpl extends IdentifiableDaoBase<TaxonName> implements ITaxonNameDao {
- private static final Logger logger = LogManager.getLogger(TaxonNameDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ITaxonDao taxonDao;
@Autowired
-
private IHomotypicalGroupDao homotypicalGroupDao;
+ @SuppressWarnings("unchecked")
public TaxonNameDaoHibernateImpl() {
super(TaxonName.class);
indexedClasses = new Class[1];
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.query.Query;
import org.springframework.stereotype.Repository;
implements ITypeDesignationDao {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TypeDesignationDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public TypeDesignationDaoHibernateImpl() {
super((Class)(TypeDesignationBase.class));
List<TypeDesignationStatusBase> terms = query.list();
return terms;
}
-}
+}
\ No newline at end of file
import javax.persistence.Tuple;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.Hibernate;
import org.hibernate.Session;
import eu.etaxonomy.cdm.model.view.AuditEvent;
import eu.etaxonomy.cdm.persistence.dao.description.IDescriptionDao;
import eu.etaxonomy.cdm.persistence.dao.hibernate.common.IdentifiableDaoBase;
-import eu.etaxonomy.cdm.persistence.dao.hibernate.taxon.TaxonDaoHibernateImpl;
import eu.etaxonomy.cdm.persistence.dao.name.IHomotypicalGroupDao;
import eu.etaxonomy.cdm.persistence.dao.name.ITaxonNameDao;
import eu.etaxonomy.cdm.persistence.dao.occurrence.IOccurrenceDao;
extends IdentifiableDaoBase<SpecimenOrObservationBase>
implements IOccurrenceDao {
- private static final Logger logger = LogManager.getLogger(TaxonDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private IDescriptionDao descriptionDao;
import java.util.Map;
import java.util.Set;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Order;
implements IOriginalSourceDao {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(OriginalSourceDaoImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public OriginalSourceDaoImpl() {
super(OriginalSourceBase.class);
import java.util.Set;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.Hibernate;
import org.hibernate.Session;
/**
* @author a.mueller
- *
*/
@Repository
@Qualifier("referenceDaoHibernateImpl")
-public class ReferenceDaoHibernateImpl extends IdentifiableDaoBase<Reference> implements IReferenceDao {
- private static final Logger logger = LogManager.getLogger(ReferenceDaoHibernateImpl.class);
+public class ReferenceDaoHibernateImpl
+ extends IdentifiableDaoBase<Reference>
+ implements IReferenceDao {
+
+ private static final Logger logger = LogManager.getLogger();
public ReferenceDaoHibernateImpl() {
super(Reference.class);
private static final int REFERENCE_LINK_RECURSION_DEPTH = 1;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(StatisticsDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public Long countDescriptiveSourceReferences() {
public class TaxonDaoHibernateImpl
extends IdentifiableDaoBase<TaxonBase>
implements ITaxonDao {
+
// private AlternativeSpellingSuggestionParser<TaxonBase> alternativeSpellingSuggestionParser;
- private static final Logger logger = LogManager.getLogger(TaxonDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public TaxonDaoHibernateImpl() {
super(TaxonBase.class);
public class TaxonNodeDaoHibernateImpl extends AnnotatableDaoBaseImpl<TaxonNode>
implements ITaxonNodeDao {
- private static final Logger logger = LogManager.getLogger(TaxonNodeDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
private static final int DEFAULT_SET_SUBTREE_PARTITION_SIZE = 100;
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Session;
import org.hibernate.query.Query;
import org.springframework.beans.factory.InitializingBean;
implements ITaxonGraphDao, InitializingBean {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TaxonGraphDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public TaxonGraphDaoHibernateImpl(IPreferenceDao preferenceDao) {
super(preferenceDao);
extends IdentifiableDaoBase<DefinedTermBase>
implements IDefinedTermDao{
- private static final Logger logger = LogManager.getLogger(DefinedTermDaoImpl.class);
+ private static final Logger logger = LogManager.getLogger();
@SuppressWarnings("unchecked")
public DefinedTermDaoImpl() {
/**
* Copyright (C) 2008 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
*/
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Criteria;
import org.springframework.stereotype.Repository;
* @since 10.09.2008
*/
@Repository
-public class RepresentationDaoImpl
+public class RepresentationDaoImpl
extends LanguageStringBaseDaoImpl<Representation> implements IRepresentationDao {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(RepresentationDaoImpl.class);
+
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
public RepresentationDaoImpl() {
- super(Representation.class);
+ super(Representation.class);
}
- public List<Representation> getAllRepresentations(Integer limit, Integer start) {
+ @Override
+ public List<Representation> getAllRepresentations(Integer limit, Integer start) {
Criteria crit = getSession().createCriteria(Representation.class);
List<Representation> results = crit.list();
return results;
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.query.Query;
public class TermTreeDaoImpl extends IdentifiableDaoBase<TermTree> implements ITermTreeDao{
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TermTreeDaoImpl.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ITermVocabularyDao termVocabularyDao;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
IEntityConstraintViolationDao {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(EntityConstraintViolationHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public EntityConstraintViolationHibernateImpl() {
super(EntityConstraintViolation.class);
import javax.validation.ConstraintViolation;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.query.Query;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;
public class EntityValidationDaoHibernateImpl extends CdmEntityDaoBase<EntityValidation> implements
IEntityValidationDao {
- private static final Logger logger = LogManager.getLogger(EntityValidationDaoHibernateImpl.class);
+ private static final Logger logger = LogManager.getLogger();
public EntityValidationDaoHibernateImpl() {
super(EntityValidation.class);
*/
public abstract class AbstractBeanInitializer<CDM extends CdmBase> implements IBeanInitializer{
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private IMethodCache methodCache;
*/
public class AdvancedBeanInitializer<CDM extends CdmBase> extends HibernateBeanInitializer<CDM> {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ICdmGenericDao genericDao;
import java.sql.SQLException;
import java.sql.Statement;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
/**
* @author ayco_holleman
*/
public class JdbcDaoUtils {
- private static final Logger logger = LogManager.getLogger(JdbcDaoUtils.class);
-
+ private static final Logger logger = LogManager.getLogger();
/**
* Closes a JDBC {@code Statement} while trapping and suppressing any
import javax.sql.DataSource;
import javax.validation.ConstraintViolation;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.joda.time.DateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class EntityValidationCrudJdbcImpl implements IEntityValidationCrud {
- public static final Logger logger = LogManager.getLogger(EntityValidationCrudJdbcImpl.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String SQL_INSERT_VALIDATION_RESULT = "INSERT INTO entityvalidation"
+ "(id, created, uuid, crudeventtype, validatedentityclass, validatedentityid,"
import eu.etaxonomy.cdm.common.AbstractStringComparator;
import eu.etaxonomy.cdm.common.UTF8;
import eu.etaxonomy.cdm.compare.taxon.ITaxonNodeComparator;
-import eu.etaxonomy.cdm.compare.taxon.TaxonNodeByNameComparator;
import eu.etaxonomy.cdm.compare.taxon.TaxonNodeStatusComparator;
import eu.etaxonomy.cdm.model.taxon.TaxonNodeStatus;
private static final String HYBRID_SIGN = UTF8.HYBRID.toString();
- private static final Logger logger = LogManager.getLogger(TaxonNodeByNameComparator.class);
+ private static final Logger logger = LogManager.getLogger();
private boolean ignoreHybridSign = true;
private boolean sortInfraGenericFirst = true;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.persistence.hibernate;
import java.io.Serializable;
* The CrudEvent unifies all CRUD events into one interface.
* Crud as in Create, Retrieve, Update, Delete. This event will only hold CdmBase objects.
*
- *
* @author n.hoffmann
* @since 24.03.2009
*/
public class CdmDataChangeEvent extends AbstractEvent{
+
private static final long serialVersionUID = 9113025682352080372L;
private static final Logger logger = LogManager.getLogger();
*
* @author n.hoffmann
* @since 25.03.2009
- * @version 1.0
*/
public enum EventType {
INSERT, LOAD, UPDATE, DELETE
private final EntityPersister persister;
private final Set<CdmBase> affectedObjects;
-
private final Object[] state;
// for update only
private Object[] oldState;
private final Serializable id;
protected final EventType eventType;
-
private CdmDataChangeEvent(
CdmBase entity,
Serializable id,
EventSource source,
EventType eventType
) {
+
super(source);
this.entity = entity;
this.id = id;
this.eventType = eventType;
this.affectedObjects = null;
}
- /**
- * @param source
- */
+
private CdmDataChangeEvent(
CdmBase entity,
Set<CdmBase> affectedObjects,
return eventType == EventType.DELETE;
}
- /**
- * @param event
- * @return
- */
public static CdmDataChangeEvent NewInstance(AbstractEvent event) {
CdmDataChangeEvent mediationEvent = null;
}
public static CdmDataChangeEvent NewInstance(CdmBase entity, Set<CdmBase> affectedObjects, EventType eventType) {
-
return new CdmDataChangeEvent(entity, affectedObjects, eventType);
}
-
-}
+}
\ No newline at end of file
private static final long serialVersionUID = 8477758472369568074L;
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private ICdmPermissionEvaluator permissionEvaluator;
*/
package eu.etaxonomy.cdm.persistence.hibernate;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.persister.entity.EntityPersister;
import eu.etaxonomy.cdm.model.common.ICdmBase;
public class Level2ValidationEventListener extends ValidationEventListenerBase {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(Level2ValidationEventListener.class);
+ private static final Logger logger = LogManager.getLogger();
public Level2ValidationEventListener(IEntityValidationCrud dao){
super(dao);
*/
package eu.etaxonomy.cdm.persistence.hibernate;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.event.spi.PostDeleteEvent;
import org.hibernate.event.spi.PostDeleteEventListener;
import org.hibernate.persister.entity.EntityPersister;
implements PostDeleteEventListener {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(Level3ValidationEventListener.class);
+ private static final Logger logger = LogManager.getLogger();
public Level3ValidationEventListener(IEntityValidationCrud dao) {
super(dao);
import java.util.Properties;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.MappingException;
import org.hibernate.service.ServiceRegistry;
import org.hibernate.type.Type;
//see also TableGeneratorGlobalOverride
public class TableGenerator extends org.hibernate.id.enhanced.TableGenerator {
- private static final Logger logger = LogManager.getLogger(TableGenerator.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public void configure(Type type, Properties params, ServiceRegistry serviceRegistry) throws MappingException {
*/
public class TaxonGraphHibernateListener implements ITaxonGraphHibernateListener {
- private static final Logger logger = LogManager.getLogger(TaxonGraphHibernateListener.class);
+ private static final Logger logger = LogManager.getLogger();
private static final long serialVersionUID = 5062518307839173935L;
package eu.etaxonomy.cdm.persistence.hibernate;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.HibernateException;
import org.hibernate.event.spi.SaveOrUpdateEvent;
import org.hibernate.event.spi.SaveOrUpdateEventListener;
public class UpdateEntityListener implements SaveOrUpdateEventListener {
- private static final long serialVersionUID = -3295612929556041686L;
+
+ private static final long serialVersionUID = -3295612929556041686L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(UpdateEntityListener.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public void onSaveOrUpdate(SaveOrUpdateEvent event) throws HibernateException {
import java.util.HashMap;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.event.spi.PostInsertEvent;
import org.hibernate.event.spi.PostInsertEventListener;
import org.hibernate.event.spi.PostUpdateEvent;
*/
@SuppressWarnings("serial")
public abstract class ValidationEventListenerBase implements PostInsertEventListener, PostUpdateEventListener{
- private static final Logger logger = LogManager.getLogger(ValidationEventListenerBase.class);
+
+ private static final Logger logger = LogManager.getLogger();
private ValidationExecutor validationExecutor;
public class CdmAuthority implements GrantedAuthority, ConfigAttribute, IGrantedAuthorityConverter {
private static final long serialVersionUID = -41894743719582595L;
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static Map<String, CdmAuthority> grantedAuthorityCache = new HashMap<>();
*/
public abstract class CdmPermissionVoter implements AccessDecisionVoter <TargetEntityStates> {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static final EnumSet<CRUD> DELETE = EnumSet.of(CRUD.DELETE);
+/**
+* Copyright (C) 2009 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
package eu.etaxonomy.cdm.persistence.permission.voter;
import java.util.Collection;
import java.util.UUID;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.security.access.ConfigAttribute;
import eu.etaxonomy.cdm.model.common.CdmBase;
public class DescriptionElementVoter extends CdmPermissionVoter {
+ private static final Logger logger = LogManager.getLogger();
+
@Override
public Class<? extends CdmBase> getResponsibilityClass() {
return DescriptionElementBase.class;
import java.util.Collection;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.security.access.ConfigAttribute;
import eu.etaxonomy.cdm.model.common.CdmBase;
*/
public class RegistrationVoter extends CdmPermissionVoter {
+ private static final Logger logger = LogManager.getLogger();
+
@Override
public Class<? extends CdmBase> getResponsibilityClass() {
return Registration.class;
import java.util.Set;
import java.util.UUID;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.security.access.ConfigAttribute;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
*/
public class SpecimenOrObservationBaseVoter extends CdmPermissionVoter {
+ private static final Logger logger = LogManager.getLogger();
+
@Override
public Class<? extends CdmBase> getResponsibilityClass() {
return SpecimenOrObservationBase.class;
*/
package eu.etaxonomy.cdm.persistence.permission.voter;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
*/
public class TaxonBaseVoter extends CdmPermissionVoter {
- public static final Logger logger = LogManager.getLogger(TaxonBaseVoter.class);
-
@Override
public Class<? extends CdmBase> getResponsibilityClass() {
return TaxonBase.class;
import java.util.Collection;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.security.access.ConfigAttribute;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
*/
public class TaxonNodeVoter extends CdmPermissionVoter {
- public static final Logger logger = LogManager.getLogger(TaxonNodeVoter.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public Class<? extends CdmBase> getResponsibilityClass() {
import java.util.List;
import java.util.Map;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.lucene.search.SortField;
import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
public class OrderHint implements Serializable {
private static final long serialVersionUID = -6638812694578112279L;
+ private static final Logger logger = LogManager.getLogger();
public enum SortOrder {
}
}
- public static final Logger logger = LogManager.getLogger(OrderHint.class);
-
private final String propertyName;
private final SortOrder sortOrder;
/**
* The property of a bean
- * @return
*/
public String getPropertyName() {
return propertyName;
/**
* possible sort orders are {@link SortOrder.ASCENDING} or {@link SortOrder.DESCENDING}
- * @return
*/
public SortOrder getSortOrder() {
return sortOrder;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.model.common.ICdmBase;
import eu.etaxonomy.cdm.model.validation.CRUDEventType;
*/
public abstract class EntityValidationTaskBase implements Runnable {
- private static final Logger logger = LogManager.getLogger(EntityValidationTaskBase.class);
+ private static final Logger logger = LogManager.getLogger();
private final ICdmBase entity;
private final CRUDEventType crudEventType;
import javax.validation.ConstraintValidator;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
/**
* A {@code ThreadPoolExecutor} specialized in dealing with
*
*/
//maybe we want to make this a spring component ? #4663
-public class ValidationExecutor extends ThreadPoolExecutor implements RejectedExecutionHandler {
+public class ValidationExecutor
+ extends ThreadPoolExecutor
+ implements RejectedExecutionHandler {
- private static final Logger logger = LogManager.getLogger(ValidationExecutor.class);
+ private static final Logger logger = LogManager.getLogger();
// Number of threads to keep in the thread pool
static final int CORE_POOL_SIZE = 0;
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database;
import static org.junit.Assert.assertEquals;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-
/**
* @author a.mueller
- *
*/
public class DatabaseTypeEnumTest {
+
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DatabaseTypeEnumTest.class);
+ private static final Logger logger = LogManager.getLogger();
+
private static DatabaseTypeEnum dbEnum;
private static DatabaseTypeEnum dbEnumSql2005;
- /**
- * @throws java.lang.Exception
- */
@BeforeClass
public static void setUpBeforeClass() throws Exception {
dbEnum = DatabaseTypeEnum.MySQL;
dbEnumSql2005 = DatabaseTypeEnum.SqlServer2005;
}
-
- /**
- * @throws java.lang.Exception
- */
- @Before
- public void setUp() throws Exception {
- }
-
/**
* Test method for {@link eu.etaxonomy.cdm.database.DatabaseTypeEnum#getName()}.
*/
String dbName = type.getDatabaseType().getDatabaseNameByConnectionString(connectionString);
assertEquals("cdm_test", dbName);
}
-
-}
+}
\ No newline at end of file
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
package eu.etaxonomy.cdm.database.types;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
/**
* @author a.mueller
* @since 18.12.2008
- * @version 1.0
*/
public class ODBCDatabaseTypeTest {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(ODBCDatabaseTypeTest.class);
-
- static DatabaseTypeEnum enumType;
-
+
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
+
+ private static DatabaseTypeEnum enumType;
+
CdmPersistentDataSource dataSource;
- String server;
+ String server;
String dbName;
int port;
String username;
String password;
-
+
/**
* @throws java.lang.Exception
*/
String expected = "jdbc:odbc:" + server ;
assertEquals(expected, enumType.getConnectionString(dataSource));
}
-
+
/**
* Test method for {@link eu.etaxonomy.cdm.database.types.PostgreSQLDatabaseType#getConnectionString(eu.etaxonomy.cdm.database.ICdmDataSource, int)}.
*/
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.types;
import static org.junit.Assert.assertEquals;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
/**
* @author a.mueller
* @since 18.12.2008
- * @version 1.0
*/
public class OracleDatabaseTypeTest {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(OracleDatabaseTypeTest.class);
-
- static DatabaseTypeEnum enumType;
-
- CdmPersistentDataSource dataSource;
- String server;
- String dbName;
- int port;
- String username;
- String password;
-
- /**
- * @throws java.lang.Exception
- */
+
+ private static DatabaseTypeEnum enumType;
+
+ private CdmPersistentDataSource dataSource;
+ private String server;
+ private String dbName;
+ private int port;
+ private String username;
+ private String password;
+
@BeforeClass
public static void setUpBeforeClass() throws Exception {
enumType = DatabaseTypeEnum.Oracle;
}
- /**
- * @throws java.lang.Exception
- */
@Before
public void setUp() throws Exception {
server = "server";
username = "user";
password = "wd";
dataSource = CdmPersistentDataSource.save(
- "oracleTest",
+ "oracleTest",
CdmDataSource.NewInstance(enumType, server, dbName, port, username, password));
}
- /**
- * @throws java.lang.Exception
- */
@After
public void tearDown() throws Exception {
}
-
@Test
public void testGetConnectionStringICdmDataSource() {
String expected = "jdbc:oracle:thin:@" + server + ":" + port + ":" + dbName ;
assertEquals(expected, enumType.getConnectionString(dataSource));
}
-
+
@Test
public void testGetConnectionStringICdmDataSourceInt() {
port = 357;
assertEquals(dbName, dataSource.getDatabase());
}
-
@Test
public void testGetServerNameByConnectionStringString() {
assertEquals(server, dataSource.getServer());
public void testGetPortByConnectionStringString() {
assertEquals(port, dataSource.getPort());
}
-}
+}
\ No newline at end of file
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
package eu.etaxonomy.cdm.database.types;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
/**
* @author a.mueller
* @since 18.12.2008
- * @version 1.0
*/
public class PostgreSQLDatabaseTypeTest {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(PostgreSQLDatabaseTypeTest.class);
-
- CdmPersistentDataSource dataSource;
- static DatabaseTypeEnum enumType;
- String server;
- String dbName;
- int port;
- String username;
- String password;
-
- /**
- * @throws java.lang.Exception
- */
+
+ private CdmPersistentDataSource dataSource;
+ private static DatabaseTypeEnum enumType;
+ private String server;
+ private String dbName;
+ private int port;
+ private String username;
+ private String password;
+
@BeforeClass
public static void setUpBeforeClass() throws Exception {
enumType = DatabaseTypeEnum.PostgreSQL;
}
- /**
- * @throws java.lang.Exception
- */
@AfterClass
public static void tearDownAfterClass() throws Exception {
}
- /**
- * @throws java.lang.Exception
- */
@Before
public void setUp() throws Exception {
server = "server";
username = "user";
password = "wd";
dataSource = CdmPersistentDataSource.save(
- "postgreSqlTest",
+ "postgreSqlTest",
CdmDataSource.NewInstance(enumType, server, dbName, port, username, password));
}
- /**
- * @throws java.lang.Exception
- */
- @After
- public void tearDown() throws Exception {
- }
-
/**
* Test method for {@link eu.etaxonomy.cdm.database.types.PostgreSQLDatabaseType#getConnectionString(eu.etaxonomy.cdm.database.ICdmDataSource)}.
*/
String expected = "jdbc:postgresql://" + server + ":" + port + "/" + dbName;
assertEquals(expected, new PostgreSQLDatabaseType().getConnectionString(dataSource));
}
-
+
/**
* Test method for {@link eu.etaxonomy.cdm.database.types.PostgreSQLDatabaseType#getConnectionString(eu.etaxonomy.cdm.database.ICdmDataSource, int)}.
*/
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.types;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* @author a.mueller
* @since 18.12.2008
- * @version 1.0
*/
public class SqlServer2000DatabaseTypeTest {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SqlServer2000DatabaseTypeTest.class);
-
- CdmPersistentDataSource dataSource;
- static DatabaseTypeEnum enumType;
- String server;
- String dbName;
- int port;
- String username;
- String password;
-
- /**
- * @throws java.lang.Exception
- */
+
+ private CdmPersistentDataSource dataSource;
+ private static DatabaseTypeEnum enumType;
+ private String server;
+ private String dbName;
+ private int port;
+ private String username;
+ private String password;
+
@BeforeClass
public static void setUpBeforeClass() throws Exception {
enumType = DatabaseTypeEnum.SqlServer2005;
}
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- }
-
- /**
- * @throws java.lang.Exception
- */
@Before
public void setUp() throws Exception {
server = "server";
username = "user";
password = "wd";
dataSource = CdmPersistentDataSource.save(
- "postgreSqlTest",
+ "postgreSqlTest",
CdmDataSource.NewInstance(enumType, server, dbName, port, username, password));
}
- /**
- * @throws java.lang.Exception
- */
- @After
- public void tearDown() throws Exception {
- }
-
/**
* Test method for {@link eu.etaxonomy.cdm.database.types.PostgreSQLDatabaseType#getConnectionString(eu.etaxonomy.cdm.database.ICdmDataSource)}.
*/
String expected = "jdbc:sqlserver://" + server + ":" + port + ";databaseName=" + dbName + ";SelectMethod=cursor";
assertEquals(expected, enumType.getConnectionString(dataSource));
}
-
+
/**
* Test method for {@link eu.etaxonomy.cdm.database.types.PostgreSQLDatabaseType#getConnectionString(eu.etaxonomy.cdm.database.ICdmDataSource, int)}.
*/
public void testGetPortByConnectionStringString() {
assertEquals(port, dataSource.getPort());
}
-}
+}
\ No newline at end of file
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.types;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* @author a.mueller
* @since 18.12.2008
- * @version 1.0
*/
public class SqlServer2005DatabaseTypeTest {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SqlServer2005DatabaseTypeTest.class);
-
- CdmPersistentDataSource dataSource;
- static DatabaseTypeEnum enumType;
- String server;
- String dbName;
- int port;
- String username;
- String password;
-
- /**
- * @throws java.lang.Exception
- */
+
+ private CdmPersistentDataSource dataSource;
+ private static DatabaseTypeEnum enumType;
+ private String server;
+ private String dbName;
+ private int port;
+ private String username;
+ private String password;
+
@BeforeClass
public static void setUpBeforeClass() throws Exception {
enumType = DatabaseTypeEnum.SqlServer2005;
}
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- }
-
- /**
- * @throws java.lang.Exception
- */
@Before
public void setUp() throws Exception {
server = "server";
username = "user";
password = "wd";
dataSource = CdmPersistentDataSource.save(
- "postgreSqlTest",
+ "postgreSqlTest",
CdmDataSource.NewInstance(enumType, server, dbName, port, username, password));
}
- /**
- * @throws java.lang.Exception
- */
- @After
- public void tearDown() throws Exception {
- }
-
/**
* Test method for {@link eu.etaxonomy.cdm.database.types.PostgreSQLDatabaseType#getConnectionString(eu.etaxonomy.cdm.database.ICdmDataSource)}.
*/
String expected = "jdbc:sqlserver://" + server + ":" + port + ";databaseName=" + dbName + ";SelectMethod=cursor";
assertEquals(expected, enumType.getConnectionString(dataSource));
}
-
+
/**
* Test method for {@link eu.etaxonomy.cdm.database.types.PostgreSQLDatabaseType#getConnectionString(eu.etaxonomy.cdm.database.ICdmDataSource, int)}.
*/
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.database.types;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-import org.junit.After;
-import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
/**
* @author a.mueller
* @since 18.12.2008
- * @version 1.0
*/
public class SybaseDatabaseTypeTest {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SybaseDatabaseTypeTest.class);
-
- static DatabaseTypeEnum enumType;
-
- CdmPersistentDataSource dataSource;
- String server;
- String dbName;
- int port;
- String username;
- String password;
-
- /**
- * @throws java.lang.Exception
- */
+
+ private static DatabaseTypeEnum enumType;
+
+ private CdmPersistentDataSource dataSource;
+ private String server;
+ private String dbName;
+ private int port;
+ private String username;
+ private String password;
+
@BeforeClass
public static void setUpBeforeClass() throws Exception {
enumType = DatabaseTypeEnum.Sybase;
}
- /**
- * @throws java.lang.Exception
- */
- @AfterClass
- public static void tearDownAfterClass() throws Exception {
- }
-
- /**
- * @throws java.lang.Exception
- */
@Before
public void setUp() throws Exception {
server = "server";
username = "user";
password = "wd";
dataSource = CdmPersistentDataSource.save(
- "sybaseTest",
+ "sybaseTest",
CdmDataSource.NewInstance(enumType, server, dbName, port, username, password));
}
- /**
- * @throws java.lang.Exception
- */
- @After
- public void tearDown() throws Exception {
- }
-
/**
* Test method for {@link eu.etaxonomy.cdm.database.types.PostgreSQLDatabaseType#getConnectionString(eu.etaxonomy.cdm.database.ICdmDataSource)}.
*/
String expected = "jdbc:sybase:Tds:" + server + ":" + port + "/" + dbName;
assertEquals(expected, enumType.getConnectionString(dataSource));
}
-
+
/**
* Test method for {@link eu.etaxonomy.cdm.database.types.PostgreSQLDatabaseType#getConnectionString(eu.etaxonomy.cdm.database.ICdmDataSource, int)}.
*/
public void testGetPortByConnectionStringString() {
assertEquals(port, dataSource.getPort());
}
-}
+}
\ No newline at end of file
import java.lang.reflect.Method;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import eu.etaxonomy.cdm.model.taxon.Taxon;
public class MethodCacheImplTest {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(MethodCacheImplTest.class);
+
private Taxon taxon;
private IBotanicalName botanicalName;
- IMethodCache methodCache;
+ private IMethodCache methodCache;
private Reference nomenclaturalReference;
@Before
import java.util.Map;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
import org.junit.Test;
import org.unitils.dbunit.annotation.DataSet;
import org.unitils.dbunit.annotation.ExpectedDataSet;
/**
* @author a.mueller
* @since 25.11.2010
- *
*/
-public class DescriptionElementDaoHibernateImplTest extends CdmTransactionalIntegrationTest {
- private static final Logger logger = LogManager.getLogger(DescriptionElementDaoHibernateImplTest.class);
+public class DescriptionElementDaoHibernateImplTest
+ extends CdmTransactionalIntegrationTest {
- @SpringBeanByType
- IDescriptionElementDao descriptionElementDao;
+ private static final Logger logger = LogManager.getLogger();
- @SpringBeanByType
- IDescriptionDao descriptionDao;
+ private final UUID uuidSingleTextData = UUID.fromString("31a0160a-51b2-4565-85cf-2be58cb561d6");
+ private final UUID uuidDobuleTextData = UUID.fromString("50f6b799-3585-40a7-b69d-e7be77b2651a");
+ private final boolean printDatasets = false;
- @SpringBeanByType
- IDefinedTermDao termDao;
+ @SpringBeanByType
+ private IDescriptionElementDao descriptionElementDao;
@SpringBeanByType
- ITaxonDao taxonDao;
-
-
- private final UUID uuidSingleTextData = UUID.fromString("31a0160a-51b2-4565-85cf-2be58cb561d6");
- private final UUID uuidDobuleTextData = UUID.fromString("50f6b799-3585-40a7-b69d-e7be77b2651a");
+ private IDescriptionDao descriptionDao;
- private final boolean printDatasets = false;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {}
+ @SpringBeanByType
+ private IDefinedTermDao termDao;
- @Before
- public void setUp() throws Exception {}
+ @SpringBeanByType
+ private ITaxonDao taxonDao;
// ***************************** TESTS ************************************/
*/
@Test
public void testCountMedia() {
- logger.warn("Not yet implemented");
+ logger.warn("testCountMedia not yet implemented");
}
-
/**
* See #2114
*/
*/
@Test
public void testCountClassOfQextendsDescriptionElementBaseString() {
- logger.warn("Not yet implemented");
+ logger.warn("testCountClassOfQextendsDescriptionElementBaseString not yet implemented");
}
/**
*/
@Test
public void testGetMedia() {
- logger.warn("Not yet implemented");
+ logger.warn("testGetMedia not yet implemented");
}
/**
*/
@Test
public void testSearch() {
- logger.warn("Not yet implemented");
+ logger.warn("testSearch not yet implemented");
}
/**
*/
@Test
public void testPurgeIndex() {
- logger.warn("Not yet implemented");
+ logger.warn("testPurgeIndex not yet implemented");
}
/**
*/
@Test
public void testRebuildIndex() {
- logger.warn("Not yet implemented");
+ logger.warn("testRebuildIndex not yet implemented");
}
/**
*/
@Test
public void testOptimizeIndex() {
- logger.warn("Not yet implemented");
+ logger.warn("testOptimizeIndex not yet implemented");
}
/**
*/
@Test
public void testCountString() {
- logger.warn("Not yet implemented");
+ logger.warn("testCountString not yet implemented");
}
/**
public class TypeDesignationDaoHibernateImplTest extends CdmTransactionalIntegrationTest {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TypeDesignationDaoHibernateImplTest.class);
+ private static final Logger logger = LogManager.getLogger();
@SpringBeanByType
private ITypeDesignationDao typeDesignationDao;
import java.util.List;
import java.util.stream.Collectors;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.h2.util.StringUtils;
import org.junit.Assert;
import org.junit.Test;
public class OccurrenceDaoHibernateImplTest extends CdmIntegrationTest {
- private static final Logger logger = LogManager.getLogger(OccurrenceDaoHibernateImplTest.class);
+ private static final Logger logger = LogManager.getLogger();
@SpringBeanByType
private IOccurrenceDao dao;
public class TaxonGraphTest extends CdmTransactionalIntegrationTest {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TaxonGraphTest.class);
+ private static final Logger logger = LogManager.getLogger();
enum EventType{
INSERT, UPDATE;
* @since 2019-08-16
*/
public class TermNodeDaoImplTest extends CdmTransactionalIntegrationTest {
- @SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger(TermNodeDaoImplTest.class);
+
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
@SpringBeanByType
private ITermTreeDao treeDao;
- @SpringBeanByType
- private ITermNodeDao nodeDao;
+ @SpringBeanByType
+ private ITermNodeDao nodeDao;
- @SpringBeanByType
- private IDefinedTermDao termDao;
+ @SpringBeanByType
+ private IDefinedTermDao termDao;
@Before
public void setUp() {}
import java.util.Set;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
* @since 10.02.2009
*/
public class TermVocabularyDaoImplTest extends CdmTransactionalIntegrationTest {
- @SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger(TermVocabularyDaoImplTest.class);
@SpringBeanByType
private ITermVocabularyDao dao;
*/
public class CacheStrategyGeneratorTest extends CdmTransactionalIntegrationTest {
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private TaxonBase<?> cdmBase;
import java.io.FileNotFoundException;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
import org.springframework.security.authentication.AuthenticationManager;
public class Level2ValidationEventListenerTest extends CdmTransactionalIntegrationTest {
- protected static final Logger logger = LogManager.getLogger(Level2ValidationEventListenerTest.class);
+ private static final Logger logger = LogManager.getLogger();
private UUID uuid;
private TaxonBase<?> cdmBase;
import java.io.FileNotFoundException;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
* @author a.mueller
*/
public class SaveOrUpdateEntityListenerTest extends CdmTransactionalIntegrationTest {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(SaveOrUpdateEntityListenerTest.class);
+
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
@SpringBeanByType
private OccurrenceDaoHibernateImpl occurrenceDao;
import java.io.FileNotFoundException;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
public class ReferringObjectMetadataFactoryTest extends CdmTransactionalIntegrationTest {
@SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger(ReferringObjectMetadataFactoryTest.class);
+ private static final Logger logger = LogManager.getLogger();
@SpringBeanByType
private ReferringObjectMetadataFactory referringObjectMetadataFactory;
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.junit.Before;
import org.junit.Test;
public class ValidationExecutorTest {
- public static final Logger logger = LogManager.getLogger(ValidationExecutorTest.class);
-
-
@Before
public void setUp() throws Exception{
}
-
@Test
public void testSetMaximumPoolSize(){
try {
fail("setMaximumPoolSize expected to throw a runtime exception");
}
-
@Test
public void testValidationExecutor(){
// Constructor test not implemented
}
-
/**
* Test behavior when the ValidationExecutor's task queue fills up. Make sure task queue
* overruns do not throw an exception. To test this, we rapidly fill the queue with tasks
e.printStackTrace();
}
}
-
-
- @Test
- public void testBeforeExecute(){
-
- }
-
-}
+}
\ No newline at end of file
import java.io.IOException;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.persistence.utils.CdmPersistenceUtils;
*/
public class TestCdmApplicationUtils {
- private static final Logger logger = LogManager.getLogger(TestCdmApplicationUtils.class);
+ private static final Logger logger = LogManager.getLogger();
private boolean testWritableResourceDirectory() throws IOException{
CdmPersistenceUtils.getWritableResourceDir();
*/
package eu.etaxonomy.cdm.test.function;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.database.CdmDataSource;
import eu.etaxonomy.cdm.database.CdmPersistentDataSource;
public class TestScriptPersistence {
- private static final Logger logger = LogManager.getLogger(TestScriptPersistence.class);
+
+ private static final Logger logger = LogManager.getLogger();
private void test(){
System.out.println("Start Datasource");
}
)
public class CdmTestSuite {
+
@SuppressWarnings("unused")
private static final Logger logger = LogManager.getLogger();
package eu.etaxonomy.cdm.test.suite;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
* eu.etaxonomy.cdm.persistence.dao.common.OperationNotSupportedInPriorViewException:
* IdentifiableDaoBase.findByTitle(String queryString, CdmBase sessionObject)
* at eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase.checkNotInPriorView(VersionableDaoBase.java:63)
- *
*/
-
}
)
public class TestsShouldNotFailInSuite_1 {
- private static final Logger logger = LogManager.getLogger(TestsShouldNotFailInSuite_1.class);
-
// the class remains completely empty,
// being used only as a holder for the above annotations
-}
+}
\ No newline at end of file
package eu.etaxonomy.cdm.test.suite;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
}
)
public class TestsShouldNotFailInSuite_2 {
-
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TestsShouldNotFailInSuite_2.class);
-
// the class remains completely empty,
// being used only as a holder for the above annotations
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.print;
-
/**
* @author n.hoffmann
* @since Apr 26, 2010
- * @version 1.0
*/
public interface IXMLElements {
public static final String ROOT = "root";
public static final String DESCRIPTIONS = "descriptions";
-
-}
+}
\ No newline at end of file
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.print;
import java.util.List;
/**
* This interface provides a simplified interface to the API offered by the cdmlib-remote project.
- *
+ *
* @author n.hoffmann
* @since Jul 16, 2010
- * @version 1.0
*/
public interface IXMLEntityFactory {
/***************** Configuration methods *********************/
-
+
/**
* Returns a list of classifications that are present in the CDM Server associated with this factory
- *
+ *
* @returna list of elements
*/
public List<Element> getClassifications();
-
+
/**
* Returns taxonomically included taxa for a given taxon or classification.
- *
+ *
* @param treeNode
* @return a list of elements
*/
public List<Element> getChildNodes(Element treeNode);
-
+
/**
* Returns the TaxonNode for the given uuid
- *
+ *
* @param taxonNodeUuid
* @return an element
*/
public Element getTaxonNode(UUID taxonNodeUuid);
-
- /*
+
+ /**
* Returns the taxonNodes for a specific name
*/
public Element getTaxonNodesByName(String taxonName, String classification);
-
+
/**
- * Returns the {@link FeatureTree FeatureTrees} available with this CDM Server
- *
+ * Returns the {@link FeatureTree FeatureTrees} available with this CDM Server
+ *
* @return a list of elements
*/
public List<Element> getFeatureTrees();
-
+
/**
- *
- *
+ *
+ *
* @return
*/
public Element getFeatureTree(UUID uuid);
-
+
/**
- *
+ *
* @param uuid
* @return
*/
public Element getTermNode(UUID uuid);
-
+
/**
- *
+ *
* @param uuid
* @return
*/
public Element getFeatureForTermNode(UUID uuid);
-
+
/***************** Harvesting methods *********************/
-
+
/**
* Retrieves to taxon associated with the given taxon node
- *
+ *
* @param taxonNodeElement
* @return an element
*/
public Element getTaxonForTaxonNode(Element taxonNodeElement);
-
+
/**
* Fully initializes an accepted taxon
- *
+ *
* @param taxonElement
* @return an element
*/
public Element getAcceptedTaxonElement(Element taxonElement);
-
+
/**
* Fully initializes a reference
- *
+ *
* @param referenceElement
* @return an element
*/
public List<Element> getReferences(Element referenceElement);
-
+
/**
* Initializes the complete synonym for an accepted taxon
- *
+ *
* @param taxonElement
* @return a list of elements
*/
public List<Element> getSynonymy(Element taxonElement);
-
+
/**
- * Initialize type designations for a name elemt
- *
+ * Initialize type designations for a name elemt
+ *
* @param nameElement
* @return
*/
public List<Element> getTypeDesignations(Element nameElement);
-
+
/**
* Initializes complete taxon descriptions for an accepted taxon
- *
+ *
* @param taxonElement
* @return a list of elements
*/
- public Element getDescriptions(Element taxonElement);
-
+ public Element getDescriptions(Element taxonElement);
+
/**
* Gets the PolytomousKey as a List of LinkedPolytomousKeyNodeRowDto objects.
- *
+ *
* @param taxonElement
* @return a list of elements
*/
- public Element getPolytomousKey(Element taxonElement);
-
+ public Element getPolytomousKey(Element taxonElement);
+
/**
* Gets the Media associated with a particular taxon
* @param taxonElement
@Component
public class LocalXMLEntityFactory extends XmlEntityFactoryBase {
- private static final Logger logger = LogManager.getLogger(LocalXMLEntityFactory.class);
+ private static final Logger logger = LogManager.getLogger();
private final JsonView xmlView;
*/
public class PublishConfigurator implements Serializable {
- private static final Logger logger = LogManager.getLogger(PublishConfigurator.class);
-
- private static final long serialVersionUID = 4896190792717383839L;
+ private static final long serialVersionUID = 4896190792717383839L;
+ private static final Logger logger = LogManager.getLogger();
private ICdmApplication applicationConfiguration;
*/
public static PublishConfigurator NewLocalInstance(
ICdmApplication applicationConfiguration) {
+
PublishConfigurator configurator = new PublishConfigurator();
configurator.setLocal();
configurator.setApplicationConfiguration(applicationConfiguration);
*/
public class RemoteXMLEntityFactory extends XmlEntityFactoryBase {
- private static final Logger logger = LogManager.getLogger(RemoteXMLEntityFactory.class);
+ private static final Logger logger = LogManager.getLogger();
private URL serviceUrl;
*/
public class Transformator {
- private static final Logger logger = LogManager.getLogger(Transformator.class);
- private Transformer transformer;
+ private static final Logger logger = LogManager.getLogger();
+ private Transformer transformer;
public Transformator(InputStream stylesheet) throws XSLTransformException{
if(stylesheet == null){
*
* @author n.hoffmann
* @since Apr 8, 2010
- * @version 1.0
*/
public class XMLHarvester {
- private static final Logger logger = LogManager.getLogger(XMLHarvester.class);
+
+ private static final Logger logger = LogManager.getLogger();
private IXMLEntityFactory factory;
*/
public abstract class XmlEntityFactoryBase implements IXMLEntityFactory {
- private static final Logger logger = LogManager.getLogger(XmlEntityFactoryBase.class);
+ private static final Logger logger = LogManager.getLogger();
/**
* A list of XML element names that are used to store collections
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.print.out;
import java.io.File;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
-
/**
* Performs the publish process defined by the implementing class. Clients should consider extending <code>AbstractPublishOutputModule</code>
*
* @see {@link PublishOutputModuleBase}
* @author n.hoffmann
* @since Apr 8, 2010
- * @version 1.0
*/
public interface IPublishOutputModule {
*/
public abstract class PublishOutputModuleBase implements IPublishOutputModule {
- private static final Logger logger = LogManager.getLogger(PublishOutputModuleBase.class);
+ private static final Logger logger = LogManager.getLogger();
/**
* The date format used by {@link #generateFilenameWithDate(String, String)}
*/
- public static final String DATE_FORMAT_NOW = "yyyyMMdd-HHmm";
+ private static final String DATE_FORMAT_NOW = "yyyyMMdd-HHmm";
private FilenameFilter filter = new FilenameFilter() {
*/
public class MediawikiOutputModule extends PublishOutputModuleBase {
- private static final Logger logger = LogManager.getLogger(MediawikiOutputModule.class);
+ private static final Logger logger = LogManager.getLogger();
- public static String STYLESHEET_RESOURCE_DEFAULT = "src/main/resources/stylesheets/mediawiki/multipages.xsl";
+ private static final String STYLESHEET_RESOURCE_DEFAULT = "src/main/resources/stylesheets/mediawiki/multipages.xsl";
// default wiki - exportparameter
public String prefix="";
*/
public class DocumentCreator {
- private static final Logger logger = LogManager.getLogger(DocumentCreator.class);
+ private static final Logger logger = LogManager.getLogger();
private OdfTextDocument outputDocument;
private OdfFileDom contentDom; // the document object model for content.xml
return false;
}
-
-
/*
* The default document has some content in it already (in the case of a
* text document, a <text:p>. Clean out all the old stuff.
childNode = officeText.getFirstChild();
}
}
-}
+}
\ No newline at end of file
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.print.out.odf;
-
/**
* @author n.hoffmann
* @since Apr 29, 2010
- * @version 1.0
*/
public interface IStyleNames {
public static String HEADING_ACCEPTED_TAXON = "heading_accepted_taxon";
public static String HEADING_FEATURE = "heading_feature";
-}
+}
\ No newline at end of file
*/
public class OdfOutputModule extends PublishOutputModuleBase {
- private static final Logger logger = LogManager.getLogger(OdfOutputModule.class);
+ private static final Logger logger = LogManager.getLogger();
public static String STYLESHEET_RESOURCE_DEFAULT = "/stylesheets/odf/cdmToOdfText.xsl";
import java.io.File;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.jdom.Document;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
*/
public class TaxPubOutputModule extends PublishOutputModuleBase {
- private static final Logger logger = LogManager.getLogger(TaxPubOutputModule.class);
-
@Override
public String getOutputFileSuffix() {
return "taxpub.xml";
*/
public class XMLOutputModule extends PublishOutputModuleBase{
- private static final Logger logger = LogManager.getLogger(XMLOutputModule.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public void output(Document document, File exportFolder, IProgressMonitor progressMonitor) {
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.print.out.pdf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import org.junit.Ignore;
+
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.List;
+import org.junit.Ignore;
import org.junit.Test;
import eu.etaxonomy.cdm.print.out.PublishOutputModuleBase;
-
/**
* @author n.hoffmann
* @since Jan 11, 2011
- * @version 1.0
*/
@Ignore
public class PdfOutputModuleTest {
-
- /**
- * @throws IOException
- *
- */
@Test
public void testGetXslt() throws IOException {
PdfOutputModule outputModule = new PdfOutputModule();
}
@Test
- public void testGetStylesheetByLocation() throws IOException, URISyntaxException{
+ public void testGetStylesheetByLocation() throws URISyntaxException{
PdfOutputModule outputModule = new PdfOutputModule();
URL shippedStylesheetsResource = PublishOutputModuleBase.class.getResource("/stylesheets/pdf/");
assertNotNull("There should be stylesheets", stylesheets);
assertEquals("There should be two stylesheets", 2, stylesheets.size());
}
-
-
-}
+}
\ No newline at end of file
//@DependsOn("objectMapperConfigurer")
public abstract class CdmSpringMVCConfig extends WebMvcConfigurationSupport {
+ private static final Logger logger = LogManager.getLogger();
+
/**
* turn caching off FOR DEBUGING ONLY !!!!
*/
private static final boolean XML_VIEW_CACHING = true;
- public static final Logger logger = LogManager.getLogger();
-
-
@Autowired
- protected ServletContext servletContext;
+ private ServletContext servletContext;
@Autowired // is initialized in PreloadedBeans.class
private ObjectMapper jsonObjectMapper;
*/
package eu.etaxonomy.cdm.remote.config;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
)
public class CdmSpringMVCConfigDefault extends CdmSpringMVCConfig {
+ private static final Logger logger = LogManager.getLogger();
+
public CdmSpringMVCConfigDefault() {
super();
logger.info(" ==========================================");
@ImportResource(locations="classpath:/eu/etaxonomy/cdm/remoting-services.xml")
public class RemotingWebServices {
- public static final Logger logger = LogManager.getLogger(RemotingWebServices.class);
+ private static final Logger logger = LogManager.getLogger();
public RemotingWebServices() {
logger.info("========================================");
@Controller
public class StaticSwaggerApiDoc {
- public static final Logger logger = LogManager.getLogger(StaticSwaggerApiDoc.class);
+ private static final Logger logger = LogManager.getLogger();
public static final String SWAGGER_STATIC = "swagger-static";
public static final String JSON = ".json";
*/
public class ClassificationIT extends WebServiceTestBase {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Test
public void checkInstanceIsOnline(){
*/
package eu.etaxonomy.cdm.remote;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.junit.Test;
/**
*/
public class ForceSchemaCreateIT extends WebServiceTestBase {
+ private static final Logger logger = LogManager.getLogger();
+
@Test
public void checkInstanceIsOnline(){
String response = httpGetJson("metadata", null);
*/
public class SwaggerStaticIT extends WebServiceTestBase {
- public static final Logger logger = LogManager.getLogger(SwaggerStaticIT.class);
+ private static final Logger logger = LogManager.getLogger();
private String[] swaggerResourcesPaths = new String[]{"", "/configuration/ui", "/configuration/security" };
-
@Test
public void fetchSwaggerResources() {
*/
public class WebServiceTestBase extends Assert {
- public static final Logger logger = LogManager.getLogger(WebServiceTestBase.class);
+ private static final Logger logger = LogManager.getLogger();
private int port = 9180;
private String baseUri = "";
*/
package eu.etaxonomy.cdm.remote.config;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
"eu.etaxonomy.cdm.remote.config" })
public class CdmSpringMVCConfigWithSwagger extends CdmSpringMVCConfig {
+ private static final Logger logger = LogManager.getLogger();
+
public CdmSpringMVCConfigWithSwagger() {
super();
logger.info(" ==========================================");
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.opt.config;
import java.io.File;
@PropertySource(value="file:${user.home}/.cdmLibrary/cdmlib-remote.properties", ignoreResourceNotFound=true)
public class DataSourceConfigurer extends AbstractWebApplicationConfigurer {
- public static final Logger logger = LogManager.getLogger(DataSourceConfigurer.class);
+ private static final Logger logger = LogManager.getLogger();
protected static final String HIBERNATE_DIALECT = "hibernate.dialect";
protected static final String HIBERNATE_SEARCH_DEFAULT_INDEX_BASE = "hibernate.search.default.indexBase";
logger.error("hibernate dialect mapping for "+url+ " not yet implemented or unavailable");
return null;
}
-
-}
+}
\ No newline at end of file
@Configuration
public class EhCacheDiskStoreConfiguration {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private DataSourceProperties dataSourceProperties = null;
*/
public abstract class AbstractWebApplicationConfigurer implements InitializingBean {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Autowired
protected ConfigurableEnvironment env;
private static final String CLIENT_ID = "any-client";
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private UserApprovalHandler userApprovalHandler;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
public abstract class AbstractIdentifiableListController <T extends IdentifiableEntity, SERVICE extends IIdentifiableEntityService<T>>
extends BaseListController<T,SERVICE> {
+ private static final Logger logger = LogManager.getLogger();
+
@InitBinder
@Override
public void initBinder(WebDataBinder binder) {
*/
public abstract class BaseListController <T extends CdmBase, SERVICE extends IService<T>> extends AbstractListController<T, SERVICE> {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@InitBinder
public void initBinder(WebDataBinder binder) {
@RequestMapping(value = {"/portal/classification/{uuid}"})
public class ClassificationPortalController extends ClassificationController {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static final List<String> CLASSIFICATION_INIT_STRATEGY = Arrays.asList(new String[]{
"source.citation.authorship",
@RequestMapping(value="/portal/classification")
public class ClassificationPortalListController extends AbstractIdentifiableListController<Classification,IClassificationService> {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static final List<String> CLASSIFICATION_INIT_STRATEGY = Arrays.asList(new String[]{
"source.citation.authorship"
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
/**
* @author a.kohlbecker
* @since 28.06.2010
- *
*/
@Controller
@Api("derivedUnitFacade")
@RequestMapping(value = {"/derivedUnitFacade/{uuid}"})
public class DerivedUnitFacadeController extends AbstractController<SpecimenOrObservationBase, IOccurrenceService>{
- private static final Logger logger = LogManager.getLogger(DerivedUnitFacadeController.class);
-
+ private static final Logger logger = LogManager.getLogger();
private IOccurrenceService service;
public List<MediaDTO> doGetFieldObjectMediaDTO(
@PathVariable("uuid") UUID occurrenceUuid,
HttpServletRequest request,
- HttpServletResponse response) throws IOException {
+ HttpServletResponse response) {
logger.info("doGetFieldObjectMediaDTO() - " + readPathParameter(request, null));
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.remote.controller;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
@RequestMapping(value = {"/description/{uuid}", "/description/{uuid_list}"})
public class DescriptionController extends AbstractIdentifiableController<DescriptionBase, IDescriptionService> {
- private static final Logger logger = LogManager.getLogger(DescriptionController.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ITermTreeService termTreeService;
mv.addObject(textData);
return mv;
}
-
-
-
-}
+}
\ No newline at end of file
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
public class DescriptionElementController
extends BaseController<DescriptionElementBase, IDescriptionElementService>{
+ private static final Logger logger = LogManager.getLogger();
+
private static final List<String> STATE_INIT_STRATEGY = Arrays.asList( new String[]{
"states.state.representations",
"modifiers",
"modifyingText"
} );
- public static final Logger logger = LogManager.getLogger(DescriptionElementController.class);
-
@Autowired
private ITermService termService;
mv.addObject(states);
return mv;
}
-
-
-}
+}
\ No newline at end of file
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.remote.controller;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
@RequestMapping(value = {"/descriptionElement"})
public class DescriptionElementListController {
- public static final Logger logger = LogManager.getLogger(DescriptionElementListController.class);
-
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ITermService termService;
"multilanguageText"
});
- /**
- * @return
- */
protected List<String> getInitializationStrategy() {
return DESCRIPTION_ELEMENT_INIT_STRATEGY;
}
binder.registerCustomEditor(Class.class, new CdmTypePropertyEditor());
}
-
/**
* Requires the query parameter "descriptionType" to be present
- *
- * @param features
- * @param descriptionType
- * @param type
- * @param pageSize
- * @param pageIndex
- * @param request
- * @param response
- * @return
- * @throws IOException
*/
@RequestMapping(value = "byFeature", method = RequestMethod.GET) // mapped as absolute path, see CdmAntPathMatcher
public Pager<? extends DescriptionElementBase> doPageDescriptionElementsByFeature(
/**
* Requires the query parameter "taxon" to be present
- *
- * @param taxon_uuid
- * @param features
- * @param type
- * @param pageSize
- * @param pageIndex
- * @param request
- * @param response
- * @return
- * @throws IOException
*/
@RequestMapping(value = "byTaxon", method = {RequestMethod.GET, RequestMethod.POST}) // mapped as absolute path, see CdmAntPathMatcher
public <T extends DescriptionElementBase> Pager<T> doGetDescriptionElementsForTaxon(
return pager;
}
-
-}
+}
\ No newline at end of file
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.remote.controller;
import java.util.Arrays;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.Api;
/**
- *
* @author a.kohlbecker
* @since Jun 25, 2013
- *
*/
@Controller
@Api("portal_descriptionElement")
@RequestMapping(value = {"/portal/descriptionElement"})
public class DescriptionElementListPortalController extends DescriptionElementListController {
- public static final Logger logger = LogManager.getLogger(DescriptionElementListPortalController.class);
-
+ private static final Logger logger = LogManager.getLogger();
protected static final List<String> DESCRIPTION_ELEMENT_INIT_STRATEGY = Arrays.asList(new String []{
"$",
"taxon2.name"
});
- /**
- * @return
- */
@Override
protected List<String> getInitializationStrategy() {
return DESCRIPTION_ELEMENT_INIT_STRATEGY;
}
-
-}
+}
\ No newline at end of file
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.remote.controller;
import java.awt.Color;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
public class DescriptionListController
extends AbstractIdentifiableListController<DescriptionBase, IDescriptionService> {
+ private static final Logger logger = LogManager.getLogger();
+
@Autowired
private ITermService termService;
import java.util.Arrays;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping(value = {"/portal/description"})
public class DescriptionListPortalController extends DescriptionListController {
- public static final Logger logger = LogManager.getLogger(DescriptionListPortalController.class);
+ private static final Logger logger = LogManager.getLogger();
protected static final List<String> DESCRIPTION_INIT_STRATEGY = Arrays.asList(new String []{
"$",
"elements.kindOfUnit"
});
-
protected static final List<String> DISTRIBUTION_INFO_INIT_STRATEGY = Arrays.asList(new String []{
"sources.citation.authorship.$",
"sources.nameUsedInSource",
"annotations"
});
-
public DescriptionListPortalController() {
- super();
setInitializationStrategy(DESCRIPTION_INIT_STRATEGY);
}
protected List<String> getDescriptionInfoInitStrategy(){
return DISTRIBUTION_INFO_INIT_STRATEGY;
}
-
-}
+}
\ No newline at end of file
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
"/portal/description/{uuid_list}"})
public class DescriptionPortalController extends BaseController<DescriptionBase, IDescriptionService> {
- private static final Logger logger = LogManager.getLogger(DescriptionPortalController.class);
+ private static final Logger logger = LogManager.getLogger();
public static final EntityInitStrategy DESCRIPTION_INIT_STRATEGY = new EntityInitStrategy(Arrays.asList(new String [] {
"$",
*/
package eu.etaxonomy.cdm.remote.controller;
-import io.swagger.annotations.Api;
-
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import eu.etaxonomy.cdm.api.service.IEventBaseService;
import eu.etaxonomy.cdm.model.common.EventBase;
-
+import io.swagger.annotations.Api;
/**
* @author a.kohlbecker
@Api("eventBase")
@RequestMapping(value = {"/eventBase/{uuid}"})
public class EventBaseController extends BaseController<EventBase, IEventBaseService> {
-
+
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(EventBaseController.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
@Autowired
*/
public class HttpStatusMessage {
- public static final Logger logger = LogManager.getLogger(HttpStatusMessage.class);
+ private static final Logger logger = LogManager.getLogger();
public final static HttpStatusMessage UUID_MISSING = new HttpStatusMessage(HttpServletResponse.SC_BAD_REQUEST, "missing uuid parameter");
public final static HttpStatusMessage UUID_INVALID = new HttpStatusMessage(HttpServletResponse.SC_BAD_REQUEST, "invalid uuid");
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
@RequestMapping(value = { "/manage" })
public class ManagementController {
- public static final Logger logger = LogManager.getLogger(ManagementController.class);
+ private static final Logger logger = LogManager.getLogger();
// @Autowired
private DataSourceReloader datasoucrceLoader;
import javax.servlet.http.HttpServletResponse;
import org.apache.http.HttpException;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
//import org.mortbay.log.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@RequestMapping(value = {"/media/{uuid}"})
public class MediaController extends AbstractIdentifiableController<Media, IMediaService>{
- private static final Logger logger = LogManager.getLogger(MediaController.class);
-
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private MediaInfoFactory mediaInfoFactory;
@RequestMapping(value = {"/name/{uuid}"})
public class NameController extends AbstractIdentifiableController<TaxonName, INameService>{
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
public static final EntityInitStrategy TYPEDESIGNATION_INIT_STRATEGY = new EntityInitStrategy(Arrays.asList(new String []{
"typeStatus.representations",
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping(value = {"/name"})
public class NameListController extends AbstractIdentifiableListController<TaxonName, INameService> {
- private static final Logger logger = LogManager.getLogger(NameListController.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private LocaleContext localeContext;
-
@Override
@Autowired
public void setService(INameService service) {
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
@RequestMapping(value = {"/portal/name/{uuid}"})
public class NamePortalController extends BaseController<TaxonName, INameService> {
- private static final Logger logger = LogManager.getLogger(NamePortalController.class);
+ private static final Logger logger = LogManager.getLogger();
private static final EntityInitStrategy DEFAULT_INIT_STRATEGY = new EntityInitStrategy(
"$",
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
@RequestMapping(value = {"/nomenclaturalStatus/{uuid}"})
public class NomenclaturalStatusController extends AbstractController<TaxonName, INameService> {
- private static final Logger logger = LogManager.getLogger(NomenclaturalStatusController.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
@Autowired
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
@RequestMapping(value = {"/occurrence/{uuid}"})
public class OccurrenceController extends AbstractIdentifiableController<SpecimenOrObservationBase, IOccurrenceService>{
- private static final Logger logger = LogManager.getLogger(OccurrenceController.class);
-
+ private static final Logger logger = LogManager.getLogger();
protected static final List<String> DEFAULT_INIT_STRATEGY = Arrays.asList(new String []{
"$",
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.remote.controller;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.search.spatial.impl.Rectangle;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@RequestMapping(value = {"/occurrence"})
public class OccurrenceListController extends AbstractIdentifiableListController<SpecimenOrObservationBase, IOccurrenceService> {
+ private static final Logger logger = LogManager.getLogger();
+
@Autowired
private ITaxonService taxonService;
* @param relationshipUuids a comma separated list of uuids e.g. CongruentTo; "60974c98-64ab-4574-bb5c-c110f6db634d"
* @param relationshipInversUuids a comma separated list of uuids
* @param maxDepth null for unlimited
- * @param pageIndex
- * @param pageSize
- * @param request
- * @param response
- * @return
- * @throws IOException
*/
@RequestMapping(
value = {"byAssociatedTaxon"},
return service.pageByAssociatedTaxon(null, includeRelationships, associatedTaxon,
maxDepth, pagerParams.getPageSize(), pagerParams.getPageIndex(),
orderHints, getInitializationStrategy());
-
}
@RequestMapping(value = "rootUnitDTOsByAssociatedTaxon", method = RequestMethod.GET)
/**
*
- * @param clazz
- * @param queryString
* @param boundingBox
* as
* minx(minlongitute),miny(minlatitute),maxx(maxlongitute),max(
* maxlatitute), e.g. 13.112,52.374,13.681,52.641 for the Berlin
* area
- * @param languages
- * @param highlighting
- * @param pageIndex
- * @param pageSize
- * @param request
- * @param response
- * @return
- * @throws IOException
- * @throws ParseException
*/
@RequestMapping(method = RequestMethod.GET, value={"findByFullText"})
public Pager<SearchResult<SpecimenOrObservationBase>> doFindByFullText(
@RequestMapping(value = {"/portal/occurrence/{uuid}"})
public class OccurrencePortalController extends OccurrenceController {
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static final List<String> DEFAULT_INIT_STRATEGY = Arrays.asList(new String []{
"$",
import java.util.Arrays;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.term.OrderedTermVocabulary;
BY_NOMENCLATURAL_ORDER_ASC(OrderHint.NOMENCLATURAL_SORT_ORDER),
BY_NOMENCLATURAL_ORDER_DESC(OrderHint.NOMENCLATURAL_SORT_ORDER_DESC);
- public static final Logger logger = LogManager.getLogger(OrderHintPreset.class);
+ private static final Logger logger = LogManager.getLogger();
private final List<OrderHint> orderHints;
*/
package eu.etaxonomy.cdm.remote.controller;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* @author a.kohlbecker
* @since 24.03.2011
- *
*/
@Controller
@Api("polytomousKey")
@RequestMapping(value = {"/polytomousKey/{uuid}"})
public class PolytomousKeyController extends AbstractIdentifiableController<PolytomousKey, IPolytomousKeyService> {
- public static final Logger logger = LogManager.getLogger(PolytomousKeyController.class);
+
+ private static final Logger logger = LogManager.getLogger();
@Override
@Autowired
public void setService(IPolytomousKeyService service) {
this.service = service;
}
-
-}
-
+}
\ No newline at end of file
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* @author a.kohlbecker
* @since 24.03.2011
- *
*/
@Controller
@Api("polytomousKey")
@RequestMapping(value = {"/polytomousKey"})
public class PolytomousKeyListController extends AbstractIdentifiableListController<PolytomousKey, IPolytomousKeyService> {
- public static final Logger logger = LogManager.getLogger(PolytomousKeyListController.class);
+ private static final Logger logger = LogManager.getLogger();
private ITaxonService taxonService;
Pager<PolytomousKey> pager = service.findByTaxonomicScope(taxon, pagerParameters.getPageSize(), pagerParameters.getPageIndex(), null, null);
return pager;
}
-
-}
-
+}
\ No newline at end of file
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
@Api(value="portal_polytomousKeyNode", description="Deprecated !")
@RequestMapping(value = {"/portal/polytomousKey/{uuid}"})
public class PolytomousKeyPortalController extends BaseController<PolytomousKey, IPolytomousKeyService> {
- public static final Logger logger = LogManager.getLogger(PolytomousKeyPortalController.class);
+
+ private static final Logger logger = LogManager.getLogger();
@Override
@Autowired
}
/**
- * @param uuid
- * @param request
- * @param response
- * @return
- * @throws IOException
* @Deprecated ONLY FOR TESTING PURPOSES
*/
@Deprecated
@RequestMapping(value = {"/registration"})
public class RegistrationController extends BaseController<Registration, IRegistrationService> {
- public static final Logger logger = LogManager.getLogger(RegistrationController.class);
+ private static final Logger logger = LogManager.getLogger();
public RegistrationController(){
setInitializationStrategy(Arrays.asList(new String[]{
public class RegistrationDTOController
extends AbstractController<Registration, IRegistrationService>{
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static final List<OrderHint> ORDER_BY_DATE_AND_ID = Arrays.asList(
new OrderHint("registrationDate", SortOrder.DESCENDING),
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping(value = { "/statistics" })
public class StatisticsController {
- private static final Logger logger = LogManager.getLogger(StatisticsController.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private IClassificationService classificationService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
@RequestMapping(value = {"/taxon/{uuid}"})
public class TaxonController extends AbstractIdentifiableController<TaxonBase, ITaxonService>{
- public static final Logger logger = LogManager.getLogger(TaxonController.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private IOccurrenceService occurrenceService;
HttpStatusMessage.UUID_REFERENCES_WRONG_TYPE.send(response);
return null;
}
-
-
-
-
-
+
+
+
+
+
}
protected EntityInitStrategy getTaxonNodeInitStrategy() {
import javax.servlet.http.HttpServletRequest;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
/**
* @author a.kohlbecker
* @since Oct 2, 2018
- *
*/
@Controller
@Api("taxonGraph")
@RequestMapping(value = {"/taxonGraph"})
public class TaxonGraphController {
-
- public static final Logger logger = LogManager.getLogger(TaxonGraphController.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ITaxonGraphService service;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.BooleanUtils;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
@RequestMapping(value = {"/taxon"})
public class TaxonListController extends AbstractIdentifiableListController<TaxonBase, ITaxonService> {
+ private static final Logger logger = LogManager.getLogger();
+
private static final List<String> SIMPLE_TAXON_INIT_STRATEGY = DEFAULT_INIT_STRATEGY;
protected List<String> getSimpleTaxonInitStrategy() {
// by BaseController
public class TaxonNodeController extends AbstractController<TaxonNode, ITaxonNodeService> {
- public static final Logger logger = LogManager.getLogger(TaxonNodeController.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
@Autowired
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Deprecated
@Component
public class TaxonNodePrintAppController extends AbstractController<TaxonNode, ITaxonNodeService> {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TaxonNodePrintAppController.class);
-
private static final List<String> NODE_INIT_STRATEGY = Arrays.asList(new String[]{
"taxon.secSource.citation",
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
@RequestMapping(value = {"/portal/taxon/{uuid}"})
public class TaxonPortalController extends TaxonController{
- public static final Logger logger = LogManager.getLogger(TaxonPortalController.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private INameService nameService;
"taxonNodes.source.citation.inReference.authorship",
"acceptedTaxon.taxonNodes.classification",
"secSource.nameUsedInSource"
-
+
}));
@Override
//
// return mediafilteredForPreferredRepresentations;
// }
-
+
@RequestMapping(
value = {"media"},
method = RequestMethod.GET)
includeTaxonDescriptions, includeOccurrences, false, includeTaxonNameDescriptions,
response, taxonInitStrategy, mediaInitStrategy);
}
-
+
public EntityMediaContext<Taxon> loadMediaForTaxonAndRelated(UUID taxonUuid,
UuidList relationshipUuids, UuidList relationshipInversUuids,
Boolean includeTaxonDescriptions, Boolean includeOccurrences, Boolean includeOriginals, Boolean includeTaxonNameDescriptions,
return listMediaForTaxon(taxon, includeRelationships, includeTaxonDescriptions, includeOccurrences, false, includeTaxonNameDescriptions, propertyPath);
}
-
+
private List<Media> listMediaForTaxon(Taxon taxon, Set<TaxonRelationshipEdge> includeRelationships,
Boolean includeTaxonDescriptions, Boolean includeOccurrences, Boolean includeOriginals, Boolean includeTaxonNameDescriptions, List<String> propertyPath) {
*/
package eu.etaxonomy.cdm.remote.controller;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Api("termNode")
@RequestMapping(value = {"/termNode/{uuid}"})
public class TermNodeController extends BaseController<TermNode, ITermNodeService> {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TermNodeController.class);
@Override
@Autowired
package eu.etaxonomy.cdm.remote.controller;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import eu.etaxonomy.cdm.model.term.TermTree;
import io.swagger.annotations.Api;
-
@Controller
@Api("termTree")
@RequestMapping(value = {"/termTree/{uuid}"})
public class TermTreeController extends AbstractIdentifiableController<TermTree, ITermTreeService> {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TermTreeController.class);
@Override
@Autowired
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping(value = {"/termTree"})
public class TermTreeListController extends AbstractIdentifiableListController<TermTree, ITermTreeService> {
+ private static final Logger logger = LogManager.getLogger();
+
@Override
@Autowired
public void setService(ITermTreeService service) {
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
@RequestMapping(value = {"/portal/termTree/{uuid}"})
public class TermTreePortalController extends TermTreeController {
- public static final Logger logger = LogManager.getLogger(TermTreePortalController.class);
-
+ private static final Logger logger = LogManager.getLogger();
private static final List<String> TERMTREE_INIT_STRATEGY = Arrays.asList(
new String[]{
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.FilenameUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
/**
* @author a.kohlbecker
* @since Jul 31, 2018
- *
*/
@Controller
@Api(value = "typeDesignation")
/* can not use BaseController since the getMethod needs to call service.loadTypeDesignation() which is generically not possible */
public class TypeDesignationController extends AbstractController<TaxonName, INameService> {
-
- private static final Logger logger = LogManager.getLogger(TypeDesignationController.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
@Autowired
}
}
}
-
}
return dtos;
}
Pager<Annotation> p = pagerForSubCollectionOf(dtb.getAnnotations(), pageIndex, pageSize, response);
return p;
}
-
-}
+}
\ No newline at end of file
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
/**
* @author a.kohlbecker
* @since 22.07.2010
- *
*/
@Controller
@Api("termVocabulary")
@RequestMapping(value = {"/termVocabulary/{uuid}"})
public class VocabularyController extends AbstractIdentifiableController<TermVocabulary, IVocabularyService> {
- public static final Logger logger = LogManager.getLogger(VocabularyController.class);
-
+ private static final Logger logger = LogManager.getLogger();
@Autowired
@Override
this.service = service;
}
-
@RequestMapping(value="terms", method=RequestMethod.GET, params="orderBy")
public Pager<DefinedTermBase> terms(
@PathVariable("uuid")UUID uuid,
return pager;
}
-
-}
+}
\ No newline at end of file
*/
package eu.etaxonomy.cdm.remote.controller;
-import io.swagger.annotations.Api;
-
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import eu.etaxonomy.cdm.api.service.IVocabularyService;
import eu.etaxonomy.cdm.model.term.TermVocabulary;
+import io.swagger.annotations.Api;
/**
* @author a.kohlbecker
* @since 22.07.2010
- *
*/
@Controller
@Api("termVocabulary")
@RequestMapping(value = {"/termVocabulary"})
public class VocabularyListController extends AbstractIdentifiableListController<TermVocabulary, IVocabularyService> {
- public static final Logger logger = LogManager.getLogger(VocabularyListController.class);
+ private static final Logger logger = LogManager.getLogger();
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.remote.controller.AbstractListController#setService(eu.etaxonomy.cdm.api.service.IService)
- */
@Autowired
@Override
public void setService(IVocabularyService service) {
-/*
+/**
* Copyright EDIT
* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ResourceLoaderAware;
private final static long DAY_IN_MILLIS = HOUR_IN_MILLIS * 24;
- private static final Logger logger = LogManager.getLogger(DwcaExportController.class);
+ private static final Logger logger = LogManager.getLogger();
/**
* Helper method, which allows to convert strings directly into uuids.
extends AbstractController<TaxonName, INameService>
implements ResourceLoaderAware {
- private static final Logger logger = LogManager.getLogger(NameCatalogueController.class);
+ private static final Logger logger = LogManager.getLogger();
private ResourceLoader resourceLoader;
/** Taxonomic status 'accepted' string */
- public static final String ACCEPTED_NAME_STATUS = "accepted";
+ private static final String ACCEPTED_NAME_STATUS = "accepted";
/** Taxonomic status 'synonym' string */
- public static final String SYNONYM_STATUS = "synonym";
+ private static final String SYNONYM_STATUS = "synonym";
/** Flag 'doubtful' strings */
- public static final String DOUBTFUL_FLAG = "doubtful";
+ private static final String DOUBTFUL_FLAG = "doubtful";
/** Base scientific name search type */
public static final String NAME_SEARCH = "name";
/** Complete scientific name search type */
- public static final String TITLE_SEARCH = "title";
+ private static final String TITLE_SEARCH = "title";
/** Default name search type */
- public static final String DEFAULT_SEARCH_TYPE = NAME_SEARCH;
+ private static final String DEFAULT_SEARCH_TYPE = NAME_SEARCH;
/** Default max number of hits for the exact name search */
- public static final String DEFAULT_MAX_NB_FOR_EXACT_SEARCH = "100";
+ private static final String DEFAULT_MAX_NB_FOR_EXACT_SEARCH = "100";
/** Classifcation 'default' key */
- public static final String CLASSIFICATION_DEFAULT = "default";
+ private static final String CLASSIFICATION_DEFAULT = "default";
/** Classifcation 'all' key */
- public static final String CLASSIFICATION_ALL = "all";
+ private static final String CLASSIFICATION_ALL = "all";
/** Classification to include uuids key */
- public static final String INCLUDE_CLUUIDS = "cluuids";
+ private static final String INCLUDE_CLUUIDS = "cluuids";
/** Fuzzy Name Cache search */
- public static final String FUZZY_NAME_CACHE = "name";
+ private static final String FUZZY_NAME_CACHE = "name";
/** Fuzzy Atomised Name search */
- public static final String FUZZY_ATOMISED = "atomised";
+ private static final String FUZZY_ATOMISED = "atomised";
private static final String DWC_DATASET_ID = "http://rs.tdwg.org/dwc/terms/datasetID";
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.core.io.Resource;
* @author p.kelbert
* @since March-2014
*/
-
@Controller
@Api("occurrence_catalogue")
@RequestMapping(value = { "/occurrence_catalogue" })
public class OccurrenceCatalogueController extends AbstractController<SpecimenOrObservationBase, IOccurrenceService> implements ResourceLoaderAware{
-
- private static final Logger logger = LogManager.getLogger(OccurrenceCatalogueController.class);
+ private static final Logger logger = LogManager.getLogger();
private ResourceLoader resourceLoader;
@RequestMapping(value = {"/dto/polytomousKey/"})
public class PolytomousKeyNodeDtoController extends AbstractController<PolytomousKey, IPolytomousKeyService> {
- public static final Logger logger = LogManager.getLogger(PolytomousKeyNodeDtoController.class);
+ private static final Logger logger = LogManager.getLogger();
private static final List<String> KEY_INIT_STRATEGY = Arrays.asList(new String[]{
"root.children"
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.ObjectUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@RequestMapping(value = { "/ext/bhl-e/" })
public class ExternalBhleController {
- public static final Logger logger = LogManager.getLogger(ExternalBhleController.class);
+ private static final Logger logger = LogManager.getLogger();
- public static String baseUrl = "http://gso.gbv.de/sru/DB=2.1/";
+ private static String baseUrl = "http://gso.gbv.de/sru/DB=2.1/";
- SruServiceWrapper sruServiceWrapper;
+ private SruServiceWrapper sruServiceWrapper;
/**
*
mv.addObject(referenceList);
return mv;
}
-
-}
+}
\ No newline at end of file
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.WebDataBinder;
@RequestMapping(value = { "ext/edit/mapServiceParameters/" })
public class ExternalGeoController extends BaseController<TaxonBase, ITaxonService> {
- public static final Logger logger = LogManager.getLogger(ExternalGeoController.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private IEditGeoService geoservice;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
* <p>
* @author a.kohlbecker
* @since 18.06.2009
- *
*/
@CrossOrigin(origins = "*")
@Controller
@RequestMapping(value = { "kml" })
public class KmlController extends BaseController<TaxonBase, ITaxonService> {
- public static final Logger logger = LogManager.getLogger(KmlController.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private IEditGeoService geoservice;
*/
public class ManifestComposer {
- public static final Logger logger = LogManager.getLogger(ManifestComposer.class);
+ private static final Logger logger = LogManager.getLogger();
private IMediaToolbox mediaTools;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.CrossOrigin;
@RequestMapping(value = {"/iiif"}, produces = "application/json; charset=utf-8")
public class ManifestController {
- private static final String HTTP_IIIF_CYBERTAXONOMY_ORG = "http://iiif.cybertaxonomy.org/";
+ private static final Logger logger = LogManager.getLogger();
- public static final Logger logger = LogManager.getLogger(ManifestController.class);
+ private static final String HTTP_IIIF_CYBERTAXONOMY_ORG = "http://iiif.cybertaxonomy.org/";
@InitBinder
public void initBinder(WebDataBinder binder) {
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.remote.controller.interceptor;
import java.util.regex.Matcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import eu.etaxonomy.cdm.database.NamedContextHolder;
*/
@Deprecated
public class DatasourceContextHandlerInterceptor extends HandlerInterceptorAdapter {
- private static final Logger logger = LogManager.getLogger(DatasourceContextHandlerInterceptor.class);
+
+ private static final Logger logger = LogManager.getLogger();
private final static Pattern basepathPattern = Pattern.compile("^/([^/]+)/.*");
return true;
}
-
-
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
NamedContextHolder.clearContextKey();
logger.info("datasource context cleared");
-
}
-}
+}
\ No newline at end of file
import java.util.Map;
import java.util.Set;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component // not used for component scan, see eu.etaxonomy.cdm.remote.config.CdmRemoteConfiguration
public class MediaToolbox implements IMediaToolbox {
- private static final Logger logger = LogManager.getLogger(MediaToolbox.class);
+ private static final Logger logger = LogManager.getLogger();
private List<MediaUriTransformation> transformations = null;
import eu.etaxonomy.cdm.common.monitor.RestServiceProgressMonitor;
import eu.etaxonomy.cdm.remote.controller.ProgressMonitorController;
import eu.etaxonomy.cdm.remote.json.JsonpRedirect;
-import eu.etaxonomy.cdm.remote.json.JsonpUtil;
+import eu.etaxonomy.cdm.remote.json.JsonUtil;
/**
* @author Andreas Kohlbecker
jsonpRedirect = new JsonpRedirect(request, monitorPath);
}
- boolean isJSONP = dataRedirect || JsonpUtil.readJsonpCallback(request) != null;
+ boolean isJSONP = dataRedirect || JsonUtil.readJsonpCallback(request) != null;
if(isJSONP){
response.setHeader("Location", jsonpRedirect.getRedirectURL());
mv.addObject(jsonpRedirect);
import javax.servlet.ServletContext;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.web.context.ServletContextAware;
import com.github.dozermapper.core.CustomConverter;
public class IdentifierConverter implements CustomConverter, ServletContextAware{
- private ServletContext servletContext;
+ private static final Logger logger = LogManager.getLogger();
- public static final Logger logger = LogManager.getLogger(IdentifierConverter.class);
+ private ServletContext servletContext;
@Override
public Object convert(Object destination, Object source, Class<?> destClass, Class<?> sourceClass) {
import java.util.Set;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacade;
import eu.etaxonomy.cdm.model.common.IdentifiableSource;
private OccurrenceSearchRequest request;
private final List<OccurrenceSearchResponse> response;
- public static final Logger logger = LogManager.getLogger();
public OccurrenceSearch() {
this.response = new ArrayList<OccurrenceSearchResponse>();
*/
public class CdmTypePropertyEditor extends PropertyEditorSupport {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Override
public void setAsText(String text) {
public class CdmExceptionResolver extends SimpleMappingExceptionResolver {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
public static String LSID_ERROR_CODE_HEADER = "LSID-Error-Code";
import java.util.List;
import java.util.Map;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.FactoryBean;
import eu.etaxonomy.cdm.remote.json.processor.bean.AbstractCdmBeanProcessor;
import net.sf.json.util.PropertyFilter;
/**
- *
* @author ben.clark
* @author a.kohlbecker
*/
public class JsonConfigFactoryBean implements FactoryBean<JsonConfig> {
- public static final Logger logger = LogManager.getLogger(JsonConfigFactoryBean.class);
+ private static final Logger logger = LogManager.getLogger();
private JsonConfig jsonConfig = null;
import javax.servlet.http.HttpServletRequest;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
/**
* @author a.kohlbecker
* @since Jan 26, 2017
- *
*/
-public class JsonpUtil {
-
- public static final Logger logger = LogManager.getLogger(JsonpUtil.class);
+public class JsonUtil {
- /**
- * @param request
- * @return
- */
static public String readJsonpCallback(HttpServletRequest request) {
String jsonpCallback= null;
String queryString = request.getQueryString();
}
return jsonpCallback;
}
-
-}
+}
\ No newline at end of file
*/
public abstract class AbstractBeanProcessor<T extends Object> implements JsonBeanProcessor{
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private Set<String> excludes = new HashSet<>();
*/
public class CdmLinkSourceBeanProcessor implements JsonBeanProcessor {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Override
public JSONObject processBean(Object bean, JsonConfig jsonConfig) {
*/
public class HibernateProxyBeanProcessor extends CycleSetAccess implements JsonBeanProcessor {
- public static final Logger logger = LogManager.getLogger(HibernateProxyBeanProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public JSONObject processBean(Object bean, JsonConfig jsonConfig) {
import java.util.Arrays;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Hibernate;
import eu.etaxonomy.cdm.api.service.l10n.LocaleContext;
/**
* @author a.kohlbecker
- *
*/
public class MediaBeanProcessor extends AbstractCdmBeanProcessor<Media> {
- public static final Logger logger = LogManager.getLogger(MediaBeanProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
private static final List<String> IGNORE_LIST = Arrays.asList(new String[] {
"title",
import java.util.List;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.term.Representation;
/**
* @author a.kohlbecker
- *
*/
public class RepresentationBeanProcessor extends AbstractCdmBeanProcessor<Representation> {
- public static final Logger logger = LogManager.getLogger(RepresentationBeanProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
private static final List<String> IGNORE_LIST = Arrays.asList(new String[] {
// "representations",
});
-
-
@Override
public List<String> getIgnorePropNames() {
return IGNORE_LIST;
return json;
}
-
-}
+}
\ No newline at end of file
import java.util.Arrays;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
import net.sf.json.JSONObject;
*/
public class TaxonBaseBeanProcessor extends AbstractCdmBeanProcessor<TaxonBase> {
- public static final Logger logger = LogManager.getLogger(TaxonBaseBeanProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
- private boolean skipTaggedTitle = false;
+ private boolean skipTaggedTitle = false;
- /**
- * @return the skipTaggedName
- */
public boolean isSkipTaggedTitle() {
return skipTaggedTitle;
}
-
- /**
- * @param skipTaggedName the skipTaggedName to set
- */
public void setSkipTaggedTitle(boolean skipTaggedTitle) {
this.skipTaggedTitle = skipTaggedTitle;
}
}
return json;
}
-
-}
+}
\ No newline at end of file
import java.util.Arrays;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.model.name.TaxonName;
import net.sf.json.JSONObject;
/**
* @author a.kohlbecker
- *
*/
public class TaxonNameBeanProcessor extends AbstractCdmBeanProcessor<TaxonName> {
- public static final Logger logger = LogManager.getLogger(TaxonNameBeanProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
private boolean skipTaggedName = false;
- /**
- * @return the skipTaggedName
- */
public boolean isSkipTaggedName() {
return skipTaggedName;
}
-
- /**
- * @param skipTaggedName the skipTaggedName to set
- */
public void setSkipTaggedName(boolean skipTaggedName) {
this.skipTaggedName = skipTaggedName;
}
json.element("nameCache", bean.getNameCache(), jsonConfig);
return json;
}
-
-}
+}
\ No newline at end of file
import java.util.Arrays;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Hibernate;
import eu.etaxonomy.cdm.api.service.l10n.LocaleContext;
/**
* @author n.hoffmann
* @since Apr 9, 2010
- * @version 1.0
*/
-public class TaxonNodeBeanProcessor extends AbstractCdmBeanProcessor<TaxonNode> implements IMultilanguageTextBeanProcessor {
+public class TaxonNodeBeanProcessor
+ extends AbstractCdmBeanProcessor<TaxonNode>
+ implements IMultilanguageTextBeanProcessor {
- private static final Logger logger = LogManager.getLogger(TaxonNodeBeanProcessor.class);
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
private static final List<String> IGNORE_LIST = Arrays.asList("text");
import java.util.Arrays;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Hibernate;
import eu.etaxonomy.cdm.api.service.l10n.TermRepresentation_L10n;
/**
* @author a.kohlbecker
- *
*/
public class TermBaseBeanProcessor extends AbstractCdmBeanProcessor<TermBase> {
- public static final Logger logger = LogManager.getLogger(TermBaseBeanProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
private static final List<String> IGNORE_LIST = Arrays.asList(new String[] {
"representations",
return json;
}
- /**
- * @param json
- * @param representation_L10n
- * @param term
- */
private void handleL10nRepresentation(JSONObject json, ITermRepresentation_L10n representation_L10n, boolean isInverse, TermBase term) {
String baseLabel = isInverse? "inverseRepresentation_L10n" : "representation_L10n";
if(representation_L10n.getLabel() != null || representation_L10n.getAbbreviatedLabel() != null) {
json.element(baseLabel,term.getClass().getSimpleName() + "<" + term.getUuid() + ">");
}
}
-
-}
+}
\ No newline at end of file
*/
public class CdmProxyBeanProcessorMatcher extends JsonBeanProcessorMatcher {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Override
public Object getMatch(Class target, Set set) {
/**
* Copyright (C) 2009 EDIT European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
- *
+ *
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.remote.json.processor.matcher;
import java.util.Set;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.proxy.HibernateProxy;
import net.sf.json.processors.JsonBeanProcessorMatcher;
/**
* @author a.kohlbecker
- *
*/
public class HibernateProxyBeanProcessorMatcher extends
JsonBeanProcessorMatcher {
- public static final Logger logger = LogManager.getLogger(HibernateProxyBeanProcessorMatcher.class);
-
- /* (non-Javadoc)
- * @see net.sf.json.processors.JsonBeanProcessorMatcher#getMatch(java.lang.Class, java.util.Set)
- */
+ private static final Logger logger = LogManager.getLogger();
+
@Override
public Object getMatch(Class target, Set set) {
-
+
if (HibernateProxy.class.isAssignableFrom(target)) {
logger.debug("Found HibernateProxy object of class " + target.getClass() + " returning " + HibernateProxy.class);
return HibernateProxy.class;
}
-
+
return DEFAULT.getMatch(target, set);
}
-
-}
+}
\ No newline at end of file
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.remote.json.processor.value;
import java.text.SimpleDateFormat;
import java.util.Calendar;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
import net.sf.json.JsonConfig;
import net.sf.json.processors.JsonValueProcessor;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
-
-
/**
* @author a.kohlbecker
* @since 20.01.2009
- * @version 1.0
*/
public class CalendarJSONValueProcessor implements JsonValueProcessor {
- private static Logger logger = LogManager.getLogger(DateTimeJSONValueProcessor.class);
+
+ private static final Logger logger = LogManager.getLogger();
private static SimpleDateFormat iso8601Format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz");
-
- /* (non-Javadoc)
- * @see net.sf.json.processors.JsonValueProcessor#processArrayValue(java.lang.Object, net.sf.json.JsonConfig)
- */
- public Object processArrayValue(Object object, JsonConfig jsonConfig) {
+
+ @Override
+ public Object processArrayValue(Object object, JsonConfig jsonConfig) {
if(object == null){
return "";
}
return CalendarJSONValueProcessor.iso8601Format.format(calendar.getTime());
}
- /* (non-Javadoc)
- * @see net.sf.json.processors.JsonValueProcessor#processObjectValue(java.lang.String, java.lang.Object, net.sf.json.JsonConfig)
- */
- public Object processObjectValue(String key, Object object, JsonConfig jsonConfig) {
+ @Override
+ public Object processObjectValue(String key, Object object, JsonConfig jsonConfig) {
if(object == null){
return "";
}
}
return CalendarJSONValueProcessor.iso8601Format.format(dateTime.getTime());
}
-}
+}
\ No newline at end of file
*/
package eu.etaxonomy.cdm.remote.json.processor.value;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
*/
public class DateTimeJSONValueProcessor implements JsonValueProcessor {
- @SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger(DateTimeJSONValueProcessor.class);
-
private static DateTimeFormatter iso8601Format = ISODateTimeFormat.dateTime();
@Override
*/
public class HibernateJSONValueProcessor implements JsonValueProcessor {
- public static final Logger logger = LogManager.getLogger(HibernateJSONValueProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
// public Object processArrayValue(Object object, JsonConfig jsonConfig) {
// if(Hibernate.isInitialized(object)) {
*/
package eu.etaxonomy.cdm.remote.json.processor.value;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.api.service.l10n.KeyTerm_L10n;
import eu.etaxonomy.cdm.model.taxon.TaxonNodeStatus;
*/
public class KeyTermValueProcessor implements JsonValueProcessor {
- public static final Logger logger = LogManager.getLogger(KeyTermValueProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public Object processArrayValue(Object value, JsonConfig jsonConfig) {
*/
public class PartialJSONValueProcessor implements JsonValueProcessor {
- private static Logger logger = LogManager.getLogger(PartialJSONValueProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public Object processArrayValue(Object object, JsonConfig jsonConfig) {
*/
package eu.etaxonomy.cdm.remote.json.processor.value;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.URI;
import net.sf.json.JsonConfig;
public class URIJSONValueProcessor implements JsonValueProcessor {
- private static final Logger logger = LogManager.getLogger(URIJSONValueProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public Object processArrayValue(Object obj, JsonConfig jsonConfig) {
public class UUIDJSONValueProcessor implements JsonValueProcessor {
- private static final Logger logger = LogManager.getLogger(UUIDJSONValueProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public Object processArrayValue(Object obj, JsonConfig jsonConfig) {
public class InitializedHibernatePropertyFilter implements PropertyFilter {
- private static final Logger logger = LogManager.getLogger(InitializedHibernatePropertyFilter.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public boolean apply(Object source, String name, Object value) {
@Component
public class RegistrableEntityFilter {
- private static Logger logger = LogManager.getLogger(RegistrableEntityFilter.class);
+ private static final Logger logger = LogManager.getLogger();
protected UserHelper userHelper;
import org.springframework.web.servlet.View;
import eu.etaxonomy.cdm.opt.config.DataSourceProperties;
-import eu.etaxonomy.cdm.remote.json.JsonpUtil;
+import eu.etaxonomy.cdm.remote.json.JsonUtil;
import net.sf.json.JSON;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
public class JsonView extends BaseView implements View {
+ private static final Logger logger = LogManager.getLogger();
+
static {
optOut_BEANUTILS_520();
}
BeanUtilsBean.setInstance(bub);
}
- public static final Logger logger = LogManager.getLogger(JsonView.class);
-
private JsonConfig jsonConfig;
private DataSourceProperties dataSourceProperties;
PrintWriter writer = response.getWriter();
// read jsonp parameter from the request
- String jsonpCallback = JsonpUtil.readJsonpCallback(request);
+ String jsonpCallback = JsonUtil.readJsonpCallback(request);
try {
// render
*/
package eu.etaxonomy.cdm.remote.view;
-
-
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
* run through a marshaller to produce xml or json
*
* @author b.clarke,c.mathew
- * @version 1.0.0
* @since 25-Nov-2012
*/
-
public class RdfView extends AbstractView {
//FIXME : the standard marshaller as defined in remote.xml is not used in web service views so it
import java.util.Set;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.hibernate.Hibernate;
import org.hibernate.HibernateException;
import org.hibernate.LazyInitializationException;
@SpringApplicationContext("file:./target/test-classes/eu/etaxonomy/cdm/applicationContext-test.xml")
public class AssemblerTest extends UnitilsJUnit4 {
- public static final Logger logger = LogManager.getLogger();
-
@SpringBeanByType
private Mapper mapper;
public class TestScriptRemote {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TestScriptRemote.class);
+ private static final Logger logger = LogManager.getLogger();
private void testNewConfigControler(){
*/
public abstract class CdmCacherBase implements ICdmUuidCacher {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
public static final String DEFAULT_CACHE_NAME = "cdmDefaultCache"; //TODO compare with CacheConfiguration where the name for the default cache is 'default', Why another name here?
// @EnableCaching // for future use
public class EhCacheConfiguration implements DisposableBean {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Autowired(required = false)
public DiskStoreConfiguration diskStoreConfiguration = null;
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.api.conversation;
import eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver;
-
/**
- * Objects implementing this class should hold a conversation.
- *
+ * Objects implementing this class should hold a conversation.
+ *
* @author n.hoffmann
* @since 17.03.2009
- * @version 1.0
*/
public interface IConversationEnabled extends ICdmPostDataChangeObserver {
-
- /**
+
+ /**
* @return the conversation holder
*/
public ConversationHolder getConversationHolder();
private static final String METER = "m";
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DerivedUnitFacade.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String notSupportMessage = "A specimen facade not supported exception has occurred at a place where this should not have happened. The developer should implement not support check properly during class initialization ";
/**
* Creates a derived unit facade for a new derived unit of type
* <code>type</code>.
- *
- * @param type
- * @return
*/
public static DerivedUnitFacade NewInstance(SpecimenOrObservationType type) {
return new DerivedUnitFacade(type, null, null);
/**
* Creates a derived unit facade for a new derived unit of type
* <code>type</code>.
- *
- * @param type
- * @return
*/
public static DerivedUnitFacade NewInstance(SpecimenOrObservationType type, FieldUnit fieldUnit) {
return new DerivedUnitFacade(type, fieldUnit, null);
* @param fieldUnit the field unit to use
* @param config the facade configurator to use
* //TODO are there any ambiguities to solve with defining a field unit or a configurator
- * @return
*/
public static DerivedUnitFacade NewInstance(SpecimenOrObservationType type, FieldUnit fieldUnit, DerivedUnitFacadeConfigurator config) {
return new DerivedUnitFacade(type, fieldUnit, config);
}
-
/**
* Creates a derived unit facade for a given derived unit using the default
* configuration.
import java.util.stream.Collectors;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.model.agent.Institution;
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
import eu.etaxonomy.cdm.strategy.StrategyBase;
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
-import eu.etaxonomy.cdm.strategy.cache.occurrence.DerivedUnitDefaultCacheStrategy;
/**
* @author a.mueller
private static final long serialVersionUID = 1578628591216605619L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DerivedUnitFacadeCacheStrategy.class);
+ private static final Logger logger = LogManager.getLogger();
private static final UUID uuid = UUID.fromString("df4672c1-ce5c-4724-af6d-91e2b326d4a4");
private boolean includeReferenceSystem = true;
private String collectionAccessionSeperator = ": ";
-
+
private boolean addTrailingDot = false;
-
+
public static DerivedUnitFacadeCacheStrategy NewInstance(){
return new DerivedUnitFacadeCacheStrategy();
}
public static DerivedUnitFacadeCacheStrategy NewInstance( boolean addTrailingDot, String collectionAccessionSeperator){
return new DerivedUnitFacadeCacheStrategy(addTrailingDot, collectionAccessionSeperator);
- }
+ }
-
//******************************* CONSTRUCTOR *******************************************/
//default value constructor
this.collectionAccessionSeperator = collectionAccessionSeperator;
}
}
-
@Override
public String getTitleCache(DerivedUnit derivedUnit) {
/**
* Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.api.facade;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
/**
* @author a.mueller
- *
*/
public class DerivedUnitFacadeConfigurator {
+
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DerivedUnitFacadeConfigurator.class);
-
-
+ private static final Logger logger = LogManager.getLogger();
+
public static DerivedUnitFacadeConfigurator NewInstance(){
return new DerivedUnitFacadeConfigurator();
}
-
-
+
private boolean moveFieldObjectMediaToGallery = false;
-
+
private boolean moveDerivedUnitMediaToGallery = false;
-
+
private boolean throwExceptionForNonSpecimenPreservationMethodRequest = true;
-
+
private boolean firePropertyChangeEvents = true;
-
+
//needed if inititialization via property paths is required
private IOccurrenceService occurrenceService;
-
- //for object initialization
+
+ //for object initialization
private List<String> propertyPaths;
-
- private DerivedUnitFacadeConfigurator(){
- //
- }
-
-// ************************ GETTER / SETTER **********************************
-
+ private DerivedUnitFacadeConfigurator(){}
+
+// ************************ GETTER / SETTER **********************************
+
public void setMoveFieldObjectMediaToGallery(
boolean moveFieldObjectMediaToGallery) {
this.moveFieldObjectMediaToGallery = moveFieldObjectMediaToGallery;
this.occurrenceService = occurrenceService;
}
-
/**
- * Needed for object initialization.
+ * Needed for object initialization.
* @see #getPropertyPaths()
- * @return
*/
public IOccurrenceService getOccurrenceService() {
return occurrenceService;
* Needed for object initialization.
* Also requires to set occurrence service
* @see #getOccurrenceService()
- * @return
*/
public List<String> getPropertyPaths() {
return propertyPaths;
public boolean isFirePropertyChangeEvents() {
return firePropertyChangeEvents;
}
-
-
-}
+}
\ No newline at end of file
/**
* Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
package eu.etaxonomy.cdm.api.facade;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
/**
- * This exception should be thrown if a derived unit facade can not be created or
+ * This exception should be thrown if a derived unit facade can not be created or
* initialized because the underlying data complexity is not supported by the facade.
- *
+ *
* @see MethodNotSupportedByDerivedUnitTypeException
- *
+ *
* @author a.mueller
* @since 17.05.2010
- *
*/
public class DerivedUnitFacadeNotSupportedException extends Exception {
- private static final long serialVersionUID = -2593445506656913492L;
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DerivedUnitFacadeNotSupportedException.class);
+ private static final long serialVersionUID = -2593445506656913492L;
- /**
- * @param arg0
- */
public DerivedUnitFacadeNotSupportedException(String arg0) {
super(arg0);
}
- /**
- * @param arg0
- */
public DerivedUnitFacadeNotSupportedException(Throwable arg0) {
super(arg0);
}
- /**
- * @param arg0
- * @param arg1
- */
public DerivedUnitFacadeNotSupportedException(String arg0, Throwable arg1) {
super(arg0, arg1);
}
-
-
-}
+}
\ No newline at end of file
/**
* Copyright (C) 2009 EDIT
-* European Distributed Institute of Taxonomy
+* European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
-*
+*
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
package eu.etaxonomy.cdm.api.facade;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
/**
* This exception should be thrown if a derived unit facade does not support a certain
* method because its derived unit type (specimenOrObservation type) does not support
* the functionality.
- *
+ *
* @see DerivedUnitFacadeNotSupportedException
- *
+ *
* @author a.mueller
* @since 17.05.2010
- *
*/
public class MethodNotSupportedByDerivedUnitTypeException extends Exception {
- private static final long serialVersionUID = -1135345372784107810L;
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(MethodNotSupportedByDerivedUnitTypeException.class);
+ private static final long serialVersionUID = -1135345372784107810L;
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
- /**
- * @param arg0
- */
public MethodNotSupportedByDerivedUnitTypeException(String arg0) {
super(arg0);
}
- /**
- * @param arg0
- */
public MethodNotSupportedByDerivedUnitTypeException(Throwable arg0) {
super(arg0);
}
- /**
- * @param arg0
- * @param arg1
- */
public MethodNotSupportedByDerivedUnitTypeException(String arg0, Throwable arg1) {
super(arg0, arg1);
}
-
-
-}
+}
\ No newline at end of file
*/
public class DebuggingRemoteInvocationExecutor implements RemoteInvocationExecutor {
- private static final Logger logger = LogManager.getLogger(DebuggingRemoteInvocationExecutor.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
public Object invoke(RemoteInvocation invocation, Object targetObject)
return invocationResult;
}
- /**
- * @param targetObject
- * @return
- */
private String targetCdmServiceInterfaces(Object targetObject) {
String interfacesStr = targetObject.getClass().getName();
if(interfacesStr.contains("$Proxy")){
}
return interfacesStr;
}
-
-
-
-
-}
+}
\ No newline at end of file
*/
public abstract class AbstractRequestTokenStore<T extends AbstractRequestToken, X extends Object> implements IAbstractRequestTokenStore<T, X> {
+ private static final Logger logger = LogManager.getLogger();
+
public static final int TOKEN_LENGTH = 50;
- protected static Logger logger = LogManager.getLogger();
- protected Map<String, T> tokenList = new HashMap<>();
- private Integer tokenLifetimeMinutes = null;
+ private Map<String, T> tokenList = new HashMap<>();
+
+ private Integer tokenLifetimeMinutes = null;
@Override
public T create(String userEmailAddress, X additionalData) {
import java.util.HashMap;
import java.util.Map;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.SessionFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Autowired;
@Service
@Transactional(readOnly = true)
public class DatabaseServiceHibernateImpl implements IDatabaseService, ApplicationContextAware {
- private static final Logger logger = LogManager.getLogger(DatabaseServiceHibernateImpl.class);
+
+ private static final Logger logger = LogManager.getLogger();
private static final String TMP_DATASOURCE = "tmp";
connection.close();
return object;
- }else{
+ } else {
throw new RuntimeException("Could not establish connection to database");
}
-
}
-
@Override
public Map<CdmMetaDataPropertyName, String> getCdmMetadataMap() throws CdmSourceException {
Map<CdmMetaDataPropertyName, String> cdmMetaDataMap = new HashMap<>();
}
return cdmMetaDataMap;
}
-
-}
+}
\ No newline at end of file
import java.util.HashSet;
import java.util.Set;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.model.common.CdmBase;
private static final long serialVersionUID = 8856465763413085548L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DeleteResult.class);
+ private static final Logger logger = LogManager.getLogger();
private final Set<CdmBase> relatedObjects = new HashSet<>();
private Set<CdmBase> deletedObjects = new HashSet<>();
*/
package eu.etaxonomy.cdm.api.service;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
extends AnnotatableServiceBase<DescriptionElementBase,IDescriptionElementDao>
implements IDescriptionElementService {
- private static final Logger logger = LogManager.getLogger(DescriptionElementServiceImpl.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
@Autowired
extends IdentifiableServiceBase<DescriptionBase,IDescriptionDao>
implements IDescriptionService {
- private static final Logger logger = LogManager.getLogger(DescriptionServiceImpl.class);
+ private static final Logger logger = LogManager.getLogger();
protected IDescriptionElementDao descriptionElementDao;
protected ITermTreeDao featureTreeDao;
+/**
+* Copyright (C) 2017 EDIT
+* European Distributed Institute of Taxonomy
+* http://www.e-taxonomy.eu
+*
+* The contents of this file are subject to the Mozilla Public License Version 1.1
+* See LICENSE.TXT at the top of this package for the full license terms.
+*/
package eu.etaxonomy.cdm.api.service;
import java.math.BigDecimal;
extends IdentifiableServiceBase<DescriptiveDataSet, IDescriptiveDataSetDao>
implements IDescriptiveDataSetService {
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private IOccurrenceService occurrenceService;
import java.util.Set;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.criterion.Criterion;
import org.springframework.transaction.annotation.Transactional;
extends AnnotatableServiceBase<T,DAO>
implements IIdentifiableEntityService<T>{
- protected static final int UPDATE_TITLE_CACHE_DEFAULT_STEP_SIZE = 1000;
- protected static final Logger logger = LogManager.getLogger(IdentifiableServiceBase.class);
+ private static final Logger logger = LogManager.getLogger();
+
+ protected static final int UPDATE_TITLE_CACHE_DEFAULT_STEP_SIZE = 1000;
@Override
@Transactional(readOnly = true)
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import eu.etaxonomy.cdm.model.term.TermVocabulary;
import eu.etaxonomy.cdm.persistence.dao.term.IDefinedTermDao;
import eu.etaxonomy.cdm.persistence.dao.term.IOrderedTermVocabularyDao;
-import eu.etaxonomy.cdm.persistence.dao.term.ITermVocabularyDao;
/**
* Quick and dirty implementation of a location service as needed by the editor.
public class LocationServiceImpl extends ServiceBase<DefinedTermBase,IDefinedTermDao> implements ILocationService {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(LocationServiceImpl.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
- protected ITermVocabularyDao vocabularyDao;
-
- @Autowired
- protected IDefinedTermDao definedTermDao;
-
- @Autowired
- protected IOrderedTermVocabularyDao orderedVocabularyDao;
+ private IOrderedTermVocabularyDao orderedVocabularyDao;
@Override
protected void setDao(IDefinedTermDao dao) {
return topLevelTerms;
}
-
-
-
-}
+}
\ No newline at end of file
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.api.service;
import java.io.IOException;
import java.util.stream.Collectors;
import org.apache.http.HttpException;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional(readOnly=true)
public class MediaServiceImpl extends IdentifiableServiceBase<Media,IMediaDao> implements IMediaService {
+ private static final Logger logger = LogManager.getLogger();
+
@Override
@Autowired
protected void setDao(IMediaDao dao) {
updatedObject = handleDeleteMedia(media, textData, description,
(IDescribable)objectToUpdate);
} else {
-
+
// this should not be happen, because it is not deletable. see isDeletable
result.setAbort();
}
}else if (ref instanceof MediaRepresentation){
continue;
}else {
-
+
result.setAbort();
}
extends IdentifiableServiceBase<TaxonName,ITaxonNameDao>
implements INameService {
- static private final Logger logger = LogManager.getLogger(NameServiceImpl.class);
+ static private final Logger logger = LogManager.getLogger();
@Autowired
private IOccurrenceService occurrenceService;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;
import eu.etaxonomy.cdm.format.description.DefaultCategoricalDescriptionBuilder;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.model.description.TextData;
import eu.etaxonomy.cdm.model.description.TextFormat;
-import eu.etaxonomy.cdm.model.term.TermTree;
import eu.etaxonomy.cdm.model.term.TermNode;
+import eu.etaxonomy.cdm.model.term.TermTree;
/**
*/
@Component
public class NaturalLanguageGenerator implements INaturalLanguageGenerator {
-
+
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(NaturalLanguageGenerator.class);
+ private static final Logger logger = LogManager.getLogger();
private String firstSeparator = ",";
private String secondSeparator = ".";
extends IdentifiableServiceBase<SpecimenOrObservationBase, IOccurrenceDao>
implements IOccurrenceService {
- static private final Logger logger = LogManager.getLogger(OccurrenceServiceImpl.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private IDescriptionService descriptionService;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
public class PreferenceServiceImpl implements IPreferenceService {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(PreferenceServiceImpl.class);
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private IPreferenceDao dao;
import java.util.Set;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional(readOnly = true)
public class ReferenceServiceImpl extends IdentifiableServiceBase<Reference,IReferenceDao> implements IReferenceService {
- static Logger logger = LogManager.getLogger(ReferenceServiceImpl.class);
+ private static final Logger logger = LogManager.getLogger();
- /**
- * Constructor
- */
public ReferenceServiceImpl(){
if (logger.isDebugEnabled()) { logger.debug("Load ReferenceService Bean"); }
}
public List<UuidAndTitleCache<Reference>> getUuidAndAbbrevTitleCacheForAuthor(Integer limit, String pattern, ReferenceType type) {
return dao.getUuidAndAbbrevTitleCacheForAuthor(limit, pattern, null);
}
-
+
@Override
public List<UuidAndTitleCache<Reference>> getUuidAndAbbrevTitleCacheForAuthorID(Integer limit, Integer authorID, ReferenceType type) {
return dao.getUuidAndAbbrevTitleCacheForAuthorID(limit, authorID, null);
return inReferenceType;
}
- /**
- * {@inheritDoc}
- */
@Override
public List<UuidAndTitleCache<Reference>> getUuidAndTitleCacheForUUIDS(Set<UUID> uuids, ReferenceType refType ) {
-
return dao.getUuidAndTitle(uuids, getInReferenceType(refType));
-
}
- /**
- * {@inheritDoc}
- */
@Override
public List<UuidAndTitleCache<Reference>> getUuidAndTitleCacheForUUIDS(Set<UUID> uuids ) {
return dao.getUuidAndTitle(uuids);
-
}
@Override
public List<Reference> findByTitleAndAbbrevTitle(IIdentifiableEntityServiceConfigurator<Reference> config){
return dao.findByTitleAndAbbrevTitle(config.getClazz(),config.getTitleSearchStringSqlized(), config.getMatchMode(), config.getCriteria(), config.getPageSize(), config.getPageNumber(), config.getOrderHints(), config.getPropertyPaths());
}
-
-}
+}
\ No newline at end of file
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* @author k.luther
* @since 15.02.2017
- *
*/
@Service
@Transactional(readOnly = true)
public class RightsServiceImpl extends AnnotatableServiceBase<Rights, IRightsDao> implements IRightsService {
- private static final Logger logger = LogManager.getLogger(RightsServiceImpl.class);
- /**
- * {@inheritDoc}
- */
+
+ private static final Logger logger = LogManager.getLogger();
+
@Override
@Autowired
protected void setDao(IRightsDao dao) {
public List<UuidAndTitleCache<Rights>> getUuidAndLabelText(Integer limit, String pattern){
return dao.getUuidAndTitleCache(limit, pattern);
}
-
-
-
-
-}
+}
\ No newline at end of file
implements IService<T>, ApplicationContextAware {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(ServiceBase.class);
+ private static final Logger logger = LogManager.getLogger();
protected ApplicationContext appContext;
package eu.etaxonomy.cdm.api.service;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional(readOnly = true)
public class ServiceImpl extends ServiceBase<CdmBase, ICdmEntityDao<CdmBase>> implements IService<CdmBase> {
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(ServiceImpl.class);
+
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
//@Autowired
//@Qualifier("mainDao")
@Transactional
public class StatisticsServiceImpl implements IStatisticsService {
- private static final Logger logger = LogManager.getLogger(StatisticsServiceImpl.class);
+ private static final Logger logger = LogManager.getLogger();
// this does not make sense, we just count nothing if no type is given.
// the one who calls this service should check that there are types given!
implements ITermNodeService {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TermNodeServiceImpl.class);
+ private static final Logger logger = LogManager.getLogger();
@Override
@Autowired
implements ITermService{
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TermServiceImpl.class);
+ private static final Logger logger = LogManager.getLogger();
private ILanguageStringDao languageStringDao;
public class UpdateResult implements Serializable{
private static final long serialVersionUID = -7040027587709706700L;
-
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(UpdateResult.class);
+ private static final Logger logger = LogManager.getLogger();
private Status status = Status.OK;
import java.io.Serializable;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
-
/**
* Base class for delete configurators.
*
public abstract class DeleteConfiguratorBase implements Serializable {
private static final long serialVersionUID = 8841790311273474123L;
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DeleteConfiguratorBase.class);
-
}
-/**\r
- * Copyright (C) 2009 EDIT\r
- * European Distributed Institute of Taxonomy \r
- * http://www.e-taxonomy.eu\r
- * \r
- * The contents of this file are subject to the Mozilla Public License Version 1.1\r
- * See LICENSE.TXT at the top of this package for the full license terms.\r
- */\r
-\r
-package eu.etaxonomy.cdm.api.service.config;\r
-\r
-import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;\r
-\r
-\r
-/**\r
- * @author a.babadshanjan\r
- * @since 03.03.2009\r
- * @version 1.0\r
- */\r
-public class IdentifiableServiceConfiguratorFactory{\r
-\r
- public static <T extends IIdentifiableEntity> IdentifiableServiceConfiguratorImpl<T> getConfigurator(Class<T> clazz){\r
- return new IdentifiableServiceConfiguratorImpl<T>();\r
- }\r
-}\r
+/**
+ * Copyright (C) 2009 EDIT
+ * European Distributed Institute of Taxonomy
+ * http://www.e-taxonomy.eu
+ *
+ * The contents of this file are subject to the Mozilla Public License Version 1.1
+ * See LICENSE.TXT at the top of this package for the full license terms.
+ */
+package eu.etaxonomy.cdm.api.service.config;
+
+import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
+
+/**
+ * @author a.babadshanjan
+ * @since 03.03.2009
+ */
+public class IdentifiableServiceConfiguratorFactory{
+
+ public static <T extends IIdentifiableEntity> IdentifiableServiceConfiguratorImpl<T> getConfigurator(Class<T> clazz){
+ return new IdentifiableServiceConfiguratorImpl<T>();
+ }
+}
\ No newline at end of file
*/
package eu.etaxonomy.cdm.api.service.config;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.api.service.INameService;
public class NameDeletionConfigurator extends DeleteConfiguratorBase {
private static final long serialVersionUID = 76414245247942488L;
-
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(NameDeletionConfigurator.class);
+ private static final Logger logger = LogManager.getLogger();
private boolean removeAllNameRelationships = false;
private boolean ignoreIsBasionymFor = false;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.api.service.ITaxonService;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
public class TaxonDeletionConfigurator extends TaxonBaseDeletionConfigurator {
private static final long serialVersionUID = -4932682946459109886L;
-
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TaxonDeletionConfigurator.class);
-
+ private static final Logger logger = LogManager.getLogger();
private boolean deleteSynonymsIfPossible = true;
*/
package eu.etaxonomy.cdm.api.service.config;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
private static final long serialVersionUID = 1187266117499706532L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TaxonNodeDeletionConfigurator.class);
+ private static final Logger logger = LogManager.getLogger();
public boolean isDeleteTaxon() {
return isDeleteElement();
*/
package eu.etaxonomy.cdm.api.service.config;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.api.service.ITermService;
private static final long serialVersionUID = 213038079829537335L;
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(TermDeletionConfigurator.class);
+ private static final Logger logger = LogManager.getLogger();
private boolean deleteIncludedTerms = false;
*/
public abstract class DescriptionAggregationBase<T extends DescriptionAggregationBase<T, CONFIG>, CONFIG extends DescriptionAggregationConfigurationBase<T>> {
- public static final Logger logger = LogManager.getLogger(DescriptionAggregationBase.class);
+ private static final Logger logger = LogManager.getLogger();
private static final long BATCH_MIN_FREE_HEAP = 150 * 1024 * 1024; //800 MB
/**
public class DistributionAggregation
extends DescriptionAggregationBase<DistributionAggregation,DistributionAggregationConfiguration>{
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
- protected static final List<String> TAXONDESCRIPTION_INIT_STRATEGY = Arrays.asList(new String [] {
+ private static final List<String> TAXONDESCRIPTION_INIT_STRATEGY = Arrays.asList(new String [] {
"description.elements.area",
"description.elements.status",
"description.elements.sources.citation.authorship",
import java.util.Set;
import java.util.stream.Collectors;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
import eu.etaxonomy.cdm.common.BigDecimalUtil;
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
public class StructuredDescriptionAggregation
extends DescriptionAggregationBase<StructuredDescriptionAggregation, StructuredDescriptionAggregationConfiguration>{
+ private static final Logger logger = LogManager.getLogger();
+
private DescriptiveDataSet dataSet;
@Override
import java.util.List;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.CdmUtils;
import eu.etaxonomy.cdm.common.URI;
private static final long serialVersionUID = 8329871164348514709L;
- private static final Logger logger = LogManager.getLogger(DerivationTreeSummaryDTO.class);
+ private static final Logger logger = LogManager.getLogger();
private List<Link> specimenScans = new ArrayList<>();
private List<MolecularData> molecularDataList = new ArrayList<>();
}
return derivateDataDTO;
}
-
+
// private void updateDerivateTree(Set<DerivedUnitDTO> derivatives) {
// for (DerivedUnitDTO childDerivate : derivatives) {
// DerivationTreeSummaryDTO childTree = childDerivate.getDerivationTreeSummary();
// this.addDetailImage(null, null);
// }
// }
-//
+//
// // assemble molecular data
// //pattern: DNAMarker [contig1, primer1_1, primer1_2, ...][contig2, primer2_1, ...]...
// if (childDerivate instanceof DNASampleDTO) {
// // TODO implement TissueSample assembly for web service
// }
// if (childDerivate.getRecordBase() == SpecimenOrObservationType.DnaSample) {
-//
+//
// for (SequenceDTO sequence : dna.getSequences()) {
// URI boldUri = null;
// try {
// }
// // assemble media data
// else if (childDerivate.hasDetailImage) {
-//
-//
+//
+//
// // specimen scan
// if (childDerivate.getKindOfUnit().getUuid().equals(DefinedTerm.uuidSpecimenScan)) {
// this.addSpecimenScanUuid(childDerivate.get);
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.SessionFactory;
import org.hibernate.StatelessSession;
import org.hibernate.query.Query;
/**
* @author a.kohlbecker
* @since Dec 12, 2017
- *
*/
public class RegistrationIdentifierMinter implements IdentifierMinter<String> {
- private static final Logger logger = LogManager.getLogger(RegistrationIdentifierMinter.class);
+ private static final Logger logger = LogManager.getLogger();
enum Method {
naturalNumberIncrement
}
private SessionFactory factory;
+
@Autowired
protected void setSessionFactory (SessionFactory factory){
this.factory = factory;
}
- Integer minLocalId = 1;
+ private Integer minLocalId = 1;
- Integer maxLocalId = Integer.MAX_VALUE;
+ private Integer maxLocalId = Integer.MAX_VALUE;
- String identifierFormatString = null;
+ private String identifierFormatString = null;
- Method method = Method.naturalNumberIncrement;
+ private Method method = Method.naturalNumberIncrement;
private Pattern identifierPattern;
- /**
- * {@inheritDoc}
- */
@Override
public void setMinLocalId(String min) {
if (min == null){
}
}
- /**
- * {@inheritDoc}
- */
@Override
public void setMaxLocalId(String max) {
if (max == null){
}
}
- /**
- * {@inheritDoc}
- */
@Override
synchronized public Identifier<String> mint() throws OutOfIdentifiersException {
}
}
- /**
- *
- */
protected Identifier<String> mintByNaturalNumberIncrement() {
Integer localid = null;
Object result = null;
return identifierPattern;
}
- /**
- * @return the identifierFormatString
- */
public String getIdentifierFormatString() {
return identifierFormatString;
}
-
- /**
- * @param identifierFormatString the identifierFormatString to set
- */
public void setIdentifierFormatString(String identifierFormatString) {
this.identifierFormatString = identifierFormatString;
}
-
-
-}
+}
\ No newline at end of file
import java.util.List;
import java.util.Set;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.Hibernate;
import eu.etaxonomy.cdm.model.common.Language;
*/
public class TermRepresentation_L10n implements ITermRepresentation_L10n {
- public static final Logger logger = LogManager.getLogger(TermRepresentation_L10n.class);
+ private static final Logger logger = LogManager.getLogger();
String label = null;
String abbreviatedLabel = null;
/**
* Shortcut for {@link #from(TermBase, boolean)} with <code>useInverseRepresentation = false</code>.
- *
- * @param term
- * @return
*/
public static TermRepresentation_L10n from(TermBase term) {
return TermRepresentation_L10n.from(term, false);
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.api.service.lsid.impl;
import java.util.Date;
import javax.wsdl.WSDLException;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import eu.etaxonomy.cdm.model.common.LSID;
import eu.etaxonomy.cdm.model.common.LSIDAuthority;
import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;
+
/**
- *
* @author Ben Szekely (<a href="mailto:bhszekel@us.ibm.com">bhszekel@us.ibm.com</a>)
* @author ben
- *
*/
@Service("lsidAuthorityService")
@Transactional
public class LsidAuthorityServiceImpl implements LSIDAuthorityService {
- @SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger(LsidAuthorityServiceImpl.class);
- private String lsidDomain;
+
+ @SuppressWarnings("unused")
+ private static final Logger logger = LogManager.getLogger();
+
+ private String lsidDomain;
private Integer lsidPort;
private LSIDRegistry lsidRegistry;
private LSIDWSDLWrapperFactory lsidWSDLWrapperFactory;
/**
* Copyright (C) 2009 EDIT
- * European Distributed Institute of Taxonomy
+ * European Distributed Institute of Taxonomy
* http://www.e-taxonomy.eu
- *
+ *
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
import java.io.ByteArrayInputStream;
import java.io.InputStream;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service("lsidDataService")
@Transactional
public class LsidDataServiceImpl implements LSIDDataService {
- private static final Logger logger = LogManager.getLogger(LsidDataServiceImpl.class);
+
+ private static final Logger logger = LogManager.getLogger();
private LSIDRegistry lsidRegistry;
-
+
@Autowired
public void setLsidRegistry(LSIDRegistry lsidRegistry) {
this.lsidRegistry = lsidRegistry;
}
- public InputStream getData(LSID lsid) throws LSIDServerException {
+ @Override
+ public InputStream getData(LSID lsid) throws LSIDServerException {
IIdentifiableDao<?> identfiableDAO = lsidRegistry.lookupDAO(lsid);
if(identfiableDAO == null) { // we do not have a mapping for lsids with this authority or namespace
throw new LSIDServerException(LSIDException.UNKNOWN_LSID, "Unknown LSID");
}
-
+
try {
IIdentifiableEntity i = identfiableDAO.find(lsid);
if(i == null) { // we have a mapping for lsids with this authority and namespace, but no lsid stored
throw new LSIDServerException(LSIDException.UNKNOWN_LSID, "Unknown LSID");
}
-
+
if(i.getData() != null) {
return new ByteArrayInputStream(i.getData());
} else {
}
}
- public InputStream getDataByRange(LSID lsid, Integer start, Integer length)
+ @Override
+ public InputStream getDataByRange(LSID lsid, Integer start, Integer length)
throws LSIDServerException {
IIdentifiableDao<?> identfiableDAO = lsidRegistry.lookupDAO(lsid);
if(identfiableDAO == null) { // we do not have a mapping for lsids with this authority or namespace
throw new LSIDServerException(LSIDException.UNKNOWN_LSID, "Unknown LSID");
}
-
+
try {
IIdentifiableEntity i = identfiableDAO.find(lsid);
if(i == null) { // we have a mapping for lsids with this authority and namespace, but no lsid stored
}
}
- public void initService(LSIDServiceConfig arg0) throws LSIDServerException {
+ @Override
+ public void initService(LSIDServiceConfig arg0) throws LSIDServerException {
//TODO
logger.warn("initService(LSIDServiceConfig) not yet implemented");
}
import java.util.List;
import org.apache.http.HttpException;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Component;
import eu.etaxonomy.cdm.common.URI;
@Component
public class MediaInfoFactory implements IMediaInfoFactory {
- private static final Logger logger = LogManager.getLogger(MediaInfoFactory.class);
+ private static final Logger logger = LogManager.getLogger();
/**
* TODO needs to be managed in CDM PREFERENCES per service and version.
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpException;
import org.apache.http.client.ClientProtocolException;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.UriUtils;
*/
public class MediaInfoFileReader extends AbstactMediaMetadataReader {
- private static Logger logger = LogManager.getLogger(MediaInfoFileReader.class);
+ private static final Logger logger = LogManager.getLogger();
public static final Integer IMAGE_READ_TIMEOUT = 3000; // ms
import java.io.InputStream;
import org.apache.http.HttpException;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.cybertaxonomy.media.info.model.MediaInfo;
import com.fasterxml.jackson.databind.ObjectMapper;
*/
public class MediaInfoServiceReader extends AbstactMediaMetadataReader {
- private static final Logger logger = LogManager.getLogger(MediaInfoServiceReader.class);
+ private static final Logger logger = LogManager.getLogger();
static private Mapper dozerMapper;
import java.util.Optional;
import java.util.regex.Matcher;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.common.URI;
import eu.etaxonomy.cdm.model.media.ImageFile;
*/
public class MediaUriTransformationProcessor {
- private static final Logger logger = LogManager.getLogger(MediaUriTransformationProcessor.class);
+ private static final Logger logger = LogManager.getLogger();
private List<MediaUriTransformation> transformations = new ArrayList<>();
import java.util.ArrayList;
import java.util.List;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.hibernate.criterion.Criterion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import eu.etaxonomy.cdm.api.service.AnnotatableServiceBase;
-import eu.etaxonomy.cdm.api.service.PreferenceServiceImpl;
import eu.etaxonomy.cdm.api.service.pager.Pager;
import eu.etaxonomy.cdm.api.service.pager.impl.AbstractPagerImpl;
import eu.etaxonomy.cdm.api.service.pager.impl.DefaultPagerImpl;
/**
* @author pplitzner
* @since 11.03.2014
- *
*/
@Service
@Transactional(readOnly = true)
public class PrimerServiceImpl extends AnnotatableServiceBase<Primer, IPrimerDao> implements IPrimerService{
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(PreferenceServiceImpl.class);
@Override
public List<UuidAndTitleCache<Primer>> getPrimerUuidAndTitleCache() {
import java.util.Map.Entry;
import java.util.UUID;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import eu.etaxonomy.cdm.api.service.AnnotatableServiceBase;
import eu.etaxonomy.cdm.api.service.DeleteResult;
-import eu.etaxonomy.cdm.api.service.IOccurrenceService;
-import eu.etaxonomy.cdm.api.service.PreferenceServiceImpl;
import eu.etaxonomy.cdm.api.service.UpdateResult;
import eu.etaxonomy.cdm.api.service.UpdateResult.Status;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
/**
* @author pplitzner
* @since 11.03.2014
- *
*/
@Service
@Transactional(readOnly = true)
public class SequenceServiceImpl extends AnnotatableServiceBase<Sequence, ISequenceDao> implements ISequenceService{
- @SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(PreferenceServiceImpl.class);
@Autowired
- IOccurrenceService occurrenceService;
-
- @Autowired
- ISingleReadDao singleReadDao;
+ private ISingleReadDao singleReadDao;
@Override
@Autowired
}
return deleteSingleRead(singleRead, sequence);
}
-
-}
+}
\ No newline at end of file
@Transactional
public class CdmMassIndexer implements ICdmMassIndexer {
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private final Set<Class<? extends CdmBase>> indexedClasses = new HashSet<>();
import java.io.IOException;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.DocIdSetIterator;
*
* @author a.kohlbecker
* @since Sep 24, 2013
- *
*/
public class DocIdBitSetPrinter {
- public static final Logger logger = LogManager.getLogger(DocIdBitSetPrinter.class);
+ private static final Logger logger = LogManager.getLogger();
public static String docsAsString(DocIdSet docset, int maxdocs){
return sb.toString();
}
-
-}
+}
\ No newline at end of file
import java.util.List;
import java.util.Set;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.MultiReader;
*/
public class LuceneMultiSearch extends LuceneSearch {
- public static final Logger logger = LogManager.getLogger(LuceneMultiSearch.class);
+ private static final Logger logger = LogManager.getLogger();
private final Set<Class<? extends CdmBase>> directorySelectClasses = new HashSet<>();
import java.util.Arrays;
import java.util.Collection;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.BooleanClause.Occur;
import eu.etaxonomy.cdm.model.taxon.TaxonBase;
/**
- *
* @author Andreas Kohlbecker
* @since Dec 21, 2011
- *
*/
public class LuceneSearch {
- public static final Logger logger = LogManager.getLogger(LuceneSearch.class);
+ private static final Logger logger = LogManager.getLogger();
public final static String ID_FIELD = "id";
*/
public class QueryFactory {
- public static final Logger logger = LogManager.getLogger(QueryFactory.class);
+ private static final Logger logger = LogManager.getLogger();
- protected ILuceneIndexToolProvider toolProvider;
+ private ILuceneIndexToolProvider toolProvider;
- Set<String> textFieldNames = new HashSet<>();
+ private Set<String> textFieldNames = new HashSet<>();
- Map<Class<? extends CdmBase>, IndexSearcher> indexSearcherMap = new HashMap<>();
+ private Map<Class<? extends CdmBase>, IndexSearcher> indexSearcherMap = new HashMap<>();
private final Class<? extends CdmBase> cdmBaseType;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.search.MultiTermQuery;
*/
public class SearchResultBuilder implements ISearchResultBuilder {
- public static final Logger logger = LogManager.getLogger(SearchResultBuilder.class);
+ private static final Logger logger = LogManager.getLogger();
private Query query;
/**
import java.util.Map;
import org.apache.commons.lang.StringUtils;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.document.Document;
import org.apache.lucene.search.highlight.TokenStreamFromTermVector;
/**
- *
* @author Andreas Kohlbecker
- *
*/
public class SearchResultHighligther {
- public static final Logger logger = LogManager.getLogger(SearchResultHighligther.class);
+ private static final Logger logger = LogManager.getLogger();
public Map<String,String[]> getFragmentsWithHighlightedTerms(Analyzer analyzer, Query query, String[] fieldNames, Document doc, int fragmentNumber, int fragmentSize){
*/
@Service
@Transactional(readOnly = true)
-public class AccountRegistrationService extends AccountSelfManagementService implements IAccountRegistrationService {
+public class AccountRegistrationService
+ extends AccountSelfManagementService
+ implements IAccountRegistrationService {
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static final String EMAIL_EXISTS = "An account for this email address already exits.";
public abstract class AccountSelfManagementService implements IRateLimitedService {
@SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
- public static final int RATE_LIMTER_TIMEOUT_SECONDS = 2;
+ private static final int RATE_LIMTER_TIMEOUT_SECONDS = 2;
- public static final double PERMITS_PER_SECOND = 0.3;
+ private static final double PERMITS_PER_SECOND = 0.3;
@Autowired
protected IUserDao userDao;
@Transactional(readOnly = false)
public class PasswordResetService extends AccountSelfManagementService implements IPasswordResetService {
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Autowired
@Qualifier("passwordResetTokenStore")
extends AbstractHibernateTaxonGraphProcessor
implements BeforeTransactionCompletionProcess {
- private static final Logger logger = LogManager.getLogger(TaxonGraphBeforeTransactionCompleteProcess.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String[] TAXONNAME_NAMEPARTS_OR_RANK_PROPS = new String[]{"genusOrUninomial", "specificEpithet", "rank"};
private static final String[] TAXONNAME_NOMENCLATURALSOURCE = new String[]{"nomenclaturalSource"};
import java.util.UUID;
import java.util.stream.Collectors;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional(readOnly = true)
public class TaxonGraphServiceImpl implements ITaxonGraphService {
- static private final Logger logger = LogManager.getLogger(TaxonGraphServiceImpl.class);
-
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ITaxonGraphDao taxonGraphDao;
public class CdmUserHelper implements UserHelper, Serializable {
private static final long serialVersionUID = -2521474709047255979L;
-
- public static final Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
@Autowired
private ICdmPermissionEvaluator permissionEvaluator;
@Autowired
@Lazy
@Qualifier("cdmRepository")
- protected CdmRepository repo;
+ private CdmRepository repo;
private AuthenticationProvider runAsAuthenticationProvider;
runAsAutheticator.setRunAsAuthenticationProvider(runAsAuthenticationProvider);
}
- RunAsAuthenticator runAsAutheticator = new RunAsAuthenticator();
+ private RunAsAuthenticator runAsAutheticator = new RunAsAuthenticator();
private SecurityContextAccess securityContextAccess;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.media.Media;
*/
public class DerivedUnitConverter<TARGET extends DerivedUnit> {
+ private static final Logger logger = LogManager.getLogger();
+
private DerivedUnit source;
private SpecimenTypeDesignation specimenTypeDesignation;
private SpecimenTypeDesignation newSpecimenTypeDesignation;
- private static final Logger logger = LogManager.getLogger(DerivedUnitConverter.class);
-
- /**
- * @param specimenTypeDesignation
- */
public DerivedUnitConverter(DerivedUnit source) throws Exception {
if(source == null){
throw new NullPointerException();
}
}
- /**
- * @param specimenTypeDesignation
- */
public DerivedUnitConverter(SpecimenTypeDesignation specimenTypeDesignation) {
if(specimenTypeDesignation == null){
throw new NullPointerException();
}
/**
- * converts the <code>source</code> <code>DerivedUnit</code> this converter has been created
+ * Converts the <code>source</code> <code>DerivedUnit</code> this converter has been created
* for into a <code>DerivedUnit</code> of the type <code>TARGET</code>.
* If the <code>source</code> instance was persisted the target instance will also be written
* into data base and the source is deleted from there.
- *
- * @param targetType
- * @param recordBasis
- * @throws DerivedUnitConversionException
*/
@SuppressWarnings("unchecked")
public SpecimenTypeDesignation convertTo(Class<TARGET> targetType, SpecimenOrObservationType recordBasis) throws DerivedUnitConversionException {
}
- /**
- * @param newInstance
- */
private void copyPropertiesTo(TARGET target) {
target.setAccessionNumber(source.getAccessionNumber());
target.setBarcode(source.getBarcode());
}
- /**
- * @param targetType
- * @return
- */
public boolean isSuppoprtedType(Class<TARGET> targetType) {
return targetType.equals(MediaSpecimen.class) || targetType.equals(DerivedUnit.class);
}
- /**
- * @return
- */
private boolean canConvert() {
if(source.getClass().equals(DerivedUnit.class)) {
public DerivedUnit oldDerivedUnit(){
return source;
}
-
-}
+}
\ No newline at end of file
*/
public class DescriptionUtility {
- private static final Logger logger = LogManager.getLogger(DescriptionUtility.class);
+ private static final Logger logger = LogManager.getLogger();
/**
import java.util.List;
import java.util.Set;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.hibernate.proxy.HibernateProxy;
import eu.etaxonomy.cdm.common.Tree;
*/
public class DistributionTree extends Tree<Set<Distribution>, NamedArea>{
- public static final Logger logger = LogManager.getLogger(DistributionTree.class);
+ private static final Logger logger = LogManager.getLogger();
private final IDefinedTermDao termDao;
}
/**
- * @param parentNode
- * @param nodeToFind
* @return false if the node was not found
*/
public boolean hasChildNode(TreeNode<Set<Distribution>, NamedArea> parentNode, NamedArea nodeID) {
/**
* Returns the (first) child node (of type TreeNode) with the given nodeID.
- * @param parentNode
- * @param nodeToFind
* @return the found node or null
*/
public TreeNode<Set<Distribution>, NamedArea> findChildNode(TreeNode<Set<Distribution>, NamedArea> parentNode, NamedArea nodeID) {
}
/**
- * @param distributions
- * @param omitLevels
* @param fallbackAreaMarkerTypes
* Areas are fallback areas if they have a {@link Marker} with one of the specified
* {@link MarkerType marker types}.
import java.util.List;
import java.util.Set;
-import org.apache.logging.log4j.LogManager;import org.apache.logging.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import eu.etaxonomy.cdm.model.description.DescriptionBase;
import eu.etaxonomy.cdm.model.description.DescriptionElementBase;
* @since Jan 27, 2010
*/
public class ImagesUtility {
- private static final Logger logger = LogManager.getLogger(ImagesUtility.class);
+
+ private static final Logger logger = LogManager.getLogger();
/**
* Quick and dirty method to get an element's first image file.
*/
@Deprecated
public static List<ImageFile> getOrderedImages(DescriptionElementBase element){
- List<ImageFile> imageList = new ArrayList<ImageFile>();
+ List<ImageFile> imageList = new ArrayList<>();
MediaRepresentation representation = getImageMediaRepresentation(element);
if (representation != null) {
for (MediaRepresentationPart part : representation.getParts()){
extends CdmTransactionalIntegrationTest {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(DerivedUnitFacadeCacheStrategyInjectionTest.class);
+ private static final Logger logger = LogManager.getLogger();
@SpringBeanByType
private IOccurrenceService occService;
private FieldUnit firstFieldObject;
private final Media media1 = Media.NewInstance();
-
//****************************** SET UP *****************************************/
@Before
firstDerivationEvent.addOriginal(firstFieldObject);
existingGatheringEvent = GatheringEvent.NewInstance();
firstFieldObject.setGatheringEvent(existingGatheringEvent);
-
}
@Test
import eu.etaxonomy.cdm.api.config.SendEmailConfigurer;
import eu.etaxonomy.cdm.test.integration.CdmIntegrationTest;
-
public class EmailSendTest extends CdmIntegrationTest {
- private static final Logger logger = LogManager.getLogger(EmailSendTest.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String SUBJECT = "eu.etaxonomy.cdm.test.function.EmailSendTest";
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.api.service;
import java.io.FileNotFoundException;
/**
* @author a.mueller
- *
*/
@Transactional(TransactionMode.DISABLED)
public class IdentifiableServiceBaseTest extends CdmTransactionalIntegrationTest {
@SuppressWarnings("unused")
- private static final Logger logger = LogManager.getLogger(IdentifiableServiceBaseTest.class);
+ private static final Logger logger = LogManager.getLogger();
@SpringBeanByType
private INameService nameService;
Assert.assertNotNull("Service shoulb be initialized", nameService);
}
-
@Test
@DataSet
@ExpectedDataSet
// commitAndStartNewTransaction(new String[]{"TaxonName","TaxonName_AUD"});
}
-
@Test
@DataSet(value="IdentifiableServiceBaseTest.testFindByIdentifierOrMarker.xml")
public final void testFindByIdentifier(){
UUID uuidIdentifierType1 = UUID.fromString("02bb62db-a229-4eeb-83e6-a9a093943d5e");
UUID uuidIdentifierType2 = UUID.fromString("ef6e960f-5289-456c-b25c-cff7f4de2f63");
-
DefinedTerm it1 = (DefinedTerm)termService.find(uuidIdentifierType1);
Assert.assertNotNull("identifier type must not be null", it1);
Assert.assertNull("Taxon must not be returned with includeEntity = false", entity.getEntity());
-
//Matchmode
includeEntity = false;
MatchMode matchmode = null;
*/
public class NameServiceImplTest extends CdmTransactionalIntegrationTest {
- private static final Logger logger = LogManager.getLogger(NameServiceImplTest.class);
+ private static final Logger logger = LogManager.getLogger();
private static final UUID NAME1_UUID = UUID.fromString("6dbd41d1-fe13-4d9c-bb58-31f051c2c384");
private static final int NAME1_ID = 10;
*/
public class OccurrenceServiceTest extends CdmTransactionalIntegrationTest {
- private static final Logger logger = LogManager.getLogger(OccurrenceServiceTest.class);
+ private static final Logger logger = LogManager.getLogger();
@SpringBeanByType
private IOccurrenceService occurrenceService;
*/
public class TaxonServiceImplTest extends CdmTransactionalIntegrationTest {
- private static final Logger logger = LogManager.getLogger(TaxonServiceImplTest.class);
+ private static final Logger logger = LogManager.getLogger();
@SpringBeanByType
private ITaxonService service;
*/
public class TaxonServiceSearchTaxaAndNamesTest extends CdmTransactionalIntegrationTest {
- private static Logger logger = LogManager.getLogger(TaxonServiceSearchTaxaAndNamesTest.class);
+ private static final Logger logger = LogManager.getLogger();
private static final String ABIES_BALSAMEA_UUID = "f65d47bd-4f49-4ab1-bc4a-bc4551eaa1a8";
* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.cdm.api.service;
import static org.junit.Assert.assertNotNull;
*/
public class TaxonServiceSearchTest extends CdmTransactionalIntegrationTest {
- private static Logger logger = LogManager.getLogger(TaxonServiceSearchTest.class);
+ private static final Logger logger = LogManager.getLogger();
private static final int BENCHMARK_ROUNDS = 300;
*/
public class DistributionAggregationTest extends CdmTransactionalIntegrationTest {
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static final UUID T_LAPSANA_UUID = UUID.fromString("f65d47bd-4f49-4ab1-bc4a-bc4551eaa1a8");
public class StructuredDescriptionAggregationTest extends CdmTransactionalIntegrationTest {
@SuppressWarnings("unused")
- private static Logger logger = LogManager.getLogger();
+ private static final Logger logger = LogManager.getLogger();
private static final UUID T_LAPSANA_UUID = UUID.fromString("f65d47bd-4f49-4ab1-bc4a-bc4551eaa1a8");
private static final UUID TN_LAPSANA_UUID = UUID.fromString("f4d29e9f-6484-4184-af2e-9704e96a17e3");
*/
public class PasswordResetServiceTest extends eu.etaxonomy.cdm.test.integration.CdmTransactionalIntegrationTest {
- private static final Logger logger = LogManager.getLogger(PasswordResetServiceTest.class);
+ private static final Logger logger = LogManager.getLogger();
private static final double maxRequestRate = 4.0;
TaxonServiceImplTest.class
,TermServiceImplTest.class
,TermLoaderIntegrationTest.class
- //,CreateDataTest.class
}
)
public class CdmTestSuite {
TaxonServiceImplTest.class
,TermServiceImplTest.class
,TermLoaderIntegrationTest.class
- //,CreateDataTest.class
);
}
-}
+}
\ No newline at end of file
*/
package eu.etaxonomy.cdm.test.integration;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
import org.springframework.security.access.AccessDeniedException;
import org.unitils.spring.annotation.SpringApplicationContext;
@SpringApplicationContext("file:./target/test-classes/eu/etaxonomy/cdm/applicationContext-securityTest.xml")
public abstract class CdmTransactionalIntegrationTestWithSecurity extends CdmTransactionalIntegrationTest {
- public static final Logger logger = LogManager.getLogger();
-
/**
* Finds a nested RuntimeExceptions of the types {@link PermissionDeniedException}, {@link AccessDeniedException}
* or returns null.