I am using Clearspacex 1.4, Jboss 4.05, Windows Vista.
I am trying to write a plugin that adds a tab to the user profile page tabs. I have successfully added the tab ' ProfileTab2' as shown in the atachment, and now need to put some business login with the action which is being called.
I have attached my plugin.xml, xwork-plugin.xml and the action class. In the other tabs on the profile bar, that url is in the form of /clearspace/people/username?view=viewtype, which triggers a call to ViewProfile action class.
In my plugin, how do I pass the current user and any other parameters that I may need to my action class? Is this done in the plugin xml files or in the action class or some other mechanism that ties them together.
Thanks for your help,
the entry in your plugin.xml should look something like this:
<component id="user-profile">
<tab id="favorites" name="Favorites" cssClass="jive-link-favorite-small" url="favoriteProfile.jspa?username=${targetUser.username}">
<description>
<![CDATA[http://<#if viewingSelf>View your favorites<#else>View favorites for ${targetUser.username?html}</#if>]|http://<#if viewingSelf>View your favorites<#else>View favorites for ${targetUser.username?html}</#if>\]\]\>
</description>
</tab>
</component>
You can see the url refers to the target user which is part of the profile action which it will be called from. You can populate any other parameters you would like in this way.
Hope that helps,
Alex
Thanks Alex.
This was quite helpful.
I am making headway trying to follow the source code from 1.4.
In the return ftl file there is a reference to 'targetUser'. I am getting an exception:
2007-08-08 12:27:37,046 ERROR http://www.jivesoftware.com/jivespace/message/50326#50326/STDERR Aug 8, 2007 12:27:37 PM com.opensymphony.webwork.dispatcher.DispatcherUtils serviceAction
SEVERE: Could not execute action
Expression targetUser is undefined on line 8, column 44 in plugins/profiletab/resources/profiletab-template.ftl.
The problematic instruction:
==> ${targetUser.username} http://on line 8, column 42 in plugins/profiletab/resources/profiletab-template.ftl
Java backtrace for programmers:
freemarker.core.InvalidReferenceException: Expression targetUser is undefined on line 8, column 44 in plugins/profiletab/resources/profiletab-template.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
at freemarker.core.Dot._getAsTemplateModel(Dot.java:78)
at freemarker.core.Expression
In my action class there is a variable named 'targetUser' that is being populated with the 'billr' user. How do I get the targetUser to be visible to the ftl file?
Jive combines the most powerful features of collaboration software, community software,
social networking software & social media monitoring into the leading SBS solution.
© Copyright 2000–2010 Jive Software. All rights reserved.
915 SW Stark St., Suite 400, Portland, OR 97205
Sales: 877-495-3700 | General: 503-295-3700
Privacy Policy | Sitemap | Jobs | Contact Us