Package org.exist.xmldb

Examples of org.exist.xmldb.LocalCollection


                dataParams[2] = storeParam;
                entryDataFunctionResult = entryDataFunction.evalFunction(contextSequence, null, dataParams);
               
                String path = entryDataFunctionResult.itemAt(0).getStringValue();
               
                Collection root = new LocalCollection(context.getUser(), context.getBroker().getBrokerPool(), new AnyURIValue("/db").toXmldbURI(), context.getAccessContext());

          if (isDirectory){
                 
                  XMLDBAbstractCollectionManipulator.createCollection(root, path);
                 
View Full Code Here


        defaultProperties.setProperty(EXistOutputKeys.PROCESS_XSL_PI, "no");
        defaultProperties.setProperty(NORMALIZE_HTML, "yes");
    }

  public Resource getResource(Object r) throws XMLDBException {
    LocalCollection collection = null;
    Subject user = null;
   
    LocalXMLResource res = null;
    if (r instanceof NodeProxy) {
      NodeProxy p = (NodeProxy) r;
View Full Code Here

   */
  private void storeSAXEvents(XMLReader dataSource) {
    try {
      if ( root instanceof LocalCollection ) {
        long t0 = System.currentTimeMillis();
        LocalCollection coll = (LocalCollection)root;
        coll.setReader(dataSource);
                                String existHome = System.getProperty("exist.home");
                                File existDir = existHome==null ? new File(".") : new File(existHome);
        doc.setContent(new File(existDir,FILE_STORED));
        coll.storeResource(doc);
        long t1 = System.currentTimeMillis();
        System.out.println("Time for storing:  " + ( t1-t0) + " ms." );
      }
    } catch (XMLDBException e) {
      fail(e.getMessage());
View Full Code Here

    this.errorIfAbsent = errorIfAbsent;
  }
 
  protected LocalCollection createLocalCollection(String name) throws XMLDBException {
    try {
      return new LocalCollection(context.getSubject(), context.getBroker().getBrokerPool(), new AnyURIValue(name).toXmldbURI(), context.getAccessContext());
    } catch(final XPathException e) {
      throw new XMLDBException(ErrorCodes.INVALID_URI,e);
    }
  }
View Full Code Here

        logger.error("Invalid user", xPathException);
        throw xPathException;
      } else {
            Collection collection = null;
        try {
                collection = new LocalCollection(contextUser, context.getBroker().getBrokerPool(), XmldbURI.ROOT_COLLECTION_URI, context.getAccessContext());
          final UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
                final Account userObj = ums.getAccount(user);
                if (null != userObj)
                    {ums.removeAccount(userObj);}
        } catch (final XMLDBException xe) {
View Full Code Here

        final String userName = args[0].getStringValue();

        Collection collection = null;
        try {
            collection = new LocalCollection(context.getSubject(), context.getBroker().getBrokerPool(), XmldbURI.ROOT_COLLECTION_URI, context.getAccessContext());
            final UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
            final Account user = ums.getAccount(userName);

            if(isCalledAs("exists-user")) {
                return null == user ? BooleanValue.FALSE : BooleanValue.TRUE;
View Full Code Here

      throws XPathException {
    final String userName = args[0].getStringValue();
       
        Collection collection = null;
    try {
            collection = new LocalCollection(context.getSubject(), context.getBroker().getBrokerPool(), XmldbURI.ROOT_COLLECTION_URI, context.getAccessContext());
      final UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
      final Account user = ums.getAccount(userName);

      if(user == null)
                // todo - why not just return false()? /ljo
View Full Code Here

                    userObj.addGroup(groups.itemAt(x).getStringValue());
                }
   
    Collection collection = null;
    try {
      collection = new LocalCollection(
          context.getSubject(),
          context.getBroker().getBrokerPool(),
          XmldbURI.ROOT_COLLECTION_URI,
          context.getAccessContext());
      final UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
View Full Code Here

  final String userName = args[0].getStringValue();
  Collection collection = null;
   
  try {
      collection = new LocalCollection(context.getSubject(), context.getBroker().getBrokerPool(), XmldbURI.ROOT_COLLECTION_URI, context.getAccessContext());
      final UserManagementService ums = (UserManagementService) collection.getService("UserManagementService", "1.0");
     
      final Account oldUser = ums.getAccount(userName);
      if(oldUser == null) {
                logger.error("User " + userName + " not found");
View Full Code Here

TOP

Related Classes of org.exist.xmldb.LocalCollection

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.