Solved

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

Posted on 2004-03-23
23
1,249 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
  • 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
 
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 24

Expert Comment

by:HemanthaKumar
ID: 10658409
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

760 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now