11 Replies Latest reply on Oct 29, 2014 6:15 AM by ryanrutan

    Extended property in HTML Widget

    preethidevaraj

      Hi,

       

      How can we retrieve a space extended property in HTML widget?

       

      Ryan Rutan, please provide your inputs.

       

      Thanks,

      Preethi Devaraj

        • Re: Extended property in HTML Widget

          If you are talking about the Extended Properties set in the Admin Console > Spaces > Settings, then you will need to do some work to get them rendered to the page via a Theme (recommended approach), as they are not available in the V3 or V2 apis from what I can tell.  In the past, I created custom properties with a specific prefix like "meta." and whenever a page loaded for a Space overview, I would iterate over the Space object in Freemarker and render all the properties that began with "meta."  this made them available for any JS/HTML necessary on that page in Widgets.

           

          Based on your question, I'm pretty sure that Jive REST Rest API v3.6 → ExtProps entity and Jive REST Rest API v3.6 → PrivateProps entity are not relevant.

           

          Hope this helps.

          1 person found this helpful
            • Re: Extended property in HTML Widget
              preethidevaraj

              Thanks Ryan Ruark. I missed out to inform that, I am trying to retrieve the property value in cloud instance. In cloud,  i tried using Open social api to get the value in HTML widget, but no luck.

               

              Could you please suggest how to go on?

               

              -Preethi

                • Re: Extended property in HTML Widget

                  If you are using cloud, then chances are your use cases is not going to work as intended.  The above links to the REST Apis are the only options for extprops, but I do not think these are the values you are wanting to pull.

                    • Re: Extended property in HTML Widget
                      preethidevaraj

                      Using the ExtProps entity, I tried retrieving the properties for a specific space by calling - https://{domain_name}/api/core/v3/places/{placeID}/extprops, but it gives 404 not found error.

                        • Re: Extended property in HTML Widget

                          What are you using as a placeID?  Make sure that you are not using the containerID in the URLs, but rather the API ID.  To get this you can just try:

                          https://{domain_name}/api/core/v3/places

                          and you should get a list of all the places....see Jive REST Rest API v3.6 → Place service for more ways to filter this request.

                           

                          Once you have the API placeID, you can use it in your call above.

                           

                          All that being said, 404 doesn't quite sound right as the response code...can you run:

                          https://{domain_name}/api/version

                          to confirm which version of the API you have?

                           

                          Hope that helps.

                            • Re: Extended property in HTML Widget
                              preethidevaraj

                              I am using the API ID of the place Ryan.

                              On running https://{domain_name}/api/version, the response contains both v2 and v3.

                               

                              I get 404 not found when i tried calling the webservice in my 604 hosted instance. But when i tried in Cloud Environment, I get the below error,

                              "error":{"message":"This request is not allowed for invalid client id","status":401}}

                              Though i use admin credentials.


                              Also, please let me know if could use osapi in Third Party Analytics section(in Admin console)to access the properties?

                              If so, what libraries should i include.


                              Thanks,

                              Preethi Devaraj

                                • Re: Extended property in HTML Widget

                                  Makes sense. Extprops wasn't added until Jive 7, and hence the 404 on Jive 6.  ExtProps also can only be accessed via an Add-On with a registered clientId ... hence your error, you cannot use HTTP Basic to access this service.

                                   

                                  As for osapi in 3rd Party Analytics, the answer is no.  OSAPI is designed for use in-side the open-social container/service (similar to Java in a JVM) and doesn't work in traditional JS alone.

                                  1 person found this helpful
                                    • Re: Extended property in HTML Widget
                                      preethidevaraj

                                      Thanks Ryan Rutan, for the info.

                                      Now if this is the case, please suggest me how to proceed for the below situation in Cloud environment,

                                       

                                      We are upgrading from 6.X hosted to Cloud and we have a custom widget developed where we have parameters configured. This widget is used in multiple spaces and in each space, with different values for the parameters.

                                       

                                      So moving on, we thought to design this widget as a HTML widget only and configure these parameters as extended properties for a space and access it using REST API. As you mentioned, this is not going to work.

                                       

                                      If we opt for a Tile, then it can only be displayed in Activity page and not Overview page.

                                       

                                      Is there anyway, I can make the widget available in Overview page only?

                                      Upgrading to cloud is becoming a great challenge for developers!

                                       

                                      Thanks,

                                      Preethi Devaraj

                                        • Re: Extended property in HTML Widget

                                          Unfortunately, with the current version of cloud, I do not have an answer for how you would achieve this.  What you are describing is similar to my Managed Snippets Plugin, which we are in talks about bringing some of its features into the product, but those talks are very high-level at the moment. 

                                           

                                          Your current options to make this work would be to create an add-on/service that is capable of storing/retrieving the ExtProps data with its assigned OAuth token... and create a simplified REST interface for the HTML widget to invoke on a per container basis.

                                           

                                          While not as direct as invoking the APIs directly from the HTML widget, this is the only way I can see this working.