git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@9644 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
6a63b53c6f
commit
495363dee9
|
@ -6,8 +6,8 @@ import org.globus.wsrf.ResourceException;
|
||||||
public class ModelerResource extends GCUBEWSResource {
|
public class ModelerResource extends GCUBEWSResource {
|
||||||
|
|
||||||
protected static final String RP_ID = "Id";
|
protected static final String RP_ID = "Id";
|
||||||
protected static final String RP_FIRSTSTEP = "reportFirstStep";
|
protected static final String RP_FIRSTSTEP = "firstReport";
|
||||||
protected static final String RP_SECONDSTEP = "reportSecondStep";
|
protected static final String RP_SECONDSTEP = "secondReport";
|
||||||
|
|
||||||
protected static String[] RPNames = { RP_ID, RP_FIRSTSTEP, RP_SECONDSTEP};
|
protected static String[] RPNames = { RP_ID, RP_FIRSTSTEP, RP_SECONDSTEP};
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ public class ModelerResource extends GCUBEWSResource {
|
||||||
this.setId((String) args[0]);
|
this.setId((String) args[0]);
|
||||||
this.setReportFirstStep("");
|
this.setReportFirstStep("");
|
||||||
this.setReportSecondStep("");
|
this.setReportSecondStep("");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,6 +64,7 @@ public class ModelerResource extends GCUBEWSResource {
|
||||||
public synchronized void setReportSecondStep(String reportSecondStep) throws ResourceException {
|
public synchronized void setReportSecondStep(String reportSecondStep) throws ResourceException {
|
||||||
this.getResourcePropertySet().get(RP_SECONDSTEP).clear();
|
this.getResourcePropertySet().get(RP_SECONDSTEP).clear();
|
||||||
this.getResourcePropertySet().get(RP_SECONDSTEP).add(reportSecondStep);
|
this.getResourcePropertySet().get(RP_SECONDSTEP).add(reportSecondStep);
|
||||||
|
this.store();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -84,6 +84,7 @@ public class ModelerResource extends GCUBEWSResource {
|
||||||
public synchronized void setReportFirstStep(String reportFirstStep) throws ResourceException {
|
public synchronized void setReportFirstStep(String reportFirstStep) throws ResourceException {
|
||||||
this.getResourcePropertySet().get(RP_FIRSTSTEP).clear();
|
this.getResourcePropertySet().get(RP_FIRSTSTEP).clear();
|
||||||
this.getResourcePropertySet().get(RP_FIRSTSTEP).add(reportFirstStep);
|
this.getResourcePropertySet().get(RP_FIRSTSTEP).add(reportFirstStep);
|
||||||
|
this.store();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.vremanagement.vremodeler.impl;
|
package org.gcube.vremanagement.vremodeler.impl;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.sql.Date;
|
import java.sql.Date;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
@ -13,6 +14,7 @@ import org.gcube.common.core.types.VOID;
|
||||||
import org.gcube.common.core.utils.logging.GCUBELog;
|
import org.gcube.common.core.utils.logging.GCUBELog;
|
||||||
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
||||||
import org.gcube.vremanagement.vremodeler.impl.thread.DeployVRE;
|
import org.gcube.vremanagement.vremodeler.impl.thread.DeployVRE;
|
||||||
|
import org.gcube.vremanagement.vremodeler.impl.util.MetadataFormat;
|
||||||
import org.gcube.vremanagement.vremodeler.impl.util.XMLUtil;
|
import org.gcube.vremanagement.vremodeler.impl.util.XMLUtil;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.CheckStatusResponse;
|
import org.gcube.vremanagement.vremodeler.stubs.CheckStatusResponse;
|
||||||
import org.gcube.vremanagement.vremodeler.stubs.CollectionArray;
|
import org.gcube.vremanagement.vremodeler.stubs.CollectionArray;
|
||||||
|
@ -252,14 +254,14 @@ public class ModelerService {
|
||||||
public String getMetadataRelatedToCollection(VOID var) throws GCUBEFault {
|
public String getMetadataRelatedToCollection(VOID var) throws GCUBEFault {
|
||||||
ResultSet resDerivable, resNative, collectionRelated, totalMF;
|
ResultSet resDerivable, resNative, collectionRelated, totalMF;
|
||||||
String preparedWhere="";
|
String preparedWhere="";
|
||||||
|
List<MetadataFormat> totalMFList;
|
||||||
Hashtable<String, ArrayList<String>> selectedMetadataStructure= new Hashtable<String, ArrayList<String>>();
|
Hashtable<String, ArrayList<String>> selectedMetadataStructure= new Hashtable<String, ArrayList<String>>();
|
||||||
boolean enter=false;
|
boolean enter=false;
|
||||||
try{
|
try{
|
||||||
DBInterface.connect();
|
DBInterface.connect();
|
||||||
|
|
||||||
collectionRelated= DBInterface.queryDB("select VRERELATEDCOLLECTION.collid from VRERELATEDCOLLECTION where VRERELATEDCOLLECTION.vreid='"+getResource().getId()+"';");
|
collectionRelated= DBInterface.queryDB("select VRERELATEDCOLLECTION.collid from VRERELATEDCOLLECTION where VRERELATEDCOLLECTION.vreid='"+getResource().getId()+"';");
|
||||||
//select only the resuls related with selected collection
|
//select only the results related with selected collection
|
||||||
preparedWhere= " and ( ";
|
preparedWhere= " and ( ";
|
||||||
while (collectionRelated.next()){
|
while (collectionRelated.next()){
|
||||||
enter=true;
|
enter=true;
|
||||||
|
@ -268,7 +270,7 @@ public class ModelerService {
|
||||||
|
|
||||||
ResultSet metadataSelected= DBInterface.queryDB("select collid, mfid from VRERELATEDMETADATAFORMAT where vreid='"+getResource().getId()+"';");
|
ResultSet metadataSelected= DBInterface.queryDB("select collid, mfid from VRERELATEDMETADATAFORMAT where vreid='"+getResource().getId()+"';");
|
||||||
|
|
||||||
//recovering possible previsious selection for metadataFormat
|
//recovering possible previous selection for metadataFormat
|
||||||
while (metadataSelected.next()){
|
while (metadataSelected.next()){
|
||||||
if(selectedMetadataStructure.containsKey(metadataSelected.getString(1)))
|
if(selectedMetadataStructure.containsKey(metadataSelected.getString(1)))
|
||||||
selectedMetadataStructure.get(metadataSelected.getString(1)).add(metadataSelected.getString(2));
|
selectedMetadataStructure.get(metadataSelected.getString(1)).add(metadataSelected.getString(2));
|
||||||
|
@ -282,12 +284,22 @@ public class ModelerService {
|
||||||
if(!enter) throw new GCUBEFault("no collection selected for this VRE");
|
if(!enter) throw new GCUBEFault("no collection selected for this VRE");
|
||||||
else preparedWhere=preparedWhere.substring(0, preparedWhere.length()-4)+") ";
|
else preparedWhere=preparedWhere.substring(0, preparedWhere.length()-4)+") ";
|
||||||
|
|
||||||
|
//retrieving all available MDFromat
|
||||||
totalMF = DBInterface.queryDB("select MDFORMAT.id, MDFORMAT.name, MDFORMAT.schemauri, MDFORMAT.language from MDFORMAT;");
|
totalMF = DBInterface.queryDB("select MDFORMAT.id, MDFORMAT.name, MDFORMAT.schemauri, MDFORMAT.language from MDFORMAT;");
|
||||||
|
totalMFList= new ArrayList<MetadataFormat>();
|
||||||
|
while (totalMF.next()){
|
||||||
|
MetadataFormat mf= new MetadataFormat(totalMF.getString(1),totalMF.getString(2), new URI(totalMF.getString(3)), totalMF.getString(4) );
|
||||||
|
totalMFList.add(mf);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
resDerivable= DBInterface.queryDB("select mdc.collid, mdc.collname, mdc.colldesc , collmdf.id as mdfid from (select * from DERIVABLEMDF INNER JOIN MDFORMAT on DERIVABLEMDF.mdfid= MDFORMAT.id) " +
|
resDerivable= DBInterface.queryDB("select mdc.collid, mdc.collname, mdc.colldesc , collmdf.id as mdfid from (select * from DERIVABLEMDF INNER JOIN MDFORMAT on DERIVABLEMDF.mdfid= MDFORMAT.id) " +
|
||||||
"as COLLMDF,(select COLLECTION.id as collid, COLLECTION.name as collname, COLLECTION.description as colldesc, MDCOLLECTION.id as mdid from COLLECTION INNER JOIN MDCOLLECTION " +
|
"as COLLMDF,(select COLLECTION.id as collid, COLLECTION.name as collname, COLLECTION.description as colldesc, MDCOLLECTION.id as mdid from COLLECTION INNER JOIN MDCOLLECTION " +
|
||||||
"ON COLLECTION.id = MDCOLLECTION.relatedcollectionid) as MDC where COLLMDF.mdcollid= MDC.mdid "+preparedWhere+";");
|
"ON COLLECTION.id = MDCOLLECTION.relatedcollectionid) as MDC where COLLMDF.mdcollid= MDC.mdid "+preparedWhere+";");
|
||||||
|
*/
|
||||||
|
|
||||||
resNative= DBInterface.queryDB("select mdc.collid, mdc.collname, mdc.colldesc , collmdf.id as mdfid from (select * from NATIVEMDF INNER JOIN MDFORMAT on NATIVEMDF.mdfid= MDFORMAT.id) " +
|
resNative= DBInterface.queryDB("select mdc.collid, mdc.collname, mdc.colldesc , collmdf.id as mdfid from (select * from NATIVEMDF INNER JOIN MDFORMAT on NATIVEMDF.mdfid= MDFORMAT.id) " +
|
||||||
"as COLLMDF,(select COLLECTION.id as collid, COLLECTION.name as collname, COLLECTION.description as colldesc, MDCOLLECTION.id as mdid from COLLECTION INNER JOIN MDCOLLECTION " +
|
"as COLLMDF,(select COLLECTION.id as collid, COLLECTION.name as collname, COLLECTION.description as colldesc, MDCOLLECTION.id as mdid from COLLECTION INNER JOIN MDCOLLECTION " +
|
||||||
|
@ -300,7 +312,7 @@ public class ModelerService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return XMLUtil.PrepareMCFormatXML( resNative,resDerivable,totalMF , selectedMetadataStructure);
|
return XMLUtil.PrepareMCFormatXML( resNative,null,totalMFList , selectedMetadataStructure);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ public abstract class VREManagerServiceHandler<T, P> extends GCUBEServiceHandler
|
||||||
try{
|
try{
|
||||||
VREManagerServiceAddressingLocator mbsal= new VREManagerServiceAddressingLocator();
|
VREManagerServiceAddressingLocator mbsal= new VREManagerServiceAddressingLocator();
|
||||||
mbpt= mbsal.getVREManagerPortTypePort(arg0);
|
mbpt= mbsal.getVREManagerPortTypePort(arg0);
|
||||||
mbpt = GCUBERemotePortTypeContext.getProxy(mbpt,scope);
|
mbpt = GCUBERemotePortTypeContext.getProxy(mbpt,scope, 120000);
|
||||||
this.setReturnValue(this.makeCall(mbpt));
|
this.setReturnValue(this.makeCall(mbpt));
|
||||||
}catch(Exception e){e.printStackTrace();throw e; }
|
}catch(Exception e){e.printStackTrace();throw e; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
import javax.xml.transform.OutputKeys;
|
import javax.xml.transform.OutputKeys;
|
||||||
|
@ -137,7 +139,7 @@ public class XMLUtil {
|
||||||
* @param res
|
* @param res
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String PrepareMCFormatXML(ResultSet resNative, ResultSet resDerivable, ResultSet allMF, Hashtable<String, ArrayList<String>> selectedMetadata){
|
public static String PrepareMCFormatXML(ResultSet resNative, ResultSet resDerivable, List<MetadataFormat> allMF, Hashtable<String, ArrayList<String>> selectedMetadata){
|
||||||
|
|
||||||
Document doc= null;
|
Document doc= null;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue