input
stringlengths
10
828
output
stringlengths
5
107
public void set attrib string attrib object val if attributes null attributes new hash map 3 attributes put attrib val set attributes string string
set the named attribute to the given value
public string get attribute string attrib if attributes null return null else return string attributes get attrib set attributes string string
get the named attribute of this controller
public object get attrib string attrib if attributes null return null else return attributes get attrib set attributes string string
get the named attribute of this controller
protected boolean valid state if get current state null return false return true
check to see if we are currently in a valid state
public map get attributes return attributes get attributes
get the attributes map
public string get handler name return this handler name
return the name of the method that will handle transitions to this
public void set attributes map attributes this attributes attributes set attributes map
set the attributes map to the supplied map
public void remove attrib string key attributes remove key
remove the attribute
public void set handler name string new name this handler name new name
use this function to bypass the automatic function naming that goes on
public void set init parameter string param name string param value if init params null init params new hash map init params put param name param value set initial parameter string string
our caller can pass us initialization parameters
public map get nested map throws controller exception hash map mapped nested new hash map map map this get named blocks if map null mapped nested put all map map this get named inputs if map null mapped nested put all map map this get named outputs if map null mapped nested put all map map this get named transitions if map null mapped nested put all map return mapped nested
useful for jstl iteration of all items in response
public transition get success transition return success transition
return the success transition
public void set parameters hashtable h we can validate the parameters against the required parameters of a given state if h null params h else params new hashtable 1 set parameters hashtable
set the parameters for this request
public void set user string new user user name new user set user string
the client of the controller must tell us who is accessing us
public string get user return my request get user
get the user name
public void set uid int new uid uid new uid
sets the current integer user id
public string get init parameter string param name if init params null return null else return string init params get param name get initial parameter string
retrieve the initialization parameter
public string get user if user name null return user unknown user return user name get user
get the user name
public void test is dbconnection available secure if set controller sf new test secure if set controller test controller boolean result sf is dbconnection available default assert true default connection should be available result true result sf is dbconnection available abitkghaigkhksksm s assert true nonsense connection should not be available result false
test for method is dbconnection available
public boolean is file parameter string param name return my request is file parameter param name
does a specified parameter refer to an uploaded file
public hashtable get parameters if params null return hashtable params clone else return new hashtable get parameters
return the complete hashtable of parameters all keyed by parameter names
protected void add output output log message try if parent block null response add log message else parent block add log message catch controller exception ex log warn error logging install message ex
helper method that adds the output to either the parent block
public void info string message output o new output message o set attribute color black add output o
log an info message
public void warn string message output o new output warn message o set attribute color orange add output o
log a warning message
public void warn string message throwable error output o new output warn message o set attribute color orange add nested outputs o error add output o
log a warning exception
public void error string message throwable error output o new output error message o set attribute color red add nested outputs o error add output o
log an error exception
public string get parameter string param code if params null return null return string params get param code get parameter string
fetch the value for the given parameter
protected void add nested outputs output o throwable error try byte array output stream bos new byte array output stream error print stack trace new print stream bos o add nested new output stack trace bos to string o add nested new output error message error get message catch controller exception ex log warn error logging install message ex log warn original exception to log error
adds the exceptions as nested outputs to the original log message
public boolean is file parameter string param name if file params null return false if file params contains key param name return true return false is file parameter string
does a specified parameter refer to an uploaded file
public string get dbname if string util not null db name equals return default return db name get dbname
return the name of the database connection we use or null
public string get data context return this get dbname
return the name of the database connection we use or null
public string get dbname return my request get data context
return the name of the database connection we use or null
public string get data context return my request get data context
return the name of the database connection we use or null
public boolean is parameter string param name hashtable all params get parameters if all params null return false return all params contains key param name
checks if the described parameter is a defined parameter
protected controller request get controller request return my request
gets the controller request object associated with this state
protected controller response get controller response return my response
retrieves the controller response object associated with this state
public locale get locale if current locale null return current locale locale l null try l new locale config manager get context get data context get language config manager get context get data context get country catch configuration exception ce l null if l null l locale get default return l
returns the locale of this request
protected void add function string name string descrip my functions put name descrip add function string string
if a job can do more than one distinct function it registers
public void remove parameter string param name params remove param name
remove a parameter from this controller request
protected void calculate handler name string state name fast string buffer fsb fast string buffer get instance try fsb append run fsb append character to upper case state name char at 0 fsb append state name substring 1 fsb append state handler name fsb to string finally fsb release fsb null
calculates the appropriate method name based upon the name of the state
public void set cron alarm entry crontab entry obj m cron alarm entry obj
sets the cron alarm entry
synchronized private void initialize initialize
sets up the whole logging system
public crontab entry get cron alarm entry return m cron alarm entry
retrieve the cron alarm entry
synchronized static public void destroy
method that destroys the logging system so we can reload all the classes
public string get log msg return msg get log msg
return the logging message
public boolean use cron return m use cron
should we use crontab
protected void add parameter string param code string param descrip my parameter names put param code param descrip add parameter string string
add a parameter
public void finalize try flush catch log exception e finalize
if for any reason the app exits and gc is getting called
public void add param valid values string param code vector param valid values my param valid values put param code param valid values add param valid values string vector
adds a list of valid values for the particular parmeters
protected void finish string msg finish msg null finish string
finish up the job clearing the job queue entry sending a completion email
public void set error transition transition new error transition error transition new error transition
set the error transition
public hashtable get functions return hashtable my functions clone get functions
retrieve the functions the job handler can execute
public string get job number return my job number get job number
return the jobnumber of this job
public category get logger if m log null setup subclass log return m log
call from subclass to log into category with subclass name
public hashtable get parameters return hashtable my parameter names clone get parameters
retreive all parameter names
public string get parameter string param name return string my parameter names get param name
get the description of a specified parameter
public hashtable get parameter names and descriptions return hashtable my parameter names clone get parameters
retreive all parameters
public void deleted user user user throws dbexception try if log is debug enabled log debug received delete user notification forum subscribe forum subscribe new forum subscribe securable system account forum subscribe set field fld uid user get uid forum subscribe set data context user get data context forum subscribe delete all catch dbexception ex log warn error deleting subscribed users ex
listener method that deletes a users subscriptions when a user is
public string get parameter description string param name return string my parameter names get param name
get the value of a specified parameter
protected string generate token controller request request if request instanceof servlet controller request servlet controller request scr servlet controller request request return super generate token http servlet request scr get servlet request else return no web environment transaction token
generate a new transaction token to be used for enforcing a single
public vector get param valid values string param code return vector my param valid values get param code get param valid values string
retrieve all valid values for the given parameter
public string get user return my user get user
return the username who requested this job
private void construct setup listeners
performs all the appropriate constructions
private void setup listeners if listeners setup cache manager add listener cache name com jcorporate expresso services dbobj group members class get name cache manager add listener cache name com jcorporate eforum dbobj forum security class get name listeners setup true
sets up the listeners throughout the system should be called within
public boolean multi threaded return false multi threaded
implementors of this class must override this to return true if they are
public int get category project throws dbexception if is field null project return 1 return get field int project
get project id for this category
protected boolean is token valid controller request request if request instanceof servlet controller request servlet controller request scr servlet controller request request return super is token valid http servlet request scr get servlet request else also true in a new app web environment e g command line interface return true
return code true code if there is a transaction token stored in
public transition get return to sender return return to sender
return the return to sender transition
protected string get data context throws dbexception return get job queue entry get data context
retrieve the data context of the job
protected void set schema string schema class string util assert not blank schema class cannot set blank schema my schema schema class set schema string
tell this job object what schema it belongs to
protected string get string string string code object args return get string string code args get string string
getstring without any substitution capabilities
public string get state form class return state form class
return the class name if any of the state form associated with
protected void reset token controller request request if request instanceof servlet controller request servlet controller request scr servlet controller request request super reset token scr get http servlet request
reset the saved transaction token in the users session
protected string get string string string code object args if my schema null set schema expresso schema class get name try job queue jq my job queue if jq null return messages get string for user get job queue entry get field int exp uid get job queue entry get data context my schema string code args else return messages get string my schema string code args catch dbexception de log error de return unable to retrieve string de get message get string string object
pass on a call to retrieve an appropriate localized string from the
protected void save token controller request request if request instanceof servlet controller request servlet controller request scr servlet controller request request super save token scr get http servlet request
save a new transaction token in the users current session
public string get title return new string send notices get title
return the title of this transaction
public string get default component code return get string eforum default component code
returns the default component code for this schema
public string get default description return e forum return get string eforum default description
returns the default description for this schema
public string get message bundle path return com jcorporate eforum get message bundle path
return the path to this applications message bundle file s
public string get version return current version
retrieve the version information string
public string get title return new string index forum messages get title
declare our title for the security functions
public string get title return new string browse forum get title
return the title of this transaction
protected int get total page count record paginator rp int page limit if page limit 0 return 1 else return int rp get total record count page limit 1
retrieve the total number of pages for this recordset
public string get string string key return message format format get string internal key null
get a string from the underlying resource bundle
public iterator get permissions synchronized permissions return permissions iterator
return the set of
public void add permission permission perm synchronized permissions if permissions contains perm permissions add perm
add a new
public boolean has permission permission perm synchronized permissions return permissions contains perm
has this role specifically assigned the specified
public string to string string buffer sb new string buffer role rolename sb append rolename sb append if description null sb append description sb append description sb append synchronized permissions if permissions size 0 sb append permissions int n 0 iterator values permissions iterator while values has next if n 0 sb append n sb append string permission values next get permission name sb append sb append return sb to string
p return a string representation of this role in xml format
public string get permission name return this permission name
return the role name of this permission which must be unique
public void set permission name string permission name this permission name permission name
set the permission name of this permission which must be unique
public string get name return get permission name
make the principal name the same as the role name
public string to string string buffer sb new string buffer permission permissionname sb append permission name sb append if description null sb append description sb append description sb append sb append return sb to string
p return a string representation of this permission in xml format
public iterator get articles synchronized articles return articles values iterator
return the set of
public iterator get barrels synchronized barrels return barrels values iterator
return the set of
public iterator get documents synchronized documents return documents values iterator
return the set of
public void close throws exception synchronized basic storage class if open count 0 open count
finalize access to this storage
public void add contentpart content part contentpart synchronized parts if parts contains contentpart parts add contentpart
add a new
public article create article string description basic article article new basic article this get unique id description synchronized articles articles put article get id article return article
create and return a new
public iterator get permissions synchronized permissions return permissions values iterator
return the set of
public barrel create barrel string description basic barrel barrel new basic barrel this get unique id description synchronized barrels barrels put barrel get id barrel return barrel
create and return a new