git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@11018 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4db6520ab5
commit
1bd753b3e7
|
@ -16,6 +16,11 @@
|
|||
type="java.lang.String"
|
||||
override="false" />
|
||||
|
||||
<environment
|
||||
name="vremanagerTimeout"
|
||||
value="600000"
|
||||
type="java.lang.String"
|
||||
override="false" />
|
||||
</service>
|
||||
|
||||
<service name="gcube/vremanagement/vremodeler/ModelerFactoryService"/>
|
||||
|
|
|
@ -47,17 +47,17 @@ INSERT INTO FUNCTIONALITY VALUES(12,'Quick Search','Using Quick Search the user
|
|||
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(0,'searchGUI#Search')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(0,'collectionsnavigator#CollectionsNavigatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(0,'resultsetPortlet#ResultsetPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(0,'newresultset#newresultset')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(0,'Metadata_Viewing_Portlet#Metadata_Viewing_Portlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(0,'VRE InformationSpace Editor#VREInformationSpaceEditorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(12,'quicksearchportlet#QuickSearchPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(12,'resultsetPortlet#ResultsetPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(12,'newresultset#newresultset')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(12,'Metadata_Viewing_Portlet#Metadata_Viewing_Portlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(11,'Metadata_Viewing_Portlet#Metadata_Viewing_Portlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(11,'resultsetPortlet#ResultsetPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(11,'newresultset#newresultset')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(11,'geospatial#GeoSpatialPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(10,'GoogleSearchPortlet#GoogleSearchPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(10,'resultsetPortlet#ResultsetPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(10,'newresultset#newresultset')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(10,'geospatial#GeoSpatialPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(6,'templatecreator#TemplateGenerator')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(2,'reportgenerator#ReportGeneratorPortlet')
|
||||
|
@ -78,6 +78,18 @@ INSERT INTO PORTLETRELTOFUNCT VALUES(10,'workspace#WorkspacePortlet')
|
|||
INSERT INTO PORTLETRELTOFUNCT VALUES(11,'workspace#WorkspacePortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(12,'workspace#WorkspacePortlet')
|
||||
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(0,'layoutcreator#LayoutcreatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(1,'layoutcreator#LayoutcreatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(2,'layoutcreator#LayoutcreatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(3,'layoutcreator#LayoutcreatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(4,'layoutcreator#LayoutcreatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(5,'layoutcreator#LayoutcreatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(6,'layoutcreator#LayoutcreatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(9,'layoutcreator#LayoutcreatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(10,'layoutcreator#LayoutcreatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(11,'layoutcreator#LayoutcreatorPortlet')
|
||||
INSERT INTO PORTLETRELTOFUNCT VALUES(12,'layoutcreator#LayoutcreatorPortlet')
|
||||
|
||||
|
||||
INSERT INTO SERVICES VALUES(1,'ABE','Annotation', '1.00.00')
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ public class DBInterface {
|
|||
|
||||
private static String dbFile = System.getenv("GLOBUS_LOCATION") + File.separator + "etc" + File.separator + "org.gcube.vremanagement.vremodeler" + File.separator + "hsqldb" + File.separator + "vdldb";
|
||||
|
||||
private static GCUBELog logger = new GCUBELog(DBInterface.class.getName());
|
||||
private static GCUBELog logger = new GCUBELog(DBInterface.class);
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
|
@ -102,19 +102,21 @@ public class DBInterface {
|
|||
logger.trace("Query for inserting in hsqldb "+insertQuery);
|
||||
|
||||
st.executeUpdate(insertQuery.toString()); // run the query
|
||||
}catch(SQLException e){logger.error("HSQLDB ERROR: Problem inserting data "+e.getMessage()+" -- "+ insertQuery);
|
||||
e.printStackTrace();
|
||||
}catch(SQLException e){
|
||||
logger.warn("HSQLDB ERROR: Problem inserting data "+insertQuery,e);
|
||||
|
||||
}
|
||||
|
||||
catch(Exception e){
|
||||
logger.error("VDLModelService error: Problem inserting data "+e.getMessage());
|
||||
e.printStackTrace();
|
||||
logger.error("VDLModelService error: Problem inserting data ",e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
st.close();
|
||||
}catch(SQLException e){logger.error("error closing SQL statement");
|
||||
}catch(SQLException e){
|
||||
logger.error("error closing SQL statement",e);
|
||||
throw new GCUBEFault(e);}
|
||||
}
|
||||
|
||||
|
@ -152,19 +154,19 @@ public class DBInterface {
|
|||
logger.trace("Query for inserting in hsqldb "+insertQuery);
|
||||
|
||||
st.executeUpdate(insertQuery.toString()); // run the query
|
||||
}catch(SQLException e){logger.error("HSQLDB ERROR: Problem inserting data "+e.getMessage()+" -- "+ insertQuery);
|
||||
e.printStackTrace();
|
||||
}catch(SQLException e){
|
||||
logger.warn("HSQLDB ERROR: Problem inserting data "+ insertQuery,e);
|
||||
}
|
||||
|
||||
catch(Exception e){
|
||||
logger.error("VDLModelService error: Problem inserting data "+e.getMessage());
|
||||
e.printStackTrace();
|
||||
logger.error("VDLModelService error: Problem inserting data ",e);
|
||||
}
|
||||
}
|
||||
|
||||
try{
|
||||
st.close();
|
||||
}catch(SQLException e){logger.error("error closing SQL statement");
|
||||
}catch(SQLException e){
|
||||
logger.error("error closing SQL statement");
|
||||
throw new GCUBEFault(e);}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,10 +40,6 @@ import org.gcube.common.core.resources.GCUBEService;
|
|||
import org.gcube.common.core.scope.GCUBEScope;
|
||||
import org.gcube.common.core.utils.handlers.GCUBEServiceClientImpl;
|
||||
import org.gcube.common.core.utils.logging.GCUBELog;
|
||||
import org.gcube.metadatamanagement.metadatabroker.stubs.FindPossibleTransformationPrograms;
|
||||
import org.gcube.metadatamanagement.metadatabroker.stubs.FindPossibleTransformationProgramsResponse;
|
||||
import org.gcube.metadatamanagement.metadatabroker.stubs.MetadataBrokerFormat;
|
||||
import org.gcube.metadatamanagement.metadatabroker.stubs.MetadataBrokerPortType;
|
||||
import org.gcube.vremanagement.vremodeler.impl.ServiceContext;
|
||||
import org.gcube.vremanagement.vremodeler.impl.util.MBrokerServiceHandler;
|
||||
import org.gcube.vremanagement.vremodeler.impl.util.MFRelationDerivate;
|
||||
|
@ -109,8 +105,9 @@ public class IStoDBUtil {
|
|||
DBInterface.deleteAll("ghnrelatedri");
|
||||
DBInterface.deleteAll("cs");
|
||||
DBInterface.deleteAll("NEEDEDRESOURCES");
|
||||
}catch (SQLException e){logger.error("error cleaning sqlDB");
|
||||
e.printStackTrace(); throw new GCUBEFault(e); }
|
||||
}catch (SQLException e){
|
||||
logger.error("error cleaning sqlDB",e);
|
||||
throw new GCUBEFault(e); }
|
||||
|
||||
}
|
||||
|
||||
|
@ -138,7 +135,7 @@ public class IStoDBUtil {
|
|||
DBInterface.connect();
|
||||
DBInterface.InsertInto("NEEDEDRESOURCES", values);
|
||||
}catch (SQLException e){
|
||||
logger.error("VDLModel: DB error "+e.getMessage());
|
||||
logger.error("VDLModel: DB error ",e);
|
||||
throw new GCUBEFault(e);
|
||||
}
|
||||
|
||||
|
@ -177,7 +174,8 @@ public class IStoDBUtil {
|
|||
DBInterface.connect();
|
||||
DBInterface.InsertInto("collection", values);
|
||||
}
|
||||
}catch (SQLException e){logger.error("VDLModel: DB error "+e.getMessage());
|
||||
}catch (SQLException e){
|
||||
logger.error("VDLModel: DB error ",e);
|
||||
throw new GCUBEFault(e); }
|
||||
}
|
||||
|
||||
|
@ -228,14 +226,14 @@ public class IStoDBUtil {
|
|||
metadataFormatList.add(mf);
|
||||
nativeMetadataFormatList.add(new MFRelationNative(col.getID(), mf.getId() ));
|
||||
}else nativeMetadataFormatList.add(new MFRelationNative(col.getID(), metadataFormatList.get(metadataFormatList.indexOf(mf)).getId()));
|
||||
|
||||
/*
|
||||
try {
|
||||
ServiceContext.getContext().setScope(scope);
|
||||
derivateMetadataFormatList.addAll(getMFDerivate(metadataFormatList, col));
|
||||
} catch (Exception e) {
|
||||
logger.error("Error in getMFDerivate"+e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
//insert values in the database
|
||||
DBInterface.connect();
|
||||
|
@ -246,13 +244,14 @@ public class IStoDBUtil {
|
|||
|
||||
|
||||
}
|
||||
}catch (SQLException e){logger.error("VDLModel: DB error "+e.getMessage());
|
||||
}catch (SQLException e){
|
||||
logger.error("VDLModel: DB error ",e);
|
||||
throw new GCUBEFault(e); }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
private static List<MFRelationDerivate> getMFDerivate(List<MetadataFormat> mdfList, GCUBEMCollection col ) throws Exception{
|
||||
|
||||
MBrokerServiceHandler<String[], MetadataFormat> sHandler= new MBrokerServiceHandler<String[],MetadataFormat >(){
|
||||
|
@ -328,7 +327,7 @@ public class IStoDBUtil {
|
|||
}
|
||||
return derivatedList;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -363,8 +362,9 @@ public class IStoDBUtil {
|
|||
DBInterface.connect();
|
||||
DBInterface.InsertInto("cs", values);
|
||||
}
|
||||
}catch (SQLException e){logger.error("error inserting cs");
|
||||
throw new GCUBEFault(e); }
|
||||
}catch (SQLException e){
|
||||
logger.error("error inserting cs",e);
|
||||
throw new GCUBEFault(e); }
|
||||
}
|
||||
|
||||
|
||||
|
@ -452,8 +452,9 @@ public class IStoDBUtil {
|
|||
DBInterface.InsertInto("ghn", values);
|
||||
DBInterface.InsertInto("runninginstance",riValues );
|
||||
DBInterface.InsertInto("GHNRELATEDRI",riRelatedGHNvalues );
|
||||
}catch (SQLException e){logger.error("error inserting cs");
|
||||
throw new GCUBEFault(e); }
|
||||
}catch (SQLException e){
|
||||
logger.error("error inserting ghn",e);
|
||||
throw new GCUBEFault(e); }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -486,8 +487,9 @@ public class IStoDBUtil {
|
|||
try{
|
||||
DBInterface.connect();
|
||||
DBInterface.InsertInto("relatedserviceid", values);
|
||||
}catch (SQLException e){//logger.error("error DB");
|
||||
e.printStackTrace(); throw new GCUBEFault(e); }
|
||||
}catch (SQLException e){
|
||||
logger.error("error DB",e);
|
||||
throw new GCUBEFault(e); }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ public class ModelFactoryService extends GCUBEStartupPortType{
|
|||
try{
|
||||
ModelerContext pctx= ModelerContext.getPortTypeContext();
|
||||
mr=(ModelerResource)pctx.getWSHome().create(pctx.makeKey(id), id);
|
||||
mr.store();
|
||||
return mr.getEPR();
|
||||
}catch (Exception e){logger.error("error creating resource",e); throw new GCUBEFault(e);}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ public class ModelerResource extends GCUBEWSResource {
|
|||
this.setId((String) args[0]);
|
||||
this.setFirstReport("");
|
||||
this.setSecondReport("");
|
||||
this.store();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ public class ServiceContext extends GCUBEServiceContext{
|
|||
protected String getJNDIName() {return "gcube/vremanagement/vremodeler";}
|
||||
|
||||
protected void onReady() throws Exception{
|
||||
try{
|
||||
try{
|
||||
logger.info("ready event invoked on " + this.getName());
|
||||
this.intializeDB();
|
||||
ModelerContext.getPortTypeContext().getWSHome().checkResourceScope();
|
||||
|
|
|
@ -12,8 +12,8 @@ import org.gcube.common.core.informationsystem.client.queries.GCUBERIQuery;
|
|||
import org.gcube.common.core.resources.GCUBERunningInstance;
|
||||
import org.gcube.common.core.utils.handlers.GCUBEServiceClient;
|
||||
import org.gcube.common.core.utils.handlers.GCUBEServiceHandler;
|
||||
import org.gcube.metadatamanagement.metadatabroker.stubs.MetadataBrokerPortType;
|
||||
import org.gcube.metadatamanagement.metadatabroker.stubs.service.MetadataBrokerServiceAddressingLocator;
|
||||
//import org.gcube.metadatamanagement.metadatabroker.stubs.MetadataBrokerPortType;
|
||||
//import org.gcube.metadatamanagement.metadatabroker.stubs.service.MetadataBrokerServiceAddressingLocator;
|
||||
import org.gcube.vremanagement.vremodeler.impl.ServiceContext;
|
||||
|
||||
public abstract class MBrokerServiceHandler<T, P> extends GCUBEServiceHandler<GCUBEServiceClient> {
|
||||
|
@ -51,17 +51,18 @@ public abstract class MBrokerServiceHandler<T, P> extends GCUBEServiceHandler<GC
|
|||
|
||||
}
|
||||
|
||||
protected abstract T makeCall(MetadataBrokerPortType mbportType) throws Exception;
|
||||
//protected abstract T makeCall(MetadataBrokerPortType mbportType) throws Exception;
|
||||
|
||||
|
||||
|
||||
protected void interact(EndpointReferenceType arg0) throws Exception{
|
||||
MetadataBrokerPortType mbpt= null;
|
||||
/*MetadataBrokerPortType mbpt= null;
|
||||
try{
|
||||
MetadataBrokerServiceAddressingLocator mbsal= new MetadataBrokerServiceAddressingLocator();
|
||||
mbpt= mbsal.getMetadataBrokerPortTypePort(arg0);
|
||||
mbpt = GCUBERemotePortTypeContext.getProxy(mbpt,ServiceContext.getContext().getScope());
|
||||
this.setReturnValue(this.makeCall(mbpt));
|
||||
}catch(Exception e){throw e;}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public abstract class VREManagerServiceHandler<T, P> extends GCUBEServiceHandler
|
|||
try{
|
||||
VREManagerServiceAddressingLocator mbsal= new VREManagerServiceAddressingLocator();
|
||||
mbpt= mbsal.getVREManagerPortTypePort(arg0);
|
||||
mbpt = GCUBERemotePortTypeContext.getProxy(mbpt,scope, 120000);
|
||||
mbpt = GCUBERemotePortTypeContext.getProxy(mbpt,scope, Integer.parseInt((String)ServiceContext.getContext().getProperty("vremanagerTimeout", true)));
|
||||
this.usedhost= arg0.getAddress().getHost();
|
||||
this.setReturnValue(this.makeCall(mbpt));
|
||||
}catch(Exception e){e.printStackTrace();throw e; }
|
||||
|
|
|
@ -26,7 +26,7 @@ public class LayoutCreation {
|
|||
|
||||
private void publish(Document doc) throws Exception{
|
||||
|
||||
System.out.println(XMLUtil.docToString(doc));
|
||||
//System.out.println(XMLUtil.docToString(doc));
|
||||
resource.setBody(XMLUtil.docToString(doc));
|
||||
resource.setDescription("the gridsphere layout for vre: "+ServiceContext.getContext().getScope()+"/"+this.vreName);
|
||||
String[] splitScope=ServiceContext.getContext().getScope().toString().split("/");
|
||||
|
|
Loading…
Reference in New Issue