1 Reply Latest reply on Mar 17, 2015 10:07 AM by pawans

    When does a "link to service" popup appears for apps (wrt connects api)

    pawans

      Hi Jivers,

      I have multiple apps deployed through in jive-sdk node.js server.

      Some of these apps need service endpoints defined using jive connects protocol, some don't.

      Here's an example of how my app.xml looks with such combination of apps.

       

      <?xml version="1.0" encoding="UTF-8"?>
      <Module specificationVersion="1">
          <ModulePrefs title="Jive apps"
                       description=""
                       author=""
                       author_affiliation=""
                       author_email="">
      
      
              <Require feature="dynamic-height"/>
              <Require feature="embedded-experiences"/>
              <Require feature="jive-core-v2" />
              <Require feature="jive-core-v3"/>
              <Require feature="minimessage"/>
              <Require feature="setprefs"/>
              <Require feature="osapi"/>
              <Require feature="views"/>
              <Require feature="jive-connects-v1">
                  <Param name="alias:service1|title:Group Service">jive:service://service2</Param>
                  <Param name="alias:service2|title:User Service">jive:service://service2</Param>
              </Require>
              <Require feature="actions">
                  <Param name="action-contributions">
                      <![CDATA[
                     <action id="org.jive.app1"
                             path="jive/actions/places/group"
                             label="App1"
                             view="app1"
                       />
                      <action id="org.jive.app2"
                              path="jive/actions/places/group"
                              label="App2"
                              view="app2"
                      />
                      <action id="org.jive.app3"
                              path="jive/tabs/places/group"
                              label="App3"
                              view="app3"
                      />
                      <action id="org.jive.app4"
                              path="jive/tabs/places/group"
                              label="App4"
                              view="app4"
                      />
        ]]>
      
      
                  </Param>
              </Require>
          </ModulePrefs>
      
      
          <Content type="html" view="app1" href="app1.html" preferred_height="400" preferred_width="500"  />
          <Content type="html" view="app2" href="app2.html" preferred_height="400" preferred_width="500"  />
          <Content type="html" view="app3" href="app3.html" preferred_height="1000"/>
          <Content type="html" view="app4" href="app4.html" preferred_height="1000"/>
      
      
      </Module>
      

       

      Now in this case my app1 and app2 need a service configured using jive connects protocol in admin console under app-services section.

      My app3 and app4 don't require any such service.

       

      So now when user tries to access app1 or app2, the "link to service" popup is displayed for user consent to use the service for the app.

      Something like follows -

      Screen Shot 2015-02-24 at 3.47.17 PM.png

       

      But this same popup is never displayed for app3 and app4.

      In app1 and app2, the only reference to the connects service in my code (beyond app.xml) is when i call the service in the javascript code, an example for this is following code -

       

       osapi.jive.connects.post({
                          authz:"signed",
                          alias: "userService",
                          headers : { "Content-Type" : "application/json" },
                          format: 'json',
                          "body": {some data}
                      }).execute.....
      

       

       

      I am trying to understand when exactly the above popup occurs or basically how does jive detect that it has to show the available service for the apps, given that all above apps are deployed on same node server and are sharing the same app.xml.

      What makes jive decide it has to show services for app1 and app2 and not for app3 and app4?

       

      Ryan Rutan, Aron Racho, can you throw some light on this magic around jive connects and the way add-ons use it?

       

      The reason I want to understand this is I have multiple apps deployed on one node server as node has capability to handle this.

      I had asked a question on Jive Developers community yesterday about connects api which you can find here -->Any better way to define multiple connects services in app.xml?

       

      I am trying to understand connects api in depth to have the right implementation (as I personally think this concept with add-ons has made my apps more powerful).

      I am using it a lot,  may be over using it. So want to get some concepts right.