Re: How does one build Sling?

2008-01-22 Thread Peter Svensson
OK. Thanks, I'll have to debug anyway, to see where the oddities lie. it
really should create an array :)

Cheers,
PS

On Jan 22, 2008 10:30 AM, Bertrand Delacretaz <[EMAIL PROTECTED]>
wrote:

> On Jan 22, 2008 10:19 AM, Peter Svensson <[EMAIL PROTECTED]> wrote:
>
> > ...I wanted to look in the class "javax.jcr.Property",
> > because it defines if a property is multiple or not (leading to the
> > generation of an array)
>
> Ok - in the case of Sling we're only dealing with the Property
> interface, which docs you can usually find on Google by searching for
> "JCR Property" which should lead you to
>
> http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Property.html
>
> -Bertrand
>


Re: How does one build Sling?

2008-01-22 Thread Bertrand Delacretaz
On Jan 22, 2008 10:19 AM, Peter Svensson <[EMAIL PROTECTED]> wrote:

> ...I wanted to look in the class "javax.jcr.Property",
> because it defines if a property is multiple or not (leading to the
> generation of an array)

Ok - in the case of Sling we're only dealing with the Property
interface, which docs you can usually find on Google by searching for
"JCR Property" which should lead you to

http://www.day.com/maven/jsr170/javadocs/jcr-1.0/javax/jcr/Property.html

-Bertrand


Re: How does one build Sling?

2008-01-22 Thread Peter Svensson
Thanks!

But hmm. Maybe not, but I wanted to look in the class "javax.jcr.Property",
because it defines if a property is multiple or not (leading to the
generation of an array). However, I think that one could implement that
oneself. It's just that I have been coding in js only for nearly half a
year, and it feels so hard to fire up Eclipse again and all the time
everything takes. I'm just very lazy :)  I'll do it, though. Just another
cup of coffee...

Cheers,
PS

On Jan 22, 2008 10:10 AM, Bertrand Delacretaz <[EMAIL PROTECTED]>
wrote:

> Hi Peter,
>
> (replied to the JSON part in a renamed thread to separate matters)
>
> >... What I meant with not finding the source code to the JCR Property
> class was
> > that i did a grep . -exec "javax.jcr.Property" {} \;  -print   and every
> > file listed was one referering to it, not defining it, except for a jar
> > file, which came from the jcr project. So I kind of gave up on that
> point :)...
>
> Ah ok - I don't think you need the JCR Property source code, as the
> JSON format is completely generated by Sling.
>
> In microsling-core, that's
>
>
> ./src/main/java/org/apache/sling/microsling/helpers/json/JsonItemWriter.java
>
> ./src/main/java/org/apache/sling/microsling/slingservlets/renderers/JsonRendererServlet.java
>
> And in launchpad/launchpad-servlets that's
>
> ./src/main/java/org/apache/sling/launchpad/renderers/JsonItemWriter.java
>
> ./src/main/java/org/apache/sling/launchpad/renderers/JsonRendererServlet.java
>
> -Bertrand
>


Re: How does one build Sling?

2008-01-22 Thread Bertrand Delacretaz
Hi Peter,

(replied to the JSON part in a renamed thread to separate matters)

>... What I meant with not finding the source code to the JCR Property class was
> that i did a grep . -exec "javax.jcr.Property" {} \;  -print   and every
> file listed was one referering to it, not defining it, except for a jar
> file, which came from the jcr project. So I kind of gave up on that point 
> :)...

Ah ok - I don't think you need the JCR Property source code, as the
JSON format is completely generated by Sling.

In microsling-core, that's

./src/main/java/org/apache/sling/microsling/helpers/json/JsonItemWriter.java
./src/main/java/org/apache/sling/microsling/slingservlets/renderers/JsonRendererServlet.java

And in launchpad/launchpad-servlets that's

./src/main/java/org/apache/sling/launchpad/renderers/JsonItemWriter.java
./src/main/java/org/apache/sling/launchpad/renderers/JsonRendererServlet.java

-Bertrand


Re: How does one build Sling?

2008-01-22 Thread Peter Svensson
Hi Bertrand,

The json that would be nice to have is something like this;

{
label: 'name',
identifier: 'name',
items:
[
{ name:'Fruit', type:'category'},
{ name:'Cinammon', type: 'category',
children:
[
{ name:'Cinammon Roll', type:'poptart' },
{ name:'Brown Sugar Cinnamon', type:'poptart' },
{ name:'French Toast', type:'poptart' }
]
},
{ name:'Chocolate', type: 'category'}
]
}

Where the only important stuff here is that child nodes should be put in a
separate array [], not as an object  to the parent node, like this;

{
"jcr:primaryType":"nt:unstructured",
"testing":
   {"jcr:primaryType":"nt:unstructured",
"test2":
   {
"title":"test2","sling:resourceType":"usling/example","jcr:primaryType":"nt:unstructured","text":"Default
text of the test node"},
"dojo_editor":
   { "title":"dojo
editor","sling:resourceType":"usling/editor","jcr:primaryType":"nt:unstructured","text":"This
is the dojo 1.x editor" },
   "d1":
   { "title":"d1","sling:resourceType":"http://www.w3.org/TR/html4/strict.dtd\";>\r\n\r\n\r\n\r\nEditor Demo<\/title>\r\n

Re: How does one build Sling?

2008-01-22 Thread Bertrand Delacretaz
Hi Peter,

On Jan 22, 2008 8:00 AM, Peter Svensson <[EMAIL PROTECTED]> wrote:

> ...I did manage to checj out and build Sling alst night, and after a while
> realized that the faulty json stuff is probably due to the fact that
> javax.jcr.Property does not return tru when a property isMultiple(). Or has
> the wrong ideas of what is multiple. That means that arrays never get
> generates, but instead all herarchical json objects are just objects within
> objects (which I prefer myself as well, but for some reason isn't
> 'standard')

Could you given an example of what JSON you'd expect to get for a
multivalued property?

I don't think this is tested currently in the microsling-core or
Launchpad tests, but I'll add it once we define what's needed.

> ...But jcr isn't (of course) included in Sling only tha API jar, so now I have
> to maybe checkout jcr as well and deal with those issues

Not sure what you mean - the Launchpad and microsling-core both use an
embedded Jackrabbit repository, so it's all in there.

> ..So, what I've done instead is gone back to the client side and try to cram
> more regexp mojo, so that I can transalte it nearer to home. We'll see how
> it goes

Ok fine - if you find a way to get what you need, we'll see how we can
make this happen in Sling!

-Bertrand


Re: How does one build Sling?

2008-01-21 Thread Peter Svensson
Thanks for you links. I must admit to being even more disoriented than that,
I'm afraid :)
I'm currently focusing on how to on either side convert the generated json
that describes a hierarchy of JCR nodes to be truly 'json' compliant, so
that I can just plug it in the Dojo Tree in bunkai.

But I haven't so much experience with specifics yet, so I know what it means
to have a Sling with or without Launchpad - i.e. what specific features does
it give.

I did manage to checj out and build Sling alst night, and after a while
realized that the faulty json stuff is probably due to the fact that
javax.jcr.Property does not return tru when a property isMultiple(). Or has
the wrong ideas of what is multiple. That means that arrays never get
generates, but instead all herarchical json objects are just objects within
objects (which I prefer myself as well, but for some reason isn't
'standard').

But jcr isn't (of course) included in Sling only tha API jar, so now I have
to maybe checkout jcr as well and deal with those issues.

So, what I've done instead is gone back to the client side and try to cram
more regexp mojo, so that I can transalte it nearer to home. We'll see how
it goes.

Cheers,
PS

On Jan 21, 2008 9:51 PM, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote:

> On Jan 21, 2008 6:14 PM, Peter Svensson <[EMAIL PROTECTED]> wrote:
> > ...Hmm. I should know by now what Launchpad does, but am I right in
> assuming
> > that that means that esp parsing while be disabled as well?...
>
> Not sure what you mean - the Launchpad works very similarly to
> microsling-core, but instead of being based on distinct code, it runs
> on the core Sling code.
>
> It is not finished, quite a few tests under [1] are disabled (search
> for TODO_FAILS_ in code for more details). So microsling-core is
> probably less risky to experiment with now, until [2] is marked
> resolved.
>
> -Bertrand
>
> [1]
> http://svn.apache.org/repos/asf/incubator/sling/trunk/launchpad/launchpad-webapp/
> [2] https://issues.apache.org/jira/browse/SLING-149
>


Re: How does one build Sling?

2008-01-21 Thread Bertrand Delacretaz
On Jan 21, 2008 6:14 PM, Peter Svensson <[EMAIL PROTECTED]> wrote:
> ...Hmm. I should know by now what Launchpad does, but am I right in assuming
> that that means that esp parsing while be disabled as well?...

Not sure what you mean - the Launchpad works very similarly to
microsling-core, but instead of being based on distinct code, it runs
on the core Sling code.

It is not finished, quite a few tests under [1] are disabled (search
for TODO_FAILS_ in code for more details). So microsling-core is
probably less risky to experiment with now, until [2] is marked
resolved.

-Bertrand

[1] 
http://svn.apache.org/repos/asf/incubator/sling/trunk/launchpad/launchpad-webapp/
[2] https://issues.apache.org/jira/browse/SLING-149


Re: How does one build Sling?

2008-01-21 Thread Peter Svensson
Hmm. I should know by now what Launchpad does, but am I right in assuming
that that means that esp parsing while be disabled as well?

Cheers,
PS

On Jan 21, 2008 6:06 PM, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote:

> On Jan 21, 2008 3:55 PM, Bertrand Delacretaz <[EMAIL PROTECTED]>
> wrote:
>
> > ...Checkout with an svn client from
> > http://svn.apache.org/repos/asf/incubator/sling/trunk/...
>
> Note that the launchpad stuff is broken in the current HEAD revision
> (see SLING-154), if you want to try it before we fix that please use
> revision 613894, i.e:
>
>  svn co -r 613894 http://svn.apache.org/repos/asf/incubator/sling/trunk/sling
>  cd sling
>  and then "mvn clean install" etc...
>
> -Bertrand
>


Re: How does one build Sling?

2008-01-21 Thread Bertrand Delacretaz
On Jan 21, 2008 3:55 PM, Bertrand Delacretaz <[EMAIL PROTECTED]> wrote:

> ...Checkout with an svn client from
> http://svn.apache.org/repos/asf/incubator/sling/trunk/...

Note that the launchpad stuff is broken in the current HEAD revision
(see SLING-154), if you want to try it before we fix that please use
revision 613894, i.e:

 svn co -r 613894 http://svn.apache.org/repos/asf/incubator/sling/trunk/ sling
 cd sling
 and then "mvn clean install" etc...

-Bertrand


Re: How does one build Sling?

2008-01-21 Thread Bertrand Delacretaz
On Jan 21, 2008 3:41 PM, Peter Svensson <[EMAIL PROTECTED]> wrote:

> ...I've tried to look in the docs for a checkout and build process, but
> couldn't find one.  COuld someone point me out to some info on this?...

Install a Java 5 JVM and Maven (I use 2.0.7).

Checkout with an svn client from
http://svn.apache.org/repos/asf/incubator/sling/trunk/

Build with "mvn clean install" in trunk (the directory that contains
api, cache, commons, etc.).

See launchpad/launchpad-webapp/README.txt if you want to run the
launchpad (née µsling).

The first mvn build will be much slower than the next ones, as lots of
dependencies will be downloaded to your local Maven "cache".

That should be it!

-Bertrand