inventory image link to CDN  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

inventory image link to CDN

Postby JuiceyBrucey » Wed Jun 21, 2023 10:12 am

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
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

Re: inventory image link to CDN  Topic is solved

Postby Mike.Sheen » Wed Jun 21, 2023 10:57 am

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: inventory image link to CDN

Postby SBarnes » Wed Jun 21, 2023 1:20 pm

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.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: inventory image link to CDN

Postby Mike.Sheen » Wed Jun 21, 2023 1:37 pm

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.
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: inventory image link to CDN

Postby pricerc » Wed Jun 21, 2023 2:03 pm

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...
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 504
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 20

Re: inventory image link to CDN

Postby SBarnes » Wed Jun 21, 2023 2:05 pm

The request is about multiple images per product
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: inventory image link to CDN

Postby pricerc » Wed Jun 21, 2023 2:09 pm

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.
/Ryan

ERP Consultant,
Advanced ERP Limited, NZ
https://aerp.co.nz
User avatar
pricerc
Senpai
Senpai
 
Posts: 504
Joined: Mon Aug 10, 2009 12:22 pm
Location: Auckland, NZ
Topics Solved: 20

Re: inventory image link to CDN

Postby Mike.Sheen » Wed Jun 21, 2023 3:09 pm

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
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756

Re: inventory image link to CDN

Postby JuiceyBrucey » Wed Jun 21, 2023 4:39 pm

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.
JuiceyBrucey
Frequent Contributor
Frequent Contributor
 
Posts: 132
Joined: Tue Aug 18, 2020 7:19 pm
Topics Solved: 1

Re: inventory image link to CDN

Postby SBarnes » Wed Jun 21, 2023 4:45 pm

That's probably getting beyond a forum post, you could ask Jiwa to quote you on doing that here
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1619
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 27 guests