PDA

View Full Version : Alpha 2: Get View Action Bar working?



Episode1
25 Jul 2007, 5:31 AM
Hello,

I'm just trying to get Alpha 2's new feature View Action Bars working. Is there anything I have to modify? I have a simple "@Compose" action (visible in notes & web) in my view, but it will not display!? I'm working on 6.54 Domino Server.

Harald

bhaidaya
25 Jul 2007, 8:34 AM
Couldn't get it working either..

javascript actions work though

jratcliff
25 Jul 2007, 9:40 AM
Hello,

I'm just trying to get Alpha 2's new feature View Action Bars working. Is there anything I have to modify? I have a simple "@Compose" action (visible in notes & web) in my view, but it will not display!? I'm working on 6.54 Domino Server.

Harald

Yes, for Alpha 2, only javascript actions work in views. However, javascript AND @formula actions should work in forms.

For forms, we can take the actionbar domino generates (if set to display as html) and convert it into an Ext.Toolbar. Domino has already done the work for us of converting the @formulas into either an href or a javascript call that does a post back to the server.

For views, since we are creating them by doing a ?ReadViewEntries, we don't have access to the domino 'converted' actionbar and are, instead, pulling that info from the dxl (via an agent since ?ReadDesign doesn't give us that info). So.... what we need to do is come up with a way to convert these @formulas ourselves. Much like what domino does on the form. Or, we can do a separate call to ?OpenView to get the domino generated action bar and convert it like we are doing for forms.

We'll figure something out soon. :)

Zakaroonikov
25 Jul 2007, 3:39 PM
I have had success with the ?OpenView method and using the following code in your UIView.
What it does it inject the toolbar of the grid panel with the first table found in a ?OpenView ajax request. If found you can use the containerEl to parse for the table actions using the Ext.nd code.

Call with: (I placed thing use the creation of the paging toolbar)


this.jcwCreateToolbar(this.grid.getView().getHeaderPanel(true));


/**
* Inject into grid panel header first table from ?OpenView HTTP Get then create actionbar if it exists
* @param {Ext.Element} tbEl Element to put toolbar onto
* @return {Ext.Toolbar} Toolbar containing actions & filter
*/
jcwCreateToolbar : function (tbEl) {
tbEl.addClass('x-tabs-strip-wrap'); // JCW - Add background image to paging toolbar
if (this.uiContainer) {
var uiNode = Ext.getDom(this.uiContainer);
if(uiNode)
var parentNode = uiNode.parentNode; // Get parent node of content
}

Ext.Ajax.request({method: 'GET', url: this.viewUrl, params: 'OpenView&Count=0', // Don't get any data to speed up process
success: function (response) {
var re = /(?:<table([^>]*)?>)((\n|\r|.)*?)(?:<\/table>)/ig;
var html = response.responseText;
var match, match1;
match = re.exec(html);
if(match) {
var containerEl = Ext.DomHelper.append(tbEl, {tag : 'div', style : 'display: none'}, true);
if(containerEl)
containerEl.update(match[0]);
var hrEl = Ext.DomHelper.append(containerEl, {tag : 'hr'});
.....
***** DO SOMETHING WITH THE NODE HERE ****
.....
}
},
scope: this});
},


Yes, for Alpha 2, only javascript actions work in views. However, javascript AND @formula actions should work in forms.

For forms, we can take the actionbar domino generates (if set to display as html) and convert it into an Ext.Toolbar. Domino has already done the work for us of converting the @formulas into either an href or a javascript call that does a post back to the server.

For views, since we are creating them by doing a ?ReadViewEntries, we don't have access to the domino 'converted' actionbar and are, instead, pulling that info from the dxl (via an agent since ?ReadDesign doesn't give us that info). So.... what we need to do is come up with a way to convert these @formulas ourselves. Much like what domino does on the form. Or, we can do a separate call to ?OpenView to get the domino generated action bar and convert it like we are doing for forms.

We'll figure something out soon. :)

Episode1
26 Jul 2007, 3:29 AM
I'm sorry, but in my environment I still do not see any view action, even if I try to call a simple JavaScript alert action.

It seems that there is an empty default action, but this appears also without having any action defined for the view... (see attachment).

jratcliff
26 Jul 2007, 11:41 AM
I'm sorry, but in my environment I still do not see any view action, even if I try to call a simple JavaScript alert action.

It seems that there is an empty default action, but this appears also without having any action defined for the view... (see attachment).

Poor documentation!! That's it! :(

I see that in the "Using Database" document I forgot to mention that you need to include this Agent in your database:

($Ext.nd.NotesDXLExporter)

This is the agent that retrieves the dxl for a view. In this dxl is the information we need for the actions. It would have been nice for IBM to have included action info in the ?ReadDesign call but they didn't and thus our need for the agent.

Let me know if this fixes it for you.

Episode1
26 Jul 2007, 11:41 PM
Now it work, thank you :) but... only the first time :-?

When I navigate to a different view or recall the same view with my outline, then my actions disappear.

jratcliff
27 Jul 2007, 7:10 AM
Now it work, thank you :) but... only the first time :-?

When I navigate to a different view or recall the same view with my outline, then my actions disappear.

Hmm :-? I haven't noticed that behavior before. I'll take a look at it this afternoon.

~JR

Episode1
15 Aug 2007, 12:12 AM
I've tested a littel bit more with Alpha2Rev1 and realised, that the problem only occurs, when I use '($Ext.nd.ViewAndFolderList)' in my $$ViewTemplateDefault. When I use my own outline, then everithing works fine; with '($Ext.nd.ViewAndFolderList)' the action bar is only shown once...

BTW. In my opinion the ext.nd framework together with the ext library is a chance to keep Lotus Domino alive... great approach and I hope, that it's not too late, because...:

Here in my company we have got large suvey together with microsoft: "How to migrate our Domino environment (more then 100 servers world-wide and about 4000 different Lotus Notes Client applications) into the microsoft world." The target platform should be .NET Development, Sharepoint, Office System 2007, Infopath or if it fits SAP... Of course it will cost a lot of money, but the IT-strategy wants a clean environment SAP/Microsoft... Perhaps with this framework we can hide Domino with web-enabled applications from our strategy?

Are there any plans to make the ext.nd framework commercial? I could imagine, that we would pay for a suported server license of the framework... perhaps collecting money could speed up the development process of the framework? Are there enough potential buyers?

RWaters
15 Aug 2007, 7:18 AM
Are there any plans to make the ext.nd framework commercial? I could imagine, that we would pay for a suported server license of the framework... perhaps collecting money could speed up the development process of the framework? Are there enough potential buyers?

We've been asked a few times now about commercial plans. We're still looking to stick to a similar setup as Ext and offer commercial licensing and some form of premium support. Details have yet to be worked out, we'll be sure to let you know.

Milos Lapis
13 Sep 2007, 7:49 AM
Hello,

I tried to install and test a basic demo of Ext.ND (just one view) and I had also a problem with View Actions. They displayed only for the first time (manually entered URL) but not after clicking on a left navigation outline (just one view in db).

After some debuging I think that the reason is in the following fragment of LotusScript agent code ($Ext.nd.NotesDXLExporter):

Case "view" :
----> Set noteView = db.GetView(sName) <------
Call nc.Add(noteView)
noteID = nc.GetFirstNoteId
Set noteDocument = db.GetDocumentByID(noteID)
Call exporter.SetInput(noteDocument)

Why? In runtime, the parameter "sName" contains UNID of the view and not the name of it and it can not work of course. When you use your own outline design element than the parameter contains really the "name" of the view.

It means that when default outline "($Ext.nd.ViewAndFolderList)" is used, Domino returns DXL code:

<?xml version="1.0" encoding="UTF-8"?>
<outlinedata>
<outlineentry position="2" level="0" type="2" url="/Demo/extnd.nsf/a0b665faa5473108c125734f005c0842?OpenView" unid="A0B665FAA5473108C125734F005C0842" title="T1" icon="/icons/view.gif" />
</outlinedata>

and when a custom outline is used then the DXL code is:

<?xml version="1.0" encoding="UTF-8"?>
<outlinedata>
<outlineentry position="1" level="0" type="2" url="/Demo/extnd.nsf/T1?OpenView" unid="A0B665FAA5473108C125734F005C0842" title="T1" icon="/icons/view.gif" />
</outlinedata>

and you can see the explanation if you look at the value of url element.

Milos Lapis
MLC

Jan K
29 Nov 2007, 12:59 AM
In order to handle, that the view name is send as a UNID, when using the default outline ($Ext.nd.ViewAndFolderList) , the following function can be used in the agent ($Ext.nd.NotesDXLExporter):


Function GetView(db As NotesDatabase, strView As String) As NotesView
Dim view As NotesView
Dim doc As NotesDocument
Dim strTitle As String

Set view = db.GetView(strView)
If view Is Nothing Then
Set doc = db.GetDocumentByUNID(strView)
If Not doc Is Nothing Then
strTitle = doc.GetItemValue("$TITLE")(0)
If Instr(strTitle, "|") > 0 Then
strTitle = Trim$(Strright(strTitle, "|"))
End If
Set view = db.GetView(strTitle)
End If
End If

Set GetView = view
End Function
Inside the agent, the line:

Set noteView = db.GetView(sName)

should then be replaced by:

Set noteView = GetView(db, sName)

Then the view is found, regardless whether it's send as a UNID or as a name.

By the way, the same function is needed in a similar way in the $Ext.nd.SearchView agent, where the same problem arises.

jratcliff
29 Nov 2007, 9:09 AM
Jan, thanks for the fix for this. I'll talk to Rich so we can get this fix into our new Ext.nd + Ext 2.0 database.

Jan K
20 Dec 2007, 2:45 AM
Just found another small issue, which gave me a lot of problems.

My view actions wasn't showing in IE, but worked fine in Firefox. After some debugging, I found out, that the issue was caused by my name. Meaning, that I have danish characters in my Notes name. And in the DXL returned from the agent $Ext.nd.NotesDXLExporter, the name of the signer of the view is returned. And IE couldn't interpret these chars. The solution was simple, just set charset to UTF-8 in the agent $Ext.nd.NotesDXLExporter, where the DXL is printed to the browser:



' added by Jerry Carter 6/20/2007
Dim outBuff As String
Print {content-type:text/xml;charset=utf-8}
outBuff = exporter.Export(noteDocument)
Print outBuff

jratcliff
20 Dec 2007, 12:06 PM
Thanks Jan! I'll put this change in now.