diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java index c7c94de..fd829d9 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalDataViewerServiceImpl.java @@ -1,5 +1,6 @@ package org.gcube.portlets.user.geoportaldataviewer.server; +import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.projects; import static org.gcube.application.geoportal.client.plugins.GeoportalAbstractPlugin.useCaseDescriptors; import java.util.ArrayList; @@ -12,9 +13,15 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; +import org.bson.Document; +import org.gcube.application.geoportal.common.model.configuration.Configuration; +import org.gcube.application.geoportal.common.model.configuration.Index; +import org.gcube.application.geoportal.common.model.document.Project; import org.gcube.application.geoportal.common.model.legacy.Concessione; import org.gcube.application.geoportal.common.model.legacy.UploadedImage; import org.gcube.application.geoportal.common.model.rest.QueryRequest; +import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor; +import org.gcube.application.geoportal.common.rest.Projects; import org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel; import org.gcube.application.geoportalcommon.ConvertToDataViewModel; import org.gcube.application.geoportalcommon.GeoportalCommon; @@ -26,16 +33,19 @@ import org.gcube.application.geoportalcommon.shared.gis.BoundsMap; import org.gcube.application.geoportalcommon.shared.products.model.UploadedImageDV; import org.gcube.application.geoportalcommon.util.URLParserUtil; import org.gcube.portlets.user.geoportaldataviewer.client.GeoportalDataViewerService; +import org.gcube.portlets.user.geoportaldataviewer.server.faults.InvalidObjectException; import org.gcube.portlets.user.geoportaldataviewer.server.gis.FeatureParser; import org.gcube.portlets.user.geoportaldataviewer.server.gis.WMSUrlValidator; import org.gcube.portlets.user.geoportaldataviewer.server.mongoservice.ConcessioniMongoServiceIdentityProxy; import org.gcube.portlets.user.geoportaldataviewer.server.util.ContextRequest; +import org.gcube.portlets.user.geoportaldataviewer.server.util.DVConversion; import org.gcube.portlets.user.geoportaldataviewer.server.util.SessionUtil; import org.gcube.portlets.user.geoportaldataviewer.shared.GCubeCollection; import org.gcube.portlets.user.geoportaldataviewer.shared.GeoNaSpatialQueryResult; import org.gcube.portlets.user.geoportaldataviewer.shared.ViewerConfiguration; import org.gcube.portlets.user.geoportaldataviewer.shared.faults.ControlledError; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.BaseMapLayer; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.IndexLayer; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.LayerObject; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wfs.FeatureRow; import org.gcube.portlets.user.geoportaldataviewer.shared.gis.wms.GeoInformationForWMSRequest; @@ -732,7 +742,7 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme // // setting identity as D4S User or KC client // new ConcessioniMongoServiceIdentityProxy(this.getThreadLocalRequest()); // SessionUtil.getCurrentContext(getThreadLocalRequest(), true); - // MongoServiceCommon serviceCommon = new MongoServiceCommon(); + // MongoServiceCommon serviceCommon = new MongoServiceCommon(); // // TODO MUST BE REPLACED BY COUNT // List listOfConcessioni = SessionUtil.getListOfConcessioni(getThreadLocalRequest(), // reloadFromService); @@ -763,6 +773,9 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme @Override protected ViewerConfiguration run() throws Exception, ControlledError { try { + + // ************* LOAD BASE LAYERS + final ViewerConfiguration config = new ViewerConfiguration(); LOG.info("Getting initial configuration "); LOG.debug("Loading base layers.."); @@ -772,17 +785,66 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme config.setBaseLayers(listBL); + + + // ************** LOAD AVAILABLE COLLECTIONS + LOG.debug("Loading available collections.. "); config.setAvailableCollections(new ArrayList()); + // TODO filter by + // configured ? + // gis indexed + QueryRequest request = new QueryRequest(); + + // TODO Constant + String Id="org.gcube.portlets.user.geoportaldataviewer"; + request.setFilter(Document.parse("{\""+UseCaseDescriptor.HANDLERS+"."+ + org.gcube.application.geoportal.common.model.useCaseDescriptor.HandlerDeclaration.ID+"\" : " + + "{\"$eq\" : \""+Id+"\"}}")); + + + useCaseDescriptors().build().query(new QueryRequest()).forEachRemaining(u->{ try{ + LOG.debug("Checking configuration for collection "+u.getId()); + + Projects p=projects(u.getId()).build(); UseCaseDescriptorDV ucd = ConvertToDataValueObjectModel.toUseCaseDescriptorDV(u, null); + Configuration ucdConfig = p.getConfiguration(); GCubeCollection coll=new GCubeCollection(); coll.setUcd(ucd); - config.getAvailableCollections().add(coll); + + + + //TODO TO Check index flag should be in configuration or evaluated according to user credentials + + String toCheckFlag = "internal"; + + // TODO constant + coll.setIndexes(new ArrayList()); + + LOG.debug("Checking if "+u.getId()+" is GIS Indexed. Index flag needed is "+toCheckFlag); + + for(Index index : ucdConfig.getIndexes()) { + try { + IndexLayer toAdd = DVConversion.convert(index); + if(toAdd.getFlag().equals(toCheckFlag)) + coll.getIndexes().add(toAdd); + }catch(InvalidObjectException e) { + LOG.debug("Skipping invalid index ",e); + }catch(Throwable t) { + LOG.error("Unable to check index ",t); + } + } + + + // Return only if gis indexed + if(coll.getIndexes().isEmpty()) + LOG.info("No available GIS Index for collection "+coll.getUcd().getName()); + else config.getAvailableCollections().add(coll); }catch(Throwable t) { LOG.warn("Invalid UCD, can't translate to DV. UCID : "+u.getId(),t); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/faults/InvalidObjectException.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/faults/InvalidObjectException.java new file mode 100644 index 0000000..ccfd735 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/faults/InvalidObjectException.java @@ -0,0 +1,30 @@ +package org.gcube.portlets.user.geoportaldataviewer.server.faults; + +public class InvalidObjectException extends Exception { + + public InvalidObjectException() { + // TODO Auto-generated constructor stub + } + + public InvalidObjectException(String message) { + super(message); + // TODO Auto-generated constructor stub + } + + public InvalidObjectException(Throwable cause) { + super(cause); + // TODO Auto-generated constructor stub + } + + public InvalidObjectException(String message, Throwable cause) { + super(message, cause); + // TODO Auto-generated constructor stub + } + + public InvalidObjectException(String message, Throwable cause, boolean enableSuppression, + boolean writableStackTrace) { + super(message, cause, enableSuppression, writableStackTrace); + // TODO Auto-generated constructor stub + } + +} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/util/DVConversion.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/util/DVConversion.java new file mode 100644 index 0000000..dd530a7 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/util/DVConversion.java @@ -0,0 +1,69 @@ +package org.gcube.portlets.user.geoportaldataviewer.server.util; + +import org.gcube.application.geoportal.client.utils.Serialization; +import org.gcube.application.geoportal.common.model.configuration.Index; +import org.gcube.application.geoportal.common.model.document.filesets.sdi.GCubeSDILayer; +import org.gcube.portlets.user.geoportaldataviewer.server.faults.InvalidObjectException; +import org.gcube.portlets.user.geoportaldataviewer.shared.gis.IndexLayer; + +public class DVConversion { + + + + /** + * + * { + "_type": "GIS-CENTROIDS", + "layer": { + "_type": "gcube-sdi-layer", + "_platformInfo": [ + { + "_type": "Geoserver", + "workspace": "profiledconcessioni_devvre", + "storeName": "profiledconcessioni_devvre_centroids", + "_host": "geoserver-218.dev.d4science.org" + } + ], + "_bbox": { + "_maxX": 180.0, + "_minX": -180.0, + "_maxY": 90.0, + "_minY": -90.0 + }, + "_ogcLinks": { + "wms": { + "wms": "https://geoserver-218.dev.d4science.org/geoserver/profiledconcessioni_devvre/wms?service=WMS&version=1.1.0&request=GetMap&layers=profiledconcessioni_devvre:null&styles=&bbox=-180.000000,-90.000000,180.000000,90.000000&srs=EPSG:4326&format=application/openlayers&width=400&height=400" + } + } + }, + "indexName": "profiledconcessioni_devvre_centroids", + "records": 4, + "crossReferencedLayers": {}, + "flag": "public" + } + * @throws InvalidObjectException + * + */ + + public static IndexLayer convert(Index toConvert) throws InvalidObjectException { + IndexLayer toReturn = null; + + + switch(toConvert.getType()) { + case "GIS-CENTROIDS" : { + toReturn = Serialization.convert(toConvert,IndexLayer.class); + // toReturn.setLayer(Serialization.read(toConvert.get("layer"), GCubeSDILayer.class)); + // toReturn.setFlag(toConvert.getString("flag")); + // toReturn.setIndexName(toConvert.getString()); + break; + + } + default:{ + throw new InvalidObjectException("Unable to convert Index. Unknown type : "+toConvert.getType()); + } + } + + return toReturn; + } + +} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/Lock.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/Lock.java deleted file mode 100644 index b6a9002..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/Lock.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document; - - - -import org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.accouting.AccountingInfo; - -import com.fasterxml.jackson.annotation.JsonProperty; - - -public class Lock { - - public static final String ID="_id"; - public static final String INFO="_info"; - public static final String OPERATION="_operation"; - - @JsonProperty(INFO) - private AccountingInfo info; - @JsonProperty(ID) - private String id; - @JsonProperty(OPERATION) - private String operation; - public AccountingInfo getInfo() { - return info; - } - public void setInfo(AccountingInfo info) { - this.info = info; - } - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getOperation() { - return operation; - } - public void setOperation(String operation) { - this.operation = operation; - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/Project.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/Project.java deleted file mode 100644 index 6f57371..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/Project.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -import org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.accouting.PublicationInfo; -import org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.identification.IdentificationReference; -import org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.lifecycle.LifecycleInformation; -import org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.relationships.Relationship; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - - - -public class Project { - - public static final String ID="_id"; - public static final String VERSION="_version"; - public static final String INFO="_info"; - public static final String PROFILE_ID="_profileID"; - public static final String PROFILE_VERSION="_profileVersion"; - public static final String LIFECYCLE_INFORMATION="_lifecycleInformation"; - public static final String RELATIONSHIPS="_relationships"; - public static final String IDENTIFICATION_REFERENCES="_identificationReferences"; - public static final String THE_DOCUMENT="_theDocument"; - public static final String LOCK="_lock"; - - // CORE METADATA - - @JsonProperty(ID) - private String id; - @JsonProperty(VERSION) - private String version; - - // Publication Info - @JsonProperty(INFO) - private PublicationInfo info; - - // UseCaseDescriptor reference - @JsonProperty(PROFILE_ID) - private String profileID; - @JsonProperty(PROFILE_VERSION) - private String profileVersion; - - @JsonProperty(LIFECYCLE_INFORMATION) - private LifecycleInformation lifecycleInformation; - - @JsonProperty(RELATIONSHIPS) - private List relationships; - - @JsonProperty(IDENTIFICATION_REFERENCES) - private List identificationReferences; - - @JsonProperty(THE_DOCUMENT) - private Object theDocument; - - @JsonProperty(LOCK) - private Lock lock; - - - /** - * Similar to equals but without checking following fields - * - * lock - * @param o - * @return - */ - public boolean isEquivalent(Object o) { - if (this == o) return true; - if (!(o instanceof Project)) return false; - Project project = (Project) o; - return Objects.equals(getId(), project.getId()) && Objects.equals(getVersion(), project.getVersion()) && Objects.equals(getInfo(), project.getInfo()) && Objects.equals(getProfileID(), project.getProfileID()) && Objects.equals(getProfileVersion(), project.getProfileVersion()) && Objects.equals(getLifecycleInformation(), project.getLifecycleInformation()) && Objects.equals(getIdentificationReferences(), project.getIdentificationReferences()) && Objects.equals(getRelationships(), project.getRelationships()) && Objects.equals(getTheDocument(), project.getTheDocument()); - } - - - @JsonIgnore - public List getIdentificationReferenceByType(String type){ - if(identificationReferences==null) return Collections.emptyList(); - else return identificationReferences.stream() - .filter(item -> item.getType().equals(type)).collect(Collectors.toList()); - }; - - @JsonIgnore - public List getRelationshipsByName(String relation){ - if(relationships==null)return Collections.emptyList(); - else return relationships.stream().filter(relationship -> relationship. - getRelationshipName().equals(relation)).collect(Collectors.toList()); - }; - - - @JsonIgnore - public Project addRelation(Relationship rel){ - if(relationships==null) relationships = new ArrayList<>(); - relationships.add(rel); - return this; - } - - - public String getId() { - return id; - } - - - public void setId(String id) { - this.id = id; - } - - - public String getVersion() { - return version; - } - - - public void setVersion(String version) { - this.version = version; - } - - - public PublicationInfo getInfo() { - return info; - } - - - public void setInfo(PublicationInfo info) { - this.info = info; - } - - - public String getProfileID() { - return profileID; - } - - - public void setProfileID(String profileID) { - this.profileID = profileID; - } - - - public String getProfileVersion() { - return profileVersion; - } - - - public void setProfileVersion(String profileVersion) { - this.profileVersion = profileVersion; - } - - - public LifecycleInformation getLifecycleInformation() { - return lifecycleInformation; - } - - - public void setLifecycleInformation(LifecycleInformation lifecycleInformation) { - this.lifecycleInformation = lifecycleInformation; - } - - - public List getRelationships() { - return relationships; - } - - - public void setRelationships(List relationships) { - this.relationships = relationships; - } - - - public List getIdentificationReferences() { - return identificationReferences; - } - - - public void setIdentificationReferences(List identificationReferences) { - this.identificationReferences = identificationReferences; - } - - - public Object getTheDocument() { - return theDocument; - } - - - public void setTheDocument(Object theDocument) { - this.theDocument = theDocument; - } - - - public Lock getLock() { - return lock; - } - - - public void setLock(Lock lock) { - this.lock = lock; - } - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/access/Access.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/access/Access.java deleted file mode 100644 index 37435a0..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/access/Access.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.access; - -import com.fasterxml.jackson.annotation.JsonProperty; - - -public class Access { - - public static final String POLICY="_policy"; - public static final String LICENSE="_license"; - - @JsonProperty(POLICY) - private AccessPolicy policy; - @JsonProperty(LICENSE) - private String license; - public AccessPolicy getPolicy() { - return policy; - } - public void setPolicy(AccessPolicy policy) { - this.policy = policy; - } - public String getLicense() { - return license; - } - public void setLicense(String license) { - this.license = license; - } - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/access/AccessPolicy.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/access/AccessPolicy.java deleted file mode 100644 index 3f1a83a..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/access/AccessPolicy.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.access; - -public enum AccessPolicy { - - OPEN,RESTRICTED,EMBARGOED; - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/AccountingInfo.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/AccountingInfo.java deleted file mode 100644 index cba361e..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/AccountingInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.accouting; - -import com.fasterxml.jackson.annotation.JsonProperty; - - -import java.time.LocalDateTime; - - -public class AccountingInfo { - - public static final String USER="_user"; - public static final String CONTEXT="_context"; - public static final String INSTANT="_instant"; - - @JsonProperty(USER) - private User user; - @JsonProperty(CONTEXT) - private Context context; - @JsonProperty(INSTANT) - private String instant; - public User getUser() { - return user; - } - public void setUser(User user) { - this.user = user; - } - public Context getContext() { - return context; - } - public void setContext(Context context) { - this.context = context; - } - public String getInstant() { - return instant; - } - public void setInstant(String instant) { - this.instant = instant; - } - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/Context.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/Context.java deleted file mode 100644 index a60a703..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/Context.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.accouting; - -import com.fasterxml.jackson.annotation.JsonProperty; - - -public class Context { - public static final String ID="_id"; - public static final String NAME = "_name"; - - @JsonProperty(ID) - private String id; - @JsonProperty(NAME) - private String name; - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/PublicationInfo.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/PublicationInfo.java deleted file mode 100644 index 7204e13..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/PublicationInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.accouting; - -import org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.access.Access; - -import com.fasterxml.jackson.annotation.JsonProperty; - - -public class PublicationInfo { - - public static final String CREATION_INFO="_creationInfo"; - public static final String LAST_EDIT_INFO="_lastEditInfo"; - public static final String ACCESS = "_access"; - - @JsonProperty(CREATION_INFO) - private AccountingInfo creationInfo; - @JsonProperty(LAST_EDIT_INFO) - private AccountingInfo lastEditInfo; - @JsonProperty(ACCESS) - private Access access; - public AccountingInfo getCreationInfo() { - return creationInfo; - } - public void setCreationInfo(AccountingInfo creationInfo) { - this.creationInfo = creationInfo; - } - public AccountingInfo getLastEditInfo() { - return lastEditInfo; - } - public void setLastEditInfo(AccountingInfo lastEditInfo) { - this.lastEditInfo = lastEditInfo; - } - public Access getAccess() { - return access; - } - public void setAccess(Access access) { - this.access = access; - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/User.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/User.java deleted file mode 100644 index 3d723e3..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/accouting/User.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.accouting; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import lombok.*; - -import java.util.Objects; -import java.util.Set; - - -public class User { - - public static final String USERNAME="_username"; - - @JsonProperty(USERNAME) - private String username; - - @JsonIgnore - private Set roles; - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (!(o instanceof User)) return false; - User user = (User) o; - return Objects.equals(getUsername(), user.getUsername()); - } - - @Override - public int hashCode() { - return Objects.hash(getUsername()); - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public Set getRoles() { - return roles; - } - - public void setRoles(Set roles) { - this.roles = roles; - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/CentroidRecordReference.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/CentroidRecordReference.java deleted file mode 100644 index 486572b..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/CentroidRecordReference.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.identification; - -public class CentroidRecordReference extends IdentificationReference{ - - public static final String CENTROID_RECORD_REFERENCE="CENTROID_RECORD_TYPE"; - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/IdentificationReference.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/IdentificationReference.java deleted file mode 100644 index 8100327..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/IdentificationReference.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.identification; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.google.gwt.json.client.JSONObject; -import com.google.gwt.json.client.JSONString; - - -public class IdentificationReference extends JSONObject { - - public static final String TYPE="_type"; - - public IdentificationReference(String type) { - setType(type); - } - - public IdentificationReference() {} - - @JsonIgnore - public String getType(){return super.get(TYPE).toString();} - @JsonIgnore - public void setType(String type){super.put(TYPE, new JSONString(type));} -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/SpatialReference.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/SpatialReference.java deleted file mode 100644 index fc6b25f..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/SpatialReference.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.identification; - -import com.fasterxml.jackson.annotation.JsonIgnore; - - -public class SpatialReference extends IdentificationReference{ - - public static final String SPATIAL_REFERENCE_TYPE="SPATIAL REFERENCE"; - public static final String GEO_JSON="geoJSON"; - - - public SpatialReference(Object geoJSON) { -// setGeoJson(geoJSON); - setType(SPATIAL_REFERENCE_TYPE); - } - - public SpatialReference() {} - - - @JsonIgnore - public Object getGeoJson(){return super.get(GEO_JSON);} -// @JsonIgnore -// public Object setGeoJson(Object geoJSON){return super.put(GEO_JSON,JSONObject.geoJSON);} -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/TemporalReference.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/TemporalReference.java deleted file mode 100644 index 2285304..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/identification/TemporalReference.java +++ /dev/null @@ -1,6 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.identification; - -public class TemporalReference extends IdentificationReference { - - public static final String TEMPORAL_REFERENCE_TYPE="TEMPORAL_REFERENCE_TYPE"; -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/lifecycle/LifecycleInformation.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/lifecycle/LifecycleInformation.java deleted file mode 100644 index 1b386da..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/lifecycle/LifecycleInformation.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.lifecycle; - -import java.util.ArrayList; -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - -public class LifecycleInformation { - - public static final class CommonPhases{ - public static final String DRAFT_PHASE="DRAFT"; - } - - //COMMON PHASES - - - public static final String PHASE="_phase"; - public static final String LAST_INVOKED_STEP="_lastInvokedStep"; - public static final String LAST_OPERATION_STATUS="_lastOperationStatus"; - public static final String ERROR_MESSAGES="_errorMessages"; - public static final String WARNING_MESSAGES="_warningMessages"; - public static final String TRIGGERED_EVENTS="_triggeredEvents"; - public static final String NOTES="_notes"; - - public static enum Status{ - OK,ERROR,WARNING - } - - @JsonProperty(PHASE) - private String phase; - @JsonProperty(LAST_INVOKED_STEP) - private String lastInvokedStep; - @JsonProperty(LAST_OPERATION_STATUS) - private Status lastOperationStatus; - @JsonProperty(ERROR_MESSAGES) - private List errorMessages; - @JsonProperty(WARNING_MESSAGES) - private List warningMessages; - @JsonProperty(TRIGGERED_EVENTS) - private List triggeredEvents; - @JsonProperty(NOTES) - private String notes; - - - @JsonIgnore - public TriggeredEvents getLastEvent(){ - if(triggeredEvents==null || triggeredEvents.isEmpty()) return null; - return triggeredEvents.get(triggeredEvents.size()-1); - } - - @JsonIgnore - public LifecycleInformation addErrorMessage(String msg){ - if(errorMessages==null) - errorMessages=new ArrayList<>(); - errorMessages.add(msg); - return this; - } - @JsonIgnore - public LifecycleInformation addWarningMessage(String msg){ - if(warningMessages==null) - warningMessages=new ArrayList<>(); - warningMessages.add(msg); - return this; - } - @JsonIgnore - public LifecycleInformation addEventReport(TriggeredEvents info){ - if(triggeredEvents==null) triggeredEvents=new ArrayList<>(); - triggeredEvents.add(info); - return this; - } - @JsonIgnore - public LifecycleInformation cleanState(){ - setLastOperationStatus(null); - setLastInvokedStep(null); - setTriggeredEvents(new ArrayList<>()); - setErrorMessages(new ArrayList<>()); - setWarningMessages(new ArrayList<>()); - return this; - } - - public String getPhase() { - return phase; - } - - public void setPhase(String phase) { - this.phase = phase; - } - - public String getLastInvokedStep() { - return lastInvokedStep; - } - - public void setLastInvokedStep(String lastInvokedStep) { - this.lastInvokedStep = lastInvokedStep; - } - - public Status getLastOperationStatus() { - return lastOperationStatus; - } - - public void setLastOperationStatus(Status lastOperationStatus) { - this.lastOperationStatus = lastOperationStatus; - } - - public List getErrorMessages() { - return errorMessages; - } - - public void setErrorMessages(List errorMessages) { - this.errorMessages = errorMessages; - } - - public List getWarningMessages() { - return warningMessages; - } - - public void setWarningMessages(List warningMessages) { - this.warningMessages = warningMessages; - } - - public List getTriggeredEvents() { - return triggeredEvents; - } - - public void setTriggeredEvents(List triggeredEvents) { - this.triggeredEvents = triggeredEvents; - } - - public String getNotes() { - return notes; - } - - public void setNotes(String notes) { - this.notes = notes; - } - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/lifecycle/TriggeredEvents.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/lifecycle/TriggeredEvents.java deleted file mode 100644 index 755980a..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/lifecycle/TriggeredEvents.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.lifecycle; - -import java.util.ArrayList; -import java.util.List; - -public class TriggeredEvents { - - public static final String PHASE="_phase"; - public static final String LAST_INVOKED_STEP="_lastInvokedStep"; - public static final String LAST_OPERATION_STATUS="_lastOperationStatus"; - public static final String ERROR_MESSAGES="_errorMessages"; - public static final String WARNING_MESSAGES="_warningMessages"; - public static final String TRIGGERED_EVENTS="_triggeredEvents"; - - private String event; - private LifecycleInformation.Status lastOperationStatus; - private List errorMessages; - private List warningMessages; - - public void addErrorMessage(String msg){ - if(errorMessages==null) - errorMessages=new ArrayList<>(); - errorMessages.add(msg); - } - public void addWarningMessage(String msg){ - if(warningMessages==null) - warningMessages=new ArrayList<>(); - warningMessages.add(msg); - } - public String getEvent() { - return event; - } - public void setEvent(String event) { - this.event = event; - } - public LifecycleInformation.Status getLastOperationStatus() { - return lastOperationStatus; - } - public void setLastOperationStatus(LifecycleInformation.Status lastOperationStatus) { - this.lastOperationStatus = lastOperationStatus; - } - public List getErrorMessages() { - return errorMessages; - } - public void setErrorMessages(List errorMessages) { - this.errorMessages = errorMessages; - } - public List getWarningMessages() { - return warningMessages; - } - public void setWarningMessages(List warningMessages) { - this.warningMessages = warningMessages; - } - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/materialization/BBOXDV.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/materialization/BBOXDV.java new file mode 100644 index 0000000..5381e3d --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/materialization/BBOXDV.java @@ -0,0 +1,109 @@ +package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.materialization; + +import java.util.HashMap; + +public class BBOXDV extends HashMap{ + + /** + * + */ + private static final long serialVersionUID = -160255589938251081L; + + public BBOXDV() { + // TODO Auto-generated constructor stub + } + + + public final String asGeoJSONBBox(){ + StringBuilder builder = new StringBuilder("["); + builder.append(getMaxX()+","); // W + builder.append(getMinY()+","); // S + if(is3d()) builder.append(getMinZ()+","); // Z + + builder.append(getMinX()+","); // E + builder.append(getMaxY()+","); // N + if(is3d()) builder.append(getMaxZ()+","); // Z + + + builder.deleteCharAt(builder.length()); + builder.append("]"); + return builder.toString(); + } + public double[] asGeoJSONArray(){ + if(is3d()){ + return new double[]{getMaxX(),getMinY(),getMinZ(),getMinX(),getMaxY(),getMaxZ()}; + }else return new double[]{getMaxX(),getMinY(),getMinX(),getMaxY()}; + } + + public static final BBOXDV fromGeoJSON(double[] coords){ + BBOXDV toReturn = new BBOXDV(); + toReturn.setMaxX(coords[0]); + toReturn.setMinY(coords[1]); + + if(coords.length == 6){ + // 3D + toReturn.setMinZ(coords[2]); + toReturn.setMinX(coords[3]); + toReturn.setMaxY(coords[4]); + toReturn.setMaxZ(coords[5]); + }else { + toReturn.setMinX(coords[2]); + toReturn.setMaxY(coords[3]); + } + return toReturn; + } + + public static final BBOXDV WORLD=new BBOXDV(180d,-180d,90d,-90d); + + public static final BBOXDV WORLD_3D=new BBOXDV(180d,-180d,90d,-90d); + + public static final String MAX_X="_maxX"; + public static final String MAX_Y="_maxY"; + public static final String MAX_Z="_maxZ"; + public static final String MIN_X="_minX"; + public static final String MIN_Y="_minY"; + public static final String MIN_Z="_minZ"; + + + public BBOXDV(Double maxX,Double minX,Double maxY,Double minY,Double maxZ,Double minZ){ + this(maxX,minX,maxY,minY); + setMaxZ(maxZ); + setMinZ(minZ); + } + public BBOXDV(Double maxX,Double minX,Double maxY,Double minY){ + setMaxX(maxX); + setMinX(minX); + setMaxY(maxY); + setMinY(minY); + } + + + public BBOXDV setMaxX(Double d){this.put(MAX_X,d);return this;} + + public BBOXDV setMaxY(Double d){this.put(MAX_Y,d);return this;} + + public BBOXDV setMaxZ(Double d){this.put(MAX_Z,d);return this;} + + public BBOXDV setMinX(Double d){this.put(MIN_X,d);return this;} + + public BBOXDV setMinY(Double d){this.put(MIN_Y,d);return this;} + + public BBOXDV setMinZ(Double d){this.put(MIN_Z,d);return this;} + + public Double getMinY(){return (Double) this.getOrDefault(MIN_Y,-90d);} + + public Double getMaxY(){return (Double) this.getOrDefault(MAX_Y,90d);} + + public Double getMinX(){return (Double) this.getOrDefault(MIN_X,-180d);} + + public Double getMaxX(){return (Double) this.getOrDefault(MAX_X,180d);} + + public Double getMinZ(){return (Double) this.getOrDefault(MIN_Z,null);} + + public Double getMaxZ(){return (Double) this.getOrDefault(MAX_Z,null);} + + + public Boolean is3d(){ + return getMinZ()!=null && getMaxZ() !=null; + } +} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/materialization/GCubeSDILayerDV.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/materialization/GCubeSDILayerDV.java new file mode 100644 index 0000000..ce66216 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/materialization/GCubeSDILayerDV.java @@ -0,0 +1,26 @@ +package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.materialization; + +import java.util.HashMap; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class GCubeSDILayerDV { + + + + // TODO manage heterogeneus collection + + @JsonProperty(value = "_type") + private String type; + @JsonProperty(value = "_platformInfo") + private List platformInfos; + @JsonProperty(value = "_bbox") + private BBOXDV bbox; + @JsonProperty(value = "_ogcLinks") + private HashMap ogcLinks; + + + + +} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/materialization/GeoServerPlatformInfoDV.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/materialization/GeoServerPlatformInfoDV.java new file mode 100644 index 0000000..2ca3e75 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/materialization/GeoServerPlatformInfoDV.java @@ -0,0 +1,61 @@ +package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.materialization; + +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class GeoServerPlatformInfoDV { + + @JsonProperty(value = "_type") + private String type; + private String workspace; + private String storeName; + + @JsonProperty(value = "_host") + private String host; + + private Map ogcLinks; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getWorkspace() { + return workspace; + } + + public void setWorkspace(String workspace) { + this.workspace = workspace; + } + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public Map getOgcLinks() { + return ogcLinks; + } + + public void setOgcLinks(Map ogcLinks) { + this.ogcLinks = ogcLinks; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/relationships/Relationship.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/relationships/Relationship.java deleted file mode 100644 index 944f063..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/relationships/Relationship.java +++ /dev/null @@ -1,39 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.relationships; - -import com.fasterxml.jackson.annotation.JsonProperty; - - -public class Relationship { - - public static final String RELATIONSHIP_NAME="_relationshipName"; - public static final String TARGET_ID="_targetID"; - public static final String TARGET_UCD="_targetUCD"; - - @JsonProperty(RELATIONSHIP_NAME) - private String relationshipName; - @JsonProperty(TARGET_ID) - private String targetID; - @JsonProperty(TARGET_UCD) - private String targetUCD; - public String getRelationshipName() { - return relationshipName; - } - public void setRelationshipName(String relationshipName) { - this.relationshipName = relationshipName; - } - public String getTargetID() { - return targetID; - } - public void setTargetID(String targetID) { - this.targetID = targetID; - } - public String getTargetUCD() { - return targetUCD; - } - public void setTargetUCD(String targetUCD) { - this.targetUCD = targetUCD; - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/relationships/RelationshipNavigationObject.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/relationships/RelationshipNavigationObject.java deleted file mode 100644 index 8bec2c3..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/document/relationships/RelationshipNavigationObject.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.relationships; - -import java.util.List; - -import org.gcube.application.geoportal.common.model.document.Project; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import lombok.NonNull; - - -public class RelationshipNavigationObject { - public static final String CHILDREN="_children"; - public static final String TARGET="_target"; - - @JsonProperty(CHILDREN) - List children; - - @NonNull - @JsonProperty(TARGET) - Project target; - - public List getChildren() { - return children; - } - - public void setChildren(List children) { - this.children = children; - } - - public Project getTarget() { - return target; - } - - public void setTarget(Project target) { - this.target = target; - } - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/DataAccessPolicy.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/DataAccessPolicy.java deleted file mode 100644 index c4441aa..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/DataAccessPolicy.java +++ /dev/null @@ -1,91 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.ucd; - -import java.util.List; - -import org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.Project; -import org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.accouting.User; - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; - - -public class DataAccessPolicy { - - public static final String POLICY = "_policy"; - public static final String ROLES = "_roles"; - public static final String ENFORCER = "_enforcer"; - - public static class PolicyEnforcer { - public static final String FILTER="_filter"; - @JsonProperty(FILTER) - private String filter; - - @JsonIgnore - public Object getFilterDocument(){ - if(filter!=null) return filter; - else return new Object(); - } - } - - - @JsonProperty(POLICY) - private Policy policy; - @JsonProperty(ROLES) - private List roles; - @JsonProperty(ENFORCER) - private PolicyEnforcer enforcer; - - @JsonIgnore - public boolean canRead(Project p, User u){ - switch(getPolicy().getRead()){ - case own: return p.getInfo().getCreationInfo().getUser().equals(u); - case any: return true; - case none: - default : return false; - } - } - - - @JsonIgnore - public boolean canWrite(Project p, User u){ - switch(getPolicy().getWrite()){ - case own: return p.getInfo().getCreationInfo().getUser().equals(u); - case any: return true; - case none: - default : return false; - } - } - - - public Policy getPolicy() { - return policy; - } - - - public void setPolicy(Policy policy) { - this.policy = policy; - } - - - public List getRoles() { - return roles; - } - - - public void setRoles(List roles) { - this.roles = roles; - } - - - public PolicyEnforcer getEnforcer() { - return enforcer; - } - - - public void setEnforcer(PolicyEnforcer enforcer) { - this.enforcer = enforcer; - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/Field.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/Field.java deleted file mode 100644 index 6483067..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/Field.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.ucd; - - -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.google.gwt.json.client.JSONArray; -import com.google.gwt.json.client.JSONObject; - -public class Field extends JSONObject { - - public static final String TYPE="_type"; - public static final String CHILDREN="_children"; - public static final String MAX_CARDINALITY="_max"; - public static final String MIN_CARDINALITY="_min"; - public static final String LABEL="_label"; - - @JsonIgnore - public String getLabel(){ - return this.get(LABEL).toString(); - } - - @JsonIgnore - public String getType(){ - return this.get(TYPE).toString(); - }; - - @JsonIgnore - public Boolean isLeaf(){ - JSONArray children = getChildren(); - return children == null || children.size()==0 || children.get(0)==null; - } - - @JsonIgnore - public JSONArray getChildren(){ - return (JSONArray)this.get(CHILDREN); - } - - @JsonIgnore - public Boolean isCollection() { - Integer maxCard=this.getMaxCardinality(); - return (maxCard>1||maxCard<0); // Negative values for unbounded - } - - @JsonIgnore - public Integer getMaxCardinality(){ - if(this.containsKey(MAX_CARDINALITY)) - return Integer.parseInt(get(MAX_CARDINALITY).toString()); - else return 1; - } - - @JsonIgnore - public Integer getMinCardinality(){ - if(this.containsKey(MIN_CARDINALITY)) - return Integer.parseInt(get(MIN_CARDINALITY).toString()); - else return 0; - } - @JsonIgnore - public Boolean isMandatory(){ - return getMinCardinality()==0; - } - - - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/FieldMap.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/FieldMap.java deleted file mode 100644 index efa106f..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/FieldMap.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.ucd; - -import java.util.ArrayList; -import java.util.HashMap; - - -class FieldMap extends ArrayList { - - public static class MapElement extends HashMap{ - - } - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/HandlerDeclaration.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/HandlerDeclaration.java deleted file mode 100644 index 363c1e9..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/HandlerDeclaration.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.ucd; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gwt.json.client.JSONObject; - - -public class HandlerDeclaration { - - public static final String ID="_id"; - public static final String TYPE="_type"; - public static final String CONFIGURATION="_configuration"; - - @JsonProperty(ID) - private String id; - @JsonProperty(TYPE) - private String type; - @JsonProperty(CONFIGURATION) - private JSONObject configuration; - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - public JSONObject getConfiguration() { - return configuration; - } - public void setConfiguration(JSONObject configuration) { - this.configuration = configuration; - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/Policy.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/Policy.java deleted file mode 100644 index b5d36ef..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/Policy.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.ucd; - -import com.fasterxml.jackson.annotation.JsonProperty; - - -public class Policy { - public static final String WRITE="_write"; - public static final String READ="_read"; - - public static enum Type{ - own, none, any - } - - @JsonProperty(WRITE) - private Policy.Type write; - @JsonProperty(READ) - private Policy.Type read; - - - public Policy.Type getWrite() { - return write; - } - public void setWrite(Policy.Type write) { - this.write = write; - } - public Policy.Type getRead() { - return read; - } - public void setRead(Policy.Type read) { - this.read = read; - } - -} \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/UCD.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/UCD.java deleted file mode 100644 index 12c4ccd..0000000 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/cl/ucd/UCD.java +++ /dev/null @@ -1,142 +0,0 @@ -package org.gcube.portlets.user.geoportaldataviewer.shared.cl.ucd; - - -import java.io.Serializable; -import java.util.List; - -import org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.accouting.AccountingInfo; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class UCD implements Serializable { - - public static final String MONGO_ID="_mongoId"; - public static final String ID="_id"; - public static final String VERSION="_version"; - public static final String NAME="_name"; - public static final String DESCRIPTION="_description"; - public static final String CREATION_INFO="_creationInfo"; - public static final String SCHEMA="_schema"; - public static final String HANDLERS="_handlers"; - public static final String DATA_ACCESS_POLICIES="_dataAccessPolicies"; - - - @JsonProperty(MONGO_ID) - private String mongoId; - - @JsonProperty(ID) - private String id; - @JsonProperty(VERSION) - private String version; - - @JsonProperty(NAME) - private String name; - @JsonProperty(DESCRIPTION) - private String description; - @JsonProperty(CREATION_INFO) - private AccountingInfo creationInfo; - - @JsonProperty(SCHEMA) - private Field schema; - - @JsonProperty(HANDLERS) - private List handlers; - - - @JsonProperty(DATA_ACCESS_POLICIES) - private List dataAccessPolicies; - - - public String getMongoId() { - return mongoId; - } - - - public void setMongoId(String mongoId) { - this.mongoId = mongoId; - } - - - public String getId() { - return id; - } - - - public void setId(String id) { - this.id = id; - } - - - public String getVersion() { - return version; - } - - - public void setVersion(String version) { - this.version = version; - } - - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public String getDescription() { - return description; - } - - - public void setDescription(String description) { - this.description = description; - } - - - public AccountingInfo getCreationInfo() { - return creationInfo; - } - - - public void setCreationInfo(AccountingInfo creationInfo) { - this.creationInfo = creationInfo; - } - - - public Field getSchema() { - return schema; - } - - - public void setSchema(Field schema) { - this.schema = schema; - } - - - public List getHandlers() { - return handlers; - } - - - public void setHandlers(List handlers) { - this.handlers = handlers; - } - - - public List getDataAccessPolicies() { - return dataAccessPolicies; - } - - - public void setDataAccessPolicies(List dataAccessPolicies) { - this.dataAccessPolicies = dataAccessPolicies; - } - - - - -} diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/IndexLayer.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/IndexLayer.java index c79d071..125819e 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/IndexLayer.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/shared/gis/IndexLayer.java @@ -1,5 +1,52 @@ package org.gcube.portlets.user.geoportaldataviewer.shared.gis; +import org.gcube.portlets.user.geoportaldataviewer.shared.cl.document.materialization.GCubeSDILayerDV; + +import com.fasterxml.jackson.annotation.JsonProperty; + public class IndexLayer { + + @JsonProperty(value = "_type") + private String type; + private GCubeSDILayerDV layer; + private String indexName; + private int records; + private String flag; + + + public String getType() { + return type; + } + public void setType(String type) { + this.type = type; + } + public GCubeSDILayerDV getLayer() { + return layer; + } + public void setLayer(GCubeSDILayerDV layer) { + this.layer = layer; + } + public String getIndexName() { + return indexName; + } + public void setIndexName(String indexName) { + this.indexName = indexName; + } + public int getRecords() { + return records; + } + public void setRecords(int records) { + this.records = records; + } + public String getFlag() { + return flag; + } + public void setFlag(String flag) { + this.flag = flag; + } + + + + }