Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Lenya Wiki" for change 
notification.

The following page has been changed by BobHarner:
http://wiki.apache.org/lenya/HowToIntegrateFCKEditor

The comment on the change is:
Further simplified installation instructions, adding 2 more downloadable files.

------------------------------------------------------------------------------
  
  This is still very much a work in progress.  This will get the famous 
FCKeditor (which we have nicknamed "Fred" to reduce snickering) to load with 
content, save the content, and link to assets.  However, validation still needs 
to be implemented when saving, and the asset upload portion is not quite ready. 
 We've only tried this with Lenya 1.2.3/1.2.4 and FCKeditor 2.0/2.11.  Full 
credit for all this goes to K. Haenni.
  
- 1. Download Fred (the FCK Editor) from http://www.fckeditor.net/ into a new 
`lenya/webapp/lenya/resources/fckeditor` directory.
+ 1. Download Fred (the FCK Editor) from http://www.fckeditor.net/.  Extract 
the ZIP or tar file into `lenya/webapp/lenya/resources/.  The ZIP or tar file 
will contain files starting with "FCKeditor/", so after extracting, rename 
"FCKeditor" to "fckeditor".
  
  2. Download [attachment:invokeEditor.js] into that same 
`lenya/webapp/lenya/resources/fckeditor` directory.
  
- 3. Add the following to `lenya/webapp/lenya/resources/fckeditor/fckconfig.js` 
after the line `FCKConfig.ImageDlgHideAdvanced` (around line 112):
+ 3. Add the following to `lenya/webapp/lenya/resources/fckeditor/fckconfig.js` 
after the line `FCKConfig.ImageDlgHideAdvanced` (around line 120):
  
  {{{
  // Need to get the publication id and doc id from the cookie.
@@ -61, +61 @@

  
  These file are just simple container pages.  The remaining html will be added 
during the transformations.  `index.xhtml` is the container for the editor page 
itself, and `uploadComplete.xhtml` is the response that's sent to Fred after an 
asset has been uploaded which contains the name of the file being uploaded and 
an error code.
  
- 6. Add the following to `global-sitemap.xmap` after  `<!-- Editor BXE -->`
+ 6. Add the following to `global-sitemap.xmap` just before `<!-- Editor BXE 
-->` (around line 237):
  
  {{{
  <map:pipeline>
@@ -84, +84 @@

  
  Alternatively, if you want to *only* use the FCKeditor, comment out the other 
editors in generic.xsp and give the FCKeditor item a label like "Edit Page".
  
- 10. Copy `lenya/webapp/lenya/xslt/bxeng/*` to 
`lenya/webapp/lenya/xslt/fckeditor/`, then:
+ 10. Copy `lenya/webapp/lenya/xslt/bxeng/*` to 
`lenya/webapp/lenya/xslt/fckeditor/`, then download the following files to that 
new directory:
  
- a. Modify `aggregate.xsl` to contain the following:
+  * [attachment:aggregate.xsl] (replacing existing file)
  
+  * [attachment:asset.xsl] (replacing existing file)
- {{{
- <?xml version="1.0"?>
- 
- <xsl:stylesheet version="1.0"
-   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
-   xmlns:xhtml="http://www.w3.org/1999/xhtml";
- >
- 
- <xsl:param name="docname"/>
- <xsl:param name="root"/>
- <xsl:param name="language"/>
- 
- <xsl:template match="/">
- <xsl:apply-templates select="fckeditor"/>
- </xsl:template>
- 
- <xsl:template match="fckeditor">
- <html xmlns="http://www.w3.org/1999/xhtml";>
- 
- 
- <!--<xsl:apply-templates select="xhtml:html/xhtml:[EMAIL PROTECTED] = 
'EditorHead']"/>-->
- <head>
-       <script src="{$root}fckeditor/fckeditor.js" 
type="text/javascript">&#160;</script>
-       <script src="{$root}fckeditor/invokeEditor.js" 
type="text/javascript">&#160;</script>
-       <title>FCKEditor Editor</title>
- </head>
- 
- 
- <body onload="invoke();">
-       <form name="daForm" id="myform" 
action="{$docname}_{$language}.html?lenya.usecase=fckeditor&amp;lenya.step=edit"
 method="POST">
- 
-            <input type="hidden" name="hidParam" value="saveIcon"/>
- 
-               <textarea name="content" id="content">
-                       <xsl:copy-of select="xhtml:html/xhtml:body/node()"/>
-               </textarea>
-          <input type="submit" value="Cancel / Exit" name="cancel" 
onclick="document.daForm.hidParam.value='cancelButton';"/>
-          <input type="submit" value="Save" name="saving" 
onclick="document.daForm.hidParam.value='saveButton';"/>
- 
-       </form>
- </body>
- </html>
- </xsl:template>
- 
- <xsl:template match="xhtml:head">
- <head xmlns="http://www.w3.org/1999/xhtml";>
- <xsl:for-each select="/fckeditor/namespaces/xmlns">
-   <meta name="fckNS" content="{.}"/>
- </xsl:for-each>
- <xsl:copy-of select="@*|node()"/>
- </head>
- </xsl:template>
-  
- </xsl:stylesheet>  
- 
- }}}
- 
- b. Modify `asset.xsl` to containt the following:
- 
- {{{
- <?xml version="1.0" encoding="UTF-8"?>
- 
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0"
-               xmlns:dir="http://apache.org/cocoon/directory/2.0";>
-    
- <xsl:param name="pubid"/>
- <xsl:param name="docid"/>
- <xsl:param name="type"/>
- 
- <xsl:template match="/">
-     <Connector command="GetFoldersAndFiles" resourceType="File">
-     <xsl:if test="$type='Image'">
-           <CurrentFolder path="/" url="/{$pubid}/authoring/{$docid}/" />
-       </xsl:if>
-       <xsl:if test="$type='File'">
-               <CurrentFolder path="/" url="{$docid}/" />
-       </xsl:if>
-       <Folders>
-           </Folders>
-           <Files>
-           <xsl:for-each select="dir:directory/dir:file">
-               <xsl:variable name="fileName" select="@name"/>
-               <xsl:variable name="size" select="@size"/>
-                       <File name="{$fileName}" size="{$size}"/>
-          </xsl:for-each>
-     </Files>
-     </Connector>
- </xsl:template>
- 
- </xsl:stylesheet>  
- 
- }}}
- 
- c. Download the following files to lenya/webapp/lenya/xslt/fckeditor/
  
   * [attachment:change-image-path.xsl] 
  
@@ -199, +106 @@

  
  TODO: When creating the Publication, one of the parameters required is the 
context.  Right now, this is hard coded.  I have yet to figure out a way to get 
this.  Obviously, hard coding is not the solution - still working on this.  
Thinking about putting the context in a properties files somewhere.
  
- To get Fred to work with all your pubs, you will need to copy 
`usecase-fckeditor.xmap` to each publication.  (Or can we put 
`usecase-fckeditor.xmap` into a `lenya/usecases/fckeditor` directory for all 
publications???)
+ To get Fred to work with all your pubs, you will need to repeate steps 8 & 9 
for each publication.  (Or can we put `usecase-fckeditor.xmap` into a 
`lenya/usecases/fckeditor` directory for all publications???)
  
  There are a lot of steps here, and this is still very much a work in 
progress, but should get the basics of Fred working.  In addition, I'm sure 
there's a better way to get the lenya tags in the document when saving rather 
than hard coding them in the xsl file. The `fckeditor-usecase.xmap` also needs 
to be cleaned up, and there are some unneeded files generated by copying bxe 
directories.  Any suggestions or comments are welcome!
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to