public Iterator<Resource> findResources(String query,
String language) {
try {
final Query q = getSession().getWorkspace().getQueryManager().createQuery(query, language);
final QueryResult result = q.execute();
final NodeIterator nodes = result.getNodes();
return new Iterator<Resource>() {
public boolean hasNext() {
return nodes.hasNext();
}
public Resource next() {
Node node = nodes.nextNode();
try {
return new JcrNodeResource(resolver, node, null ,null);
} catch (RepositoryException e) {
throw new IllegalStateException(e);
}
}
public void remove() {
throw new UnsupportedOperationException("remove");
}
};
} catch (NamingException ne) {
return null;
} catch (RepositoryException re) {
return null;
}
}
public Resource getResource(Resource base, String path) {
// TODO Auto-generated method stub
return null;
}
public Resource getResource(String path) {
// TODO Auto-generated method stub
return null;
}
public String[] getSearchPath() {
return new String[] {"/apps/", "/libs/"};
}
public Iterator<Resource> listChildren(Resource parent) {
// TODO Auto-generated method stub
return null;
}
public String map(HttpServletRequest request, String resourcePath) {
// TODO Auto-generated method stub
return null;
}
public String map(String resourcePath) {
// TODO Auto-generated method stub
return null;
}
public Iterator<Map<String, Object>> queryResources(String query,
String language) {
try {
final Query q = getSession().getWorkspace().getQueryManager().createQuery(query, language);
final QueryResult result = q.execute();
final String[] colNames = result.getColumnNames();
final RowIterator rows = result.getRows();
return new Iterator<Map<String, Object>>() {
public boolean hasNext() {
return rows.hasNext();
}