views:

33

answers:

1

Hi,

I am writing java application which will export the design time data of forms and views of a Notes application in DXL XML format.So I am using Notes java API createDXLExporter to export. But it is not returning any data about forms or views. Below is the code snippet

NoteCollection nc = database.createNoteCollection(false);
nc.setSelectForms(true);
nc.buildCollection();

System.out.println("Count "+nc.getCount());
String xml = exporter.exportDxl(nc);
System.out.println(xml);

The output XML is

**Count 7**
 <database xmlns='http://www.lotus.com/dxl' version='8.5' replicaid='8025776D0027BB2F' path='MyApp.nsf' title='MyApp' fromtemplate='StdR4Billing' usejavascriptinpages='false' showinopendialog='false' advancedtemplate='true'> <databaseinfo dbid='8025776D0027BB2F' odsversion='43' diskspace='393216' percentused='98.4375' numberofdocuments='0'><datamodified><datetime dst='true'>20100727T081400,71+01</datetime></datamodified><designmodified><datetime dst='true'>20100727T232343,35+01</datetime></designmodified></databaseinfo></database>

I am not seeing any forms desing data in it,even though the collection count is printed as 7.

Any Idea what I am missing? I am running this as a standalone java application.

Thanks and Regards, Srinivas

A: 

I just tried something similar using LotusScript and I can't reproduce the problem you're having. Perhaps there's something below that is missing in your code? I borrowed most of this from the examples in the docs.

Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.CurrentDatabase

'This is similar to your first snippet...
Dim nc As NotesNoteCollection
Set nc = db.CreateNoteCollection(False)
nc.SelectForms = True
Call nc.BuildCollection()

'Used to output the resulting DXL
Dim stream As NotesStream
Set stream = s.CreateStream
filename$ = "c:\temp\" & Left(db.FileName, Len(db.FileName) - 3) & "xml"
If Not stream.Open(filename$) Then
    Messagebox "Cannot open " & filename$,, "Error"
    Exit Sub
End If
Call stream.Truncate

'This is similar to your second snippet.  
'Here the example in the docs used a stream to 
'output the xml, and that was triggered by the Process method.
Dim exporter As NotesDXLExporter
Dim xml As String
Set exporter = s.CreateDXLExporter(nc, stream)
xml = exporter.Export(nc)
Call exporter.Process

Dim fileNum As Integer
Dim fileName2 As String
fileNum% = Freefile()
fileName2$ = "c:\temp\xml.txt"

'output the xml string similar to what you've done.  
'it checked out fine.
Open fileName2$ For Output As fileNum%
Print #fileNum%, xml
Close fileNum%
Ken Pespisa
Hi Ken, Thanks for posting the sample. Is this running locally within Notes environment. I think the difference is Java app is running standalone app, so similar to running remotely. Do you this could be problem?Regards,Srinivas
Srinivas
That's a good thought. If you want to rule out the stand-alone vs. local difference, then perhaps you could put the Java app code into a Notes Java Agent. But your point brings up another thought - the security context you're in. Perhaps the user your app is authenticated as does not have enough rights to the database? I suppose if the user didn't have rights to view all the forms, it might just leave the information out of the XML file as you're app is experiencing.
Ken Pespisa