git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@8769 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3c9b0e5198
commit
1ee3b43067
|
@ -485,30 +485,18 @@ public class ModelerService {
|
|||
logger.error("Error retrieving the Resource Requested"); throw new GCUBEUnrecoverableFault(e);
|
||||
}
|
||||
|
||||
LayoutCreation lc= new LayoutCreation(resourceID, "prova");
|
||||
lc.createTree();
|
||||
StringWriter s= new StringWriter();
|
||||
try {
|
||||
lc.createAndPublishLayout().store(s);
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
System.out.println("RESOURCE --------------------------------");
|
||||
System.out.println(s.toString());
|
||||
/*
|
||||
try{
|
||||
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='"+DEPLOYING+"' WHERE VRE.id='"+resourceID+"';");
|
||||
} catch (GCUBEFault e) {
|
||||
logger.error("HSQLDB Error "+e);
|
||||
throw new GCUBEUnrecoverableFault(e);
|
||||
}
|
||||
System.out.println("the scope is"+ServiceContext.getContext().getScope());
|
||||
DeployVRE deployVREThread= new DeployVRE(resourceID, ServiceContext.getContext().getScope() );
|
||||
|
||||
DeployVRE deployVREThread= new DeployVRE(resourceID, ServiceContext.getContext().getScope() );
|
||||
ServiceContext.getContext().setScope(deployVREThread, ServiceContext.getContext().getScope());
|
||||
logger.trace("Deploy VRE thread started");
|
||||
deployVREThread.start();
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package org.gcube.vremanagement.vremodeler.impl.thread;
|
|||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
|
@ -41,6 +42,7 @@ import org.gcube.vremanagement.vremodeler.impl.ModelerResource;
|
|||
import org.gcube.vremanagement.vremodeler.impl.ModelerService;
|
||||
import org.gcube.vremanagement.vremodeler.impl.util.Couple;
|
||||
import org.gcube.vremanagement.vremodeler.impl.util.VREManagerServiceHandler;
|
||||
import org.gcube.vremanagement.vremodeler.portallayout.LayoutCreation;
|
||||
import org.globus.wsrf.ResourceException;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
@ -79,6 +81,13 @@ public class DeployVRE extends Thread{
|
|||
if (!deployManagerOnVRE(firstGHNId)){
|
||||
if (!createVRE(GHNList, firstGHNId)){
|
||||
DBInterface.ExecuteUpdate("UPDATE VRE SET STATUS='"+ModelerService.DEPLOYED+"' WHERE VRE.id='"+this.resourceId+"';");
|
||||
LayoutCreation lc= new LayoutCreation(this.resourceId, this.vreName);
|
||||
StringWriter s= new StringWriter();
|
||||
try {
|
||||
lc.createAndPublishLayout().store(s);
|
||||
} catch (Exception e) {
|
||||
throw new Exception("Cannot create and publish the Layout Generic Resource",e);
|
||||
}
|
||||
logger.info("Deploying of the VRE with id "+this.resourceId+" FINISHED");
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.w3c.dom.Document;
|
|||
|
||||
public class LayoutCreation {
|
||||
|
||||
private TreeNode layoutTree = new TreeNode("Root");
|
||||
private TreeNode layoutTree;
|
||||
private Document doc;
|
||||
private GCUBEGenericResource resource;
|
||||
private String vreId;
|
||||
|
@ -32,7 +32,7 @@ public class LayoutCreation {
|
|||
resource.setName("Layout_"+splitScope[1]+"_"+splitScope[2]+"_"+this.vreName);
|
||||
resource.setSecondaryType("VRE");
|
||||
ISPublisher publisher= GHNContext.getImplementation(ISPublisher.class);
|
||||
System.out.println(publisher.registerGCUBEResource(resource, ServiceContext.getContext().getScope(), ServiceContext.getContext()));
|
||||
publisher.registerGCUBEResource(resource, ServiceContext.getContext().getScope(), ServiceContext.getContext());
|
||||
}
|
||||
|
||||
|
||||
|
@ -46,12 +46,14 @@ public class LayoutCreation {
|
|||
}
|
||||
|
||||
public GCUBEGenericResource createAndPublishLayout() throws Exception{
|
||||
layoutTree = new TreeNode("Root");
|
||||
createTree();
|
||||
doc.appendChild(layoutTree.createElement(doc));
|
||||
publish(doc);
|
||||
return resource;
|
||||
}
|
||||
|
||||
public void createTree(){
|
||||
private void createTree() throws Exception{
|
||||
try {
|
||||
ResultSet selectedPortlet= DBInterface.queryDB("select p.name, p.portletclass, p.parent from VRERELATEDFUNCT as vf,PORTLETRELTOFUNCT as pf, PORTLET as p WHERE vf.FUNCID=pf.FUNCID and pf.PORTLETNAME=p.NAME and vf.VREID='"+this.vreId+"';");
|
||||
while (selectedPortlet.next()){
|
||||
|
@ -74,8 +76,8 @@ public class LayoutCreation {
|
|||
System.out.println("sono entrato");
|
||||
}
|
||||
} catch (SQLException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
throw new Exception("Error creating the Portlet Tree",e);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue