AnsweredAssumed Answered

URGENT!!! Query String

Question asked by enkidu on Dec 3, 2013
Latest reply on Dec 13, 2013 by enkidu
hi mates,

i have a query problem and dont know the answer.. this code works:



      StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
      ResultSet rs = searchService.query(storeRef, SearchService.LANGUAGE_XPATH, "/app:company_home/st:sites");
      NodeRef companyHomeNodeRef = null;
      try
      {
          if (rs.length() == 0)
          {
              throw new AlfrescoRuntimeException("Didn't find Company Home");
          }
          companyHomeNodeRef = rs.getNodeRef(0);
          fileFolderService.create(companyHomeNodeRef, "new Folder", ContentModel.TYPE_FOLDER);
      }
      finally
      {
          rs.close();
      }



can u tell me how the code should look like after the new folder is created?



      StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
      ResultSet rs = searchService.query(storeRef, SearchService.LANGUAGE_XPATH, "/app:company_home/st:sites/??:new Folder"); <– problems with query !!!
      NodeRef companyHomeNodeRef = null;
      try
      {
          if (rs.length() == 0)
          {
              throw new AlfrescoRuntimeException("Didn't find Company Home");
          }
          companyHomeNodeRef = rs.getNodeRef(0);
          fileFolderService.create(companyHomeNodeRef, "new new Folder", ContentModel.TYPE_FOLDER);
      }
      finally
      {
          rs.close();
      }

Outcomes