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

List:       forgerock-openidm
Subject:    Re: [OpenIDM] OpenIDM Digest, Vol 73, Issue 6
From:       Greg Gebhart <greg.gebhart () identityfusion ! com>
Date:       2016-06-15 19:07:50
Message-ID: CAMJ+q9O7Op-At0_YhfxMmUStrpab44duqwfbBYsVkBrvq4aMzw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Thanks Jake!  I'll give it a try.

On Wed, Jun 15, 2016 at 3:00 PM, <openidm-request@forgerock.org> wrote:

> Send OpenIDM mailing list submissions to
> openidm@forgerock.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.forgerock.org/mailman/listinfo/openidm
> or, via email, send a message with subject or body 'help' to
> openidm-request@forgerock.org
> 
> You can reach the person managing the list at
> openidm-owner@forgerock.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of OpenIDM digest..."
> 
> 
> Today's Topics:
> 
> 1. OpenIDM Custom Endpoints Configuration Options (Greg Gebhart)
> 2. Re: OpenIDM Custom Endpoints Configuration Options (Jake Feasel)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 14 Jun 2016 17:54:41 -0400
> From: Greg Gebhart <greg.gebhart@identityfusion.com>
> To: openidm@forgerock.org
> Subject: [OpenIDM] OpenIDM Custom Endpoints Configuration Options
> Message-ID:
> <CAMJ+q9N=
> sp3sXoY2_DdgGpoD+wbUzS922bG9Wgv+BBsAeG1QUA@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> Hi,
> 
> I'm working on a custom endpoint in OpenIDM to return an array of objects
> based upon a consumer's query request.  Essentially they request some data
> from the custom endpoint, the endpoint calculates an array of objects, and
> the endpoint returns the array.
> 
> The code looks something like this:
> 
> if (request instanceof QueryRequest) {
> if (request.queryId == 'sampleData') {
> result = [];
> for (i = 0; i < 10; i++) {
> def optionCount = calculateDailyOptions(i)  // Custom
> function
> def obj = ["day" : i, "count" : optionCount]
> result.push(obj)
> }
> return result;
> }
> }
> 
> When the response is sent down to the consumer it gets wrapped in into
> another object that resembles something like
> {
> "result:[[obj1, obj2, obj3, ...]],
> "resultCount":10,
> "pagedResultsCookie":null,
> "totalPagedResultsPolicy":"NONE",
> "totalPagedResults":-1,
> "remainingPagedResults":-1
> }
> 
> Is there anyway to configure the endpoint to NOT wrap the return value with
> the resultCount and paging parameters?  From what I can tell these
> parameters are added after execution leaves the groovy script defined for
> the custom endpoint so I don't have direct control over them.
> 
> Thanks,
> Greg
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.forgerock.org/pipermail/openidm/attachments/20160614/9b44e9f2/attachment-0001.html
> 
> > 
> 
> ------------------------------
> 
> Message: 2
> Date: Tue, 14 Jun 2016 15:11:51 -0700
> From: Jake Feasel <jake.feasel@forgerock.com>
> To: "openidm@forgerock.org" <openidm@forgerock.org>
> Subject: Re: [OpenIDM] OpenIDM Custom Endpoints Configuration Options
> Message-ID:
> <CALXz=-
> W5fxvOWAMyk8bWCYpEYdL22uPf5gUKBN_vx4cXQHd9Og@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> The wrapping is based on the fact that your endpoint is getting interpreted
> as a query request. You can avoid the wrapping by instead requesting it as
> an action request; something like POST
> /openidm/endpoint/myCustomEndpoint?_action=myAction
> 
> On Tue, Jun 14, 2016 at 2:54 PM, Greg Gebhart <
> greg.gebhart@identityfusion.com> wrote:
> 
> > Hi,
> > 
> > I'm working on a custom endpoint in OpenIDM to return an array of objects
> > based upon a consumer's query request.  Essentially they request some
> data
> > from the custom endpoint, the endpoint calculates an array of objects,
> and
> > the endpoint returns the array.
> > 
> > The code looks something like this:
> > 
> > if (request instanceof QueryRequest) {
> > if (request.queryId == 'sampleData') {
> > result = [];
> > for (i = 0; i < 10; i++) {
> > def optionCount = calculateDailyOptions(i)  // Custom
> > function
> > def obj = ["day" : i, "count" : optionCount]
> > result.push(obj)
> > }
> > return result;
> > }
> > }
> > 
> > When the response is sent down to the consumer it gets wrapped in into
> > another object that resembles something like
> > {
> > "result:[[obj1, obj2, obj3, ...]],
> > "resultCount":10,
> > "pagedResultsCookie":null,
> > "totalPagedResultsPolicy":"NONE",
> > "totalPagedResults":-1,
> > "remainingPagedResults":-1
> > }
> > 
> > Is there anyway to configure the endpoint to NOT wrap the return value
> > with the resultCount and paging parameters?  From what I can tell these
> > parameters are added after execution leaves the groovy script defined for
> > the custom endpoint so I don't have direct control over them.
> > 
> > Thanks,
> > Greg
> > 
> > 
> > _______________________________________________
> > OpenIDM mailing list
> > OpenIDM@forgerock.org
> > https://lists.forgerock.org/mailman/listinfo/openidm
> > 
> > 
> 
> 
> --
> [image: ForgeRock] <http://www.forgerock.com/> *Jake Feasel*
> Senior Software Developer  |  ForgeRock
> *email* jake.feasel@forgerock.com <firstname.lastname@forgerock.com>
> *web* forgerock.o <http://www.forgerock.com/>rg
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.forgerock.org/pipermail/openidm/attachments/20160614/6a06f463/attachment-0001.html
> 
> > 
> 
> ------------------------------
> 
> _______________________________________________
> OpenIDM mailing list
> OpenIDM@forgerock.org
> https://lists.forgerock.org/mailman/listinfo/openidm
> 
> 
> End of OpenIDM Digest, Vol 73, Issue 6
> **************************************
> 



-- 

[image:
https://docs.google.com/uc?export=download&id=0B7HjJIBQ0tDFZ3prQmdwT0htYkE&revid=0B7HjJIBQ0tDFS00xblNwZjFRY254SG1aOTIzZTRUaGpGWWZjPQ]


*GREG GEBHART* / Identity Fusion, Inc.
<http://www.identityfusion.com/> / Identity
Management Consultant
*linkedin:* GGebhart <https://www.linkedin.com/in/greg-gebhart-b0b39137>


[Attachment #5 (text/html)]

<div dir="ltr">Thanks Jake!   I&#39;ll give it a try.</div><div \
class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 15, 2016 at 3:00 PM,  \
<span dir="ltr">&lt;<a href="mailto:openidm-request@forgerock.org" \
target="_blank">openidm-request@forgerock.org</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
                solid;padding-left:1ex">Send OpenIDM mailing list submissions to<br>
            <a href="mailto:openidm@forgerock.org">openidm@forgerock.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
            <a href="https://lists.forgerock.org/mailman/listinfo/openidm" \
rel="noreferrer" target="_blank">https://lists.forgerock.org/mailman/listinfo/openidm</a><br>
 or, via email, send a message with subject or body &#39;help&#39; to<br>
            <a href="mailto:openidm-request@forgerock.org">openidm-request@forgerock.org</a><br>
 <br>
You can reach the person managing the list at<br>
            <a href="mailto:openidm-owner@forgerock.org">openidm-owner@forgerock.org</a><br>
 <br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of OpenIDM digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
     1. OpenIDM Custom Endpoints Configuration Options (Greg Gebhart)<br>
     2. Re: OpenIDM Custom Endpoints Configuration Options (Jake Feasel)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 14 Jun 2016 17:54:41 -0400<br>
From: Greg Gebhart &lt;<a \
href="mailto:greg.gebhart@identityfusion.com">greg.gebhart@identityfusion.com</a>&gt;<br>
                
To: <a href="mailto:openidm@forgerock.org">openidm@forgerock.org</a><br>
Subject: [OpenIDM] OpenIDM Custom Endpoints Configuration Options<br>
Message-ID:<br>
            &lt;CAMJ+q9N=<a \
href="mailto:sp3sXoY2_DdgGpoD%2BwbUzS922bG9Wgv%2BBBsAeG1QUA@mail.gmail.com">sp3sXoY2_DdgGpoD+wbUzS922bG9Wgv+BBsAeG1QUA@mail.gmail.com</a>&gt;<br>
                
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
Hi,<br>
<br>
I&#39;m working on a custom endpoint in OpenIDM to return an array of objects<br>
based upon a consumer&#39;s query request.   Essentially they request some data<br>
from the custom endpoint, the endpoint calculates an array of objects, and<br>
the endpoint returns the array.<br>
<br>
The code looks something like this:<br>
<br>
if (request instanceof QueryRequest) {<br>
   if (request.queryId == &#39;sampleData&#39;) {<br>
   result = [];<br>
   for (i = 0; i &lt; 10; i++) {<br>
                        def optionCount = calculateDailyOptions(i)   // Custom<br>
function<br>
   def obj = [&quot;day&quot; : i, &quot;count&quot; : optionCount]<br>
   result.push(obj)<br>
   }<br>
   return result;<br>
   }<br>
}<br>
<br>
When the response is sent down to the consumer it gets wrapped in into<br>
another object that resembles something like<br>
{<br>
&quot;result:[[obj1, obj2, obj3, ...]],<br>
&quot;resultCount&quot;:10,<br>
&quot;pagedResultsCookie&quot;:null,<br>
&quot;totalPagedResultsPolicy&quot;:&quot;NONE&quot;,<br>
&quot;totalPagedResults&quot;:-1,<br>
&quot;remainingPagedResults&quot;:-1<br>
}<br>
<br>
Is there anyway to configure the endpoint to NOT wrap the return value with<br>
the resultCount and paging parameters?   From what I can tell these<br>
parameters are added after execution leaves the groovy script defined for<br>
the custom endpoint so I don&#39;t have direct control over them.<br>
<br>
Thanks,<br>
Greg<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.forgerock.org/pipermail/openidm/attachments/20160614/9b44e9f2/attachment-0001.html" \
rel="noreferrer" target="_blank">http://lists.forgerock.org/pipermail/openidm/attachments/20160614/9b44e9f2/attachment-0001.html</a>&gt;<br>
 <br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 14 Jun 2016 15:11:51 -0700<br>
From: Jake Feasel &lt;<a \
                href="mailto:jake.feasel@forgerock.com">jake.feasel@forgerock.com</a>&gt;<br>
                
To: &quot;<a href="mailto:openidm@forgerock.org">openidm@forgerock.org</a>&quot; \
                &lt;<a \
                href="mailto:openidm@forgerock.org">openidm@forgerock.org</a>&gt;<br>
Subject: Re: [OpenIDM] OpenIDM Custom Endpoints Configuration Options<br>
Message-ID:<br>
            &lt;CALXz=-<a \
href="mailto:W5fxvOWAMyk8bWCYpEYdL22uPf5gUKBN_vx4cXQHd9Og@mail.gmail.com">W5fxvOWAMyk8bWCYpEYdL22uPf5gUKBN_vx4cXQHd9Og@mail.gmail.com</a>&gt;<br>
                
Content-Type: text/plain; charset=&quot;utf-8&quot;<br>
<br>
The wrapping is based on the fact that your endpoint is getting interpreted<br>
as a query request. You can avoid the wrapping by instead requesting it as<br>
an action request; something like POST<br>
/openidm/endpoint/myCustomEndpoint?_action=myAction<br>
<br>
On Tue, Jun 14, 2016 at 2:54 PM, Greg Gebhart &lt;<br>
<a href="mailto:greg.gebhart@identityfusion.com">greg.gebhart@identityfusion.com</a>&gt; \
wrote:<br> <br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m working on a custom endpoint in OpenIDM to return an array of \
objects<br> &gt; based upon a consumer&#39;s query request.   Essentially they \
request some data<br> &gt; from the custom endpoint, the endpoint calculates an array \
of objects, and<br> &gt; the endpoint returns the array.<br>
&gt;<br>
&gt; The code looks something like this:<br>
&gt;<br>
&gt; if (request instanceof QueryRequest) {<br>
&gt;     if (request.queryId == &#39;sampleData&#39;) {<br>
&gt;     result = [];<br>
&gt;     for (i = 0; i &lt; 10; i++) {<br>
&gt;                          def optionCount = calculateDailyOptions(i)   // \
Custom<br> &gt; function<br>
&gt;     def obj = [&quot;day&quot; : i, &quot;count&quot; : optionCount]<br>
&gt;     result.push(obj)<br>
&gt;     }<br>
&gt;     return result;<br>
&gt;     }<br>
&gt; }<br>
&gt;<br>
&gt; When the response is sent down to the consumer it gets wrapped in into<br>
&gt; another object that resembles something like<br>
&gt; {<br>
&gt; &quot;result:[[obj1, obj2, obj3, ...]],<br>
&gt; &quot;resultCount&quot;:10,<br>
&gt; &quot;pagedResultsCookie&quot;:null,<br>
&gt; &quot;totalPagedResultsPolicy&quot;:&quot;NONE&quot;,<br>
&gt; &quot;totalPagedResults&quot;:-1,<br>
&gt; &quot;remainingPagedResults&quot;:-1<br>
&gt; }<br>
&gt;<br>
&gt; Is there anyway to configure the endpoint to NOT wrap the return value<br>
&gt; with the resultCount and paging parameters?   From what I can tell these<br>
&gt; parameters are added after execution leaves the groovy script defined for<br>
&gt; the custom endpoint so I don&#39;t have direct control over them.<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Greg<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; OpenIDM mailing list<br>
&gt; <a href="mailto:OpenIDM@forgerock.org">OpenIDM@forgerock.org</a><br>
&gt; <a href="https://lists.forgerock.org/mailman/listinfo/openidm" rel="noreferrer" \
target="_blank">https://lists.forgerock.org/mailman/listinfo/openidm</a><br> &gt;<br>
&gt;<br>
<br>
<br>
--<br>
[image: ForgeRock] &lt;<a href="http://www.forgerock.com/" rel="noreferrer" \
target="_blank">http://www.forgerock.com/</a>&gt; *Jake Feasel*<br> Senior Software \
                Developer   |   ForgeRock<br>
*email* <a href="mailto:jake.feasel@forgerock.com">jake.feasel@forgerock.com</a> \
&lt;<a href="mailto:firstname.lastname@forgerock.com">firstname.lastname@forgerock.com</a>&gt;<br>
                
*web* forgerock.o &lt;<a href="http://www.forgerock.com/" rel="noreferrer" \
                target="_blank">http://www.forgerock.com/</a>&gt;rg<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.forgerock.org/pipermail/openidm/attachments/20160614/6a06f463/attachment-0001.html" \
rel="noreferrer" target="_blank">http://lists.forgerock.org/pipermail/openidm/attachments/20160614/6a06f463/attachment-0001.html</a>&gt;<br>
 <br>
------------------------------<br>
<br>
_______________________________________________<br>
OpenIDM mailing list<br>
<a href="mailto:OpenIDM@forgerock.org">OpenIDM@forgerock.org</a><br>
<a href="https://lists.forgerock.org/mailman/listinfo/openidm" rel="noreferrer" \
target="_blank">https://lists.forgerock.org/mailman/listinfo/openidm</a><br> <br>
<br>
End of OpenIDM Digest, Vol 73, Issue 6<br>
**************************************<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div \
class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><table \
border="0" cellpadding="0" width="95%" \
style="font-size:12.8px;width:988px"><tbody><tr style="height:33.75pt"><td width="40" \
style="width:30pt;padding:0.75pt;height:33.75pt"><p \
style="margin-right:0in;margin-bottom:22.5pt;margin-left:0in"><span \
style="font-size:9.5pt;font-family:Arial,sans-serif"><img width="40" height="40" \
src="https://docs.google.com/uc?export=download&amp;id=0B7HjJIBQ0tDFZ3prQmdwT0htYkE&amp;revid=0B7HjJIBQ0tDFS00xblNwZjFRY254SG1aOTIzZTRUaGpGWWZjPQ" \
alt="https://docs.google.com/uc?export=download&amp;id=0B7HjJIBQ0tDFZ3prQmdwT0htYkE&am \
p;revid=0B7HjJIBQ0tDFS00xblNwZjFRY254SG1aOTIzZTRUaGpGWWZjPQ"></span><u></u><u></u></p></td><td \
style="padding:0.75pt;height:33.75pt"><p \
style="margin-right:0in;margin-bottom:22.5pt;margin-left:0in"><b><span \
style="font-size:8.5pt;font-family:&#39;Trebuchet \
MS&#39;,sans-serif;color:rgb(11,83,148);text-transform:uppercase;letter-spacing:1.5pt">GREG \
GEBHART</span></b><span style="font-size:8.5pt;font-family:&#39;Trebuchet \
MS&#39;,sans-serif;color:rgb(136,136,136)">  /  </span><a \
href="http://www.identityfusion.com/" title="Visit Identity Fusion" \
style="color:rgb(17,85,204)" target="_blank"><span \
style="font-size:8.5pt;font-family:&#39;Trebuchet \
MS&#39;,sans-serif;color:rgb(136,136,136)">Identity Fusion, Inc.</span></a><span \
style="font-size:8.5pt;font-family:&#39;Trebuchet \
MS&#39;,sans-serif;color:rgb(136,136,136)">  /  </span><span \
style="font-size:8.5pt;font-family:&#39;Trebuchet \
MS&#39;,sans-serif;color:rgb(178,178,178)">Identity Management Consultant</span><span \
style="font-size:9.5pt;font-family:Arial,sans-serif"><br></span><b><span \
style="font-size:8.5pt;font-family:&#39;Trebuchet \
MS&#39;,sans-serif;color:rgb(136,136,136)">linkedin:</span></b><span \
style="font-size:8.5pt;font-family:&#39;Trebuchet \
MS&#39;,sans-serif;color:rgb(178,178,178)">  <a \
href="https://www.linkedin.com/in/greg-gebhart-b0b39137" style="color:rgb(17,85,204)" \
target="_blank">GGebhart</a></span></p></td></tr></tbody></table></div></div> </div>



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


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

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