Package org.apache.slide.webdav.util.resourcekind

Examples of org.apache.slide.webdav.util.resourcekind.ResourceKind


                                                                       UriHandler resourceUrihandler,
                                                                       String existingVersionPath,
                                                                       NodeRevisionDescriptor existingVersionNrd,
                                                                       UriHandler existingVersionUrihandler) throws SlideException {
       
        ResourceKind rRk = AbstractResourceKind.determineResourceKind( nsaToken, resourcePath, resourceNrd );
        ResourceKind evRk = AbstractResourceKind.determineResourceKind( nsaToken, existingVersionPath, existingVersionNrd );
       
        if( !(rRk instanceof DeltavCompliantUnmappedUrl) ) {
            return new ViolatedPrecondition(C_CANNOT_ADD_TO_EXISTING_HISTORY, WebdavStatus.SC_CONFLICT);
        }
        if( !(evRk instanceof Version) || existingVersionNrd == null) {
View Full Code Here


            NodeRevisionDescriptors rNrds = content.retrieve( sToken, resourcePath );
            rNrd = content.retrieve( sToken, rNrds );
        }
        catch( ObjectNotFoundException e ) {}; // can be ignored here!
       
        ResourceKind rRk = AbstractResourceKind.determineResourceKind( nsaToken, resourcePath, rNrd );
       
        if( !(rRk instanceof DeltavCompliantUnmappedUrl) ) {
            throw new PreconditionViolationException(
                new ViolatedPrecondition(C_RESOURCE_MUST_BE_NULL, WebdavStatus.SC_CONFLICT), resourcePath);
        }
        if( !rUh.isWorkspaceUri() ) {
            throw new PreconditionViolationException(
                new ViolatedPrecondition(C_WORKSPACE_LOCATION_OK, WebdavStatus.SC_FORBIDDEN), resourcePath);
        }
        if( !rRk.isSupportedMethod(req.getMethod()) ) {
            throw new MethodNotAllowedException( rRk );
        }
       
        // Set initial ws properties
        String wsUri = String.valueOf(rUh);
View Full Code Here

                           NodeRevisionDescriptor rNrd, boolean forkOk, boolean applyToVersion, boolean isAutoVersionCheckout  )
        throws SlideException, JDOMException, IOException, PreconditionViolationException  {
       
        //Iterator i;
        String rUri = getUri( rNrds, rNrd );
        ResourceKind rRk = AbstractResourceKind.determineResourceKind( nsaToken, rNrds, rNrd );
       
        if( !rRk.isSupportedMethod(req.getMethod()) ) {
            // check precondition C_MUST_BE_CHECKED_IN
            if( rRk instanceof CheckedOut ) {
                throw new PreconditionViolationException(new ViolatedPrecondition(C_MUST_BE_CHECKED_IN, WebdavStatus.SC_CONFLICT), rNrds.getUri());
            }
            throw new MethodNotAllowedException( rRk );
View Full Code Here

        throws SlideException, JDOMException, IOException, PreconditionViolationException  {
       
        Iterator i;
        Enumeration j;
        String rUri = getUri( rNrds, rNrd );
        ResourceKind rRk = AbstractResourceKind.determineResourceKind( nsaToken, rNrds, rNrd );
       
        if( !rRk.isSupportedMethod(req.getMethod()) ) {
            // check precondition C_MUST_BE_CHECKED_IN
            if( rRk instanceof CheckedOut ) {
                throw new PreconditionViolationException(new ViolatedPrecondition(C_MUST_BE_CHECKED_IN, WebdavStatus.SC_CONFLICT), rNrds.getUri());
            }
            throw new MethodNotAllowedException( rRk );
View Full Code Here

    public void uncheckout( NodeRevisionDescriptors rNrds, NodeRevisionDescriptor rNrd)
        throws SlideException, JDOMException, IOException, PreconditionViolationException  {
       
        //Iterator i;
        String rUri = getUri( rNrds, rNrd );
        ResourceKind rRk = AbstractResourceKind.determineResourceKind( nsaToken, rNrds, rNrd );
       
        // check precondition C_MUST_BE_CHECKED_OUT_VERSION_CONTROLLED_RESOURCE
        if ( ! (rRk instanceof CheckedOutVersionControlled) ) {
            throw new PreconditionViolationException(new ViolatedPrecondition(C_MUST_BE_CHECKED_OUT_VERSION_CONTROLLED_RESOURCE,
                                                                              WebdavStatus.SC_CONFLICT),
                                                     rNrds.getUri());
        }
       
        if( !rRk.isSupportedMethod(req.getMethod()) ) {
            throw new MethodNotAllowedException( rRk );
        }
       
        // get checked-out VR
        NodeProperty coutProp = rNrd.getProperty( P_CHECKED_OUT );
View Full Code Here

        throws SlideException, JDOMException, IOException, PreconditionViolationException {
       
        Iterator i;
        Enumeration j;
        String rUri = getUri( rNrds, rNrd );
        ResourceKind rRk = AbstractResourceKind.determineResourceKind( nsaToken, rNrds, rNrd );
       
        if( !rRk.isSupportedMethod(req.getMethod()) ) {
            // check precondition C_MUST_BE_CHECKED_OUT
            if( (rRk instanceof CheckedInVersionControlled) ) {
                throw new PreconditionViolationException(
                    new ViolatedPrecondition(C_MUST_BE_CHECKED_OUT, WebdavStatus.SC_CONFLICT), rUri);
            }
View Full Code Here

       
        NodeRevisionDescriptors revisionDescriptors =
            content.retrieve( sToken, resourcePath );
        NodeRevisionDescriptor revisionDescriptor =
            content.retrieve( sToken, revisionDescriptors);
        ResourceKind resourceKind = AbstractResourceKind.determineResourceKind( nsaToken, resourcePath, revisionDescriptor);
       
        if ( (resourceKind instanceof VersionControlled) && (label != null) ) {
            String vrUri = getUriOfAssociatedVR(nsaToken, sToken, content, revisionDescriptors.getUri());
            UriHandler vrUriHandler = UriHandler.getUriHandler(vrUri);
            String historyUri = vrUriHandler.getAssociatedHistoryUri();
View Full Code Here

           
            if (revisionDescriptor == null) {
                revisionDescriptor = new NodeRevisionDescriptor(0);
            }
           
            ResourceKind resourceKind = AbstractResourceKind.determineResourceKind(token, resourcePath, revisionDescriptor);
           
            // check preconditions
            ViolatedPrecondition violatedPrecondition = getPreconditionViolation(revisionDescriptors, revisionDescriptor, resourceKind);
            if (violatedPrecondition != null) {
                throw new PreconditionViolationException(violatedPrecondition, resourcePath);
View Full Code Here

        Structure structure = token.getStructureHelper();
        NodeRevisionDescriptors revisionDescriptors =
            content.retrieve(slideToken, uri);
        NodeRevisionDescriptor revisionDescriptor =
            content.retrieve(slideToken, revisionDescriptors);
        ResourceKind resourceKind = AbstractResourceKind.determineResourceKind(token, uri, revisionDescriptor);
        if( Configuration.useVersionControl() &&
               (resourceKind instanceof CheckedOutVersionControlled) ) {
            NodeProperty checkinLocktokenProperty =
                revisionDescriptor.getProperty(DeltavConstants.I_CHECKIN_LOCKTOKEN,
                                               NodeProperty.NamespaceCache.SLIDE_URI);
View Full Code Here

           
            // if resource being removed is a checked-out VCR or a WR,
            // remove its URI in the DAV:checkout-set property of the VR
            NodeRevisionDescriptors nrds = content.retrieve(slideToken, targetUri);
            NodeRevisionDescriptor nrd = content.retrieve(slideToken, nrds);
            ResourceKind rk = AbstractResourceKind.determineResourceKind(token, nrds, nrd);
            if(rk instanceof CheckedOutVersionControlled || rk instanceof Working) {
                String vrUri =
                    VersioningHelper.getUriOfAssociatedVR(token, slideToken, content, targetUri);
                try {
                    NodeRevisionDescriptors vrNrds = content.retrieve(slideToken, vrUri);
View Full Code Here

TOP

Related Classes of org.apache.slide.webdav.util.resourcekind.ResourceKind

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.