## org.apache.portals.bridges.perl
Class PerlPortlet

    java.lang.Object
      javax.portlet.GenericPortlet
          org.apache.portals.bridges.perl.PerlPortlet

All Implemented Interfaces:
  javax.portlet.Portlet, javax.portlet.PortletConfig

public class PerlPortlet
extends javax.portlet.GenericPortlet

This portlet is executes a Perl/cgi files in a portlet. Note: The Perl Portlet uses the rewriter component that requires config xml files. Make sre that the portlet application using the Perl Portlet has the following files included in WEB-INF/conf: rewriter-rules-mapping.xml and default-rewriter-rules.xml

Version:
  $Id: PerlPortlet.java 517068 2007-03-12 01:44:37Z ate $
Author:
  Roger Ruttimann

Field Summary
`private String` `applicationName`
`private boolean` `bDemoMode`
`String` `defaultEncoding` Default encoding
`(package private) String` `lastPage`
`private String` `lastQuery`
`private static org.apache.commons.logging.Log` `log`
`static String` `PARAM_APPLICATION` PARAM_APPLICATION ApplicationName identifies the caller so that the portlet only refreshes content that was supposed for the portlet.
`static String` `PARAM_DEMO_MODE` DemoMode on or off
`static String` `PARAM_PERL_SCRIPT` INIT parameters required by the Perl Portlet:PerlScript, ScriptPath, DemoMode Name of the scrip to to execute
`static String` `PARAM_SCRIPT_PATH` Name of the Script Path where the perl scripts (among others) are located
`private String` `perlScript`
`(package private) org.apache.jetspeed.rewriter.RewriterController` `rewriteController`
`(package private) org.apache.jetspeed.rewriter.RulesetRewriter` `rewriter`
`private String` `scriptPath`

Fields inherited from class javax.portlet.GenericPortlet
``

Constructor Summary
`PerlPortlet()`

Method Summary
`void` `doView(javax.portlet.RenderRequest request, javax.portlet.RenderResponse response)` doView Executes the perl script that is defined by the property PerlScript.
`protected byte[]` `doWebContent(StringBuffer perlRenderedPage, javax.portlet.PortletURL actionURL, String actionParameterName)`
`private org.apache.jetspeed.rewriter.RewriterController` `getController(String contextPath)`
`void` `init(javax.portlet.PortletConfig config)`
`void` `processAction(javax.portlet.ActionRequest actionRequest, javax.portlet.ActionResponse actionResponse)` processAction() Checks action initiated by the perl portlet (invoking other perl scripts)
`private String` `urlEncoding(String url, String source, String replace)`

Methods inherited from class javax.portlet.GenericPortlet
`destroy, doDispatch, doEdit, doHelp, getInitParameter, getInitParameterNames, getPortletConfig, getPortletContext, getPortletName, getResourceBundle, getTitle, init, render`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### PARAM_PERL_SCRIPT

    public static final String PARAM_PERL_SCRIPT

  INIT parameters required by the Perl Portlet:PerlScript, ScriptPath, DemoMode Name of the scrip to to execute

  See Also:
    Constant Field Values

### PARAM_SCRIPT_PATH

    public static final String PARAM_SCRIPT_PATH

  Name of the Script Path where the perl scripts (among others) are located

  See Also:
    Constant Field Values

### PARAM_DEMO_MODE

    public static final String PARAM_DEMO_MODE

  DemoMode on or off

  See Also:
    Constant Field Values

### PARAM_APPLICATION

    public static final String PARAM_APPLICATION

  PARAM_APPLICATION ApplicationName identifies the caller so that the portlet only refreshes content that was supposed for the portlet. If the application name is undefined the portlet will process the request. If you have more than one perl-portlet for the same user/session all the portlets will be refreshed with the same content.

  See Also:
    Constant Field Values

### perlScript

    private String perlScript

### scriptPath

    private String scriptPath

### applicationName

    private String applicationName

### bDemoMode

    private boolean bDemoMode

### log

    private static final org.apache.commons.logging.Log log

### lastQuery

    private String lastQuery

### lastPage

    String lastPage

### rewriter

    org.apache.jetspeed.rewriter.RulesetRewriter rewriter

### rewriteController

    org.apache.jetspeed.rewriter.RewriterController rewriteController

### defaultEncoding

    public String defaultEncoding

  Default encoding

Constructor Detail

### PerlPortlet

    public PerlPortlet()

Method Detail

### init

    public void init(javax.portlet.PortletConfig config)
              throws javax.portlet.PortletException

  Throws:
    `javax.portlet.PortletException`

### processAction

    public void processAction(javax.portlet.ActionRequest actionRequest,
                              javax.portlet.ActionResponse actionResponse)
                       throws javax.portlet.PortletException,
                              IOException

  processAction() Checks action initiated by the perl portlet (invoking other perl scripts)

  Parameters:
    `actionRequest` -
    `actionResponse` -
  Throws:
    `javax.portlet.PortletException`
    `IOException`

### doView

    public void doView(javax.portlet.RenderRequest request,
                       javax.portlet.RenderResponse response)
                throws javax.portlet.PortletException,
                       IOException

  doView Executes the perl script that is defined by the property PerlScript. If the incoming request has the query perl-script= defined this script will be executed.

  Throws:
    `javax.portlet.PortletException`
    `IOException`

### getController

    private org.apache.jetspeed.rewriter.RewriterController getController(String contextPath)
                                                                   throws Exception

  Throws:
    `Exception`

### doWebContent

    protected byte[] doWebContent(StringBuffer perlRenderedPage,
                                  javax.portlet.PortletURL actionURL,
                                  String actionParameterName)
                           throws javax.portlet.PortletException

  Throws:
    `javax.portlet.PortletException`

### urlEncoding

    private String urlEncoding(String url,
                               String source,
                               String replace)

Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.