git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@9586 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
f4c3f5ba20
commit
6a63b53c6f
|
@ -88,12 +88,12 @@ public class IStoDBUtil {
|
|||
{
|
||||
try{
|
||||
DBInterface.connect();
|
||||
DBInterface.deleteAll("VRERELATEDCOLLECTION");
|
||||
DBInterface.deleteAll("VRERELATEDCS");
|
||||
DBInterface.deleteAll("VRERELATEDMETADATAFORMAT");
|
||||
DBInterface.deleteAll("VRERELATEDFUNCT");
|
||||
DBInterface.deleteAll("VRERELATEDGHN");
|
||||
DBInterface.deleteAll("VRE");
|
||||
//DBInterface.deleteAll("VRERELATEDCOLLECTION");
|
||||
//DBInterface.deleteAll("VRERELATEDCS");
|
||||
//DBInterface.deleteAll("VRERELATEDMETADATAFORMAT");
|
||||
//DBInterface.deleteAll("VRERELATEDFUNCT");
|
||||
//DBInterface.deleteAll("VRERELATEDGHN");
|
||||
//DBInterface.deleteAll("VRE");
|
||||
DBInterface.deleteAll("nativemdf");
|
||||
DBInterface.deleteAll("derivablemdf");
|
||||
DBInterface.deleteAll("mdformat");
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package org.gcube.vremanagement.vremodeler.impl;
|
||||
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
|
||||
import org.gcube.common.core.persistence.GCUBEWSFilePersistenceDelegate;
|
||||
|
||||
|
||||
public class ModelerPersistenceDelegate extends GCUBEWSFilePersistenceDelegate<ModelerResource>{
|
||||
|
||||
|
||||
protected void onLoad(ModelerResource resource, ObjectInputStream ois) throws Exception {
|
||||
super.onLoad(resource, ois);
|
||||
resource.setId((String)ois.readObject());
|
||||
resource.setReportFirstStep((String)ois.readObject());
|
||||
resource.setReportSecondStep((String)ois.readObject());
|
||||
}
|
||||
|
||||
|
||||
protected void onStore(ModelerResource resource,ObjectOutputStream oos) throws Exception {
|
||||
super.onStore(resource, oos);
|
||||
oos.writeObject(resource.getId());
|
||||
oos.writeObject(resource.getReportFirstStep());
|
||||
oos.writeObject(resource.getReportSecondStep());
|
||||
}
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package org.gcube.vremanagement.vremodeler.impl;
|
||||
|
||||
import org.gcube.common.core.contexts.GCUBEServiceContext;
|
||||
import org.gcube.common.core.resources.GCUBERunningInstance;
|
||||
import org.gcube.common.core.resources.runninginstance.DeploymentData;
|
||||
import org.gcube.vremanagement.vremodeler.db.IStoDBUtil;
|
||||
|
||||
public class ServiceContext extends GCUBEServiceContext{
|
||||
|
@ -18,9 +20,14 @@ public class ServiceContext extends GCUBEServiceContext{
|
|||
protected String getJNDIName() {return "gcube/vremanagement/vremodeler";}
|
||||
|
||||
protected void onReady() throws Exception{
|
||||
try{
|
||||
logger.info("ready event invoked on " + this.getName());
|
||||
IStoDBUtil.initDB(ServiceContext.getContext().getStartScopes()[0].isInfrastructure()? ServiceContext.getContext().getStartScopes()[1]: ServiceContext.getContext().getStartScopes()[0]);
|
||||
|
||||
ModelerContext.getPortTypeContext().getWSHome().checkResourceScope();
|
||||
}catch (Exception e){
|
||||
this.setStatus(Status.FAILED, true);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,6 +28,6 @@ public class MFRelationNative implements Listable{
|
|||
|
||||
public boolean equals(Object o){
|
||||
MFRelationNative mf= (MFRelationNative) o;
|
||||
return (this.metaCollectionID==mf.getMetadataCollectionId()) && (this.metaFormatID==mf.getMetadataFormatId());
|
||||
return (this.metaCollectionID.compareTo(mf.getMetadataCollectionId())==0) && (this.metaFormatID.compareTo(mf.getMetadataFormatId())==0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class MetadataFormat implements Listable{
|
|||
|
||||
return ((this.name.compareTo(mf.getName())==0) &&
|
||||
(languageControl) &&
|
||||
(this.schemaURI.compareTo(mf.getSchemaURI())==0));
|
||||
(this.schemaURI.toString().compareTo(mf.getSchemaURI().toString())==0));
|
||||
}
|
||||
|
||||
public List<String> getAsStringList(){
|
||||
|
|
|
@ -198,7 +198,8 @@ public class XMLUtil {
|
|||
|
||||
|
||||
//setting the derivable MDF
|
||||
while(resDerivable.next()){
|
||||
/* TODO: when metadataBroker will be ready for transformation
|
||||
* while(resDerivable.next()){
|
||||
Element tmpKeyEl= addElements(doc, "Collection", new Element[]{
|
||||
createTextElement(doc,"CollectionID" , resDerivable.getString(1)),
|
||||
createTextElement(doc,"Name" , resDerivable.getString(2)),
|
||||
|
@ -227,7 +228,7 @@ public class XMLUtil {
|
|||
MDFHash.put(resDerivable.getString(1), new Couple<Element, ArrayList<Element>>(tmpKeyEl, tempArray) );
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
}catch(SQLException e){logger.error("hsqldb error");
|
||||
e.printStackTrace();
|
||||
}catch(Exception e){
|
||||
|
|
Loading…
Reference in New Issue