com.opencms.core
Class CmsExportRequest

java.lang.Object
  |
  +--com.opencms.core.CmsExportRequest
All Implemented Interfaces:
I_CmsRequest

public class CmsExportRequest
extends Object
implements I_CmsRequest

Implementation of the I_CmsRequest interface which is used to request pages during a static export.

Version:
$Revision: 1.9 $ $Date: 2002/12/06 16:00:50 $

Constructor Summary
CmsExportRequest(javax.servlet.http.HttpServletRequest req)
           
CmsExportRequest(String webAppUrl, String servletUrl)
           
 
Method Summary
 byte[] getFile(String name)
          Returns the content of an uploaded file.
 Enumeration getFileNames()
          Returns the names of all uploaded files in this request.
 Object getOriginalRequest()
          Returns the original request that was used to create the CmsRequest.
 int getOriginalRequestType()
          Returns the type of the request that was used to create the CmsRequest.
 String getParameter(String name)
          Returns the value of a named parameter as a String.
 Enumeration getParameterNames()
          Returns all parameter names as an Enumeration of String objects.
 String[] getParameterValues(String key)
          Returns all parameter values of a parameter key.
 String getRequestedResource()
          This funtion returns the name of the requested resource.
 String getScheme()
          Methods to get the data from the original request.
 String getServerName()
          Methods to get the data from the original request.
 int getServerPort()
          Methods to get the data from the original request.
 String getServletUrl()
          Gets the part of the Url that describes the current servlet of this Web-Application.
 String getWebAppUrl()
          Returns the part of the Url that descibes the Web-Application.
 void setOriginalRequest(Object request)
          Sets the original request to another value
 void setParameters(Hashtable parameters)
          sets the parameters for this static export.
 void setRequestedResource(String res)
          Set the name returned by getRequestedResource().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsExportRequest

public CmsExportRequest(javax.servlet.http.HttpServletRequest req)

CmsExportRequest

public CmsExportRequest(String webAppUrl,
                        String servletUrl)
Method Detail

getFile

public byte[] getFile(String name)
Description copied from interface: I_CmsRequest
Returns the content of an uploaded file. Returns null if no file with this name has been uploaded with this request. Returns an empty byte[] if a file without content has been uploaded.

Specified by:
getFile in interface I_CmsRequest
Parameters:
name - The name of the uploaded file.
Returns:
The selected uploaded file content.

getFileNames

public Enumeration getFileNames()
Description copied from interface: I_CmsRequest
Returns the names of all uploaded files in this request. Returns an empty eumeration if no files were included in the request.

Specified by:
getFileNames in interface I_CmsRequest
Returns:
An Enumeration of file names.

getOriginalRequest

public Object getOriginalRequest()
Description copied from interface: I_CmsRequest
Returns the original request that was used to create the CmsRequest.

Specified by:
getOriginalRequest in interface I_CmsRequest
Returns:
The original request of the CmsRequest.

setOriginalRequest

public void setOriginalRequest(Object request)
Description copied from interface: I_CmsRequest
Sets the original request to another value

Specified by:
setOriginalRequest in interface I_CmsRequest

getOriginalRequestType

public int getOriginalRequestType()
Description copied from interface: I_CmsRequest
Returns the type of the request that was used to create the CmsRequest. The returned int must be one of the constants defined above in this interface.

Specified by:
getOriginalRequestType in interface I_CmsRequest
Returns:
The type of the CmsRequest.

getParameter

public String getParameter(String name)
Description copied from interface: I_CmsRequest
Returns the value of a named parameter as a String. Returns null if the parameter does not exist or an empty string if the parameter exists but without a value.

Specified by:
getParameter in interface I_CmsRequest
Parameters:
name - The name of the parameter.
Returns:
The value of the parameter.

getParameterNames

public Enumeration getParameterNames()
Description copied from interface: I_CmsRequest
Returns all parameter names as an Enumeration of String objects. Returns an empty Enumeratrion if no parameters were included in the request.

Specified by:
getParameterNames in interface I_CmsRequest
Returns:
Enumeration of parameter names.

getParameterValues

public String[] getParameterValues(String key)
Description copied from interface: I_CmsRequest
Returns all parameter values of a parameter key.

Specified by:
getParameterValues in interface I_CmsRequest
Returns:
Aarray of String containing the parameter values.

setParameters

public void setParameters(Hashtable parameters)
sets the parameters for this static export.

Parameters:
parameters - The Hashtable with the parameters (contains String[])

getRequestedResource

public String getRequestedResource()
Description copied from interface: I_CmsRequest
This funtion returns the name of the requested resource.

For a http request, the name of the resource is extracted as follows: http://{servername}/{servletpath}/{path to the cms resource} In the following example: http://my.work.server/servlet/opencms/system/def/explorer the requested resource is /system/def/explorer.

Specified by:
getRequestedResource in interface I_CmsRequest
Returns:
The path to the requested resource.

setRequestedResource

public void setRequestedResource(String res)
Description copied from interface: I_CmsRequest
Set the name returned by getRequestedResource(). This is required in case there was a folder name requested and a default file (e.g. index.html) has to be used instead of the folder.

Specified by:
setRequestedResource in interface I_CmsRequest
Parameters:
res - The name to set the requested resource name to

getWebAppUrl

public String getWebAppUrl()
Returns the part of the Url that descibes the Web-Application. E.g: http://www.myserver.com/opencms/engine/index.html returns http://www.myserver.com/opencms

Specified by:
getWebAppUrl in interface I_CmsRequest

getServletUrl

public String getServletUrl()
Gets the part of the Url that describes the current servlet of this Web-Application.

Specified by:
getServletUrl in interface I_CmsRequest

getServerName

public String getServerName()
Methods to get the data from the original request.

Specified by:
getServerName in interface I_CmsRequest

getServerPort

public int getServerPort()
Methods to get the data from the original request.

Specified by:
getServerPort in interface I_CmsRequest

getScheme

public String getScheme()
Methods to get the data from the original request.

Specified by:
getScheme in interface I_CmsRequest