This document is a brief overview of the default skin in Jive Forums.

Overview

The Jive Forums 5 default skin uses a MVC (model-view-controller) architecture. The JSP pages included in the distribution are the view - they act as templates for forum content. Jive Forums uses the WebWork framework as the controller - all page requests are made to WebWork actions (mapped to the .jspa extension). The WebWork action will handle the logic of loading forum objects, posting messages, searching, etc and then display the appropriate view. The model is the Jive Forums API.

Additionally, Jive Forums 5 uses a technology called SiteMesh for page templating. This makes customizations and writing new templates for the skin very easy.

Structure

The default skin templates (the JSP pages) contain all the display logic for forum content. All JSP pages for the default skin are located in the jiveforums.war directory of the distribution or in the "skins" directory of the source release. These JSP pages are not designed to be called directly - rather you need to call the pages via their action mapping - the .jspa extensions. For example, typing http://yoursite.com/jive/forum.jspa into your web browser actually makes a request to the forum controller which in turn will call the viewforum.jsp page. The file containing these mappings is called xwork-community.xml and is located in the jiveforums.jar. If you want to see how the .jspa commands map to the .jsp pages, extract the xwork-community.xml file from the JAR file with the following command:

jar xvf jiveforums.jar xwork-community.xml

As a result of this you should see:

extracted: xwork-community.xml

Open xwork-community.xml in a text editor to see the view mappings. For example, to edit the file associated with the front page of the default skin, search the file for name="index" since you're looking for the mappings for the index.jspa alias. You should see a section like this:

<action name="index" class="com.jivesoftware.forum.action.ForumCategoryAction"> <result name="error">error-notfound.jsp</result> <result name="unauthorized">main.jsp</result> <result name="success">main.jsp</result> </action>

The index.jspa alias uses the main.jsp file as the template it will redirect to if there were no errors loading the specified (or default) category. If an error occurred while loading the category, error-notfound.jsp will be used.

Sometimes it's necessary to make changes to support different or new actions, or different view definitions. To do this, you don't need to edit the xwork-community.xml file but you can use a different file to override or add to the action defintions in xwork-community.xml. Simply put a file called xwork-community-custom.xml in your webapp's classpath (the WEB-INF/classes directory will do) and define your actions there. You can override the actions defined in xwork-community.xml or make new ones.

Color and Font Changes

Most of the changes you'll want to make involve changing the colors or fonts used in the default skin. This is easy to do via the Jive Forums admin tool. Simply log into the admin tool and click on the "Skin Settings" tab. From there click on "Fonts" or "Colors" on the left sidebar. From these screens you'll be able to change the global fonts and color schemes used by the default skin. You can also specify a chunk of HTML for the header and footer of the default skin. If you want to make more significant changes (ie, changing what happens to links when a mouse pointer is over them), look at modifying the CSS of the default skin. To do this, edit the style.jsp page, located in the same directory as the rest of the default skin JSP pages. This page can be replaced by your own CSS file. Simply edit templates/default/template.jsp and replace the line:

<link rel="stylesheet" type="text/css" href="style.jsp" />

with your own include, for example:

<link rel="stylesheet" type="text/css" href="my-style.css" />

FAQ (Frequently Asked Questions)

What is the advantange to using the WebWork framework?
The WebWork framework allows us to remove all controller and view logic from the JSP pages. In older versions of Jive Forums the JSP pages included a heavy amount of Java code. This made the pages harder to edit and update because of bug-fixes and harder to understand. Now, any Java code in the JSP pages is simply for view reasons - ie, displaying a list of topics in a forum or results on a search page. More often than not, the Java code necessary for that has been replaced by easy to understand JSP tags.
How do I specify my own CSS file?
Edit the templates/default/template.jsp file - in there you will see a <link rel... /> tag which links to the stylesheet. You can replace the default one with one of your own or add another <link rel... /> tag.
How do I edit a .jspa file? All I see are .jsp files.
There are no .jspa files to edit - the .jspa extensions are aliases to the controller logic of the default skin. For more information, please read the structure section.
Why isn't the style.jsp page a style.css file?
The CSS page is a JSP page because it needs to dynamically include different colors. These colors are included as Jive properties stored in the database.

Additional Help

If you need further help, please search for or post your questions on the Jive Software support forums at http://www.jivesoftware.com/jive/.