[prev in list] [next in list] [prev in thread] [next in thread] 

List:       forgerock-openidm
Subject:    [OpenIDM] RE :  RE : Groovy Connector Toolkit + scriptArguments
From:       "Belleville-Rioux, Vincent" <rioux.vincent () uqam ! ca>
Date:       2015-03-31 20:41:51
Message-ID: 0AD36E0192997748BD28BC68B14C75D01646A2DD () Lettre ! gst ! uqam ! ca
[Download RAW message or body]

Quick other question : how do you define a scriptOnResource in the provisioner.conf \
file?

Thanks,

Vincent


________________________________
De : openidm-bounces@forgerock.org [openidm-bounces@forgerock.org] de la part de Gael \
Allioux [gael.allioux@forgerock.com] Date d'envoi : 31 mars 2015 16:04
À : openidm@forgerock.org
Objet : Re: [OpenIDM] RE : Groovy Connector Toolkit + scriptArguments



On 03/31/2015 08:42 PM, Belleville-Rioux, Vincent wrote:
Salut Gael,

We're trying to add an unlock account functionality through a ScriptedSQL \
provisioner.  That functionality would be triggered by an external system through a \
REST call.

provisioner.conf :

{
    "name" : "mysystem",
    "connectorRef" : {
        "bundleName" : "org.forgerock.openicf.connectors.groovy-connector",
        "bundleVersion" : "1.4.1.0",
        "connectorName" : \
"org.forgerock.openicf.connectors.scriptedsql.ScriptedSQLConnector"  },
(...)
    "systemActions" : [
        {
            "scriptId" : "UnlockAccount",
            "actions" : [
                {
                    "systemType" : ".*ScriptedSQLConnector",
                    "actionType" : "Groovy",
                    "actionFile" : \
"script/provisioners/mysystem/UnlockAccount.groovy"  }
            ]
        }
    ],
(...)

Then, calling that through a REST call :

/openidm/system/mysystem?_action=script&scriptId=UnlockAccount&userName=test

The UnlockAccount.groovy script is launched (we can confirm from the logs), but we'd \
like to be able to read the actual userName parameter. userName parameter should be \
injected in the script since you're going to run a "scriptOnConnector" action

I think  "scriptArguments" would be injected if you were running "scriptOnResource" \
action.



Otherwise, we'd be interested in another approach if we could do a REST call like :

/openidm/system/mysystem/account/test?_action=script&scriptId=UnlockAccount

why don't you just write your own custom endpoint ?



But we couldn't figure out any way to do that from the samples / docs.

Thanks,

Vincent


________________________________
De : openidm-bounces@forgerock.org<mailto:openidm-bounces@forgerock.org> \
[openidm-bounces@forgerock.org<mailto:openidm-bounces@forgerock.org>] de la part de \
Belleville-Rioux, Vincent [rioux.vincent@uqam.ca<mailto:rioux.vincent@uqam.ca>] Date \
d'envoi : 31 mars 2015 13:59 À : openidm@forgerock.org<mailto:openidm@forgerock.org>
Objet : [OpenIDM] Groovy Connector Toolkit + scriptArguments

Hi,

How can we access the script arguments when using the Groovy Connector Toolkit?

We tried doing something like this :
def scriptArguments = scriptArguments as ScriptArguments

log.info(scriptArguments.toString())

But that Map doesn't seem to exist.

Thanks,

Vincent



_______________________________________________
OpenIDM mailing list
OpenIDM@forgerock.org<mailto:OpenIDM@forgerock.org>
https://lists.forgerock.org/mailman/listinfo/openidm


[Attachment #3 (text/html)]

<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Quick \
other question : how do you define a scriptOnResource in the provisioner.conf file? \
<div><br> </div>
<div>Thanks,</div>
<div><br>
</div>
<div>Vincent<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style=""><br>
</div>
</div>
</div>
</div>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div id="divRpF450541" style="direction: ltr;"><font face="Tahoma" size="2" \
color="#000000"><b>De :</b> openidm-bounces@forgerock.org \
[openidm-bounces@forgerock.org] de la part de Gael Allioux \
[gael.allioux@forgerock.com]<br> <b>Date d'envoi :</b> 31 mars 2015 16:04<br>
<b>À :</b> openidm@forgerock.org<br>
<b>Objet :</b> Re: [OpenIDM] RE : Groovy Connector Toolkit &#43; scriptArguments<br>
</font><br>
</div>
<div></div>
<div><br>
<br>
<div class="moz-cite-prefix">On 03/31/2015 08:42 PM, Belleville-Rioux, Vincent \
wrote:<br> </div>
<blockquote type="cite"><style type="text/css" id="owaParaStyle"></style>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Salut \
Gael, <div><br>
</div>
<div>We're trying to add an unlock account functionality through a ScriptedSQL \
provisioner. &nbsp;That functionality would be triggered by an external system \
through a REST call.</div> <div><br>
</div>
<div>provisioner.conf :</div>
<div><br>
</div>
<div>{</div>
<div>
<div>&nbsp; &nbsp; &quot;name&quot; : &quot;mysystem&quot;,</div>
<div>&nbsp; &nbsp; &quot;connectorRef&quot; : {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &quot;bundleName&quot; : \
&quot;org.forgerock.openicf.connectors.groovy-connector&quot;,</div> <div>&nbsp; \
&nbsp; &nbsp; &nbsp; &quot;bundleVersion&quot; : &quot;1.4.1.0&quot;,</div> \
<div>&nbsp; &nbsp; &nbsp; &nbsp; &quot;connectorName&quot; : \
&quot;org.forgerock.openicf.connectors.scriptedsql.ScriptedSQLConnector&quot;</div> \
<div>&nbsp; &nbsp; },</div> </div>
<div>(...)</div>
<div>
<div>&nbsp; &nbsp; &quot;systemActions&quot; : [</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;scriptId&quot; : \
&quot;UnlockAccount&quot;,</div> <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&quot;actions&quot; : [</div> <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; {</div> <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &quot;systemType&quot; : &quot;.*ScriptedSQLConnector&quot;,</div> <div>&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;actionType&quot; \
: &quot;Groovy&quot;,</div> <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; &quot;actionFile&quot; : \
&quot;script/provisioners/mysystem/UnlockAccount.groovy&quot;</div> <div>&nbsp; \
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div> <div>&nbsp; &nbsp; &nbsp; \
&nbsp; &nbsp; &nbsp; ]</div> <div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; ],</div>
</div>
<div>(...)</div>
<div><br>
</div>
<div>Then, calling that through a REST call :</div>
<div><br>
</div>
<div>/openidm/system/mysystem?_action=script&amp;scriptId=UnlockAccount&amp;userName=test</div>
 <div><br>
</div>
<div>The UnlockAccount.groovy script is launched (we can confirm from the logs), but \
we'd like to be able to read the actual userName parameter.</div> </div>
</blockquote>
userName parameter should be injected in the script since you're going to run a \
&quot;scriptOnConnector&quot; action<br> <br>
I think&nbsp; &quot;scriptArguments&quot; would be injected if you were running \
&quot;scriptOnResource&quot; action.<br> <br>
<br>
<blockquote type="cite">
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">
<div><br>
</div>
<div>Otherwise, we'd be interested in another approach if we could do a REST call \
like :</div> <div><br>
</div>
<div>/openidm/system/mysystem/account/test?_action=script&amp;scriptId=UnlockAccount</div>
 </div>
</blockquote>
<br>
why don't you just write your own custom endpoint ?<br>
<br>
<br>
<blockquote type="cite">
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">
<div><br>
</div>
<div>But we couldn't figure out any way to do that from the samples / docs.</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Vincent<br>
<div><br>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style=""><br>
</div>
</div>
</div>
</div>
<div style="font-family:Times New Roman; color:#000000; font-size:16px">
<hr tabindex="-1">
<div id="divRpF239170" style="direction:ltr"><font color="#000000" face="Tahoma" \
size="2"><b>De :</b> <a class="moz-txt-link-abbreviated" \
href="mailto:openidm-bounces@forgerock.org" target="_blank"> \
openidm-bounces@forgerock.org</a> [<a class="moz-txt-link-abbreviated" \
href="mailto:openidm-bounces@forgerock.org" \
target="_blank">openidm-bounces@forgerock.org</a>] de la part de Belleville-Rioux, \
Vincent [<a class="moz-txt-link-abbreviated" href="mailto:rioux.vincent@uqam.ca" \
target="_blank">rioux.vincent@uqam.ca</a>]<br> <b>Date d'envoi :</b> 31 mars 2015 \
13:59<br> <b>À :</b> <a class="moz-txt-link-abbreviated" \
href="mailto:openidm@forgerock.org" target="_blank"> openidm@forgerock.org</a><br>
<b>Objet :</b> [OpenIDM] Groovy Connector Toolkit &#43; scriptArguments<br>
</font><br>
</div>
<div>
<div style="direction:ltr; font-family:Tahoma; color:#000000; font-size:10pt">Hi,
<div><br>
</div>
<div>How can we access the script arguments when using the Groovy Connector \
Toolkit?</div> <div><br>
</div>
<div>We tried doing something like this :</div>
<div>def scriptArguments = scriptArguments as ScriptArguments<br>
<div><br>
</div>
<div>log.info(scriptArguments.toString())</div>
<div><br>
</div>
<div>But that Map doesn't seem to exist.</div>
<div>
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style=""><br>
</div>
<div style="">Thanks,</div>
<div style=""><br>
</div>
<div style="">Vincent</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader" target="_blank"></fieldset> <br>
<pre>_______________________________________________
OpenIDM mailing list
<a class="moz-txt-link-abbreviated" href="mailto:OpenIDM@forgerock.org" \
target="_blank">OpenIDM@forgerock.org</a> <a class="moz-txt-link-freetext" \
href="https://lists.forgerock.org/mailman/listinfo/openidm" \
target="_blank">https://lists.forgerock.org/mailman/listinfo/openidm</a> </pre>
</blockquote>
<br>
</div>
</div>
</div>
</div>
</body>
</html>



_______________________________________________
OpenIDM mailing list
OpenIDM@forgerock.org
https://lists.forgerock.org/mailman/listinfo/openidm

--===============6954275566229815435==--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic