You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Felix Meschberger (JIRA)" <ji...@apache.org> on 2010/07/28 21:03:16 UTC

[jira] Commented: (SLING-1193) Extend Resource interface and provide AbstractResource base class

    [ https://issues.apache.org/jira/browse/SLING-1193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12893310#action_12893310 ] 

Felix Meschberger commented on SLING-1193:
------------------------------------------

In Rev. 980150 added the methods to the Resource interface
  - Add AbstractResource abstract class with implementations of new methods
  - Adapt ResourceUtil, SyntheticResource and ResourceWrapper
  - Move AdapterManager field from SyntheticResource to AbstractResource
  - Adapt JCR Resource support to new API and test cases
  - Fix Testcase in Engine bundle to extend MockResource from AbstractResource

(In Rev. 980155 removed superfluous interface addition)

In Rev. 980158 adapt ServletResource and DefaultSlingScript to new Resource API

> Extend Resource interface and provide AbstractResource base class
> -----------------------------------------------------------------
>
>                 Key: SLING-1193
>                 URL: https://issues.apache.org/jira/browse/SLING-1193
>             Project: Sling
>          Issue Type: New Feature
>          Components: API, Engine, JCR, Scripting, Servlets
>    Affects Versions: Servlets Resolver 2.0.8, Scripting Core 2.0.10, JCR Resource 2.0.6, Engine 2.0.6, API 2.0.8
>            Reporter: Felix Meschberger
>            Assignee: Felix Meschberger
>             Fix For: Servlets Resolver 2.0.10, Scripting Core 2.0.12, JCR Resource 2.0.8, Engine 2.1.0, API 2.1.0
>
>
> Currently the Resource interface has only bare bones API to access its own local attributes, like getPath() or getResourceType().
> Accessing the resource in the context of its parent or its children is not currently possible and doing so requires getting the resource resolver out of the resource and asking the resource resolver.
> For convenience, we should add the following methods:
>    getParent() -- returns the parent resource (same as ResourceUtil.getParent(this))
>    getName() -- returns the name of the resource (same as ResourceUtil.getName(this))
>    listChildren() -- same as getResourceResolver().listChildren(this)
>    getChild(String) -- same as getResourceResolver().getResource(this, path)
>    isResourceType(String) -- same as ResourceUtil.isA(this, String)
> The new AbstractResource class will implement these methods as indicated.
> Implementors of the Resource interface are then advised to actually extend from the AbstractResource interface, which in the future will provide default implementations of any methods added to the Resource interface, if it makes sense.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.