>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
(i also like the proposal from Julian with support for lambda expression,
another option to be supported)
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].
makes it easier to write and read and minimizes the need for exception
handling.
3. the ResourceBuilder interface currently mixes resource building and
ResourceBuilder creation, leading to of UnsupportedOperation/IllegalState
exceptions in both ResourceBuilderImpl and ResourceBuilderService. perhaps just
split this up in two interfaces - a builder-factory API and a builder API?
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"? (meaning not the resource tree root, but the builder root -
naming still not fully clear)
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? i thought this was how the discussion about ResourceBuilder started.
stefan
[1]
http://docs.spring.io/autorepo/docs/spring/3.2.x/spring-framework-reference/html/resources.html#resources-resourceloader
[2]
https://sling.apache.org/documentation/development/sling-mock.html#building-content
[3] http://sling.apache.org/site/content-loading.html