Package javax.jcr

Examples of javax.jcr.Item


                if (targetNode.hasProperty(JCR_DATA)) {
                    final Property prop = targetNode.getProperty(JCR_DATA);
                    contentLength = JcrItemResource.getContentLength(prop);
                } else {
                    // otherwise try to follow default item trail
                    Item item = getPrimaryItem(targetNode);
                    while (item != null && item.isNode()) {
                        item = getPrimaryItem((Node) item);
                    }
                    if ( item != null ) {
                        final Property data = (Property) item;
View Full Code Here


        if (jcrSession == null) {
            throw new RepositoryException("JCR Session not found");
        }

    Item item = jcrSession.getItem(resourcePath);
    if (item != null) {
      resourcePath = item.getPath();
    } else {
      throw new ResourceNotFoundException("Resource is not a JCR Node");
    }

    // Calculate a map of privileges to all the aggregate privileges it is contained in.
    // Use for fast lookup during the mergePrivilegeSets calls below.
        AccessControlManager accessControlManager = AccessControlUtil.getAccessControlManager(jcrSession);
    Map<Privilege, Set<Privilege>> privilegeToAncestorMap = new HashMap<Privilege, Set<Privilege>>();
        Privilege[] supportedPrivileges = accessControlManager.getSupportedPrivileges(item.getPath());
        for (Privilege privilege : supportedPrivileges) {
      if (privilege.isAggregate()) {
        Privilege[] ap = privilege.getAggregatePrivileges();
        for (Privilege privilege2 : ap) {
          Set<Privilege> set = privilegeToAncestorMap.get(privilege2);
View Full Code Here

          if (resourcePath == null) {
          throw new ResourceNotFoundException("Resource path was not supplied.");
          }

        Item item = jcrSession.getItem(resourcePath);
        if (item != null) {
          resourcePath = item.getPath();
        } else {
          throw new ResourceNotFoundException("Resource is not a JCR Node");
        }

        //load the principalIds array into a set for quick lookup below
View Full Code Here

   
      if (resourcePath == null) {
      throw new ResourceNotFoundException("Resource path was not supplied.");
      }

    Item item = jcrSession.getItem(resourcePath);
    if (item != null) {
      resourcePath = item.getPath();
    } else {
      throw new ResourceNotFoundException("Resource is not a JCR Node");
    }
   
    // Collect the modified privileges from the request.
View Full Code Here

        return node.getPath() + "/" + path;
    }

    private String getUUID(Session session, String propPath, String referencePath) throws RepositoryException {
        if (session.itemExists(referencePath)) {
            Item item = session.getItem(referencePath);
            if (item.isNode()) {
                Node refNode = (Node) item;
                if (refNode.isNodeType("mix:referenceable")) {
                    return refNode.getUUID();
                }
            }
View Full Code Here

        path = path.substring(0, lastSlash);
        if (!session.itemExists(path)) {
            return null;
        }

        Item item = session.getItem(path);
        return (item.isNode()) ? (Node) item : null;
    }
View Full Code Here

    }

    private Node deepCreateNode(String path, Session session, String nodeType) throws RepositoryException {
        Node result = null;
        if (session.itemExists(path)) {
            Item it = session.getItem(path);
            if(it.isNode()) {
                result = (Node)it;
            }
        }
        else {
            int slashPos = path.lastIndexOf("/");
View Full Code Here

            // 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

        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

        // Try ExecutionEngine first, persistent storage if not found
        JobStatus result = executionEngine.getJobStatus(path);
        if(result == null) {
            try {
                if(session.itemExists(path)) {
                    final Item i = session.getItem(path);
                    if(i.isNode()) {
                        result = jobStatusFactory.getJobStatus((Node)i);
                    }
                }
            } catch(RepositoryException re) {
                throw new JobStorageException("RepositoryException in getJobStatus(path)", re);
View Full Code Here

TOP

Related Classes of javax.jcr.Item

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.