Package org.apache.slide.content

Examples of org.apache.slide.content.NodeProperty


            Iterator queryResultIterator = queryResult.iterator();
            RequestedResource requestedResource = null;
            NodeRevisionDescriptors workingResourceRevisionDescriptors = null;
            NodeRevisionDescriptor workingResourceRevisionDescriptor = null;
            NodeProperty autoUpdateProperty = null;
            String workingResourceUri = null;

            while (queryResultIterator.hasNext()) {

                requestedResource = (RequestedResource)queryResultIterator.next();
                workingResourceUri = requestedResource.getUri();
                workingResourceRevisionDescriptors =
                    content.retrieve( slideToken, workingResourceUri);
                workingResourceRevisionDescriptor =
                    content.retrieve( slideToken, workingResourceRevisionDescriptors);
                autoUpdateProperty = new NodeProperty(P_AUTO_UPDATE,
                                                      propertyHelper.createHrefValue(destinationUri));
                workingResourceRevisionDescriptor.setProperty(autoUpdateProperty);
                content.store(slideToken,
                              workingResourceRevisionDescriptors.getUri(),
                              workingResourceRevisionDescriptor,
View Full Code Here


        if( Configuration.useVersionControl() ) {

            if (isRequestSourceWorkspace) {
                // DAV:workspace-moved
                revisionDescriptor.setProperty(
                    new NodeProperty( P_WORKSPACE, propertyHelper.createHrefValue(this.destinationUri)) );
            }
            else {
                // DAV:workspace-member-moved
                versioningHelper.setWorkspaceProperty(resourceUri, revisionDescriptor);
            }
View Full Code Here

                                       (WebdavStatus.SC_OK));
       
        while (propertyIterator.hasNext()) {
           
            RequestedProperty property = (RequestedProperty)propertyIterator.next();
            NodeProperty currentProperty = null;
            Integer errorCode = null;
            try {
                currentProperty = requestedResource.getProperty(property.getName(),
                                                                property.getNamespace());
                if (currentProperty == null) {
View Full Code Here

                   ) {
                    // skip properties from specification extensions
                    continue;
                }
               
                NodeProperty currentProperty = null;
                Integer errorCode = null;
                try {
                    currentProperty = requestedResource.getProperty(currentPropertyName);
                    if (currentProperty == null) {
                        errorCode = new Integer(WebdavStatus.SC_NOT_FOUND);
View Full Code Here

       
        if (!liveOnly) {
            // add this resource's dead properties
            Enumeration props = nrd.enumerateProperties();
            while (props.hasMoreElements()) {
                NodeProperty np = (NodeProperty)props.nextElement();
                if (!result.contains(np)) {
                    result.addProperty(new RequestedPropertyImpl(np.getName(), np.getNamespace()));
                }
            }
        }
        return result;
    }
View Full Code Here

            // Check if resource must be checked in due to auto-versioning
            // semantics.
            ResourceKind resourceKind = AbstractResourceKind.determineResourceKind(token, requestUri, revisionDescriptor);
            if( Configuration.useVersionControl() &&
                   (resourceKind instanceof CheckedOutVersionControlled) ) {
                NodeProperty checkinLocktokenProperty =
                    revisionDescriptor.getProperty(DeltavConstants.I_CHECKIN_LOCKTOKEN,
                                                   NamespaceCache.SLIDE_URI);
                if (checkinLocktokenProperty == null) {
                    // retry with default (DAV:) namespace which was the
                    // former namespace of this property
                    checkinLocktokenProperty =
                        revisionDescriptor.getProperty(DeltavConstants.I_CHECKIN_LOCKTOKEN);
                }
                if ( (checkinLocktokenProperty != null) && (checkinLocktokenProperty.getValue() != null) &&
                    lockId.equals(checkinLocktokenProperty.getValue().toString()) ) {
                    VersioningHelper versionHelper = VersioningHelper.getVersioningHelper(slideToken, token, req, resp, config);
                    versionHelper.checkin(revisionDescriptors, revisionDescriptor, false, false, true);
                }
            }
           
View Full Code Here

            vrNrd.setProperty( (NodeProperty)i.next() );
       
        // Copy dead properties VCR -> VR
        j = rNrd.enumerateProperties();
        while( j.hasMoreElements() ) {
            NodeProperty p = (NodeProperty)j.nextElement();
            if( p.isLiveProperty() )
                continue;
            if( !vrNrd.exists(p.getName()) )
                vrNrd.setProperty( p );
        }
       
        // Copy properties VCR->VR
        NodeRevisionContent rNrc = content.retrieve( sToken, rNrds, rNrd );
        vrNrd.setContentType(rNrd.getContentType()); // P_GETCONTENTTYPE
        vrNrd.setContentLength(rNrd.getContentLength()); // P_GETCONTENTLENGTH
        vrNrd.setContentLanguage(rNrd.getContentLanguage()); // P_GETCONTENTLANGUAGE
        String comment = "INITIAL VERSION. ";
        if( rNrd.exists(P_COMMENT) )
            comment += (String)rNrd.getProperty(P_COMMENT).getValue();
        vrNrd.setProperty(
            new NodeProperty(P_COMMENT, comment) );
       
        // Set initial VHR properties
        Vector vhrLabels = new Vector();
        Hashtable vhrProps = new Hashtable();
        String vhrBranch = NodeRevisionDescriptors.MAIN_BRANCH;
        NodeRevisionDescriptor vhrNrd =
            new NodeRevisionDescriptor( NodeRevisionNumber.HIDDEN_0_0, vhrBranch, vhrLabels, vhrProps );
        i = pHelp.createInitialProperties(VersionHistoryImpl.getInstance()).iterator();
        while( i.hasNext() )
            vhrNrd.setProperty( (NodeProperty)i.next() );
       
        // Set initial VCR properties (do not overwrite existing!!)
        i = pHelp.createInitialProperties(VersionControlledImpl.getInstance()).iterator();
        while( i.hasNext() ) {
            NodeProperty p = (NodeProperty)i.next();
            if( !rNrd.exists(p.getName()) )
                rNrd.setProperty( p );
        }
       
        // 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) );
       
        // Set specific properties
        vrNrd.setName(rUh.getName()); // P_DISPLAYNAME
        rNrd.setProperty(
            new NodeProperty(P_CHECKED_IN, pHelp.createHrefValue(vrUri)) );
        vhrNrd.setCreationDate( new Date() ); // P_CREATIONDATE
        setCreationUser(vhrNrd);
        vhrNrd.setLastModified( new Date() ); // P_GETLASTMODIFIED
        vhrNrd.setContentLength( 0 ); // P_GETCONTENTLENGTH
        vhrNrd.setETag( PropertyHelper.computeEtag(vhrUri, vhrNrd) ); // P_GETETAG
        vhrNrd.setName( vhrUh.getHistoryName() ); // P_DISPLAYNAME
        vhrNrd.setProperty(
            new NodeProperty(P_VERSION_SET, pHelp.createHrefValue(vrUri)) );
        vrNrd.setCreationDate( new Date() ); // P_CREATIONDATE
        setCreationUser(vrNrd);
        vrNrd.setLastModified( new Date() ); // P_GETLASTMODIFIED
        vrNrd.setETag( PropertyHelper.computeEtag(vrUri, vrNrd)); // P_GETETAG
        vrNrd.setProperty(
            new NodeProperty(P_VERSION_NAME, vrUh.getVersionName()) );
       
        // Store changes
        content.store( sToken, resourcePath, rNrd, null ); //revisionContent=null
        content.store( sToken, vhrUri, vhrNrd, null ); //revisionContent=null
        content.store( sToken, vhrUri, vrNrd, null ); //revisionContent=null
View Full Code Here

        if (!Configuration.useBinding(nsaToken.getUri(sToken, vcrUri).getStore())) {
            vcrNrd.setName( utok[utok.length - 1] ); // P_DISPLAYNAME
        }
        vcrNrd.setCreationDate( new Date() ); // P_CREATIONDATE
        setCreationUser(vcrNrd);
        vcrNrd.setProperty( new NodeProperty(P_CHECKED_IN,
                                             pHelp.createHrefValue(evUri)) );
        // set workspace
        setWorkspaceProperty( vcrUri, vcrNrd );
       
        // store
View Full Code Here

    public void setWorkspaceProperty( String rUri, NodeRevisionDescriptor rNrd ) {
        UriHandler rUh = UriHandler.getUriHandler( rUri );
        String wsUri = rUh.getAssociatedWorkspaceUri();
        if( wsUri != null ) {
            rNrd.setProperty(
                new NodeProperty(P_WORKSPACE, pHelp.createHrefValue(wsUri)) );
        }
        else {
            rNrd.removeProperty(P_WORKSPACE);
        }
    }
View Full Code Here

        while( i.hasNext() )
            wsNrd.setProperty( (NodeProperty)i.next() );
       
        // Set specific properties
        wsNrd.setProperty(
            new NodeProperty(P_WORKSPACE, pHelp.createHrefValue(wsUri)) );
        wsNrd.setLastModified( new Date() ); //P_GETLASTMODIFIED
        wsNrd.setContentLength( 0 ); // P_GETCONTENTLENGTH
        wsNrd.setETag( PropertyHelper.computeEtag(wsUri, wsNrd) ); // P_GETETAG
        if (!Configuration.useBinding(nsaToken.getUri(sToken, wsUri).getStore())) {
            wsNrd.setName( rUh.getWorkspaceName() ); // P_DISPLAYNAME
View Full Code Here

TOP

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

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.