Examples of ExistRepository


Examples of org.exist.repo.ExistRepository

        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

Examples of org.exist.repo.ExistRepository

  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

Examples of org.exist.repo.ExistRepository

    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

Examples of org.exist.repo.ExistRepository

        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

Examples of org.exist.repo.ExistRepository

        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

Examples of org.exist.repo.ExistRepository

            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

Examples of org.exist.repo.ExistRepository

    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
TOP
Copyright © 2018 www.massapi.com. 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.