Package org.apache.slide.content

Examples of org.apache.slide.content.NodeProperty$Kind


     *             of the given <code>revisionDescriptor</code>.
     */
    public String getAutoVersionElementName(NodeRevisionDescriptor revisionDescriptor) {
       
        String autoVersionValue = null;
        NodeProperty autoVersionProperty = revisionDescriptor.getProperty(DeltavConstants.P_AUTO_VERSION);
        if ( (autoVersionProperty != null) && (autoVersionProperty.getValue() != null) ) {
            if (autoVersionProperty.getValue().toString().length() > 0) {
                autoVersionValue = getElementName(autoVersionProperty.getValue().toString());
            }
            else {
                autoVersionValue = "";
            }
        }
View Full Code Here


        UriHandler historyUriHandler = UriHandler.getUriHandler(historyUri);
        if (historyUriHandler.isHistoryUri()) {
            NodeRevisionDescriptors historyNrds = content.retrieve(sToken, historyUri);
            NodeRevisionDescriptor historyNrd =
                content.retrieve(sToken, historyNrds, NodeRevisionNumber.HIDDEN_0_0);
            NodeProperty versionSet = historyNrd.getProperty(P_VERSION_SET);
            try {
                XMLValue versionSetValue = new XMLValue(versionSet.getValue().toString());
                NodeRevisionDescriptor vrNrd = null;
                NodeProperty labelNameSetProperty = null;
                String labelNameSetString = null;
                Iterator versionSetIterator = versionSetValue.iterator();
                String vrUri = null;
                UriHandler vrUriHandler = null;
                boolean found = false;
                while ( !found && versionSetIterator.hasNext() ) {
                    vrUri = ((Element)versionSetIterator.next()).getText();
                    vrUriHandler = UriHandler.getUriHandler(vrUri);
                    NodeRevisionNumber vrRevisionNumber = new NodeRevisionNumber(vrUriHandler.getVersionName());
                    vrNrd = content.retrieve(sToken, historyNrds, vrRevisionNumber);
                    labelNameSetProperty = vrNrd.getProperty(P_LABEL_NAME_SET);
                    if ( (labelNameSetProperty != null) && (labelNameSetProperty.getValue() != null) ) {
                        labelNameSetString = labelNameSetProperty.getValue().toString();
                        if (labelNameSetString != null) {
                            XMLValue labelNameSet = new XMLValue(labelNameSetString);
                            Iterator labelNameSetIterator = labelNameSet.iterator();
                            while ( !found && labelNameSetIterator.hasNext() ) {
                                found = label.equals(((Element)labelNameSetIterator.next()).getText());
View Full Code Here

       
        NodeRevisionDescriptors revisionDescriptors = content.retrieve(sToken, resourceUri);
        if (!revisionDescriptors.isVersioned()) {
            NodeRevisionDescriptor revisionDescriptor =
                content.retrieve( sToken, revisionDescriptors);
            NodeProperty property = revisionDescriptor.getProperty(P_CHECKED_OUT);
            if ( (property == null) || (property.getValue() == null) ) {
                property = revisionDescriptor.getProperty(P_CHECKED_IN);
            }
            if ( (property != null) && (property.getValue() != null) ) {
               
                try {
                    XMLValue xmlValue = new XMLValue(property.getValue().toString());
                    Iterator iterator = xmlValue.iterator();
                    if (iterator.hasNext()) {
                        Element element = (Element)iterator.next();
                        vrUri = element.getText();
                    }
View Full Code Here

    }
   
    private void writeReport(NodeRevisionDescriptors nrds, SlideToken slideToken, Element multistatusElm) throws SlideException {
        // this is a versioned resource
        NodeRevisionDescriptor hNrd = content.retrieve(slideToken, nrds, NodeRevisionNumber.HIDDEN_0_0);
        NodeProperty versionSetProperty = hNrd.getProperty(P_VERSION_SET);
        if ( (versionSetProperty != null) && (versionSetProperty.getValue() != null) ) {
            XMLValue xmlValue;
            try {
                xmlValue =  new XMLValue(versionSetProperty.getValue().toString());
            }
            catch (JDOMException e) {
                throw new SlideException("Could not parse DAV:version-set: "+nrds.getUri());
            }
            Iterator hrefIterator = xmlValue.iterator();
View Full Code Here

              res = statement.executeQuery();
           
              while (res.next()) {
                  String propertyName = res.getString(PROPERTY_NAME);
                  String propertyNamespace = res.getString(PROPERTY_NAMESPACE);
                  NodeProperty property =
                      new NodeProperty(propertyName,
                                       res.getString(PROPERTY_VALUE),
                                       propertyNamespace,
                                       res.getString(PROPERTY_TYPE),
                                       (res.getInt(PROPERTY_PROTECTED) == 1));
                  properties.put(propertyNamespace + propertyName, property);
View Full Code Here

              // Creating associated properties
              statement = null;
              Enumeration properties = revisionDescriptor.enumerateProperties();
              while (properties.hasMoreElements()) {
                  NodeProperty property =
                      (NodeProperty) properties.nextElement();
                  int protectedProperty = 0;
                  if (property.isProtected()) {
                      protectedProperty = 1;
                  }
                  if (statement == null){
                      statement = connection.prepareStatement
                          ("insert into property values(?,?,?,?,?,?,?)");
                  }
                  statement.setString(1, uri.toString());
                  statement.setString
                      (2, revisionDescriptor.getRevisionNumber().toString());
                  statement.setString(3, property.getName());
                  statement.setString(4, property.getValue().toString());
                  statement.setString(5, property.getNamespace());
                  statement.setString(6, property.getType());
                  statement.setInt(7, protectedProperty);
                  statement.execute();
              }
              closeStatement(statement);
           
View Full Code Here

    public Object getThisValue (String propName, String propNamespace) {
        Object result = null;
        // special handling for properties as contenlength, contenttype, ...
       
        // all other properties...
        NodeProperty property = null;
        try {
            property = getProperty(propName, propNamespace);
        }
        catch (SlideException e) {
            Domain.error("ComparableResourceImpl.getThisValue()", e);
        }
        result = (property == null) ? null : property.getValue();
       
        return result;
    }
View Full Code Here

     * @param      propName       the name of the property.
     *
     * @return     the requested NodeProperty.
     */
    protected NodeProperty getProperty(String propName) {
        NodeProperty property = null;
        try {
            property = getProperty(propName, NamespaceCache.DEFAULT_URI);
        }
        catch (SlideException e) {
            Domain.error("ComparableResourceImpl.getProperty()", e);
View Full Code Here

     *
     * @throws     SlideException
     */
    public NodeProperty getProperty(String name, String namespace) throws SlideException {
       
        NodeProperty property = null;
        if ( (propertyProvider != null) && propertyProvider.isSupportedProperty(getUri(), name, namespace) ) {
            property = propertyProvider.getProperty(getUri(), name, namespace);
        }
        else {
            property = revisionDescriptor.getProperty (name, namespace);
View Full Code Here

        boolean result = false;
       
        if (revisionDescriptor == null)
            return true;
       
        NodeProperty property = revisionDescriptor.getProperty("resourcetype");
       
        if ((property != null)
            && (property.getValue().equals("<collection/>"))) {
            result = true;
        }
       
        return result;
    }
View Full Code Here

TOP

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

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.