Changeset 1435 for MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice
- Timestamp:
- 06/24/11 21:42:19 (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
r1389 r1435 108 108 //"http://clarin.ids-mannheim.de/vcr/service/virtualcollection"; 109 109 String urlstring = Admin.getConfig().getProperty("virtualcollection.uri"); 110 String vcrstr = (String)get QueryVcrid();110 String vcrstr = (String)getVcrid();//getQueryVcrid(); 111 111 if (!vcrstr.equals("0")){ 112 112 urlstring = urlstring + "/" + vcrstr; -
MDService2/trunk/MDService2/src/eu/clarin/cmdi/mdservice/action/WorkspaceAction.java
r1417 r1435 459 459 nodelist.item(0).setTextContent(to_id); 460 460 } 461 public String createNewId(String name){ 461 public String createNewId(){//String name){ 462 String name = "maxid"; 462 463 String id = workspace_doc.getElementsByTagName(name).item(0).getTextContent(); 463 464 Integer i = Integer.parseInt(id) + 1; … … 545 546 Node node = new_doc.getFirstChild(); 546 547 if (this.qid.equals("0")){ 547 newid = createNewId( "maxqid");548 newid = createNewId();//"maxqid"); 548 549 new_doc.getElementsByTagName("id").item(0).setTextContent(newid); 549 550 Element root = workspace_doc.getDocumentElement(); … … 582 583 Node node = new_doc.getFirstChild(); 583 584 if (this.qid.equals("0")){ 584 newid = createNewId( "maxbid");585 newid = createNewId();//"maxbid"); 585 586 new_doc.getElementsByTagName("id").item(0).setTextContent(newid); 586 587 Element root = workspace_doc.getDocumentElement(); … … 620 621 Node node = new_doc.getFirstChild(); 621 622 if (this.qsid.equals("0")){ 622 newid = createNewId( "maxqsid");623 newid = createNewId();//"maxqsid"); 623 624 new_doc.getElementsByTagName("id").item(0).setTextContent(newid); 624 625 Element root = workspace_doc.getDocumentElement(); … … 659 660 Node node = new_doc.getFirstChild(); 660 661 if (this.qsid.equals("0")){ 661 newid = createNewId( "maxbsid");662 newid = createNewId();//"maxbsid"); 662 663 new_doc.getElementsByTagName("id").item(0).setTextContent(newid); 663 664 Element root = workspace_doc.getDocumentElement(); … … 935 936 } 936 937 938 return result; 939 } 940 941 public Object getVcrid() throws XPathExpressionException{ 942 943 XPathFactory factory = XPathFactory.newInstance(); 944 XPath xpath = factory.newXPath(); 945 XPathExpression expr1, expr2; 946 //expr = xpath.compile("item[id='" + this.qid + "']/vcrid"); 947 expr1 = xpath.compile("//Profiles/WorkspaceProfiles/WorkspaceProfile/Querysets/item/Queries/item[id='" + this.qid + "']/vcrid"); 948 expr2 = xpath.compile("//Profiles/WorkspaceProfiles/WorkspaceProfile/Bookmarksets/item[id='" + this.qid + "']/vcrid"); 949 950 //expression is evaluated with respect to a certain context node which is doc. 951 Object result = null; 952 try{ 953 result = expr1.evaluate(workspace_doc, XPathConstants.STRING); 954 } catch(Exception e){ 955 956 } 957 if (result.equals("")){ 958 try{ 959 result = expr2.evaluate(workspace_doc, XPathConstants.STRING); 960 } catch(Exception e){ 961 962 } 963 } 937 964 return result; 938 965 }
Note: See TracChangeset
for help on using the changeset viewer.