- geeves
- Sep 16, 2004
-
|
building an XPath query
code:public String methodName(String tagString){
//tagString delmited by ";"
ArrayList<String> tagNames = processTagString(tagString);
for (int i = 0 i < tagNames.size(); i++) {
// Set up filter string and add tags to array list
String filterString = "";
String queryString = "/jcr:root//content/foo";
for (int j = 0; j < i; j++) {
if (0 < j) {
filterString += " and @cq:tags='" + tagNames.get(j) + "'";
} else {
filterString += "@cq:tags='" + tagNames.get(j) + "'";
}
}
queryString += "[" + filterString + "] order by @cq:lastModified";
return queryString;
}
}
geeves fucked around with this message at 03:23 on Dec 16, 2009
|
#
¿
Dec 16, 2009 03:19
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
May 21, 2024 16:37
|
|