This commit is contained in:
Lucio Lelii 2009-01-22 19:22:51 +00:00
parent 39940b5d73
commit 0345eb6ec2
4 changed files with 30 additions and 14 deletions

View File

@ -16,7 +16,7 @@ CREATE MEMORY TABLE VRERELATEDCOLLECTION(VREID VARCHAR NOT NULL,COLLID VARCHAR N
CREATE MEMORY TABLE VRERELATEDGHN(VREID VARCHAR NOT NULL,GHNID VARCHAR NOT NULL,PRIMARY KEY(VREID,GHNID)) CREATE MEMORY TABLE VRERELATEDGHN(VREID VARCHAR NOT NULL,GHNID VARCHAR NOT NULL,PRIMARY KEY(VREID,GHNID))
CREATE MEMORY TABLE VRERELATEDCS(VREID VARCHAR NOT NULL,CSID VARCHAR NOT NULL,PRIMARY KEY(VREID,CSID)) CREATE MEMORY TABLE VRERELATEDCS(VREID VARCHAR NOT NULL,CSID VARCHAR NOT NULL,PRIMARY KEY(VREID,CSID))
CREATE MEMORY TABLE VRERELATEDMETADATAFORMAT(VREID VARCHAR,COLLID VARCHAR,MFID VARCHAR) CREATE MEMORY TABLE VRERELATEDMETADATAFORMAT(VREID VARCHAR,COLLID VARCHAR,MFID VARCHAR)
CREATE MEMORY TABLE SERVICES(ID INTEGER NOT NULL,NAME VARCHAR NOT NULL,CLASS VARCHAR NOT NULL,PRIMARY KEY(NAME,CLASS),CONSTRAINT SYS_FK_189 FOREIGN KEY(ID) REFERENCES FUNCTIONALITY(ID)) CREATE MEMORY TABLE SERVICES(ID INTEGER NOT NULL,NAME VARCHAR NOT NULL,CLASS VARCHAR NOT NULL, VERSION VARCHAR NOT NULL, PRIMARY KEY(NAME,CLASS),CONSTRAINT SYS_FK_189 FOREIGN KEY(ID) REFERENCES FUNCTIONALITY(ID))
CREATE MEMORY TABLE VRERELATEDFUNCT(VREID VARCHAR NOT NULL,FUNCID VARCHAR NOT NULL,PRIMARY KEY(VREID,FUNCID)) CREATE MEMORY TABLE VRERELATEDFUNCT(VREID VARCHAR NOT NULL,FUNCID VARCHAR NOT NULL,PRIMARY KEY(VREID,FUNCID))
CREATE MEMORY TABLE RELATEDSERVICEID(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR NOT NULL,CLASS VARCHAR NOT NULL) CREATE MEMORY TABLE RELATEDSERVICEID(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR NOT NULL,CLASS VARCHAR NOT NULL)
CREATE MEMORY TABLE PORTLET(NAME VARCHAR NOT NULL PRIMARY KEY, PORTLETCLASS VARCHAR, PARENT VARCHAR) CREATE MEMORY TABLE PORTLET(NAME VARCHAR NOT NULL PRIMARY KEY, PORTLETCLASS VARCHAR, PARENT VARCHAR)
@ -51,12 +51,12 @@ INSERT INTO FUNCTIONALITY VALUES(15,'Information Object Editing','By selecting t
INSERT INTO PORTLETRELTOFUNCT VALUES(0,'CollectionsNavigatorPortlet') INSERT INTO PORTLETRELTOFUNCT VALUES(0,'CollectionsNavigatorPortlet')
INSERT INTO PORTLETRELTOFUNCT VALUES(0,'GSPortlet') INSERT INTO PORTLETRELTOFUNCT VALUES(0,'GSPortlet')
INSERT INTO SERVICES VALUES(5,'ABE','Annotation') INSERT INTO SERVICES VALUES(5,'ABE','Annotation')
INSERT INTO SERVICES VALUES(0,'FilterXPathOperator','Search') INSERT INTO SERVICES VALUES(0,'FilterXPathOperator','Search','1.00.00')
INSERT INTO SERVICES VALUES(0,'JoinInnerOperatorService','Search') INSERT INTO SERVICES VALUES(0,'JoinInnerOperatorService','Search','1.00.00')
INSERT INTO SERVICES VALUES(0,'KeepTopOperatorService','Search') INSERT INTO SERVICES VALUES(0,'KeepTopOperatorService','Search','1.00.00')
INSERT INTO SERVICES VALUES(0,'MergeOperator','Search') INSERT INTO SERVICES VALUES(0,'MergeOperator','Search','1.00.00')
INSERT INTO SERVICES VALUES(3,'GoogleService','Search') INSERT INTO SERVICES VALUES(3,'GoogleService','Search','1.00.00')
INSERT INTO SERVICES VALUES(0,'ResultSetService','Search') INSERT INTO SERVICES VALUES(0,'ResultSetService','Search','1.00.00')
INSERT INTO SERVICES VALUES(0,'SearchMaster','Search') INSERT INTO SERVICES VALUES(0,'SearchMaster','Search','1.00.00')
INSERT INTO SERVICES VALUES(0,'SortOperatorService','Search') INSERT INTO SERVICES VALUES(0,'SortOperatorService','Search','1.00.00')
INSERT INTO SERVICES VALUES(0,'TransformXsltOperatorService','Search') INSERT INTO SERVICES VALUES(0,'TransformXsltOperatorService','Search','1.00.00')

View File

@ -14,6 +14,8 @@ 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.XMLUtil; import org.gcube.vremanagement.vremodeler.impl.util.XMLUtil;
import org.gcube.vremanagement.vremodeler.portallayout.CollectionResourceCreation;
import org.gcube.vremanagement.vremodeler.portallayout.LayoutCreation;
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;
import org.gcube.vremanagement.vremodeler.stubs.FunctionalityIDArray; import org.gcube.vremanagement.vremodeler.stubs.FunctionalityIDArray;
@ -490,11 +492,22 @@ public class ModelerService {
throw new GCUBEUnrecoverableFault(e); throw new GCUBEUnrecoverableFault(e);
} }
//only for test
LayoutCreation lc= new LayoutCreation(resourceID, "TestScenarioPub");
CollectionResourceCreation crc= new CollectionResourceCreation(resourceID, "TestScenarioPub");
try {
lc.createAndPublishLayout();
crc.createAndPublish();
} catch (Exception e) {
e.printStackTrace();
}
/*
DeployVRE deployVREThread= new DeployVRE(resourceID, ServiceContext.getContext().getScope() ); DeployVRE deployVREThread= new DeployVRE(resourceID, ServiceContext.getContext().getScope() );
ServiceContext.getContext().setScope(deployVREThread, ServiceContext.getContext().getScope()); ServiceContext.getContext().setScope(deployVREThread, ServiceContext.getContext().getScope());
logger.trace("Deploy VRE thread started"); logger.trace("Deploy VRE thread started");
deployVREThread.start(); deployVREThread.start();
*/
} }

View File

@ -40,6 +40,7 @@ import org.gcube.vremanagement.vremodeler.impl.ModelerResource;
import org.gcube.vremanagement.vremodeler.impl.ModelerService; import org.gcube.vremanagement.vremodeler.impl.ModelerService;
import org.gcube.vremanagement.vremodeler.impl.util.Couple; import org.gcube.vremanagement.vremodeler.impl.util.Couple;
import org.gcube.vremanagement.vremodeler.impl.util.VREManagerServiceHandler; import org.gcube.vremanagement.vremodeler.impl.util.VREManagerServiceHandler;
import org.gcube.vremanagement.vremodeler.portallayout.CollectionResourceCreation;
import org.gcube.vremanagement.vremodeler.portallayout.LayoutCreation; import org.gcube.vremanagement.vremodeler.portallayout.LayoutCreation;
import org.globus.wsrf.ResourceException; import org.globus.wsrf.ResourceException;
import org.w3c.dom.Document; import org.w3c.dom.Document;
@ -80,10 +81,12 @@ public class DeployVRE extends Thread{
if (!createVRE(GHNList, firstGHNId)){ if (!createVRE(GHNList, firstGHNId)){
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='"+ModelerService.DEPLOYED+"' WHERE VRE.id='"+this.resourceId+"';"); DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='"+ModelerService.DEPLOYED+"' WHERE VRE.id='"+this.resourceId+"';");
LayoutCreation lc= new LayoutCreation(this.resourceId, this.vreName); LayoutCreation lc= new LayoutCreation(this.resourceId, this.vreName);
CollectionResourceCreation crc= new CollectionResourceCreation(this.resourceId, this.vreName);
try { try {
lc.createAndPublishLayout(); lc.createAndPublishLayout();
crc.createAndPublish();
} catch (Exception e) { } catch (Exception e) {
throw new Exception("Cannot create and publish the Layout Generic Resource",e); throw new Exception("Cannot create and publish the Layout Generic Resource and the CollectionScenarioInfo",e);
} }
logger.info("Deploying of the VRE with id "+this.resourceId+" FINISHED"); logger.info("Deploying of the VRE with id "+this.resourceId+" FINISHED");
} }

View File

@ -68,7 +68,7 @@ public class CollectionResourceCreation {
private String transformCollectionResource() throws Exception{ private String transformCollectionResource() throws Exception{
ISClient client= GHNContext.getImplementation(ISClient.class); ISClient client= GHNContext.getImplementation(ISClient.class);
GCUBEGenericResourceQuery query= client.getQuery(GCUBEGenericResourceQuery.class); GCUBEGenericResourceQuery query= client.getQuery(GCUBEGenericResourceQuery.class);
query.addAtomicConditions(new AtomicCondition("/Resource/Profile/Name","ScenarioCollectionInfo"), new AtomicCondition("/Resource/Profile/Body/DL/@name",ServiceContext.getContext().getScope().toString())); query.addAtomicConditions(new AtomicCondition("/Profile/Name","ScenarioCollectionInfo"), new AtomicCondition("/Profile/Body/DL/@name",ServiceContext.getContext().getScope().toString()));
List<GCUBEGenericResource> list= client.execute(query, ServiceContext.getContext().getScope()) ; List<GCUBEGenericResource> list= client.execute(query, ServiceContext.getContext().getScope()) ;
if (list.size()==0) throw new Exception("No GenericResource founded in IS"); if (list.size()==0) throw new Exception("No GenericResource founded in IS");
StringWriter sw= new StringWriter(); StringWriter sw= new StringWriter();