Adding a dynamic image

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
Karl
New User
Posts: 8
Joined: Sat Oct 31, 2015 6:03 am
First Name: Karl
Last Name: Kappel
Company Name: Segmueller
State / Province: Outside Canada/USA
Country: Germany
Contact:

Adding a dynamic image

Post by Karl »

Hi,

I can display images located under profoundui http path (/www/profoundui/htdocs/) .
But how can I display images located somewhere in IFS (not within http path) or located
within smb path?

Karl
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Adding a dynamic image

Post by Scott Klement »

Since browsers retrieve files using the HTTP protocol, the "normal" behavior is to only retrieve files that are available to Apache. By default, this means files in the DocumentRoot (by default, that is the "htdocs" directory that you mention.) You can enable other directories by creating Aliases for them in your httpd.conf configuration file.

Files placed in Aliases or the htdocs file are available to everyone with no security. For that reason, it might be a good idea to use the pui.downloadURL() API instead of an Alias. With this API, you can use the PUIDNLEXIT exit program to control access to the files. This approach lets you access files anywhere in the IFS (including /QNTC for SMB access) without any need for an Alias.
http://www.profoundlogic.com/docs/pages ... d=13664291

A third method would be to use an http:// URL to retrieve the images from another server. If your images are hosted on another server, retrieving them this way has shown itself to be more reliable than using /QNTC.
Karl
New User
Posts: 8
Joined: Sat Oct 31, 2015 6:03 am
First Name: Karl
Last Name: Kappel
Company Name: Segmueller
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Adding a dynamic image

Post by Karl »

Thank You - this is what I am looking for, but it seems I do not use this API correctly.

I've set the 'image source' property Custom JavaScript Function to:
script: pui.downloadURL({ "id": "/home/username/test.gif", "contentType": "image/gif" });

The result is an URL like this - but no Image is shown:
http://systemname:8090/profoundui/%5Bobject%20Object%5D
User avatar
Glenn
Profound Logic Staff Member
Posts: 124
Joined: Mon Apr 14, 2014 4:08 pm
First Name: Glenn
Last Name: Hopwood
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: Adding a dynamic image

Post by Glenn »

Karl,

Have you setup your PUIDNLEXIT program described in the documentation? http://www.profoundlogic.com/docs/pages ... d=10092551

This program is used, as Scott mentioned, to allow your organization to control access to the requested resources.

Glenn
Karl
New User
Posts: 8
Joined: Sat Oct 31, 2015 6:03 am
First Name: Karl
Last Name: Kappel
Company Name: Segmueller
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Adding a dynamic image

Post by Karl »

>Have you setup your PUIDNLEXIT program described in the documentation?
Yes - I have compiled PUIDNLEXIT without changes, to allow all downloads.
The usage counter of PUIDNLEXIT ist still zero.
Must it be called within my application or is it called from PUI?
User avatar
Glenn
Profound Logic Staff Member
Posts: 124
Joined: Mon Apr 14, 2014 4:08 pm
First Name: Glenn
Last Name: Hopwood
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: Adding a dynamic image

Post by Glenn »

Karl,

The PUIDNLEXIT program is called by our runtime framework, you don't need to call it directly. Did you compile it into the same library that Profound UI is installed (default installation library is PROFOUNDUI)?

Also, does the image in fact exist in /home/username/test.gif?

Glenn
Karl
New User
Posts: 8
Joined: Sat Oct 31, 2015 6:03 am
First Name: Karl
Last Name: Kappel
Company Name: Segmueller
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Adding a dynamic image

Post by Karl »

>Did you compile it into the same library that Profound UI is installed
Yes - installation library is profound89 - I have compiled PUIDNLEXIT into library profound89 and into profoundui.

>Also, does the image in fact exist in /home/username/test.gif?
Yes - I have built as simple program - only show one picture.
The IFS path with the image is not within /www/profound89 and not within /www/profoundui.

Maybe I miss something with image properties in designer.
I have set image properties field - image source - field formatting - custom java script function:
script: pui.downloadURL({ "id": "/home/KAPPEL/3.gif", "contentType": "image/gif" });

Maybe You can provide a working example with image path not within http path.
User avatar
Glenn
Profound Logic Staff Member
Posts: 124
Joined: Mon Apr 14, 2014 4:08 pm
First Name: Glenn
Last Name: Hopwood
Company Name: Profound Logic Software
State / Province: Ohio
Country: United States
Contact:

Re: Adding a dynamic image

Post by Glenn »

Karl,

I think I may see the problem. You should put the text "script: pui.downloadURL({ "id": "/home/KAPPEL/3.gif", "contentType": "image/gif" });" directly into the 'image source' property not bound into the binding dialog.

I would do the following...
- right click on the 'image source' property and choose 'Remove Property Value'.
remove property.png
remove property.png (14.59 KiB) Viewed 2366 times
- type the script text above directly into the window next to the 'image source' property.
enter here.png
enter here.png (11.08 KiB) Viewed 2366 times
Try these steps and let me know if that works for you.

Glenn
Karl
New User
Posts: 8
Joined: Sat Oct 31, 2015 6:03 am
First Name: Karl
Last Name: Kappel
Company Name: Segmueller
State / Province: Outside Canada/USA
Country: Germany
Contact:

Re: Adding a dynamic image

Post by Karl »

>Try these steps and let me know if that works for you.
Thank You - it works.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests