1
votes

I've been making a tool to create dummy documents on Lotus Notes using the Java API.

So far I've been successful creating the documents using the NotesFactory create session method

NotesFactory.createSession(serverUrl, username, password);

And later creating the document using the Database class createDocument() method.

However, regardless of the user I put when I'm creating the session, the created document always has "Administrator" as the document originator.

Is there any way to override this behavior?

EDIT 8/24/2016:

Here is the code I'm using to create documents

Session session = NotesFactory.createSession(serverUrl, username, password);

Database db = session.getDatabase(session.getServerName(), "docLibra.nsf");
Document doc = db.createDocument();

// Set document properties
doc.replaceItemValue("Subject", "Sample Subject");

RichTextItem bodyItem = doc.createRichTextItem("Body");
bodyItem.appendText("Sample content");
doc.save();
doc.recycle();
db.recycle();
session.recycle();

I created several users (i.e. user1, user2) and I'm able to get a Session with the credentials of those, but when the document is saved. The originator is set as Administrator, even tough the Administrator credentials are nowhere on the code and the code is executed on an external computer.

1
If you want to get a meaningful answer, you should provide more code, such as the code that you use to connect to Notes.Robin Daugherty
DIIOP? Or in an agent or so, running from the Notes client? And you are Administrator? That could explain things...D.Bugger

1 Answers

0
votes

Well, that means that your code is running under the identity of someone name "Administrator". That could be you, or the person who re-signed the code before allowing to run on the server. Get in touch with that person.

Now, what are you trying to do ? Impersonnating someone else ? On Domino ? No way.

Writing code that any user can run ? There are many ways.

Generating documents that can be read, or maybe modified, by all users or by a definite subset of them ? There are plenty of ways. Look for Access Control List, for the concept of Role, and for the special types of fields Author and Reader.