Class WuiProperties

Description

Class to provide functions to emulate the java.util.Properties class.

This class emulates many of the methods found in the java.util.Properties class. It can be particularily helpful when implementing the server side of AJAX based applications (you can easily build/send a XML document to your client side JavaScript using this class).

Here is an example of creating a simple AJAX style response (in this example, we are simply passing back values for variables "x", "y" and "z" - it's up to the client side JavaScript to do something with the values):

  1.  $p new Properties();
  2.  $p->setComment("This \"is\" a test.");
  3.  $p->setProperty("x","123");
  4.  $p->setProperty("y","2");
  5.  $p->setProperty("z","135");
  6.  
  7.  $p->renderPage();

Located in /lib/WuiProperties.php (line 55)

Properties
   |
   --WuiProperties
Method Summary
WuiProperties __construct ()
void addLoadAvg ()
void addMemInfo ()
void addOverlayUsage ()
void addUpTime ()
void pushReturn (string $url, string $label, string $from)
void setTimeFormat24 (enable $enable)
Methods
Constructor __construct (line 65)

Constructs instance of object (with no properties).

  • access: public
WuiProperties __construct ()

Redefinition of:
Properties::__construct()
Constructs instance of object (with no properties).
addLoadAvg (line 165)

Adds the load average information to be displayed on the header bar.

This method adds the following properties:

<dl> <dt>uptime_load_1min</dt><dd>The load on the system computed over

  1. minute.</dd>
<dt>uptime_load_5min</dt><dd>The load on the system computed over 5 minutes.</dd> <dt>uptime_load_15min</dt><dd>The load on the system computed over 15 minutes.</dd> </dl>

  • access: public
void addLoadAvg ()
addMemInfo (line 263)

Adds memory information to be displayed with the CPU usage widget.

This method adds the following properties:

<dl> <dt>mem_total</dt><dd>Total system memory.</dd> <dt>mem_free</dt><dd>System memory free.</dd> <dt>mem_available</dt><dd>System memory available.</dd> <dt>mem_buffers</dt><dd>System memory in buffer cache, so relatively temporary storage for raw disk blocks. </dd> <dt>mem_cached</dt><dd>System memory in cache which includes disk and shared memory caches.</dd> <dt>mem_sreclaimable</dt><dd>System memory that is part of the Slab that might be reclaimed.</dd> <dt>mem_shmem</dt><dd>System memory used by shared memory. This is memory shared between several processes.</dd> </dl>

  • access: public
void addMemInfo ()
addOverlayUsage (line 200)

Adds the NST Live Overlay Storage block usage (Used/Total) on the header bar.

This method adds the following properties:

<dl> <dt>live_overlay_blocks_used</dt><dd>The number of overlay blocks used on on an NST Live system.</dd> <dt>live_overlay_blocks_total</dt><dd>The total number of overlay blocks on an NST Live system.</dd> </dl>

  • access: public
void addOverlayUsage ()
addStandardProperties (line 420)

Adds standard properties to the "AJAX" document.

This method sets the following properties:

  • server_addr - The IP address of the server.
  • server_fqdn - The fully qualified domain name of the server.
  • server_label - The label to use for the server on the top banner bar of the NST WUI.
  • nst_date - The server time in the format: "%a %b %d, %Y".
  • nst_time - The server time in the format: "%T %Z".
  • nst_time_secs - The server time in the format: "%s".
  • nst_time_nanos - The server time in the format: "%N".
  • UPTIME INFO - All of the information added by the 'addUptime()' method.
  • LOAD AVG - All of the information added by the 'addLoadAvg()' method.
  • NST Live Overlay Storage Status - All of the information added by the 'addOverlayUsage()' method.

  • access: public
void addStandardProperties ()
addUpTime (line 122)

Add information about how long the server has been up.

This method adds the following properties:

<dl> <dt>uptime_up_duration</dt><dd>Total number of seconds the system has been up.</dd> <dt>uptime_up_days</dt><dd>Integer count of number of days system was up.</dd> <dt>uptime_up_hours</dt><dd>Integer count of number of hours system has been up during the current day.</dd> <dt>uptime_up_minutes</dt><dd>Integer count of number of minutes the system has been up during the current hour.</dd> <dt>uptime_up_seconds</dt><dd>Integer count of number of seconds the system has been up during the current minute.</dd> <dt>uptime_up_hours_mins</dt><dd>Hours and minutes (as a string in the form of HH:MM) of how long system has been up for current day.</dd> </dl>

  • access: public
void addUpTime ()
getCommandLine (line 85)

Get command line used to run system commands with.

  • return: object (never returns null).
CommandLine getCommandLine ()
loadAutoReturnValues (line 330)

Adds standard return related values to the Properties object.

This method looks for the following values out of the POST/GET parameters and loads them into the properties object (using the same keys):

<dl> <dt>return</dt><dd>The return URL.</dd> <dt>return_from</dt><dd>The return from value.</dd> <dt>return_label</dt><dd>The return label value.</dd> <dt>synckey</dt><dd>The synckey used by some WUI pages to keep track of data information.</dd> </dl>

  • access: public
void loadAutoReturnValues ()
pushReturn (line 363)

Pushes current return info to return_back and sets new return values.

  • access: public
void pushReturn (string $url, string $label, string $from)
  • string $url: url New URL for return (old "return" becomes "return_back" if present).
  • string $label: label New label for return_label (old "return_label" becomes "return_label_back" if present).
  • string $from:

    from New value for return_from (old "return_from" becomes "return_from_back" if present).

    <dt>return</dt><dd>The return URL.</dd>

    <dt>return_from</dt><dd>The return from value.</dd>

    <dt>return_label</dt><dd>The return label value.</dd>

    <dt>synckey</dt><dd>The synckey used by some WUI pages to keep track of data information.</dd>

    </dl>

setTimeFormat24 (line 76)

Set whether we should use 24 hour mode when formatting time for top banner info.

  • access: public
void setTimeFormat24 (enable $enable)
  • enable $enable: Set to true for 24 hour mode and false for 12 hour mode.

Inherited Methods

Inherited From Properties

Properties::__construct()
Properties::disableCaching()
Properties::getAsArray()
Properties::getPostGet()
Properties::getProperty()
Properties::loadFromXML()
Properties::printJSON()
Properties::printXML()
Properties::removeProperty()
Properties::renderJSON()
Properties::renderPage()
Properties::setComment()
Properties::setDocumentInfo()
Properties::setIncludeXsl()
Properties::setProperty()
Properties::size()
Properties::storeToXML()
Properties::toUrlParams()

Documentation generated on Sun, 11 Feb 2018 07:41:02 -0500 by phpDocumentor 1.4.4