Re: Outbound Link Mangling

2016-08-09 Thread Christopher Rockwell
Thanks very much for taking the time to respond. 

I have tried unchecking the Namespace Mangling option of the Resource Resolver 
Factory. I have a few observations. Unfortunately it did not fix the problem. 
Rendering of the link still was still rewritten removing the colon (:) and 
surrounding with _*_   The only change I noticed was that the authoring 
interface became usable as many AJAX requests became unresolved. For example, 
the sidekick no longer had components populated. The network tab in Chrome was 
full of 404 requests looking like 
this...http://localhost:4502/etc/designs/my-app/_jcr_content.0.json/ -> 404 . 
Checking Namespace Mangling again in the Resource Resolver Factory resolved 
that.

So it seems AEM might require Namespace Mangling to be enabled. Since disabling 
it did not fix the problem anyway, I will leave it enabled. Based on the 
description, Namespace Mangling should only affect the URI path, correct? But 
it apparently also rewrites hash fragments. IMO the description and 
documentation could be updated to reflect all parts of the URI affected by 
Namespace Mangling. Since disabling it did not 100% work, I feel there’s 
probably an issue there. The only apparent change was that incoming requests 
containing underscores (_jcr_content) were not resolved, however the filter 
rewriting links continued to mangle the namespaces in both the path and hash 
fragment.

Fortunately, I have found a workaround for this issue. Since the URI affecting 
us do not require a path, just deleting the slash works for us.

For example, 
https://emailgroup.signup.com/#group:this-group - > 
https://emailgroup.signup.com/_#group_this-group (NG)
https://emailgroup.signup.com#group:this-group  (OK)


> On Aug 9, 2016, at 10:00 AM, Steven Walters  wrote:
> 
> This is the namespace mangling feature in the Sling Resource Resolver
> Factory configuration:
> 
> 
> Namespace Mangling
> 
> Defines whether namespace prefixes of resource names inside the path
> (e.g. "jcr:" in "/home/path/jcr:content") are mangled or not. Mangling
> means that any namespace prefix contained in the path is replaced as
> per the generic substitution pattern "/([^:]+):/_$1_/" when calling
> the "map" method of the resource resolver. Likewise the "resolve"
> methods will unmangle such namespace prefixes according to the
> substituation pattern "/_([^_]+)_/$1:/". This feature is provided
> since there may be systems out there in the wild which cannot cope
> with URLs containing colons, even though they are perfectly valid
> characters in the path part of URI references with a scheme. The
> default value of this property if no configuration is provided is
> "true". (resource.resolver.manglenamespaces)
> 
> 
> As indicated in the description, the option is on by default, so
> turning it off should fix your issue here.
> 
> This is a feature that is meant for JCR namespaces appearing in paths,
> as they are prefixed by colons, such as "jcr:content" getting mangled
> into "_jcr_content" that is often seen in AEM content trees.
> As such, you may need to validate that turning this off isn't going to
> cause other issues in return.
> 
> On Tue, Aug 9, 2016 at 10:37 PM, Christopher Rockwell
>  wrote:
>> Hi all.
>> 
>> I’m having trouble with outbound links within AEM containing colons (:) 
>> within the URL hash. The problem seems to stem from Sling URL mangling. I 
>> created a Stackoverflow question with the details- see link below. I’m 
>> hoping folks on the list can take a look and provide some suggestions.
>> 
>> http://stackoverflow.com/questions/38752586/outbound-links-with-colon-in-hash-get-mangled
>>  
>> 
>> 
>> Thanks!
>> Chris Rockwell
>> University of Michigan
>> Web Services, Sr. Application Developer
>> cmroc...@umich.edu ,
>> 
>> 



Re: Call JSP Directly on Apache Sling

2016-08-09 Thread Jason Bailey
This really depends on what you mean by 'calling directly'

if you put a jsp file under the /apps directory. You are putting a file there. 
You can access that file directly as a file. If you are looking at accessing  
the functionality that the jsp provides, the servlet, you need to point to 
something that says 

1. compile that jsp over there that the meta data is aware of into a servlet
2. pass the arguments from the called object into that servlet

That's the whole basis of the sling design with the separation of logic and 
content that represents that logic. If you feel really compelled to do 
something where you want to put a jsp and then be able to call that as servlet 
from the location you put it, in my understanding, that would be a custom 
implementation where you would need to create your own extension or selector so 
that when you requested the jsp file it would be handled in the manner that you 
want.

-Jason


From: Júnior 
Sent: Tuesday, August 9, 2016 9:10 AM
To: users@sling.apache.org
Subject: Call JSP Directly on Apache Sling

Hi,

Is there any way to call a JSP directly on Apache Sling?

I'd like to call a JSP that is deployed on Apache Sling.

Any tips are welcome.

Thanks
--
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*


Re: Outbound Link Mangling

2016-08-09 Thread Steven Walters
This is the namespace mangling feature in the Sling Resource Resolver
Factory configuration:


Namespace Mangling

Defines whether namespace prefixes of resource names inside the path
(e.g. "jcr:" in "/home/path/jcr:content") are mangled or not. Mangling
means that any namespace prefix contained in the path is replaced as
per the generic substitution pattern "/([^:]+):/_$1_/" when calling
the "map" method of the resource resolver. Likewise the "resolve"
methods will unmangle such namespace prefixes according to the
substituation pattern "/_([^_]+)_/$1:/". This feature is provided
since there may be systems out there in the wild which cannot cope
with URLs containing colons, even though they are perfectly valid
characters in the path part of URI references with a scheme. The
default value of this property if no configuration is provided is
"true". (resource.resolver.manglenamespaces)


As indicated in the description, the option is on by default, so
turning it off should fix your issue here.

This is a feature that is meant for JCR namespaces appearing in paths,
as they are prefixed by colons, such as "jcr:content" getting mangled
into "_jcr_content" that is often seen in AEM content trees.
As such, you may need to validate that turning this off isn't going to
cause other issues in return.

On Tue, Aug 9, 2016 at 10:37 PM, Christopher Rockwell
 wrote:
> Hi all.
>
> I’m having trouble with outbound links within AEM containing colons (:) 
> within the URL hash. The problem seems to stem from Sling URL mangling. I 
> created a Stackoverflow question with the details- see link below. I’m hoping 
> folks on the list can take a look and provide some suggestions.
>
> http://stackoverflow.com/questions/38752586/outbound-links-with-colon-in-hash-get-mangled
>  
> 
>
> Thanks!
> Chris Rockwell
> University of Michigan
> Web Services, Sr. Application Developer
> cmroc...@umich.edu ,
>
>


Re: Call JSP Directly on Apache Sling

2016-08-09 Thread Júnior
Hi Jason,

Thanks for you reply.

By "calling directly" I mean to be processed as it was being called in a
web container. So the scriptlets and tags would be processed.

As I understood it correctly, I would need to have a servlet or component
that would be responsible for calling that JSP, right?

Thanks


2016-08-09 10:50 GMT-03:00 Jason Bailey :

> This really depends on what you mean by 'calling directly'
>
> if you put a jsp file under the /apps directory. You are putting a file
> there. You can access that file directly as a file. If you are looking at
> accessing  the functionality that the jsp provides, the servlet, you need
> to point to something that says
>
> 1. compile that jsp over there that the meta data is aware of into a
> servlet
> 2. pass the arguments from the called object into that servlet
>
> That's the whole basis of the sling design with the separation of logic
> and content that represents that logic. If you feel really compelled to do
> something where you want to put a jsp and then be able to call that as
> servlet from the location you put it, in my understanding, that would be a
> custom implementation where you would need to create your own extension or
> selector so that when you requested the jsp file it would be handled in the
> manner that you want.
>
> -Jason
>
> 
> From: Júnior 
> Sent: Tuesday, August 9, 2016 9:10 AM
> To: users@sling.apache.org
> Subject: Call JSP Directly on Apache Sling
>
> Hi,
>
> Is there any way to call a JSP directly on Apache Sling?
>
> I'd like to call a JSP that is deployed on Apache Sling.
>
> Any tips are welcome.
>
> Thanks
> --
> Francisco Ribeiro
> *SCEA|SCJP|SCWCD|IBM Certified SOA Associate*
>



-- 
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*


Outbound Link Mangling

2016-08-09 Thread Christopher Rockwell
Hi all. 

I’m having trouble with outbound links within AEM containing colons (:) within 
the URL hash. The problem seems to stem from Sling URL mangling. I created a 
Stackoverflow question with the details- see link below. I’m hoping folks on 
the list can take a look and provide some suggestions.

http://stackoverflow.com/questions/38752586/outbound-links-with-colon-in-hash-get-mangled
 


Thanks! 
Chris Rockwell
University of Michigan 
Web Services, Sr. Application Developer
cmroc...@umich.edu , 




Call JSP Directly on Apache Sling

2016-08-09 Thread Júnior
Hi,

Is there any way to call a JSP directly on Apache Sling?

I'd like to call a JSP that is deployed on Apache Sling.

Any tips are welcome.

Thanks
-- 
Francisco Ribeiro
*SCEA|SCJP|SCWCD|IBM Certified SOA Associate*