git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@53014 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
587e15a2ec
commit
995d3cac28
|
@ -3,11 +3,7 @@
|
|||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/VreModelerDependecies"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/GCORE"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/ContentManager"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/gDL2"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/gML2"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/CMDeps"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/EolusClient-gCore"/>
|
||||
<classpathentry kind="lib" path="/Users/lucio/workspace/Dependencies/VREModeler/org.gcube.common.eolus-client.jar"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/GCORELIB"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -9,7 +9,6 @@ CREATE CACHED TABLE FUNCTIONALITY(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(S
|
|||
CREATE CACHED TABLE VRERELATEDCOLLECTION(VREID VARCHAR NOT NULL,COLLID VARCHAR NOT NULL,PRIMARY KEY(VREID,COLLID))
|
||||
CREATE CACHED TABLE VRERELATEDGHN(VREID VARCHAR NOT NULL,GHNID VARCHAR NOT NULL, ISCANDIDATE BOOLEAN,PRIMARY KEY(VREID,GHNID))
|
||||
CREATE CACHED TABLE VRERELATEDCS(VREID VARCHAR NOT NULL,CSID VARCHAR NOT NULL,PRIMARY KEY(VREID,CSID))
|
||||
CREATE CACHED TABLE VRERELATEDMETADATAFORMAT(VREID VARCHAR,COLLID VARCHAR,MFID VARCHAR)
|
||||
CREATE CACHED TABLE SERVICES(ID INTEGER NOT NULL,NAME VARCHAR NOT NULL,CLASS VARCHAR NOT NULL, VERSION VARCHAR NOT NULL, PRIMARY KEY(ID,NAME,CLASS),CONSTRAINT SYS_FK_189 FOREIGN KEY(ID) REFERENCES FUNCTIONALITY(ID))
|
||||
CREATE CACHED TABLE VRERELATEDFUNCT(VREID VARCHAR NOT NULL,FUNCID VARCHAR NOT NULL,PRIMARY KEY(VREID,FUNCID))
|
||||
CREATE CACHED TABLE RELATEDSERVICEID(ID VARCHAR NOT NULL PRIMARY KEY,NAME VARCHAR NOT NULL,CLASS VARCHAR NOT NULL)
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<Main>
|
||||
<Description>Allows user to create new VRE</Description>
|
||||
<Name>VREModeler-service</Name>
|
||||
<Version>1.5.0</Version>
|
||||
<Version>1.6.0</Version>
|
||||
<Dependencies>
|
||||
<Dependency>
|
||||
<Service>
|
||||
|
@ -20,21 +20,10 @@
|
|||
<Version>1.0.0</Version>
|
||||
</Service>
|
||||
<Package>VREModeler-stubs</Package>
|
||||
<Version>[1.05.00,1.06.00)</Version>
|
||||
<Version>[1.06.00,1.07.00)</Version>
|
||||
<Scope level="GHN"/>
|
||||
<Optional>false</Optional>
|
||||
</Dependency>
|
||||
<Dependency>
|
||||
<Service>
|
||||
<Class>ContentManagement</Class>
|
||||
<Name>GCubeDocumentLibrary</Name>
|
||||
<Version>1.0.0</Version>
|
||||
</Service>
|
||||
<Package>GCubeModelLibrary</Package>
|
||||
<Version>[2.0.0,3.0.0)</Version>
|
||||
<Scope level="GHN" />
|
||||
<Optional>false</Optional>
|
||||
</Dependency>
|
||||
<Dependency>
|
||||
<Service>
|
||||
<Class>ExternalSoftware</Class>
|
||||
|
@ -67,7 +56,7 @@
|
|||
<Software>
|
||||
<Description>Allows user to create new VRE</Description>
|
||||
<Name>VREModeler-stubs</Name>
|
||||
<Version>1.5.0</Version>
|
||||
<Version>1.6.0</Version>
|
||||
<Files><File>org.gcube.vremanagement.vremodeler.stubs.jar</File></Files>
|
||||
</Software>
|
||||
</Packages>
|
||||
|
|
|
@ -61,7 +61,6 @@ public class IStoDBUtil {
|
|||
DBInterface.connect();
|
||||
//DBInterface.deleteAll("VRERELATEDCOLLECTION");
|
||||
//DBInterface.deleteAll("VRERELATEDCS");
|
||||
//DBInterface.deleteAll("VRERELATEDMETADATAFORMAT");
|
||||
//DBInterface.deleteAll("VRERELATEDFUNCT");
|
||||
//DBInterface.deleteAll("VRERELATEDGHN");
|
||||
//DBInterface.deleteAll("VRE");
|
||||
|
|
|
@ -235,8 +235,10 @@ public class ModelerService {
|
|||
DBInterface.connect();
|
||||
resFunct= DBInterface.queryDB("select * from functionality where father is null;");
|
||||
selectedFuncRes= DBInterface.queryDB("select funcid from VRERELATEDFUNCT where vreid='"+getResource().getId()+"';");
|
||||
while (selectedFuncRes.next())
|
||||
while (selectedFuncRes.next()){
|
||||
selectedFunctionality.add(selectedFuncRes.getInt(1));
|
||||
logger.trace("selected functionality is "+selectedFuncRes.getInt(1));
|
||||
}
|
||||
selectedCSRes= DBInterface.queryDB("select csid from VRERELATEDCS where vreid='"+getResource().getId()+"';");
|
||||
while (selectedCSRes.next())
|
||||
selectedCS.add(selectedCSRes.getString(1));
|
||||
|
|
|
@ -56,7 +56,8 @@ public class ServiceContext extends GCUBEServiceContext{
|
|||
ArrayList<ServicePair> baseServiceGhn= new ArrayList<ServicePair>();
|
||||
for (String gen:((String)this.getProperty("BaseRisForSelectableGHN", true)).split(";")){
|
||||
String[] serviceString=gen.split(",");
|
||||
new ServicePair(serviceString[0], serviceString[1]);
|
||||
logger.trace("base service: "+serviceString[0]+","+ serviceString[1]);
|
||||
baseServiceGhn.add(new ServicePair(serviceString[0], serviceString[1]));
|
||||
}
|
||||
this.setBaseServiceForGhn(baseServiceGhn);
|
||||
|
||||
|
|
|
@ -223,13 +223,6 @@ public class DeployVRE extends Thread{
|
|||
resItemList.addAll(addCollections());
|
||||
}catch(SQLException sqle){logger.error("Error contacting HSQLDB "+sqle);}
|
||||
|
||||
//retrieving MDCollection with native MDFormat
|
||||
try{
|
||||
resItemList.addAll(addMetadataFormats());
|
||||
}catch(SQLException sqle){
|
||||
logger.error("Error contacting HSQLDB ",sqle);
|
||||
}
|
||||
|
||||
//adding the CollectionResource genericResource
|
||||
ResourceItem genResItem= new ResourceItem();
|
||||
genResItem.setID(collectionResourceCreation.getCreatedResourceId());
|
||||
|
@ -438,20 +431,6 @@ public class DeployVRE extends Thread{
|
|||
return resItemList;
|
||||
}
|
||||
|
||||
private List<ResourceItem> addMetadataFormats() throws Exception{
|
||||
List<ResourceItem> resItemList= new ArrayList<ResourceItem>();
|
||||
ResourceItem resItem;
|
||||
ResultSet resMdColNative =DBInterface.queryDB("select n.mdcollid from VRERELATEDMETADATAFORMAT AS s, NATIVEMDF as n where s.vreid='"+this.resourceId+"' and n.mdfid=s.mfid;");
|
||||
while (resMdColNative.next()){
|
||||
resItem= new ResourceItem();
|
||||
resItem.setID(resMdColNative.getString(1));
|
||||
logger.trace("selected MetadataCollection:"+ resItem.getID());
|
||||
resItem.setType(GCUBEMCollection.TYPE);
|
||||
resItemList.add(resItem);
|
||||
}
|
||||
return resItemList;
|
||||
}
|
||||
|
||||
private List<ResourceItem> addGenericResources() throws Exception{
|
||||
List<ResourceItem> resItemList= new ArrayList<ResourceItem>();
|
||||
ResourceItem resItem;
|
||||
|
|
|
@ -13,7 +13,6 @@ import javax.xml.xpath.XPathConstants;
|
|||
import javax.xml.xpath.XPathFactory;
|
||||
import org.gcube.common.core.resources.GCUBECollection;
|
||||
import org.gcube.common.core.resources.GCUBEGenericResource;
|
||||
import org.gcube.common.core.resources.GCUBEMCollection;
|
||||
import org.gcube.common.core.utils.logging.GCUBELog;
|
||||
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
||||
import org.gcube.vremanagement.vremodeler.stubs.deployreport.DeployReport;
|
||||
|
@ -77,9 +76,6 @@ public class ReportFiller {
|
|||
while (resRelatedCol.next())
|
||||
report.getResources().add(new Resource(resRelatedCol.getString(1), GCUBECollection.TYPE));
|
||||
|
||||
ResultSet resMdColNative =DBInterface.queryDB("select n.mdcollid from VRERELATEDMETADATAFORMAT AS s, NATIVEMDF as n where s.vreid='"+vreResourceId+"' and n.mdfid=s.mfid;");
|
||||
while (resMdColNative.next())
|
||||
report.getResources().add(new Resource(resMdColNative.getString(1), GCUBEMCollection.TYPE));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,9 +17,46 @@ public class ServicePair {
|
|||
public String getServiceName() {
|
||||
return serviceName;
|
||||
}
|
||||
|
||||
public boolean equals(Object o){
|
||||
ServicePair servicePair= (ServicePair) o;
|
||||
return this.serviceClass.compareTo(servicePair.getServiceClass())==0 && this.serviceName.compareTo(servicePair.getServiceName())==0;
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result
|
||||
+ ((serviceClass == null) ? 0 : serviceClass.hashCode());
|
||||
result = prime * result
|
||||
+ ((serviceName == null) ? 0 : serviceName.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ServicePair other = (ServicePair) obj;
|
||||
if (serviceClass == null) {
|
||||
if (other.serviceClass != null)
|
||||
return false;
|
||||
} else if (!serviceClass.equals(other.serviceClass))
|
||||
return false;
|
||||
if (serviceName == null) {
|
||||
if (other.serviceName != null)
|
||||
return false;
|
||||
} else if (!serviceName.equals(other.serviceName))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.gcube.common.core.utils.logging.GCUBELog;
|
|||
import org.gcube.vremanagement.resourcemanager.stubs.resourcemanager.ResourceManagerPortType;
|
||||
import org.gcube.vremanagement.resourcemanager.stubs.resourcemanager.service.ResourceManagerServiceAddressingLocator;
|
||||
import org.gcube.vremanagement.vremodeler.db.DBInterface;
|
||||
import org.gcube.vremanagement.vremodeler.impl.ModelerService;
|
||||
import org.gcube.vremanagement.vremodeler.impl.ServiceContext;
|
||||
import org.gcube.vremanagement.vremodeler.stubs.CollectionType;
|
||||
import org.gcube.vremanagement.vremodeler.stubs.CollectionTypeInfo;
|
||||
|
@ -48,7 +47,7 @@ import org.w3c.dom.Element;
|
|||
public class Util {
|
||||
|
||||
|
||||
private static final GCUBELog logger = new GCUBELog(ModelerService.class.getName());
|
||||
private static final GCUBELog logger = new GCUBELog(Util.class);
|
||||
|
||||
/**
|
||||
* it creates the XML output for VDLGenerator
|
||||
|
@ -94,12 +93,13 @@ public class Util {
|
|||
ResultSet riRes;
|
||||
while (res.next()){
|
||||
//controlling all the RIs on the GHN
|
||||
riRes= DBInterface.queryDB("select RI.id, RI.name, RI.class from RUNNINGINSTANCE as RI, GHNRELATEDRI as REL where REL.GHNID='"+res.getString("ID")+"' and REL.RIID=RI.ID");
|
||||
riRes= DBInterface.queryDB("select RI.id as ID, RI.name as NAME, RI.class as CLASS from RUNNINGINSTANCE as RI, GHNRELATEDRI as REL where REL.GHNID='"+res.getString("ID")+"' and REL.RIID=RI.ID");
|
||||
int risNum=0;
|
||||
List<RunningInstance> riList= new ArrayList<RunningInstance>();
|
||||
while (riRes.next()){
|
||||
if (!ServiceContext.getContext().getBaseServiceForGhn().contains(new ServicePair(riRes.getString(2),riRes.getString(3))))
|
||||
if (!ServiceContext.getContext().getBaseServiceForGhn().contains(new ServicePair(riRes.getString("NAME"),riRes.getString("CLASS"))))
|
||||
risNum++;
|
||||
|
||||
riList.add(new RunningInstance(riRes.getString(3),riRes.getString(2)));
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ public class Util {
|
|||
* @return
|
||||
*/
|
||||
public static List<FunctionalityItem> prepareFunctionalities(ResultSet res, ArrayList<Integer> selectedFunct, ArrayList<String> selectedCS){
|
||||
|
||||
logger.trace("preparing functionality");
|
||||
List<FunctionalityItem> functionalityItemList= new ArrayList<FunctionalityItem>();
|
||||
try {
|
||||
while(res.next()){
|
||||
|
@ -176,6 +176,7 @@ public class Util {
|
|||
functionlityItem.setSelected(selectedFunct.contains(res.getInt(1)));
|
||||
functionlityItem.setDescription(res.getString(3));
|
||||
|
||||
logger.trace(" - "+functionlityItem.getName()+" - "+ functionlityItem.isSelected() );
|
||||
List<FunctionalityItem> subFunctionalities= new ArrayList<FunctionalityItem>();
|
||||
|
||||
ResultSet subFunctRes=DBInterface.queryDB("select * from FUNCTIONALITY where father='"+res.getInt(1)+"';");
|
||||
|
@ -185,7 +186,8 @@ public class Util {
|
|||
subFunctionalityItem.setName(subFunctRes.getString(2));
|
||||
subFunctionalityItem.setDescription(subFunctRes.getString(3));
|
||||
subFunctionalityItem.setSelected(selectedFunct.contains(subFunctRes.getInt(1)));
|
||||
subFunctionalities.add(subFunctionalityItem);
|
||||
subFunctionalities.add(subFunctionalityItem);
|
||||
logger.trace(" - "+subFunctRes.getString(2)+" - "+ subFunctionalityItem.isSelected() );
|
||||
}
|
||||
functionlityItem.setChilds(subFunctionalities.toArray(new FunctionalityItem[subFunctionalities.size()]));
|
||||
functionalityItemList.add(functionlityItem);
|
||||
|
|
Loading…
Reference in New Issue