Examples of itemExists()


Examples of javax.jcr.Session.itemExists()

            // create a symetric link
            RequestParameter linkParam = request.getRequestParameter("target");
            if (linkParam != null) {
                String linkPath = linkParam.getString();
                if (session.itemExists(linkPath)) {
                    Item targetItem = session.getItem(linkPath);
                    if (targetItem.isNode()) {
                        linkHelper.createSymetricLink(source,
                            (Node) targetItem, "link");
                    }
View Full Code Here

Examples of javax.jcr.Session.itemExists()

        // is it possible to add the response to the method header ?
        String resourcePath = changes.get(0).getSource();
        Node source = (Node) session.getItem(resourcePath);

        // create a symetric link
        if (session.itemExists(linkPath)) {
          Item targetItem = session.getItem(linkPath);
          if (targetItem.isNode()) {
            linkHelper.createSymetricLink(source, (Node) targetItem, "link");
          }
        }
View Full Code Here

Examples of javax.jcr.Session.itemExists()

        // destination parent and name
        String dstParent = trailingSlash ? dest : ResourceUtil.getParent(dest);

        // delete destination if already exists
        if (!trailingSlash && session.itemExists(dest)) {

            final String replaceString = request.getParameter(SlingPostConstants.RP_REPLACE);
            final boolean isReplace = "true".equalsIgnoreCase(replaceString);
            if (!isReplace) {
                response.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED,
View Full Code Here

Examples of javax.jcr.Session.itemExists()

        } else {

            // check if path to destination exists and create it, but only
            // if it's a descendant of the current node
            if (!dstParent.equals("")) {
                if (session.itemExists(dstParent)) {
                    checkoutIfNecessary((Node) session.getItem(dstParent), changes, versioningConfiguration);
                } else {
                    response.setStatus(HttpServletResponse.SC_PRECONDITION_FAILED,
                        "Cannot " + getOperationName() + " " + resource + " to "
                            + dest + ": parent of destination does not exist");
View Full Code Here

Examples of javax.jcr.Session.itemExists()

        String destPath = destParent + "/" + destName;
        Session session = source.getSession();
       
        checkoutIfNecessary(source.getParent(), changes, versioningConfiguration);

        if (session.itemExists(destPath)) {
            session.getItem(destPath).remove();
        }
       
        session.move(sourcePath, destPath);
        changes.add(Modification.onMoved(sourcePath, destPath));
View Full Code Here

Examples of javax.jcr.Session.itemExists()

        final Session session = resolver.adaptTo(Session.class);
        String propPath = property.getPath();
        String source = property.getRepositorySource();

        // only continue here, if the source really exists
        if (session.itemExists(source)) {

            // if the destination item already exists, remove it
            // first, otherwise ensure the parent location
            if (session.itemExists(propPath)) {
                Node parent = session.getItem(propPath).getParent();
View Full Code Here

Examples of javax.jcr.Session.itemExists()

        // only continue here, if the source really exists
        if (session.itemExists(source)) {

            // if the destination item already exists, remove it
            // first, otherwise ensure the parent location
            if (session.itemExists(propPath)) {
                Node parent = session.getItem(propPath).getParent();
                checkoutIfNecessary(parent, changes, versioningConfiguration);

                session.getItem(propPath).remove();
                changes.add(Modification.onDeleted(propPath));
View Full Code Here

Examples of javax.jcr.Session.itemExists()

    private void findPathsToWatch(final String rootPath, final List<WatchedFolder> result) throws RepositoryException {
        Session s = null;

        try {
            s = repository.loginAdministrative(repository.getDefaultWorkspace());
            if (!s.itemExists(rootPath) || !s.getItem(rootPath).isNode() ) {
                logger.info("Bundles root node {} not found, ignored", rootPath);
            } else {
                logger.debug("Bundles root node {} found, looking for bundle folders inside it", rootPath);
                final Node n = (Node)s.getItem(rootPath);
                findPathsUnderNode(n, result);
View Full Code Here

Examples of javax.jcr.Session.itemExists()

            // remove
            logger.debug("Removing artifact at {}", path);
            Session session = null;
            try {
                session = this.repository.loginAdministrative(null);
                if ( session.itemExists(path) ) {
                    session.getItem(path).remove();
                    session.save();
                }
            } catch (final RepositoryException re) {
                logger.error("Unable to remove resource from " + path, re);
View Full Code Here

Examples of javax.jcr.Session.itemExists()

                    }
                    nodePath = getPathWithHighestPrio(this.newConfigPath + name + ".config");
                }
                // ensure extension 'config'
                if ( !nodePath.endsWith(".config") ) {
                    if ( session.itemExists(nodePath) ) {
                        session.getItem(nodePath).remove();
                    }
                    path = nodePath + ".config";
                } else {
                    path = nodePath;
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.