Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Images shared by maintains are broken.
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Images shared by maintains are broken.
 Login/Join
 
Silver Member
posted
I am trying to include images in a maintain. The images are not stored in the application's directory but an images directory that will be shared with all application. When I add the image from the images directory by dragging and dropping it to the form and deploy the maintain the path that shows for the broken image is:

http://localhost/approot/images/philseal.gif

If I place the image in the application's directory and add the image using the image tool it works. In maintain the path changes to:

http://serverip/approot/appdir/philseal.gif

So not only does the directory change but so does how the server revers to itself. It replaces localhost with the servers IP. So when the IP is used the image appears but when it uses localhost it does not.

How can I resolve this so that all the images for my maintain can be in one directory?


---------------
Webfocus 7.7.1
WinServer 2008

This message has been edited. Last edited by: Kerry,
 
Posts: 41 | Registered: August 21, 2007Reply With QuoteReport This Post
Master
posted Hide Post
When I add an image to my form, after selecting it and clicking Finish, I get a prompt that says:
Before opening this file a copy must be made in the project directory.

This is why, when you run from inside the MDE, you should see the image and the property should be:
localhost/approot/appname/imagename

Then, when you use the deployment tool, whatever server/path that you use there should replace the localhost in the properties.

If you DO want to use one specific directory for all of the images, I recommend using a variable with an image path for the pictures. For example, in my code I have:
Compute Pic/a100 = '/approot/maintain/images/book.gif';
When I deploy / run Maintain resolves the variable and I see my image. In this way I can store the names in a database as well. The only drawback to this is that you don't see the images when developing in the MDE.

Mark
 
Posts: 658 | Location: New York | Registered: May 08, 2003Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Mark,
I find this hard to fathom. IBI has long advised putting image files in their own directory. And, we have successfully used Javascript files from a different directory in Maintain applications. Why should image files be any different ?

While writing a line of code, for each image, in all Maintains, may work, it feels like a workaround to me, and additional work.

Are you sure there isn't another way to get the MDE to write the correct URL for the images ?


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
 
Posts: 165 | Location: Detroit Metro | Registered: September 17, 2003Reply With QuoteReport This Post
Master
posted Hide Post
Dave
When you use the deployment tool, you select where the images get copied to. At that point Maintain replaces the current image path in the MNT file with whatever path you are assigning. If you have a specific directory on the server that you want your images to reside in, add that to your deployment scenario and the url should be taken care of automatically.

I just suggested the image path idea, because many of our clients like the idea of keeping that information in a database.

Mark
 
Posts: 658 | Location: New York | Registered: May 08, 2003Reply With QuoteReport This Post
Silver Member
posted Hide Post
quote:
If you have a specific directory on the server that you want your images to reside in, add that to your deployment scenario and the url should be taken care of automatically.


How is this done? I am only able to deploy to the application's directory. How do I specify another directory that's on the same level as the applications directory?


root
-my_app_dir
-other_app
-another_app
-images
 
Posts: 41 | Registered: August 21, 2007Reply With QuoteReport This Post
Master
posted Hide Post
When you are in a deployment scenario, all of the Application files are on the left, and the Available Servers are on the right. You should see your Webserver as:
Web/appname
Where appname is the name of the application you are deploying your resource files to. If you right click on the WEB server name you can select New Folder and add a subfolder there. If you drag your Image files to there, they will get placed there when deployed.

When you run, the image properties will point to the sub-directory.

Mark
 
Posts: 658 | Location: New York | Registered: May 08, 2003Reply With QuoteReport This Post
Silver Member
posted Hide Post
If I right click Web/appname and add images won't that create an images sub-directory in the appname directory. How is this going to point to the images directory on the same level as the appname directory?

-Root
--Images
--Appname
-----Images
 
Posts: 41 | Registered: August 21, 2007Reply With QuoteReport This Post
Master
posted Hide Post
The issue here is that the deployment tool only allows you to deploy resource files to one Web server path. To do what you are requesting would require the ability to deploy to multiple paths. We do allow you to deploy to a sub-directory, but not to a parallel one.

The only solution that I can offer you is to create an image path for each image. When you place the image on the form, use a variable to display its location. This variable can be hardcoded or come from a database.

I can submit your case as an NFR, but I do not know if we could add this functionality.

Mark
 
Posts: 658 | Location: New York | Registered: May 08, 2003Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Mark,

Let's say that the same directory structure is created in Dev. Studio, and on the Reporting server:

root (IBI/Apps)
-- Images
-- Scripts
-- Project1

And the 'Project1' paths in Dev Studio are set to the 'Images' and 'Scripts' directories, then images and Javascripts are inserted into a Maintain form.

The Images, Scripts, and Project1 projects would then be deployed to the Server separately.

Wouldn't the file paths be created properly when the Maintain app. in Project1 is deployed ?

If so, why not ?


Regards,
Dave

http://www.daveayers.com

WebFocus/Maintain 7.6.4-8
on Win2000 and 2003 Server
 
Posts: 165 | Location: Detroit Metro | Registered: September 17, 2003Reply With QuoteReport This Post
Master
posted Hide Post
Dave
When an image is placed on a form, it is copied into the project. When run locally, you will see that the image's properties are not from the directory that it was added from, but the current project. When we deploy to another server, if you deploy the images, the address / path is replaced with the server / path that you are deploying it to. The MDE only allows for one path at this point.

Now, there IS an option to NOT deploy the image, and ONLY use the path, but no way to redirect the URL to another image directory at this point. So, the only 2 ways I can think to accomplish this is to:

1) Edit the mnt file by hand before deployment. Replace the path to the image, and then at deploy time, do not deploy the image. If you don't deploy then the path that you hard-coded will be respected.

2) Use a variable with an image path when placing the image on the form.

Mark
 
Posts: 658 | Location: New York | Registered: May 08, 2003Reply With QuoteReport This Post
Master
posted Hide Post
We put everything in ibi_html/images and direct link it via url in the Top case of the Maintain. All the checkboxes and bullets and arrows get used in a dozen places so it's the most straightforward way to get a hold of everything we need from everywhere it's needed. We use the same images in focexecs that support the Maintain app and even on static pages so it keeps everything very simple and easy.

I suppose you could have a sensitive image that shouldn't be available to everyone but we haven't run into that yet.

This may not as slickey as it could be, but it is super-easy and super-dependable. We also never deploy them -- having multiple Maintains deploying the same file is NOT pretty if something has to change. Drop them there and link to them.

J.



 
Posts: 916 | Location: At the Mast | Registered: May 17, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Images shared by maintains are broken.

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.