You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Ben Short <be...@benshort.co.uk> on 2009/10/13 11:45:07 UTC

Importing content to root

Hi,

I have deployed the Sling Web Application to a tomcat instance and all
works fine.

When I connect via webdav I can see a index.html file. If I point my
browser to htttp://127.0.0.1:8888 (I deployed the webapp as root) I
get redirected to the index.html file.

How is the redirect configured and how can I change it to redirect to
some other file?

Also how can I import bundle content to the root node?

Taking the following XML Descriptor id like the content of the root
node to be rendered via a GET.jsp located at
/apps/website/home/GET.jsp

<node>
    <name>root</name>
    <primaryNodeType>nt:unstructured</primaryNodeType>
    <property>
            <name>sling:resourceType</name>
            <value>website/home</value>
        </property>
</node>

Regards

Ben Short

Re: Importing content to root

Posted by Ben Short <be...@benshort.co.uk>.
Thank Bertrand that did the job.

2009/10/13 Bertrand Delacretaz <bd...@apache.org>:
> On Tue, Oct 13, 2009 at 12:14 PM, Ben Short <be...@benshort.co.uk> wrote:
>> I just tried http://127.0.0.1:8888/json and got the following...
>>
>> {
>> "headline":"Loaded from ROOT.json",
>> "sling:resourceType":"sling:redirect",
>> "jcr:mixinTypes":["mix:lockable","rep:AccessControllable"],
>> "sling:target":"/index.html",
>> "jcr:primaryType":"rep:root"
>> }
>>
>> So it seems that some of my content is being set but not all of it.
>
> Looks like you have leftovers from the default initial content, you
> can remove them with (for example)
>
>  curl -F "sling:target=" http://admin:admin@localhost:8888/
>
> as setting a property to an empty string removes it.
>
> -Bertrand
>

Re: Importing content to root

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Oct 13, 2009 at 12:14 PM, Ben Short <be...@benshort.co.uk> wrote:
> I just tried http://127.0.0.1:8888/json and got the following...
>
> {
> "headline":"Loaded from ROOT.json",
> "sling:resourceType":"sling:redirect",
> "jcr:mixinTypes":["mix:lockable","rep:AccessControllable"],
> "sling:target":"/index.html",
> "jcr:primaryType":"rep:root"
> }
>
> So it seems that some of my content is being set but not all of it.

Looks like you have leftovers from the default initial content, you
can remove them with (for example)

  curl -F "sling:target=" http://admin:admin@localhost:8888/

as setting a property to an empty string removes it.

-Bertrand

Re: Importing content to root

Posted by Ben Short <be...@benshort.co.uk>.
I just tried http://127.0.0.1:8888/json and got the following...

{
"headline":"Loaded from ROOT.json",
"sling:resourceType":"sling:redirect",
"jcr:mixinTypes":["mix:lockable","rep:AccessControllable"],
"sling:target":"/index.html",
"jcr:primaryType":"rep:root"
}

So it seems that some of my content is being set but not all of it.

Ben

2009/10/13 Ben Short <be...@benshort.co.uk>:
> Hi,
>
> I have the following in ROOT.json at the route of the bundle content
> but after I deploy the bundle I still get redirected to index.html
>
> {
>    "sling:resourceType": "website",
>        "headline": "Loaded from ROOT.json"
> }
>
> Is there anyway to dump the contents of jackrabbit so I can see if the
> properties are set as expected?
>
> Regards
>
> Ben
>
> 2009/10/13 Bertrand Delacretaz <bd...@apache.org>:
>> Hi Ben,
>>
>> On Tue, Oct 13, 2009 at 11:45 AM, Ben Short <be...@benshort.co.uk> wrote:
>>> ...When I connect via webdav I can see a index.html file. If I point my
>>> browser to htttp://127.0.0.1:8888 (I deployed the webapp as root) I
>>> get redirected to the index.html file.
>>>
>>> How is the redirect configured and how can I change it to redirect to
>>> some other file?...
>>
>> In the Sling Launchpad this is configured by the
>> org.apache.sling.launchpad.content which supplies some initial
>> content.
>>
>> See http://svn.apache.org/repos/asf/sling/trunk/launchpad/content/src/main/resources/content/ROOT.json
>> for more specific info on the root node properties that configure the
>> redirect.
>>
>>>
>>> Also how can I import bundle content to the root node?
>>>
>>> Taking the following XML Descriptor id like the content of the root
>>> node to be rendered via a GET.jsp located at
>>> /apps/website/home/GET.jsp
>>>
>>> <node>
>>>    <name>root</name>
>>>    <primaryNodeType>nt:unstructured</primaryNodeType>
>>>    <property>
>>>            <name>sling:resourceType</name>
>>>            <value>website/home</value>
>>>        </property>
>>> </node>
>>
>> ROOT.json, as shown above, should allow you to setup the root node as required.
>>
>> -Bertrand
>>
>

Re: Importing content to root

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Oct 13, 2009 at 12:11 PM, Ben Short <be...@benshort.co.uk> wrote:
> Hi,
>
> I have the following in ROOT.json at the route of the bundle content
> but after I deploy the bundle I still get redirected to index.html
>
> {
>    "sling:resourceType": "website",
>        "headline": "Loaded from ROOT.json"
> }
>
> Is there anyway to dump the contents of jackrabbit so I can see if the
> properties are set as expected?

You can request /.tidy.json (or /.tidy.2.json to get a two-level
recursive dump or the root node).

-Bertrand

Re: Importing content to root

Posted by Ben Short <be...@benshort.co.uk>.
Hi,

I have the following in ROOT.json at the route of the bundle content
but after I deploy the bundle I still get redirected to index.html

{
    "sling:resourceType": "website",
	"headline": "Loaded from ROOT.json"
}

Is there anyway to dump the contents of jackrabbit so I can see if the
properties are set as expected?

Regards

Ben

2009/10/13 Bertrand Delacretaz <bd...@apache.org>:
> Hi Ben,
>
> On Tue, Oct 13, 2009 at 11:45 AM, Ben Short <be...@benshort.co.uk> wrote:
>> ...When I connect via webdav I can see a index.html file. If I point my
>> browser to htttp://127.0.0.1:8888 (I deployed the webapp as root) I
>> get redirected to the index.html file.
>>
>> How is the redirect configured and how can I change it to redirect to
>> some other file?...
>
> In the Sling Launchpad this is configured by the
> org.apache.sling.launchpad.content which supplies some initial
> content.
>
> See http://svn.apache.org/repos/asf/sling/trunk/launchpad/content/src/main/resources/content/ROOT.json
> for more specific info on the root node properties that configure the
> redirect.
>
>>
>> Also how can I import bundle content to the root node?
>>
>> Taking the following XML Descriptor id like the content of the root
>> node to be rendered via a GET.jsp located at
>> /apps/website/home/GET.jsp
>>
>> <node>
>>    <name>root</name>
>>    <primaryNodeType>nt:unstructured</primaryNodeType>
>>    <property>
>>            <name>sling:resourceType</name>
>>            <value>website/home</value>
>>        </property>
>> </node>
>
> ROOT.json, as shown above, should allow you to setup the root node as required.
>
> -Bertrand
>

Re: Importing content to root

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Ben,

On Tue, Oct 13, 2009 at 11:45 AM, Ben Short <be...@benshort.co.uk> wrote:
> ...When I connect via webdav I can see a index.html file. If I point my
> browser to htttp://127.0.0.1:8888 (I deployed the webapp as root) I
> get redirected to the index.html file.
>
> How is the redirect configured and how can I change it to redirect to
> some other file?...

In the Sling Launchpad this is configured by the
org.apache.sling.launchpad.content which supplies some initial
content.

See http://svn.apache.org/repos/asf/sling/trunk/launchpad/content/src/main/resources/content/ROOT.json
for more specific info on the root node properties that configure the
redirect.

>
> Also how can I import bundle content to the root node?
>
> Taking the following XML Descriptor id like the content of the root
> node to be rendered via a GET.jsp located at
> /apps/website/home/GET.jsp
>
> <node>
>    <name>root</name>
>    <primaryNodeType>nt:unstructured</primaryNodeType>
>    <property>
>            <name>sling:resourceType</name>
>            <value>website/home</value>
>        </property>
> </node>

ROOT.json, as shown above, should allow you to setup the root node as required.

-Bertrand