You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by 付 尧 <gu...@gmail.com> on 2008/10/28 12:07:57 UTC
Something not so proper in the PathIterator
Hi, guys,
Sling's concept of extension and suffix is great.
But I went to an error when I try to add a child node to the node that
has an dot in its name.
Let's suppose this, there is a node /apps/my.app/resources with type
of nt:unstructured.
When I post a file to the folder, sling post servlet will give me a
surprise of adding the node to /apps/my/resources, just because the
PathIterator behave like that(It takes .app as an extension).
Maybe let the PathIterator check the resource's existence (or escape
the dot in the path?) is the solution here, what do you think?
Folders has one or more dot for name is so natural to me, cause I'm a
Mac. :)
Thanks.
PS:
Thanks again for forgive me for my poor english, I'm Chinese, you can
see it from my name, :).
-----
Jack
Re: Something not so proper in the PathIterator
Posted by 付 尧 <gu...@gmail.com>.
Thanks a lot.
-----
Jack
在 2008-10-28,下午10:00, Felix Meschberger 写道:
> Hi Jack,
>
> you just hit issue SLING-588, which has been heavily discussed about
> but
> then was lost track.
>
> I just applied the respective patch.
>
> As a workaround you may also POST to /apps/my.app/ (the trailing slash
> is important to have a new node below /apps/my.app created) and add a
> field ":name" whose value is the required name of your node.
>
> For example the curl command:
>
> $ curl -F:name=resources -Fjcr:primaryType=nt:folder \
> http://host:port/apps/my.app/
>
> will create the /apps/my.app/resources folder.
>
> With the patch from SLING-588 applied, the curl command
>
> $ curl -Fjcr:primaryType=nt:folder \
> http://host:port/apps/my.app/resources
>
> should also work.
>
> Hope this helps.
>
> Regards
> Felix
>
> [1] https://issues.apache.org/jira/browse/SLING-588
>
>
> 付 尧 schrieb:
>> Hi Felix,
>>
>> I did that in webdav. ;)
>> And of course, my.app is a nt:folder. I just use /apps/my.app as an
>> example.
>>
>> thank you for you response.
>> -----
>> Jack
>>
>>
>>
>> 在 2008-10-28,下午7:18, Felix Meschberger 写道:
>>
>>> Hi Jack,
>>>
>>> 付 尧 schrieb:
>>>> But I went to an error when I try to add a child node to the node
>>>> that
>>>> has an dot in its name.
>>>>
>>>> Let's suppose this, there is a node /apps/my.app/resources with
>>>> type of
>>>> nt:unstructured.
>>>>
>>>> When I post a file to the folder, sling post servlet will give me a
>>>> surprise of adding the node to /apps/my/resources, just because
>>>> the
>>>> PathIterator behave like that(It takes .app as an extension).
>>>
>>> I am not sure, whether I understand you. How did you create the
>>> /apps/my.app/resources node ? Did you use the SlingPostServlet to
>>> create
>>> it like this ?
>>>
>>> POST /apps/my.app/resources ?
>>>
>>> It might be possible (I cannot exactly remember the code right
>>> now) that
>>> the SlingPostServlet has a bug creating the required node and
>>> cutting
>>> off the extension here.
>>>
>>> If you could list the exact steps you do to try to create your
>>> nodes,
>>> this might help. Thanks.
>>>
>>>>
>>>> Maybe let the PathIterator check the resource's existence (or
>>>> escape the
>>>> dot in the path?) is the solution here, what do you think?
>>>>
>>>> Folders has one or more dot for name is so natural to me, cause
>>>> I'm a
>>>> Mac. :)
>>>
>>> Yes, names with dots should be possible, I agree.
>>>
>>> Regards
>>> Felix
>>>
>>>
>>
>>
>
Re: Something not so proper in the PathIterator
Posted by Felix Meschberger <fm...@gmail.com>.
Hi Jack,
you just hit issue SLING-588, which has been heavily discussed about but
then was lost track.
I just applied the respective patch.
As a workaround you may also POST to /apps/my.app/ (the trailing slash
is important to have a new node below /apps/my.app created) and add a
field ":name" whose value is the required name of your node.
For example the curl command:
$ curl -F:name=resources -Fjcr:primaryType=nt:folder \
http://host:port/apps/my.app/
will create the /apps/my.app/resources folder.
With the patch from SLING-588 applied, the curl command
$ curl -Fjcr:primaryType=nt:folder \
http://host:port/apps/my.app/resources
should also work.
Hope this helps.
Regards
Felix
[1] https://issues.apache.org/jira/browse/SLING-588
付 尧 schrieb:
> Hi Felix,
>
> I did that in webdav. ;)
> And of course, my.app is a nt:folder. I just use /apps/my.app as an
> example.
>
> thank you for you response.
> -----
> Jack
>
>
>
> 在 2008-10-28,下午7:18, Felix Meschberger 写道:
>
>> Hi Jack,
>>
>> 付 尧 schrieb:
>>> But I went to an error when I try to add a child node to the node that
>>> has an dot in its name.
>>>
>>> Let's suppose this, there is a node /apps/my.app/resources with type of
>>> nt:unstructured.
>>>
>>> When I post a file to the folder, sling post servlet will give me a
>>> surprise of adding the node to /apps/my/resources, just because the
>>> PathIterator behave like that(It takes .app as an extension).
>>
>> I am not sure, whether I understand you. How did you create the
>> /apps/my.app/resources node ? Did you use the SlingPostServlet to create
>> it like this ?
>>
>> POST /apps/my.app/resources ?
>>
>> It might be possible (I cannot exactly remember the code right now) that
>> the SlingPostServlet has a bug creating the required node and cutting
>> off the extension here.
>>
>> If you could list the exact steps you do to try to create your nodes,
>> this might help. Thanks.
>>
>>>
>>> Maybe let the PathIterator check the resource's existence (or escape the
>>> dot in the path?) is the solution here, what do you think?
>>>
>>> Folders has one or more dot for name is so natural to me, cause I'm a
>>> Mac. :)
>>
>> Yes, names with dots should be possible, I agree.
>>
>> Regards
>> Felix
>>
>>
>
>
Re: Something not so proper in the PathIterator
Posted by 付 尧 <gu...@gmail.com>.
Hi Felix,
I did that in webdav. ;)
And of course, my.app is a nt:folder. I just use /apps/my.app as an
example.
thank you for you response.
-----
Jack
在 2008-10-28,下午7:18, Felix Meschberger 写道:
> Hi Jack,
>
> 付 尧 schrieb:
>> But I went to an error when I try to add a child node to the node
>> that
>> has an dot in its name.
>>
>> Let's suppose this, there is a node /apps/my.app/resources with
>> type of
>> nt:unstructured.
>>
>> When I post a file to the folder, sling post servlet will give me a
>> surprise of adding the node to /apps/my/resources, just because the
>> PathIterator behave like that(It takes .app as an extension).
>
> I am not sure, whether I understand you. How did you create the
> /apps/my.app/resources node ? Did you use the SlingPostServlet to
> create
> it like this ?
>
> POST /apps/my.app/resources ?
>
> It might be possible (I cannot exactly remember the code right now)
> that
> the SlingPostServlet has a bug creating the required node and cutting
> off the extension here.
>
> If you could list the exact steps you do to try to create your nodes,
> this might help. Thanks.
>
>>
>> Maybe let the PathIterator check the resource's existence (or
>> escape the
>> dot in the path?) is the solution here, what do you think?
>>
>> Folders has one or more dot for name is so natural to me, cause
>> I'm a
>> Mac. :)
>
> Yes, names with dots should be possible, I agree.
>
> Regards
> Felix
>
>
Re: Something not so proper in the PathIterator
Posted by Felix Meschberger <fm...@gmail.com>.
Hi Jack,
付 尧 schrieb:
> But I went to an error when I try to add a child node to the node that
> has an dot in its name.
>
> Let's suppose this, there is a node /apps/my.app/resources with type of
> nt:unstructured.
>
> When I post a file to the folder, sling post servlet will give me a
> surprise of adding the node to /apps/my/resources, just because the
> PathIterator behave like that(It takes .app as an extension).
I am not sure, whether I understand you. How did you create the
/apps/my.app/resources node ? Did you use the SlingPostServlet to create
it like this ?
POST /apps/my.app/resources ?
It might be possible (I cannot exactly remember the code right now) that
the SlingPostServlet has a bug creating the required node and cutting
off the extension here.
If you could list the exact steps you do to try to create your nodes,
this might help. Thanks.
>
> Maybe let the PathIterator check the resource's existence (or escape the
> dot in the path?) is the solution here, what do you think?
>
> Folders has one or more dot for name is so natural to me, cause I'm a
> Mac. :)
Yes, names with dots should be possible, I agree.
Regards
Felix