站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.6 API 英文版文档

NewsPortlet - JBOSS Portal 2.6 API 英文版文档


org.jboss.samples.portlet.news
Class NewsPortlet

java.lang.Object
  extended byjavax.portlet.GenericPortlet
      extended byorg.jboss.samples.portlet.news.NewsPortlet
All Implemented Interfaces:
Portlet

public class NewsPortlet
extends GenericPortlet

Adapted from JBoss Weather Portlet to deal with RSS News Feeds using RSS 1.0 or RSS 2.0 format.

Author:
Roy Russo

Field Summary
private static java.lang.String E_UNPARSEABLE
           
private static java.lang.String E_UNREADABLE
           
private static java.lang.String E_XSL_UNREADABLE
           
private static java.lang.String JSP_EDIT
          Edit page
static org.apache.log4j.Logger log
          Logger
private  java.lang.String RSS_URL
          Base URL of News RSS
private static java.lang.String RSS1_XSL
          RSS 1.0 XSL page for output
private static java.lang.String RSS2_XSL
          RSS 2.0 XSL page for output
private  javax.xml.transform.Templates template_1_0
          Compiled Template for output RSS 1.0
private  javax.xml.transform.Templates template_2_0
          Compiled Template for output RSS 2.0
 
Fields inherited from class javax.portlet.GenericPortlet
 
Constructor Summary
NewsPortlet()
           
 
Method Summary
protected  void doEdit(RenderRequest request, RenderResponse response)
          Allow edit of RSS Feed.
protected  void doView(RenderRequest request, RenderResponse response)
          Helper method to serve up the mandatory view mode.
 void init()
          Compile the XSL File.
 void processAction(ActionRequest request, ActionResponse response)
          Process RSS Feed edit.
 
Methods inherited from class javax.portlet.GenericPortlet
destroy, doDispatch, 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

log

public static org.apache.log4j.Logger log
Logger


JSP_EDIT

private static final java.lang.String JSP_EDIT
Edit page

See Also:
Constant Field Values

RSS2_XSL

private static final java.lang.String RSS2_XSL
RSS 2.0 XSL page for output

See Also:
Constant Field Values

RSS1_XSL

private static final java.lang.String RSS1_XSL
RSS 1.0 XSL page for output

See Also:
Constant Field Values

template_2_0

private javax.xml.transform.Templates template_2_0
Compiled Template for output RSS 2.0


template_1_0

private javax.xml.transform.Templates template_1_0
Compiled Template for output RSS 1.0


RSS_URL

private java.lang.String RSS_URL
Base URL of News RSS


E_XSL_UNREADABLE

private static final java.lang.String E_XSL_UNREADABLE
See Also:
Constant Field Values

E_UNREADABLE

private static final java.lang.String E_UNREADABLE
See Also:
Constant Field Values

E_UNPARSEABLE

private static final java.lang.String E_UNPARSEABLE
See Also:
Constant Field Values
Constructor Detail

NewsPortlet

public NewsPortlet()
Method Detail

init

public void init()
Compile the XSL File.

Overrides:
init in class GenericPortlet

doView

protected void doView(RenderRequest request,
                      RenderResponse response)
               throws java.io.IOException,
                      PortletException
Description copied from class: GenericPortlet
Helper method to serve up the mandatory view mode.

The default implementation throws an exception.

Overrides:
doView in class GenericPortlet
Parameters:
request - the portlet request
response - the render response
Throws:
PortletException - if the portlet cannot fulfilling the request
java.io.IOException - if the streaming causes an I/O problem

doEdit

protected void doEdit(RenderRequest request,
                      RenderResponse response)
               throws java.io.IOException,
                      PortletException
Allow edit of RSS Feed.

Overrides:
doEdit in class GenericPortlet
Parameters:
request -
response -
Throws:
java.io.IOException
PortletException

processAction

public void processAction(ActionRequest request,
                          ActionResponse response)
                   throws PortletException
Process RSS Feed edit.

Specified by:
processAction in interface Portlet
Overrides:
processAction in class GenericPortlet
Parameters:
request -
response -
Throws:
PortletException