How can I programatically change ActionBar height. I have tons of views and I do not want to do it manually. In source sync ActionBar is rawitemdata encoded.
I am not sure if this can be done programmatically.
Perhaps, you can create an enhancement for same using below URL.
Regards,
Amit SHarma
Ytria actionBarEZ is able to do this, unfortunately it is not available for free.
You could use the XML Exporter that is included in Domino Designer to export the views as XML:
Just select them all and use "Tools - DXL Utilities - Exporter..."
After that you could edit the resulting dxl file and do a simple "search & replace":
<actionbar borderstyle='none' bgcolor='#f4f4f2' bordercolor='silver'><actionbarstyle
height='35px' repeat='hrepeat'><imageref name='BG_ActBar.gif'/></actionbarstyle>
Unfortunately the DXL Importer is gone since a long time from Designer. To import the modified file you need to write your own code or use some free tools like my "N4Y Toolbar" (can be found in this German forum) that has an action for XML Import built in.
Here is an excerpt of the code the toolbar uses for XML Import:
Dim dxlImport As NotesDXLImporter Dim streamXml As NotesStream
Set streamXml = g_ses.CreateStream
Call streamXml.Open( “PathToYourDXLFile” )Set dxlImport = ses.Createdxlimporter(streamXml, dbImport)
dxlImport.Documentimportoption = DXLIMPORTOPTION_IGNORE
dxlImport.Designimportoption = DXLIMPORTOPTION_REPLACE_ELSE_CREATE
dxlImport.Aclimportoption = DXLIMPORTOPTION_IGNORE
dxlImport.Replacedbproperties = False
dxlImport.Compilelotusscript = True
dxlImport.Replicarequiredforreplaceorupdate = True
On Error GoTo ErrorImport
Call dxlImport.Process()
On Error GoTo ErrorRoutine
I guess this can be done programetically . I have done it for some application in respect of data documents to transform domino dxl output to xml, html, json etc.
Broad outline of solution is as follows:
Create a dxlexporter ... Read documentation on dxl exporter in domino designer
set input from notesnotecollection (read documentation) on how to get a handle on views only
set output to a stream (as file) in fist pass... just to know the dxl generated for the concerned views
understand what you need to change here (not just the height attribute) the changes can be done via xsltransformer using xslt file written specifically for the use case being handles
Now for actual stuff
create dxlexporter
get handle on views and set the notesnotecollection as input
in the concerned loop... process only the views you want to process
create a xsltransformer... write the requisite xslt file using xpath which should have the rules for transformation... basically let every thing pass throuh ... except for the nodes requiring change use test expressions and provide replacement xpath expressions
pl read documentation for xsltransformer
pipe the dxlexporter to xsltransformer and xsltransformer to dxlimporter whose output is set to the concerned databases.
create dxlimporter whoes input is xsltransformer...
while coding for dxlimporter be sure to set the right properties for designimportoptions (4 options like create... replace ... replace else create or ignore)
this should work
basically database/databases->notesnotecollection->dxlexporter->xsltransformer(with path to requisite xslt file to make required changes to design properties)->dxlimporter( with rules set for importing design elements)->database
The documentation is available for all these in domino designer
Hope this helps... In case you want specific details.. ready to assist... its a delayed response. guess i was late for the party
Here is the solution I tested ... it works... I have done it for background color of the action bar .... just change the XSLT.xsl file to transform the height attribute and any other attribute of action bar or any other component...
The code is below that works for a single database.... you could iterate over all databases and make it work for all effected databases
Dim session As New notessession
Dim db As NotesDatabase
Set db=session.CurrentDatabase
Dim Exporter As NotesDXLExporter
Dim Transformer As NotesXSLTransformer
Dim Importer As NotesDXLImporter
Dim XSLStream As NotesStream
DirPath="C:\TempNotes"
Rem **here is where you place the XSLT.xsl file after editing suitably as per your reqmt**
Set XSLStream=session.CreateStream
If Not XSLStream.Open(DirPath+"\XSLT.xsl") Then
Messagebox "Cannot open XSL File"
Exit Sub
End If
Rem *** Collect the Notes Corresponding to all views design elements in the database***
Dim NoteCollection As NotesNoteCollection
Set NoteCollection = db.CreateNoteCollection(False)
NoteCollection.SelectViews = True
Call NoteCollection.BuildCollection
Set Exporter = session.CreateDXLExporter
Call Exporter.setinput(NoteCollection)
Set Importer=session.CreateDXLImporter
Call Importer.setoutput(db)
Importer.DesignImportOption=6
Set Transformer=session.CreateXSLTransformer(Exporter,XSLStream,Importer)
Call Importer.setinput(Transformer)
Call Exporter.Process
The XSLT.xsl file is not attaching ... so im putting it down here... create a file named XSLT.xsl and place in tempnotes or any other directory you wish to ,,,you can modify it to alter other parameters...
******** XSLT.xsl file Content... this is used to transform the output of DXL Exporter before being fed to DXL Importer*****
<?xml version="1.0"?>
<xsl:stylesheet xmlns:d="http://www.lotus.com/dxl" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="newColor" select="'blue'"/>
<!--Identity template, provides default behavior that copies all content into the output -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="d:actionbar/@bgcolor">
<xsl:attribute name="bgcolor">
<xsl:value-of select="$newColor"/>
</xsl:attribute>
</xsl:template>
</xsl:stylesheet>
*********End XSLT.xsl
DXLImporter is still very much a part of Domino Designer
You can put this code in any view in the effected database and run it for all views in that database
or create a new database and put it as a an action there... write the loop to iterate over the databases for which you want to transform the action bar on nay other design element
Hope this helps
Have a nice day