Hi,
On Tue, Sep 30, 2014 at 10:21 AM, Carsten Ziegeler <[email protected]> wrote:
> I've thought a little bit more about the model and I came up with a
> slightly different syntax. A file with examples can be found here:
> https://svn.apache.org/repos/asf/sling/trunk/launchpad/slingstart/src/main/model/example.txt
>
> The previous version messed up features and run modes and made them the
> same. But that's not true, a feature can have artifacts in different run
> modes.
> So I changed the model and now each file represents a single feature, a
> feature has a name which is usually derived from the file name of the model
> file.
>
> A feature has variables that can be used for the values of settings and
> configurations and also to specify artifacts.
>
> A feature consists of run modes - the global one is the default run mode
> and always active.
>
> A run mode can have settings, configurations, and artifacts.
>
> In the txt file, each part is introduced with a section notation, like
> [configurations], [artifacts] etc.
>
> An artifact is just a single line with the maven coordinates of the
> artifact. it can have additional information like the sha1 etc.
>
> A configuration is started with a line containing the pid or factory pid +
> alias, followed by the contents of the configuration and ends with an empty
> line.
>
> Each object in the model can have comments preceding the object.
>
> Based on this we'll have two utility methods: one for agregating a model
> based on features. This is e.g. reading a directory of model files in
> alphabetical order. The aggregation checks for unique variables etc.
> The second utility method is merging - it merges a complete (aggregated
> model) with another aggregated one. This allows for overlaying or customing.
>
> WDYT?
I haven't looked very much in depth at this, but I like where this is
heading. A couple of questions/nitpicks:
1. Attaching additional information to artifacts currently looks like this
org.apache.commons/commons-math/2.2/jar {sha1=2353750701ABE}
How will multiple attributes look like? We can have a CSV list, e.g.
{att1=val1,att2=val2} or multiple space-separated groups, e.g.
{att1=val1} {att2=val2} . I think the first one looks better but needs
to define escaping.
Also, when I see a '{' '}' block I immediately think of code. Perhaps
it would be more intuitive to have these attributes enclosed in
parenthesis, e.g. '(sha1=CAFEBABE)'.
2. One of the example OSGi configs has a string value quoted and also escaped
# A plain configuration
org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
name="Default\ NodeStore"
repository.home="sling/oak/repository"
Would it not be simpler to have the value be "Default NodeStore" ?
3. Runmode configuration needs an additional section, and is ( I think
) the only case where we have nested sections. Would it simplify the
model and make the file easier to understand by including them as
attributes to various sections ? I think this model looks somewhat
flat - which is a good thing - but is not very good at expressing deep
nesting like XML/JSON.
[artifacts startLevel=15 runModeName=jackrabbit]
org.apache.derby/derby/10.5.3.0_1/jar
org.apache.sling/org.apache.sling.jcr.jackrabbit.server/2.1.3-SNAPSHOT/jar
Thanks,
Robert
>
> Regards
> Carsten
>
> 2014-09-30 8:11 GMT+02:00 Carsten Ziegeler <[email protected]>:
>
>> Hi,
>>
>> 2014-09-29 15:36 GMT+02:00 Carsten Ziegeler <[email protected]>:
>>
>>> Hi Bertrand,
>>>
>>>
>>> 2014-09-29 14:42 GMT+02:00 Bertrand Delacretaz <[email protected]>:
>>>
>>>>
>>>> Can we call this "startup model" BTW? It's more descriptive than
>>>> slingstart.
>>>>
>>>> I'm fine with nearly any name, I just picked the first thing running
>>> through my brain...
>>> While "startup model" is more descriptive, the model can also be used to
>>> describe partial systems (being it a subsystem etc.), therefore "startup"
>>> is slightly missleading.
>>> The same goes with "instance model". I thought about "runtime model" but
>>> that seems to be not 100% correct, either :)
>>>
>>
>> What about Sling Provisioning Model (SPM) ?
>>
>> Carsten
>>
>>
>> --
>> Carsten Ziegeler
>> Adobe Research Switzerland
>> [email protected]
>>
>
>
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> [email protected]