Hi Stefan, thanks for your comments!
On Mon, Dec 21, 2015 at 5:46 PM, Stefan Seifert <[email protected]> wrote:
>>The details are at https://issues.apache.org/jira/browse/SLING-5356,
>>what do people think?
>
> some ideas from my side:
>
> 1. also support passing a Map for properties of a resource, not only the flat
> list of Objects. if
> you have more than 2 or 3 properties this gets confusing...
Potentially yes - anyway it's easy to add support for Maps, I have noted that.
> (i also like the proposal from Julian with support for lambda expression,
> another option to be supported)..
Yes, later maybe IMO.
>
> 2. perhaps add a shortcut for adding files
> .file("text.html", "/files/text.html")
> which defaults to the classpath, or with prefixes like "classpath://",
> "file://", "http://"
> etc. similar to the spring (not sling) resource concept [1]....
Ok, I prefer the prefix /URL idea, noted.
> ...3. the ResourceBuilder interface currently mixes resource building and
> ResourceBuilder
> creation, leading to of UnsupportedOperation/IllegalState exceptions...
Yes, I changed to this variant after other discussions in this thread.
It's a bit funny from the implementation side but I think it leads to
a very natural syntax, and allows having just one service which
reduces the number of things to understand. I'd like to keep it the
way it is now.
> ...4. i still find the names "forParent"/"atParent" a bit confusing, because
> it's not always a
> parent but might be any ancestor. perhaps switch it to "forRoot"/"atRoot"? ...
The builder state always has a current parent so it is a parent
indeed. As you mention, "root" is a confusing concept here that we
should avoid. I'm still open to name suggestions but the parent
concept is correct IMO.
> ...5. is the ResourceBuilder supposed to support some sort of JSON initial
> content loading as
> well like sling-mock ContentLoader [2] and the Sling Content Loader [3]
> does?...
Yes, I haven't implemented that yet, I suppose it should be an
import(...) method which behaves like file(...) but processes the
imported files as those other tools do?
For now I'll note your suggestions at SLING-5356 - I'm busy with
SLING-5355 these days however.
-Bertrand