Rakesh API

biz.wedoit4u
Class CDASession

java.lang.Object
  extended by biz.wedoit4u.Session
      extended by biz.wedoit4u.CDASession

public class CDASession
extends Session

A class that is used to store sessional information about a user that is using the CDA.

Copyright 2003, Rakesh Vidyadharan and wedoit4u.biz

Version:
$Id: CDASession.java,v 1.4 2004/05/26 11:42:29 rakesh Exp $
Author:
Rakesh Vidyadharan 18th November 2003

Field Summary
private  int categoryId
          The site category that the user is currently browsing.
(package private)  CustomerBean cb
          The instance of CustomerBean that is associated with the user logged in.
private  boolean loggedOn
          A flag that is used to indicate that a user has successfully logged on to the service.
(package private)  SitePropertyBean spb
          The instance of SitePropertyBean that is associated with the user logged in.
private  java.lang.String username
          The username of the user currently logged on to the CDA.
 
Constructor Summary
CDASession()
          The default constructor.
 
Method Summary
 int getBottomRail()
          Returns the value of SitePropertyBean.bottomRail.
 int getCategoryId()
          Returns categoryId.
 ContentBean getContentBean(int contentId)
          Return the ContentBean instance identified by the contentId primary key value specified.
 int getContentId(java.lang.String content)
          Parse the content id out of the specified string value.
 java.lang.String getCSSContents()
          Return the CSS properties for the customer as a String.
 int getCustomerId()
          Returns the value of CustomerBean.customerId.
 java.lang.String getFooter()
          Returns the value of SitePropertyBean.footer.
 java.lang.String getHeader()
          Returns the value of SitePropertyBean.header.
 int getLeftRail()
          Returns the value of SitePropertyBean.leftRail.
 boolean getLoggedOn()
          Returns loggedOn.
 int getRightRail()
          Returns the value of SitePropertyBean.rightRail.
 int getTopRail()
          Returns the value of SitePropertyBean.topRail.
 boolean login(java.lang.String username, java.lang.String password)
          Log the specified user into the CDA.
 void setCategoryId(java.lang.String category)
          Set categoryId based upon the String value specified.
 
Methods inherited from class biz.wedoit4u.Session
getCategoryBeans, getCategoryList, getContentList, getContentList, getUniqueNumber
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loggedOn

private boolean loggedOn
A flag that is used to indicate that a user has successfully logged on to the service.


username

private java.lang.String username
The username of the user currently logged on to the CDA.


categoryId

private int categoryId
The site category that the user is currently browsing.


cb

CustomerBean cb
The instance of CustomerBean that is associated with the user logged in.


spb

SitePropertyBean spb
The instance of SitePropertyBean that is associated with the user logged in.

Constructor Detail

CDASession

public CDASession()
The default constructor. Does nothing special.

Method Detail

login

public boolean login(java.lang.String username,
                     java.lang.String password)
Log the specified user into the CDA. Just ensure that the password specified matches the username specified.

Parameters:
username - - The username that is to be matched.
password - - The password that is to be matched.
Returns:
boolean - Return true if the username exists and matches the password.

getCustomerId

public int getCustomerId()
Returns the value of CustomerBean.customerId.


getTopRail

public int getTopRail()
Returns the value of SitePropertyBean.topRail.

Returns:
int - The value of top_rail.

getLeftRail

public int getLeftRail()
Returns the value of SitePropertyBean.leftRail.

Returns:
int - The value of left_rail.

getRightRail

public int getRightRail()
Returns the value of SitePropertyBean.rightRail.

Returns:
int - The value of right_rail.

getBottomRail

public int getBottomRail()
Returns the value of SitePropertyBean.bottomRail.

Returns:
int - The value of bottom_rail.

getHeader

public java.lang.String getHeader()
Returns the value of SitePropertyBean.header.

Returns:
String - The value of header.

getFooter

public java.lang.String getFooter()
Returns the value of SitePropertyBean.footer.

Returns:
String - The value of footer.

getLoggedOn

public final boolean getLoggedOn()
Returns loggedOn.

Returns:
boolean - The value/reference of/to loggedOn.

getCategoryId

public final int getCategoryId()
Returns categoryId.

Returns:
int - The value/reference of/to categoryId.

setCategoryId

public final void setCategoryId(java.lang.String category)
                         throws CMAException
Set categoryId based upon the String value specified. If the value is null or empty then the category with highest priority for the user is set.

Parameters:
category - - The value based upon which to find the appropriate category.
Throws:
CMAException - - If errors are encountered while fetching the categories for the customer.

getContentId

public final int getContentId(java.lang.String content)
Parse the content id out of the specified string value.

Parameters:
content - - The content id string value to parse.
Returns:
int - The contentId value. If the specified string is null or empty, this method returns 0.

getContentBean

public final ContentBean getContentBean(int contentId)
                                 throws CMAException
Return the ContentBean instance identified by the contentId primary key value specified.

Parameters:
contentId - - The primary key value based upon which to find the appropriate bean instance.
Returns:
ContentBean - The java bean instance.
Throws:
CMAException - - If the bean instance cannot be found.
See Also:
ContentBean.getInstance( int )

getCSSContents

public final java.lang.String getCSSContents()
                                      throws CMAException
Return the CSS properties for the customer as a String. Create a new instance of the CSSGenerator class for the customer_id and fetch the CSS contents.

Returns:
String - The CSS properties string.
Throws:
CMAException - - If errors are encountered while fetching the CSS contents for the customer.
See Also:
CSSGenerator.getCssContents()

Rakesh API

Copyright © 2002-2005 - Rakesh Vidyadharan