1

I am writing a plugin for Jive (SBS) 7 and want to add more data to the template for the user profile Overview page (i.e. /people/admin ). In Jive 6 I did overwrite the profile path in struts and added my own ViewProfile action. But this action seems to be called no more.

I also cannot even figure out where the templates I changed get their data from (soy/people/profile/{userProfile, header, head}.soy) or what action is responsible for.

So how can I add another property to the soy file that gets a custom property for the targetUser? (custom property = property saved in the database table jiveuserprop)

mmlac
  • 1,091
  • 1
  • 9
  • 24

2 Answers2

1

You need to create a plugin and then use the option. Then, you simply use jquery to add the extra stuff.

you can create an action that takes in information using getters or post and throw it into the user's extended properties. You can create another action that'll retrieve that info in json.

then, simply use jquery's getJson to grab the info and use selectors to show the data in the user profile.

Don't forget to use the $j(document).ready(function(){ // your code here }); to show the info

simple example:

<scipt>

    $j(document).ready(function(){
        $j("div#j-profile-header-details").append("<p>hello World</p>");
    });

</script> 

will append "hello world" under the user's email address / job title.

hope this helps. feel free to ask more questions if it doesn't make sense. here's a good link on writing the javascript part of the plugin: http://docs.jivesoftware.com/jive/7.0/community_admin/index.jsp?topic=/com.jivesoftware.help.sbs.online/developer/PluginXMLReference.html

Moe Singh
  • 809
  • 7
  • 12
  • actually, there could be other ways to do this, but this is by far the easiest. only downfall is that if they change the layout of the profile (like they did going from jive 6 to 7), then you have to change your jquery stuff... – Moe Singh Jul 11 '14 at 15:04
  • Of course Javascript is always an option and actually a Plugin Template Definition[1] is the best way to inject the Javascript. [1]: https://community.jivesoftware.com/community/developer/plugins/blog/2013/02/28/extending-jive-with-plugin-template-definitions – mmlac Jul 30 '14 at 04:52
1

I got an answer in the Jive Developer community:

profile is an action in Struts2.  /people/username is a URL Mapper permutation

https://community.jivesoftware.com/thread/263660

mmlac
  • 1,091
  • 1
  • 9
  • 24