PDA

View Full Version : First Test Session



becomcs
5 Jun 2007, 4:15 AM
Form :

jratcliff
6 Jun 2007, 6:16 AM
[QUOTE=becomcs;36752]Form :

mdm-adph
7 Jun 2007, 5:11 AM
* Action Bars
Yes, we definitely have plans to take an action bar (whether on a form or view) and turn it into an Ext.Toolbar. We'll probably start with just creating buttons/menus using the label and code defined in Designer. Later on we'll give developers the option for the code to read in and use the fonts/colors/etc. that are also defined in Designer.


I've created a script like this for my forms -- it just traverses the action bar DOM at loadtime and turns it into a toolbar. There's not a more elegant way to do that, is there?

jratcliff
7 Jun 2007, 5:32 AM
I've created a script like this for my forms -- it just traverses the action bar DOM at loadtime and turns it into a toolbar. There's not a more elegant way to do that, is there?

Not that I know of. Sounds like you have done what we are planning. I already have an agent that will return the dxl of a form or view (or a document if you want). My plan was to call that agent, passing in what I want dxl for, and then just traverse the actionbar element in the dxl and build a Toolbar. The one issue I have run into is with the NotesSteam class. If I associate it to a file on disk, and have my NotesDxlExporter send its output there, then all works fine. If I do not want to use a file on disk but just have the stream stay in memory, then I don't get all of the xml and thus it is not well-formed when it gets to the browser. Any ideas on that one?

mdm-adph
7 Jun 2007, 11:04 AM
Honestly, I haven't worked with NotesStream before -- don't want to lie and give you advice that doesn't make sense. However, what do you mean by "it's not well-formed?" Can you give me a quick example of what you're getting returned?

I've had nsf's where I've had to rebuild data server-side (XML, JSON) just so that I could have some legible data to JavaScript when it gets to the browser -- might be a case like that.

jratcliff
9 Jun 2007, 5:45 PM
Honestly, I haven't worked with NotesStream before -- don't want to lie and give you advice that doesn't make sense. However, what do you mean by "it's not well-formed?" Can you give me a quick example of what you're getting returned?

I've had nsf's where I've had to rebuild data server-side (XML, JSON) just so that I could have some legible data to JavaScript when it gets to the browser -- might be a case like that.

Hi mdm-adph,

This is what I get when trying to return the dxl of the People view in the Domino Directory:
http://www.openntf.org/extnd/names.nsf/($Ext.nd.NotesDxlExporter)?OpenAgent&type=view&value=People

It returns the full XML if I remove ALL of the actions:
http://www.openntf.org/extnd/names.nsf/($Ext.nd.NotesDxlExporter)?OpenAgent&type=view&value=PeopleTest

And here's the code for ($Ext.nd.NotesDxlExporter)

Sub Initialize
On Error Goto ErrHandler

Dim session As New NotesSession
Dim db As NotesDatabase
Dim docCtxt As NotesDocument

Dim nc As NotesNoteCollection
Dim noteDocument As NotesDocument
Dim noteForm As NotesForm
Dim noteView As NotesView
Dim noteOutline As NotesOutline

Dim sType As String ' document, form, view or outline
Dim value As String

Set db = session.CurrentDatabase
Set nc = db.CreateNoteCollection(False)
Call nc.BuildCollection

Set docCtxt = session.DocumentContext

Dim objQS As New QSParser
sType = objQS.GetQSVal("type")
value = objQS.GetQSVal("value")

Msgbox "sType=" + sType
Msgbox "value=" + value

Dim stream As NotesStream
Dim exporter As NotesDXLExporter

Set stream = session.CreateStream
Set exporter = session.CreateDXLExporter
exporter.OutputDOCTYPE = False

Select Case sType
Case "document" :
Set noteDocument = db.GetDocumentByUNID(value)
Call exporter.SetInput(noteDocument)
Case "form" :
Set noteForm = db.GetForm(value)
Call nc.Add(noteForm)
Call exporter.SetInput(nc)
Case "view" :
Set noteView = db.GetView(value)
Call nc.Add(noteView)
Call exporter.SetInput(nc)
Case "outline" :
Set noteOutline = db.GetOutline(value)
Msgbox noteOutline.Name
Call nc.Add(noteOutline)
Call exporter.SetInput(nc)
Case Else :
Exit Sub
End Select

Call exporter.SetOutput(stream)
Call exporter.Process

REM tell the browser it is getting xml
Print {content-type:text/xml;charset=utf-8}
Print stream.ReadText
Exit Sub

ErrHandler:
REM tell the browser it is getting xml
Print {content-type:text/xml;charset=utf-8}
Print "<?xml version='1.0' encoding='utf-8'?>"
Print "<error>" + "<line>" + Cstr(Erl) + "</line>" + "<number>" + Cstr(Err) + "</number>" + "<message>" + Error$ + "</message>" + "</error>"

End Sub

mdm-adph
11 Jun 2007, 7:15 AM
hmm -- I created an agent with this code, worked fine! (Mind if I put it to good use?) I still don't like the way that Domino, even in DXL output, does not nest actions that are contained within submenu action buttons into some kind of nested XML structure (instead, relying upon a simple forward slash in its name to signify a submenu action).

Could it be something wrong with that particular action that's causing the XML to go kaput? (The actual markup degenerates into 棕■■■轼흥ヒ廹㩶㗻■■�■ꪪ��တ at that point...)

EDIT:

You may have already found a solution to this, but how in the heck to you turn something like "@Command([FileSave]);" into the corresponding JavaScript function, for example...
_doClick('862572D80050AF21.c7d4d066a385c233862572eb004ef437/$V5ACTIONS/0.100', this, null) ...without letting the server do it for you? I've long thought that there was a method for generating that string it uses as a passing parameter, but I haven't yet figured it out.