/*
* This software and supporting documentation were developed by
*
* Siemens Corporate Technology
* Competence Center Knowledge Management and Business Transformation
* D-81730 Munich, Germany
*
* Authors (representing a really great team ;-) )
* Stefan B. Augustin, Thorbj�rn Hansen, Manfred Langen
*
* This software is Open Source under GNU General Public License (GPL).
* Read the text of this license in LICENSE.TXT
* or look at www.opensource.org/licenses/
*
* Once more we emphasize, that:
* THIS SOFTWARE IS MADE AVAILABLE, AS IS, WITHOUT ANY WARRANTY
* REGARDING THE SOFTWARE, ITS PERFORMANCE OR
* FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR
* ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND
* PERFORMANCE OF THE SOFTWARE IS WITH THE USER.
*
*/
// PS_Servlet
// ************ package ******************************************************
package appl.Portal.Personalize.Servlet;
// ************ imports ******************************************************
// This application/module packages
import appl.Portal.Personalize.Servlet.PS_Props;
import appl.Portal.Personalize.GUI.*;
// Other application/module packages
// KFM packages
import KFM.Exceptions.KFMException;
import KFM.ServletFramework.*;
// Library classes (JHDK, JSDK, RegExp, ...)
import javax.servlet.*;
import javax.servlet.http.*;
// Java packages
import java.io.IOException;
/** The 'PersonalizeSubscribe' servlet is responsible for the registration of new users.
*
* <H2>Requires</H2>
*
* <P>Cut+paste-source was `P_Servlet�.</P>
*
* @version 0.1 (01.02.19)
*/
public class PS_Servlet extends KFM_PropertyServlet2
{
// ************************************************************
// Variables
// ************************************************************
/** The servlet properties.
*
* Shadows `super.mProps�, which is OK, as both refer to the same object.
*/
protected PS_Props mProps = null;
// ************************************************************
// Methods
// ************************************************************
/** Called by the web server when the servlet is just loaded, and
* after a destroy.
*
* @param config The configuration information.
* We only expect one data, which is the configuration file to read,
* something like
* `configFile=O:/KFM/config/dev/dampfer/PS.properties�.
*/
public void init (ServletConfig aConfig)
throws ServletException
{
super.init(aConfig, mProps = new PS_Props() /*sic*/);
}
public void doInit(ServletConfig aConfig)
throws ServletException, NoSuchServletPropertyException, KFMException
{
// * Read the required and optional properties of `PS_Props�.
mProps.MailHost = mProps.getRequired("MailHost");
mProps.AdminEmail = mProps.getRequired("AdminEmail");
mProps.DefaultStylesheet = mProps.getRequired("DefaultStylesheet");
mProps.TemplateDir = mProps.getRequired("TemplateDir");
mProps.RegistrationRedirectUrl = mProps.getRequired("RegistrationRedirectUrl");
mProps.HotlineEmail = mProps.getOptional("HotlineEmail");
}
/** Handle all HTTP request (escpecially `doGet� and `doPost�).
*
* This method is called for each HTTP requerst.
* It Creates an applicationpage for each request and calls its `write�.
* When we get user states etc. we cannot create a new applicationpage each time,
* but don't worry about that yet.
*
* @param aReq The POST or GET request information.
* @param aRes The HTTP response object.
*
* @exception ServletException
* @exception IOException
*/
public void processRequest2 (
HttpServletRequest aReq,
HttpServletResponse aRes)
throws ServletException, IOException, KFMException
{
// Create a new ApplicationPage for each request. Really.
PS_ApplicationPage tP = new PS_ApplicationPage(mProps, aReq);
tP.setServletName(this);
tP.write(/*user state*/ null, aReq, aRes);
// Note that the ApplicationPage is thrown away. Really.
}
}