Parent URL not resolving correctly

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Parent URL not resolving correctly

pctan
Hi,

My parent’s url under ‘associated resource’ is giving me an error. Is there something I need to configure? Please advise.

When I hover over  parent link (red circle), it shows: https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b

When I click on it, it gives me error (see below). The browser URL still shows https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b

I expected it to resolve to

https://data-uat.gns.cri.nz/metadata343/srv/eng/catalog.search#/metadata/ eb9f6170-7835-4438-9f02-348a4ea3212b <https://data-uat.gns.cri.nz/metadata343/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b>  (correct one)

[cid:image001.png@01D43653.2A960FD0]
Error:
{"error": { "message": "Metadata not found" , "class": "MetadataNotFoundEx" , "stack": { "at": "org.fao.geonet.services.metadata.Show Show.java line 122 #exec" , "at": "jeeves.server.dispatchers.ServiceInfo ServiceInfo.java line 227 #execService" , "at": "jeeves.server.dispatchers.ServiceInfo ServiceInfo.java line 142 #noTransactionExec" , "at": "jeeves.server.dispatchers.ServiceInfo ServiceInfo.java line 46 #access$000" , "at": "jeeves.server.dispatchers.ServiceInfo$1 ServiceInfo.java line 121 #doInTransaction" , "at": "jeeves.server.dispatchers.ServiceInfo$1 ServiceInfo.java line 118 #doInTransaction" , "at": "jeeves.transaction.TransactionManager TransactionManager.java line 73 #runInTransaction" , "at": "jeeves.server.dispatchers.ServiceInfo ServiceInfo.java line 115 #execServices" , "at": "jeeves.server.dispatchers.ServiceManager ServiceManager.java line 449 #dispatch" , "at": "jeeves.server.dispatchers.ServiceManager ServiceManager.java line 387 #dispatch" , "at": "jeeves.server.JeevesEngine JeevesEngine.java line 594 #dispatch" , "at": "org.fao.geonet.services.main.GenericController GenericController.java line 149 #dispatch" , "at": "jeeves.config.springutil.JeevesDispatcherServlet JeevesDispatcherServlet.java line 41 #access$001" , "at": "jeeves.config.springutil.JeevesDispatcherServlet$1 JeevesDispatcherServlet.java line 54 #doInTransaction" , "at": "jeeves.config.springutil.JeevesDispatcherServlet$1 JeevesDispatcherServlet.java line 51 #doInTransaction" , "at": "jeeves.transaction.TransactionManager TransactionManager.java line 73 #runInTransaction" , "at": "jeeves.config.springutil.JeevesDispatcherServlet JeevesDispatcherServlet.java line 48 #doDispatch" , "at": "org.geonetwork.http.SessionTimeoutCookieFilter SessionTimeoutCookieFilter.java line 89 #doFilter" , "at": "jeeves.config.springutil.PassthroughFilter PassthroughFilter.java line 50 #doFilter" , "at": "jeeves.config.springutil.MultiNodeAuthenticationFilter MultiNodeAuthenticationFilter.java line 125 #doFilter" , "at": "jeeves.config.springutil.JeevesDelegatingFilterProxy JeevesDelegatingFilterProxy.java line 104 #doFilter" } , "request": {} } }

-----------------------------------------------------------------------------------------------------
Peck Choo Tan I Analyst Programmer
GNS Science I Te Pῡ Ao
1 Fairway Drive, Avalon 5010, PO Box 30368, Lower Hutt 5040, New Zealand
Ph 04 570 4739 I Mob 021 2178684
http://www.gns.cri.nz/ | Email: [hidden email]


Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

image001.png (15K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

FW: Parent URL not resolving correctly

pctan
Hi,
The thing to note is that my application is also called metadata.

In Edit mode,

The parent link below (red circle)  is : https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b (error)

Can someone pls tell me where I can change this : https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b
to resolve correctly to
https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/ eb9f6170-7835-4438-9f02-348a4ea3212b <https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b>  ?
[cid:image001.png@01D43653.2A960FD0]


If you see the view page (below), the parent link is correct: https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/ eb9f6170-7835-4438-9f02-348a4ea3212b <https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b>
[cid:image002.png@01D43B18.E6BCBE10]

Any help will be appreciated. Thanks.

-----------------------------------------------------------------------------------------------------
Peck Choo Tan I Analyst Programmer
GNS Science I Te Pῡ Ao
1 Fairway Drive, Avalon 5010, PO Box 30368, Lower Hutt 5040, New Zealand
Ph 04 570 4739 I Mob 021 2178684
http://www.gns.cri.nz/ | Email: [hidden email]<mailto:[hidden email]>


Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

image001.png (15K) Download Attachment
image002.png (32K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FW: Parent URL not resolving correctly

Olivier Guyot
Hi,

The URL
https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b
should redirect you to
https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/
eb9f6170-7835-4438-9f02-348a4ea3212b,
that would be the role of the redirect rules defined here:
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml

The expected redirection is of type "permanent redirect" (the browser
receives a HTTP 301 code and the current URL is changed), but in your case
the URL is not changed and you receive a raw backend error from the Show
service
<https://github.com/geonetwork/core-geonetwork/blob/master/services/src/main/java/org/fao/geonet/services/metadata/Show.java>,
so I'd say the rewrite rule applied in your case is:
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml#L380-L388

Whereas the expected one would be:
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml#L276-L283

Before searching any further, could you please confirm which version of GN
you are using, and whether your urlrewrite.xml file is the same as the one
by default? Thanks.
--
*camptocamp*
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS


*Olivier Guyot*
Geospatial Developer
+33 4 58 48 20 28


On Thu, Aug 23, 2018 at 9:44 AM Peck-Choo Tan <[hidden email]> wrote:

> Hi,
> The thing to note is that my application is also called metadata.
>
> In Edit mode,
>
> The parent link below (red circle)  is :
> https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b
> (error)
>
> Can someone pls tell me where I can change this :
> https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b
> to resolve correctly to
> https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/
> eb9f6170-7835-4438-9f02-348a4ea3212b <
> https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b>
> ?
> [cid:image001.png@01D43653.2A960FD0]
>
>
> If you see the view page (below), the parent link is correct:
> https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/
> eb9f6170-7835-4438-9f02-348a4ea3212b <
> https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b
> >
> [cid:image002.png@01D43B18.E6BCBE10]
>
> Any help will be appreciated. Thanks.
>
>
> -----------------------------------------------------------------------------------------------------
> Peck Choo Tan I Analyst Programmer
> GNS Science I Te Pῡ Ao
> 1 Fairway Drive, Avalon 5010, PO Box 30368, Lower Hutt 5040, New Zealand
> Ph 04 570 4739 I Mob 021 2178684
> http://www.gns.cri.nz/ | Email: [hidden email]<mailto:[hidden email]>
>
>
> Notice: This email and any attachments are confidential and may not be
> used, published or redistributed without the prior written consent of the
> Institute of Geological and Nuclear Sciences Limited (GNS Science). If
> received in error please destroy and immediately notify GNS Science. Do not
> copy or disclose the contents.
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> GeoNetwork-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: FW: Parent URL not resolving correctly

pctan
Hi Oliver,

My GN version is 3.4.3. The urlrewrite.xml is the default one . I did not change anything in there.
See attached.

I made a discovery. If I change my application name to eg: ‘metadata343’ instead of ‘metadata’, my parent link resolves correctly.

So The URL https://data-uat.gns.cri.nz/metadata343/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b resolves correctly to https://data-uat.gns.cri.nz/metadata343/srv/eng/catalog.search#/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b,

So the redirect must have got confused with 2 ‘metadata’ in the same url.

Thanks.
Peck

From: Olivier Guyot [mailto:[hidden email]]
Sent: Thursday, 23 August 2018 9:10 PM
To: Peck-Choo Tan <[hidden email]>
Cc: [hidden email]
Subject: Re: [GeoNetwork-users] FW: Parent URL not resolving correctly

Hi,

The URL https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b should redirect you to https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b,
that would be the role of the redirect rules defined here:
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml

The expected redirection is of type "permanent redirect" (the browser receives a HTTP 301 code and the current URL is changed), but in your case the URL is not changed and you receive a raw backend error from the Show service<https://github.com/geonetwork/core-geonetwork/blob/master/services/src/main/java/org/fao/geonet/services/metadata/Show.java>, so I'd say the rewrite rule applied in your case is:
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml#L380-L388

Whereas the expected one would be:
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml#L276-L283

Before searching any further, could you please confirm which version of GN you are using, and whether your urlrewrite.xml file is the same as the one by default? Thanks.
--
camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS
Olivier Guyot
Geospatial Developer
+33 4 58 48 20 28


On Thu, Aug 23, 2018 at 9:44 AM Peck-Choo Tan <[hidden email]<mailto:[hidden email]>> wrote:
Hi,
The thing to note is that my application is also called metadata.

In Edit mode,

The parent link below (red circle)  is : https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b (error)

Can someone pls tell me where I can change this : https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b
to resolve correctly to
https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/ eb9f6170-7835-4438-9f02-348a4ea3212b <https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b>  ?
[cid:image001.png@01D43653.2A960FD0]


If you see the view page (below), the parent link is correct: https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/ eb9f6170-7835-4438-9f02-348a4ea3212b <https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b>
[cid:image002.png@01D43B18.E6BCBE10]

Any help will be appreciated. Thanks.

-----------------------------------------------------------------------------------------------------
Peck Choo Tan I Analyst Programmer
GNS Science I Te Pῡ Ao
1 Fairway Drive, Avalon 5010, PO Box 30368, Lower Hutt 5040, New Zealand
Ph 04 570 4739 I Mob 021 2178684
http://www.gns.cri.nz/ | Email: [hidden email]<mailto:[hidden email]><mailto:[hidden email]<mailto:[hidden email]>>


Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
GeoNetwork-users mailing list
[hidden email]<mailto:[hidden email]>
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork

urlrewrite.xml (19K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FW: Parent URL not resolving correctly

Olivier Guyot
Yes, OK, thanks for trying out changing the application name. I'm surprised
though, because I thought that the URL rewrite mechanism was supposed to
ignore the *context-path* (i.e. application name) when resolving regexps.

My impression is that this is a bug on the urlrewrite filter (external lib)
<https://github.com/paultuckey/urlrewritefilter> used by GN, but there may
be a workaround on the Geonetwork side of things.

If you don't mind opening an issue here
<https://github.com/geonetwork/core-geonetwork/issues> with the elements
above so this can be discussed and eventually fixed or acknowledged, that
would be great. Thanks a lot!
--
*camptocamp*
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS


*Olivier Guyot*
Geospatial Developer
+33 4 58 48 20 28


On Thu, Aug 23, 2018 at 3:12 PM Peck-Choo Tan <[hidden email]> wrote:

> Hi Oliver,
>
>
>
> My GN version is 3.4.3. The urlrewrite.xml is the default one . I did not
> change anything in there.
>
> See attached.
>
>
>
> I made a discovery. If I change my application name to eg: ‘metadata343’
> instead of ‘metadata’, my parent link resolves correctly.
>
>
>
> So The URL https://data-uat.gns.cri.nz/metadata343/srv
> /metadata/eb9f6170-7835-4438-9f02-348a4ea3212b resolves correctly to
> https://data-uat.gns.cri.nz/metadata343/srv/eng/catalog.search#
> /metadata/eb9f6170-7835-4438-9f02-348a4ea3212b,
>
>
>
> So the redirect must have got confused with 2 ‘metadata’ in the same url.
>
>
>
> Thanks.
>
> Peck
>
>
>
> *From:* Olivier Guyot [mailto:[hidden email]]
> *Sent:* Thursday, 23 August 2018 9:10 PM
> *To:* Peck-Choo Tan <[hidden email]>
> *Cc:* [hidden email]
> *Subject:* Re: [GeoNetwork-users] FW: Parent URL not resolving correctly
>
>
>
> Hi,
>
>
>
> The URL
> https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b
> should redirect you to
> https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/
> eb9f6170-7835-4438-9f02-348a4ea3212b,
>
> that would be the role of the redirect rules defined here:
>
>
> https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml
>
>
>
> The expected redirection is of type "permanent redirect" (the browser
> receives a HTTP 301 code and the current URL is changed), but in your case
> the URL is not changed and you receive a raw backend error from the Show
> service
> <https://github.com/geonetwork/core-geonetwork/blob/master/services/src/main/java/org/fao/geonet/services/metadata/Show.java>,
> so I'd say the rewrite rule applied in your case is:
>
>
> https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml#L380-L388
>
>
>
> Whereas the expected one would be:
>
>
> https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml#L276-L283
>
>
>
> Before searching any further, could you please confirm which version of GN
> you are using, and whether your urlrewrite.xml file is the same as the one
> by default? Thanks.
>
> --
>
> *camp**to**camp*
>
> INNOVATIVE SOLUTIONS
>
> BY OPEN SOURCE EXPERTS
>
> *Olivier Guyot*
>
> Geospatial Developer
>
> +33 4 58 48 20 28
>
>
>
>
>
> On Thu, Aug 23, 2018 at 9:44 AM Peck-Choo Tan <[hidden email]> wrote:
>
> Hi,
> The thing to note is that my application is also called metadata.
>
> In Edit mode,
>
> The parent link below (red circle)  is :
> https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b
> (error)
>
> Can someone pls tell me where I can change this :
> https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b
> to resolve correctly to
> https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/
> eb9f6170-7835-4438-9f02-348a4ea3212b <
> https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b>
> ?
> [cid:image001.png@01D43653.2A960FD0]
>
>
> If you see the view page (below), the parent link is correct:
> https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/
> eb9f6170-7835-4438-9f02-348a4ea3212b <
> https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b
> >
> [cid:image002.png@01D43B18.E6BCBE10]
>
> Any help will be appreciated. Thanks.
>
>
> -----------------------------------------------------------------------------------------------------
> Peck Choo Tan I Analyst Programmer
> GNS Science I Te Pῡ Ao
> 1 Fairway Drive, Avalon 5010, PO Box 30368, Lower Hutt 5040, New Zealand
> Ph 04 570 4739 I Mob 021 2178684
> http://www.gns.cri.nz/ | Email: [hidden email]<mailto:[hidden email]>
>
>
> Notice: This email and any attachments are confidential and may not be
> used, published or redistributed without the prior written consent of the
> Institute of Geological and Nuclear Sciences Limited (GNS Science). If
> received in error please destroy and immediately notify GNS Science. Do not
> copy or disclose the contents.
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> GeoNetwork-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>
> Notice: This email and any attachments are confidential and may not be
> used, published or redistributed without the prior written consent of the
> Institute of Geological and Nuclear Sciences Limited (GNS Science). If
> received in error please destroy and immediately notify GNS Science. Do not
> copy or disclose the contents.
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: FW: Parent URL not resolving correctly

pctan
Hi Olivier,

Thanks. I will do that. Thanks so much for your help. Appreciate it.
Peck

From: Olivier Guyot [mailto:[hidden email]]
Sent: Friday, 24 August 2018 1:29 AM
To: Peck-Choo Tan <[hidden email]>
Cc: [hidden email]
Subject: Re: [GeoNetwork-users] FW: Parent URL not resolving correctly

Yes, OK, thanks for trying out changing the application name. I'm surprised though, because I thought that the URL rewrite mechanism was supposed to ignore the context-path (i.e. application name) when resolving regexps.

My impression is that this is a bug on the urlrewrite filter (external lib)<https://github.com/paultuckey/urlrewritefilter> used by GN, but there may be a workaround on the Geonetwork side of things.

If you don't mind opening an issue here<https://github.com/geonetwork/core-geonetwork/issues> with the elements above so this can be discussed and eventually fixed or acknowledged, that would be great. Thanks a lot!
--
camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS
Olivier Guyot
Geospatial Developer
+33 4 58 48 20 28


On Thu, Aug 23, 2018 at 3:12 PM Peck-Choo Tan <[hidden email]<mailto:[hidden email]>> wrote:
Hi Oliver,

My GN version is 3.4.3. The urlrewrite.xml is the default one . I did not change anything in there.
See attached.

I made a discovery. If I change my application name to eg: ‘metadata343’ instead of ‘metadata’, my parent link resolves correctly.

So The URL https://data-uat.gns.cri.nz/metadata343/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b resolves correctly to https://data-uat.gns.cri.nz/metadata343/srv/eng/catalog.search#/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b,

So the redirect must have got confused with 2 ‘metadata’ in the same url.

Thanks.
Peck

From: Olivier Guyot [mailto:[hidden email]<mailto:[hidden email]>]
Sent: Thursday, 23 August 2018 9:10 PM
To: Peck-Choo Tan <[hidden email]<mailto:[hidden email]>>
Cc: [hidden email]<mailto:[hidden email]>
Subject: Re: [GeoNetwork-users] FW: Parent URL not resolving correctly

Hi,

The URL https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b should redirect you to https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b,
that would be the role of the redirect rules defined here:
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml

The expected redirection is of type "permanent redirect" (the browser receives a HTTP 301 code and the current URL is changed), but in your case the URL is not changed and you receive a raw backend error from the Show service<https://github.com/geonetwork/core-geonetwork/blob/master/services/src/main/java/org/fao/geonet/services/metadata/Show.java>, so I'd say the rewrite rule applied in your case is:
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml#L380-L388

Whereas the expected one would be:
https://github.com/geonetwork/core-geonetwork/blob/master/web/src/main/webResources/WEB-INF/urlrewrite.xml#L276-L283

Before searching any further, could you please confirm which version of GN you are using, and whether your urlrewrite.xml file is the same as the one by default? Thanks.
--
camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS
Olivier Guyot
Geospatial Developer
+33 4 58 48 20 28


On Thu, Aug 23, 2018 at 9:44 AM Peck-Choo Tan <[hidden email]<mailto:[hidden email]>> wrote:
Hi,
The thing to note is that my application is also called metadata.

In Edit mode,

The parent link below (red circle)  is : https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b (error)

Can someone pls tell me where I can change this : https://data-uat.gns.cri.nz/metadata/srv/metadata/eb9f6170-7835-4438-9f02-348a4ea3212b
to resolve correctly to
https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/ eb9f6170-7835-4438-9f02-348a4ea3212b <https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b>  ?
[cid:image001.png@01D43653.2A960FD0]


If you see the view page (below), the parent link is correct: https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/ eb9f6170-7835-4438-9f02-348a4ea3212b <https://data-uat.gns.cri.nz/metadata/srv/eng/catalog.search#/metadata/%20eb9f6170-7835-4438-9f02-348a4ea3212b>
[cid:image002.png@01D43B18.E6BCBE10]

Any help will be appreciated. Thanks.

-----------------------------------------------------------------------------------------------------
Peck Choo Tan I Analyst Programmer
GNS Science I Te Pῡ Ao
1 Fairway Drive, Avalon 5010, PO Box 30368, Lower Hutt 5040, New Zealand
Ph 04 570 4739 I Mob 021 2178684
http://www.gns.cri.nz/ | Email: [hidden email]<mailto:[hidden email]><mailto:[hidden email]<mailto:[hidden email]>>


Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
GeoNetwork-users mailing list
[hidden email]<mailto:[hidden email]>
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.
Notice: This email and any attachments are confidential and may not be used, published or redistributed without the prior written consent of the Institute of Geological and Nuclear Sciences Limited (GNS Science). If received in error please destroy and immediately notify GNS Science. Do not copy or disclose the contents.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork