asiri (SVN) wrote:
> Modified: 
> sandbox/xwiki-webdav/src/main/java/com/xpn/xwiki/plugin/webdav/resources/XWikiDavResource.java
> ===================================================================
> --- 
> sandbox/xwiki-webdav/src/main/java/com/xpn/xwiki/plugin/webdav/resources/XWikiDavResource.java
>     2008-10-08 11:28:58 UTC (rev 13413)
> +++ 
> sandbox/xwiki-webdav/src/main/java/com/xpn/xwiki/plugin/webdav/resources/XWikiDavResource.java
>     2008-10-08 12:12:14 UTC (rev 13414)
> @@ -9,6 +9,8 @@
>  import org.apache.jackrabbit.webdav.DavResourceLocator;
>  import org.apache.jackrabbit.webdav.DavSession;
>  import org.apache.jackrabbit.webdav.lock.LockManager;
> +import org.xwiki.component.manager.ComponentManager;
> +import org.xwiki.component.phase.Composable;
>  
>  import com.xpn.xwiki.XWikiContext;
>  
> @@ -18,9 +20,14 @@
>   * 
>   * @version $Id$
>   */
> -public interface XWikiDavResource extends DavResource
> +public interface XWikiDavResource extends DavResource, Composable
>  {
>      /**
> +     * This component's role, used when code needs to look it up.
> +     */
> +    String ROLE = XWikiDavResource.class.getName(); 
> +        
> +    /**
>       * Initializes this resource with common attributes inherited from the 
> parent.
>       * 
>       * @param parent Parent resource.
> @@ -72,6 +79,11 @@
>      XWikiContext getXwikiContext();
>  
>      /**
> +     * @return The [EMAIL PROTECTED] ComponentManager} used to lookup 
> components.
> +     */
> +    ComponentManager getComponentManager();
> +    
> +    /**
>       * @return The [EMAIL PROTECTED] LockManager} associated with this 
> request (global).
>       */
>      LockManager getLockManager();

I don't like this... a component interface should not expose the
component manager, which is supposed to be used in implementations. Please:
- remove the Composable from the interface
- add it to AbstractXWikiDavResource, if needed
- move the getComponentManager there, too, if you must

I'm not sure you need the component manager inside all DAV resources. As
I see in the code, you only need it in the Root view, so you should only
declare that XWikiRootDavView implements Composable.


FYI, the XWiki helper interfaces (Composable, LogEnabled, Initializable)
are supposed to be used by implementations, not by other interfaces.
-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to