Package org.exist.repo

Examples of org.exist.repo.Deployment


      throw new XPathException(this, EXPathErrorCode.EXPDY003, "Permission denied. You need to be a member " +
          "of the dba group to use repo:deploy/undeploy");
   
    String pkgName = args[0].getStringValue();
        try {
            Deployment deployment = new Deployment(context.getBroker());
            String target;
            if (isCalledAs("deploy")) {
                String userTarget = null;
                if (getArgumentCount() == 2)
                    userTarget = args[1].getStringValue();
                target = deployment.deploy(pkgName, context.getRepository(), userTarget);
            } else if (isCalledAs("install-and-deploy")) {
                String version = null;
                String repoURI;
                if (getArgumentCount() == 3) {
                    version = args[1].getStringValue();
                    repoURI = args[2].getStringValue();
                } else {
                    repoURI = args[1].getStringValue();
                }
                target = installAndDeploy(pkgName, version, repoURI);
            } else if (isCalledAs("install-and-deploy-from-db")) {
                String repoURI = null;
                if (getArgumentCount() == 2)
                    repoURI = args[1].getStringValue();
                target = installAndDeployFromDb(pkgName, repoURI);
            } else
                target = deployment.undeploy(pkgName, context.getRepository());
            return statusReport(target);
        } catch (PackageException e) {
            throw new XPathException(this, EXPathErrorCode.EXPDY001, e.getMessage());
        } catch (IOException e) {
            throw new XPathException(this, ErrorCodes.FOER0000, "Caught IO error while deploying expath archive");
View Full Code Here


    }

    private String installAndDeploy(String pkgName, String version, String repoURI) throws XPathException {
        try {
            RepoPackageLoader loader = new RepoPackageLoader(repoURI);
            Deployment deployment = new Deployment(context.getBroker());
            File xar = loader.load(pkgName, new PackageLoader.Version(version, false));
            if (xar != null)
                return deployment.installAndDeploy(xar, loader);
            return null;
        } catch (MalformedURLException e) {
            throw new XPathException(this, EXPathErrorCode.EXPDY005, "Malformed URL: " + repoURI);
        } catch (PackageException e) {
            throw new XPathException(this, EXPathErrorCode.EXPDY007, e.getMessage());
View Full Code Here

            File file = ((NativeBroker)context.getBroker()).getCollectionBinaryFileFsPath(doc.getURI());
            RepoPackageLoader loader = null;
            if (repoURI != null)
                loader = new RepoPackageLoader(repoURI);
            Deployment deployment = new Deployment(context.getBroker());
            return deployment.installAndDeploy(file, loader);
        } catch (PackageException e) {
            throw new XPathException(this, EXPathErrorCode.EXPDY007, e.getMessage());
        } catch (IOException e) {
            throw new XPathException(this, EXPathErrorCode.EXPDY007, e.getMessage());
        } catch (PermissionDeniedException e) {
View Full Code Here

TOP

Related Classes of org.exist.repo.Deployment

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.