voyent
inputrichtext : Trying to upgrade FCKEditor to 2.6.3  XML
Forum Index -> Contributor's Corner
Author Message
awkay69

Joined: 27/Nov/2007 00:00:00
Messages: 2
Offline


I went though some efforts to get a newer version of fckeditor working. The old version included with icefaces is too old, and is missing significant things I need for my project (compatibility issues, mainly, but the popup windows make it impossible to integrate a decent file browser either).

I've gotten it to work via the following changes:
- I replaced the fckeditor.zip with a new zip containing the new 2.6.3 editor
- I modified this FCKConfig parameter in fckeditor_ext.js:

this.thirdPartyObject.Config["FloatingPanelsZIndex"] = 35000 ;

so that the floating panels would show up (they were being obscured by popup panels in my UI).

Everything works in the editor, and in Icefaces...including the fckeditor dialogs (they come up, and respond properly). Closing the dialogs returns everything to normal, and everything still works

However, if I use the dialogs and click on the "Browse Server" button to go to my custom file browser (which opens a new window), Icefaces stops responding.

It is the actual window open is what hoses things...If I just close the window and try to continue working (in which case my browser has no communication with anything at all) it is just as hung as if I'd used the browser. BTW, The custom file browser does work with fckeditor, even though icefaces has stopped responding.

Afterwards, the javascript console shows lots of icefaces activity with continued mouse interaction, but the display will not change.

Any clues as to how to get icefaces to sync back up with the server?
My icefaces UI is a popup panel, with a tabbed panel, and the first tab contains the editor:

<ice:panelPopup draggable="true" modal="true" resizable="false" style="width: 95%;" rendered="#{mainMenu.editing}">
<f:facet name="header">
<h:outputText value="#{messages['mainmenu.editor.title']}" />
</f:facet>
<f:facet name="body">
<ice:panelTabSet height="100%">
<ice:panelTab label="#{messages['mainmenu.tab.edit']}">
<ice:inputRichText height="400" saveOnSubmit="true"
customConfigPath="#{fckConfig.filePath}"
valueChangeListener="#{mainMenu.updatePreview}" id="pageEditor"
value="#{mainMenu.textToEdit.value}">
</ice:inputRichText>

<ice:commandButton value="#{messages.done}"
action="#{mainMenu.done}"></ice:commandButton>
</ice:panelTab>
<ice:panelTab label="${messages['mainmenu.tab.preview']}">
<script type="text/javascript">
// <![CDATA[
window._ts_conversation_id = #{conversation.id};
// ]]>
</script>
<iframe src="#{mainMenu.previewURL}" scrolling="auto"
width="100%" height="400"> </iframe>
</ice:panelTab>
</ice:panelTabSet>
</f:facet>
</ice:panelPopup>


Here are some of the browser console messages for clicks after things stop responding, in case they mean anything useful:

Browser does post of block/send-receive-updates
[window.cKzp#1.sync-connection] [7445307] : receive [200] OK
[window.cKzp#1] applied update : <script id="cKzpIBgiUzNpXt-PdgyYBg:1:dynamic-code" type="text/javascript">...</script>
[window.stateMon] Monitor [j_id44:j_id45] has not been replaced
[window.stateMon] Not rebuilding [j_id44:j_id45] type [Draggable]
[window.stateMon] Not rebuilding [j_id44:j_id45] type [Draggable]
[window.cKzp#1.sync-connection] [7445307] : connection closed
[window] Focus Set on [j_id44:j_id47:0.1]
[window] Interup pressed
[window] User action. Set focus will be ignored.
[window] Interup pressed


and here are the icefaces console messages from the server that are generated simultaneously:


18:43:30,147 DEBUG [com.icesoft.faces.context.BridgeFacesContext] javax.servlet.include.request_uri = null
18:43:30,147 DEBUG [com.icesoft.faces.context.BridgeFacesContext] javax.servlet.include.servlet_path = null
18:43:30,148 DEBUG [com.icesoft.faces.context.BridgeFacesContext] javax.servlet.include.request_uri = null
18:43:30,148 DEBUG [com.icesoft.faces.context.BridgeFacesContext] javax.servlet.include.servlet_path = null
awkay69

Joined: 27/Nov/2007 00:00:00
Messages: 2
Offline


Turns out that I didn't have concurrent views enabled in Icefaces, and the window I was opening was showing a different icefaces page.

So, anyone interested in upgrading the internal FCKEditor, it is a relatively easy thing. Basically, replace all of the fckeditor files in the comps jar, and make a minor change to the fckeditor_ext.js file from the previous post. Here are the basic steps:

1. Unjar the icefaces-comps.jar into a tmp directory
2. cd to com/icesoft/faces/component/inputrichtext
4. rm fckeditor.zip
5. Download fckeditor 2.6.3 to /tmp and unzip it, this will give you a /tmp/fckeditor directory.
6. cd INTO fckeditor that you just unzipped
7. zip -r ../fckeditor.zip .

Your new zip file now has a few files, and "editor/" starting at its root (you effectively got rid of the fckeditor part of the path in the zip file)

8. Put the new fckeditor.zip where the old one was in the icefaces extraction from (1)
9. Patch fckeditor_ext.js as indicated in the previous post.
10. cd back to the top level of the unzipped files (where META-INF and com are)
11. jar cf ../icefaces-comps.jar .

Put the modified JAR in your webapp, and you are done!

Make sure you clear all the various caches, restart the app in your app server. If you get errors complaining about missing things (in your browser), then your browser is still caching files. See various Google searchs about tenacious browser caching.

This works for me so far, and I am even able to create a plugin that allows me to show icefaces windows from my webapp in fckeditor dialogs!
ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1332
Offline


Thanks for updating the JIRA for this (ICE-3513).

I've scheduled this for 1.8 so hopefully we can cut the newer FCKEditor release in for that release.

Regards,
Ken

Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
jansid

Joined: 14/Oct/2008 00:00:00
Messages: 3
Offline


Hi, I've tried to use that upgrade solution but file browsing doesn't work. It tries to use php to get data from server as I udenderstand. Does someone know how make it work? Leak of browsing and uploading inside inputrichtext is big disadvantages.... Thanks in advance.
bbxfnet

Joined: 15/Apr/2010 00:00:00
Messages: 5
Offline


See http://www.icefaces.org/JForum/posts/list/19551.page
 
Forum Index -> Contributor's Corner
Go to:   
Powered by JForum 2.1.7ice © JForum Team