Solved

Saving a document on another server.

Posted on 2000-02-21
7
223 Views
Last Modified: 2013-12-18
I am currently creating an agent that will save the document on another server and database. This agent is being called whenever the user clicks on the button.The document is a web page.The web page is on server A, what I want is when the user clicks on the button on the webpage, the document is saved on server B. The agent is shown below, but it does not seem to work.I use $$QuerySaveAgent to trigger the agent.
And also when should this agent run and which document should it act on?
'-----------------------------------
Sub Initialize
   Dim session as New notesession
   Dim doc as notesdocument
   Dim db as New notesdatabase("serverb","test.nsf")
Set db=session.currentdatabase
 Dim newdoc as notesdocument
set newdoc = New notesdocument(db)
set doc = session.documentcontext

Call doc.copyallitems(newdoc)
Call newdoc.save(True,False)
End Sub
_____________________________________















0
Comment
Question by:Barkley
7 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2546290
Hi You are missing something in this code, the code should be like this

Sub Initialize
   Dim session as New notesession
   Dim doc as notesdocument
   Dim tgtdb as New notesdatabase("serverb","test.nsf")
Set db=session.currentdatabase
 Dim newdoc as notesdocument
set newdoc = New notesdocument(tgtdb)
set doc = session.documentcontext

Call doc.copyallitems(newdoc)
Call newdoc.save(True,False)
End Sub

PS:The db handle is overridden by the currentdatabase statement, I have created a new tgtdb to represent the foreign database


Good Luck
~Hemanth
0
 

Author Comment

by:Barkley
ID: 2549197
Yes Hemanth you are right the db should be different, I made some changes on the code so it would work on Notes, and it worked.But when I used the above code on the browser, it did not work.I think this method:
Call doc.copyallitems(newdoc)
Call newdoc.save(True,False)
does not work on browsers.Could you help me on what method will I use so that the document will be saved on a separate server and database?
Thanks a lot.
0
 

Author Comment

by:Barkley
ID: 2552842
Adjusted points to 103
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 2598898
Hi

Use CopyToDatabase method of NotesDocument, but u may have to save the currentdoc in the currentdatabase and remove it after it is copied to another database.

Good Luck
~Hemanth
0
 
LVL 3

Expert Comment

by:Simon_Hendry
ID: 2598978
Using this code on a browser will not work... From a background agent ( which is what the code is when it runs after you submit a form via a browser )  you cannot directly store documents in a non-local database.. You would have to store it locally and then replicate it to the other server.

So

   Sub Initialize
   Dim session as New notesession
   Dim doc as notesdocument
   Dim tgtdb as New notesdatabase("","test.nsf")
   Dim newdoc as notesdocument

   Set db=session.currentdatabase
   Set newdoc = New notesdocument(tgtdb)
   set doc = session.documentcontext

   Call doc.copyallitems(newdoc)
   Call newdoc.save(True,False)
   Call  tgtdb.Replicate("SERVERB")

   End Sub
0
 

Author Comment

by:Barkley
ID: 2606739
I created a lotuscript agent triggered from a browser, what it does is save the document directly to the other server. From the log file, it stated that you are not allowed to save a document from another server and database. We are thinking of using Java to do this. If we use Java, we can have servlets on each server and these servlets can pass data to each other whenever a document is being saved.We are still doing a research on Java RMI. Need help on this one. Thank you very much for your help.
0
 

Accepted Solution

by:
ysriprak earned 103 total points
ID: 2618395
Let your destination database to be MainIn Database, and send you document from front end to destination by mail.
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Lotus notes "Estimate" form to Quickbooks invoice 2 355
Lotus Notes Mail Database issues 2 926
Lotus Domino Server Failure 1 182
DIIOP IP Addresses Changes Automatically 5 84
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

773 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