Viewing of DXL files in Notes Client.

I have a requirement to be able to open an exported content of Notes email ( DXL ) to be opened uisng Notes Client. I used the DXLExporter class in Java/Corba toolkit  to create this file.

What/How do I make this file open using Notes Client( assuming Notes client recognizes the format, since it was exported ). Or are there any other ways that the I can view this exported DXL.
deepankar_das1Asked:
Who is Participating?
 
mbonaciConnect With a Mentor Commented:
For local calls:
- you don't need CORBA.
- the classpath must include Notes.jar (for local calls).
- path has to include Lotus\Notes dir.
- the interfaces in lotus.domino package are implemented in package lotus.domino.local.

The local calls require that the NotesThread class manages threads (because NotesThread extends java.lang.Thread to include special init and term codes for Domino.
You have three options to execute threads:
- through inheritance
- through the Runnable interface
- through the static methods

To avoid password prompt (when accessing through the Notes ID) create session like this:

Session s = NotesFactory.createSession((String)null, (String)null, "password" )

Note that the ID file through you access session is specified in KeyFileName variable in first Notes.ini in path.


Hope this helps,
mb¤
0
 
mbonaciCommented:
You used DXLExporter to create DXL file from Domino data (document).

The DXLImporter class converts DXL to Domino data. Use the createDXLImporter method in Session to create a DxlImporter object. Input to DxlImporter can be a String, Stream, or NotesRichTextItem object. Output is to a Database object.
The import operation constructs a list of note IDs for the newly imported notes. You can access these note IDs using the getFirstImportedNoteId and getNextImportedNoteId methods.

Here's an example of an agent that converts a DXL file into a newly created database:
import lotus.domino.*;
 
public class JavaAgent extends AgentBase {
 
  static DxlImporter importer = null;
 
  public void NotesMain() {
 
    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();
 
      // (Your code goes here) 
      // Get current database
      Database db = agentContext.getCurrentDatabase();
      // Get DXL file
      String filename = "c:\\dxl\\exporteddb.dxl";
      Stream stream = session.createStream();
      if (stream.open(filename) & (stream.getBytes() >0)) {
        // Create new database - replace if it already exists
        Database newdb = session.getDatabase(null, "imported");
        if (newdb.isOpen())
          newdb.remove();
        DbDirectory dbdir = session.getDbDirectory(null);
        newdb = dbdir.createDatabase("imported", true);
        newdb.setTitle("Imported");
        // Import DXL from file to new database
        importer = session.createDxlImporter();
        importer.setReplaceDbProperties(true);
        importer.setReplicaRequiredForReplaceOrUpdate(false);
        importer.setAclImportOption(
          DxlImporter.DXLIMPORTOPTION_REPLACE_ELSE_IGNORE);
        importer.setDesignImportOption(
          DxlImporter.DXLIMPORTOPTION_CREATE);
        importer.importDxl(stream, newdb);
      }
      else
        System.out.println(filename + " does not exist or is empty");
 
    } catch(Exception e) {
      e.printStackTrace();
      
    } finally {
      // Print importer log
      try {
        System.out.println(importer.getLog());
      } catch(Exception e) {e.printStackTrace();}
    }
  }
}

Open in new window

0
 
deepankar_das1Author Commented:
thanks for the inputs. But my question was how can a Notes client be automatically made to be launched when we click on a DXL file. I'm not sure if this is possible or not.

The reason why we need this is that the users don't want to just open the emails right there and not do this as a multi step process of
1. Creating a temp nsf file.
2. Importing all the DXL files into that database.
3. Now open Notes client and view the emails imported through DXL.

0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
mbonaciCommented:
I thought that your clients have Notes opened. Then you would develop e.g. action "Import DXL" in the Inbox folder, which the user would click and choose DXL file. That's it. You would, of course, convert dxl into docs and refresh the view/folder...

And although it would be the most practical solution, It can't be done the way you want - double click on dxl file in windows explorer.

Mb¤
0
 
mbonaciCommented:
And yes, the code was just example from Designer help, you wouldn't create db every time you import something, of course :)
0
 
Sjef BosmanGroupware ConsultantCommented:
Watch out when importing DXL: if there are Reader fields in the document you might not even see it after importing it!

If the mail is a plain text mail, so no crypting and no images, you might be able to find an XSLT-tool and a transformation xsl-stylesheet. Or you have to develop a transformation xsl-stylesheet. Not easy but doable. In that case you wouldn't even need Notes to view it, just a browser (if you translate the DXL to HTML).

There's another option, which would even allow you to get rid of the DXL: just forward the mail... :-))

By the way, if you double-click a .nsf database, Notes will automatically start and open that db.
0
 
deepankar_das1Author Commented:
I tried to use the code as specific above to import an DXL file into a newly created database. Note I'm running this on a separate box using the Java/Corba api. I get the following exception

NotesException: Disk i/o is a restricted operation
        at lotus.domino.NotesExceptionHelper.read(Unknown Source)
        at lotus.domino.NotesExceptionHolder._read(Unknown Source)
        at lotus.priv.CORBA.iiop.RepImpl.invoke(Unknown Source)
        at lotus.priv.CORBA.portable.ObjectImpl._invoke(Unknown Source)
        at lotus.domino.corba._IDxlImporterStub.importDxlStream(Unknown Source)
        at lotus.domino.cso.DxlImporter.importDxl(Unknown Source)

I did try to enable the flags to be able to run the restricted operations for the userId( Session is created uisng this Id) but did not change the behaviour.

I would appreciate any pointers.

Paresh
0
 
deepankar_das1Author Commented:
Here's the attachment showing the settings that I have on the server.
permissions.doc
0
 
Sjef BosmanGroupware ConsultantCommented:
Is it an agent? Try to set, in the Agent Properties box, the Runtime security level to 2 or 3.

Or where is your Java running? What permissions do you have on the system you're running your program on??
0
 
deepankar_das1Author Commented:
Not it is not an agent. My Java program is running on a Windows box as a service under Tomcat and I'm using the Java/Corba toolkit api's.
0
 
Sjef BosmanGroupware ConsultantCommented:
Did you try to add your username to the people allowed to run Unrestricted agents?
0
 
deepankar_das1Author Commented:
If I allow the user to "Run Unrestricted methods and operations" I get the following exception. Note this worked when I used Notes.jar through my service, as I also have the Notes client installed locally. But I don't want to use it since it prompts me during the runtime for password before importing the document. Whereas using the remote calls since my session is already established using an username/pasword I don't have this problem. Hence I'm using the remote calls to achive this.

NotesException: DXLImporter output object is invalid, uninitialized, or not explicitly declared and strongly typed
        at lotus.domino.NotesExceptionHelper.read(Unknown Source)
        at lotus.domino.NotesExceptionHolder._read(Unknown Source)
        at lotus.priv.CORBA.iiop.RepImpl.invoke(Unknown Source)
        at lotus.priv.CORBA.portable.ObjectImpl._invoke(Unknown Source)
        at lotus.domino.corba._IDxlImporterStub.importDxlStream(Unknown Source)

I'm using the DxlImporter as follows.
        .....
        // Import DXL from file to new database
        importer = session.createDxlImporter();
        importer.setReplaceDbProperties(true);
        importer.setReplicaRequiredForReplaceOrUpdate(true);
        importer.setInputValidationOption(DxlImporter.DXLVALIDATIONOPTION_VALIDATE_NEVER);
        importer.setAclImportOption(
                          DxlImporter.DXLIMPORTOPTION_REPLACE_ELSE_IGNORE);
        importer.setDesignImportOption(
                          DxlImporter.DXLIMPORTOPTION_CREATE);
        importer.importDxl(stream, newdb);
        .....

I'm using Notes 6.5 as the Domino Administrator Client.
0
 
deepankar_das1Author Commented:
Is it possible becuse this is a remote api its acutally trying to locate the database file on the server box where I'm connected when the
                            importer.importDxl(...)
is executed. This is something that I'm trying to execute locally on my Windows box where the database file is. Is my understanding right here??

If remote api's is not the one to use as the database exists locally,  how can I prevent the prompt for the password during the import operation which I get when I use the Notes.jar file.



0
 
Sjef BosmanGroupware ConsultantCommented:
Seems a complete copy/paste from the Help db to me, so it should work. What line does the execution stop at? The first one, at the createDxlImporter?
0
 
Sjef BosmanGroupware ConsultantCommented:
Aaaah, you're right, that isn't possible.  The database must reside on the server. The only way to use a local database would be through a Local Notes client, using the COM interface. Maybe it's possible via Java and the Lotus.NotesSession objects (not Domino.Notes), but that I don't know.
0
 
deepankar_das1Author Commented:
No as I indicated it happens when we exeucte the importer.importDxl(..) stmt. Could you please clarify the above question as well. There's no point looking into it if the remote calls will not work for local databases.

0
 
deepankar_das1Author Commented:
I undid the permission for "Run unrestricted methods and operations" due to the exception. Can you tell me what I need to set based on the attached document.
total-perms.doc
0
 
deepankar_das1Author Commented:
Sorry I missed you previous response. So now if I use the Notes.jar for which the import works, what settings do I need to have. Can I put somethings inside the notes.ini to not prompt for the password and proceed.
0
 
Sjef BosmanGroupware ConsultantCommented:
The password is required to allow the Notes-layer to access the server, by means of opening the ID-file. There is the possibility in COM to create a Session in combination with a name and a password, but whether that works for Java as well ... dunno.

I'm off now. I'll read the attachment tomorrow. Sorry (yawn).
0
 
deepankar_das1Author Commented:
I created the Session without specifying the userName and I did not see the prompt. Thanks for the help.
0
All Courses

From novice to tech pro — start learning today.