Package org.apache.slide.content

Examples of org.apache.slide.content.NodeProperty


        NodeRevisionDescriptor lowerNrd = null;
        try {
            lowerNrds = content.retrieve(stoken, lowerNode.getUri());
            lowerNrd = content.retrieve(stoken, lowerNrds);

            NodeProperty psProp = lowerNrd.getProperty(P_PARENT_SET);
            XMLValue xv = new XMLValue( String.valueOf(psProp.getValue()) );
            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();
View Full Code Here


                String propName = (String)i.next();
                if( AbstractResourceKind.isComputedProperty(propName) )
                    continue;
                Object pvalue = createDefaultValue( propName, resourceKind );
                if (pvalue != null) {
                    result.add( new NodeProperty(propName, pvalue) );
                }
            }
        }
        return result;
    }
View Full Code Here

     * @throws   SlideException
     * @throws   JDOMException
     */
    public NodeProperty getProperty(String propertyName, NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws SlideException, JDOMException {
       
        NodeProperty property = revisionDescriptor.getProperty( propertyName );
        ResourceKind resourceKind = AbstractResourceKind.determineResourceKind(nsaToken, revisionDescriptors, revisionDescriptor);
        if (resourceKind.isSupportedLiveProperty(propertyName)) {
            if (AbstractResourceKind.isComputedProperty(propertyName)) {
                property = computeProperty(propertyName, revisionDescriptors, revisionDescriptor, contextPath, servletPath);
            }
View Full Code Here

     * @throws   SlideException
     * @throws   JDOMException
     */
    public NodeProperty computeProperty(String propertyName, NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws SlideException, JDOMException {
       
        NodeProperty property = null;
        if (P_SUCCESSOR_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeSuccessorSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_VERSION_HISTORY.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeVersionHistory(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_ROOT_VERSION.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeRootVersion(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_SUPPORTED_METHOD_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeSupportedMethodSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_SUPPORTED_LIVE_PROPERTY_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeSupportedLivePropertySet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_SUPPORTED_REPORT_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeSupportedReportSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_CHECKOUT_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeCheckoutSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_WORKSPACE_CHECKOUT_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeWorkspaceCheckoutSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_WORKSPACE.equals(propertyName)) {
            XMLValue ws = null;
            if (Configuration.useBinding(nsaToken.getUri(sToken, revisionDescriptors.getUri()).getStore())) {
                ws = computeWorkspace(revisionDescriptors, revisionDescriptor, contextPath, servletPath);
            }
            else {
                ws = computeWorkspaceNoBinding(revisionDescriptors, revisionDescriptor, contextPath, servletPath);
            }
            if (ws != null) {
                property = new NodeProperty(propertyName, ws);
            }
        }
           
        else if (P_LOCKDISCOVERY.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeLockDiscovery(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_SUPPORTEDLOCK.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeSupportedlock(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_SUPPORTED_PRIVILEGE_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeSupportedPrivilegeSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_CURRENT_USER_PRIVILEGE_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeCurrentuserPrivilegeSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_ACL.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeAcl(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_PRINCIPAL_COLLECTION_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computePrincipalCollectionSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_PRIVILEGE_COLLECTION_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computePrivilegeCollectionSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_OWNER.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeOwner(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_CREATIONUSER.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeCreationUser(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_MODIFICATIONUSER.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeModificationUser(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_INHERITED_ACL_SET.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeInheritedAclSet(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_ACL_RESTRICTIONS.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeAclRestrictions(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
        else if (P_GROUP_MEMBERSHIP.equals(propertyName)) {
            property = new NodeProperty(propertyName, computeGroupMembership(revisionDescriptors, revisionDescriptor, contextPath, servletPath));
        }
       
        return property;
    }
View Full Code Here

            hrElm.setText(rUh.getAssociatedWorkspaceUri());
            result.add(hrElm);
            return result;
        }
       
        NodeProperty psProp = revisionDescriptor.getProperty(P_PARENT_SET);
        if (psProp == null) {
            return new XMLValue();
        }
       
        List psUris = new ArrayList();
        XMLValue xv = new XMLValue(String.valueOf(psProp.getValue()));
        Iterator i = xv.getList().iterator();
        while (i.hasNext()) {
            Element pElm = (Element)i.next();
            UriHandler hrUh = new UriHandler(pElm.getChild(E_HREF, DNSP).getText());
            if (hrUh.getAssociatedWorkspaceUri() != null) {
View Full Code Here

     * @throws   ObjectNotFoundException
     * @throws   JDOMException
     */
    public XMLValue computeOwner(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
       
        NodeProperty ownerProperty = revisionDescriptor.getProperty(P_OWNER,
                                                                    NodeProperty.DEFAULT_NAMESPACE);
       
  // FIXME wihtout servletPath??
        XMLValue xmlValue = createUserPath(ownerProperty, contextPath);
       
View Full Code Here

        return xmlValue;
    }
   
    public XMLValue computeCreationUser(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
       
        NodeProperty creationUserProperty = revisionDescriptor.getProperty(P_CREATIONUSER,
                                                                           NodeProperty.DEFAULT_NAMESPACE);
  // FIXME wihtout servletPath??
        XMLValue xmlValue = createUserPath(creationUserProperty, contextPath);
       
        return xmlValue;
View Full Code Here

        return xmlValue;
    }
   
    public XMLValue computeModificationUser(NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, String contextPath, String servletPath) throws ObjectLockedException, RevisionDescriptorNotFoundException, ServiceAccessException, LinkedObjectNotFoundException, AccessDeniedException, ObjectNotFoundException, LockTokenNotFoundException, JDOMException {
       
        NodeProperty modificationUserProperty = revisionDescriptor.getProperty(P_MODIFICATIONUSER,
                                                                               NodeProperty.DEFAULT_NAMESPACE);
       
  // FIXME wihtout servletPath??
        XMLValue xmlValue = createUserPath(modificationUserProperty, contextPath);
       
View Full Code Here

     * @throws   JDOMException
     *
     */
    public static boolean addElementToProperty(NodeRevisionDescriptor revisionDescriptor, String propertyName, String elementName, String elementValue) throws JDOMException {
       
        NodeProperty property = revisionDescriptor.getProperty(propertyName);
        if (property == null) {
            property = new NodeProperty(propertyName, null);
        }
        XMLValue xmlValue = new XMLValue((String)property.getValue());
        Iterator iterator = xmlValue.iterator();
        boolean alreadyContained = false;
        Element element = null;
        while (iterator.hasNext() && !alreadyContained) {
            element = (Element)iterator.next();
View Full Code Here

     * @throws   JDOMException
     *
     */
    public static boolean removeElementFromProperty(NodeRevisionDescriptor revisionDescriptor, String propertyName, String elementName, String elementValue) throws JDOMException {
       
        NodeProperty property = revisionDescriptor.getProperty(propertyName);
        boolean found = false;
        if (property != null) {
           
            XMLValue xmlValue = new XMLValue((String)property.getValue());
            Iterator iterator = xmlValue.iterator();
            Element element = null;
            while (iterator.hasNext() && !found) {
                element = (Element)iterator.next();
                if (element.getName().equals(elementName) && element.getText().equals(elementValue)) {
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.