tags:

views:

19

answers:

1

Hi,

How to create and add an Agent to an existing database using a Standalone java application. I am trying the option of importing it through DXL as mentioned in this article ,but no luck. Is there any way to achieve this?

Any help or links will be very much appreciated.

Code

  DxlImporter importer = session.createDxlImporter();

importer.setReplaceDbProperties(true); importer.setAclImportOption(DxlImporter.DXLIMPORTOPTION_REPLACE_ELSE_CREATE); importer.setDesignImportOption(DxlImporter.DXLIMPORTOPTION_CREATE); importer.setInputValidationOption(DxlImporter.DXLVALIDATIONOPTION_VALIDATE_ALWAYS);

try { importer.importDxl(getDXLContent(), db); System.out.println("Imported successfully"); } catch (Exception e) { System.out.println(importer.getLog()); }

DXL

Please refer the this article section "Add an agent into the existing database" for the DXL.

I am not getting any error. while I print the logs. But when I comment importer.setAclImportOption line, I am getting "Unknown element 'database'" and "Unknown element 'agent'" and so on...

Thanks & Regards,

Srinivas

A: 

Yes, provided that you have at least Designer ACL access to the database (which is required to create or edit any design note*) in the context of your Java program. Note that most rational deployments do not provide higher than Editor access in a production environment, except to a few administrative IDs. DXL is the easiest way to do it, since it only requires that you create the source code for the agent (other methods involve bytecode compilation, odd encodings and the creation and attachment of JARs).


*There is one exception, that being that an Editor with Create Views permissions will allow you to create view and folder design notes.

Stan Rogers
Hi Stan, This java program is a standalone application. Is it possible even through standalone application? I have Manager role attached to the database,but getting the error <error source='NotesInputSource' line='17' column='32' id='582'>You are not authorized to perform that operation</error> while running through standlone java application. But If i run the same code as Agent, it is importing successfully. Do you know other ACL which will allow to import from remote standalone java application? Any help will be appreciated.
Srinivas
Are you accessing Domino natively or via DIIOP? If DIIOP, you're restricted to the "maximum access for internet" settings in the ACL.
Stan Rogers
Hi Stan,I am using DIIOP. Can that be changed to allow DIIOP to import or export DXL remotely through Java program? I had the same issue for exporting design time element using DIIOP through standalone program. So is it something related to server settings?
Srinivas
Hi Stan, You are star!!!I have changed the ACL setting on the database and it resolved the issue. Now I could able to import the agent. But when I open the agent in designer, it says it is not signed. Can I sign the imported agent programatically using DIIO?
Srinivas
I haven't tried (and don't have a server handy) but I don't think so -- there isn't enough information on the Person document (just the public certificate). You could, though, run an agent using runOnServer() to sign the agent with the server ID. Obviously, there's a risk there, so you would have to restrict who can run the signing agent. ACLs, ECLs and Readers/Authors fields are real; all else is an illusion of security.
Stan Rogers
No problem. But is there a better way of accessing and exporting design time content of any application/databases of a server using DIIOP?
Srinivas