Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-21205

No link to the resource to get the URL aliases of a Location

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Duplicate
    • Affects Version/s: 5.1, 5.2-dev
    • Fix Version/s: None
    • Component/s: Platform > REST API v2
    • Labels:

      Description

      According to the specifications, in order to get the Url Aliases of a Location you are supposed to do a GET on /content/locations/<path>/urlaliases. Unfortunately, this URI is not referenced anywhere in the output of the REST API so you are forced to build it on the client side.

      This URI should be referenced in the application/vnd.ez.api.Location (ie the output of GET /content/locations/<path>)

        Issue Links

          Activity

          Hide
          Bertrand Dunogier added a comment -

          One "problem" with this, and I'm not sure I know how to work around it: the /content/locations/

          {locationPath}

          /urlaliases resource (https://github.com/ezsystems/ezpublish-kernel/blob/master/doc/specifications/rest/REST-API-V2.rst#132112list-urlaliases-for-location) accepts a custom parameter.

          This parameter will filter in what is returned by the resource:

          • true: manual/custom url aliases
          • false: automatically generated url aliases

          The default is false.

          We should probably include links to both custom=true / custom=false, shouldn't we ? How would this be materialized in the response ?

          Show
          Bertrand Dunogier added a comment - One "problem" with this, and I'm not sure I know how to work around it: the /content/locations/ {locationPath} /urlaliases resource ( https://github.com/ezsystems/ezpublish-kernel/blob/master/doc/specifications/rest/REST-API-V2.rst#132112list-urlaliases-for-location ) accepts a custom parameter. This parameter will filter in what is returned by the resource: true: manual/custom url aliases false: automatically generated url aliases The default is false. We should probably include links to both custom=true / custom=false, shouldn't we ? How would this be materialized in the response ?
          Hide
          Damien Pobel (Inactive) added a comment -

          good point indeed. Maybe, the RFC6570 might help here ? Or we might include both, something like:

          <?xml version="1.0" encoding="UTF-8"?>
          <Location media-type="application/vnd.ez.api.Location+xml" href="/api/ezp/v2/content/locations/1/2">
           <id>2</id>
           <priority>0</priority>
           <hidden>false</hidden>
           <invisible>false</invisible>
           <ParentLocation media-type="application/vnd.ez.api.Location+xml" href="/api/ezp/v2/content/locations/1"/>
           <pathString>/1/2/</pathString>
           <depth>1</depth>
           <childCount>6</childCount>
           <remoteId>f3e90596361e31d496d4026eb624c983</remoteId>
           <Children media-type="application/vnd.ez.api.LocationList+xml" href="/api/ezp/v2/content/locations/1/2/children"/>
           <Content media-type="application/vnd.ez.api.Content+xml" href="/api/ezp/v2/content/objects/57"/>
           <UrlAliasesCustom media-type="application/vnd.ez.api.UrlAliasRefList+xml" href="/api/ezp/v2/content/locations/1/2/urlaliases?custom=true"/>
           <UrlAliases media-type="application/vnd.ez.api.UrlAliasRefList+xml" href="/api/ezp/v2/content/locations/1/2/urlaliases?custom=false"/>
           <sortField>PRIORITY</sortField>
           <sortOrder>ASC</sortOrder>
          </Location>

          I tend to prefer the second solution.

          (note the default filter value is true which is a bit weird...)

          Show
          Damien Pobel (Inactive) added a comment - good point indeed. Maybe, the RFC6570 might help here ? Or we might include both, something like: <? xml version = "1.0" encoding = "UTF-8" ?> < Location media-type = "application/vnd.ez.api.Location+xml" href = "/api/ezp/v2/content/locations/1/2" > < id >2</ id > < priority >0</ priority > < hidden >false</ hidden > < invisible >false</ invisible > < ParentLocation media-type = "application/vnd.ez.api.Location+xml" href = "/api/ezp/v2/content/locations/1" /> < pathString >/1/2/</ pathString > < depth >1</ depth > < childCount >6</ childCount > < remoteId >f3e90596361e31d496d4026eb624c983</ remoteId > < Children media-type = "application/vnd.ez.api.LocationList+xml" href = "/api/ezp/v2/content/locations/1/2/children" /> < Content media-type = "application/vnd.ez.api.Content+xml" href = "/api/ezp/v2/content/objects/57" /> < UrlAliasesCustom media-type = "application/vnd.ez.api.UrlAliasRefList+xml" href = "/api/ezp/v2/content/locations/1/2/urlaliases?custom=true" /> < UrlAliases media-type = "application/vnd.ez.api.UrlAliasRefList+xml" href = "/api/ezp/v2/content/locations/1/2/urlaliases?custom=false" /> < sortField >PRIORITY</ sortField > < sortOrder >ASC</ sortOrder > </ Location > I tend to prefer the second solution. (note the default filter value is true which is a bit weird...)
          Hide
          Bertrand Dunogier added a comment -

          I agree about the default value being weird, I'd have expected the opposite.

          Note that there is an issue that references this RFC already: https://jira.ez.no/browse/EZP-20930.

          Show
          Bertrand Dunogier added a comment - I agree about the default value being weird, I'd have expected the opposite. Note that there is an issue that references this RFC already: https://jira.ez.no/browse/EZP-20930 .
          Hide
          Bertrand Dunogier added a comment -

          Duplicate from EZP-21312.

          Show
          Bertrand Dunogier added a comment - Duplicate from EZP-21312 .

            People

            • Assignee:
              Unassigned
              Reporter:
              Damien Pobel (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: