Package appl.Portal.Personalize.Servlet

Source Code of appl.Portal.Personalize.Servlet.P_KFM_Servlet2

/*
*  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.
*
*/


// P_KFM_Servlet2

// ************ package ******************************************************
package appl.Portal.Personalize.Servlet;

// ************ imports ******************************************************

// Hack for Portal's servlet `Personalize�.
import appl.Portal.Personalize.DB.P_DBAuthorizedUserState2;
import appl.Portal.Personalize.GUI.*;


import java.sql.*;
import java.io.*;
import java.util.*;

import mod.AccountDB.GUI.*;
//import AuthorityDB.Utils.DB.*;


import KFM.Servlet.KFM_Servlet2_Props;
import KFM.ServletFramework.*;
import KFM.Servlet.KFM_Servlet2;
import KFM.GUI.*;
import KFM.Exceptions.*;
import KFM.*;
import KFM.HTML.*;
import KFM.DB.*;
import KFM.log.*;

import javax.servlet.*;
import javax.servlet.http.*;

import java.sql.*;
import java.io.*;
import java.util.*;


/*** This class implements the createServletTask-method for Personalize only.
*
*
* @version 0.1 (02 04 17)
*/
abstract public class P_KFM_Servlet2 extends P_ServletBroker2
{
    // ************************************************************
    // Variables
    // ************************************************************

    /** The servlet properties.
     *
     * Shadows `super.mProps�, which is OK, as both refer to the same object.
     */
    protected KFM_Servlet2_Props mProps = null;

    // ************************************************************
    // Methods
    // ************************************************************

    /** Called by the web server when the servlet is just loaded, and
     *  after a destroy.
     *
     * @param config The configuration information
     */
    public void init (ServletConfig aConfig, KFM_Servlet2_Props aProps)
        throws ServletException
    {
        super.init(aConfig, mProps = aProps);
    }

    /**
     * Called by the web server when the servlet is just loaded, and after a destroy.
     * Copied from KFM_Servlet2. Should be refactored.
     *
     * @param config The configuration information
     */
    /** Called by the web server when the servlet is just loaded, and after a destroy.
     *
     * @param config The configuration information
     */
    public void doInit(ServletConfig config)
        throws ServletException, NoSuchServletPropertyException,
                ProgrammerException, KFMException
    {
        super.doInit(config);

        KFM_Servlet2.handleDoInit(
            mProps,
            mServletProps,
            mLog);
        //
        // * Check whether connection pooling is on.
        //

        boolean tPossible = KFM_Database.isConnectionPoolingPossible(mProps.AuthorisationJdbcDriver,
                                            mProps.AuthorisationJdbcConnectionURL,
                                            mProps.AuthorisationJdbcUser);
        String tMsg = this.getClass().getName() + ": "
            + (tPossible == false ? "WARNING!" : "")
            + "KFM_Database.isConnectionPoolingPossible("
                + "\"" + mProps.AuthorisationJdbcDriver + "\", \""
                + mProps.AuthorisationJdbcConnectionURL + "\", \""
                + mProps.AuthorisationJdbcUser + "\""
            + ") returned " + tPossible + ".\n"
            + "Note: `false� probably means you made an error during configuration.\n"
            + "Note: `true� means that connection is *possible* but might be turned of in the Java code.";

        //
        // Log this everywhere I can think of.
        // GUS: This is a copy of ThHs paranoid code :-)
        mLog.info(tMsg);
        log(tMsg);
    }


    /** 'CreateServletTask� for use by `P_Servlet� only
     *
     * Consult documentation of `createServletTask�.
     *
     * TODO: Refactor TemplateLoginPage to P_TemplateLoginPage to hold only
     * the code for Personalize.
     */
    public ServletTask createServletTask(
        HttpServletRequest req,
        Page aApplicationPage,
        //A // Does not work yet. -- ThH
        //A KFM_Database2 aDbA,
        String aApplicationTitle,
        String aApplicationId,
        String aFeedbackmailSubject,
        P_Props aProps,
        P_Servlet aServlet)
    {
        KFM_HttpServletRequest myreq = new KFM_HttpServletRequest(req);

        aApplicationPage.setDebugMode(mProps.Debug);



        // *** Create the pages of the application

        // TODO: Refactor to P_TemplateLoginPage
        P_LoginPage loginPage = new P_LoginPage(
            KFM_HttpServletRequest.getContextAndServletPath(myreq),
            "Login",
            mProps,
            new String[] { "de", "en" },
            /*HACK IsPersonalize*/ true);

        loginPage.setDebugMode(mProps.Debug);

        //
        // create the servlet task
        //
        P_DBAuthorizedUserState2 us =
            new P_DBAuthorizedUserState2(
                loginPage, aApplicationPage,
                myreq.getParam(/*HACK HtmlParam.USERNAME*/ "members_nick"),
                aApplicationId,
                mLog,
                aProps,
                aServlet);

        return us;
    }


}
TOP

Related Classes of appl.Portal.Personalize.Servlet.P_KFM_Servlet2

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.