[prev in list] [next in list] [prev in thread] [next in thread]
List: forgerock-openidm-commit
Subject: [CommitOpenIDM] [5048] trunk/src/main/docbkx/integrators-guide/appendix-scripting.xml: CR-6386
From: anonymous () forgerock ! org
Date: 2015-03-25 7:49:07
Message-ID: 20150325074907.D01163F881 () sources ! internal ! forgerock ! com
[Download RAW message or body]
[Attachment #2 (text/html)]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[5048] trunk/src/main/docbkx/integrators-guide/appendix-scripting.xml: CR-6386 \
(OPENIDM-2969, OPENIDM-2983, OPENIDM-3065) Multiple issues in the scripting \
appendix</title> </head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: \
verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: \
bold} #msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: \
bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: \
6px; } #logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em \
0; } #logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg \
h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; } \
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; \
} #logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: \
-1.5em; padding-left: 1.5em; } #logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em \
1em 0 1em; background: white;} #logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid \
#fa0; border-bottom: 1px solid #fa0; background: #fff; } #logmsg table th { \
text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted \
#fa0; } #logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: \
0.2em 0.5em; } #logmsg table thead th { text-align: center; border-bottom: 1px solid \
#fa0; } #logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: \
6px; } #patch { width: 100%; }
#patch h4 {font-family: \
verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, \
#patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins \
{background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del \
{background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, \
.info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a \
href="http://sources.forgerock.org/changelog/openidm/?cs=5048">5048</a></dd> \
<dt>Author</dt> <dd>lana</dd> <dt>Date</dt> <dd>2015-03-25 07:49:07 +0000 (Wed, 25 \
Mar 2015)</dd> </dl>
<h3>Log Message</h3>
<pre>CR-6386 (<a href="https://bugster.forgerock.org/jira/browse/OPENIDM-2969">OPENIDM-2969</a>, \
<a href="https://bugster.forgerock.org/jira/browse/OPENIDM-2983">OPENIDM-2983</a>, <a \
href="https://bugster.forgerock.org/jira/browse/OPENIDM-3065">OPENIDM-3065</a>) \
Multiple issues in the scripting appendix</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcmaindocbkxintegratorsguideappendixscriptingxml">trunk/src/main/docbkx/integrators-guide/appendix-scripting.xml</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcmaindocbkxintegratorsguideappendixscriptingxml"></a>
<div class="modfile"><h4>Modified: \
trunk/src/main/docbkx/integrators-guide/appendix-scripting.xml (5047 => 5048)</h4> \
<pre class="diff"><span> <span class="info">--- \
trunk/src/main/docbkx/integrators-guide/appendix-scripting.xml 2015-03-24 23:21:39 \
UTC (rev 5047)
+++ trunk/src/main/docbkx/integrators-guide/appendix-scripting.xml 2015-03-25 \
07:49:07 UTC (rev 5048) </span><span class="lines">@@ -65,18 +65,16 @@
</span><span class="cx">
</span><span class="cx"> <section xml:id="script-json">
</span><span class="cx"> <title>Script Configuration File</title>
</span><del>-
</del><span class="cx"> <para>
</span><span class="cx"> OpenIDM ${docTargetVersion} includes a script \
configuration file </span><del>- \
(<filename>/path/to/openidm/conf/script.json</filename>) \
that enables you
- to modify the parameters used by your Groovy and Java Scripts. You can
- also use this file to change the default project and script directories.
- For more information, see <link
- xlink:show="new" \
xlink:role="http://docbook.org/xlink/role/olink" </del><ins>+ \
(<filename>conf/script.json</filename>) that enables you to modify the + \
parameters used by your Javascript and Groovy scripts. You can also use + this \
file to change the default project and script directories. For more + \
information, see <link xlink:show="new" + \
xlink:role="http://docbook.org/xlink/role/olink" </ins><span class="cx"> \
xlink:href="integrators-guide#config-default-directories"><citetitle>Default
</span><span class="cx"> and Custom Configuration \
Directories</citetitle></link>. </span><span class="cx"> \
</para> </span><del>-
</del><span class="cx"> <para>
</span><span class="cx"> The properties shown in the default version of the
</span><span class="cx"> <filename>script.json</filename> file are \
described here: </span><span class="lines">@@ -245,7 +243,7 @@
</span><span class="cx"> <title>Calling A Script From a Configuration \
File</title> </span><span class="cx"> <para>
</span><span class="cx"> You can call a script from within a configuration file \
by providing the </span><del>- script source, or be referencing a file that \
contains the script source. </del><ins>+ script source, or by referencing a file \
that contains the script source. </ins><span class="cx"> For example:
</span><span class="cx"> </para>
</span><span class="cx">
</span><span class="lines">@@ -277,8 +275,10 @@
</span><span class="cx"> <varlistentry>
</span><span class="cx"> <term>source</term>
</span><span class="cx"> <listitem>
</span><del>- <para>string, required if file is not specified</para>
</del><span class="cx"> <para>
</span><ins>+ string, required if <literal>file</literal> is not \
specified + </para>
+ <para>
</ins><span class="cx"> Specifies the source code of the script to be \
executed. </span><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="lines">@@ -286,21 +286,20 @@
</span><span class="cx"> <varlistentry>
</span><span class="cx"> <term>file</term>
</span><span class="cx"> <listitem>
</span><del>- <para>string, required if source is not \
specified</para> </del><span class="cx"> <para>
</span><ins>+ string, required if <literal>source</literal> is not \
specified + </para>
+ <para>
</ins><span class="cx"> Specifies the file containing the source code of the \
script to execute. </span><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> </variablelist>
</span><del>-
- </section>
-
- </section>
-
- <section xml:id="scripting-example">
- <title>Examples</title>
</del><span class="cx"> <para>
</span><ins>+ The following examples indicate how scripts can be called from \
configuration + files.
+ </para>
+ <para>
</ins><span class="cx"> The following example (included in the \
<filename>sync.json</filename> file) </span><span class="cx"> returns \
<literal>true</literal> if the \
<literal>employeeType</literal> is </span><span class="cx"> equal to \
<literal>external</literal>, otherwise returns </span><span \
class="lines">@@ -319,7 +318,6 @@ </span><span class="cx"> sets the \
<literal>__PASSWORD__</literal> attribute to </span><span class="cx"> \
<literal>defaultpwd</literal> when OpenIDM creates a target object. \
</span><span class="cx"> </para> </span><del>-
</del><span class="cx"> <programlisting language="javascript">
</span><span class="cx"> "onCreate" : {
</span><span class="cx"> "type" : "text/javascript",
</span><span class="lines">@@ -332,7 +330,6 @@
</span><span class="cx"> script is located in a file,
</span><span class="cx"> \
<filename>/path/to/openidm/script/createUnixHomeDir.js</filename>. \
</span><span class="cx"> </para> </span><del>-
</del><span class="cx"> <programlisting language="javascript">
</span><span class="cx"> {
</span><span class="cx"> "filters" : [ {
</span><span class="lines">@@ -344,7 +341,55 @@
</span><span class="cx"> }
</span><span class="cx"> } ]
</span><span class="cx"> } </programlisting>
</span><ins>+ <para>
+ Often, script files are reused in different contexts. You can pass
+ variables to your scripts to provide these contextual details at runtime.
+ You pass variables to the scripts that are referenced in configuration
+ files by declaring the variable name in the script reference.
+ </para>
+ <para>
+ The following example of a scheduled task configuration calls a script
+ named <literal>triggerEmailNotification.js</literal>. The example \
sets the + sender and recipient of the email in the schedule configuration, \
rather + than in the script itself.
+ </para>
+ <programlisting language="javascript">{
+ "enabled" : true,
+ "type" : "cron",
+ "schedule" : "0 0/1 * * * ?",
+ "invokeService" : "script",
+ "invokeContext" : {
+ "script": {
+ "type" : "text/javascript",
+ "file" : "script/triggerEmailNotification.js",
+ "fromSender" : "admin@example.com",
+ "toEmail" : "user@example.com"
+ }
+ }
+} </programlisting>
+ <para>
+ In general, it is preferable to namespace variables passed into scripts
+ with the <literal>"globals"</literal> map. Passing \
variables in this way + prevents collisions with the top-level reserved words for \
script maps, such + as <literal>file</literal>, \
<literal>source</literal>, and + <literal>type</literal>. \
The following example uses the + \
<literal>"globals"</literal> map to namespace the variables \
passed in the + previous example.
+ </para>
+ <programlisting language="javascript">"script": {
+ "type" : "text/javascript",
+ "file" : "script/triggerEmailNotification.js",
+ "globals" : {
+ "fromSender" : "admin@example.com",
+ "toEmail" : "user@example.com"
+ }
+}</programlisting>
+ <para>
+ Script variables are not necessarily simple \
<literal>key:value</literal> + pairs. A script variable can be any \
arbitrarily complex JSON object. + </para>
</ins><span class="cx"> </section>
</span><ins>+ </section>
</ins><span class="cx">
</span><span class="cx"> <section xml:id="function-ref">
</span><span class="cx"> <title>Function Reference</title>
</span><span class="lines">@@ -363,21 +408,6 @@
</span><span class="cx"> provided to each script.
</span><span class="cx"> </para>
</span><span class="cx"> <para>
</span><del>- OpenIDM also provides a <literal>logger</literal> \
object to access the
- Simple Logging Facade for Java (SLF4J) facilities. The following code shows
- an example of the <literal>logger</literal> object.
- </para>
- <programlisting \
language="javascript">logger.info("Parameters passed in: {} {} \
{}", param1, param2, param3);</programlisting>
- <para>
- To set the log level for all scripts, add the following property to the
- <filename>openidm/conf/logging.properties</filename> file:
- <literal>org.forgerock.openidm.script.javascript.JavaScript.level</literal>.
- The level can be one of <literal>SEVERE</literal> (highest value),
- <literal>WARNING, INFO, CONFIG, FINE, FINER</literal>, or
- <literal>FINEST</literal> (lowest value). For example:
- </para>
- <programlisting \
language="javascript">org.forgerock.script.javascript.JavaScript.level=WARNING</programlisting>
- <para>
</del><span class="cx"> The following sections describe the OpenIDM functions \
supported by the </span><span class="cx"> script engine.
</span><span class="cx"> </para>
</span><span class="lines">@@ -420,15 +450,22 @@
</span><span class="cx"> </varlistentry>
</span><span class="cx"> </variablelist>
</span><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
- <para>
- The created OpenIDM resource object.
- </para>
</del><ins>+ <blockquote>
+ <title>Returns</title>
+ <para>The created OpenIDM resource object.</para>
+ </blockquote>
</ins><span class="cx">
</span><del>- <bridgehead>Throws</bridgehead>
- <para>
- An exception is thrown if the object could not be created.
- </para>
</del><ins>+ <blockquote>
+ <title>Throws</title>
+ <para>
+ An exception is thrown if the object could not be created.
+ </para>
+ </blockquote>
+
+ <blockquote>
+ <title>Example</title>
+ <programlisting \
language="javascript">openidm.create("managed/user", bjensen, \
<replaceable>map</replaceable>);</programlisting> + \
</blockquote> </ins><span class="cx"> </section>
</span><span class="cx">
</span><span class="cx"> <section xml:id="function-patch">
</span><span class="lines">@@ -466,21 +503,37 @@
</span><span class="cx"> <listitem>
</span><span class="cx"> <para>object</para>
</span><span class="cx"> <para>
</span><del>- The value of the modifications to be applied to the object.
</del><ins>+ The value of the modifications to be applied to the object. The \
patch + set includes the operation type, the field to be changed, and the new
+ values. A PATCH request can <literal>add</literal>,
+ <literal>remove</literal>, \
<literal>replace</literal>, or + \
<literal>increment</literal> an attribute value. A + \
<literal>replace</literal> operation replaces an existing value, or + \
adds a value if no value exists. </ins><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> </variablelist>
</span><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
- <para>
- The modified OpenIDM resource object.
- </para>
</del><ins>+ <blockquote>
+ <title>Returns</title>
+ <para>
+ The modified OpenIDM resource object.
+ </para>
+ </blockquote>
</ins><span class="cx">
</span><del>- <bridgehead>Throws</bridgehead>
- <para>
- An exception is thrown if the object could not be updated.
- </para>
</del><ins>+ <blockquote>
+ <title>Throws</title>
+ <para>
+ An exception is thrown if the object could not be updated.
+ </para>
+ </blockquote>
+
+ <blockquote>
+ <title>Example</title>
+ <programlisting \
language="javascript">openidm.patch("managed/user/" + \
user._id, null, + [{"operation" : "replace", "field" : \
"/password", "value": \
"Passw0rd"}]);</programlisting> + </blockquote>
</ins><span class="cx"> </section>
</span><span class="cx">
</span><span class="cx"> <section xml:id="function-read">
</span><span class="lines">@@ -495,22 +548,29 @@
</span><span class="cx"> <listitem>
</span><span class="cx"> <para>string</para>
</span><span class="cx"> <para>
</span><del>- The identifier of the object to be read.
</del><ins>+ The full path to the object to be read, including the ID.
</ins><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> </variablelist>
</span><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
- <para>
- The read OpenIDM resource object, or <literal>null</literal> if \
not found.
- </para>
</del><ins>+ <blockquote>
+ <title>Returns</title>
+ <para>
+ The OpenIDM resource object, or <literal>null</literal> if not \
found. + </para>
+ </blockquote>
+
+ <blockquote>
+ <title>Example</title>
+ <programlisting \
language="javascript">openidm.read("managed/user/"+userId)</programlisting>
+ </blockquote>
</ins><span class="cx"> </section>
</span><span class="cx">
</span><span class="cx"> <section xml:id="function-update">
</span><span class="cx"> <title>openidm.update(id, rev, \
value)</title> </span><span class="cx"> <para>
</span><del>- This function updates a resource object.
</del><ins>+ This function updates an entire resource object.
</ins><span class="cx"> </para>
</span><span class="cx"> <variablelist>
</span><span class="cx"> <title>Parameters</title>
</span><span class="lines">@@ -528,9 +588,10 @@
</span><span class="cx"> <listitem>
</span><span class="cx"> <para>string</para>
</span><span class="cx"> <para>
</span><del>- The revision of the object to be updated. Use \
<literal>null</literal> if
- the object is not subject to revision control, or if you want to skip
- the revision check and update the object, regardless of the revision.
</del><ins>+ The revision of the object to be updated. Use \
<literal>null</literal> + if the object is not subject to \
revision control, or if you want to + skip the revision check and update the \
object, regardless of the + revision.
</ins><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="lines">@@ -539,21 +600,40 @@
</span><span class="cx"> <listitem>
</span><span class="cx"> <para>object</para>
</span><span class="cx"> <para>
</span><del>- The value of the object to be updated.
</del><ins>+ The complete replacement object.
</ins><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> </variablelist>
</span><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
- <para>
- The modified OpenIDM resource object.
- </para>
</del><ins>+ <blockquote>
+ <title>Returns</title>
+ <para>
+ The modified OpenIDM resource object.
+ </para>
+ </blockquote>
</ins><span class="cx">
</span><del>- <bridgehead>Throws</bridgehead>
</del><ins>+ <blockquote>
+ <title>Throws</title>
+ <para>
+ An exception is thrown if the object could not be updated.
+ </para>
+ </blockquote>
+
+ <blockquote>
+ <title>Example</title>
</ins><span class="cx"> <para>
</span><del>- An exception is thrown if the object could not be updated.
</del><ins>+ In this example, the managed user entry is read (with an
+ <literal>openidm.read</literal>, the user entry that has been read \
is + updated with a new description, and the entire updated object is replaced
+ with the new value.
</ins><span class="cx"> </para>
</span><ins>+ <programlisting language="javascript">
+ var user_read = openidm.read('managed/user/' + source._id);
+ user_read['description'] = 'The entry has been updated';
+ openidm.update('managed/user/' + source._id, null, user_read);
+ </programlisting>
+ </blockquote>
</ins><span class="cx"> </section>
</span><span class="cx">
</span><span class="cx"> <section xml:id="function-delete">
</span><span class="lines">@@ -586,35 +666,34 @@
</span><span class="cx"> </varlistentry>
</span><span class="cx"> </variablelist>
</span><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
- <para>
- A <literal>null</literal> value if successful.
- </para>
-
- <bridgehead>Throws</bridgehead>
- <para>
- An exception is thrown if the object could not be deleted.
- </para>
- <note>
</del><ins>+ <blockquote>
+ <title>Returns</title>
</ins><span class="cx"> <para>
</span><del>- Note that <literal>delete</literal> is a reserved \
word in JavaScript
- and this function can therefore not be called in the usual manner. To
- call delete from a JavaScript, you must specify the call as shown in the
- following example:
</del><ins>+ Returns the deleted object if successful.
</ins><span class="cx"> </para>
</span><del>- <programlisting \
language="javascript">openidm['delete']('managed/user/'+ user._id, \
user._rev)</programlisting> </del><ins>+ </blockquote>
+
+ <blockquote>
+ <title>Throws</title>
</ins><span class="cx"> <para>
</span><del>- Calling <literal>openidm.delete()</literal> directly \
from a JavaScript
- results in an error similar to the following:
</del><ins>+ An exception is thrown if the object could not be deleted.
</ins><span class="cx"> </para>
</span><del>- <screen>org.forgerock.openidm.script.ScriptException: \
missing name after . operator</screen>
- </note>
</del><ins>+ </blockquote>
+
+ <blockquote>
+ <title>Example</title>
+ <programlisting \
language="javascript">openidm.delete('managed/user/'+ user._id, \
user._rev)</programlisting> + </blockquote>
</ins><span class="cx"> </section>
</span><span class="cx">
</span><span class="cx"> <section xml:id="function-query">
</span><del>- <title>openidm.query(id, params)</title>
</del><ins>+ <title>openidm.query(id, params, fields)</title>
</ins><span class="cx"> <para>
</span><span class="cx"> This function performs a query on the specified \
OpenIDM resource object. </span><ins>+ For more information, see <link
+ xlink:href="integrators-guide#constructing-queries"
+ xlink:role="http://docbook.org/xlink/role/olink"><citetitle>Constructing
+ Queries</citetitle></link>.
</ins><span class="cx"> </para>
</span><span class="cx"> <variablelist>
</span><span class="cx"> <title>Parameters</title>
</span><span class="lines">@@ -623,7 +702,9 @@
</span><span class="cx"> <listitem>
</span><span class="cx"> <para>string</para>
</span><span class="cx"> <para>
</span><del>- The identifier of the object to perform the query on.
</del><ins>+ The resource object on which the query should be performed, for
+ example, <literal>"managed/user"</literal>, or
+ <literal>"system/ldap/account"</literal>.
</ins><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="lines">@@ -632,13 +713,62 @@
</span><span class="cx"> <listitem>
</span><span class="cx"> <para>object</para>
</span><span class="cx"> <para>
</span><del>- An object containing the query ID and its parameters.
</del><ins>+ The parameters that are passed to the query,
+ <literal>_queryFilter</literal>, \
<literal>_queryId</literal>, or + \
<literal>_queryExpression</literal>. Additional parameters passed to + \
the query will differ, depending on the query. </ins><span class="cx"> \
</para> </span><ins>+ <para>
+ Certain common parameters can be passed to the query to restrict the
+ query results. The following sample query passes paging parameters and
+ sort keys to the query.
+ </para>
+ <informalexample><?dbfo pgwide="1"?>
+<programlisting>reconAudit = openidm.query("audit/recon", {
+ "_queryFilter": queryFilter,
+ "_pageSize": limit,
+ "_pagedResultsOffset": offset,
+ "_pagedResultsCookie": string,
+ "_sortKeys": "-timestamp"
+});</programlisting>
+ </informalexample>
+ <para>
+ For more information about <literal>_queryFilter</literal> \
syntax, see + <link xlink:show="new" \
xlink:href="integrators-guide#query-filters" + \
xlink:role="http://docbook.org/xlink/role/olink"><citetitle>Common \
+ Filter Expressions</citetitle></link>. For more information \
about + paging, see <link xlink:show="new"
+ xlink:href="integrators-guide#paging-query-results"
+ xlink:role="http://docbook.org/xlink/role/olink"><citetitle>Paging
+ Query Results</citetitle></link>.
+ </para>
</ins><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><ins>+ <varlistentry>
+ <term>fields</term>
+ <listitem>
+ <para>
+ list
+ </para>
+ <para>
+ A list of the fields, or columns, that should be returned in the
+ result. The following example returns only the
+ <literal>userName</literal> and \
<literal>_id</literal> fields: + </para>
+ <programlisting language="javascript">
+openidm.query("managed/user", { "_queryFilter": "/userName \
sw \"user.1\""}, ["userName", "_id"]) + \
</programlisting> + <para>
+ This parameter is particularly useful in enabling you to return the
+ response from a query without including intermediary code to massage it
+ into the right format.
+ </para>
+ </listitem>
+ </varlistentry>
</ins><span class="cx"> </variablelist>
</span><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
</del><ins>+ <blockquote>
+ <title>Returns</title>
</ins><span class="cx"> <para>
</span><span class="cx"> The result of the query. A query result includes the \
following parameters: </span><span class="cx"> </para>
</span><span class="lines">@@ -695,12 +825,32 @@
</span><span class="cx"> ],
</span><span class="cx"> "query-time-ms": 1
</span><span class="cx"> }
</span><del>- </programlisting>
</del><ins>+ </programlisting>
+ </blockquote>
</ins><span class="cx">
</span><del>- <bridgehead>Throws</bridgehead>
- <para>
- An exception is thrown if the given query could not be processed.
- </para>
</del><ins>+ <blockquote>
+ <title>Throws</title>
+ <para>
+ An exception is thrown if the given query could not be processed.
+ </para>
+ </blockquote>
+
+ <blockquote>
+ <title>Examples</title>
+ <para>
+ The following sample query uses a <literal>_queryFilter</literal> \
to + query the managed user repository.
+ </para>
+ <programlisting>openidm.query("managed/user",
+{ '_queryFilter' : userIdPropertyName + ' eq "' + security.authenticationId + \
'"' });</programlisting> + <para>
+ The following sample query references the \
<literal>for-userName</literal> + query, defined in the repository \
configuration, to query the managed user + repository.
+ </para>
+ <programlisting>openidm.query("managed/user",
+{"_queryId": "for-userName", "uid": \
request.additionalParameters.uid } );</programlisting> + \
</blockquote> </ins><span class="cx"> </section>
</span><span class="cx">
</span><span class="cx"> <section xml:id="function-action">
</span><span class="lines">@@ -718,7 +868,8 @@
</span><span class="cx"> <listitem>
</span><span class="cx"> <para>string</para>
</span><span class="cx"> <para>
</span><del>- The resource that the function acts upon, such as managed/user.
</del><ins>+ The resource that the function acts upon, for example,
+ <literal>managed/user</literal>.
</ins><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="lines">@@ -727,14 +878,206 @@
</span><span class="cx"> <listitem>
</span><span class="cx"> <para>string</para>
</span><span class="cx"> <para>
</span><del>- The action to execute.
</del><ins>+ The action to execute. Actions are used to represent \
functionality that + is not covered by the standard methods for a resource \
(create, read, + update, delete, patch, or query). In general, you should not \
use the + <literal>openidm.action</literal> function for create, \
read, update, + patch, delete or query operations. Instead, use the \
corresponding + function specific to the operation (for example,
+ <literal>openidm.create</literal>).
</ins><span class="cx"> </para>
</span><ins>+ <para>
+ Using the operation-specific functions enables you to benefit from the
+ well-defined REST API, which follows the same pattern as all other
+ standard resources in the system. Using the REST API enhances usability
+ for your own API enforces the established patterns described in the
+ <link xlink:show="new" \
xlink:href="integrators-guide#appendix-rest" + \
xlink:role="http://docbook.org/xlink/role/olink"><citetitle>REST \
API + Reference</citetitle></link>.
+ </para>
+ <para>
+ OpenIDM-defined resources support a fixed set of actions. For
+ user-defined resources (scriptable endpoints) you can implement
+ whatever actions you require.
+ </para>
+ <variablelist>
+ <para>
+ The following list outlines the supported actions, for each
+ OpenIDM-defined resource. The actions listed here are also supported
+ over the REST interface, and are described in detail in the <link
+ xlink:href="integrators-guide#appendix-rest"
+ xlink:role="http://docbook.org/xlink/role/olink"><citetitle>REST
+ Appendix</citetitle></link>.
+ </para>
+ <varlistentry>
+ <term>
+ Actions supported on the managed resource
+ (<literal>managed/<replaceable>*</replaceable></literal>)
+ </term>
+ <listitem>
+ <para>
+ command, patch-by-query
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ Actions supported on system resources
+ (<literal>system/<replaceable>*</replaceable></literal>)
+ </term>
+ <listitem>
+ <para>
+ availableConnectors, createCoreConfig, createFullConfig, test,
+ testConfig, liveSync, authenticate, script
+ </para>
+ <para>
+ For example:
+ </para>
+ <programlisting \
language="javascript">openidm.action("system/ldap/account", \
"authenticate", {}, +{"userName" : "bjensen", \
"password" : "Passw0rd"});</programlisting> + \
</listitem> + </varlistentry>
+ <varlistentry>
+ <term>
+ Actions supported on the repository (<literal>repo</literal>)
+ </term>
+ <listitem>
+ <para>
+ command, updateDbCredentials
+ </para>
+ <para>
+ For example:
+ </para>
+ <programlisting language="javascript">var r, command = {
+ "commandId": "purge-by-recon-number-of",
+ "numberOf": numOfRecons,
+ "includeMapping" : includeMapping,
+ "excludeMapping" : excludeMapping
+};
+r = openidm.action("repo/audit/recon", "command", {}, \
command);</programlisting> + </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ Actions supported on the synchronization resource \
(<literal>sync</literal>) + </term>
+ <listitem>
+ <para>
+ performAction,
+ </para>
+ <para>
+ For example:
+ </para>
+ <programlisting \
language="javascript">openidm.action('sync', 'performAction', content, \
params)</programlisting> + </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ Actions supported on the reconciliation resource \
(<literal>recon</literal>) + </term>
+ <listitem>
+ <para>
+ recon, cancel
+ </para>
+ <para>
+ For example:
+ </para>
+ <programlisting \
language="javascript">openidm.action("recon", \
"cancel", content, params);</programlisting> + \
</listitem> + </varlistentry>
+ <varlistentry>
+ <term>
+ Actions supported on the script resource \
(<literal>script</literal>) + </term>
+ <listitem>
+ <para>
+ eval
+ </para>
+ <para>
+ For example:
+ </para>
+ <programlisting \
language="javascript">openidm.action("script", \
"eval", getConfig(scriptConfig), {});</programlisting> + \
</listitem> + </varlistentry>
+ <varlistentry>
+ <term>
+ Actions supported on the policy resource \
(<literal>policy</literal>) + </term>
+ <listitem>
+ <para>
+ validateObject, validateProperty
+ </para>
+ <para>
+ For example:
+ </para>
+ <informalexample><?dbfo pgwide="1"?>
+<programlisting language="javascript">openidm.action("policy/" \
+ fullResourcePath, "validateObject", request.content, { \
"external" : "true" });</programlisting> + \
</informalexample> + </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ Actions supported on the workflow resource \
(<literal>workflow/*</literal>) + </term>
+ <listitem>
+ <para>
+ claim, createProcessInstance
+ </para>
+ <para>
+ For example:
+ </para>
+ <informalexample><?dbfo pgwide="1"?>
+<programlisting language="javascript">var params = {
+"_key" : "EmailNotification",
+"fromSender" : "admin@example.com",
+"toEmail" : "bjensen@example.com"
+};
+openidm.action('workflow/processinstance', {"_action" : \
"createProcessInstance"}, params);</programlisting> + \
</informalexample> + </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ Actions supported on the task scanner resource
+ (<literal>taskscanner</literal>)
+ </term>
+ <listitem>
+ <para>
+ execute, cancel
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ Actions supported on the external email resource
+ (<literal>external/email</literal>)
+ </term>
+ <listitem>
+ <para>
+ sendEmail
+ </para>
+ <para>
+ For example:
+ </para>
+ <programlisting language="javascript">{
+ emailParams = {
+ "from" : 'admin@example.com',
+ "to" : user.mail,
+ "subject" : 'Password expiry notification',
+ "type" : 'text/plain',
+ "body" : 'Your password will expire soon. Please change it!'
+ }
+ openidm.action("external/email", 'sendEmail', emailParams);
+}</programlisting>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</ins><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> <varlistentry>
</span><span class="cx"> <term>content</term>
</span><span class="cx"> <listitem>
</span><del>- <para>object</para>
</del><ins>+ <para>object (optional)</para>
</ins><span class="cx"> <para>
</span><span class="cx"> Content given to the action for processing.
</span><span class="cx"> </para>
</span><span class="lines">@@ -743,26 +1086,31 @@
</span><span class="cx"> <varlistentry>
</span><span class="cx"> <term>params</term>
</span><span class="cx"> <listitem>
</span><del>- <para>object</para>
</del><ins>+ <para>object (optional)</para>
</ins><span class="cx"> <para>
</span><del>- Parameters are key/value strings. You may see them in \
JavaScript files
- with entries such as
- <literal>request.additionalParameters.userId</literal> and
- <literal>request.additionalParameters.mapping</literal>.
</del><ins>+ Additional parameters passed to the script. The
+ <literal>params</literal> object must be a set of simple \
key:value + pairs, and cannot include complex values. The parameters must map
+ directly to URL variables, which take the form
+ <literal>name1=val1&amp;name2=val2&amp;...</literal>.
</ins><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> </variablelist>
</span><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
- <para>
- The result of the action may be <literal>null</literal>.
- </para>
</del><ins>+ <blockquote>
+ <title>Returns</title>
+ <para>
+ The result of the action may be <literal>null</literal>.
+ </para>
+ </blockquote>
</ins><span class="cx">
</span><del>- <bridgehead>Throws</bridgehead>
- <para>
- If the action cannot be executed, an exception is thrown.
- </para>
</del><ins>+ <blockquote>
+ <title>Throws</title>
+ <para>
+ If the action cannot be executed, an exception is thrown.
+ </para>
+ </blockquote>
</ins><span class="cx"> </section>
</span><span class="cx">
</span><span class="cx"> <section xml:id="function-encrypt">
</span><span class="lines">@@ -774,215 +1122,293 @@
</span><span class="cx"> <title>Parameters</title>
</span><span class="cx"> <varlistentry>
</span><span class="cx"> <term>value</term>
</span><del>- <listitem>
- <para>any</para>
- <para>
- The value to be encrypted.
- </para>
- </listitem>
- </varlistentry>
</del><ins>+ <listitem>
+ <para>any</para>
+ <para>
+ The value to be encrypted.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>cipher</term>
+ <listitem>
+ <para>string</para>
+ <para>
+ The cipher with which to encrypt the value, using the form
+ "algorithm/mode/padding" or just "algorithm". Example:
+ <literal>AES/ECB/PKCS5Padding</literal>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>alias</term>
+ <listitem>
+ <para>string</para>
+ <para>
+ The key alias in the keystore with which to encrypt the node.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+
+ <blockquote>
+ <title>Returns</title>
+ <para>
+ The value, encrypted with the specified cipher and key.
+ </para>
+ </blockquote>
+
+ <blockquote>
+ <title>Throws</title>
+ <para>
+ An exception is thrown if the object could not be encrypted for any
+ reason.
+ </para>
+ </blockquote>
+ </section>
+
+ <section xml:id="function-decrypt">
+ <title>openidm.decrypt(value)</title>
+ <para>This function decrypts a value.</para>
+ <variablelist>
+ <title>Parameters</title>
+ <varlistentry>
+ <term>value</term>
+ <listitem>
+ <para>object</para>
+ <para>
+ The value to be decrypted.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+
+ <blockquote>
+ <title>Returns</title>
+ <para>
+ A deep copy of the value, with any encrypted value decrypted.
+ </para>
+ </blockquote>
+
+ <blockquote>
+ <title>Throws</title>
+ <para>
+ An exception is thrown if the object could not be decrypted for any
+ reason. An error is thrown if the value is passed in as a string - it
+ must be passed in an object.
+ </para>
+ </blockquote>
+ </section>
+
+ <section xml:id="function-isencrypted">
+ <title>openidm.isEncrypted(object)</title>
+ <para>
+ This function determines if a value is encrypted.
+ </para>
+ <variablelist>
+ <title>Parameters</title>
+ <varlistentry>
+ <term>object to check</term>
+ <listitem>
+ <para>any</para>
+ <para>
+ The object whose value should be checked to determine if it is
+ encrypted.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+
+ <blockquote>
+ <title>Returns</title>
+ <para>
+ Boolean, <literal>true</literal> if the value is encrypted, and
+ <literal>false</literal> if it is not encrypted.
+ </para>
+ </blockquote>
+
+ <blockquote>
+ <title>Throws</title>
+ <para>
+ An exception is thrown if the server is unable to detect whether the
+ value is encrypted, for any reason.
+ </para>
+ </blockquote>
+ </section>
+
+ <section xml:id="logger-functions">
+ <title>Logging Functions</title>
+ <para>
+ OpenIDM also provides a <literal>logger</literal> object to access \
the + Simple Logging Facade for Java (SLF4J) facilities. The following code
+ shows an example of the <literal>logger</literal> object.
+ </para>
+ <programlisting \
language="javascript">logger.info("Parameters passed in: {} {} \
{}", param1, param2, param3);</programlisting> + <para>
+ To set the log level for all scripts, add the following property to the
+ <filename>openidm/conf/logging.properties</filename> file:
+ <literal>org.forgerock.openidm.script.javascript.JavaScript.level</literal>.
+ The level can be one of <literal>SEVERE</literal> (highest \
value), + <literal>WARNING, INFO, CONFIG, FINE, FINER</literal>, or
+ <literal>FINEST</literal> (lowest value). For example:
+ </para>
+ <programlisting \
language="javascript">org.forgerock.script.javascript.JavaScript.level=WARNING</programlisting>
+ <para>
+ In addition, JavaScript has a useful logging function named
+ <literal>console.log()</literal>. This function provides an easy \
way to + dump data to the OpenIDM standard output (usually the same output as \
the + Felix console). The function works well with the JavaScript built-in
+ function <literal>JSON.stringify</literal> and provides \
fine-grained + details about any given object. For example, the following line \
will + print a formatted JSON structure that represents the HTTP request details
+ to STDOUT.</para>
+ <programlisting \
language="javascript">console.log(JSON.stringify(context.http, null, \
4));</programlisting> + <para>
+ For more information, see .
+ </para>
+ <note>
+ <para>
+ These logging functions apply only to JavaScript scripts. To use the
+ logging functions in Groovy scripts, the following lines must be added to
+ the Groovy scripts:
+ </para>
+ <programlisting>
+import org.slf4j.*;
+logger = LoggerFactory.getLogger('logger');
+ </programlisting>
+ </note>
+ <para>
+ The following sections describe the logging functions available to the
+ script engine.
+ </para>
+
+ <section xml:id="function-logger-debug">
+ <title>logger.debug(string message, object... params)</title>
+ <para>
+ Logs a message at DEBUG level.
+ </para>
+ <variablelist>
+ <title>Parameters</title>
</ins><span class="cx"> <varlistentry>
</span><del>- <term>cipher</term>
</del><ins>+ <term>message</term>
</ins><span class="cx"> <listitem>
</span><span class="cx"> <para>string</para>
</span><span class="cx"> <para>
</span><del>- The cipher with which to encrypt the value, using the form
- "algorithm/mode/padding" or just "algorithm". Example:
- <literal>AES/ECB/PKCS5Padding</literal>.
</del><ins>+ The message format to log. Params replace \
<literal>{}</literal> in + your message.
</ins><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> <varlistentry>
</span><del>- <term>alias</term>
</del><ins>+ <term>params</term>
</ins><span class="cx"> <listitem>
</span><del>- <para>string</para>
</del><ins>+ <para>object</para>
</ins><span class="cx"> <para>
</span><del>- The key alias in the keystore with which to encrypt the node.
</del><ins>+ Arguments to include in the message.
</ins><span class="cx"> </para>
</span><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> </variablelist>
</span><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
- <para>
- The value, encrypted with the specified cipher and key.
- </para>
-
- <bridgehead>Throws</bridgehead>
- <para>
- An exception is thrown if the object could not be encrypted for any reason.
- </para>
- </section>
-
- <section xml:id="function-decrypt">
- <title>openidm.decrypt(value)</title>
- <para>This function decrypts a value.</para>
- <variablelist>
- <title>Parameters</title>
- <varlistentry>
- <term>value</term>
- <listitem>
- <para>any</para>
- <para>
- The value to be decrypted.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <bridgehead>Returns</bridgehead>
</del><ins>+ <blockquote>
+ <title>Returns</title>
</ins><span class="cx"> <para>
</span><del>- A deep copy of the value, with any encrypted value decrypted.
</del><ins>+ A <literal>null</literal> value if successful.
</ins><span class="cx"> </para>
</span><del>- <bridgehead>Throws</bridgehead>
- <para>
- An exception is thrown if the object could not be decrypted for any
- reason.
- </para>
- </section>
</del><ins>+ </blockquote>
</ins><span class="cx">
</span><del>- <section xml:id="function-isencrypted">
- <title>openidm.isEncrypted(object)</title>
</del><ins>+ <blockquote>
+ <title>Throws</title>
</ins><span class="cx"> <para>
</span><del>- This function determines if a value is encrypted.
- </para>
- <variablelist>
- <title>Parameters</title>
- <varlistentry>
- <term>object to check</term>
- <listitem>
- <para>any</para>
- <para>
- The object whose value should be checked to determine if it is
- encrypted.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <bridgehead>Returns</bridgehead>
- <para>
- Boolean, <literal>true</literal> if the value is encrypted, and
- <literal>false</literal> if it is not encrypted.
- </para>
- <bridgehead>Throws</bridgehead>
- <para>
- An exception is thrown if the server is unable to detect whether the
- value is encrypted, for any reason.
- </para>
- </section>
-
- <section xml:id="function-logger-debug">
- <title>logger.debug(string message, object... params)</title>
- <para>
- Logs a message at DEBUG level.
- </para>
- <variablelist>
- <title>Parameters</title>
- <varlistentry>
- <term>message</term>
- <listitem>
- <para>string</para>
- <para>
- The message format to log. Params replace \
<literal>{}</literal> in
- your message.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>params</term>
- <listitem>
- <para>object</para>
- <para>
- Arguments to include in the message.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <bridgehead>Returns</bridgehead>
- <para>
- A <literal>null</literal> value if successful.
- </para>
- <bridgehead>Throws</bridgehead>
- <para>
</del><span class="cx"> An exception is thrown if the message could not be \
logged. </span><span class="cx"> </para>
</span><del>- </section>
</del><ins>+ </blockquote>
+ </section>
</ins><span class="cx">
</span><del>- <section xml:id="function-logger-error">
- <title>logger.error(string message, object... params)</title>
- <para>
- Logs a message at ERROR level.
- </para>
- <variablelist>
- <title>Parameters</title>
- <varlistentry>
- <term>message</term>
- <listitem>
- <para>string</para>
- <para>
- The message format to log. Params replace \
<literal>{}</literal> in
- your message.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>params</term>
- <listitem>
- <para>object</para>
- <para>
- Arguments to include in the message.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
</del><ins>+ <section xml:id="function-logger-error">
+ <title>logger.error(string message, object... params)</title>
+ <para>
+ Logs a message at ERROR level.
+ </para>
+ <variablelist>
+ <title>Parameters</title>
+ <varlistentry>
+ <term>message</term>
+ <listitem>
+ <para>string</para>
+ <para>
+ The message format to log. Params replace \
<literal>{}</literal> in + your message.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>params</term>
+ <listitem>
+ <para>object</para>
+ <para>
+ Arguments to include in the message.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</ins><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
</del><ins>+ <blockquote>
+ <title>Returns</title>
</ins><span class="cx"> <para>
</span><span class="cx"> A <literal>null</literal> value if \
successful. </span><span class="cx"> </para>
</span><ins>+ </blockquote>
</ins><span class="cx">
</span><del>- <bridgehead>Throws</bridgehead>
</del><ins>+ <blockquote>
+ <title>Throws</title>
</ins><span class="cx"> <para>
</span><span class="cx"> An exception is thrown if the message could not be \
logged. </span><span class="cx"> </para>
</span><del>- </section>
</del><ins>+ </blockquote>
+ </section>
</ins><span class="cx">
</span><del>- <section xml:id="function-logger-info">
- <title>logger.info(string message, object... params)</title>
- <para>
- Logs a message at INFO level.
- </para>
- <variablelist>
- <title>Parameters</title>
- <varlistentry>
- <term>message</term>
- <listitem>
- <para>string</para>
- <para>
- The message format to log. Params replace \
<literal>{}</literal> in
- your message.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>params</term>
- <listitem>
- <para>object</para>
- <para>
- Arguments to include in the message.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
</del><ins>+ <section xml:id="function-logger-info">
+ <title>logger.info(string message, object... params)</title>
+ <para>
+ Logs a message at INFO level.
+ </para>
+ <variablelist>
+ <title>Parameters</title>
+ <varlistentry>
+ <term>message</term>
+ <listitem>
+ <para>string</para>
+ <para>
+ The message format to log. Params replace \
<literal>{}</literal> in + your message.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>params</term>
+ <listitem>
+ <para>object</para>
+ <para>
+ Arguments to include in the message.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</ins><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
</del><ins>+ <blockquote>
+ <title>Returns</title>
</ins><span class="cx"> <para>
</span><span class="cx"> A <literal>null</literal> value if \
successful. </span><span class="cx"> </para>
</span><ins>+ </blockquote>
</ins><span class="cx">
</span><del>- <bridgehead>Throws</bridgehead>
</del><ins>+ <blockquote>
+ <title>Throws</title>
</ins><span class="cx"> <para>
</span><span class="cx"> An exception is thrown if the message could not be \
logged. </span><span class="cx"> </para>
</span><ins>+ </blockquote>
</ins><span class="cx"> </section>
</span><span class="cx">
</span><span class="cx"> <section \
xml:id="function-logger-trace"> </span><span class="lines">@@ -1013,15 \
+1439,19 @@ </span><span class="cx"> </varlistentry>
</span><span class="cx"> </variablelist>
</span><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
- <para>
- A <literal>null</literal> value if successful.
- </para>
</del><ins>+ <blockquote>
+ <title>Returns</title>
+ <para>
+ A <literal>null</literal> value if successful.
+ </para>
+ </blockquote>
</ins><span class="cx">
</span><del>- <bridgehead>Throws</bridgehead>
- <para>
- An exception is thrown if the message could not be logged.
- </para>
</del><ins>+ <blockquote>
+ <title>Throws</title>
+ <para>
+ An exception is thrown if the message could not be logged.
+ </para>
+ </blockquote>
</ins><span class="cx"> </section>
</span><span class="cx">
</span><span class="cx"> <section xml:id="function-logger-warn">
</span><span class="lines">@@ -1052,17 +1482,22 @@
</span><span class="cx"> </varlistentry>
</span><span class="cx"> </variablelist>
</span><span class="cx">
</span><del>- <bridgehead>Returns</bridgehead>
- <para>
- A <literal>null</literal> value if successful.
- </para>
</del><ins>+ <blockquote>
+ <title>Returns</title>
+ <para>
+ A <literal>null</literal> value if successful.
+ </para>
+ </blockquote>
</ins><span class="cx">
</span><del>- <bridgehead>Throws</bridgehead>
- <para>
- An exception is thrown if the message could not be logged.
- </para>
</del><ins>+ <blockquote>
+ <title>Throws</title>
+ <para>
+ An exception is thrown if the message could not be logged.
+ </para>
+ </blockquote>
</ins><span class="cx"> </section>
</span><span class="cx"> </section>
</span><ins>+ </section>
</ins><span class="cx">
</span><span class="cx"> <section xml:id="script-places">
</span><span class="cx"> <title>Places to Trigger Scripts</title>
</span><span class="lines">@@ -1167,8 +1602,9 @@
</span><span class="cx"> <title>Variables Available in \
Scripts</title> </span><span class="cx"> <para>
</span><span class="cx"> The variables that are available to scripts depend on \
the triggers that </span><del>- launch the script. The following section \
outlines the available variables,
- per trigger.
</del><ins>+ launch the script, and on the locations in which those triggers are
+ defined. The following section outlines the available variables, per
+ trigger.
</ins><span class="cx"> </para>
</span><span class="cx"> <variablelist>
</span><span class="cx"> <varlistentry>
</span><span class="lines">@@ -1192,13 +1628,23 @@
</span><span class="cx"> <varlistentry>
</span><span class="cx"> <term>onCreate, postCreate</term>
</span><span class="cx"> <listitem>
</span><del>- <para>object, source, target</para>
</del><ins>+ <para>
+ Triggered in <filename>sync.json</filename> : object, source, \
target + </para>
+ <para>
+ Triggered in <filename>managed.json</filename> : object
+ </para>
</ins><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> <varlistentry>
</span><span class="cx"> <term>onDelete, postDelete</term>
</span><span class="cx"> <listitem>
</span><del>- <para>object</para>
</del><ins>+ <para>
+ Triggered in <filename>sync.json</filename> : object, source, \
target + </para>
+ <para>
+ Triggered in <filename>managed.json</filename> : object
+ </para>
</ins><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> <varlistentry>
</span><span class="lines">@@ -1246,7 +1692,12 @@
</span><span class="cx"> <varlistentry>
</span><span class="cx"> <term>onUpdate, postUpdate</term>
</span><span class="cx"> <listitem>
</span><del>- <para>oldObject, newObject</para>
</del><ins>+ <para>
+ Triggered in <filename>sync.json</filename> : source, target
+ </para>
+ <para>
+ Triggered in <filename>managed.json</filename> : oldObject, \
newObject + </para>
</ins><span class="cx"> </listitem>
</span><span class="cx"> </varlistentry>
</span><span class="cx"> <varlistentry>
</span></span></pre>
</div>
</div>
<div id="footer">Copyright (c) by ForgeRock. All rights reserved.</div>
</body>
</html>
_______________________________________________
CommitOpenIDM mailing list
CommitOpenIDM@forgerock.org
https://lists.forgerock.org/mailman/listinfo/commitopenidm
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic