|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jetspeed.util.descriptor.PortletApplicationWar
public class PortletApplicationWar
This class facilitates operations a portlet applications WAR file or WAR file-like structure.
This class is utility class used mainly implementors of
org.apache.jetspeed.pamanager.Deployment
and
org.apache.jetspeed.pamanager.Registration
to assist in deployment
and undeployment of portlet applications.
Field Summary | |
---|---|
protected static java.lang.String[] |
ELEMENTS_BEFORE_SERVLET
|
protected static java.lang.String[] |
ELEMENTS_BEFORE_SERVLET_MAPPING
|
static java.lang.String |
EXTENDED_PORTLET_XML_PATH
|
static java.lang.String |
JETSPEED_SERVLET_MAPPING_XPATH
|
static java.lang.String |
JETSPEED_SERVLET_XPATH
|
protected static org.apache.commons.logging.Log |
log
|
protected static int |
MAX_BUFFER_SIZE
|
protected java.util.List |
openedResources
|
protected java.lang.String |
paName
|
static java.lang.String |
PORTLET_XML_PATH
|
protected FileSystemHelper |
warStruct
|
static java.lang.String |
WEB_XML_PATH
|
protected static java.lang.String |
WEB_XML_STRING
|
protected java.lang.String |
webAppContextRoot
|
Constructor Summary | |
---|---|
PortletApplicationWar(FileSystemHelper warStruct,
java.lang.String paName,
java.lang.String webAppContextRoot)
|
|
PortletApplicationWar(FileSystemHelper warStruct,
java.lang.String paName,
java.lang.String webAppContextRoot,
long paChecksum)
|
Method Summary | |
---|---|
void |
close()
close |
PortletApplicationWar |
copyWar(java.lang.String targetAppRoot)
copyWar |
java.lang.ClassLoader |
createClassloader(java.lang.ClassLoader parent)
createClassloader |
MutablePortletApplication |
createPortletApp()
|
MutablePortletApplication |
createPortletApp(java.lang.ClassLoader classLoader)
createPortletApp |
MutableWebApplication |
createWebApp()
createWebApp |
java.lang.String |
getDeployedPath()
getDeployedPath |
FileSystemHelper |
getFileSystem()
|
protected java.io.InputStream |
getInputStream(java.lang.String path)
getInputStream |
protected java.io.OutputStream |
getOutputStream(java.lang.String path)
getOutputStream |
long |
getPortletApplicationChecksum()
|
java.lang.String |
getPortletApplicationName()
|
protected java.io.Reader |
getReader(java.lang.String path)
getReader |
protected java.io.Writer |
getWriter(java.lang.String path)
|
void |
processWebXML()
processWebXML |
void |
removeWar()
removeWar |
void |
validate()
Validate a PortletApplicationDefinition tree AFTER its WebApplicationDefinition has been loaded. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String WEB_XML_STRING
public static final java.lang.String PORTLET_XML_PATH
public static final java.lang.String WEB_XML_PATH
public static final java.lang.String EXTENDED_PORTLET_XML_PATH
protected static final int MAX_BUFFER_SIZE
public static final java.lang.String JETSPEED_SERVLET_XPATH
public static final java.lang.String JETSPEED_SERVLET_MAPPING_XPATH
protected static final org.apache.commons.logging.Log log
protected java.lang.String paName
protected java.lang.String webAppContextRoot
protected FileSystemHelper warStruct
protected final java.util.List openedResources
protected static final java.lang.String[] ELEMENTS_BEFORE_SERVLET
protected static final java.lang.String[] ELEMENTS_BEFORE_SERVLET_MAPPING
Constructor Detail |
---|
public PortletApplicationWar(FileSystemHelper warStruct, java.lang.String paName, java.lang.String webAppContextRoot)
warFile
- FileSystemHelper
representing
the WAR file we are working with. This
FileSystemHelper
can be an actual WAR file or a
directory structure layed out in a WAR-like fashion. name of
the portlet application the warPath
containswebAppContextRoot
- context root relative to the servlet container of this apppublic PortletApplicationWar(FileSystemHelper warStruct, java.lang.String paName, java.lang.String webAppContextRoot, long paChecksum)
Method Detail |
---|
public long getPortletApplicationChecksum() throws java.io.IOException
java.io.IOException
public MutableWebApplication createWebApp() throws PortletApplicationException, java.io.IOException
createWebApp
Creates a web applicaiton object based on the values in this WAR's WEB-INF/web.xml
java.io.IOException
PortletApplicationException
WebApplicationDescriptor
public MutablePortletApplication createPortletApp(java.lang.ClassLoader classLoader) throws PortletApplicationException, java.io.IOException
createPortletApp
Creates a portlet application object based of the WAR file's WEB-INF/portlet.xml
java.io.IOException
PortletApplicationException
org.apache.jetspeed.uitl.descriptor.PortletApplicationDescriptor
public MutablePortletApplication createPortletApp() throws PortletApplicationException, java.io.IOException
PortletApplicationException
java.io.IOException
protected java.io.Reader getReader(java.lang.String path) throws java.io.IOException
getReader
Returns ajava.io.Reader
to a resource within this WAR's
structure.
path
- realtive to an object within this WAR's file structure
java.io.IOException
- if the path does not exist or there was a problem reading the
WAR.protected java.io.InputStream getInputStream(java.lang.String path) throws java.io.IOException
getInputStream
Returns ajava.io.InputStream
to a resource within this
WAR's structure.
path
- realtive to an object within this WAR's file structure
java.io.IOException
- if the path does not exist or there was a problem reading the
WAR.protected java.io.OutputStream getOutputStream(java.lang.String path) throws java.io.IOException
getOutputStream
Returns ajava.io.OutputStream
to a resource within this
WAR's structure.
path
- realtive to an object within this WAR's file structure
java.io.IOException
- if the path does not exist or there was a problem reading the
WAR.protected java.io.Writer getWriter(java.lang.String path) throws java.io.IOException
java.io.IOException
public PortletApplicationWar copyWar(java.lang.String targetAppRoot) throws java.io.IOException
copyWar
Copies the entire WAR structure to the path defined intargetAppRoot
targetAppRoot
- target to copy this WAR's content to. If the path ends in
.war
or .jar
. The war will be
copied into that file in jar format.
java.io.IOException
public void removeWar() throws java.io.IOException
removeWar
Deletes this WAR. If the WAR is a file structure and not an actual WAR file, all children are delted first, then the directory is removed.
java.io.IOException
- if there is an error removing the WAR from the file system.public void validate() throws PortletApplicationException
PortletApplicationException
public void processWebXML() throws MetaDataException
processWebXML
Infuses this PortletApplicationWar's web.xml file withservlet
and a servlet-mapping
element for
the JetspeedContainer servlet. This is only done if the descriptor does
not already contain these items.
MetaDataException
- if there is a problem infusingpublic void close() throws java.io.IOException
close
Closes any resource this PortletApplicationWar may have opened.
java.io.IOException
public java.lang.ClassLoader createClassloader(java.lang.ClassLoader parent) throws java.io.IOException
createClassloader
Use this method to create a classloader based on this wars structure. I.e. it will create a ClassLoader containing the contents of WEB-INF/classes and WEB-INF/lib and the ClassLoader will be searched in that order.
parent
- Parent ClassLoader. Can be null
java.io.IOException
public java.lang.String getPortletApplicationName()
public java.lang.String getDeployedPath()
getDeployedPath
null
is the URL could not be created.public FileSystemHelper getFileSystem()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |