As I continue to develop the project (hint: it has a slight connection to my
IdoSphere post), I have discovered that my database is missing some resource files I will need. I'll need a CSS style sheet and at least a couple of JavaScript files. Since I won't know exactly which ahead of time, our third method will be GeniiSession.CreateFileResource. As before, I have included much of the general help, as well as an example. Please note that in the example, if the file has a .css extension, it is automatically added as a Stylesheet resource, while other files are added as regular File Resource files.
Are you starting to see how many different things the
Midas Rich Text LSX can, aside from just "manipulating rich text"?
CreateFileResource method
Version added: 3.50
Creates a new style sheet or file resource design element and returns a GeniiRTItem class object connected to the file resource data.
Defined in
GeniiSession class
Syntax
Call geniiSession.CreateFileResource(server$, filepath$, resourcename$, properties$)
Parameter
server$
String. The server for the database in which the file resource will be created. This should be a blank string, "", for a local database. If a NotesDatabase object is instantiated, this is the Server property.
filepath$
String. The pathname of the database, relative to the Notes data directory. If a NotesDatabase object is instantiated, this is the FilePath property.
resourcename$
String. The name of the file resource to be created. If this name ends in a .css, the file resource will be created as a style sheet resource, and otherwise it will be a regular file resource.
properties$
String. Optional. Various property pairs which effect the creation of the file resource. Possible property pairs are below:
Overwrite=Yes/No (defaults to No)
SourceFile=filename (If no source file is specified, the file resource could be added other ways, but for now this should always be used)
Example:
Dim s As New NotesSession
Dim db As NotesDatabase
Dim gSession As New GeniiSession
Dim rtitem As GeniiRTItem
Set db = s.CurrentDatabase
' *** Create a style sheet
Set rtitem = gSession.CreateFileResource(db.Server,
db.FilePath,
"alltogether.css")
' *** Create a file resource
Set rtitem = gSession.CreateFileResource(db.Server,
db.FilePath,
"glasnost.js")
Copyright © 2011 Genii Software Ltd.
Technorati tags: Midas Rich Text LSX XPages Lotus Notes