Package org.exist.collections.triggers

Examples of org.exist.collections.triggers.TriggerException


        if(xqueryRegistry.isXquery(document)) {
            try {
                final List<RestXqService> services = xqueryRegistry.findServices(broker, document);
                xqueryRegistry.registerServices(broker, services);
            } catch(final ExQueryException eqe) {
               throw new TriggerException(eqe.getMessage(), eqe);
            }
        }
    }
View Full Code Here


            if (!remove) {
                lastRev = vDoc;
            }          
       
        } catch (PermissionDeniedException e) {
            throw new TriggerException("Permission denied in VersioningTrigger: " + e.getMessage(), e);
        } catch (Exception e) {
            LOG.warn("Caught exception in VersioningTrigger: " + e.getMessage(), e);
        } finally {
            broker.setSubject(activeSubject);
        }
View Full Code Here

                try {
                    long rev = Long.parseLong(documentRev);
                    if (VersioningHelper.newerRevisionExists(broker, documentPath, rev, documentKey)) {
                        long baseRev = VersioningHelper.getBaseRevision(broker, documentPath, rev, documentKey);
                        LOG.debug("base revision: " + baseRev);
                        throw new TriggerException("Possible version conflict detected for document: " + documentPath);
                    }
                } catch (XPathException e) {
                    LOG.warn("Internal error in VersioningTrigger: " + e.getMessage(), e);
                } catch (IOException e) {
                    LOG.warn("Internal error in VersioningTrigger: " + e.getMessage(), e);
View Full Code Here

                collection.getURI().append(doc.getFileURI()),
                newUri.append(doc.getFileURI())
            );
          }
    } catch (PermissionDeniedException e) {
      throw new TriggerException(e);
    }
  }
View Full Code Here

  public void beforeDeleteCollection(DBBroker broker, Txn txn, Collection collection) throws TriggerException {
//    System.out.println("beforeDeleteCollection "+collection.getURI());
    try {
      deleteCollectionRecursive(broker, collection);
    } catch (PermissionDeniedException e) {
      throw new TriggerException(e);
    }
  }
View Full Code Here

                colTriggers.add(new CollectionTriggerProxy((Class<? extends CollectionTrigger>)clazz, parameters)); //collectionConfigurationURI, parameters));
                added = true;
            }
           
            if(!added) {
                throw new TriggerException("Unknown Trigger class type: " + clazz.getName());
            }

        } catch (final ClassNotFoundException e) {
            if(testOnly) {
                throw new CollectionConfigurationException(e.getMessage(), e);
View Full Code Here

                    contentsFile = XmldbURI.create("contents.xml");
            } else {
                    try{
                            contentsFile = XmldbURI.xmldbUriFor(contentsName);
                    } catch(URISyntaxException e) {
                            throw new TriggerException(e);
                    }
            }
            // try to retrieve the contents file
            try {
                this.doc = parent.getDocument(broker, contentsFile);
                if(this.doc == null)
                // doesn't exist yet: create it

                LOG.debug("creating new file for collection contents");
                // IMPORTANT: temporarily disable triggers on the collection.
                // We would end up in infinite recursion if we don't do that
                parent.setTriggersEnabled(false);
                IndexInfo info = parent.validateXMLResource(null, broker, contentsFile, "<?xml version=\"1.0\"?><contents></contents>");
                //TODO : unlock the collection here ?
                parent.store(null, broker, info, "<?xml version=\"1.0\"?><contents></contents>", false);
                this.doc = info.getDocument();
            } catch (Exception e) {
                throw new TriggerException(e.getMessage(), e);
            } finally {
                parent.setTriggersEnabled(true);
            }
    }
View Full Code Here

      for(int i = 0; i < modifications.length; i++)
        modifications[i].process(null);
      broker.flush();
    } catch (Exception e) {
      e.printStackTrace();
      throw new TriggerException(e.getMessage(), e);
    } finally {
      // IMPORTANT: re-enable trigger processing for the collection.
      getCollection().setTriggersEnabled(true);
    }
  }
View Full Code Here

TOP

Related Classes of org.exist.collections.triggers.TriggerException

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.