Home       About Genii       Products       Downloads       News & Events       Support       Weblog   
December, 2008
SMTWTFS
 01 02 03 04 05 06
07 08 09 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
November, 2008
October, 2008
September, 2008
August, 2008
July, 2008
June, 2008

Show all 67 months


Search the weblog

Ben Langhinrichs
E-mail address - Ben Langhinrichs

Photograph of Ben Langhinrichs



©2003-2008 Genii Software Ltd. All rights reserved. The rights to all logos, images, etc. are owned by their respective owners.

The views expressed in this weblog are mine alone, but since I am President and Owner, they necessarily also reflect the views of Genii Software, Ltd.
Genii Weblog
Genii Weblog

Mimic a directory structure in Domino

Fri 4 Feb 2005, 01:27 PM

I have been working with CoexEdit, and needed a template that used the FCKEditor.  When I have done this before, I have simply stored the FCKEditor directory under the \lotus\domino\data\domino\html\FCKEditor directory, which works reasonably well, but which requires a level of access to the directory structure of the server that I don't always have, and it works less well with CoexEdit which likes to use image resources, since those can be accessed via both the Notes client and the web browser.

So, I decided to mimic the directory structure in the Notes database.  I used the existing Midas ability to create image resources, plus our new Midas ability to create file resources, including style sheets, and wrote a fairly simple agent to create the whole structure.  The only really important part of the agent is:

Sub CreateResource(db As NotesDatabase, name As String, src As String)
  Dim rtitem As New GeniiRTitem
  If Instr(Lcase(name), ".gif") > 0 Or Instr(Lcase(name), ".jpg") > 0 Then
   Set rtitem = gSession.CreateImageResource(db.FilePath, db.FilePath, name, |SourceFile='|+src+|' URLEncode='Yes'|)
  Elseif Instr(name, ".") > 0 Then
   Set rtitem = gSession.CreateFileResource(db.Server, db.FilePath, name, |SourceFile='|+src+|' URLEncode='Yes'|)
  End If
  rtitem.Save
End Sub

which creates the image and file resources.  A key component is the URLEncode='Yes', which switches backslashes into forward slashes among other things.  This is where the beauty of the scheme comes in.  Both Internet Explorer and Firefox will switch from backslashes to forward slashes automatically, so even though the FCKEditor assumes you have this in a directory structure, the directory is translated.  The image resources then have names such as editor/dialog/images/logo_fckeditor.gif, which are allowed in Notes.

But a picture is worth a thousand words.  Here is what it looks like in Firefox, with an image down in the directory structure displayed.  Note the circled words, both in the URL and in the properties for the image.  They don't look like ordinary Domino URLs, but that is all they are.


What has been said:

291.1. Neil Gower (09/02/2005 02:06)

Hi,

Dont suppose you could post the db with the editor in, I am currently just starting to look at this, and a db with all the files imported would be a great help..

291.2. Ben Langhinrichs (02/09/2005 07:02 AM)

Excellent question. I'll send you one for now, but in the near future I intend to create these for several major rich text editors and I will make them available from my website (with CoexEdit integration ready if you want it, I might add).

291.3. Johan Känngård (03/03/2005 02:27 AM)

The Query string generated by some FCKeditor buttons/commands are invalid Domino URLs, like fckeditor.html?InstanceName=xx. These has to be changed into URLs like fckeditor.html?Open&InstanceName=xx... Have you done this with the current version of FCKeditor? I am very interested in obtaining that database then :-)

- Johan

http://dev.kanngard.net

291.4. mark davenport (05/07/2008 09:19 AM)

Ben;

I'm wondering if you might still be able to send along the above-mentioned sample db where you emulated the directory structure of FCKeditor and it's files using Domino's file resources...

TIA

Have your say:

Name *:
E-mail:
e-mail addresses will not be displayed on this site
Notify me of other comments

Comment *:


<HTML is not allowed>
Linking: Add links as {{http://xxx|title}}, and they will be activated once approved
Blocked? Unable to post a comment? Please read this for a possible explanation...

Copyright © 1996-2008 Genii Software Ltd. All Rights Reserved. Some images courtesy of BigFoto.com  Nedstat