Skip navigation

Configuring your action to use the freemarker result type

 

  • Freemarker views are rendered via the webwork result type freemarker, or by using the dispatcher result type in conjunction Webwork's FreemarkerServlet.

  • We use the freemarker result type which is defined in xwork-community.xml, so you can simply use it like so:

 

<action name="test" class="package.Test">
    <result name="success" type="freemarker">
        /templates/testView.ftl
    </result> 
</action>

 

  • Since freemarker is defined as the default result type, type="freemarker" is not necessary when declaring your action.

 

Property Resolution

 

  • Your action properties are automatically resolved. FOR EXAMPLE:

 

${name} will result in stack.findValue("name"), which generally results in action.getName() being executed.

 

  • A search process is used to resolve the variable, searching the following scopes in order, until a value is found:

1.) Freemarker Variables 
2.) Webwork Value Stack 
3.) Request Attributes 
4.) Session Attributes 
5.) Servlet Context Attributes

 

 

Objects in the Context

 

  • Webwork objects added to the context

    • request - the current HttpServletRequest

    • response - the current HttpServletResponse

    • stack - the current OgnlValueStack

    • ognl - the OgnlTool instance. This class contains useful methods to execute OGNL expressions against arbitary objects

    • webwork ? an instance of FreemarkerWebWorkUtil

    • action - the current WebWork action

    • exception - optional the Exception instance, if the view is a JSP exception or Servlet exception

 

  • Jive objects added to the context

    • JiveGlobals

    • JiveConstants

    • LocaleUtils

    • StringUtils

    • DateUtils

    • SkinUtils

    • Permissions

    • IMSettingsUtils

    • ActionUtils

    • RSSActionSupport

    • ViewCountManager

    • CommunityUtils

    • BlogUtils

    • FeedUtils

    • WikiUtils

    • LicenseManager

    • DocumentPermHelper

    • MessagePermHelper

 

${JiveGlobals.getJiveProperty(?skin.defaultHeader?)?default(?Community Home?)}

 

  • In addition, static models and enums can be referenced as so:

 

${statics('com.jivesoftware.community.action.CommunityAction').VIEW_OVERVIEW}
${enums('com.jivesoftware.community.SearchQueryCriteria$SortType').RELEVANCE.key?c}
where ) is replaced with ] and ( is replaced with [

 

I just wanted to remind everyone to attend our Jivespace group chat on Thursday at 9am Pacific time. Several of the Clearspace core developers and support engineers will be online to answer your questions about Clearspace!

 

If you missed the last chat, you can find the transcript in Jivespace.

Clearspace 1.10.1 was released today, and it includes a number of minor bug fixes and improvements. Be sure to look at the changelog if you are interested in what has changed.

 

Wondering what happened to 1.11?  We released a Clearspace 1.11 beta a few weeks ago, and then we decided to rename it to 1.10.1 to reflect that these are bug fixes and not releases with new features. So, 1.11 = 1.10.1.

 

We are going to continue putting out releases for the Clearspace 1.x series, but from this point forward they will only contain bug fixes and minor improvements. All new feature development has been moved to Clearspace 2.0, which will be available at the end of Q1 2008.

I asked Jay if he would mind being the featured Jivespace community member, and he was kind enough to indulge me with the answers to these questions in an email interview:

 

Can you tell us a little bit about yourself and what you do?

 

I work for a large computer company and lead the community development on one of their web sites.  I took an odd path getting here, I have a math, science and English background (liberal arts, go Ripon College Red Hawks!) but never took a computer class in my life.  That usually leads to jokes like "no wonder your code is...".   A Shakespeare background doesn't hurt when navigating the politics of a large company.  I try to use my own experience as an example for my kids that they can do anything they want if they put their minds to it.  You can imagine how that goes over, they are holding out for the sleeping late and playing video games all day job.  That's not too far from what we do so there's hope.

 

How did you get involved with Jive and Clearspace?

 

In the summer of 2000 I (with help from a couple friends who quickly bailed) wrote a sports trivia web site, lockerjock.com.  I needed to integrate forums into it and after some searching found Jive.  This was around the Jive forums 1 release when Jive was open source software.  I probably have the oldest continually running Jive forums installation ( 1.2.6 I think).  I should invest some more time into it but I'm waiting for the sports trivia market to really take off.  I got to know Matt, Bill, Dave, and Bruce and continued using all the Jive products both personally and professionally. I once knew the entire Jive team but you guys are growing so fast I can't keep up!  It's been very satisfying to watch Jive succeed.

 

What is your favorite Clearspace plugin?

 

The youtube plugin.

 

What is your favorite Clearspace feature?

 

The drag and drop widgets.  I should say the robust, flexible APIs, enterprise performance, or integrated community suite but I'm a sucker for eye-candy.

 

Mac or PC?

 

Sadly, PC but I'm seriously considering a Mac.  My daughter searched on pumpkin patterns around Halloween (do NOT do that) and picked up  a virus that I'm still trying to get rid of.  It sounds like I can do all my development work on a Mac now.

 

What do you do for fun?

 

As Bill Cosby said my wife and I used to be intellectuals but then we had kids.  Some days we think all we do is yell.  We have three kids, two boys and a girl and all of them are pretty serious soccer players which consumes a lot of our free time.  Both Kris and I play competitive tennis, Kris coaches girls track, and I run somewhat competitively.  I've done two stints on the Jive Hood to Coast team and am considering a third if Kris and I don't go to the tennis US Open.  When I do my own development it's in the evenings after the kids go to bed.

The same practices for performance testing other enterprise applications also apply when testing Clearspace. Here is a 10,000 ft overview:

 

(1) Build a test plan.

In it, determine the hardware/software characteristics of your test platform, which should be logically scaled down from the target production environment (if it isn't the target production environment). Similarly, plan the size of the community you are modeling, considering factors such as size of existing dataset (users, blogs, documents, messages, threads) and the number of concurrently active users you are going to simulate. Also crucial is to determine the usage model for your installation, which is typically the mixture of activities (read documents, publish documents, read messages, login, etc.) these users are going to perform, as well as the rate of activities, and the amount of delay between the activities. Finally, decide what the performance acceptability criteria are (for example, all activities must complete under 5 seconds or less). 

 

(2) Tune the test environment.

The target environment should be tuned to be as performant as possible. One way is to  subject the environment to a reliable amount of load, tweaking the various components so that bottlenecks are discovered and mitigated. This load should model the 'average' amount of traffic you expect from production (or some scaled down amount).

 

Some of the usual bottleneck suspects are the number and size of worker threads available to the webserver and application servers; database caches and connection parameters; database connection pool size; interference from outside network traffic; and others. 

 

Tuning the clearspace caches are of special importance in this step. Cache efficiency is the key here -- no caches should be marked inefficient during your tuning efforts. You must increase the default caches until no cache is marked inefficient; otherwise your database will be hammered, and overall performance will suffer.

 

(3) Subject the environment to increasing amounts of load.

Once your environment is tuned to average load, systematically subject it to larger and larger amounts of load, measuring the impacts on user experience and environment resources. Typically, the impact of increasing amounts of load would be measured against a single 'benchmark' user; the other 'load generating' users may or may not be measured.

 

A general rule of thumb is that if any physical server exceeds 80% utilization, or memory starts swapping, or if any of the performance acceptibility criteria (aka SLAs) fail, the system has reached saturation. By the end of the exercise, you should have a good idea of how much beyond the 'average' amount of load your environment can handle under the version of Clearspace you are running.

 

Some miscellaneous tips:

  • Try variations of your test, and compare against the baseline. Once you get a baseline for how your environment works under one usage model, see if performance changes under different use models (i.e. try making your tests more read heavy if they are write-heavy); vary the database, to see if the type of database makes a difference; vary the clustering -- see if adding more nodes under your levels of load improves performance.

  • Make sure that your load generating applications as much as possible do not artificially inflate reports of performance degradation -- some load testing tools may slow down in their ability to report accurately as loads increase. Take a distributed approach to load generation rather than a single monolithic load generator, especially for high loads.

  • You should typically have the tester and target environment on the same subnet.

 

Happy testing!

Having a tough issue with Clearspace? Curious about why we do things the way we do? Just want to learn more about customizing Clearspace?

 

On Thursday at 9am PST, we will be hosting our first Jivespace group chat.  A few of us (including some of the people who wrote Clearspace) will be hanging out in the group chat, so it would be great if a few of you would join us!

 

You can ask us anything

Do you have employees or customers who working in various locations around the world?

 

The Translations macro can help you easily translate documents into other languages only as the need arises. It will insert several flags into the document. When you click on one of the flags, a new window will open with the translated version of the current page.

 

Right now, it is using Google as the translation engine, and is fixed at having English as the original language. However, the source code is available if you want to tweak it to meet your specific needs (just don't forget to contribute back any enhancements)!

 

If you want to take a peek at the code to see how the translations macro was constructed, you can get the source from svn.

dolan.halbrook

Spring Is Coming

Posted by dolan.halbrook Employee Jan 17, 2008

Among the changes being made to Clearspace during 2008 is the adoption of the Spring framework in many parts of the application.  The first and most obvious feature of Spring of which we are taking advantage is the well-known and robust configuration and dependency injection service.  Much of what was formerly done using the JiveContext is now delegated to a Spring ApplicationContext, and this trend will continue.  This enables easier integration with existing libraries, more pluggability and testablility, and greater familiarity to the developer world.  What is more, with our upgrade to Struts2 (from WebWork2) all Struts objects are created using Spring as the object factory.  The immediate benefit to the developer is that any Spring-managed dependencies in a Struts object (actions, interceptors, etc) will automagically be set using Spring autowiring.

 

JDBC and Transactional support are other areas where we have attempted to make use of the facilities provided by the Spring framework.  Indeed anyone who has used the code provided by the framework for those two areas will be clear as to why we have chosen to do so.  Because of the improved ease of layering transactions declaratively, much more of the codebase will be transactional than before, leading to improved data integrity across the system.  We have also taken advantage of Spring LDAP support, DWR integration, CXF integration, and OSWorkflow integration.  Last but not least, we have worked to integrate the Acegi framework for authentication, and are working to use it for authorization as well.

 

The inclusion of the Spring framework into our project lays the groundwork for many benefits in upcoming versions of Clearspace.  We hope that you're as excited as we are to explore the possibilities and reap the benefits of its arrival.

Learn the basics of customizing your Clearspace theme in this introduction to skinning Clearspace with Matt Walker, professional services engineer (and juggler!) at Jive Software.

 

 

 

Or you can download the Quicktime version (Caution! ~100MB file)

 

You can also learn more about customizing Clearspace by visiting our documentation space!

I asked our developers here at Jive to respond to the following in 15 seconds or less: tell me your craziest idea for how to improve Clearspace.  Here is what they came up with, but make sure you hang around for the bloopers at the end!

 

 

 

Or download the Quicktime movie (~58MB)

New Widgets

Posted by ajohnson1200 Jan 10, 2008

In a future release of Clearspace we're talking about adding a personalized homepage feature, much like My.Yahoo.com or Google.com/ig, where users can add Clearspace widgets like 'Recent Content' or 'Top Members' to their homepage. A lot of the widgets that we debuted in the 'customize a community' feature (have you seen the video?) will be available for users on the homepage, but we'd like to hear from you: assuming you had a customizable homepage and you could use Clearspace like you use My.Yahoo.com or Google.com/ig, what widgets (Clearspace related or unrelated) would make your day?

If you are looking for an easy way to display slide shows in Clearspace, we have a SlideShare Macro plugin that lets anyone display a slide show presentation in documents, blog posts, and threads.

 

You can use this plugin to display SlideShare presentations, but it also provides a simple example code to illustrate how you can use a plugin to display media from other online sources in Clearspace as embedded content. You can learn more about the plugin or just download the code from svn.

 

A quick example:

 

 

As many of you have already noticed our Jive Integrated support instance on jivesoftware.com/jive has joined the developer community on our Jive Community ClearspaceX instance at http://www.jivesoftware.com/community.  Through user feedback, we re-integrated the supportand developercommunities within a single site to improve your experience.  You should now have much less trouble deciding where to post--depending on whether the question is a developer related question or a support related question all on the same instance.  For users of our old instance, all information from our old site was migrated to this new location.

 

With this move not only comes a better user interface and integrated user community but also provides Jive Support with the ability to create periodic blog posts.  Jive Support Engineers will be blogging on best practices we use ourselves when troubleshooting or improving our products' environments.  Please let us know if 

there is anything in particular you want to know more about!

 

Thanks,

 

Kevin Williams

Jive Support Manager

The Clearspace 1.11 Beta is available for download.

 

Clearspace 1.11 is primarily a bug fix release. You can browse through the change log attached below if you want to know exactly what we changed. It would be great to have a few people from the Jivespace community kick the tires for a while. You can post any bugs, issues, or other feedback in the Clearspace Beta Program space.

 

As always, the standard caveats apply. Please keep in mind that we offer these betas to give developers an opportunity to test pre-released Jive Software. Do NOT run production environments using beta products. These beta products are entirely unsupported. However, we would love to hear your feedback about the beta product to help us improve the final version of Clearspace.

Filter Blog

By date: By tag: