git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/VREModeler@7390 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
58fc35a30b
commit
15294f965f
|
@ -108,9 +108,8 @@ public class DBInterface {
|
|||
|
||||
st.executeUpdate(insertQuery.toString()); // run the query
|
||||
}catch(SQLException e){logger.error("HSQLDB ERROR: Problem inserting data "+e.getMessage()+" -- "+ insertQuery);
|
||||
System.out.println("HSQLDB ERROR: Problem inserting data "+e.getMessage()+" -- "+ insertQuery);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
catch(Exception e){
|
||||
logger.error("VDLModelService error: Problem inserting data "+e.getMessage());
|
||||
|
|
|
@ -166,7 +166,6 @@ public class IStoDBUtil {
|
|||
GCUBECollectionQuery query= queryClient.getQuery(GCUBECollectionQuery.class);
|
||||
query.addGenericCondition("$result/Profile/IsUserCollection[string(@value) eq 'true']");
|
||||
collectionList= queryClient.execute(query, scope);
|
||||
System.out.println("collections "+ collectionList.size());
|
||||
}catch(Exception e ){logger.error("Error queryng IS"); throw new GCUBEFault(e); }
|
||||
|
||||
try{
|
||||
|
@ -236,7 +235,7 @@ public class IStoDBUtil {
|
|||
throw new GCUBEFault(e); }
|
||||
|
||||
|
||||
/*
|
||||
|
||||
ArrayList<String[]> MDFormatArray=new ArrayList<String[]>();
|
||||
ArrayList<String[]> MDNativeArray=new ArrayList<String[]>();
|
||||
ArrayList<String[]> MDDerivableArray=new ArrayList<String[]>();
|
||||
|
@ -245,38 +244,7 @@ public class IStoDBUtil {
|
|||
String metadataFormatQuery;
|
||||
String[] singleNativeMDF;
|
||||
String[] singleDerivableMDF;
|
||||
/*
|
||||
MetadataBrokerPortType metadataBroker=null;
|
||||
MetadataBrokerServiceAddressingLocator mbLoc;
|
||||
boolean brokerConnected=true;
|
||||
|
||||
//connecting to metadata broker service
|
||||
try{
|
||||
RunningInstanceManager ri=DISHLSClient.getRunningInstanceManager(cred, epr);
|
||||
|
||||
String[] eprs= ri.getEPRsRIFromClassAndName("MetadataManagement", "MetadataBrokerService", "diligentproject/metadatamanagement/metadatabrokerservice", cred, epr);
|
||||
|
||||
|
||||
|
||||
EndpointReferenceType eprTemp= new EndpointReferenceType();
|
||||
eprTemp.setAddress(new AttributedURI(eprs[0]));
|
||||
|
||||
//metadata Broker Service connection
|
||||
mbLoc = new MetadataBrokerServiceAddressingLocator() ;
|
||||
|
||||
metadataBroker=mbLoc.getMetadataBrokerPortTypePort(eprTemp);
|
||||
|
||||
if (ModelFactoryService.isSecurityEnabled){
|
||||
ConfigureSecurity.setSecurity(((javax.xml.rpc.Stub) metadataBroker), true, cred, GSIConstants.GSI_MODE_FULL_DELEG );
|
||||
}
|
||||
|
||||
|
||||
|
||||
}catch(Exception e){
|
||||
logger.error("error contacting metadata broker Service "+e.getMessage());
|
||||
//e.printStackTrace();
|
||||
brokerConnected=false;
|
||||
}
|
||||
|
||||
for(String[] singleColl: resultsParsed)
|
||||
{
|
||||
|
@ -284,6 +252,7 @@ public class IStoDBUtil {
|
|||
uuid=uuidMFGEN.nextUUID();
|
||||
String existID;
|
||||
//retriving the metadataFormat for the current MDCollection
|
||||
|
||||
metadataFormatQuery="for $MetadataFormat in collection(\"/db/Profiles/MetadataCollection\")//Document/Data/child::*[local-name()='Profile']/DILIGENTResource where $MetadataFormat/UniqueID/string() eq '"+singleColl[0]+"' return <r><id>"+uuid+"</id><Name>{$MetadataFormat/Profile/MetadataFormat/Name/string()}</Name><SchemaURI>{$MetadataFormat/Profile/MetadataFormat/SchemaURI/string()}</SchemaURI><lng>{$MetadataFormat/Profile/MetadataFormat/Language/string()}</lng></r>";
|
||||
results=makeQueryDIS(epr, cred, metadataFormatQuery);
|
||||
String[][] resultsMDFParsed= parseResults(results, "r");
|
||||
|
|
|
@ -219,7 +219,6 @@ public class ModelerService {
|
|||
public void setCollection(CollectionArray request) throws GCUBEFault{
|
||||
try{
|
||||
logger.trace("method setCollection Called");
|
||||
System.out.println("method setCollection Called");
|
||||
DBInterface.connect();
|
||||
DBInterface.ExecuteUpdate("DELETE FROM VRERELATEDCOLLECTION WHERE VRERELATEDCOLLECTION.vreid='"+getResource().getId()+"';");
|
||||
|
||||
|
|
|
@ -36,8 +36,7 @@ public class XMLUtil {
|
|||
try{
|
||||
while (res.next()){
|
||||
|
||||
System.out.println("entered");
|
||||
selectedString= relatedCollection.contains(res.getString("ID")) ? "true" : "false";
|
||||
selectedString= relatedCollection.contains(res.getString("ID")) ? "true" : "false";
|
||||
temp.append("<Collection><ID>");
|
||||
temp.append(res.getString(1));
|
||||
temp.append("</ID><Name>");
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
package org.gcube.vremanagement.vremodeler.impl.util;
|
||||
|
||||
import org.gcube.common.core.informationsystem.client.XMLResult;
|
||||
import org.gcube.common.core.informationsystem.client.XMLResult.ISResultEvaluationException;
|
||||
import org.gcube.common.core.utils.logging.GCUBELog;
|
||||
|
||||
public class MetadataFormat{
|
||||
|
||||
|
||||
private static GCUBELog log= new GCUBELog(MetadataFormat.class.getName());
|
||||
private String name;
|
||||
private String schemaURI;
|
||||
private String language;
|
||||
|
||||
public MetadataFormat(){}
|
||||
|
||||
public MetadataFormat(XMLResult xml){
|
||||
try {
|
||||
name= xml.evaluate("//Name/text()").get(0);
|
||||
schemaURI= xml.evaluate("//SchemaURI/text()").get(0);
|
||||
language= xml.evaluate("//lng/text()").get(0);
|
||||
}catch(ISResultEvaluationException ise){
|
||||
log.error("Error parsing th emetadata "+ise.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String getName(){
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String Name){
|
||||
name= Name;
|
||||
}
|
||||
|
||||
public String getSchemaURI(){
|
||||
return schemaURI;
|
||||
}
|
||||
|
||||
public void setSchemaURI(String schemaURI){
|
||||
name= schemaURI;
|
||||
}
|
||||
|
||||
public String getLanguage(){
|
||||
return language;
|
||||
}
|
||||
|
||||
public void setLanguage(String lng){
|
||||
name= lng;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o){
|
||||
MetadataFormat mf = (MetadataFormat)o;
|
||||
return ((this.name.compareTo(mf.getName())==0) &&
|
||||
(this.language.compareTo(mf.getLanguage())==0) &&
|
||||
(this.schemaURI.compareTo(mf.getSchemaURI())==0));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue