7 Replies Latest reply on Feb 7, 2014 6:39 AM by dzmitry_h

    Custom queries to EAE engine

    dzmitry_h

      Hi jive-guys,

       

      It would be grateful if somebody can share the experience how to make custom queries/requests to eae engine.

      From javadocs in com.jivesoftware.community.eae.ActivityManager I see that possible to invoke methods with following params --> Set<FilterType> filterTypes, List<String> queryTerms

       

      Iterable<ActivityContainer> getActivitySinceButRequire(JiveObject jiveObject, StreamSource streamSource,

                                                                 Stream stream,

                                                                 Set<FilterType> filterTypes, List<String> queryTerms,

                                                                 long sinceTime, long requireTime);

       

       

      So the question is how to do it correctly. Any working examples would be appreciated.

       

      Thanks and love you all, Dzmitry)

        • Re: Custom queries to EAE engine

          Dzmitry - could you give us a little more information on what you're actually trying to achieve? Also have you considered using the Jive REST API v3.3 → Activity service as we'd certainly suggest that rather then try and call EAE classes directly.

            • Re: Custom queries to EAE engine
              dzmitry_h

              Hi Martin,

               

              cc: Martin Holmes

               

              For sure. I would like to get status updates only from people I'm following but in public stream (I know about connections stream but have such business requirements).

              Is it possible to achieve that using above shown filters?

              Unfortunately I'm trying to do it through jive back-end but if it only one solution please explain how to do it using REST api.

               

              Let me know if any additional details required.

               

              Thanks, DH.

                • Re: Custom queries to EAE engine

                  Hi Dzmitry. I'm currently waiting on a response internally and will let you know when I hear back. Thanks!

                  • Re: Custom queries to EAE engine

                    Hi Dzmitry,

                     

                    I was waiting for a response from Engineering to confirm, however after playing with this a little this afternoon myself I got this working by calling:

                     

                    http://<instance_url>/api/core/v3/activities?filter=type(update)

                     

                    According to Jive REST API v3.3 → Activity service this will return "...the specified activities from the stream of all activity visible to the requesting person....", so please give this a try out and let me know how it looks.

                     

                    Regards,

                    Martin

                      • Re: Re: Custom queries to EAE engine
                        dzmitry_h

                        Hi Martin Holmes,

                         

                        Thanks for drilling this out. I also was trying to play with this rest api and moreover was trying to debug this calls.

                         

                        So from my investigations I figured out that methods which invoked with parameter "filter" doesn't exists inside ActivityService.java.

                        So even if I calling -->

                              

                                 curl  -u  admin:admin  "http://localhost:8080/api/core/v3/activities?filter=(update)&count=2"   or   curl  -u  admin:admin  "http://localhost:8080/api/core/v3/activities?filter=update&count=2"


                        I get all activities from EAE as result for my admin user.


                        From debug perspective I see that invocation occurred on that method (without filter parameter) -->


                        @GET

                            @Path("/")

                            @StaticJavaScriptMethod(name = "osapi.jive.corev3.{plural}.get")

                            @Trace

                            public Entities<ActivityEntity> getActivity(@QueryParam("after") String after,

                                                                        @QueryParam("before") String before,

                                                                        @QueryParam("count") @DefaultValue("25") int count,

                                                                        @QueryParam("fields") @DefaultValue(ActivityEntity.ALL_FIELDS) String fields)

                         

                         

                        So I can say that I have no any filtration. Also I saw that comment inside ActivityService: // TODO - future enhancement to support StreamConstants.FilterType filters, plus query terms, on all activity getters


                        Seems that such filtration wasn't implemented in 6.0.3.4.

                        Correct me if I have a mistake regarding any my statements.

                         

                        Thanks, Dzmitry.