Portlet proxy

Last modified by Admin on 2021/03/17 21:52

cogProvides a portlet that can be used to integrate an XWiki instance inside a JSR286 compatible portal.
TypeJAR
Category
Developed by

Marius Dumitru Florea

Active Installs0
Rating
0 Votes
LicenseGNU Lesser General Public License 2.1
Compatibility

Tested with WebSphere 7 and Apache Pluto 2

Installable with the Extension Manager

Description

Provides a portlet that can be used to integrate an XWiki instance inside a JSR286 compatible portal.

XWiki run as Servlet and this module take care of convering both way Portlet to Servlet request as well as what need to be converted in the produced content.

Prerequisites & Installation Instructions

  1. Dependency management
    1. Remove portlet-api-1.0.jar if any (been removed in XWiki 5.0)
    2. Copy nekohtml-1.9.16.jar
    3. Copy rhino-1.7R4.jar
    4. Copy the downloaded jar file
    5. Repackage yuicompressor because it conflicts with Rhino
    6. Repackage boilerpipe because it conflicts with NekoHTML parser
    7. You may have to update the prototype.js used by the portal with the one used by XWiki
  2. Configuration (https://github.com/xwiki-contrib/portlet-proxy/tree/master/src/main/resources)
    1. Copy portlet.xml
    2. Copy editportlet.vm
    3. Modify xwikivars.vm
          #set ($isInPortletMode = $xwikimode == 1 || "$!request.getAttribute('javax.portlet.request')" != '')
         #set ($isInServletMode = $xwikimode == 0 && !$isInPortletMode)
    4. Modify web.xml
          <!-- Filter that rewrites the XWiki output to be able to include it in a portal page. -->
         <filter>
           <filter-name>XWiki Portlet Filter</filter-name>
           <filter-class>org.xwiki.portlet.controller.DispatchFilter</filter-class>
         </filter>

         <!--
            This filter must be the first one applied in portlet mode because it wraps the request and response objects to fix
            some of the differences between portlet and servlet mode.
          -->

         <filter-mapping>
           <filter-name>XWiki Portlet Filter</filter-name>
           <url-pattern>/*</url-pattern>
           <dispatcher>INCLUDE</dispatcher>
           <dispatcher>FORWARD</dispatcher>
         </filter-mapping>
    5. Wrap HTML element identifiers used in JavaScript code with ID('someHTMLElementId')
      1. Add the ID function to javascript.vm
            var ID = function(id){return id}
      2. Wrap the WYSIWYG editor 'hookId' configuration parameter (wysiwyg_writeConfig macro in macros.vm)
            #if($entry.key.equals('hookId'))
              ${separator}$entry.key: ID('$!{escapetool.javascript($entry.value)}')
            #else
              ${separator}$entry.key: '$!{escapetool.javascript($entry.value)}'
            #end
      3. Wrap 'Comments' with ID function in js/uicomponents/viewers/comments.js
    1. Modify javascript.vm by adding the following lines before prototype.js
          #if($isInPortletMode)
          $xwiki.jsfx.use('js/xwiki/portletOverwrites.js', {'forceSkinAction': true})
          #end
    2. Copy portletOverwrites.js

Dependencies

Dependencies for this extension (org.xwiki.contrib:portlet-proxy 1.0):

  • net.sourceforge.nekohtml:nekohtml 1.9.16
  • dom4j:dom4j 1.6.1
  • net.sourceforge.cssparser:cssparser 0.9.7-20121016
  • org.mozilla:rhino 1.7R4
  • org.apache.commons:commons-lang3 3.1
  • commons-io:commons-io 2.0.1
  • org.slf4j:slf4j-api 1.6.4
  • ch.qos.logback:logback-classic 1.0.0
Tags:
    

Get Connected