Skip to content

Extend Byline component with an image retrieved from an external service #1

@mgallecom

Description

@mgallecom

Task Overview

We want to extend the Byline component to render an image for each occupation authored in the component. For this we want to leverage the https://loremflickr.com/ API

API Description

Then Endpoint we want to use to retrieve the image is
https://loremflickr.com/json/g/320/240/[OCCUPATION]/all
Where the Occupation part of the path will be replaced by the authored string.
A JSON will be returned and the image link, that is part of the json will be value retrieved and used

Task Description

Create OSGi Service to call endpoint and return image link

  1. Make the service configurable, configurable values should be width,length of the image to be pulled and connection timeout
  2. Configure sensible defaults
  3. implement sensible error handling
  4. cover 50 % of the lines with unit tests (optional)

Adjust Byline Component Sling Model

  1. Inject your service into the model
  2. expose method to the HTL that retrieves an image link or links, depending on your approach
  3. cover the new lines with unit tests

Adjust byline HTL

  1. change the htl to render an image for each occupation authored in the component
  2. adjust the css to render images next to each other if more than one occupation is present

Notes

It is not expected for you to finish this task in time, we want to see what you focus on, and what your approach is.

for any questions reach out to m.galle@reply.com, I will answer you as immediate as possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions