ToXmlDoc (UserStatistics function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>XmlDoc with values of statistics in specified UserStatistics</b></span>
{{Template:UserStatistics:ToXmlDoc subtitle}}
[[Category:UserStatistics methods|ToXmlDoc function]]
<var>ToXmlDoc</var> returns in a <var class="product">[[Janus SOAP]]</var> <var>[[XmlDoc_class|XmlDoc]]</var> object the values of the statistics in the method <var>UserStatistics</var> object. By default, it will only return those statistics with non-zero values; but, as an option, it may return all (including zero) statistics.
<!--DPL?? Category:UserStatistics methods|ToXmlDoc function: XmlDoc with values of statistics in specified UserStatistics-->
 
<!--DPL?? Category:System methods|ToXmlDoc (UserStatistics function): XmlDoc with values of statistics in specified UserStatistics-->
==Syntax==
<p>
{{Template:UserStatistics:ToXmlDoc syntax}}
ToXmlDoc is a member of the [[UserStatistics class]].
</p>


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]            -
                        [,&nbsp;AttributeValues=bool]  -
                        [,&nbsp;AttributeNames=bool]    -
                        [,&nbsp;NamestoLower=bool] )
===Syntax terms===
===Syntax terms===
<dl>
<table class="syntaxTable">
<dt><i>%doc</i>
<tr><th>%doc</th>
<dd>An XmlDoc object variable to contain the listing of the values of the
<td>An <var>XmlDoc</var> object variable to contain the listing of the values of the statistics. </td></tr>
statistics.
<dt><i>%ustat</i>
<dd>A UserStatistics object variable.
<dt><b>Zeros= </b><i>bool</i>
<dd>This name required argument (<tt>Zeros</tt>) 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 <tt>False</tt>, which
results in the inclusion of only statistics with non-zero values.
<dt><b>AttributeValues= </b><i>bool</i>
<dd>This name required argument (<tt>AttributeValues</tt>) 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, <tt><DKRD>1107</DKRD></tt> is text format,
<tr><th>userStatistics</th>
and <tt><DKRD value="1107"/></tt> is attribute value format.
<td>A <var>UserStatistics</var> object variable. </td></tr>


The default value is <tt>False</tt>, which produces text format.
<tr><th><var>Zeros</var></th>
<dt><b>AttributeNames= </b><i>bool</i>
<td>This [[Notation conventions for methods#Named parameters|name required]] argument is a <var>[[Enumerations#Using Boolean enumerations|Boolean]]</var> value that indicates whether statistics with a zero value should be included in the returned data. <var>Zeros</var> is an optional argument that defaults to <var>False</var>, which results in the inclusion of only statistics with non-zero values. </td></tr>
<dd>This name required argument (<tt>AttributeNames</tt>) 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 &ldquo;name&rdquo; attribute.


For example, <tt><DKRD>1107</DKRD></tt> is element-name format,
<tr><th><var>AttributeValues</var></th>
and the following is name-as-attribute format:
<td>This name required argument is a <var>Boolean</var> value that indicates whether statistic values are to be displayed as text or as value attributes within their XML document elements. For example:
<pre>
<code><DKRD>1107</DKRD></code> is text format, and <code><DKRD value="1107"/></code> is attribute value format.
    <stat name="DKRD">
<p>
      1107
The default value is <var>False</var>, which produces text format.</p></td></tr>
    </stat>
</pre>


The default value is <tt>False</tt>, which produces element-name format.
<tr><th><var>AttributeNames</var></th>
<dt><b>NamesToLower= </b><i>bool</i>
<td>This name required argument is a <var>Boolean</var> 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:
<dd>This name required argument (<tt>NamesToLower</tt>) is a boolean value
<code><DKRD>1107</DKRD></code> is element-name format, and the following is name-as-attribute format: <p class="code"><stat name="DKRD"> 1107 </stat></p>  
that indicates whether statistic names are to be displayed in lowercase
characters.
The default value is <tt>False</tt>.


</dl>
<p>
===Usage Notes===
The default value is <var>False</var>, which produces element-name format. </p></td></tr>
<ul>
<li>The [[DifferenceToXmlDoc (UserStatistics function)|DifferenceToXmlDoc]] function returns
to an XmlDoc object the difference in values between one
UserStatistics object and another for the Login statistics.
</ul>
===Examples===


The display of non-zero Login and Request statistics below is produced
<tr><th><var>NamesToLower</var></th>
by a sequence of statements like the following:
<td>This name required argument is a <var>Boolean</var> value that indicates whether statistic names are to be displayed in lowercase characters. The default value is <var>False</var>.</td></tr>
<pre>
</table>
    %doc is object xmldoc
    %ustat is object userstatistics
    . . .
    %doc = %ustat:ToXmlDoc
    %doc:Print
</pre>


==Examples==
The following display of non-zero [[UserStatistics_class#login|Login]] and [[UserStatistics_class#request|Request]] statistics is produced by a sequence of statements like the following:
<p class="code">%doc is object xmldoc
%ustat is object userstatistics
  ...
%doc = %ustat:ToXmlDoc
%doc:print
</p>
The following are sample results:
The following are sample results:
<pre>
<p class="output"><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>
</p>
</pre>
Using a <code>%doc = %ustat:ToXmlDoc(Zeros=true)</code> statement would return all the statistics, including those with a <code>0</code> value.


A <tt>%doc = %ustat:ToXmlDoc(Zeros=true)</tt> statement would
==See also==
return all the statistics, including those with a <tt>0</tt> value.
<ul>
<li><var>[[DifferenceToXmlDoc (UserStatistics function)|DifferenceToXmlDoc]]</var> returns, to an <var>XmlDoc</var> object, the difference in values between the Login statistics in one <var>UserStatistics</var> object and another.
</ul>
{{Template:UserStatistics:ToXmlDoc footer}}

Latest revision as of 22:15, 20 November 2012

Export the UserStatistics values to Xml (UserStatistics class)

ToXmlDoc returns in a Janus SOAP XmlDoc object the values of the statistics in the method UserStatistics object. By default, it will only return those statistics with non-zero values; but, as an option, it may return all (including zero) statistics.

Syntax

%doc = userStatistics:ToXmlDoc[( [Zeros= boolean], - [AttributeValues= boolean], - [AttributeNames= boolean], - [NamesToLower= boolean])]

Syntax terms

%doc An XmlDoc object variable to contain the listing of the values of the statistics.
userStatistics A UserStatistics object variable.
Zeros This name required argument 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 This name required argument 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 This name required argument 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 This name required argument is a Boolean value that indicates whether statistic names are to be displayed in lowercase characters. The default value is False.

Examples

The following display of non-zero Login and Request statistics 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>

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

See also

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