Toolbar setup does not work with 8.5.1

Hi, we add our own icon to the Notes client toolbar with a mechanism published by André Guirard in “The View” some years ago, via importing design elements dxl documents, signing agents and so on; we use bookmarks.nsf as a container for our temporary stuff.

Well, unfortunately this mechanism seems to be broken with the Notes Client 8.5.1 - maybe one of the fixes went wrong ?

Here is my “Toolbar setup” code - at least the beginning :

…std::string ServerName;

std::string DatabaseName = "bookmark.nsf";



// Importing the new Dxl Design Elements into the Corresponding Database

STATUS Status = NOERROR;

DebugHandler->Dbg( "I", "importing design element: " + pToolbarIconDxlFileName );

Status = ImportDXLDesignElement( ServerName, DatabaseName, pToolbarIconDxlFileName );			if ( Status != NOERROR ) { return Status; }

DebugHandler->Dbg( "I", "importing design element: " + pToolbarOutlineDxlFileName );

Status = ImportDXLDesignElement( ServerName, DatabaseName, pToolbarOutlineDxlFileName );		if ( Status != NOERROR ) { return Status; }

DebugHandler->Dbg( "I", "importing design element: " + pToolbarTempCopyAgentDxlFileName );

Status = ImportDXLDesignElement( ServerName, DatabaseName, pToolbarTempCopyAgentDxlFileName );	if ( Status != NOERROR ) { return Status; }



// Running the Temporary Lotus Script Copy Agent and Deleting it

DebugHandler->Dbg( "I", "running agent" );

//Status = RunLotusScriptAgent( ServerName, DatabaseName, pToolbarTempCopyAgentName, true );		if ( Status != NOERROR ) { return Status; }

Status = RunLotusScriptAgent( ServerName, DatabaseName, pToolbarTempCopyAgentName, false );		

RunLotusScriptAgent :

Status = OpenDatabase( pServerName, pDatabaseName, DatabaseHandle );			if ( Status != NOERROR ) { return Status; }



// Signing the Lotus Script Agent

DebugHandler->Dbg( "D", "signing the Lotus Script Agent" );

DebugHandler->Dbg( "D", pDatabaseName );  //bookmark.nsf

NOTEID AgentNoteId;

NOTEHANDLE AgentNoteHandle;

HAGENT AgentHandle;

HAGENTCTX AgentContext;	

char AgentName[MAXPATH] = {0};

strcat_s( AgentName, sizeof ( AgentName ), pAgentName.c_str() );	

DebugHandler->Dbg( "D", AgentName );	//dialtoolbarupdateagent

Status = NIFFindDesignNote ( DatabaseHandle, AgentName, NOTE_CLASS_FILTER, &AgentNoteId );

if ( Status != NOERROR ) { Status = NIFFindPrivateDesignNote ( DatabaseHandle, AgentName, NOTE_CLASS_FILTER, &AgentNoteId ); }

And here I get the message :

“Entry not found in index” which IMHO means, the agent is not there.

But really, it used to, in all other client versions :-(.

Subject: The message probably does mean the design element isn’t found…

…but that’s not the error you want to look at since it’s the return value from the second call, NIFFindPrivateDesignNote, after the first call, NIFFindDesignNote, already failed. Why did the first call fail? Don’t throw away the original error status.

Then, I hope you get a better fix than adjusting the timing. I wouldn’t have thought that DXL import would have anything going on in background; why should adding “sleeps” help? Is your code in ImportDXLDesignElement itself doing any threading?

Subject: Toolbar setup does not work with 8.5.1

Hi ! The master himself :-).My theorie at the moment is concerning the fact, that the agent that we import is deleted afterwards. The guy, who implemented the stuff originally has obviously experienced the same problem once in a while and therefore already put the toolbar setup into a loop (for loop, 10 times) with a Sleep inside…

Well, I allready made it work when I did not delete the agent from the bookmark.nsf after one installation loop and started the client twice.

It is very strange and definitely an effect which did not occur in 8.5.

(And I also ordered new hardware :slight_smile: ).

As soon as I know more, I will tell you.

Best regards, Nicole Ziegenhagen

Subject: urg

The first error message is 1028, unfortunately I have to wait until monday to find out, what that means.Have a nice weekend !

Subject: 1028

1028 = Entry not found in index, so the design element is not found

Subject: well, wel

Now I wanted to write a service request to IBM, and guess what - it does not work any more.So, we will just advice our customers not to use the 8.5.1 client and that was it, bye bye.

Subject: .

New hardware did not solve the problem, and Windows7 made it even worse. But okay, I know that you did not release a Windows7 supporting client yet.

Subject: No problem with basic client

Hi Mr. Guirard, I just found out that there is absolutely no problem with the basic client - only the “complete” client is still making problems.

Subject: Agent Not Found from 8.5.1 custom toolbar button

Button code:_unid := @Text(@DocumentUniqueID);

ENVIRONMENT PARAM1 := @Implode(@DbName:_unid; “,”);

@Command([MailOpen]);

@Command([ToolsRunMacro];“ExportFields”)

In Mail database, Agent code:

ExportFields:

Option Public

Option Explicit

Sub Initialize

Dim session As New NotesSession

Dim wksp As New NotesUIWorkspace

Dim doc As NotesDocument

Dim db As NotesDatabase

Dim strParam$, varArr



strParam = session.GetEnvironmentString("Param1")

If strParam = "" Then

	' do selected document in current view.

	Set db = session.CurrentDatabase

	If Not (wksp.CurrentDocument Is Nothing) Then

		Msgbox "This agent must be run from a view. The user's access is determined by data already stored in the document -- not by the results of field default and computed field formulas after they open the document." 

		Exit Sub

	End If

	Set doc = session.DocumentContext

	If doc Is Nothing Then

		Msgbox "You must highlight a document before you run this agent."

		Exit Sub

	End If

Else

	' Param1 had a value in it. This contains the server name, db filepath, and document UNID delimited by ",")

	session.SetEnvironmentVar "Param1", ""

	varArr = Split(strParam, ",")

	Set db = New NotesDatabase(varArr(0), varArr(1))

	Set doc = db.GetDocumentByUNID(varArr(2))

	If doc Is Nothing Then

		Msgbox "Oops! Can't figure out argument: " & strParam

		Exit Sub

	End If

End If



WriteFieldsMeta doc

End Sub

Sub WriteFieldsMeta (doc As NotesDocument )

On Error Resume Next



Dim fileNum1 As Integer

Dim FldName As String

Dim FldText As String

Dim FldType As Integer

Dim FldSize As Long



fileNum1% = Freefile

Open "D:\Fields.csv" For Output As fileNum1%

Dim item As NotesItem

Forall i In doc.Items

	FldName = i.Name 

	FldType = i.Type

	FldSize =  i.ValueLength

	Set item =doc.GetFirstItem( FldName )	' 

	Forall v In item.Values

		FldText = v

		If v <> " " Or Not Isnull(v) Or Not (v Is Nothing) Then

			Write #fileNum1%, FldName, FldText, FldType, Cstr( FldSize )

		End If

	End Forall

End Forall

Close fileNum1%

Print "File written to D:\Fields.csv"

End Sub

Subject: I will ask my boss for new hardware.

Well well well - the solution : 8.5.1 is al little bit slower than 8.5 - so the importing of the dxl - files is not yet finished when the program tries to sign the agent - the agent is just not there yet - congratulations.I hope that some extra “Sleeps” will solve the problem.