6 Replies Latest reply on Sep 2, 2011 3:25 PM by dolan.halbrook

    Modifying spaces tab bar

      I cannot find a clear example on how to add new tabs to the spaces tab bar at the top of a space (shows Overview, Content, People, Subspaces and Projects) for Jive 5.


      I see many examples for Jive 4.5 that do not work in Jive 5.


      I require assistance.

        • Re: Modifying spaces tab bar
          Ryan Rutan

          Ben,  In Jive 5, the ui-components framework has been reduced to a smaller set of capabilities.  The new framework for adding features such as this is via the Spring-UI beans.  It's actually just as easy, and yet much more powerful.


          Here's an example I'm working on that I'll adapt to your use-case.


          1.) Locate the spring definitions for the UI element you wish to modify,for example:  I believe you are looking for a Space Tab bar.  Open up the Source Code for jive and find the spring-ui-components.xml file.

          In this case, I believe this is the bean definition:  placeTabLinks


          Now that we have the bean definition, you need to create a new Action Link to be appended to the end of the list: 

          Here is a simple example:

          public class MyCustomLink extends AbstractActionLink {
              public boolean isVisible() {
                  return true;
              } // end isVisible
          } // end class


          an overlooked piece to this new functionality is the ability to inject in Managers to help make the "isVisible" implementation more robust.  Right now, this is just a simple always on; however, I could do a series of checks against the User, Container or what not to determine if the Tab should be displayed in this method.  Now that we are using Spring, we can inject in those necessary managers to make this decision.


          Now that you've got your ActionLink defined, you can do the final step and inject the ActionLink into the Spring List.  Like this:


          Sorry for the images, but pasting XML seems to have some issues right now, and this was the better alternative.   I hope this helps.

            • Re: Modifying spaces tab bar

              Thank you so much for this information. I have been spinning my wheels with this from a while now.


              These steps are rather different compared to the documentation found for Jive 5

              (http://docs.jivesoftware.com/jive_sbs/5.0/topic/com.jivesoftware.help.sbs.online_5.0/developer/BuildingActions.html). The steps in the documentation appears to be for 4.5. Do you have any documentation that goes into more detail on managing your UI through Spring (vs the ui-components and plugin xml of 4.5)?


              As well, I was wondering if Jive has a listing of all the various tags, and what they represent in the UI? A list of those would greatly increase our productivity.

                • Re: Modifying spaces tab bar
                  Ryan Rutan

                  Ben, you read my mind.  =) I honestly think that Jive needs to rev their documentation on this and/or it is very possible that I am doing something that I'm not supposed to...but I doubt it.  That is how Spring is being used elsewhere in plugins.  In general, if you open up that spring-ui-components.xml you should be able to see all of the bean IDs that are in the system. 


                  Oliver Young Josh Richau can we get an action item to update some of the documentation and/or confirm that the instructions are at least still valid?  Understand you guys are busy still...but just thought it would be worth noting. 

                    • Re: Modifying spaces tab bar

                      After implementing your code example, I am getting the following exception:


                      Cannot convert value of type [com.lixar.mars.jive.plugin.client.link.ActionItemActionLink] to required type [com.jivesoftware.community.places.PlaceTabLink] for property 'placeTabLinks[5]': no matching editors or conversion strategy found


                      I was wondering if you could provide more information about this issue and how to resolve it. I have attached the full exception and a zip of my source.

                        • Re: Modifying spaces tab bar
                          Ryan Rutan

                          doh...I forgot to mention that.  So AbstractActionLink is the base class, but the various locations have their own extensions.  In this case, the error is telling you to extend PlaceTabLink (which is more specific than Abstract).  If you change the extends AbstractActionLink to extends PlaceTabLink and correct any compilation bugs you should be good to go.  Note, if the Java Class is just a placeholder...(meaning there's no fancy display logic), you can do just a spring definition with no new classes...like Jive does...


                          This should get you going. =)

                        • Re: Modifying spaces tab bar

                          Hi Benjamin Liptak, Ryan Rutan,


                          Thanks for pointing out the documentation issue.  I'll be working with one of our documentation people to get that updated ASAP.


                          Unfortunately for the near future we'll have certain UI elements controlled by the legacy model (ui-components.xml) and other pieces with the new model (spring-ui-components.xml).  We were aiming to make the UI components more testable, easier to extend, and more consistent with the rest of the application extension model.  Thanks Ryan for the validation


                          Benjamin, Ryan is correct in that you'll need a concrete class of your own that extends PlaceTabLink, or you should be able to just use PlaceTabLink directly to create another link.  Let me know if you're still running into any issues and I'll do what I can to help.