I made a node, foo, mix:sharable. Copied foo to bar. I did NOT use
workspace.clone() as the spec said.
This CMS that I'm using comes with a gui repo browser. And, I could
not find .clone() functionality.

So, editing foo did not change bar. :P

I was too lazy to write up a Java program to clone the nodes.

In the end, I have:
/some/path/to/jpeg
/some/path/to/png
/some/path/to/gif
...

I just did not want to create png, gif... and other nodes. But it
seems to be inevitable.
(And, sling:alias won't do good even if it supported String[]
because.. it's complicated :)
Actually, something is callling
http://dev.day.com/content/docs/en/cq/current/javadoc/com/day/cq/commons/servlets/OverlayServlet.html
 and it does not consider sling:alias.

I mean.. actual requests are like:
GET /some/path/to/formitems.overlay.json/image/png.json

And, that OverlayServlet seems to test existance of
/some/path/to/image/png/formitems .. and if that does not exist, it
does some other things.

And, setting /some/path/to/image/j...@sling:alias=png  is not useful
when request is:
GET /some/path/to/image/png/formitems

(sling:alias seems to only work for basenames, or right most things.
GET /some/path/to/image/png is good. GET
/some/path/to/image/png/some/other/stuff   does not get resolved to
GET /some/path/to/image/JPEG/some/other/stuff)

I did not formulate my initial question well enough. I misled you. I'm sorry.

Anyway,  the problem is solved with /etc/map  redirects. :P

Thanks.
Sam


On Fri, Nov 5, 2010 at 3:55 PM, Justin Edelson <[email protected]> wrote:
> Was there some reason that shareable nodes didn't work? Or are you simply
> opposed to them because mix:shareable can't be removed?
>
> Multi-valued sling:alias support was added in SLING-1332 and will be in
> the next release of the JCR Resource bundle.
>
> Justin
>
> On 11/5/10 3:25 PM, "sam lee" <[email protected]> wrote:
>
>>Ah, Thank you. I see.
>>
>>I hope sling:alias could be String[]. Even if I set sling:alias =
>>{png, gif, tiff}.. only the first entry, png, is used.
>>
>>For example,
>>/some/path/jpeg (sling:alias = {png, gif, tiff})
>>
>>then,
>>GET /some/path/jpeg.json  ==> good
>>GET /some/path/png.json  ==> good
>>GET /some/path/gif.json     ==> bad
>>GET /some/path/tiff.json    ==> bad
>>
>>I ended up writing /etc/map config to redirect stuff to
>>/some/path/jpeg (according to
>>http://sling.apache.org/site/mappings-for-resource-resolution.html)
>>
>>I tried mix:shareable .. it was a nightmare since I did not back up
>>the node before setting mixin.. And it's impossible to remove
>>mix:shareable mixin :P
>>
>>SLING-1778 looks promising. I can't apply patches. I'm using Day CQ
>>and have to wait until they apply the patch to the sling they ship
>>with.
>>
>>Thanks.
>>Sam
>>
>>On Wed, Nov 3, 2010 at 10:02 AM, Justin Edelson
>><[email protected]> wrote:
>>> Hi...
>>>
>>> sling:alias only works within the same path segment, i.e. if
>>>
>>> /some/path/j...@sling:alias = jpg
>>>
>>> then you could request either /some/path/jpeg or /some/path/jpg and
>>> get the resource at /some/path/jpeg.
>>>
>>> JCR 2 Shareable Nodes might be a solution for you. Or take a look at
>>>SLING-1778.
>>>
>>> Justin
>>>
>>>
>>> On Tue, Nov 2, 2010 at 4:07 PM, sam lee <[email protected]> wrote:
>>>> Hey,
>>>>
>>>> I want:
>>>> GET /some/path/jpeg.tidy.infinity.json
>>>>
>>>> to be equivalent to:
>>>> GET /some/other/path/foo.tidy.infinity.json
>>>>
>>>> I tried:
>>>> /some/path/jpeg/sling:resourceType = /some/other/path/foo
>>>> and
>>>> /some/path/jpeg/sling:resourceSuperType = /some/other/path/foo
>>>>
>>>> but, the json returned by
>>>> GET /some/path/jpeg.tidy.infinity.json
>>>> is not same as the json returned by
>>>> GET /some/other/path/foo.tidy.inifinity.json
>>>>
>>>> Should I use something other than sling:resourceType ?
>>>> sling:alias?
>>>>
>>>> Thanks.
>>>> Sam
>>>>
>>>
>
>
>

Reply via email to