|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 String[] |
ELEMENTS_BEFORE_SERVLET
|
protected static String[] |
ELEMENTS_BEFORE_SERVLET_MAPPING
|
static String |
EXTENDED_PORTLET_XML_PATH
|
static String |
JETSPEED_SERVLET_MAPPING_XPATH
|
static String |
JETSPEED_SERVLET_XPATH
|
protected static org.apache.commons.logging.Log |
log
|
protected static int |
MAX_BUFFER_SIZE
|
protected List |
openedResources
|
private long |
paChecksum
|
protected String |
paName
|
static String |
PORTLET_XML_PATH
|
private org.apache.jetspeed.om.common.portlet.MutablePortletApplication |
portletApp
|
protected org.apache.jetspeed.util.FileSystemHelper |
warStruct
|
static String |
WEB_XML_PATH
|
protected static String |
WEB_XML_STRING
|
private org.apache.jetspeed.om.common.servlet.MutableWebApplication |
webApp
|
protected String |
webAppContextRoot
|
Constructor Summary | |
---|---|
PortletApplicationWar(org.apache.jetspeed.util.FileSystemHelper warStruct,
String paName,
String webAppContextRoot)
|
|
PortletApplicationWar(org.apache.jetspeed.util.FileSystemHelper warStruct,
String paName,
String webAppContextRoot,
long paChecksum)
|
Method Summary | |
---|---|
void |
close()
close |
PortletApplicationWar |
copyWar(String targetAppRoot)
copyWar |
ClassLoader |
createClassloader(ClassLoader parent)
createClassloader |
org.apache.jetspeed.om.common.portlet.MutablePortletApplication |
createPortletApp()
|
org.apache.jetspeed.om.common.portlet.MutablePortletApplication |
createPortletApp(ClassLoader classLoader)
createPortletApp |
org.apache.jetspeed.om.common.servlet.MutableWebApplication |
createWebApp()
createWebApp |
String |
getDeployedPath()
getDeployedPath |
org.apache.jetspeed.util.FileSystemHelper |
getFileSystem()
|
protected InputStream |
getInputStream(String path)
getInputStream |
protected OutputStream |
getOutputStream(String path)
getOutputStream |
long |
getPortletApplicationChecksum()
|
String |
getPortletApplicationName()
|
protected Reader |
getReader(String path)
getReader |
protected Writer |
getWriter(String path)
|
void |
processWebXML()
processWebXML |
void |
removeWar()
removeWar |
void |
validate()
Validate a PortletApplicationDefinition tree AFTER its WebApplicationDefinition has been loaded. |
private void |
validatePortletApplicationName(String paName)
validatePortletApplicationName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String WEB_XML_STRING
public static final String PORTLET_XML_PATH
public static final String WEB_XML_PATH
public static final String EXTENDED_PORTLET_XML_PATH
protected static final int MAX_BUFFER_SIZE
public static final String JETSPEED_SERVLET_XPATH
public static final String JETSPEED_SERVLET_MAPPING_XPATH
protected static final org.apache.commons.logging.Log log
protected String paName
protected String webAppContextRoot
protected org.apache.jetspeed.util.FileSystemHelper warStruct
private org.apache.jetspeed.om.common.servlet.MutableWebApplication webApp
private org.apache.jetspeed.om.common.portlet.MutablePortletApplication portletApp
private long paChecksum
protected final List openedResources
protected static final String[] ELEMENTS_BEFORE_SERVLET
protected static final String[] ELEMENTS_BEFORE_SERVLET_MAPPING
Constructor Detail |
---|
public PortletApplicationWar(org.apache.jetspeed.util.FileSystemHelper warStruct, String paName, 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(org.apache.jetspeed.util.FileSystemHelper warStruct, String paName, String webAppContextRoot, long paChecksum)
Method Detail |
---|
public long getPortletApplicationChecksum() throws IOException
IOException
private void validatePortletApplicationName(String paName)
validatePortletApplicationName
paName
- public org.apache.jetspeed.om.common.servlet.MutableWebApplication createWebApp() throws PortletApplicationException, IOException
createWebApp
Creates a web applicaiton object based on the values in this WAR's WEB-INF/web.xml
IOException
PortletApplicationException
WebApplicationDescriptor
public org.apache.jetspeed.om.common.portlet.MutablePortletApplication createPortletApp(ClassLoader classLoader) throws PortletApplicationException, IOException
createPortletApp
Creates a portlet application object based of the WAR file's WEB-INF/portlet.xml
IOException
PortletApplicationException
org.apache.jetspeed.uitl.descriptor.PortletApplicationDescriptor
public org.apache.jetspeed.om.common.portlet.MutablePortletApplication createPortletApp() throws PortletApplicationException, IOException
PortletApplicationException
IOException
protected Reader getReader(String path) throws 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
IOException
- if the path does not exist or there was a problem reading the
WAR.protected InputStream getInputStream(String path) throws 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
IOException
- if the path does not exist or there was a problem reading the
WAR.protected OutputStream getOutputStream(String path) throws 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
IOException
- if the path does not exist or there was a problem reading the
WAR.protected Writer getWriter(String path) throws IOException
IOException
public PortletApplicationWar copyWar(String targetAppRoot) throws 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.
IOException
public void removeWar() throws 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.
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 IOException
close
Closes any resource this PortletApplicationWar may have opened.
IOException
public ClassLoader createClassloader(ClassLoader parent) throws 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
IOException
public String getPortletApplicationName()
public String getDeployedPath()
getDeployedPath
null
is the URL could not be created.public org.apache.jetspeed.util.FileSystemHelper getFileSystem()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |