This commit is contained in:
Lucio Lelii 2009-02-18 17:41:36 +00:00
parent 8721e2beaf
commit 0d690cb16b
2 changed files with 6 additions and 2 deletions

View File

@ -119,7 +119,7 @@ public class IStoDBUtil {
try{ try{
if (queryClient==null) queryClient= GHNContext.getImplementation(ISClient.class); if (queryClient==null) queryClient= GHNContext.getImplementation(ISClient.class);
GCUBEGenericResourceQuery query= queryClient.getQuery(GCUBEGenericResourceQuery.class); GCUBEGenericResourceQuery query= queryClient.getQuery(GCUBEGenericResourceQuery.class);
query.addGenericCondition("$result/Profile/SecondType/string() eq 'UserProfile' or $result/Profile/SecondType/string() eq 'Schemas Searchable Fields' or $result/Profile/SecondType/string() eq 'MetadataXSLT' or $result/Profile/SecondType/string() eq 'PresentationXSLT'"); query.addGenericCondition("$result/Profile/SecondaryType/string() eq 'UserProfile' or $result/Profile/SecondaryType/string() eq 'MetadataXSLT' or $result/Profile/SecondaryType/string() eq 'PresentationXSLT'");
genericResourcesList= queryClient.execute(query, scope); genericResourcesList= queryClient.execute(query, scope);
}catch(Exception e ){logger.error("Error queryng IS"); throw new GCUBEFault(e); } }catch(Exception e ){logger.error("Error queryng IS"); throw new GCUBEFault(e); }

View File

@ -12,6 +12,7 @@ import org.gcube.vremanagement.vremodeler.db.DBInterface;
import org.gcube.vremanagement.vremodeler.impl.ServiceContext; import org.gcube.vremanagement.vremodeler.impl.ServiceContext;
import org.gcube.vremanagement.vremodeler.impl.util.XMLUtil; import org.gcube.vremanagement.vremodeler.impl.util.XMLUtil;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element;
public class GenericResourcePortlet { public class GenericResourcePortlet {
@ -22,8 +23,11 @@ public class GenericResourcePortlet {
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
DBInterface.connect(); DBInterface.connect();
ResultSet rs= DBInterface.queryDB("select pf.PORTLETCLASS from PORTLETRELTOFUNCT as pf, VRERELATEDFUNCT as vf where vf.vreid='"+vreId+"' and pf.FUNCID=vf.FUNCID"); ResultSet rs= DBInterface.queryDB("select pf.PORTLETCLASS from PORTLETRELTOFUNCT as pf, VRERELATEDFUNCT as vf where vf.vreid='"+vreId+"' and pf.FUNCID=vf.FUNCID");
Element root= doc.createElement("ListPortlets");
while(rs.next()) while(rs.next())
doc.appendChild(XMLUtil.createTextElement(doc, "Portlet", rs.getString(1))); root.appendChild(XMLUtil.createTextElement(doc, "Portlet", rs.getString(1)));
doc.appendChild(root);
resource.setBody(XMLUtil.docToString(doc)); resource.setBody(XMLUtil.docToString(doc));
resource.setDescription("List of selectable Portlet for the VRE "+vreName); resource.setDescription("List of selectable Portlet for the VRE "+vreName);