[ 
https://issues.apache.org/jira/browse/JCR-4458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16895685#comment-16895685
 ] 

Woonsan Ko edited comment on JCR-4458 at 7/30/19 1:07 AM:
----------------------------------------------------------

Hi [~reschke],

I've submitted a new PR: https://github.com/apache/jackrabbit/pull/85
This PR solves the problem case described above with jackrabbit-boot, and it 
also makes all the integrationTesting scenarios* passed. The PR includes the 
servlet_path_prefix.patch in JCR-4460.

Basically, in the same way how 
{{org.apache.jackrabbit.webdav.WebdavRequestImpl#getHrefLocator(String, 
boolean)}} normalizes the _input_ href value by removing the contextPath prefix 
if found when creating a {{DavResourceLocator}}, the PR ensures every Report or 
Resource handling classes to normalize the _input_ href value from the input 
element when a {{DavResourceLocator}} needs to be created.
As Report handlers do not have an access to {{WebdavRequest}}, I ended up 
introducing {{WebdavRequestContext}} and {{WebdavRequestContextHolder}}, which 
are set and removed in {{AbstractWebdavServlet#service()}}, in order to get the 
contextPath.

Please review the PR.

Thanks,

Woonsan

-----
\* {{mvn clean install -PintegrationTesting}},
  {{mvn clean install -PintegrationTesting -DWebDAVServletPrefix=}}, 
  {{mvn clean install -PintegrationTesting -DWebDAVServletContext="/foo"}}



was (Author: woon_san):
Hi [~reschke],

I've submitted a new PR: https://github.com/apache/jackrabbit/pull/85
This PR solves the problem case described above with jackrabbit-boot, and it 
also makes all the integrationTesting scenarios* passed. The PR includes the 
servlet_path_prefix.patch in JCR-4460.

Basically, in the same way how 
{{org.apache.jackrabbit.webdav.WebdavRequestImpl#getHrefLocator(String, 
boolean)}} normalizes the _input_ href value by removing the contextPath prefix 
if found when creating a {{DavResourceLocator}}, the PR ensures every Report or 
Resource handling classes to normalize the _input_ href value from the input 
element when a {{DavResourceLocator}} needs to be created.
As Report handlers do not have an access to {{WebdavRequest}}, I ended up 
introducing {{WebdavRequestContext}} and {{WebdavRequestContextHolder}}, which 
are set and removed in {{AbstractWebdavServlet#service()}}, in order to get the 
contextPath.

Please review the PR.

Thanks,

Woonsan

-----
\* {{mvn clean install -PintegrationTesting}}, {{mvn clean install 
-PintegrationTesting -DWebDAVServletPrefix=}}, and {{mvn clean install 
-PintegrationTesting -DWebDAVServletContext="/foo"}}


> When JcrRemotingServlet deployed on non-root context, AclResource Webdav 
> request fails
> --------------------------------------------------------------------------------------
>
>                 Key: JCR-4458
>                 URL: https://issues.apache.org/jira/browse/JCR-4458
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>    Affects Versions: 2.18.2
>            Reporter: Woonsan Ko
>            Assignee: Julian Reschke
>            Priority: Major
>
> If {{org.apache.jackrabbit.server.remoting.davex.JcrRemotingServlet}} is 
> configured in a non-root web application, the contextPath of which is "/cms" 
> for example with the servletPath, "/server", then 
> {{javax.jcr.Session#importXML(...)}} fails from a JCR client based on 
> JCR/WebDAV. In other words, {{#importXML(...)}} fails from a JCR {{Session}} 
> using a repository which can be created like the following for JCR over 
> WebDAV:
> {code}
>     String repositoryAddress = "http://localhost:8080/cms/server";;
>     Jcr2davRepositoryFactory factory = new Jcr2davRepositoryFactory();
>     Map<String, String> params = new HashMap<String, String>();
>     params.put(JcrUtils.REPOSITORY_URI, repositoryAddress);
>     Repository repository = factory.getRepository(params);
>     // ...
> {code}
> It seems like that {{Session#importXML(...)}} call invokes an AclResource 
> Webdav request first on the specific resource path, but 
> {{org.apache.jackrabbit.webdav.jcr.version.report.JcrPrivilegeReport#init(DavResource,
>  ReportInfo)}} does not remove the contextPath, "/cms" for example, when 
> determining the resoucrePath.
> Unlike the {{JcrPrivilegeReport}}, 
> {{org.apache.jackrabbit.webdav.WebdavRequestImpl#getHrefLocator(String, 
> boolean)}} seems to remove the contextPath properly.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to