This commit is contained in:
Lucio Lelii 2009-02-11 18:31:11 +00:00
parent 6a63b53c6f
commit 495363dee9
4 changed files with 27 additions and 12 deletions

View File

@ -6,8 +6,8 @@ import org.globus.wsrf.ResourceException;
public class ModelerResource extends GCUBEWSResource {
protected static final String RP_ID = "Id";
protected static final String RP_FIRSTSTEP = "reportFirstStep";
protected static final String RP_SECONDSTEP = "reportSecondStep";
protected static final String RP_FIRSTSTEP = "firstReport";
protected static final String RP_SECONDSTEP = "secondReport";
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.setReportFirstStep("");
this.setReportSecondStep("");
}
@ -65,6 +64,7 @@ public class ModelerResource extends GCUBEWSResource {
public synchronized void setReportSecondStep(String reportSecondStep) throws ResourceException {
this.getResourcePropertySet().get(RP_SECONDSTEP).clear();
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 {
this.getResourcePropertySet().get(RP_FIRSTSTEP).clear();
this.getResourcePropertySet().get(RP_FIRSTSTEP).add(reportFirstStep);
this.store();
}
}

View File

@ -1,5 +1,6 @@
package org.gcube.vremanagement.vremodeler.impl;
import java.net.URI;
import java.rmi.RemoteException;
import java.sql.Date;
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.vremanagement.vremodeler.db.DBInterface;
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.stubs.CheckStatusResponse;
import org.gcube.vremanagement.vremodeler.stubs.CollectionArray;
@ -252,14 +254,14 @@ public class ModelerService {
public String getMetadataRelatedToCollection(VOID var) throws GCUBEFault {
ResultSet resDerivable, resNative, collectionRelated, totalMF;
String preparedWhere="";
List<MetadataFormat> totalMFList;
Hashtable<String, ArrayList<String>> selectedMetadataStructure= new Hashtable<String, ArrayList<String>>();
boolean enter=false;
try{
DBInterface.connect();
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 ( ";
while (collectionRelated.next()){
enter=true;
@ -268,7 +270,7 @@ public class ModelerService {
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()){
if(selectedMetadataStructure.containsKey(metadataSelected.getString(1)))
selectedMetadataStructure.get(metadataSelected.getString(1)).add(metadataSelected.getString(2));
@ -282,13 +284,23 @@ public class ModelerService {
if(!enter) throw new GCUBEFault("no collection selected for this VRE");
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;");
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) " +
"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+";");
*/
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 " +
"ON COLLECTION.id = MDCOLLECTION.relatedcollectionid) as MDC where COLLMDF.mdcollid= MDC.mdid "+preparedWhere+";");
@ -300,7 +312,7 @@ public class ModelerService {
}
return XMLUtil.PrepareMCFormatXML( resNative,resDerivable,totalMF , selectedMetadataStructure);
return XMLUtil.PrepareMCFormatXML( resNative,null,totalMFList , selectedMetadataStructure);
}

View File

@ -65,7 +65,7 @@ public abstract class VREManagerServiceHandler<T, P> extends GCUBEServiceHandler
try{
VREManagerServiceAddressingLocator mbsal= new VREManagerServiceAddressingLocator();
mbpt= mbsal.getVREManagerPortTypePort(arg0);
mbpt = GCUBERemotePortTypeContext.getProxy(mbpt,scope);
mbpt = GCUBERemotePortTypeContext.getProxy(mbpt,scope, 120000);
this.setReturnValue(this.makeCall(mbpt));
}catch(Exception e){e.printStackTrace();throw e; }
}

View File

@ -7,6 +7,8 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.List;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
@ -137,7 +139,7 @@ public class XMLUtil {
* @param res
* @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;
try {