Package org.exist.repo

Examples of org.exist.repo.ExistRepository$Notification


    ExternalContentV2 content = request.getContent();
    Assert.assertEquals( message.getMessageTitle(), content.getMessageTitle() );
    Assert.assertEquals( message.getMessageBody(), content.getMessageBody() );
    Assert.assertEquals( message.getMessageSummary(), content.getMessageSummary() );
    Assert.assertEquals( settings.getLanguageCode(), content.getLanguageCode() );
    Notification notification = request.getNotifications().getNotification().get( 0 );
    List<ReceiverEndPoint> receiverEndPoints = notification.getReceiverEndPoints().getReceiverEndPoint();
    for (ReceiverEndPoint receiverEndPoint : receiverEndPoints) {
      TransportType transportType = receiverEndPoint.getTransportType();
      if (TransportType.EMAIL.equals( transportType )) {
      } else if (TransportType.SMS.equals( transportType )) {
      } else {
View Full Code Here


        try {
            if ( pkg == null ) {
                System.err.println("Package name required");
            }
            else {
                ExistRepository repo = getContext().getRepository();
                Repository parent_repo = repo.getParentRepo();
                parent_repo.removePackage(pkg, force, interact);
                repo.reportAction(ExistRepository.Action.UNINSTALL, pkg);
                context.getBroker().getBrokerPool().getXQueryPool().clear();
            }
        } catch (PackageException ex ) {
            return removed;
            // /TODO: _repo.removePackage seems to throw PackageException
View Full Code Here

  public Sequence eval(Sequence[] args, Sequence contextSequence)
    throws XPathException {
        ValueSequence result = new ValueSequence();
        try {
            ExistRepository repo = getContext().getRepository();
            Repository parent_repo = repo.getParentRepo();
            for ( Packages pkg :  parent_repo.listPackages() ) {
                String name = pkg.name();
                result.add(new StringValue(name));
            }
        } catch (Exception ex ) {
View Full Code Here

    String pkgName = args[0].getStringValue();
    String path = args[1].getStringValue();
    try {
      File packageDir = null;
     
      ExistRepository repo = context.getRepository();
      Package pkg = null;
      for (Packages pp : repo.getParentRepo().listPackages()) {
        pkg = pp.latest();
        if (pkg.getName().equals(pkgName)) {
          try {
            StreamSource source = pkg.getResolver().resolveResource(path);
            return Base64BinaryDocument.getInstance(context, source.getInputStream());
View Full Code Here

        Sequence removed = BooleanValue.FALSE;
        boolean force = true;
        UserInteractionStrategy interact = new BatchUserInteraction();
        String pkgOrPath = args[0].getStringValue();
       
        ExistRepository repo = getContext().getRepository();
        Repository parent_repo = repo.getParentRepo();

        try {
            Package pkg;
            if (isCalledAs("install")) {
            // download .xar from a URI
            URI uri = _getURI(pkgOrPath);
                pkg = parent_repo.installPackage(uri, force, interact);
                repo.reportAction(ExistRepository.Action.INSTALL, pkg.getName());
          } else {
            // .xar is stored as a binary resource
            BinaryDocument doc = null;
            try {
              doc = _getDocument(pkgOrPath);
              File file = ((NativeBroker)context.getBroker()).getCollectionBinaryFileFsPath(doc.getURI());
              LOG.debug("Installing file: " + file.getAbsolutePath());
              pkg = parent_repo.installPackage(file, force, interact);
                    repo.reportAction(ExistRepository.Action.INSTALL, pkg.getName());
            } finally {
              if (doc != null)
                doc.getUpdateLock().release(Lock.READ_LOCK);
            }
          }
View Full Code Here

        shutdown(passwd);
    }

    private static void installApps(XQueryService query, String[] args, int offset) throws EXistException {
        final File home = getExistHome();
        final ExistRepository repository = getRepository(home);

        final List<String> uris = new ArrayList<String>();
        for (int i = offset; i < args.length; i++) {
            final String name = args[i];
            try {
                final File xar = findApp(home, name);
                if (xar != null) {
                    System.out.println("Installing app package " + xar.getName());
                    final UserInteractionStrategy interact = new BatchUserInteraction();
                    final Package pkg = repository.getParentRepo().installPackage(xar, true, interact);
                    final String pkgName = pkg.getName();
                    uris.add(pkgName);
                } else {
                    System.err.println("App package not found: " + name + ". Skipping it.");
                }
View Full Code Here

            if (home != null){
                final File repo_dir = new File(home, "webapp/WEB-INF/expathrepo");
                // ensure the dir exists
                repo_dir.mkdir();
                final FileSystemStorage storage = new FileSystemStorage(repo_dir);
                return new ExistRepository(storage);
            }else{
                final File repo_dir = new File(System.getProperty("java.io.tmpdir") + "/expathrepo");
                // ensure the dir exists
                repo_dir.mkdir();
                final FileSystemStorage storage = new FileSystemStorage(repo_dir);
                return new ExistRepository(storage);
            }
        }
        catch ( final PackageException ex ) {
            // problem with pkg-repo.jar throwing exception
            throw new EXistException("Problem setting expath repository", ex);
View Full Code Here

    private Module resolveInEXPathRepository(String namespace, String prefix)
            throws XPathException
    {
        // the repo and its eXist handler
        final ExistRepository repo = getRepository();
        // try an internal module
        final Module mod = repo.resolveJavaModule(namespace, this);
        if ( mod != null ) {
            return mod;
        }
        // try an eXist-specific module
        final File resolved = repo.resolveXQueryModule(namespace);
        // use the resolved file or return null
        if ( resolved == null ) {
            return null;
        }
        // build a module object from the file
View Full Code Here

    public void commitOperation(
        @WebParam(name = "Commit", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
        Notification parameters)
    {
        MessageContext ctx = webServiceCtx.getMessageContext();
        final Notification commit = parameters;
        final AddressingProperties inboundAddressProperties
            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);

        TaskManager.getManager().queueTask(new Task() {
View Full Code Here

    public void rollbackOperation(
        @WebParam(name = "Rollback", targetNamespace = "http://docs.oasis-open.org/ws-tx/wsat/2006/06", partName = "parameters")
        Notification parameters)
    {
        MessageContext ctx = webServiceCtx.getMessageContext();
        final Notification rollback = parameters;
        final AddressingProperties inboundAddressProperties
            = (AddressingProperties)ctx.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND);
        final ArjunaContext arjunaContext = ArjunaContext.getCurrentContext(ctx);

        TaskManager.getManager().queueTask(new Task() {
View Full Code Here

TOP

Related Classes of org.exist.repo.ExistRepository$Notification

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.