David Sean Taylor wrote:

> Christophe,
>
> Say I wanted to have 2 or more component services for the same component 
> interface. Can I configure that easily in Spring?
> Its not readily apparent to me...


Never tested but it should work : with 2 distinct component id:

Eg :
  <!-- Content Model Service  1-->
  <bean id="Model1"  
class="org.apache.portals.graffito.impl.ContentModelServiceImpl"   >        
         <constructor-arg ><ref 
bean="org.apache.portals.graffito.persistence.impl.ContentPersistenceServiceImpl"/></constructor-arg>
        
       <constructor-arg ><ref 
bean="org.apache.portals.graffito.impl.ContentVersionServiceImpl"/></constructor-arg>
        
  </bean>


  <!-- Content Model Service  2-->
  <bean id="Model2"  
class="org.apache.portals.graffito.impl.ContentModelServiceImpl"   >        
         <constructor-arg ><ref 
bean="org.apache.portals.graffito.persistence.impl.ContentPersistenceServiceImpl"/></constructor-arg>
        
       <constructor-arg ><ref 
bean="org.apache.portals.graffito.impl.ContentVersionServiceImpl"/></constructor-arg>
        
  </bean>

>
> For example, I want to have 3 ContentModelService implementations, one going 
> to WebDAV, one to default persistence store, and one to the file system.
>
ok Now I understand what you want.

I don't advise you to change the implementation of ContentModelService,  
ContentSearchService, ContentVersionService, ...
The default implementations of thoses services are using the Persistence 
service (see the architecture page in the Graffito Site). By this way, you can 
plug more than one content server into the Vitural Content Tree.
The Persistence service is a key component that can be used in a lot of use 
cases. Each time a request is made on a specific uri. The persistence store 
find the appropriate content store (depending on a uri mapping).

Supporting another kind of content stores (WEBDAV, fs, ...)  is made via the 
ContentStore interface and Server interface. 

What you have to do is :
* Write a new plugin (eg. new ContentStore implementation for Webdav server and 
another implementation for a FS).
* Define a new Server implementation. This data object contains connection info 
for a specific server. One attribute is of course the the plug class to used 
for this server (one of the ContentStore implementation). Each server has a 
scope attribute used to make the URI mapping.

* Register a new server in the Graffito engine (Persistence service).
          Via the API :  ContentServerService.addServer(server)
          When starting the application  :  Add a new entry in the Master 
Graffito Store (DB) : this store is used by the Persistence Store when you 
start the Graffito engine. This store contains all server references to plug 
into your Graffito running application.

Other comments :
* Can you review the architecture page in the Graffito site and let me know if 
it not clear. My english is really bad :-(
* I can help for the WEBDAV impl. I made one for JCMS 1 and I should be 
possible to migrate it for Graffito. Let me know when you need this impl.
* Should be nice to see the status on the subproject : VFS from Jakarta Commons.









Reply via email to