org.apache.jetspeed.tools.deploy
Class JetspeedWebApplicationRewriter

java.lang.Object
  extended byorg.apache.jetspeed.tools.deploy.JetspeedWebApplicationRewriter

public class JetspeedWebApplicationRewriter
extends Object

Utilities for manipulating the web.xml deployment descriptor

Version:
$Id: WebDescriptorUtilities.java,v 1.2 2004/05/12 22:25:04 taylor Exp $
Author:
Scott T. Weaver , Matt Avery , David Sean Taylor

Field Summary
private  boolean changed
           
private  org.jdom.Document document
           
protected static String[] ELEMENTS_BEFORE_SERVLET
           
protected static String[] ELEMENTS_BEFORE_SERVLET_MAPPING
           
protected static String[] ELEMENTS_BEFORE_TAGLIB_MAPPING
           
static String JETSPEED_CONTAINER
           
static String JETSPEED_SERVLET_MAPPING_XPATH
           
static String JETSPEED_SERVLET_XPATH
           
static String PORTLET_TAGLIB_XPATH
           
private  String portletApplication
           
private  boolean portletTaglibAdded
           
protected static String WEB_XML_PATH
           
 
Constructor Summary
JetspeedWebApplicationRewriter(org.jdom.Document doc)
           
JetspeedWebApplicationRewriter(org.jdom.Document doc, String portletApplication)
           
 
Method Summary
private  void insertContextNameParam(org.jdom.Element jetspeedServletElement)
           
protected  void insertElementCorrectly(org.jdom.Element root, org.jdom.Element toInsert, String[] elementsBefore)
           insertElementCorrectly
private  void insertLoadOnStartup(org.jdom.Element jetspeedServletElement)
           
 boolean isChanged()
           
 boolean isPortletTaglibAdded()
           
 void processWebXML()
           processWebXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JETSPEED_CONTAINER

public static final String JETSPEED_CONTAINER
See Also:
Constant Field Values

JETSPEED_SERVLET_XPATH

public static final String JETSPEED_SERVLET_XPATH
See Also:
Constant Field Values

JETSPEED_SERVLET_MAPPING_XPATH

public static final String JETSPEED_SERVLET_MAPPING_XPATH
See Also:
Constant Field Values

PORTLET_TAGLIB_XPATH

public static final String PORTLET_TAGLIB_XPATH
See Also:
Constant Field Values

WEB_XML_PATH

protected static final String WEB_XML_PATH
See Also:
Constant Field Values

ELEMENTS_BEFORE_SERVLET

protected static final String[] ELEMENTS_BEFORE_SERVLET

ELEMENTS_BEFORE_SERVLET_MAPPING

protected static final String[] ELEMENTS_BEFORE_SERVLET_MAPPING

ELEMENTS_BEFORE_TAGLIB_MAPPING

protected static final String[] ELEMENTS_BEFORE_TAGLIB_MAPPING

document

private org.jdom.Document document

portletApplication

private String portletApplication

changed

private boolean changed

portletTaglibAdded

private boolean portletTaglibAdded
Constructor Detail

JetspeedWebApplicationRewriter

public JetspeedWebApplicationRewriter(org.jdom.Document doc,
                                      String portletApplication)

JetspeedWebApplicationRewriter

public JetspeedWebApplicationRewriter(org.jdom.Document doc)
Method Detail

processWebXML

public void processWebXML()
                   throws Exception

processWebXML

Infuses this PortletApplicationWar's web.xml file with servlet and a servlet-mapping element for the JetspeedContainer servlet. This is only done if the descriptor does not already contain these items.

Throws:
MetaDataException - if there is a problem infusing
Exception

insertContextNameParam

private void insertContextNameParam(org.jdom.Element jetspeedServletElement)

insertLoadOnStartup

private void insertLoadOnStartup(org.jdom.Element jetspeedServletElement)

isChanged

public boolean isChanged()

insertElementCorrectly

protected void insertElementCorrectly(org.jdom.Element root,
                                      org.jdom.Element toInsert,
                                      String[] elementsBefore)
                               throws Exception

insertElementCorrectly

Parameters:
root - JDom element representing the < web-app >
toInsert - JDom element to insert into the web.xml hierarchy.
elementsBefore - an array of web.xml elements that should be defined before the element we want to insert. This order should be the order defined by the web.xml's DTD type definition.
Throws:
Exception

isPortletTaglibAdded

public boolean isPortletTaglibAdded()
Returns:
Returns the portletTaglibAdded.


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