13
Views
5
Comments
App to display paintings from a external API

Hello


I tried this earlier and did not succeed but I want to try it again. 

I want to make a reactive website where I display paintings from the rijksmuseum in Amsterdam. 

So I have to make 3 calls to get the info, I think I can do that. 

I get 10 image of the 2700 back which I want to display on a screen but because I do not always get the same 10 images back I do not want to store them in a database.

But I like to have some sort of pagination whcih as I think now fetch the next 10 or the former 10.

and I think I need a "trick" because not all paintings have the same orientation some of them are horizonal oriented and some of them vertical.


Can I do this with outsystems ? 


Rank: #274

Sure this is possible. (but do check if you're allowed to "scrape" and show their info like this)

Is that service returning 10 random paintings each time? So you want to fetch them multiple times and store them in a database to have like a cache of 100 paintings for example? And you want the user to be able to go through them?

Technically that's all doable. With a gallery widget (or even a plain list with image widget) you can easily achieve this. It's just a matter of having your query and work with an index to have the pagination in place. 

Some documentation: https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Creating_and_editing_tables/Table_pagination_and_sorting

Use a List widget, with your query as source and then show an image.

https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Images/Display_an_Image_Stored_in_the_Database

And possibly also use the pagination widget:

https://outsystemsui.outsystems.com/OutSystemsUIWebsite/PatternDetail?PatternId=54

Rank: #1623

Thanks, 


Yep, that service is returning 10 random paintings all the time.

My idea was to show the 10 images on a page and make a pagination that calls the api again to show the next 10. Maybe a idea to store them in a database and use that as a sort of cache. The only thing that I then have to take care is that a painting is not stored multiple times in a database.

Making a cache means that a user sees the same 10 images on a page all the time. Now I think about I like that idea. So I have to find out how I can make it work that the code looks first in the database and if there is nothing there asked the api .

Rank: #274

Oh, my bad, I misread and thought you wanted to put them in the database.

Well, either solution is possible. When not using the database as cache, you can just work with the result of the api call directly. Use that as source of your List widget. It's even easier. Have a button on the screen to fetch some new ones. This would just be a refresh of your data fetch action, and done.

Off course, going back to the previous set of 10 would be a challenge...

Rank: #1623

yep, and without a database pagination also would be a challenge. I cannot make that part then work. 


First on the todo list.  Find out how I can make the three calls to the api to fetch all the data and store it in the database. 

Second on the list.  Find out how I can see if the paintings are already in the database , if not , fetch them

Rank: #1623

And I hope I can make this work with this : 

https://colorlib.com/preview/#thumber


or this layout 


https://colorlib.com/preview/#shutter


Roelof