Package org.apache.slide.structure

Examples of org.apache.slide.structure.ObjectNode


            subject = config.getUsersPath()+"/"+
                      ((PrincipalSourcePermission) sourcepermission).getPrincipal();

            // Test if principal exists
            try {
                ObjectNode objectnode = structure.retrieve(this.slideToken,
                                                           subject);

                if ( !(objectnode instanceof SubjectNode)) {
                    throw new SourceException("Principal '"+
                                              ((PrincipalSourcePermission) sourcepermission).getPrincipal()+
                                              "' doesn't exists");
                }
            } catch (SlideException se) {
                throw new SourceException("Could not retrieve object for principal '"+
                                          ((PrincipalSourcePermission) sourcepermission).getPrincipal()+
                                          "'", se);
            }

        } else if (sourcepermission instanceof GroupSourcePermission) {
            subject = config.getUsersPath()+"/"+
                      ((GroupSourcePermission) sourcepermission).getGroup();

            // Test if group exists
            try {
                ObjectNode objectnode = structure.retrieve(this.slideToken,
                                                           subject);

                if ( !(objectnode instanceof GroupNode)) {
                    throw new SourceException("Group '"+
                                              ((GroupSourcePermission) sourcepermission).getGroup()+
View Full Code Here


            subject = config.getUsersPath()+"/"+
                      ((PrincipalSourcePermission) sourcepermission).getPrincipal();

            // Test if principal exists
            try {
                ObjectNode objectnode = structure.retrieve(this.slideToken,
                                                           subject);

                if ( !(objectnode instanceof SubjectNode)) {
                    throw new SourceException("Principal '"+
                                              ((PrincipalSourcePermission) sourcepermission).getPrincipal()+
                                              "' doesn't exists");
                }
            } catch (SlideException se) {
                throw new SourceException("Could not retrieve object for principal '"+
                                          ((PrincipalSourcePermission) sourcepermission).getPrincipal()+
                                          "'", se);
            }

        } else if (sourcepermission instanceof GroupSourcePermission) {
            subject = config.getUsersPath()+"/"+
                      ((GroupSourcePermission) sourcepermission).getGroup();

            // Test if group exists
            try {
                ObjectNode objectnode = structure.retrieve(this.slideToken,
                                                           subject);

                if ( !(objectnode instanceof GroupNode)) {
                    throw new SourceException("Group '"+
                                              ((GroupSourcePermission) sourcepermission).getGroup()+
View Full Code Here

    public SourcePermission[] getSourcePermissions() throws SourceException {
        try {

            NamespaceConfig config = this.nat.getNamespaceConfig();

            ObjectNode current = structure.retrieve(this.slideToken,
                                                    this.config.getFilesPath()+
                                                    this.path);

            security.checkCredentials(this.slideToken, current,
                                      config.getReadPermissionsAction());
View Full Code Here

    public XMLValue computeCurrentuserPrivilegeSet(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
        XMLValue xmlValue = new XMLValue();
       
        NamespaceConfig config = nsaToken.getNamespaceConfig();
        Structure structure = nsaToken.getStructureHelper();
        ObjectNode object =  structure.retrieve(sToken, revisionDescriptors.getUri());
       
        // check read-own-permissions permission
        Security security = nsaToken.getSecurityHelper();
        security.checkCredentials(sToken, object, config.getReadOwnPermissionsAction());
       
        try {
            String actionsPath = config.getActionsPath();
            Uri actionsPathUri = nsaToken.getUri(sToken, actionsPath);
            ObjectNode actionsPathNode = actionsPathUri.getStore().retrieveObject(actionsPathUri);
            Enumeration actions = actionsPathNode.enumerateChildren();
            while (actions.hasMoreElements()) {
                ActionNode aNode = ActionNode.getActionNode((String)actions.nextElement());
                if (security.hasPermission(sToken, object, aNode)) {
                    xmlValue.add(createPrivilege(aNode.getPath().lastSegment()));
                }
View Full Code Here

       
        XMLValue xmlValue = new XMLValue();
       
        NamespaceConfig config = nsaToken.getNamespaceConfig();
        Structure structure = nsaToken.getStructureHelper();
        ObjectNode objectNode =  structure.retrieve(sToken, revisionDescriptors.getUri());
       
        // check read-acl permission
        Security security = nsaToken.getSecurityHelper();
        security.checkCredentials(sToken, objectNode, config.getReadPermissionsAction());
       
View Full Code Here

        try {

            // Then we must get object contents ...

            ObjectNode object = structure.retrieve(slideToken, resourcePath);
            NodeRevisionDescriptors revisionDescriptors =
                content.retrieve(slideToken, resourcePath);

            if (revisionDescriptors.hasRevisions()) {
View Full Code Here

                    NodeRevisionDescriptors revisionDescriptors = content.retrieve(slideToken, requestUri);
                    NodeRevisionDescriptor revisionDescriptor = content.retrieve(slideToken, revisionDescriptors);
                    if (isLockNull(revisionDescriptor)) {
                        content.remove(slideToken, requestUri, revisionDescriptor);
                        content.remove(slideToken, revisionDescriptors);
                        ObjectNode node = structure.retrieve(slideToken, requestUri);
                        structure.remove(slideToken, node);
                    }
                }
               
            }
View Full Code Here

            Iterator i = xv.getList().iterator();
            while (i.hasNext()) {
                // iterate over parent elements
                Element pElm = (Element)i.next();
                String hrPath = pElm.getChild( E_HREF, DNSP ).getText();
                ObjectNode hrNode = structure.retrieve( stoken, hrPath );
                return isDescendant( hrNode, upperNode );
            }
        } catch (ServiceAccessException e) {
            throw e;
        } catch (Exception e) {}
View Full Code Here

        System.out.println("now execute: " + theExecutableCommand);

        //
        // fake one result
        //
        ObjectNode node = new SubjectNode("/"); // this will return the root folder
        RequestedResource resource = null;
        IBasicQuery query = factory.getQuery();

        try {
            resource = new ComparableResourceImpl
View Full Code Here

        SlideToken slideToken = new SlideTokenImpl(credToken);
       
        // Fetch the Slide object representing the user.
        try {
           
            ObjectNode user = securityHelper.getPrincipal(slideToken);
           
        } catch (SlideException e) {
            return null;
        }
       
View Full Code Here

TOP

Related Classes of org.apache.slide.structure.ObjectNode

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.