Hi Bertrand,

For my case, need to get this node set up as the base folder of a particular 
data store.  It's a Sling model but has no other properties are required for 
adaptTo() to work successfully, so what you describe would work for me.


It wouldn't work if I had any other required properties that needed to be 
mapped from the node.  For that, the repoinit language would need to support 
general property initialization, and I'm not sure whether that falls within the 
intended scope.


For now the repository initializer should work just fine; somehow I looked 
right past that when scanning the repoinit stuff.


Thanks, as always, for your help!


John

________________________________
From: Bertrand Delacretaz <[email protected]>
Sent: Friday, December 15, 2017 3:09:44 AM
To: users
Subject: Re: Setting sling:resourceType on a node as part of repo 
initialization?

Hi John,

On Fri, Dec 15, 2017 at 1:44 AM, John Logan <[email protected]> wrote:
>... I'm creating a node at repository initialization time using a "create 
>path" statement in my repoinit
> block, and wondering what the best practice would be for also setting the 
> sling:resourceType on
> that node....

You're right that this is not supported by the repoinit language so far.

As a workaround you might register a SlingRepositoryInitializer [1]
that does what you need.

But I agree that it would make sense to support this in repoint. As
resource types are in the same "family" than node types I think best
is to expand the bracketed node type statements to something like

  (nt:unstructured mixin nt:versionable resourceType foo/bar)

WDYT?

I won't have time to do this myself in the next few days, though, but
we might at least create a ticket as I think it makes sense. Feel free
to that if you want.

-Bertrand

[1] 
https://sling.apache.org/documentation/bundles/repository-initialization.html

Reply via email to