[ 
https://issues.apache.org/jira/browse/SLING-1198?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Róbert Csákány updated SLING-1198:
----------------------------------

    Attachment: MapEntry.patch

I've made a little modification in mapping. 
There are mapping parameter allowed (when you need dynamic virtual host to be 
mapped to pathes)
This patch detects the URL is templated or not, if isn't templated the normal 
behaviour is used.

Some information about the use of this patch:

- it's designed for internal redirects - other cases not wasn't tested
- I use with 1..1 mapping, so in Mappig there was only one internalredirect for 
the URL- other cases wasn't tested.

The usage:

If you define a @par(parname, regexp)@ in URL and the redirect URL, the 
resolver replace it to the given regexp, and when the URL matches replaces the 
parameter in the result.
CAUTION! All parameter have to defined in URL and PATH too.


Example:

match: ww...@par(2,\w+)@\...@par(1,\w+)@\.domain\.com
redirect: /home/@par(1,\w+)@/@par(2,\w+)@

The resolve of: www.var1.var2.domain.com/testpage.html will returns 
/home/var2/var1/testpage.html
The map of:  /home/var1/var2/testpage.html returns 
www.var2.var1.domain.com/testpage.html

Please review and test it, it works for me, but all comment and idea is help me 
to finish this patch.



> Allow mapping nodes to internet domains with template parameters
> ----------------------------------------------------------------
>
>                 Key: SLING-1198
>                 URL: https://issues.apache.org/jira/browse/SLING-1198
>             Project: Sling
>          Issue Type: New Feature
>          Components: Engine
>    Affects Versions: JCR Resource 2.0.2
>            Reporter: Róbert Csákány
>            Assignee: Felix Meschberger
>             Fix For: JCR Resource 2.0.4
>
>         Attachments: MapEntry.patch
>
>
> Sling should support hosting multiple domains, with different JCR roots.
> E.g.:
> http://www.domain1.com could map to /content/domain1.com
> http://www.domain2.com could map to /content/domain2.com
> While developing a website, the fully qualified domain might not be 
> available. Ideally, the mapping could be configured in a flexible way. One 
> option would be to maintain a set of regular expressions to match against 
> URLs. Each regexp would then match to a path in the JCR.

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

Reply via email to