ToXmlDoc (UserStatistics function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 6: Line 6:
ToXmlDoc is a member of the [[UserStatistics class]].
ToXmlDoc is a member of the [[UserStatistics class]].
</p>
</p>
 
This method returns in a [[Janus SOAP]] XmlDoc object the values of the statistics
This method returns in a [[Janus SOAP]] XmlDoc object the values of the statistics
in the method UserStatistics object.
in the method UserStatistics object.
Line 34: Line 34:
statistic values are to be displayed as text or as value attributes within
statistic values are to be displayed as text or as value attributes within
their XML document elements.
their XML document elements.
 
For example, <tt><DKRD>1107</DKRD></tt> is text format,
For example, <tt><DKRD>1107</DKRD></tt> is text format,
and <tt><DKRD value="1107"/></tt> is attribute value format.
and <tt><DKRD value="1107"/></tt> is attribute value format.
 
The default value is <tt>False</tt>, which produces text format.
The default value is <tt>False</tt>, which produces text format.
<dt><b>AttributeNames= </b><i>bool</i>
<dt><b>AttributeNames= </b><i>bool</i>
Line 44: Line 44:
within their XML document elements
within their XML document elements
as the element name or as the value of a &ldquo;name&rdquo; attribute.
as the element name or as the value of a &ldquo;name&rdquo; attribute.
 
For example, <tt><DKRD>1107</DKRD></tt> is element-name format,
For example, <tt><DKRD>1107</DKRD></tt> is element-name format,
and the following is name-as-attribute format:
and the following is name-as-attribute format:
Line 51: Line 51:
</stat>
</stat>
</p>
</p>
 
The default value is <tt>False</tt>, which produces element-name format.
The default value is <tt>False</tt>, which produces element-name format.
<dt><b>NamesToLower= </b><i>bool</i>
<dt><b>NamesToLower= </b><i>bool</i>
Line 58: Line 58:
characters.
characters.
The default value is <tt>False</tt>.
The default value is <tt>False</tt>.
 
</dl>
</dl>
===Usage Notes===
===Usage Notes===
Line 67: Line 67:
</ul>
</ul>
===Examples===
===Examples===
 
The display of non-zero Login and Request statistics below is produced
The display of non-zero Login and Request statistics below is produced
by a sequence of statements like the following:
by a sequence of statements like the following:
Line 76: Line 76:
%doc:Print
%doc:Print
</p>
</p>
 
The following are sample results:
The following are sample results:
<pre>
<p class="code"><nowiki><UserStatistics id="40" time=20080902203110278
    <UserStatistics id="40" time=20080902203110278
userNumber="6" loginTime="20080902094309010">
    userNumber="6" loginTime="20080902094309010">
  <login>
      <login>
      <CNCT>38881</CNCT>
          <CNCT>38881</CNCT>
      <DKRD>7</DKRD>
          <DKRD>7</DKRD>
      <DKWR>102</DKWR>
          <DKWR>102</DKWR>
      <SQRD>79</SQRD>
          <SQRD>79</SQRD>
      <SQWR>353</SQWR>
          <SQWR>353</SQWR>
      <SGMTI>598</SGMTI>
          <SGMTI>598</SGMTI>
      <SVRD>2</SVRD>
          <SVRD>2</SVRD>
      <SVWR>2</SVWR>
          <SVWR>2</SVWR>
      <CPU>27</CPU>
          <CPU>27</CPU>
      <REQ>13</REQ>
          <REQ>13</REQ>
      <MOVE>284</MOVE>
          <MOVE>284</MOVE>
      <AUDIT>136</AUDIT>
          <AUDIT>136</AUDIT>
      <WAIT>286</WAIT>
          <WAIT>286</WAIT>
      <DKAR>173</DKAR>
          <DKAR>173</DKAR>
      <DKPR>421</DKPR>
          <DKPR>421</DKPR>
      <SMPLS>1595</SMPLS>
          <SMPLS>1595</SMPLS>
      <BLKI>1000</BLKI>
          <BLKI>1000</BLKI>
      <SCREENS>54</SCREENS>
          <SCREENS>54</SCREENS>
      <SVPAGES>172</SVPAGES>
          <SVPAGES>172</SVPAGES>
  </login>
      </login>
  <request>
      <request>
      <NTBL>8</NTBL>
          <NTBL>8</NTBL>
      <QTBL>32</QTBL>
          <QTBL>32</QTBL>
      <STBL>3776</STBL>
          <STBL>3776</STBL>
      <VTBL>177</VTBL>
          <VTBL>177</VTBL>
      <PDL>168</PDL>
          <PDL>168</PDL>
  </request>
      </request>
</UserStatistics>
    </UserStatistics>
</nowiki></p>
</p>
 
A <code>%doc = %ustat:ToXmlDoc(Zeros=true)</code> statement would
A <tt>%doc = %ustat:ToXmlDoc(Zeros=true)</tt> statement would
return all the statistics, including those with a <code>0</code> value.
return all the statistics, including those with a <tt>0</tt> value.

Revision as of 17:21, 28 February 2011

XmlDoc with values of statistics in specified UserStatistics

ToXmlDoc is a member of the UserStatistics class.

This method returns in a Janus SOAP XmlDoc object the values of the statistics in the method UserStatistics object. It returns all statistics with non-zero values (by default), or it returns all statistics (as an option).

Syntax

  %doc = %ustat:ToXmlDoc( [Zeros=bool]             -
                        [, AttributeValues=bool]   -
                        [, AttributeNames=bool]    -
                        [, NamestoLower=bool] )

Syntax terms

%doc
An XmlDoc object variable to contain the listing of the values of the statistics.
%ustat
A UserStatistics object variable.
Zeros= bool
This name required argument (Zeros) is a boolean value that indicates whether statistics with a zero value should be included in the returned data. Zeros is an optional argument that defaults to False, which results in the inclusion of only statistics with non-zero values.
AttributeValues= bool
This name required argument (AttributeValues) is a boolean value that indicates whether statistic values are to be displayed as text or as value attributes within their XML document elements. For example, <DKRD>1107</DKRD> is text format, and <DKRD value="1107"/> is attribute value format. The default value is False, which produces text format.
AttributeNames= bool
This name required argument (AttributeNames) is a boolean value that indicates whether statistic names are to be displayed within their XML document elements as the element name or as the value of a “name” attribute. For example, <DKRD>1107</DKRD> is element-name format, and the following is name-as-attribute format:

<stat name="DKRD"> 1107 </stat>

The default value is False, which produces element-name format.

NamesToLower= bool
This name required argument (NamesToLower) is a boolean value that indicates whether statistic names are to be displayed in lowercase characters. The default value is False.

Usage Notes

  • The DifferenceToXmlDoc function returns to an XmlDoc object the difference in values between one UserStatistics object and another for the Login statistics.

Examples

The display of non-zero Login and Request statistics below is produced by a sequence of statements like the following:

%doc is object xmldoc %ustat is object userstatistics . . . %doc = %ustat:ToXmlDoc %doc:Print

The following are sample results:

<UserStatistics id="40" time=20080902203110278 userNumber="6" loginTime="20080902094309010"> <login> <CNCT>38881</CNCT> <DKRD>7</DKRD> <DKWR>102</DKWR> <SQRD>79</SQRD> <SQWR>353</SQWR> <SGMTI>598</SGMTI> <SVRD>2</SVRD> <SVWR>2</SVWR> <CPU>27</CPU> <REQ>13</REQ> <MOVE>284</MOVE> <AUDIT>136</AUDIT> <WAIT>286</WAIT> <DKAR>173</DKAR> <DKPR>421</DKPR> <SMPLS>1595</SMPLS> <BLKI>1000</BLKI> <SCREENS>54</SCREENS> <SVPAGES>172</SVPAGES> </login> <request> <NTBL>8</NTBL> <QTBL>32</QTBL> <STBL>3776</STBL> <VTBL>177</VTBL> <PDL>168</PDL> </request> </UserStatistics>

A %doc = %ustat:ToXmlDoc(Zeros=true) statement would return all the statistics, including those with a 0 value.