com.opencms.flex
Interface I_CmsResourceLoader

All Known Implementing Classes:
CmsDumpLoader, CmsJspLoader, CmsXmlTemplateLoader

public interface I_CmsResourceLoader

This interface describes a resource loader for OpenCms, a class that can load a resource from the VFS, process it's contents and deliver the result to the user.

The I_CmsResourceLoader operates with Request and Response in much the same way as a standard Java web application.

The I_CmsResourceLoader is closely related to the I_CmsLauncher interface. In essence, both interfaces serve the same purpose. However, the I_ResourceLoader is much closer related to the standard Java Servlet API then the I_CmsLauncher, which makes it easier to understand for the novice OpenCms programmer. That way, a programmer will hopefully need less time to get productive with OpenCms.

This interface uses a standard servlet HttpServletRequestWrapper / HttpServletResponseWrapper that provide access to a special implementation of the RequestDispatcher. The handling of the output written to the response is done by this dispatcher. The results are then passed back to OpenCms which will deliver them to the requesting user.

Since:
FLEX alpha 1
Version:
$Revision: 1.6 $
Author:
Alexander Kandzior (a.kandzior@alkacon.com)
See Also:
CmsFlexRequest, CmsFlexResponse, CmsFlexRequestDispatcher

Field Summary
static String C_LOADER_CACHENAME
          Name of FlexCache runtime property
static String C_LOADER_CACHEPROPERTY
          The name of the VFS property that steers the caching
static String C_LOADER_EXCEPTION_PREFIX
          Prefix for exception message that occurs in a loaded file
static String C_LOADER_STREAMPROPERTY
          The name of the VFS property that steers the streaming
 
Method Summary
 void destroy()
          Destroy this ResourceLoder
 String getResourceLoaderInfo()
          Return a String describing the ResourceLoader
 void init(A_OpenCms openCms)
          Initialize the ResourceLoader.
 void load(CmsObject cms, CmsFile file, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Basic top-page processing method for a I_CmsResourceLoader, this method is called if the page is called as a sub-element on a page not already loded with a I_CmsResourceLoader, which most often would be an I_CmsLauncher then.
 void service(CmsObject cms, CmsResource file, CmsFlexRequest req, CmsFlexResponse res)
          Does the job of including the requested resource, this method is called directly if the element is called as a sub-element from another I_CmsResourceLoader.
 

Field Detail

C_LOADER_CACHEPROPERTY

public static final String C_LOADER_CACHEPROPERTY
The name of the VFS property that steers the caching

See Also:
Constant Field Values

C_LOADER_STREAMPROPERTY

public static final String C_LOADER_STREAMPROPERTY
The name of the VFS property that steers the streaming

See Also:
Constant Field Values

C_LOADER_CACHENAME

public static final String C_LOADER_CACHENAME
Name of FlexCache runtime property

See Also:
Constant Field Values

C_LOADER_EXCEPTION_PREFIX

public static final String C_LOADER_EXCEPTION_PREFIX
Prefix for exception message that occurs in a loaded file

See Also:
Constant Field Values
Method Detail

init

public void init(A_OpenCms openCms)
Initialize the ResourceLoader.

Parameters:
openCms - An A_OpenCms object to use for initalizing.

destroy

public void destroy()
Destroy this ResourceLoder


getResourceLoaderInfo

public String getResourceLoaderInfo()
Return a String describing the ResourceLoader


load

public void load(CmsObject cms,
                 CmsFile file,
                 javax.servlet.http.HttpServletRequest req,
                 javax.servlet.http.HttpServletResponse res)
          throws javax.servlet.ServletException,
                 IOException
Basic top-page processing method for a I_CmsResourceLoader, this method is called if the page is called as a sub-element on a page not already loded with a I_CmsResourceLoader, which most often would be an I_CmsLauncher then.

Parameters:
cms - the initialized CmsObject which provides user permissions
file - the requested OpenCms VFS resource
req - the original servlet request
res - the original servlet response
Throws:
javax.servlet.ServletException - might be thrown in the process of including the JSP
IOException - might be thrown in the process of including the JSP
See Also:
service(CmsObject, CmsResource, CmsFlexRequest, CmsFlexResponse)

service

public void service(CmsObject cms,
                    CmsResource file,
                    CmsFlexRequest req,
                    CmsFlexResponse res)
             throws javax.servlet.ServletException,
                    IOException
Does the job of including the requested resource, this method is called directly if the element is called as a sub-element from another I_CmsResourceLoader.

Parameters:
cms - used to access the OpenCms VFS
file - the reqested JSP file resource in the VFS
req - the current request
res - the current response
Throws:
javax.servlet.ServletException - might be thrown in the process of including the JSP
IOException - might be thrown in the process of including the JSP
See Also:
CmsFlexRequestDispatcher