Solved

How to import files directly into image resources from a file server using LotusScript or LS2API...

Posted on 2004-03-23
23
1,274 Views
Last Modified: 2013-12-18
Hello Guys,

Here I am again.
I can only spend two days development on the project I'm working on, so i'll need your help to get the job done quickly.

The requirement is to import a whole HTML web site into a notes database with all HTML HREF tags staying what they are.

The html files pose no problem, this is just a question of importing them as plain text into a document with form property "treat document contents as HTML" and then reference them from a sorted view that mimics the directory where they are in.

Things are a bit more complicated for images and .svg files and the sort.
These I'd like to import as an image resource in the database with as image resource name the full path of the imported image.

Does anyone know how this can be done using LotusScript or LS2API?

I am working with R5.0.12 and an upgrade to R6.x is out of the question. Third party products are probably out of the question too as the budget for the project is very limited.

Any help and suggestions are welcome!

Kind regards,

JM
0
Comment
Question by:Jean Marie Geeraerts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 7
  • 3
  • +2
23 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10658014
Q&D solution: Dump all images etc. in one document, so you'd have db.nsf/view/doc/$File as a BASE
You can also use the images-directory as mentioned in the website-document in the NAB.

Do something like this anyway, if you have only 2 days...

Success!
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 10658124
I'm pretty quick as it comes to writing code once I know where to start.
In theory it shouldn't be too complicated to write this. In fact I think Lotus should have provided the possiblity to do this with script!
The problem with the BASE solution is that I would have to modify all the imported html documents in a pretty smart way as I import the complete code from <html> to </html> and manipulating text isn't that straight-forward in script either in R5.

I'll just see what other hints come in and see.

Thanks for the tip so far!
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10658128
Download this dll which can facilitate the import/export of image in IR

http://www.atom5.com/Development/IDEs-Coding-Utilities/image-resource-manager-5096.html

~Hemanth
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 300 total points
ID: 10658167
jerrith,

You could of course open each file, read line by line, and replace all links by new ones. I think we did this once, a long, long time ago. Worked for us. You have to walk through the HTML anyway, don't you?

Then you could choose to import every image in a separate Picture document, to be found in the Pictures-view, to be referenced as db.nsf/pictures/picname.gif/$File/picname.gif

Sjef
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 10658205
Hm, this will only link to the page to buy the full version.
Is it possible to download a trial version somewhere? It does look very cheap and I suppose management would consider paying for this, but I'd have to test and see if I can use it first.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10658215
Manipulating text is easy in LS: write your own Explode and Implode functions (don't call them like that, they do exist in R6 as Split and Implode). Pulling apart HTML the dirty way might not be the best way, but if the goal is to get the job finished in a short time...
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 10658221
You are right, Sjef.
Does the image resource have a limit as to the maximum number of images?
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 10658235
I already have StrImplode and strExplode functions that work exactly like @Implode and @Explode, so I could use those I guess.
The problem with me is I'm a bit of a perfectionist. I don't like Q&D solutions, even if I only have a limited time to write a solution :-)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10658332
It's the "pragmatic" way (I used to hate that word!)
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 10658367
Still have a day left, so I'll wait and see for the moment. If I can't find 'the perfect way' by then I'll go with the Q&D you suggested.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10658419
And a day is 24 hours? Piece of cake ;)
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 10658509
Hemanth, I'll look into the suggested links tomorrow. Thanks.

Sjef, no just 7.5 hours in a day here :-)
0
 
LVL 14

Accepted Solution

by:
p_partha earned 200 total points
ID: 10658769
Hi jerrith,
There are couple of ways to handle this, but the basic question that sjef already raised  why do u require it to be a part of image resource?, It can be a part of a document,

and also the XML tookit guide has provisions (the <imageresource> element). The full working (free) practical example is in codestore.. Have a look at it.

http://www.codestore.net/store.nsf/unid/EPSD-54VLYL?OpenDocument


Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10658950
Jupiter has days of 9.84 hours...
0
 
LVL 14

Expert Comment

by:p_partha
ID: 10658956
Sjef,
I want to work in jupiter then..

Partha
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 10659018
Looks interesting Partha. Unfortunately, doesn't look like I'll be able to implement this in the time frame give to me since I don't know anything about Java :(
Maybe in version 2.0 of the application when I've learned Java :)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 10659364
Partha,

They seem to have vacancies there. If you can cope with the pressure...
Better stay in the States.

Sjef :)
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 10667020
Pressure at work? Me? Naah, only problem is this is something I have to do "in between projects" and there's no budget for it, so I have to limit my time I spend on it to a maximum of two days, that's all :-)
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10672593
Assuming you had an images directory on the old server, so the files were referenced as <IMG SRC="/images/xyz.gif"> -- then you are almost home free!

1) Import multiple iamges at once into the database -- open the images screen in Designer, click NEW IMAGE RESOURCE, and select ALL the images.  Click OPEN, sit back, and wait.  Go get some coffee if there are many!

2) Define an HTTP redirect for the server -- /images/* -> /yourpath/yourdb.nsf/*
This will cause the server to redirect the browser to the correct image reosurce URL.  I think if you specify this as internal redirection, then there is almost NO penalty for doing it this way.
0
 
LVL 14

Expert Comment

by:p_partha
ID: 10672615
Jerrith,
I believe sjef was talking abt the pressure in jupiter :)..

I second qwal's idea, just to add to it, u can just use DOM and get all the images and change their src , which is fast and efficient


Partha
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 10676342
Hello qwalatee,

Import needs to be automated through an agent that runs on a daily basis, so doing it manual isn't an option. (I did this once, just to demonstrate the possibility of using the image resources for images).
The redirection is not necessary if I use as name for the image resource "images/image.jpg" for example.

Anyway, it looks like a colleague of mine has some C code lying around somewhere I could use, but he's not coming back until next week.

So this is definitely to be continued later :-)
0
 
LVL 8

Author Comment

by:Jean Marie Geeraerts
ID: 10721561
Hello guys,
Time to close up this question. The C code from my colleague was apparantly relying on some third party .dll's and management didn't like that either, so I decided to go with Sjef's bypass solution and import the images as file attachments and then change the URL reference to the file while importing the HTML files.
Thanks for all your input, guys!!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question