Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Saving a document on another server.

Posted on 2000-02-21
7
Medium Priority
?
231 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 206 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

972 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