Awesome work Stefan! I have a project I'll be starting soon that's in
need of something like this. Thank you much.

-James

On Tue, 2005-01-11 at 18:23 +0100, Stefan LÃtzkendorf wrote:
> Hello folks,
> 
> as you may have noticed, I made some restructuring in the webdav layer 
> for support of configurable properties. A first major step is done and 
> that's why I want to give a short overview. I'll add a wiki page to this 
> stuff later.
> 
> hope this will be usefull for others too,
> Stefan
> 
> ----------------------
> 
> Similiar to the previous solution: capabilities of resources are managed
> around "resource kinds". Capabilities currently are
>   - live-properties
>   - webdav methods allowed
>   - reports allowed
> 
> New is that these capabilities are no longer 'hard coded' but
> can be configured!
> 
> The default configuration of slides supported properties can be found
> in the org.apache.slide.webdav.util.resourcekind package in the
> resource_kinds.xml file.
> AND user defined resource kind capabilities (e.g. new computed 
> properties) can additionally added in the Domain.xml.
> 
> 1st sample (computed properties): someone wants to add a new property 
> that each resource can have, that can be set explicitly and if a 
> resource has no explicite value set, the value shall be inherited by the 
> nearest ancester resource. This is a task for a computed property. You 
> have to create a new PropertyComputer. For this sample slide contains 
> always an implementation (InheritedProperty).
> 
> The following configuration registers the computed property:
> 
>     <resource-kind name="DeltavCompliant">
>       <live-properties>
>         <live-property name="myProperty"
>            namespace="http://my.company.com/slide";
>     computer="org.apache.slide.webdav.util.properties.InheritedProperty">
>           <computer-configuration>
>             <default-value>undefined</default-value>
>           </computer-configuration>
>         </live-property>
>       </live-properties>
>     </resource-kind>
> 
> 2nd sample (validated properties): someone wants to add a new property
> that only supports a given set of values or the value must have a
> special syntax (e.g. must be date string matching some formats).
> To resolve this you have to implement a PropertyValueValidator.
> As a sample slide contains a DateValueValidator.
> 
> The following configuration registers a validated property:
> 
>     <resource-kind name="DeltavCompliantCollection">
>       <live-properties>
>         <live-property name="myDate"
>          namespace="http://my.company.com/slide"; 
> validator="org.apache.slide.webdav.util.properties.DateValueValidator">
>         </live-property>
>       </live-properties>
>     </resource-kind>
> 
> Note that I use the resource kind DeltavCompliantCollection, i.e., this 
> property definition is limited to collection resources)
> 
> 3rd (default values): It may be usefull to set a default value for 
> certain properties. This is possible, but is currently not used 
> consitently through slide. In particular the PutMethod and the 
> MkcolMethod are not using this currently (maybe some other methods will 
> need this too). Actually it is used only by some of the versioning 
> implementations.
> 
> 
> The configuration framents shown above may be posted to the 
> resource_kinds.xml of the resourcekind package if the properties shall 
> be default in slide.
> 
> Or you can add them in the Domain.xml. Add the following to the <events>
> section:
> 
>    <event classname="org.apache.slide.event.DomainEvent" enable="true"/>
>    <listener 
> classname="org.apache.slide.webdav.util.resourcekind.ResourceKindConfigurator">
>      <configuration>
>        ... your resource kind capability definitions here ...
>      </configuration>
>    </listener>
> 
> I have added a DomainEvent that is triggered if the domain is 
> initialized successfully. I'm not sure that this is the best to trigger 
> webdav specific configuration way but for now it works.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to