Hi Wentao,

Yes, that should do it.


- Florian


Hi Florian,

So you mean the base URL string should be
"http://esbserver:1234/cmis/atom/{repositoryId}";?


Thanks
Wentao

-----Original Message-----
From: Florian Müller [mailto:f...@apache.org]
Sent: 2016, January 09 9:04 AM
To: dev@chemistry.apache.org
Cc: Lu, Wentao
Subject: Re: Filter to change org.apache.chemistry.opencmis.baseurl
does not work on opencmis bridge?

Hi Wentao,

Use the placeholder "{repositoryId}" in the base URL for the repository ID.


- Florian

On 09.01.2016 01:22, Lu, Wentao wrote:
Hi,

We are currently using opencmis-bridge 0.10. Based on corporate policy, all request to CMIS need to go through ESB servers. The high level data flow is: client->ESB->OpenCMIS-Bridge->CMIS Server

I am trying to add a filter for atompub to update the "org.apache.chemistry.opencmis.baseurl" with ESB base url, the code snip as below:

public void doFilter(ServletRequest request, ServletResponse response, final FilterChain chain) throws IOException,
            ServletException {

        // check for request header
        if (request instanceof HttpServletRequest) {
HttpServletRequest httpRequest = (HttpServletRequest)request;
              String esbURL = httpRequest.getHeader("ESBURL");
              if (esbURL != null) {
request.setAttribute("org.apache.chemistry.opencmis.baseurl", esbURL);
              }
        }

        // call next
        chain.doFilter(request, response); }

Web.xml as below
<filter>
              <filter-name>ESB</filter-name>
              <filter-class>mytest.ESBFilter</filter-class>
       </filter>
       <filter-mapping>
              <filter-name>ESB</filter-name>
              <servlet-name>cmisatom</servlet-name>
   </filter-mapping>

However, when I tested it with "ESBURL" header value "http://esbserver:1234/cmis/atom";, the returned url missed the repositoryid part. i.e. I send a request http://localhost:7001/cmis/atom and the result supposed to return all repositories href as below:

<app:workspace>
                                <atom:title>DevOS1</atom:title>
                                <app:collection
href="http://localhost:7001/cmis/atom/DevOS1/children?id=idf_0F1E2D3C-
4B5A-6978-8796-A5B4C3D2E1F0">
...........................
...........................
<app:workspace>
                                <atom:title>DevOS2</atom:title>
                                <app:collection
href="http://localhost:7001/cmis/atom/DevOS2/children?id=idf_0F1E2D3C-
4B5A-6978-8796-A5B4C3D2E1F0">
...................

But in fact, it returns

<app:workspace>
                                <atom:title>DevOS1</atom:title>
                                <app:collection
href="http://localhost:7001/cmis/atom/children?id=idf_0F1E2D3C-4B5A-69
78-8796-A5B4C3D2E1F0">
...........................
...........................
<app:workspace>
                                <atom:title>DevOS2</atom:title>
                                <app:collection
href="http://localhost:7001/cmis/atom/children?id=idf_0F1E2D3C-4B5A-69
78-8796-A5B4C3D2E1F0">
...................


Did I missed something?

Thanks
Wentao



________________________________
This email and its attachments are intended solely for the personal use of the individual or entity named above. Any use of this communication by an unintended recipient is strictly prohibited. If you have received this email in error, any publication, use, reproduction, disclosure or dissemination of its contents is strictly prohibited. Please immediately delete this message and its attachments from your computer and servers. We would also appreciate if you would contact us by a collect call or return email to notify us of this error. Thank you for your cooperation.
-BCHydroDisclaimerID5.2.8.1541


Reply via email to