added two more annotations (for ckan resource and simple field)
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/data-catalogue/grsf-publisher-ws@133393 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
584cac5372
commit
4b6d48850b
|
@ -3,6 +3,9 @@
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
|
<dependent-module archiveName="ckan-util-library-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-util-library/ckan-util-library">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
<property name="context-root" value="grsf-publisher-ws"/>
|
<property name="context-root" value="grsf-publisher-ws"/>
|
||||||
<property name="java-output-path" value="/grsf-publisher-ws/target/classes"/>
|
<property name="java-output-path" value="/grsf-publisher-ws/target/classes"/>
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.gcube.data_catalogue.grsf_publish_ws.custom_annotations;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Annotate a field of the json input representing a future CKAN field (key, value)
|
||||||
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.FIELD)
|
||||||
|
public @interface CkanField {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.gcube.data_catalogue.grsf_publish_ws.custom_annotations;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Annotate a field of the json input representing a future CKAN resource
|
||||||
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||||
|
*/
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target(ElementType.FIELD)
|
||||||
|
public @interface CkanResource {
|
||||||
|
|
||||||
|
}
|
|
@ -8,11 +8,11 @@ import javax.ws.rs.ext.Provider;
|
||||||
import org.gcube.data_catalogue.grsf_publish_ws.json.output.ResponseBean;
|
import org.gcube.data_catalogue.grsf_publish_ws.json.output.ResponseBean;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@Provider
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown when @Valid fail
|
* Exception thrown when @Valid fail
|
||||||
* @author Costantino Perciante at ISTI-CNR
|
* @author Costantino Perciante at ISTI-CNR
|
||||||
*/
|
*/
|
||||||
|
@Provider
|
||||||
public class ApplicationException implements ExceptionMapper<Exception> {
|
public class ApplicationException implements ExceptionMapper<Exception> {
|
||||||
|
|
||||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ApplicationException.class);
|
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ApplicationException.class);
|
||||||
|
|
|
@ -10,11 +10,11 @@ import javax.ws.rs.ext.Provider;
|
||||||
import org.gcube.data_catalogue.grsf_publish_ws.json.output.ResponseBean;
|
import org.gcube.data_catalogue.grsf_publish_ws.json.output.ResponseBean;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@Provider
|
|
||||||
/**
|
/**
|
||||||
* Exception thrown on fail
|
* Exception thrown on fail
|
||||||
* @author Costantino Perciante at ISTI-CNR
|
* @author Costantino Perciante at ISTI-CNR
|
||||||
*/
|
*/
|
||||||
|
@Provider
|
||||||
public class ValidationException implements ExceptionMapper<javax.validation.ValidationException> {
|
public class ValidationException implements ExceptionMapper<javax.validation.ValidationException> {
|
||||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ValidationException.class);
|
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(ValidationException.class);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue