/********************************************************************
 *  Oracle JDeveloper
 *  Copyright (c) 1997, 1999, Oracle Corporation. All rights reserved.
 ********************************************************************/


package oracle.jdeveloper.html;

import java.io.*;
import oracle.jdeveloper.html.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

/**
 * Implements basic rendering and initialization functionality for
 * Web Beans.
 */
public interface WebBean
{
   public static final int JSUtilitiesLib              = 1;
   public static final int JSTableConstructLib         = 2;
   public static final int JSDataConstructLib          = 4;
   public static final int JSTreeConstructLib          = 8;
   public static final int JSToolbarConstructorLib     = 16;
   public static final int JSCalendarConstructorLib    = 32;
   public static final int JSModalPageConstructorLib   = 64;
   public static final int JSButtonConstructorLib      = 128;
   public static final int JSContainerConstructorLib   = 256;

   public static final String JS_LIBRARIES = "JS_LIBRARIES";
   public static final String JS_NAMEID = "JS_NAMEID";
   public static final String contentFrameName = "_cnt";
   public static final String defaultImageBase = "/webapp/images";
   public static final String defaultCaboImageBase = "/webapp/jsimages";
   public static final String defaultJSPBase = "/webapp/jsp";
   public static final String defaultCaboBase = "/webapp/cabo";

   /**
   * Initializes this Web Bean object to
   * access the important objects of the JSP: application, session,
   * request, response, and out.
   * <p>
   * @param appContext     the JSP page's ServletContext.
   * @param session        the JSP page's HttpSession.
   * @param request        the JSP page's HttpServletRequest.
   * @param response       the JSP page's HttpServletResponse.
   * @param out            the PrintWriter to render to.
   */	
	public void        initialize(ServletContext appContext, HttpSession session , HttpServletRequest request, HttpServletResponse response, PrintWriter out)  throws Exception;

   /**
   * Initializes this Web Bean object to
   * access the important objects of the JSP: application, session,
   * request, response, and out.
   *
   * @param page           the JSP page's ServletContext.
   */	
	public void        initialize(PageContext page)  throws Exception;
   
   /**
	*	Internal initialize.
   * This method should be overriden by any WebBean needing to initialize some internal data
   * after all the base class member have been initialize properly.
	*/
   public void        internalInitialize()  throws Exception; 
   
   /**
	*	Renders the Web Bean's contents to the output stream.
	*/
	public void        render()  throws Exception;

	/**
	*	Renders the Web Bean's contents to the specified PrintWriter.
	* <p>
	*	@param out	the PrintWriter to render to.
	*/
	public void        render(PrintWriter out) throws Exception;	
}