Changeset 1388 for MDService2/trunk/MDService2/src/eu/clarin/cmdi
- Timestamp:
- 06/01/11 21:59:12 (13 years ago)
- Location:
- MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/VirtualCollectionProxyAction.java
r1310 r1388 36 36 //private String proxy_key = "virtual_collection"; 37 37 38 private String qid;38 //private String qid; 39 39 //private String date; 40 40 //private String datefrom; 41 41 //private String dateto; 42 42 /* 43 43 public String getQid(){ 44 44 return qid; … … 47 47 this.qid = qid; 48 48 } 49 49 */ 50 50 @Override 51 51 protected void initialize(){ … … 105 105 106 106 //create connection and post request data 107 108 URL url = new URL("http://clarin.ids-mannheim.de/vcr/service/virtualcollection"); 107 // find out 108 String urlstring = "http://clarin.ids-mannheim.de/vcr/service/virtualcollection"; 109 String vcrstr = (String)getQueryVcrid(); 110 if (!vcrstr.equals("0")){ 111 urlstring = urlstring + "/" + vcrstr; 112 } 113 //qlist.item(0).get 114 URL url = new URL(urlstring); 109 115 String charset = "UTF-8"; 110 116 URLConnection urlconn = url.openConnection(); -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/WorkspaceAction.java
r1384 r1388 552 552 // apend to specific queryset 553 553 NodeList wsnodelist = (NodeList) getQueryParent(); 554 wsnodelist.item(0).appendChild(node2); 554 Node anode = wsnodelist.item(0); 555 if (anode.getTextContent().trim().toLowerCase().equals("null")){ 556 anode.setTextContent(""); 557 } 558 anode.appendChild(node2); 555 559 } 556 560 … … 585 589 // apend to specific bookmarkset 586 590 NodeList wsnodelist = (NodeList) getBookmarkParent(); 587 wsnodelist.item(0).appendChild(node2); 591 Node anode = wsnodelist.item(0); 592 if (anode.getTextContent().trim().toLowerCase().equals("null")){ 593 anode.setTextContent(""); 594 } 595 anode.appendChild(node2); 588 596 } 589 597 … … 620 628 NodeList wsnodelist = (NodeList) this.getWorkspace(); 621 629 Element welem = (Element)wsnodelist.item(0); 622 welem.getElementsByTagName("Querysets").item(0).appendChild(node2); 630 Node anode = welem.getElementsByTagName("Querysets").item(0); 631 if (anode.getTextContent().trim().toLowerCase().equals("null")){ 632 anode.setTextContent(""); 633 } 634 anode.appendChild(node2); 623 635 } 624 636 … … 655 667 NodeList wsnodelist = (NodeList) this.getWorkspace(); 656 668 Element welem = (Element)wsnodelist.item(0); 657 welem.getElementsByTagName("Bookmarksets").item(0).appendChild(node2); 669 Node anode = welem.getElementsByTagName("Bookmarksets").item(0); 670 if (anode.getTextContent().trim().toLowerCase().equals("null")){ 671 anode.setTextContent(""); 672 } 673 anode.appendChild(node2); 658 674 } 659 675 … … 873 889 XPathExpression expr; 874 890 expr = xpath.compile("//Profiles/WorkspaceProfiles/WorkspaceProfile/Querysets/item/Queries/item[id='" + this.qid + "']"); 891 //expr = xpath.compile("//Profiles/WorkspaceProfiles/WorkspaceProfile/Querysets/item/Queries/item[id='" +this.qid.toString()+"']"); 875 892 //expr = xpath.compile("//item[@id='" + this.qid + "']"); 876 893 //expression is evaluated with respect to a certain context node which is doc. … … 901 918 return result; 902 919 } 920 921 public Object getQueryVcrid() throws XPathExpressionException{ 922 923 XPathFactory factory = XPathFactory.newInstance(); 924 XPath xpath = factory.newXPath(); 925 XPathExpression expr; 926 // expr = xpath.compile("//Profiles/WorkspaceProfiles/WorkspaceProfile/Querysets/item[id='" + this.qsid + "']/vcrid"); 927 expr = xpath.compile("//Profiles/WorkspaceProfiles/WorkspaceProfile/Querysets/item/Queries/item[id='" + this.qid + "']/vcrid"); 928 929 //expression is evaluated with respect to a certain context node which is doc. 930 Object result = null; 931 try{ 932 result = expr.evaluate(workspace_doc, XPathConstants.STRING); 933 } catch(Exception e){ 934 935 } 936 937 return result; 938 } 903 939 public Object getQueryset() throws XPathExpressionException{ 904 940
Note: See TracChangeset
for help on using the changeset viewer.