Package com.dbxml.db.core.query

Examples of com.dbxml.db.core.query.ResultSet


            }
            else
               throw new CompilationException("Document '" + docName + "' not found");
         }
         else if ( hasXpath ) {
            ResultSet rs;
            if ( keys != null )
               rs = context.queryDocument(tx, XPathQueryResolver.STYLE_XPATH, xpath, nsMap, keys);
            else
               rs = context.queryCollection(tx, XPathQueryResolver.STYLE_XPATH, xpath, nsMap);
View Full Code Here


            attribIndex++;
            String selector = (String)attribs.get("select");

            // If we found an XPath selector we need to execute the commands.
            if ( selector != null ) {
               ResultSet rs = domAdapter.queryCollection(tx, XPathQueryResolver.STYLE_XPATH, selector, null);
               Key lastKey = null;
               while ( rs != null && rs.next() ) {
                  Key key = rs.getResultKey();
                  if ( lastKey != null && (key == lastKey || key.equals(lastKey)) )
                     continue;

            Document doc = domAdapter.getDocument(tx, key);
           
View Full Code Here

   public String[] listGroupContents(String group) throws DBException {
      Transaction tx = new Transaction();
      try {
         XMLSerializableAdapter col = getContentCollection();
         ResultSet res = col.queryCollection(tx, XPathQueryResolver.STYLE_XPATH, "/content[@status='active']/groups/group[.='"+group+"']", EmptyNSMap);
         Set s = new TreeSet();
         while ( res.next() )
            s.add(res.getResultKey().toString());
      return (String[])s.toArray(EmptyStrings);
      }
      catch ( DBException e ) {
         tx.cancel();
         throw e;
View Full Code Here

            sb.append("]");
         }
         sb.append("]");

         XMLSerializableAdapter col = getContentCollection();
         ResultSet rs = col.queryCollection(tx, XPathQueryResolver.STYLE_XPATH, sb.toString(), null);
         Map grpMap = new HashMap(); // of String to List of Element

         while ( rs.next() ) {
            try {
               DocumentTable dt = rs.getResult();
               Element elem = (Element)DTSMHelper.tableToNode(dt);
               NodeList nl = elem.getElementsByTagName(Constants.GROUP);
               for ( int i = 0; i < nl.getLength(); i++ ) {
                  Element e = (Element)nl.item(i);
                  String grpName = DOMUtils.getText(e);
View Full Code Here

   public String[] listUsersForRole(String roleID) throws DBException {
      Transaction tx = new Transaction();
      try {
         XMLSerializableAdapter col = getUsersCollection();
         String queryString = "/user[role[.='"+roleID+"']]/@id";
         ResultSet rs = col.queryCollection(tx, XPathQueryResolver.STYLE_XPATH, queryString, null);
         Set roles = new TreeSet();
         while ( rs.next() ) {
            try {
               String userID = DTSMHelper.tableToText(rs.getResult());
               roles.add(userID);
            }
            catch ( DTSMException e ) {
               // Should never happen
            }
View Full Code Here

         col.remove(tx, roleID);
         roleCache.remove(roleID);

         col = getUsersCollection();
         String queryString = "/user[role[.='"+roleID+"']]/@id";
         ResultSet rs = col.queryCollection(tx, XPathQueryResolver.STYLE_XPATH, queryString, null);
         while ( rs.next() ) {
            try {
               String userID = DTSMHelper.tableToText(rs.getResult());
               User user = readUser(userID);
               user.removeRole(role);
               storeUser(user);
            }
            catch ( DTSMException e ) {
               // Should never happen
            }
         }

         col = getAccessCollection();
         queryString = "/access[role[.='"+roleID+"']]/path/text()";
         rs = col.queryCollection(tx, XPathQueryResolver.STYLE_XPATH, queryString, null);
         while ( rs.next() ) {
            try {
               String path = DTSMHelper.tableToText(rs.getResult());
               Access access = readAccess(path);
               access.removePermissions(role);
               storeAccess(access);
            }
            catch ( DTSMException e ) {
View Full Code Here

TOP

Related Classes of com.dbxml.db.core.query.ResultSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.