3 Replies Latest reply on Jul 29, 2011 8:35 AM by Lukáš Fryč

    Editor and resource paths handling

    Lukáš Fryč Master

      Hi guys,

       

      I have got stuck with problem of CKEditor's resource paths generation.

       

      CKEditor loads own resources from paths which are generated at runtime and thus may be redefined, mainly in two ways, using:

       

      • window.CKEDITOR_BASEPATH
        • defines the base path of the request, e.g. basePath + resourcePath
        • this is useful when you have prefix-style mapped servlet (e.g. /faces/)
      • window.CKEDITOR_GETURL
        • defines the function which generates resource paths
        • this is useful when you have suffix-style mapped servlet (e.g. .jsf)
        • more complex for usage then previous option (function must handle URLs appropriately)
        • does not work for CKEditor's CSS files referencing PNG images (url(images/*.png)) since these are not processed by CKEDITOR_GETURL

       

      Currently, rich:editor is using first variant and thus relies on default FacesServlet mapping /faces/.

      But when user redefines servlet mapping, it will got invalid.

       

       

      ========================

       

      Basically there are several options:

       

      1. rewrite CSS files of CKEditor to be generated dynamically (use ECSS)
        • hard to maintain during component upgrade
      2. search all the FacesServlet mappings and try to find suitable absolute mapping (e.g. /faces/)
      3. register custom servlet mapping for FacesServlet at runtime (e.g. /org.richfaces.resources/)
      4. hybrid of (1) and (3)
        • search for suitable or use custom servlet mapping as fallback

       

      I would prefer (3), but would like to hear any opinions and objections on this topic.