Package org.apache.slide.content

Examples of org.apache.slide.content.NodeRevisionDescriptors


     * @throws     SlideException
     * @throws     JDOMException  if creating the JDOM Element fails.
     */
    public List getPropertiesOfObject(RequestedProperties requestedProperties, String uri, NodeRevisionNumber revisionNumber, String servletContextPath, boolean extendedAllprop) throws SlideException, JDOMException {
       
        NodeRevisionDescriptors revisionDescriptors = content.retrieve(sToken, uri);
        NodeRevisionDescriptor revisionDescriptor = content.retrieve(sToken,
                                                                     revisionDescriptors,
                                                                     revisionNumber);
        return getPropertiesOfObject(requestedProperties, revisionDescriptors, revisionDescriptor, servletContextPath, extendedAllprop);
    }
View Full Code Here


            if (aNode.hasChildren()) {
                result = findAction(aNode.getChildren().iterator(), privilegeName, privilegeNamespace);
            }
            else {
                Uri aUri = token.getUri(slideToken, aUriAsString);
                NodeRevisionDescriptors nrds = aUri.getStore().retrieveRevisionDescriptors(aUri);
                NodeRevisionDescriptor latestNrd = aUri.getStore().retrieveRevisionDescriptor(aUri, nrds.getLatestRevision());
                NodeProperty aNamespaceAsNode = latestNrd.getProperty(AclConstants.P_PRIVILEGE_NAMESPACE, WebdavConstants.S_DAV);
                String aNamespace = aNamespaceAsNode == null ? null : aNamespaceAsNode.getValue().toString();
                String aUriLastSegment = aUriAsString.substring(aUriAsString.lastIndexOf('/') + 1);
                if (aUriLastSegment.equals(privilegeName)
                        && ((aNamespace != null && privilegeNamespace.equals(aNamespace))
View Full Code Here

            } else {
                return new UriHandler(uniqueUri);
            }
        } else {

            NodeRevisionDescriptors hpathNrds = content.retrieve(sToken, hpath);
            NodeRevisionDescriptor hpathNrd = content.retrieve(sToken, hpathNrds);
            NodeProperty nextHnProp = hpathNrd.getProperty(I_NEXT_HISTORY_NAME, NamespaceCache.SLIDE_URI);

            if (UriHandler.useHistoryCollectionHack) {
View Full Code Here

        String uniqueUri = structure.generateUniqueUri(sToken, wrpath);

        if (uniqueUri != null) {
            result = new UriHandler(uniqueUri);
        } else {
            NodeRevisionDescriptors wrpathNrds =
                content.retrieve( sToken, wrpath );
           
            NodeRevisionDescriptor wrpathNrd =
                content.retrieve( sToken, wrpathNrds );
           
View Full Code Here

    public void versionControl( String resourcePath ) throws SlideException {
        UriHandler rUh = UriHandler.getUriHandler( resourcePath );
        Iterator i;
        Enumeration j;
       
        NodeRevisionDescriptors rNrds = content.retrieve( sToken, resourcePath );
        NodeRevisionDescriptor rNrd = content.retrieve( sToken, rNrds );
        ResourceKind rRk = AbstractResourceKind.determineResourceKind( nsaToken, resourcePath, rNrd );
        if( !rRk.isSupportedMethod(req.getMethod()) ) {
            throw new MethodNotAllowedException( rRk );
        }
View Full Code Here

        if ( ! evUh.isVersionUri() ) {
            throw new PreconditionViolationException(
                new ViolatedPrecondition(C_MUST_BE_VERSION, WebdavStatus.SC_CONFLICT), resourcePath);
        }
        //NodeRevisionNumber evNrn = new NodeRevisionNumber( evUh.getVersionName() );
        NodeRevisionDescriptors rNrds = null;
        NodeRevisionDescriptor rNrd = null;
        //NodeRevisionDescriptors vcrNrds = null;
        NodeRevisionDescriptor vcrNrd = null;
        NodeRevisionDescriptors evNrds = null;
        NodeRevisionDescriptor evNrd = null;
       
        try {
            rNrds = content.retrieve( sToken, resourcePath );
            rNrd = content.retrieve( sToken, rNrds );
View Full Code Here

    Vector branches = new Vector();
    branches.add( rev );
    Hashtable branchNames = new Hashtable();
    branchNames.put( "main", branches );
     
    return new NodeRevisionDescriptors(
      uri.toString(),
      rev,
      workingRevisions,
      latestRevisionNumbers,
      branchNames,
View Full Code Here

        Iterator i;
       
        UriHandler rUh = UriHandler.getUriHandler( resourcePath );
        NodeRevisionDescriptor rNrd = null;
        try {
            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 );
View Full Code Here

     */
    public String checkout( String resourcePath, boolean forkOk, boolean applyToVersion, boolean isAutoVersionCheckout )
        throws SlideException, JDOMException, IOException, PreconditionViolationException  {
       
        UriHandler rUh = UriHandler.getUriHandler( resourcePath );
        NodeRevisionDescriptors rNrds = content.retrieve( sToken, resourcePath );
        NodeRevisionDescriptor rNrd = content.retrieve( sToken, rNrds );
       
        if( rUh.isVersionUri() ) {
            NodeRevisionContent rNrc = content.retrieve( sToken, rNrds, rNrd );
            return checkout( rNrds, rNrd, rNrc, forkOk, null ); // autoUpdateUri=null
View Full Code Here

            NodeProperty cinProp = rNrd.getProperty( P_CHECKED_IN );
            String cinHref = getElementValue((String)cinProp.getValue());
            UriHandler cinUriHandler = UriHandler.getUriHandler(cinHref);
            String cinhUri = cinUriHandler.getAssociatedHistoryUri();
            NodeRevisionNumber cinNrn = new NodeRevisionNumber(cinUriHandler.getVersionName());
            NodeRevisionDescriptors cinNrds = content.retrieve(sToken, cinhUri);
            NodeRevisionDescriptor cinNrd = content.retrieve(sToken, cinNrds, cinNrn);
           
            // working resource feature
            if( applyToVersion ) {
                NodeRevisionContent cinNrc = content.retrieve( sToken, cinNrds, cinNrd );
                return checkout( cinNrds, cinNrd, cinNrc, forkOk, rUri ); // autoUpdateUri=rUri
            }
           
            ViolatedPrecondition violatedPrecondition = getCheckoutPreconditionViolation(cinNrds, cinNrd, forkOk);
            if (violatedPrecondition != null) {
                throw new PreconditionViolationException(violatedPrecondition, rNrds.getUri());
            }
           
            //NodeRevisionDescriptors vhrNrds = content.retrieve(sToken, cinhUri);
           
            // do the checkout
            backupSpecificLiveProperties(rNrds, rNrd);
            rNrd.removeProperty( cinProp );
            rNrd.setProperty(
                new NodeProperty(P_CHECKED_OUT, cinProp.getValue()) );
            rNrd.setProperty(
                new NodeProperty(P_PREDECESSOR_SET, cinProp.getValue()) );
            NodeProperty property = cinNrd.getProperty(P_CHECKOUT_FORK);
            if (property != null) {
                rNrd.setProperty(property);
            }
            property = cinNrd.getProperty(P_CHECKIN_FORK);
            if (property != null) {
                rNrd.setProperty(property);
            }
           
            if (isAutoVersionCheckout &&
                !(E_CHECKOUT_IGNORE_UNLOCK.equals(getAutoVersionElementName(rNrd)))) {
                NodeLock writeLock = getWriteLock(sToken, rNrds);
                if (writeLock != null) {
                    NodeProperty p =
                        new NodeProperty(I_CHECKIN_LOCKTOKEN,
                                         writeLock.getLockId(),
                                         NamespaceCache.SLIDE_URI);
                    p.setKind( NodeProperty.Kind.PROTECTED );
                    rNrd.setProperty( p );
                }
            }
           
            // update checked-in VR's DAV:checkout-set property
            PropertyHelper.addHrefToProperty(cinNrd, P_CHECKOUT_SET, rUri);
           
            // Store changes
            content.store( sToken, rNrds.getUri(), rNrd, null ); //revisionContent=null
            content.store( sToken, cinNrds.getUri(), cinNrd, null );
            return null;
        }
        else {
            Domain.warn(
                "Do not know how to checkout a '"+rRk+"' resource" );
View Full Code Here

TOP

Related Classes of org.apache.slide.content.NodeRevisionDescriptors

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.