com.sapportals.wcm.protocol.webdav.repository

Class WDProperties

java.lang.Object
  extended by com.sapportals.wcm.protocol.webdav.repository.WDProperties

public class WDProperties
extends Object

Helper functions for WebDAV repository interaction regarding property objects.

Attributes on the property element are persisted by mapping from/to repository property attributes. As the XML format used in WebDAV allows namespaced property names, while the repository only allows simple names, the following mapping is used:

name=valueas is
xml:localName=valueas is
xmlns:prefix=valueas is
prefix:localName=value {namespaceUri}localName=value and
xmlns:prefix=namespaceUri

Copyright (c) SAP AG 2001-2005


Constructor Summary
WDProperties()
           
 
Method Summary
static void appendProperty(Element parent, IPropertyName pname, IProperty prop, com.sapportals.wcm.util.http.DateFormat df, com.sapportals.wcm.util.uri.IHierarchicalUri baseUri)
           
static void appendProperty(Element parent, IPropertyName pname, IProperty prop, com.sapportals.wcm.util.http.DateFormat df, com.sapportals.wcm.util.uri.IHierarchicalUri baseUri, boolean includeHiddenFlag)
          Add a Property definition as child of an element.
static void appendPropertyValue(Element parent, IProperty prop, com.sapportals.wcm.util.http.DateFormat df, boolean includeHiddenFlag)
           
static void appendPropertyValue(Element parent, IProperty prop, com.sapportals.wcm.util.http.DateFormat df, com.sapportals.wcm.util.uri.IHierarchicalUri baseUri, boolean includeHiddenFlag)
          Add a Property Value as child of an element.
static IMutableProperty getProperty(IPropertyName pname, Element e, com.sapportals.wcm.util.http.DateFormat df, com.sapportals.wcm.util.uri.IHierarchicalUri baseUri, boolean tolerateTypeError)
          Create a Property from its XML/WebDAV serialization.
static IMutableProperty getProperty(IPropertyName pname, PropertyType pt, Element e, com.sapportals.wcm.util.http.DateFormat df)
          Create a Property from its XML/WebDAV serialization.
static void setElementAttributes(Element elem, IProperty property)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WDProperties

public WDProperties()
Method Detail

setElementAttributes

public static void setElementAttributes(Element elem,
                                        IProperty property)
                                 throws ResourceException
Throws:
ResourceException

appendProperty

public static void appendProperty(Element parent,
                                  IPropertyName pname,
                                  IProperty prop,
                                  com.sapportals.wcm.util.http.DateFormat df,
                                  com.sapportals.wcm.util.uri.IHierarchicalUri baseUri,
                                  boolean includeHiddenFlag)
                           throws ResourceException
Add a Property definition as child of an element.

Parameters:
parent - where to append property element
pname - name to use for property
prop - the property to add
df - date format object to use
Throws:
ResourceException - when property is not valid

appendProperty

public static void appendProperty(Element parent,
                                  IPropertyName pname,
                                  IProperty prop,
                                  com.sapportals.wcm.util.http.DateFormat df,
                                  com.sapportals.wcm.util.uri.IHierarchicalUri baseUri)
                           throws ResourceException
Throws:
ResourceException

appendPropertyValue

public static void appendPropertyValue(Element parent,
                                       IProperty prop,
                                       com.sapportals.wcm.util.http.DateFormat df,
                                       boolean includeHiddenFlag)
                                throws ResourceException
Throws:
ResourceException

appendPropertyValue

public static void appendPropertyValue(Element parent,
                                       IProperty prop,
                                       com.sapportals.wcm.util.http.DateFormat df,
                                       com.sapportals.wcm.util.uri.IHierarchicalUri baseUri,
                                       boolean includeHiddenFlag)
                                throws ResourceException
Add a Property Value as child of an element.

Parameters:
parent - where to append property value and set attributes on
prop - the property to add
df - date format object to use
Throws:
ResourceException - when property is not valid

getProperty

public static IMutableProperty getProperty(IPropertyName pname,
                                           Element e,
                                           com.sapportals.wcm.util.http.DateFormat df,
                                           com.sapportals.wcm.util.uri.IHierarchicalUri baseUri,
                                           boolean tolerateTypeError)
                                    throws ParseException,
                                           ResourceException
Create a Property from its XML/WebDAV serialization. Use the given PropertName. The element is the property name element. This method tries to extract type information according to RFC4316: Datatypes for Web Distributed Authoring and Versioning (WebDAV) Properties.

Parameters:
pname - the name to use in the property
e - the element with the property name in WebDAV XML serialization
df - date formatter
tolerateTypeError - when set to true, tolerate errors in parsing data types and fall back to simple types like string or XML.
Returns:
created property or null
Throws:
ParseException
ResourceException

getProperty

public static IMutableProperty getProperty(IPropertyName pname,
                                           PropertyType pt,
                                           Element e,
                                           com.sapportals.wcm.util.http.DateFormat df)
                                    throws ParseException,
                                           ResourceException
Create a Property from its XML/WebDAV serialization. Use the given PropertyName and type. The element is the property name element.

Parameters:
pname - the name to use in the property
pt - the property type to use
e - the element with the property name in WebDAV XML serialization
df - date formatter
Returns:
created property or null
Throws:
ParseException
ResourceException
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] KMC-CM [sap.com] tc/km/frwk api EP-KM-CM
[sap.com] KMC-WPC [sap.com] tc/kmc/wpc/wpcfacade api EP-PIN-WPC-WCM


Copyright 2012 SAP AG Complete Copyright Notice