File: eaf_n_cst_variablemanager.sru
Size: 5406
Date: Tue, 22 Jan 2008 23:39:12 +0100
$PBExportHeader$eaf_n_cst_variablemanager.sru
forward
global type eaf_n_cst_variablemanager from nonvisualobject
end type
end forward

global type eaf_n_cst_variablemanager from nonvisualobject
end type
global eaf_n_cst_variablemanager eaf_n_cst_variablemanager

type variables
Protected:
string         is_name[]
string         is_value[]
end variables

forward prototypes
public function integer getvalue (string as_variablename, ref string as_variablevalue)
public function integer setvalue (string as_variablename, string as_variablevalue)
public function long buildvariablelist ()
public function integer addvariable (string as_variablename, string as_variablevalue)
end prototypes

public function integer getvalue (string as_variablename, ref string as_variablevalue);Long ll_row

for ll_row = 1 to UpperBound(is_name)
   if as_variablename = is_name[ll_row] then
      as_variablevalue = is_value[ll_row]
      return 1
   end if
next

if not IsValid(sqlca) then return -1
If not sqlca.dbhandle() > 0 Then return -1

select value into :as_variablevalue
   from eaf_variables
   where name = :as_variablename;

if sqlca.sqlcode = 0 then
   return 1
else
   return -1
end if
end function

public function integer setvalue (string as_variablename, string as_variablevalue);if not IsValid(sqlca) then return -1
If not sqlca.dbhandle() > 0 Then return -1

addVariable( as_variablename, as_variablevalue)

delete from eaf_variables
   where name = :as_variablename;

insert into eaf_variables (name, value, description)
   values (:as_variablename, :as_variablevalue, '');

if sqlca.sqlcode = 0 then
   return 1
else
   return -1
end if
end function

public function long buildvariablelist ();constant string METHOD_NAME = "buildVariableList "

//Logging and Tracing Variable Names
addVariable("com.youngsoft.eaf.debug", "false")
addVariable("com.youngsoft.eaf.trace", "false")
addVariable("com.youngsoft.eaf.debug.detailed", "false")
addVariable("com.youngsoft.eaf.usedatabaselogging", "false")
addVariable("com.youngsoft.eaf.warning", "false")

//Javascript location
addVariable("com.youngsoft.eaf.htmldw.110.js.location", "%WEBSITE%scripts")

//XML DW publish Location, put your web application's absoluate path here
//Note: the following 8 variabes only available to XHTML and XML WEB DW.
addVariable("com.youngsoft.eaf.webdw.css.publish.path", "D:\yoyo\Program\YouERP\EAF.NET\Tutorials\First EAF.NET Web Application\ASP.NET\css")
addVariable("com.youngsoft.eaf.webdw.js.publish.path",  "D:\yoyo\Program\YouERP\EAF.NET\Tutorials\First EAF.NET Web Application\ASP.NET\js")
addVariable("com.youngsoft.eaf.webdw.xml.publish.path", "D:\yoyo\Program\YouERP\EAF.NET\Tutorials\First EAF.NET Web Application\ASP.NET\xml")
addVariable("com.youngsoft.eaf.webdw.xsl.publish.path", "D:\yoyo\Program\YouERP\EAF.NET\Tutorials\First EAF.NET Web Application\ASP.NET\xsl")
//XML DW resource reference location
addVariable("com.youngsoft.eaf.webdw.css.resource.base", "%WEBSITE%css")
addVariable("com.youngsoft.eaf.webdw.js.resource.base", "%WEBSITE%js")
addVariable("com.youngsoft.eaf.webdw.xml.resource.base", "%WEBSITE%xml")
addVariable("com.youngsoft.eaf.webdw.xsl.resource.base", "%WEBSITE%xsl")

//Email Management
addVariable("com.youngsoft.eaf.mailmanager.attachment.key.value.sql", "select @@identity")
addVariable("com.youngsoft.eaf.mailmanager.current.timestamp.expression", "GETDATE()")
addVariable("com.youngsoft.eaf.mailmanager.default.attachment.mime.type.id", "0")
addVariable("com.youngsoft.eaf.mailmanager.default.character.set", "ISO-8859-1")
addVariable("com.youngsoft.eaf.mailmanager.default.delete.after.send.indicator", "true")
addVariable("com.youngsoft.eaf.mailmanager.default.mime.type.id", "1")
addVariable("com.youngsoft.eaf.mailmanager.default.notify.on.failure.email.address", "administrator@yourdomain.com")
addVariable("com.youngsoft.eaf.mailmanager.default.notify.on.failure.indicator", "true")
addVariable("com.youngsoft.eaf.mailmanager.default.retry.count", "3")
addVariable("com.youngsoft.eaf.mailmanager.email.attempt.count.column.name", "attempt_count")
addVariable("com.youngsoft.eaf.mailmanager.email.key.value.sql", "select @@identity")
addVariable("com.youngsoft.eaf.mailmanager.key.value.autoincrement", "true")
addVariable("com.youngsoft.eaf.mailmanager.poll.interval", "60")
addVariable("com.youngsoft.eaf.mailmanager.retry.interval", "30")
addVariable("com.youngsoft.eaf.mailmanager.retry.interval.sql", "GETDATE() > DATEADD( minute, com.youngsoft.eaf.mailmanager.retry.interval, com.youngsoft.eaf.mailmanager.email.last.retry.date.column.name)")
addVariable("com.youngsoft.eaf.mailmanager.smtp.host.name", "somehost.somedomain")
addVariable("com.youngsoft.eaf.mailmanager.smtp.host.port", "25")
addVariable("com.youngsoft.eaf.pdf.provider", "Ghostscript")

Return 1

end function

public function integer addvariable (string as_variablename, string as_variablevalue);Long ll_upper

ll_upper = UpperBound(is_name)

ll_upper ++

is_name[ll_upper]  = as_variablename
is_value[ll_upper] = as_variablevalue

return 1
end function

on eaf_n_cst_variablemanager.create
call super::create
TriggerEvent( this, "constructor" )
end on

on eaf_n_cst_variablemanager.destroy
TriggerEvent( this, "destructor" )
call super::destroy
end on

event constructor;buildVariableList()
end event