4 Replies Latest reply on Jul 23, 2014 12:22 AM by ryanrutan

    How to display a custom error on jive app when node.js server is down / inaccessible?

    pawans

      Hi,

      How to display a custom error on jive app when node.js server is down / inaccessible?

        • Re: How to display a custom error on jive app when node.js server is down / inaccessible?

          There are a couple of ways to do this...

           

          You could:

          Include an "Not available" div in your view's html. When you determine the node.js server es no bueno, then hide the current dive and show the error div.

          or...

          Use minimessage (opensocial feature) to show an error.

          or...

          Use jive message to show an error. (I'll have to look up the API call for this, but it's in Jive Core.)

            • Re: How to display a custom error on jive app when node.js server is down / inaccessible?
              pawans

              Hey Mark,

              I am a bit confused with the first option you gave about including a div.

              As per what I understand, in jive-sdk the node.js server pushes the html,css,js files to jive website at run time when jive needs to load the app.

              Now if this node.js server itself is down, how will any file get pushed to jive website?

              Also to use the open social feature , I guess I need to load some javascript file to jive website.

              How wil I have this javascript file without node.js server working?

                • Re: Re: How to display a custom error on jive app when node.js server is down / inaccessible?
                  Robert Hanson

                  As per what I understand, in jive-sdk the node.js server pushes the html,css,js files to jive website at run time when jive needs to load the app.

                  Now if this node.js server itself is down, how will any file get pushed to jive website?

                   

                  You could embed some or all of the HTML/CSS/JS/etc. content in the app.xml, like this.

                  <Content view="embedded" type="html">
                  <![CDATA[
                    <p>This is my view content</p>
                    <script>
                      // do my checks here to see if the add-on server is running
                  
                    </script>
                  
                  ]]>
                  </Content>
                  
                  

                   

                  It is possible to embed all of your content this way, including images which would be encoded using base64.

                   

                  The app.xml file will be cached by Jive for some time, although I am not sure what happens when it tried to reload the app.xml from the server.  I hope that it would continue to use the cached version until it can access the server again.

                  1 person found this helpful