Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Custom widget embedding FCKeditor
Custom widget embedding FCKeditor [message #513362] Tue, 09 February 2010 20:45 Go to next message
Valer Roman is currently offline Valer RomanFriend
Messages: 36
Registered: July 2009
Member
Hello,

I am trying to create a custom widget for the FCKEditor.
I have studied the GMap example and all seems clear but ... the
problem I have is in using the fckeditor.js java script library as a
resource.
I have used it as an external resource on a different server path
localhost:8080/fckeditor/fckeditor.js. Here the problem is that it
reports "Permission denied" messages on some code of other javascripts
libraries fckeditor.js uses. This is I think because rap runs on
localhost:9090/rap so it sees localhost:8080 as a different server and
browser security forbids some methods to be executed.
I would like somehow to have the fckeditor deployed on the same server
as rap, localhost:9090/rap or something like that, to avoid the security
problems.
If somebody could help me ... maybe I am on the wrong track ...

Thank you,
Valer Roman
Re: Custom widget embedding FCKeditor [message #513370 is a reply to message #513362] Tue, 09 February 2010 21:11 Go to previous messageGo to next message
Nikolai Raitsev is currently offline Nikolai RaitsevFriend
Messages: 102
Registered: July 2009
Senior Member
Hi,

maybe you still need to register the fckeditor resources?

We do it programmatically, e.g.:

public RichHtmlEditor(Composite parent, int style) {
super(parent, style);

logger.debug("creating RichHtmlEditor Object, register tinymce resources");
Activator activator = Activator.getDefault();
if (!activator.isResoursesRegistered())
activator.registerResources();
}

In Activator of RichHtmlEditor-Bundle:
(under tiny_mce-Folder are all TinyMCE resources (all js-files and images)

public void registerResources()
{
try
{
logger.debug("register tinymce resources");
registerResources("tiny_mce", new String[]{".svn"});
resourcesRegistered = true;
}catch (Exception e)
{
logger.error("Error in registerResources", e);
resourcesRegistered = false;
}
}

/**
* Register all resources, recursively under specified folder
* <br />
* search path = plugin root location
*
* @param clazz - executor class
* @param folder - folder name
* @param exclude - compared by filename.startsWith(exclude[*])
*/
private void registerResources(String folder, String...exclude) {

RWT.getResourceManager().setContextLoader(this.getClass().ge tClassLoader());

List<String> collectedPaths = new ArrayList<String>();
getContents("/" + folder, collectedPaths, exclude);
for ( String resource:collectedPaths ) {
if ( !RWT.getResourceManager().isRegistered(resource) ) {
RWT.getResourceManager().register(resource);
logger.debug("registered resource ->" + resource);
}
}

}


private void getContents(String path, List<String> collectedPaths,
String...exclude)
{
Enumeration<?> enums = getBundle().getEntryPaths(path);

while(enums.hasMoreElements())
{
Object object = enums.nextElement();
Enumeration<?> tmpEnum =getBundle().getEntryPaths(object.toString());
if(tmpEnum != null)
getContents(object.toString(), collectedPaths, exclude);
else
{
boolean accept = true;
for(String str:exclude)
{
if(object.toString().contains(str))
accept = false;
}

if(accept)
collectedPaths.add(object.toString());
}


}
}


for more see in code from Georgi:)

wish you much fun:)

Best regards,

Nikolai



Valer Roman schrieb:
> Hello,
>
> I am trying to create a custom widget for the FCKEditor.
> I have studied the GMap example and all seems clear but ... the
> problem I have is in using the fckeditor.js java script library as a
> resource.
> I have used it as an external resource on a different server path
> localhost:8080/fckeditor/fckeditor.js. Here the problem is that it
> reports "Permission denied" messages on some code of other javascripts
> libraries fckeditor.js uses. This is I think because rap runs on
> localhost:9090/rap so it sees localhost:8080 as a different server and
> browser security forbids some methods to be executed.
> I would like somehow to have the fckeditor deployed on the same server
> as rap, localhost:9090/rap or something like that, to avoid the security
> problems.
> If somebody could help me ... maybe I am on the wrong track ...
>
> Thank you,
> Valer Roman
Re: Custom widget embedding FCKeditor [message #513373 is a reply to message #513370] Tue, 09 February 2010 21:29 Go to previous message
Valer Roman is currently offline Valer RomanFriend
Messages: 36
Registered: July 2009
Member
Thanks again :)

I have also tried the TinyMCE code, works great. The only issue is that
I want to use also images in the text so I am still playing with
FCKEditor integration.
I have managed to start the FCKEditor visually, thanks to code from
TinyMCE, but got some errors when using.
I think your code for registering recursively resources will help me
advance.

will get back with more info or problems :)

Nikolai Raitsev wrote:
> Hi,
>
> maybe you still need to register the fckeditor resources?
>
> We do it programmatically, e.g.:
>
> public RichHtmlEditor(Composite parent, int style) {
> super(parent, style);
>
> logger.debug("creating RichHtmlEditor Object, register tinymce
> resources");
> Activator activator = Activator.getDefault();
> if (!activator.isResoursesRegistered())
> activator.registerResources();
> }
>
> In Activator of RichHtmlEditor-Bundle:
> (under tiny_mce-Folder are all TinyMCE resources (all js-files and images)
>
> public void registerResources()
> {
> try
> {
> logger.debug("register tinymce resources");
> registerResources("tiny_mce", new String[]{".svn"});
> resourcesRegistered = true;
> }catch (Exception e)
> {
> logger.error("Error in registerResources", e);
> resourcesRegistered = false;
> }
> }
>
> /**
> * Register all resources, recursively under specified folder
> * <br />
> * search path = plugin root location
> *
> * @param clazz - executor class
> * @param folder - folder name
> * @param exclude - compared by filename.startsWith(exclude[*])
> */
> private void registerResources(String folder, String...exclude) {
>
> RWT.getResourceManager().setContextLoader(this.getClass().ge tClassLoader());
>
>
> List<String> collectedPaths = new ArrayList<String>();
> getContents("/" + folder, collectedPaths, exclude);
> for ( String resource:collectedPaths ) {
> if ( !RWT.getResourceManager().isRegistered(resource) ) {
> RWT.getResourceManager().register(resource);
> logger.debug("registered resource ->" + resource);
> }
> }
>
> }
>
>
> private void getContents(String path, List<String> collectedPaths,
> String...exclude)
> {
> Enumeration<?> enums = getBundle().getEntryPaths(path);
>
> while(enums.hasMoreElements())
> {
> Object object = enums.nextElement();
> Enumeration<?> tmpEnum
> =getBundle().getEntryPaths(object.toString());
> if(tmpEnum != null)
> getContents(object.toString(), collectedPaths, exclude);
> else
> {
> boolean accept = true;
> for(String str:exclude)
> {
> if(object.toString().contains(str))
> accept = false;
> }
>
> if(accept)
> collectedPaths.add(object.toString());
> }
>
>
> }
> }
>
>
> for more see in code from Georgi:)
>
> wish you much fun:)
>
> Best regards,
>
> Nikolai
>
>
>
> Valer Roman schrieb:
>> Hello,
>>
>> I am trying to create a custom widget for the FCKEditor.
>> I have studied the GMap example and all seems clear but ... the
>> problem I have is in using the fckeditor.js java script library as a
>> resource.
>> I have used it as an external resource on a different server path
>> localhost:8080/fckeditor/fckeditor.js. Here the problem is that it
>> reports "Permission denied" messages on some code of other javascripts
>> libraries fckeditor.js uses. This is I think because rap runs on
>> localhost:9090/rap so it sees localhost:8080 as a different server and
>> browser security forbids some methods to be executed.
>> I would like somehow to have the fckeditor deployed on the same server
>> as rap, localhost:9090/rap or something like that, to avoid the security
>> problems.
>> If somebody could help me ... maybe I am on the wrong track ...
>>
>> Thank you,
>> Valer Roman
Previous Topic:enable AJP in jetty to force request to RAP in jetty over apache http
Next Topic:Custom Widget: Composing Qooxdoo Widgets in CanvasLayout, the widget is not shown.
Goto Forum:
  


Current Time: Fri Apr 19 07:45:44 GMT 2024

Powered by FUDForum. Page generated in 0.01786 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top