org.ifeth.sehr.beans
Class ServiceData

java.lang.Object
  |
  +--org.ifeth.sehr.beans.ServiceData

public class ServiceData
extends java.lang.Object

This bean is used to manage the services offered by the centers (zones).

Version:
$Id: ServiceData.java,v 1.14 2005/01/16 12:15:57 hansjhaase Exp $
Author:
hansjhaase

Constructor Summary
ServiceData()
           
ServiceData(int svid)
           
ServiceData(SEHRCfg cfg)
           
ServiceData(java.lang.String cfgfile)
           
 
Method Summary
 void clear()
           
static int countBasicServices(SEHRCfg cfg)
          Count no. of basic services
 java.lang.String getCategoryHTMLSelect()
          Get category list.
 java.lang.String getCategoryTitle()
          Get title of a category defined by catid.
 java.lang.String getCategoryTitle(int catid)
           
 java.lang.String getCategoryTitle(java.lang.String s)
           
 int getCatid()
           
 java.lang.String getCenterDatabase()
           
 int getCenterid()
           
 java.lang.String getDataRootOfCenter()
           
 java.sql.Date getEofs()
           
 java.lang.String getLocalZone()
          Retrieve local zone for some security intervention purposes
 int getLocalZoneInt()
           
 int getModid()
           
 java.lang.String getModtitle()
           
 java.lang.String getModulesHTMLSelect()
          Get list of public modules to register as service for center This method is used by editing a service to make a module usable for a center.
 java.lang.String getMsgstatus()
           
 java.lang.String getPik()
           
 java.sql.Date getSofs()
           
 java.lang.String getSvHTMLSelect()
          Get registered, usable services (by NET_SERVICES) for the local zone as HTML selection field.
 int getSvid()
           
 java.lang.String getSvTitle()
           
 java.lang.String getTitle()
           
 java.lang.String getUrladmin()
           
 java.lang.String getUrluser()
           
 int getZoneid()
           
 void init(java.lang.String cfgfile)
          Load SEHR configuration by given configuration file.
 void initObject(SEHRCfg cfg)
          Initialize the object using the SEHR configuration object The configuration object is the interface between the SEHR core, the underlaying system and the 'business model'; Due to this splitted responsibility the the cfg object is resonsible for a correct db handle/connection.
static int insertRecord(ServiceData sd)
          Insert ServiceData record using given object (static method!)
static void main(java.lang.String[] args)
          for testing purposes only....
 void readDataOfCenter()
          Gets some important entries of the center associated for the current netservice object
 ServiceData selectService(int svid, ServiceData sd)
           
static ServiceData selectServiceModRec(int svid, ServiceData sd)
           
 void setCatid(int i)
           
 void setCenterid(int i)
           
 void setEofs(java.sql.Date date)
           
 void setModid(int modid)
           
 void setModtitle(java.lang.String modtitle)
           
 void setMsgstatus(java.lang.String string)
           
 void setPik(java.lang.String string)
           
 void setSofs(java.sql.Date date)
           
 void setSvid(int i)
           
 void setTitle(java.lang.String string)
           
 void setUrladmin(java.lang.String string)
           
 void setUrluser(java.lang.String string)
           
 void setZoneid(int i)
           
 boolean unregisterService()
           
static boolean updateRecord(int svidrec, ServiceData sd)
          Updates NET_SERVICES using ServiceData object fields.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceData

public ServiceData()

ServiceData

public ServiceData(int svid)

ServiceData

public ServiceData(java.lang.String cfgfile)

ServiceData

public ServiceData(SEHRCfg cfg)
Method Detail

init

public void init(java.lang.String cfgfile)
Load SEHR configuration by given configuration file. If 'null' then the configuration will be 'guessed' by the running SEHR core.


initObject

public void initObject(SEHRCfg cfg)
Initialize the object using the SEHR configuration object

The configuration object is the interface between the SEHR core, the underlaying system and the 'business model'; Due to this splitted responsibility the the cfg object is resonsible for a correct db handle/connection.

Parameters:
cfg -

clear

public void clear()

getModulesHTMLSelect

public java.lang.String getModulesHTMLSelect()
Get list of public modules to register as service for center

This method is used by editing a service to make a module usable for a center. If assigned to a center as a service every user of a zone can be assigned/be allowed to use this service
NB: Basic modules like mail, news are standards by default

Returns:
HTML_SELECT

getCategoryHTMLSelect

public java.lang.String getCategoryHTMLSelect()
Get category list.

Returns:
HTML_SELECT

getDataRootOfCenter

public java.lang.String getDataRootOfCenter()

getCenterDatabase

public java.lang.String getCenterDatabase()

readDataOfCenter

public void readDataOfCenter()
Gets some important entries of the center associated for the current netservice object


getCategoryTitle

public java.lang.String getCategoryTitle()
Get title of a category defined by catid.

Returns:
title

getCategoryTitle

public java.lang.String getCategoryTitle(java.lang.String s)

getCategoryTitle

public java.lang.String getCategoryTitle(int catid)

getSvHTMLSelect

public java.lang.String getSvHTMLSelect()
Get registered, usable services (by NET_SERVICES) for the local zone as HTML selection field.

NB: Basic services are not listed, they are always usable for registered users.

Returns:
(String) HTML_SELECT

getSvTitle

public java.lang.String getSvTitle()

selectService

public ServiceData selectService(int svid,
                                 ServiceData sd)

selectServiceModRec

public static ServiceData selectServiceModRec(int svid,
                                              ServiceData sd)

unregisterService

public boolean unregisterService()

countBasicServices

public static int countBasicServices(SEHRCfg cfg)
Count no. of basic services


insertRecord

public static int insertRecord(ServiceData sd)
Insert ServiceData record using given object (static method!)

Parameters:
sd - ServiceData object
Returns:
new_service_id or -1 if failed

updateRecord

public static boolean updateRecord(int svidrec,
                                   ServiceData sd)
Updates NET_SERVICES using ServiceData object fields.

Only fields of the record object are updated that are containing valid values

Parameters:
svidrec - Record (ID) to be updated
sd - ServiceData object containing the fields
Returns:
true or false

getModid

public int getModid()

setModid

public void setModid(int modid)

getSvid

public int getSvid()

setSvid

public void setSvid(int i)

getCatid

public int getCatid()

getCenterid

public int getCenterid()

getEofs

public java.sql.Date getEofs()

getPik

public java.lang.String getPik()

getSofs

public java.sql.Date getSofs()

getTitle

public java.lang.String getTitle()

getUrladmin

public java.lang.String getUrladmin()

getUrluser

public java.lang.String getUrluser()

getZoneid

public int getZoneid()

setCatid

public void setCatid(int i)
Parameters:
i -

setCenterid

public void setCenterid(int i)
Parameters:
i -

setEofs

public void setEofs(java.sql.Date date)
Parameters:
date -

setPik

public void setPik(java.lang.String string)
Parameters:
string -

setSofs

public void setSofs(java.sql.Date date)
Parameters:
date -

setTitle

public void setTitle(java.lang.String string)
Parameters:
string -

setUrladmin

public void setUrladmin(java.lang.String string)
Parameters:
string -

setUrluser

public void setUrluser(java.lang.String string)
Parameters:
string -

setZoneid

public void setZoneid(int i)
Parameters:
i -

getMsgstatus

public java.lang.String getMsgstatus()

setMsgstatus

public void setMsgstatus(java.lang.String string)

getLocalZone

public java.lang.String getLocalZone()
Retrieve local zone for some security intervention purposes

Returns:
(String) zoneid //of configuration file

getLocalZoneInt

public int getLocalZoneInt()

getModtitle

public java.lang.String getModtitle()
Returns:
Returns the modtitle.

setModtitle

public void setModtitle(java.lang.String modtitle)
Parameters:
modtitle - The modtitle to set.

main

public static void main(java.lang.String[] args)
for testing purposes only....