org.ignition.blojsom.extension.blojsim
Class BlojsimBaseServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.ignition.blojsom.extension.blojsim.BlojsimBaseServlet
All Implemented Interfaces:
BlojsimConstants, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
BlojsimAIMServlet, BlojsimJabberServlet, BlojsimMSNServlet

public class BlojsimBaseServlet
extends javax.servlet.http.HttpServlet
implements BlojsimConstants

Base Blojsim Servlet

Version:
$Id: BlojsimBaseServlet.java,v 1.21 2003/05/11 16:12:05 intabulas Exp $
Author:
Mark Lussier
See Also:
Serialized Form

Field Summary
protected  org.ignition.blojsom.blog.Blog _blog
           
protected  java.lang.String _bloghome
           
protected  org.ignition.blojsom.blog.BlogCategory[] _categories
           
protected  java.lang.String _defaultcategory
           
protected  java.util.Map _posterhash
           
protected  java.lang.String _subject
           
protected static java.lang.String BLOJSIM_CONFIRMATION
           
protected static java.lang.String NULL_SUBJECT
           
 
Fields inherited from interface org.ignition.blojsom.extension.blojsim.BlojsimConstants
AIM_ENTRY_FOOTER, AIM_PASSWORD, AIM_SERVER, AIM_SERVER_PORT, AIM_USERID, BLOJSIM_CONFIGURATION, COMMENTED_LINE, DEFAULT_AIM_SERVER, DEFAULT_AIM_SERVER_PORT, DEFAULT_BLOJSIM_CONFIGURATION, DEFAULT_JABBER_SERVER, JABBER_ENTRY_FOOTER, JABBER_PASSWORD, JABBER_SERVER, JABBER_USERID, MSN_ENTRY_FOOTER, MSN_PASSWORD, MSN_USERID, PROTOCOL_AIM, PROTOCOL_JABBER, PROTOCOL_MSN
 
Constructor Summary
BlojsimBaseServlet()
           
 
Method Summary
 void configureBlojsim(javax.servlet.ServletContext context, java.lang.String filename)
           
protected  void configureValidPosters(java.lang.String postersfile)
          Process the Valid Blog Posters List
protected  void doGet(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
           
 java.util.Properties getConfiguration()
           
 java.lang.String getEntryFilename(java.lang.String protocol)
          Creates a timestamped entry filename for a given protocol
 java.lang.String getEntryFooter(java.lang.String protocol, java.lang.String userid)
          Returns a Entry Footer filled out with the Reply IM Hyperlink and all other neato info
 java.lang.String getEntryTimestamp()
          Returns a Timestamp String yyyyMMDD-HHmmssSS to use in the filename
 void init(javax.servlet.ServletConfig servletConfig)
           
 void processBlojsomCongfiguration(javax.servlet.ServletContext context, java.lang.String filename)
          Process the Blojsom Configuration files (blojsom.properties) to determine the home directory of the blog
 void writeEntryToFile(java.lang.String filename, java.lang.String contents)
          Write the Entry to a File
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLOJSIM_CONFIRMATION

protected static final java.lang.String BLOJSIM_CONFIRMATION
See Also:
Constant Field Values

NULL_SUBJECT

protected static final java.lang.String NULL_SUBJECT
See Also:
Constant Field Values

_posterhash

protected java.util.Map _posterhash

_bloghome

protected java.lang.String _bloghome

_blog

protected org.ignition.blojsom.blog.Blog _blog

_subject

protected java.lang.String _subject

_defaultcategory

protected java.lang.String _defaultcategory

_categories

protected org.ignition.blojsom.blog.BlogCategory[] _categories
Constructor Detail

BlojsimBaseServlet

public BlojsimBaseServlet()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest httpServletRequest,
                     javax.servlet.http.HttpServletResponse httpServletResponse)
              throws javax.servlet.ServletException,
                     java.io.IOException
Parameters:
httpServletRequest -
httpServletResponse -
Throws:
javax.servlet.ServletException
java.io.IOException

getEntryFooter

public java.lang.String getEntryFooter(java.lang.String protocol,
                                       java.lang.String userid)
Returns a Entry Footer filled out with the Reply IM Hyperlink and all other neato info

Parameters:
protocol - String representing the protocol (AIM,Jabber, etc)
userid - Posters IM User ID
Returns:
A Formatted string using the parameters

getEntryFilename

public java.lang.String getEntryFilename(java.lang.String protocol)
Creates a timestamped entry filename for a given protocol

Parameters:
protocol - String representing the protocol (AIM,Jabber, etc)
Returns:
A Formatted filename to append to catagory paths

writeEntryToFile

public void writeEntryToFile(java.lang.String filename,
                             java.lang.String contents)
Write the Entry to a File

Parameters:
filename - The fully qualified filename to write to
contents - The Blog Entry

getEntryTimestamp

public java.lang.String getEntryTimestamp()
Returns a Timestamp String yyyyMMDD-HHmmssSS to use in the filename

Returns:
The filename

configureValidPosters

protected void configureValidPosters(java.lang.String postersfile)
Process the Valid Blog Posters List

Parameters:
postersfile - The filename that contains the posters list

processBlojsomCongfiguration

public void processBlojsomCongfiguration(javax.servlet.ServletContext context,
                                         java.lang.String filename)
Process the Blojsom Configuration files (blojsom.properties) to determine the home directory of the blog

Parameters:
context - The ServletContext
filename - The Filename to process

configureBlojsim

public void configureBlojsim(javax.servlet.ServletContext context,
                             java.lang.String filename)
Parameters:
context -
filename -

init

public void init(javax.servlet.ServletConfig servletConfig)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Parameters:
servletConfig -
Throws:
javax.servlet.ServletException

getConfiguration

public java.util.Properties getConfiguration()
Returns: