[jira] Created: (SLING-650) Support for vanity urls

2008-09-08 Thread Carsten Ziegeler (JIRA)
Support for vanity urls
---

 Key: SLING-650
 URL: https://issues.apache.org/jira/browse/SLING-650
 Project: Sling
  Issue Type: New Feature
  Components: JCR Resource
Affects Versions: JCR Resource 2.0.2
Reporter: Carsten Ziegeler
Assignee: Carsten Ziegeler
 Fix For: JCR Resource 2.0.4


It would be nice to have support for vanity urls: these are urls that do not 
directly point to a resource. Instead it is possible to give a resource a 
"pretty" (vanity) url which can be used to address this resource.
Example:
/a/b/x/y/myPage
You can either address this by /a/b/x/y/myPage or by /products

This can be done by adding a new mixin: sling:VanityUrl
which has two properties: vanityUrl (which has in the example above the value 
/products)
and redirect which is a boolean indication if a redirect should be done or if 
the content should
be directly displayed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.



Re: [jira] Created: (SLING-650) Support for vanity urls

2008-09-08 Thread Bertrand Delacretaz
On Mon, Sep 8, 2008 at 11:58 AM, Carsten Ziegeler (JIRA)
<[EMAIL PROTECTED]> wrote:

> ...This can be done by adding a new mixin: sling:VanityUrl
> which has two properties: vanityUrl (which has in the example above the value 
> /products)
> and redirect which is a boolean indication if a redirect should be done or if 
> the content should
> be directly displayed

Could we also use this to select the resource to display when / is accessed?

Currently we're setting a redirect URL on the root node for this, but
there might be several candidates for /, maybe in a priority order:
display the Sling default homepage, unless there's an application
homepage that has more priority, unless a script has been created to
show a menu of homepages and has more priority, etc.

What you suggest sounds good for this, except that we might need an
additional "priority" property, to be able to resolve conflicts
without having to ask users.

WDYT?

-Bertrand


Re: [jira] Created: (SLING-650) Support for vanity urls

2008-09-08 Thread Carsten Ziegeler
Bertrand Delacretaz wrote:
> 
> Could we also use this to select the resource to display when / is accessed?
Yes, this should work for this case as well

> 
> Currently we're setting a redirect URL on the root node for this, but
> there might be several candidates for /, maybe in a priority order:
> display the Sling default homepage, unless there's an application
> homepage that has more priority, unless a script has been created to
> show a menu of homepages and has more priority, etc.
> 
> What you suggest sounds good for this, except that we might need an
> additional "priority" property, to be able to resolve conflicts
> without having to ask users.
> 
Hmm, actually I've no real opinion here whether this is good or not.
Yes, we could add such a priority property - on the other hand if you
know that you have to set this property, you might also know that you
have to remove the url configuration from another node.

Carsten

-- 
Carsten Ziegeler
[EMAIL PROTECTED]


Re: [jira] Created: (SLING-650) Support for vanity urls

2008-09-08 Thread Bertrand Delacretaz
On Mon, Sep 8, 2008 at 1:59 PM, Carsten Ziegeler <[EMAIL PROTECTED]> wrote:

> Bertrand Delacretaz wrote:
>> ...What you suggest sounds good for this, except that we might need an
>> additional "priority" property, to be able to resolve conflicts
>> without having to ask users.
>>
> Hmm, actually I've no real opinion here whether this is good or not.
> Yes, we could add such a priority property - on the other hand if you
> know that you have to set this property, you might also know that you
> have to remove the url configuration from another node

The use case is:

-User starts with an "empty" Sling app -> gets default Sling homepage on /

-User loads a Sling-based application in the repository -> gets that
app's homepage on /, due to higher priority

-Use removes Sling-based app -> gets default Sling homepage again.

Using vanity URL priorities is not optimal, but it's useful in this
case and I'm not sure how to solve it otherwise.

-Bertrand


Re: [jira] Created: (SLING-650) Support for vanity urls

2008-09-08 Thread Carsten Ziegeler
Bertrand Delacretaz wrote:
> On Mon, Sep 8, 2008 at 1:59 PM, Carsten Ziegeler <[EMAIL PROTECTED]> wrote:
> 
>> Bertrand Delacretaz wrote:
>>> ...What you suggest sounds good for this, except that we might need an
>>> additional "priority" property, to be able to resolve conflicts
>>> without having to ask users.
>>>
>> Hmm, actually I've no real opinion here whether this is good or not.
>> Yes, we could add such a priority property - on the other hand if you
>> know that you have to set this property, you might also know that you
>> have to remove the url configuration from another node
> 
> The use case is:
> 
> -User starts with an "empty" Sling app -> gets default Sling homepage on /
> 
> -User loads a Sling-based application in the repository -> gets that
> app's homepage on /, due to higher priority
> 
> -Use removes Sling-based app -> gets default Sling homepage again.
> 
> Using vanity URL priorities is not optimal, but it's useful in this
> case and I'm not sure how to solve it otherwise.
> 
Yes, I see your point and adding the priority handling is easy as well,
it's just that I'm not sure about it :)

But yes, I'll add the priority handling and we can see how this works.

Carsten

-- 
Carsten Ziegeler
[EMAIL PROTECTED]