Package org.apache.slide.structure

Examples of org.apache.slide.structure.SubjectNode


     *
     * @throws   SlideException
     * @throws   IOException
     */
    public void execute(String resourcePath, Element multistatusElm, int depth) throws SlideException, IOException {
        SubjectNode currentUserNode = (SubjectNode)security.getPrincipal(slideToken);
        Element queryElm = getQueryElement(resourcePath, currentUserNode);
        new XMLOutputter("  ", true).output(queryElm, System.out);
       
        String absUri = WebdavUtils.getAbsolutePath (resourcePath, contextPath,
                                                     servletPath, config);
View Full Code Here


        }
       
        // Create VHR/VR
        UriHandler vhrUh = UriHandler.createNextHistoryUri( sToken, nsaToken, rUh );
        String vhrUri = String.valueOf( vhrUh );
        SubjectNode vhrNode = new SubjectNode();
        structure.create( sToken, vhrNode, String.valueOf(vhrUh) );
        content.create( sToken, vhrUri, true ); //isVersioned=true
        content.create( sToken, vhrUri, vrNrd, rNrc );
        NodeRevisionDescriptors vhrNrds =
            content.retrieve( sToken, vhrUri );
        content.create(
            sToken, vhrUri, null, vhrNrd, null ); //branch=null, revisionContent=null
       
        // Create VR node
        NodeRevisionNumber vrVersion = vrNrd.getRevisionNumber();
        SubjectNode vrNode = new SubjectNode();
        UriHandler vrUh =
            UriHandler.createVersionUri( vhrUh, String.valueOf(vrVersion) );
        String vrUri = String.valueOf( vrUh );
        structure.create( sToken, vrNode, String.valueOf(vrUh) );
       
View Full Code Here

                                             pHelp.createHrefValue(evUri)) );
        // set workspace
        setWorkspaceProperty( vcrUri, vcrNrd );
       
        // store
        SubjectNode vcrNode = new SubjectNode();
        structure.create( sToken, vcrNode, vcrUri );
        NodeRevisionContent evContent =
            content.retrieve( sToken, evNrds, evNrd );
        content.create( sToken, vcrUri, vcrNrd, evContent );
       
View Full Code Here

        }
        wsNrd.setCreationDate( new Date() ); // P_CREATIONDATE
        setCreationUser(wsNrd);
       
        // Create the ws resource
        SubjectNode wsNode = new SubjectNode();
        structure.create( sToken, wsNode, wsUri );
        content.create( sToken, wsUri, wsNrd, null ); // revisionContent = null
       
        // Set status created
        resp.setStatus( WebdavStatus.SC_CREATED );
View Full Code Here

            NodeRevisionDescriptors vhrNrds = content.retrieve(sToken, vhUri);
           
            // create the workingresource
            UriHandler wrUh = UriHandler.createNextWorkingresourceUri( sToken, nsaToken, rUh );
            String wrUri = String.valueOf( wrUh );
            SubjectNode wrNode = new SubjectNode();
            structure.create( sToken, wrNode, String.valueOf(wrUh) );
           
            // set WR props
            NodeRevisionDescriptor wrNrd = new NodeRevisionDescriptor();
            i = pHelp.createInitialProperties(WorkingImpl.getInstance()).iterator();
View Full Code Here

            }
           
            // create new VR node
            String vrUriNew = vhrUri+"/"+vrNrdNew.getRevisionNumber().toString();
            UriHandler vrUhNew = UriHandler.getUriHandler( vrUriNew );
            SubjectNode vrNodeNew = new SubjectNode();
            structure.create( sToken, vrNodeNew, vrUriNew );
           
            // set specific properties
            if( keepCheckedOut ) {
                rNrd.setProperty(
View Full Code Here

            SlideToken slideToken = new SlideTokenImpl(new CredentialsToken(""));
            slideToken.setForceStoreEnlistment(true);

            // First, we create the root node
            Uri rootUri = getUri(slideToken, "/");
            SubjectNode rootNode = new SubjectNode("/");
            try {
                rootUri.getStore().createObject(rootUri, rootNode);
            } catch (ObjectAlreadyExistsException e) {
                // abort the failed transaction
                getTransactionManager().rollback();
View Full Code Here

       
        // Prevent dirty reads
        slideToken.setForceStoreEnlistment(true);
       
       
        SubjectNode toLockSubject = null;
        boolean isCollection = isCollection(lockInfo_lockSubject);
        boolean inheritance = false;
        Date lockDate = null;
       
        switch (lockType) {
           
            case LOCK_CREATION:
               
                try {
                   
                    NamespaceConfig namespaceConfig = token.getNamespaceConfig();
                   
                    try {
                        toLockSubject = (SubjectNode) structure
                            .retrieve(slideToken, lockInfo_lockSubject);
                    } catch (ObjectNotFoundException ex) {
                       
                        // Creating a lock null resource
                        toLockSubject = new SubjectNode();
                       
                        // Creating new subject
                        structure.create(slideToken, toLockSubject,
                                         lockInfo_lockSubject);
                       
View Full Code Here

            } catch (LinkedObjectNotFoundException e) {
                int statusCode = getErrorCode( e );
                sendError( statusCode, e );
                throw new WebdavException( statusCode );
            } catch (ObjectNotFoundException e) {
                SubjectNode subject = new SubjectNode();
                // Creating an object
                structure.create(slideToken, subject, resourcePath);
               
                NodeRevisionDescriptor revisionDescriptor =
                    new NodeRevisionDescriptor(req.getContentLength());
View Full Code Here

     */
    public boolean checkLockToken(SlideToken slideToken, NodeLock token) {
        if (!slideToken.isEnforceLockTokens())
            return true;
       
        SubjectNode principalNode = null;
        SubjectNode ownerNode = SubjectNode.getSubjectNode(token.getSubjectUri());
        try {
            principalNode = (SubjectNode)securityHelper.getPrincipal(slideToken);
        }
        catch (SlideException e) {}
        if (Configuration.usePrincipalIdentifiedLocks() &&
            ownerNode != null &&
            ownerNode != SubjectNode.UNAUTHENTICATED &&
            ownerNode.equals(principalNode)) {
            return true;
        }
        else {
        return (slideToken.checkLockToken(token.getLockId()));
    }
View Full Code Here

TOP

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

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.