msi.web.client
Class DataStore

java.lang.Object
  extended byorg.apache.struts.action.ActionForm
      extended bymsi.web.client.DataStore
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
msi.web.client.LPAppInsuranceGen, msi.web.client.LPApplicationGen, LPAppStatusTransfer, msi.web.client.LPAssetGen, msi.web.client.LPBookLeaseGen, msi.web.client.LPClientGen, msi.web.client.LPNotebookGen, msi.web.client.LPPayoffQuoteGen, msi.web.client.LPReferenceGen, msi.web.client.LPUdt_TablesGen, msi.web.client.LPUserDefFieldsGen

public class DataStore
extends org.apache.struts.action.ActionForm

This is a generic container that stores our data in an internal hashtable. It is used throughout and should be inherited from and not directly called.

Author:
Joseph Acosta
See Also:
Serialized Form

Field Summary
static int DATASTORE_ADD
          formaction to add a record.
static int DATASTORE_ADD_CLONE
          formaction for addclone in lessee world
static int DATASTORE_CLONE
          formaction to clone a record
static int DATASTORE_FETCH
          formaction to fetch a record.
static int DATASTORE_RESET
          formaction to update a reset.
static int DATASTORE_SEARCH
          formaction to search for records.
static int DATASTORE_SUBMIT
          formaction to search for records.
static int DATASTORE_UNKNOWN
           
static int DATASTORE_UPDATE
          formaction to update a record.
static int ERROR_MESSAGE
          ERROR_MESSAGE is a define type var for 0 used by the subclasses of this object for their process* wsdl functions
static int INFO_MESSAGE
          INFO_MESSAGE is a define type var for 1 used by the subclasses of this object for their process* wsdl functions
static int PROCESSING_COMPLETED
          PROCESSING_COMPLETED is a define type var for 2 used by the subclasses of this object for their process* wsdl functions
 
Constructor Summary
DataStore()
          DataStore bean constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener lstnr)
          This is part of the JavaBean API requirements.
 boolean apiInitXMLParser(java.lang.String XMLDocument)
          This is used by the API.
 java.lang.String buildErrorMessage()
          This method is used only by the DataStore and mPowerRequestProcessor and is not intended to be called elsewhere.
 java.lang.String buildXmlMsg(java.lang.String xmlTopLevelElement, boolean error, java.lang.String msg)
           
 void deleteFieldValue(java.lang.String fieldName)
          A function to delete a field from the DataStore Map.
 boolean dsConnect()
           
 boolean dsConnect(java.lang.String username, java.lang.String password)
          Method for connecting to the remote xml driver through the WSDL interface.
 boolean dsConnectAsUser(java.lang.String username, java.lang.String password)
          Method for connecting to the remote xml driver through the WSDL interface.
 boolean dsConnectUseINI(java.lang.String iniName)
           
 boolean dsConnectWithINI(java.lang.String username, java.lang.String password, java.lang.String iniFile)
          Method for connecting to the remote xml driver through the WSDL interface.
 void dsDisconnect()
          Method to Disconnect and terminate the XMLRequestor.
 java.lang.String dsProcessRequest()
          Method that processes the Hashtable currently stored in the session.
 java.lang.String dsProcessSearchRequest(java.lang.String xslFile)
          Method that processes the Hashtable currently stored in the session.
 void dsSetDebugMode(boolean onOrOff)
          Method to turn on or off debugging.
 java.util.Map getAll()
          A function to get the data store as a map.
 java.lang.String getCompany()
          public function to get the company.
 java.util.Hashtable getCurrentData()
          this gets the contents of the DataStore hashtable.
 java.lang.String getErrorMessage()
          This method gets the messages from the server.
 java.lang.String getFieldValue(java.lang.String fieldName)
          A function to get a field from the DataStore Map.
 int getFormAction()
          A function to get the formaction in the DataStore Map.
 java.lang.String getInfoMessage()
          This method gets INFO the messages from the server.
 java.util.Hashtable getLPCodes(java.lang.String codename)
          A function to deal with the codes in mPower.
 java.lang.String getModulenumber()
          A function to get the modulenumber from the DataStore Map.
 java.lang.String getMpd_Build_sequence()
           
 java.lang.String getOffice()
          public function to get the office.
 java.lang.String getPortfolio()
          public function to get the portfolio.
 java.lang.String getRegion()
          public function to get the region.
 java.lang.String getResultData()
           
 java.util.Hashtable getStateCodes()
          A function to deal with the STATE codes in mPower.
 java.lang.String getWarnMessage()
          This method gets WARN the messages from the server.
 java.lang.String getXML_Build_sequence()
           
 java.lang.String hashtableToXml(java.util.Hashtable tbl, java.lang.String xmlTopLevelElement)
           
 void initLabels(msi.util.mplabels relabel)
          This object takes an existing mplabels object and uses it to initialize this object for the life of this object.
 int processFormActionType(java.lang.String type)
          This returns the form action type from the object.
 void putAll(java.util.Map allData)
          A function to set the DataStore Map.
 void removePropertyChangeListener(java.beans.PropertyChangeListener lstnr)
          This is part of the JavaBean API requirements.
 void resetDataStore()
          A function to reinitialize the DataStore so that all data is removed and new data can start being added.
 java.lang.String selfToXML(java.lang.String xmlTopLevelElement)
           
 void setCompany(java.lang.String comp)
          public function to set the company.
 void setCurrentData(java.util.Hashtable currdata)
          in one fell swoop you could set the contents of the hashtable If you know what you are doing INTERNAL to mPower.
 void setDefaultPCRO(java.lang.String port, java.lang.String comp, java.lang.String region, java.lang.String office)
          This sets up the default portfolio, company, region and office.
 boolean setField(java.lang.String fieldName, java.lang.String fieldValue)
          A function to set a field in the DataStore Map.
 void setFormAction(java.lang.String fieldValue)
          A function to set the formaction in the DataStore Map.
 void setFormActionAdd()
          A function to set the formaction in the DataStore Map to Add a record.
 void setFormActionClone()
          A function to set the formaction in the DataStore Map to Clone a record.
 void setFormActionFetch()
          A function to set the formaction in the DataStore Map to Fetch a record.
 void setFormActionReset()
          A function to set the formaction in the DataStore Map to Reset.
 void setFormActionSearch()
          A function to set the formaction in the DataStore Map to Search.
 void setFormActionUpdate()
          A function to set the formaction in the DataStore Map to Update a record.
 void setLocale(msi.util.mplabels local)
          using the mplabels object set the local INTERNAL to mPower.
 void setModulenumber(java.lang.String fieldValue)
          A function to set the modulenumber in the DataStore Map.
 void setOffice(java.lang.String office)
          public function to set the office.
 void setPortfolio(java.lang.String port)
          public function to set the portfolio.
 void setRegion(java.lang.String region)
          public function to set the region.
 
Methods inherited from class org.apache.struts.action.ActionForm
getMultipartRequestHandler, getServletWrapper, reset, reset, setMultipartRequestHandler, setServlet, validate, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_MESSAGE

public static final int ERROR_MESSAGE
ERROR_MESSAGE is a define type var for 0 used by the subclasses of this object for their process* wsdl functions

See Also:
Constant Field Values

INFO_MESSAGE

public static final int INFO_MESSAGE
INFO_MESSAGE is a define type var for 1 used by the subclasses of this object for their process* wsdl functions

See Also:
Constant Field Values

PROCESSING_COMPLETED

public static final int PROCESSING_COMPLETED
PROCESSING_COMPLETED is a define type var for 2 used by the subclasses of this object for their process* wsdl functions

See Also:
Constant Field Values

DATASTORE_ADD

public static final int DATASTORE_ADD
formaction to add a record.

See Also:
Constant Field Values

DATASTORE_UPDATE

public static final int DATASTORE_UPDATE
formaction to update a record.

See Also:
Constant Field Values

DATASTORE_RESET

public static final int DATASTORE_RESET
formaction to update a reset.

See Also:
Constant Field Values

DATASTORE_FETCH

public static final int DATASTORE_FETCH
formaction to fetch a record.

See Also:
Constant Field Values

DATASTORE_SEARCH

public static final int DATASTORE_SEARCH
formaction to search for records.

See Also:
Constant Field Values

DATASTORE_SUBMIT

public static final int DATASTORE_SUBMIT
formaction to search for records.

See Also:
Constant Field Values

DATASTORE_CLONE

public static final int DATASTORE_CLONE
formaction to clone a record

See Also:
Constant Field Values

DATASTORE_ADD_CLONE

public static final int DATASTORE_ADD_CLONE
formaction for addclone in lessee world

See Also:
Constant Field Values

DATASTORE_UNKNOWN

public static final int DATASTORE_UNKNOWN
See Also:
Constant Field Values
Constructor Detail

DataStore

public DataStore()
DataStore bean constructor.

Method Detail

initLabels

public void initLabels(msi.util.mplabels relabel)
This object takes an existing mplabels object and uses it to initialize this object for the life of this object. INTERNAL to mPower.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener lstnr)
This is part of the JavaBean API requirements.

Parameters:
lstnr -

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener lstnr)
This is part of the JavaBean API requirements.

Parameters:
lstnr -

processFormActionType

public int processFormActionType(java.lang.String type)
This returns the form action type from the object. INTERNAL to mPower.

Parameters:
type - - the type of form action.
Returns:
int - the formaction type.

setLocale

public void setLocale(msi.util.mplabels local)
using the mplabels object set the local INTERNAL to mPower.


getAll

public java.util.Map getAll()
A function to get the data store as a map. INTERNAL to mPower.

Returns:
Map of the current contents of the DataStore.

getCurrentData

public java.util.Hashtable getCurrentData()
this gets the contents of the DataStore hashtable. INTERNAL to mPower.


setCurrentData

public void setCurrentData(java.util.Hashtable currdata)
in one fell swoop you could set the contents of the hashtable If you know what you are doing INTERNAL to mPower.


resetDataStore

public void resetDataStore()
A function to reinitialize the DataStore so that all data is removed and new data can start being added. This is useful in situation where the DataStore has been used to update one record and a second seperate transaction needs to be done in the same session. Each object that inherits from this object will have this in it and the api user should call this between add and updates ONLY!


setField

public boolean setField(java.lang.String fieldName,
                        java.lang.String fieldValue)
A function to set a field in the DataStore Map. INTERNAL to mPower, internally used in the API.

Parameters:
fieldName - - the name of the field to set.
fieldValue - - the value of the field.
Returns:
boolean - true on success or false on fail.

getFieldValue

public java.lang.String getFieldValue(java.lang.String fieldName)
A function to get a field from the DataStore Map. INTERNAL to mPower, internally used in the API.

Parameters:
fieldName - - the name of the field to set.
Returns:
String fieldValue - the value of the field.

deleteFieldValue

public void deleteFieldValue(java.lang.String fieldName)
A function to delete a field from the DataStore Map. INTERNAL to mPower.

Parameters:
fieldName - - the name of the field to delete.

setModulenumber

public void setModulenumber(java.lang.String fieldValue)
A function to set the modulenumber in the DataStore Map. INTERNAL to mPower, internally used in the API.

Parameters:
fieldValue - - the value of the module number.

getModulenumber

public java.lang.String getModulenumber()
A function to get the modulenumber from the DataStore Map. INTERNAL to mPower, internally used in the API.

Returns:
- the value of the module number.

getFormAction

public int getFormAction()
A function to get the formaction in the DataStore Map. INTERNAL to mPower, internally used in the API.

Returns:
int - the DATASTORE formaction int number one of DATASTORE_UPDATE, DATASTORE_FETCH, DATASTORE_SEARCH.

setFormAction

public void setFormAction(java.lang.String fieldValue)
A function to set the formaction in the DataStore Map. INTERNAL to mPower, internally used in the API.

Parameters:
fieldValue - - the value of the formaction.

setFormActionAdd

public void setFormActionAdd()
A function to set the formaction in the DataStore Map to Add a record. INTERNAL to mPower, internally used in the API.


setFormActionFetch

public void setFormActionFetch()
A function to set the formaction in the DataStore Map to Fetch a record. INTERNAL to mPower, internally used in the API.


setFormActionUpdate

public void setFormActionUpdate()
A function to set the formaction in the DataStore Map to Update a record. INTERNAL to mPower, internally used in the API.


setFormActionClone

public void setFormActionClone()
A function to set the formaction in the DataStore Map to Clone a record. INTERNAL to mPower, internally used in the API.

Returns:
boolean - true on success or false on fail.

setFormActionSearch

public void setFormActionSearch()
A function to set the formaction in the DataStore Map to Search. INTERNAL to mPower, internally used in the API.


setFormActionReset

public void setFormActionReset()
A function to set the formaction in the DataStore Map to Reset. INTERNAL to mPower, internally used in the API.


putAll

public void putAll(java.util.Map allData)
A function to set the DataStore Map. INTERNAL to mPower.

Parameters:
allData - - all the data to go into the map.

getLPCodes

public java.util.Hashtable getLPCodes(java.lang.String codename)
A function to deal with the codes in mPower. INTERNAL to mPower.

Returns:
- all the data FROM the LPCodes map.

getStateCodes

public java.util.Hashtable getStateCodes()
A function to deal with the STATE codes in mPower. INTERNAL to mPower.

Returns:
- a hashtable containing all the states long names and shortnames.

setPortfolio

public void setPortfolio(java.lang.String port)
public function to set the portfolio.

Parameters:
port - - portfolio.

setCompany

public void setCompany(java.lang.String comp)
public function to set the company.

Parameters:
comp - - company.

setRegion

public void setRegion(java.lang.String region)
public function to set the region.

Parameters:
region - - region.

setOffice

public void setOffice(java.lang.String office)
public function to set the office.

Parameters:
office - - office.
Returns:
none.

getPortfolio

public java.lang.String getPortfolio()
public function to get the portfolio.

Returns:
String portfolio.

getCompany

public java.lang.String getCompany()
public function to get the company.

Returns:
String company.

getRegion

public java.lang.String getRegion()
public function to get the region.

Returns:
String region.

getOffice

public java.lang.String getOffice()
public function to get the office.

Returns:
String office.

setDefaultPCRO

public void setDefaultPCRO(java.lang.String port,
                           java.lang.String comp,
                           java.lang.String region,
                           java.lang.String office)
This sets up the default portfolio, company, region and office.

Parameters:
port - - the portfolio.
comp - - the company.
region - - the region.
office - - the office.

apiInitXMLParser

public boolean apiInitXMLParser(java.lang.String XMLDocument)
This is used by the API. If the caller of the API chooses the XML version of the API, then this method is called.

Parameters:
XMLDocument - - the full large or small xml document.
Returns:
boolean - if the file was parsed or not

dsConnect

public boolean dsConnect()
                  throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

dsConnectUseINI

public boolean dsConnectUseINI(java.lang.String iniName)
                        throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

dsConnectAsUser

public boolean dsConnectAsUser(java.lang.String username,
                               java.lang.String password)
                        throws java.rmi.RemoteException
Method for connecting to the remote xml driver through the WSDL interface.

Parameters:
username - - the leasepak username to use to login to the server.
password - - the leasepak network encrypted password.
Returns:
boolean - sets error message and returns false on fail or true on success.
Throws:
throws - RemoteException
java.rmi.RemoteException

dsConnect

public boolean dsConnect(java.lang.String username,
                         java.lang.String password)
                  throws java.rmi.RemoteException
Method for connecting to the remote xml driver through the WSDL interface.

Parameters:
username - - the leasepak username to use to login to the server.
password - - the leasepak network encrypted password.
Returns:
boolean - sets error message and returns false on fail or true on success.
Throws:
throws - RemoteException
java.rmi.RemoteException

dsConnectWithINI

public boolean dsConnectWithINI(java.lang.String username,
                                java.lang.String password,
                                java.lang.String iniFile)
                         throws java.rmi.RemoteException
Method for connecting to the remote xml driver through the WSDL interface.

Parameters:
username - - the leasepak username to use to login to the server.
password - - the leasepak network encrypted password.
iniFile - - the leasepak ini filename.
Returns:
boolean - sets error message and returns false on fail or true on success.
Throws:
throws - RemoteException
java.rmi.RemoteException

dsDisconnect

public void dsDisconnect()
                  throws java.rmi.RemoteException
Method to Disconnect and terminate the XMLRequestor.

Throws:
throws - RemoteException
java.rmi.RemoteException

dsSetDebugMode

public void dsSetDebugMode(boolean onOrOff)
                    throws java.rmi.RemoteException
Method to turn on or off debugging.

Parameters:
onOrOff - - turn the debugging on or off.
Returns:
none.
Throws:
RemoteException.
java.rmi.RemoteException

dsProcessRequest

public java.lang.String dsProcessRequest()
                                  throws java.rmi.RemoteException
Method that processes the Hashtable currently stored in the session. A map MUSt exist in the session. This function takes the hashtable currently stored in the session and send it to the leasepak server, by calling the XMLRequestor and having the requestor process the data. The result is stored in the hashtable.

Returns:
String - one of the following will be set 1) ITEMLIST - this means that the Hashtable has more name / value pairs; 2) ITEMSTRING - xsl transformed data as a string; 3) REPORT- report data as a String; 4) ERROR - an error message; or 5) INFO - an information message, like Lessee Added.
Throws:
throws - RemoteException
java.rmi.RemoteException

dsProcessSearchRequest

public java.lang.String dsProcessSearchRequest(java.lang.String xslFile)
                                        throws java.rmi.RemoteException
Method that processes the Hashtable currently stored in the session. A map MUSt exist in the session. This function takes the hashtable currently stored in the session and send it to the leasepak server, by calling the XMLRequestor and having the requestor process the data. The result is stored in the hashtable.

Parameters:
xslFile - caller should pass either none or an xsl File.
Returns:
String - one of the following will be set 1) ITEMLIST - this means that the Hashtable has more name / value pairs; 2) ITEMSTRING - xsl transformed data as a string; 3) REPORT- report data as a String; 4) ERROR - an error message; or 5) INFO - an information message, like Lessee Added.
Throws:
throws - RemoteException
java.rmi.RemoteException

getErrorMessage

public java.lang.String getErrorMessage()
This method gets the messages from the server.

Returns:
String - contains the message.

getWarnMessage

public java.lang.String getWarnMessage()
This method gets WARN the messages from the server.

Returns:
String - contains the message.

getInfoMessage

public java.lang.String getInfoMessage()
This method gets INFO the messages from the server.

Returns:
String - contains the message.

getResultData

public java.lang.String getResultData()

getMpd_Build_sequence

public java.lang.String getMpd_Build_sequence()

getXML_Build_sequence

public java.lang.String getXML_Build_sequence()

hashtableToXml

public java.lang.String hashtableToXml(java.util.Hashtable tbl,
                                       java.lang.String xmlTopLevelElement)

selfToXML

public java.lang.String selfToXML(java.lang.String xmlTopLevelElement)

buildXmlMsg

public java.lang.String buildXmlMsg(java.lang.String xmlTopLevelElement,
                                    boolean error,
                                    java.lang.String msg)

buildErrorMessage

public java.lang.String buildErrorMessage()
                                   throws java.rmi.RemoteException
This method is used only by the DataStore and mPowerRequestProcessor and is not intended to be called elsewhere. It is essentially a private method for building error message strings.

Returns:
String - this string contains the data within the conneciton object itself.
Throws:
throws - RemoteException
java.rmi.RemoteException


© 2008 by NetSol Technologies, Inc.

All rights reserved.The information contained in this document is the property of NetSol Technologies, Inc. Use of the information contained herein is restricted. Conditions of use are subject to change without notice. NetSol Technologies, Inc. assumes no liability for any inaccuracy that may appear in this document; the contents of this document do not constitute a promise or warranty. The software described in this document is furnished under license and may be used or copied only in accordance with the terms of said license. Unauthorized use, alteration, or reproduction of this document without the written consent of NetSol Technologies, Inc. is prohibited.