Class UserProperty

Index Home MAE > MAE Architecture > MAE Data Types > Class Index > Class UserProperty

Summary
Public Methods
static string getValue(user_id, appname, section, variable, defaultValue)
static string getValue(user_id, section, variable)
static long getValueInt(user_id, appname, section, variable, defaultValue)
static long getValueInt(user_id, section, variable)
static bool getValueBool(user_id, appname, section, variable, defaultValue)
static bool getValueBool(user_id, section, variable)
static HashArray getValues(user_id, appname, section)
inline static string getGlobalValue(user_id, appname, variable, defaultValue)
inline static long getGlobalValueInt(user_id, appname, variable, defaultValue)
inline static bool getGlobalValueBool(user_id, appname, variable, defaultValue)
inline static HashArray getGlobalValues(user_id, appname)
static bool setValue(user_id, appname, section, variable, value)
static bool setValue(user_id, section, variable, value)
static bool setValue(user_id, section, variable, value)
static bool setValueBool(user_id, section, variable, value)
Private Properties
Private Methods
static bool initdb()
See Also

#include <UserProperty.h >

Summary

Interface to DB table for application-specific properties specific to Users.

Variables are grouped into sections; if a varaible is not in a section, it is considered a global variable.

Public Methods

static string getValue(user_id, appname, section, variable, defaultValue)

DbRecNum user_id

the User id

const string& appname

the application-specific variable, e.g. task.getName()

const string& section

the section (application defined) for the variable

const string& variable

the name of the variable

const string& defaultValue

if blank, the default value for the variable

Default value: ""


Given an application, a section, and a variable, return the value (or default value) as string for a specific user.

Return value: the value requested or if blank, the defaultValue

static string getValue(user_id, section, variable)

DbRecNum user_id

the User id

const string& section

the section (application defined) for the variable

const string& variable

the name of the variable


Given an application, a section, and a variable, return the value as string for a specific user.

The current application's name is the appname for the lookup, , e.g. task.getName().

Return value: the value requested or if blank, the defaultValue

static long getValueInt(user_id, appname, section, variable, defaultValue)

DbRecNum user_id

the User id

const string& appname

the application-specific variable, e.g. task.getName()

const string& section

the section (application defined) for the variable

const string& variable

the name of the variable

int defaultValue

if blank, the default value for the variable

Default value: 0


Given an application, a section, and a variable, return the value (or default value) as long int for a specific user.

Return value: the value requested or if blank, the defaultValue

static long getValueInt(user_id, section, variable)

DbRecNum user_id

the User id

const string& section

the section (application defined) for the variable

const string& variable

the name of the variable


Given an application, a section, and a variable, return the value as long int for a specific user.

The current application's name is the appname for the lookup, e.g. task.getName().

Return value: the value requested or if blank, the defaultValue

static bool getValueBool(user_id, appname, section, variable, defaultValue)

DbRecNum user_id

the User id

const string& appname

the application-specific variable, e.g. task.getName()

const string& section

the section (application defined) for the variable

const string& variable

the name of the variable

bool defaultValue

if blank, the default value for the variable

Default value: false


Given an application, a section, and a variable, return the value (or default value) as bool for a specific user.

Return value: the value requested or if blank, the defaultValue

static bool getValueBool(user_id, section, variable)

DbRecNum user_id

the User id

const string& section

the section (application defined) for the variable

const string& variable

the name of the variable


Given an application, a section, and a variable, return the value as bool for a specific user.

The current application's name is the appname for the lookup, e.g. task.getName().

Return value: the value requested or if blank, the defaultValue

static HashArray getValues(user_id, appname, section)

DbRecNum user_id

the User id

const string& appname

the application-specific variable

const string& section

the section (application defined) for the variable


Given a section and app name, return the list of variables and values for a specific user.

Return value: the key/value pairs of the variables and values in a HashArray

inline static string getGlobalValue(user_id, appname, variable, defaultValue)

DbRecNum user_id

the User id

const string& appname

the application-specific variable, e.g. task.getName()

const string& variable

the name of the variable

const string& defaultValue

if blank, the default value for the variable

Default value: ""


Given an application and a variable, return the value (or default value) as string for a specific user from that app's global section (not a named section).

Return value: the value requested or if blank, the defaultValue

inline static long getGlobalValueInt(user_id, appname, variable, defaultValue)

DbRecNum user_id

the User id

const string& appname

the application-specific variable, e.g. task.getName()

const string& variable

the name of the variable

int defaultValue

if blank, the default value for the variable

Default value: 0


Given an application and a variable, return the value (or default value) as long int for a specific user from that app's global section (not a named section).

Return value: the value requested or if 0, the defaultValue

inline static bool getGlobalValueBool(user_id, appname, variable, defaultValue)

DbRecNum user_id

the User id

const string& appname

the application-specific variable, e.g. task.getName()

const string& variable

the name of the variable

bool defaultValue

if blank, the default value for the variable

Default value: false


Given an application and a variable, return the value (or default value) as bool for a specific user from that app's global section (not a named section).

Return value: the value requested or if 0, the defaultValue

inline static HashArray getGlobalValues(user_id, appname)

DbRecNum user_id

the User id

const string& appname

the application-specific variable


Given an app name, return the list of gobal variables and values for a specific user.

Return value: the key/value pairs of the variables and values in a HashArray

static bool setValue(user_id, appname, section, variable, value)

DbRecNum user_id

the User id

const string& appname

the application-specific variable, e.g. task.getName()

const string& section

the section (application defined) for the variable

const string& variable

the name of the variable

const string& value

the value to set


Set a string value for an application variable in a section for a specific user.

Return value: true if value to to variable successfully

static bool setValue(user_id, section, variable, value)

DbRecNum user_id

the User id

const string& section

the section (application defined) for the variable

const string& variable

the name of the variable

const string& value

the value to set


Set a string value for an application variable in a section for a specific user.

The current application's name is the appname for the lookup, , e.g. task.getName().

Return value: true if value to to variable successfully

static bool setValue(user_id, section, variable, value)

DbRecNum user_id

the User id

const string& section

the section (application defined) for the variable

const string& variable

the name of the variable

long value

the value to set


Set a long int value for an application variable in a section for a specific user.

The current application's name is the appname for the lookup, , e.g. task.getName().

Return value: true if value to to variable successfully

static bool setValueBool(user_id, section, variable, value)

DbRecNum user_id

the User id

const string& section

the section (application defined) for the variable

const string& variable

the name of the variable

bool value

the value to set


Set a bool value for an application variable in a section for a specific user.

The current application's name is the appname for the lookup, , e.g. task.getName().

Return value: true if value to to variable successfully

Private Properties

DbRecNum id

Table record number/id

DbRecNum user_id

DB record id from User table

string appName

Application's name

const string& section

Section/Block with variables

const string& variable

Variable name with a value

string value

Value of variable

static Datastore db

Our connection to DB table data


Private Methods

static bool initdb()

Make sure we're connected to our table in the Datastore

Return value: true upon success, false upon failure

See Also

UserProperty database table