Page 1 of 1

inventory image link to CDN

PostPosted: Wed Jun 21, 2023 10:12 am
by JuiceyBrucey
Using 7.2.1 SR 16.
Is there currently any method of storing a link to an inventory image rather than blobbing it into the database?
My website CMS automatically loads image files into a CDN and then pulls them from there to display them. There can be anywhere up to 30 images per inventory item showing various angles or other info.
Is there currently provision for a similar concept in JIWA?
Thank you

Re: inventory image link to CDN  Topic is solved

PostPosted: Wed Jun 21, 2023 10:57 am
by Mike.Sheen
JuiceyBrucey wrote:Is there currently any method of storing a link to an inventory image rather than blobbing it into the database?


You can create a custom field and store the link in there if you don't want the image in the database.

JuiceyBrucey wrote:My website CMS automatically loads image files into a CDN and then pulls them from there to display them. There can be anywhere up to 30 images per inventory item showing various angles or other info.
Is there currently provision for a similar concept in JIWA?


The cleanest way to do this would be to have a custom table, which has 2 columns : InventoryID and the link. A plugin could display and allow edit of the values on a new tab in the inventory maintenance form. You might also want this plugin to add a route to the API to perform CRUD operations on the table for a given InventoryID - such that the CMS changes relating to images could easily be applied to the Jiwa system.

Or, you could come up with an inferred system - where your CDN is structured such that all images in a folder names the same Jiwa PartNo are the CDN images for that item - much simpler.

For instance, if your part was 1170, then a folder https://CDN.com/ProductImages/1170 would contain all the images related to the product. This way you don't have to do anything in Jiwa at all - but it'd be pretty easy to create a plugin to show on a tab of the Jiwa inventory maintenance form the images in that CDN folder if desired.

Re: inventory image link to CDN

PostPosted: Wed Jun 21, 2023 1:20 pm
by SBarnes
I have actually gone to the scenario of adding an extra table to Jiwa to hold the images and then added a tab to inventory maintenance to show the images as well as modifying the import to load in the images and then have custom routes to retrieve them but that was several days work to make it happen in 7.2.1.

One other option if you look at the ServiceStack's documentation, is that it supports virtual file systems, one option would be to use that and follow some sort of naming convention to the files on disk, that way you wouldn't even need to load them into a cdn and you could have the api serve them up.

Re: inventory image link to CDN

PostPosted: Wed Jun 21, 2023 1:37 pm
by Mike.Sheen
SBarnes wrote:that way you wouldn't even need to load them into a cdn and you could have the api serve them up.


That won't fill the same role as a CDN.

the N in CDN is Network - a copy of the files is kept in various global zones and which one serves the content depends on the geographical location of the requestor. So an Australian visitor gets it's files from an geographically close copy of the files, and a European visitor has a copy delivered from a copy close to them.

So, I don't think the virtual file system is a good fit here.

Re: inventory image link to CDN

PostPosted: Wed Jun 21, 2023 2:03 pm
by pricerc
Mike.Sheen wrote:
You can create a custom field and store the link in there if you don't want the image in the database.


Isn't there a now-unused Inventory field (Aux4?) that used to hold an image file name that you could use?

edit to add: this obviously won't work if you need more than one link per part...

Re: inventory image link to CDN

PostPosted: Wed Jun 21, 2023 2:05 pm
by SBarnes
The request is about multiple images per product

Re: inventory image link to CDN

PostPosted: Wed Jun 21, 2023 2:09 pm
by pricerc
SBarnes wrote:The request is about multiple images per product


I read Mikes "custom table, which has 2 columns : InventoryID and the link." before looking properly at the OP.

Re: inventory image link to CDN

PostPosted: Wed Jun 21, 2023 3:09 pm
by Mike.Sheen
SBarnes wrote:The request is about multiple images per product


It's a bit more than that

JuiceyBrucey wrote:My website CMS automatically loads image files into a CDN and then pulls them from there to display them

Re: inventory image link to CDN

PostPosted: Wed Jun 21, 2023 4:39 pm
by JuiceyBrucey
Thank you very much for replies. Much appreciated.

A plugin could display and allow edit of the values on a new tab in the inventory maintenance form


Is there any tutorials on how to do this?

I will work my way through and let you know which method proved to be the most practical.
Thanks again.

Re: inventory image link to CDN

PostPosted: Wed Jun 21, 2023 4:45 pm
by SBarnes
That's probably getting beyond a forum post, you could ask Jiwa to quote you on doing that here