infosapient.servlet
Class KBServlet

infosapient.servlet.KBServlet

public class KBServlet

KBServlet
Responsible for interaction with a KnowledgeBase as a whole.

Version:
$Revision: 1.1.1.1 $

Modification Log:


Field Summary
(package private) static boolean debugInWTE
           
private  boolean debugToConsole
           
private static java.util.Properties properties
           
private  boolean trace_enabled
           
private  int trace_indent
           
 
Constructor Summary
KBServlet()
           
 
Method Summary
private  void browserType(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          This method determines what browser is being used.
private  void cancelChanges(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          Reopens the knowledgebase to cancel changes made after the last save Creation date: (1/10/00 2:33:28 PM)
private  void createKB(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          Creates an empty KnowledgeBase with a given name.
private  void deleteKB(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          Physically deletes a knowledgebase file, and removes the knowledgebase object from the user session.
 void doGet(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          directs the reponse to the proper method
 void doPost(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          directs the reponse to the proper method
private  java.util.Properties getKBProperties()
           
private  void getSaved(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          This method creates the JavaScript for create_kb.shtml which checks to see if the current knowledgebase in the session is saved or not Creation date: (1/19/00 2:33:10 PM)
 java.lang.String getServletInfo()
           
private  void goToPage(java.lang.String address, infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          Method for forwarding pages instead of duplicating code in other methods.
 void init(infosapient.servlet.ServletConfig config)
           
 void log(java.lang.String str)
          Extends the servlet log() method by adding a timestamp Creation date: (12/13/1999 8:50:25 PM)
private  void logout(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          checks to make sure the kb is saved and logs the kb out of the session Creation date: (1/14/00 3:51:17 PM)
private  void openKB(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          Parses a knowledgebase file and stores the resulting kb in the user session.
private  void returnFriendlyError(java.lang.String methodName, java.lang.String errorMessage, infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          Handles passing error messages back to the client
private  void saveKB(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          Saves an existing KnowledgeBase Creation date: (12/13/1999 10:16:34 AM)
private  void setKbProps(infosapient.servlet.HttpServletRequest request, infosapient.servlet.HttpServletResponse response)
          Retrieves an existing knowledgebase from the session, and updates its properties from values in the request stream., The parameters are pased in the request stream.
private  void trace_call(java.lang.String s)
           
private  void trace_return(java.lang.String s)
           
 

Field Detail

properties

private static java.util.Properties properties

debugInWTE

static final boolean debugInWTE

trace_enabled

private boolean trace_enabled

trace_indent

private int trace_indent

debugToConsole

private boolean debugToConsole
Constructor Detail

KBServlet

public KBServlet()
Method Detail

browserType

private void browserType(infosapient.servlet.HttpServletRequest request,
                         infosapient.servlet.HttpServletResponse response)
This method determines what browser is being used. Creation date: (1/20/00 9:42:16 AM)
Parameters:
request - javax.servlet.http.HttpServletRequest
response - javax.servlet.http.HttpServletResponse

cancelChanges

private void cancelChanges(infosapient.servlet.HttpServletRequest request,
                           infosapient.servlet.HttpServletResponse response)
Reopens the knowledgebase to cancel changes made after the last save Creation date: (1/10/00 2:33:28 PM)
Parameters:
request - javax.servlet.http.HttpServletRequest
response - javax.servlet.http.HttpServletResponse

createKB

private void createKB(infosapient.servlet.HttpServletRequest request,
                      infosapient.servlet.HttpServletResponse response)
               throws infosapient.servlet.ServletException
Creates an empty KnowledgeBase with a given name. Stores the kb in the user session. The parameters are passed in the request stream. Creation date: (1/21/00 2:54:31 PM)

deleteKB

private void deleteKB(infosapient.servlet.HttpServletRequest request,
                      infosapient.servlet.HttpServletResponse response)
Physically deletes a knowledgebase file, and removes the knowledgebase object from the user session. Creation date: (1/21/00 2:59:10 PM)
Parameters:
KbName - Name of the knowledgebase to create.

doGet

public void doGet(infosapient.servlet.HttpServletRequest request,
                  infosapient.servlet.HttpServletResponse response)
           throws infosapient.servlet.ServletException
directs the reponse to the proper method

doPost

public void doPost(infosapient.servlet.HttpServletRequest request,
                   infosapient.servlet.HttpServletResponse response)
            throws infosapient.servlet.ServletException
directs the reponse to the proper method

getKBProperties

private java.util.Properties getKBProperties()

getSaved

private void getSaved(infosapient.servlet.HttpServletRequest request,
                      infosapient.servlet.HttpServletResponse response)
This method creates the JavaScript for create_kb.shtml which checks to see if the current knowledgebase in the session is saved or not Creation date: (1/19/00 2:33:10 PM)
Parameters:
request - javax.servlet.http.HttpServletRequest
response - javax.servlet.http.HttpServletResponse

getServletInfo

public java.lang.String getServletInfo()

goToPage

private void goToPage(java.lang.String address,
                      infosapient.servlet.HttpServletRequest request,
                      infosapient.servlet.HttpServletResponse response)
               throws java.io.IOException,
                      javax.servlet.ServletException
Method for forwarding pages instead of duplicating code in other methods. Creation date: (03/01/01 10:47:11 AM)
Parameters:
address - java.lang.String
request - javax.servlet.http.HttpServletRequest
response - javax.servlet.http.HttpServletResponse
Throws:
java.io.IOException -  
javax.servlet.ServletException -  

init

public void init(infosapient.servlet.ServletConfig config)
          throws infosapient.servlet.ServletException

log

public void log(java.lang.String str)
Extends the servlet log() method by adding a timestamp Creation date: (12/13/1999 8:50:25 PM)
Parameters:
str - java.lang.String

logout

private void logout(infosapient.servlet.HttpServletRequest request,
                    infosapient.servlet.HttpServletResponse response)
checks to make sure the kb is saved and logs the kb out of the session Creation date: (1/14/00 3:51:17 PM)
Parameters:
request - javax.servlet.http.HttpServletRequest
response - javax.servlet.http.HttpServletResponse

openKB

private void openKB(infosapient.servlet.HttpServletRequest request,
                    infosapient.servlet.HttpServletResponse response)
             throws infosapient.servlet.ServletException,
                    java.io.IOException
Parses a knowledgebase file and stores the resulting kb in the user session. The parameters are passed in the request stream. Creation date: (1/21/00 2:54:31 PM)
Parameters:
Descriptiona - text description of the kb

returnFriendlyError

private void returnFriendlyError(java.lang.String methodName,
                                 java.lang.String errorMessage,
                                 infosapient.servlet.HttpServletRequest request,
                                 infosapient.servlet.HttpServletResponse response)
                          throws java.io.IOException,
                                 infosapient.servlet.ServletException
Handles passing error messages back to the client
Parameters:
String - errorMessage
HttpServletRequest - request
HttpServletResponse - response

saveKB

private void saveKB(infosapient.servlet.HttpServletRequest request,
                    infosapient.servlet.HttpServletResponse response)
Saves an existing KnowledgeBase Creation date: (12/13/1999 10:16:34 AM)

setKbProps

private void setKbProps(infosapient.servlet.HttpServletRequest request,
                        infosapient.servlet.HttpServletResponse response)
Retrieves an existing knowledgebase from the session, and updates its properties from values in the request stream., The parameters are pased in the request stream. Creation date: (1/21/00 2:54:31 PM)
Parameters:
KbName - Name of the knowledgebase.
Description - a text description of the kb
CorrelationMethod -  
ImplicationMethod -  
ResolutionMethod -  

trace_call

private final void trace_call(java.lang.String s)

trace_return

private final void trace_return(java.lang.String s)

License to use this program is provided under the TERMS OF THE COMMON PUBLIC LICENSE 0.5. ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.

Copyright (c) 2001, Workplace Performance Tools, All Rights Reserved