com.astroshare.astroonline.horoscopes
Class Horoscope

java.lang.Object
  extended by com.astroshare.astroonline.horoscopes.Horoscope
Direct Known Subclasses:
Lov, Natal, Partner, Sign

public abstract class Horoscope
extends java.lang.Object

Implementation of Horoscope base class.

This class should be used by every class which implements an online horoscope. The content servlet calls specific methods from this base class. Therefor all sub classes must have the methods called from the content servlet and these methods should implement the necessary functionality to work properly.

To write a new online horoscope, create a subclass and implement the ncessary methods. Add your new online horoscope to the list of installed horoscopes and call your horoscope from by adding the appropriete arguments on the URL.


Field Summary
protected  java.util.HashMap<java.lang.String,java.lang.Object> args
          arguments from URL converted to hashmap
protected  java.lang.String databaseID
          horoscope database ID
protected  java.lang.String horoscopeID
          horoscope ID
protected  java.lang.String language
          horoscope language
protected static org.apache.log4j.Logger log
          init logging
protected  boolean startupMode
          startup mode (Y/N)
protected  java.lang.String templateInput
          name of the input template
protected  java.lang.String templateOutput
          name of the output template
 
Constructor Summary
Horoscope()
           
 
Method Summary
protected abstract  boolean checkHoroscopeData()
           Abstract method checkHoroscopeData must be implemented in every sub class.
protected  java.util.HashMap<java.lang.String,java.lang.Object> getFormText()
           Get all form text converted to a hashmap.
 java.lang.String getHoroscope(java.util.HashMap<java.lang.String,java.lang.Object> params)
           Function must be called directly from servlet.
protected abstract  void getHoroscopeArguments()
           Abstract method getHoroscopeArguments must be implemented in every sub class.
protected abstract  java.util.HashMap<java.lang.String,java.lang.Object> getInputMap()
           Abstract method getInputMap must be implemented in every sub class.
protected  java.lang.String getInputPage()
           Implemented the implementation of the input page.
protected  java.util.HashMap<java.lang.String,java.lang.Object> getMap()
           Get all horoscope data converted to a hashmap.
protected abstract  java.util.HashMap<java.lang.String,java.lang.Object> getOutputMap()
           Abstract method getOutputMap must be implemented in every sub class.
protected  java.lang.String getOutputPage()
           Implemented the implementation of the output page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.log4j.Logger log
init logging


args

protected java.util.HashMap<java.lang.String,java.lang.Object> args
arguments from URL converted to hashmap


startupMode

protected boolean startupMode
startup mode (Y/N)


horoscopeID

protected java.lang.String horoscopeID
horoscope ID


databaseID

protected java.lang.String databaseID
horoscope database ID


templateInput

protected java.lang.String templateInput
name of the input template


templateOutput

protected java.lang.String templateOutput
name of the output template


language

protected java.lang.String language
horoscope language

Constructor Detail

Horoscope

public Horoscope()
Method Detail

getHoroscope

public java.lang.String getHoroscope(java.util.HashMap<java.lang.String,java.lang.Object> params)
                              throws java.lang.Exception

Function must be called directly from servlet.

Parameters:
params - URL arguments
Throws:
java.lang.Exception - Exception is thrown on errors

getInputMap

protected abstract java.util.HashMap<java.lang.String,java.lang.Object> getInputMap()

Abstract method getInputMap must be implemented in every sub class. Must implement the argument recognition and saving of all variables which have to be processed in the input template.

Returns:
Input map

getInputPage

protected java.lang.String getInputPage()

Implemented the implementation of the input page. The input page is returned as string.

Returns:
String Input page

getOutputMap

protected abstract java.util.HashMap<java.lang.String,java.lang.Object> getOutputMap()

Abstract method getOutputMap must be implemented in every sub class. Must implement the argument recognition and saving of all variables which have to be processed in the output template.

Returns:
String Output map

getOutputPage

protected java.lang.String getOutputPage()

Implemented the implementation of the output page. The output page is returned as string.

Returns:
String Output page

getHoroscopeArguments

protected abstract void getHoroscopeArguments()

Abstract method getHoroscopeArguments must be implemented in every sub class. Must implement the argument recognition and saving.


checkHoroscopeData

protected abstract boolean checkHoroscopeData()

Abstract method checkHoroscopeData must be implemented in every sub class. Must implement the verification of the arguments.

Returns:
TRUE=Data is valid;FALSE=Data is invalid

getMap

protected java.util.HashMap<java.lang.String,java.lang.Object> getMap()

Get all horoscope data converted to a hashmap.

Returns:
Hashmap containging all horoscope data

getFormText

protected java.util.HashMap<java.lang.String,java.lang.Object> getFormText()

Get all form text converted to a hashmap.

Returns:
Hashmap containging form text


Astro-Online © 2001 − 2008 Astro Share
Documentation generated on: Thursday August 12th 2008 (PS)