Updated Operations

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@100586 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-09 16:49:56 +00:00
parent 4fe91e52c4
commit 26bb4951b1
5 changed files with 229 additions and 0 deletions

View File

@ -339,4 +339,8 @@ public interface TDGWTServiceAsync {
void getResourcesTD(TRId trId,AsyncCallback<ArrayList<ResourceTDDescriptor>> callback);
void getResourcesTDByType(TRId trId, ResourceTDType reourceTDType,AsyncCallback<ArrayList<ResourceTDDescriptor>> callback);
//GIS MAP
}

View File

@ -0,0 +1,71 @@
package org.gcube.portlets.user.td.gwtservice.server.opexecution;
import java.util.HashMap;
import java.util.Map;
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationDefinition;
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution;
import org.gcube.data.analysis.tabulardata.service.TabularDataService;
import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap;
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
import org.gcube.portlets.user.td.gwtservice.shared.OperationsId;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
import org.gcube.portlets.user.td.gwtservice.shared.map.MapCreationSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Operation Execution for Map Creation
*
* @author "Giancarlo Panichi" email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class OpExecution4MapCreation extends OpExecutionBuilder {
protected static Logger logger = LoggerFactory
.getLogger(OpExecution4MapCreation.class);
private TabularDataService service;
private MapCreationSession mapCreationSession;
public OpExecution4MapCreation(TabularDataService service,
MapCreationSession mapCreationSession) {
this.service = service;
this.mapCreationSession = mapCreationSession;
}
@Override
public void buildOpEx() throws TDGWTServiceException {
logger.debug(mapCreationSession.toString());
OperationDefinition operationDefinition;
operationDefinition = OperationDefinitionMap.map(
OperationsId.GenerateMap.toString(), service);
Map<String, Object> map = new HashMap<String, Object>();
map.put(Constants.PARAMETER_GENERATEMAP_MAPNAME,
mapCreationSession.getName());
map.put(Constants.PARAMETER_GENERATEMAP_FEATURE,
mapCreationSession.getFeature());
map.put(Constants.PARAMETER_GENERATEMAP_USEVIEW,
mapCreationSession.isUseView());
map.put(Constants.PARAMETER_GENERATEMAP_METAABSTRACT,
mapCreationSession.getMetaAbstract());
map.put(Constants.PARAMETER_GENERATEMAP_METAPURPOSE,
mapCreationSession.getMetaPurpose());
map.put(Constants.PARAMETER_GENERATEMAP_USER,
mapCreationSession.getUsername());
map.put(Constants.PARAMETER_GENERATEMAP_METACREDITS,
mapCreationSession.getMetaCredits());
map.put(Constants.PARAMETER_GENERATEMAP_METAKEYWORDS,
mapCreationSession.getMetaKewords());
OperationExecution invocation = new OperationExecution(
operationDefinition.getOperationId(), map);
operationExecutionSpec.setOp(invocation);
}
}

View File

@ -99,4 +99,13 @@ public class Constants {
public static final String PARAMETER_CLONE_TABLE = "table";
public static final String PARAMETER_GENERATEMAP_MAPNAME = "mapName";
public static final String PARAMETER_GENERATEMAP_FEATURE = "feature";
public static final String PARAMETER_GENERATEMAP_USEVIEW = "useView";
public static final String PARAMETER_GENERATEMAP_METAABSTRACT = "metaAbstract";
public static final String PARAMETER_GENERATEMAP_METAPURPOSE = "metaPurpose";
public static final String PARAMETER_GENERATEMAP_USER = "User";
public static final String PARAMETER_GENERATEMAP_METACREDITS = "metaCredits";
public static final String PARAMETER_GENERATEMAP_METAKEYWORDS = "metaKeywords";
}

View File

@ -84,6 +84,7 @@ public enum OperationsId {
ColumnNameRemove("1007"),
TableNameAdd("1008"),
TableNameRemove("1009"),
GenerateMap("1010"),
ChangeToAnnotationColumn("2000"),
ChangeToAttributeColumn("2001"),
ChangeToMeasureColumn("2002"),

View File

@ -0,0 +1,144 @@
/**
*
*/
package org.gcube.portlets.user.td.gwtservice.shared.map;
import java.io.Serializable;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class MapCreationSession implements Serializable {
private static final long serialVersionUID = 2648327461965415567L;
private String name;
private ArrayList<ColumnData> feature;
private boolean useView;
private ColumnData geometry;
private String username;
private String metaAbstract;
private String metaPurpose;
private String metaCredits;
private ArrayList<String> metaKewords;
public MapCreationSession() {
super();
}
/**
*
* @param name
* @param feature
* @param useView
* @param geometry
* @param username
* @param metaAbstract
* @param metaPurpose
* @param metaCredits
* @param metaKewords
*/
public MapCreationSession(String name, ArrayList<ColumnData> feature,
boolean useView, ColumnData geometry, String username,
String metaAbstract, String metaPurpose, String metaCredits,
ArrayList<String> metaKewords) {
super();
this.name = name;
this.feature = feature;
this.useView = useView;
this.geometry = geometry;
this.username = username;
this.metaAbstract = metaAbstract;
this.metaPurpose = metaPurpose;
this.metaCredits = metaCredits;
this.metaKewords = metaKewords;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public ArrayList<ColumnData> getFeature() {
return feature;
}
public void setFeature(ArrayList<ColumnData> feature) {
this.feature = feature;
}
public boolean isUseView() {
return useView;
}
public void setUseView(boolean useView) {
this.useView = useView;
}
public ColumnData getGeometry() {
return geometry;
}
public void setGeometry(ColumnData geometry) {
this.geometry = geometry;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getMetaAbstract() {
return metaAbstract;
}
public void setMetaAbstract(String metaAbstract) {
this.metaAbstract = metaAbstract;
}
public String getMetaPurpose() {
return metaPurpose;
}
public void setMetaPurpose(String metaPurpose) {
this.metaPurpose = metaPurpose;
}
public String getMetaCredits() {
return metaCredits;
}
public void setMetaCredits(String metaCredits) {
this.metaCredits = metaCredits;
}
public ArrayList<String> getMetaKewords() {
return metaKewords;
}
public void setMetaKewords(ArrayList<String> metaKewords) {
this.metaKewords = metaKewords;
}
@Override
public String toString() {
return "MapCreationSession [name=" + name + ", feature=" + feature
+ ", useView=" + useView + ", geometry=" + geometry
+ ", username=" + username + ", metaAbstract=" + metaAbstract
+ ", metaPurpose=" + metaPurpose + ", metaCredits="
+ metaCredits + ", metaKewords=" + metaKewords + "]";
}
}