Skip to content
branaway edited this page Sep 14, 2010 · 2 revisions

2012/3/10: v0.33

  1. removed the dependency on Ant DirectoryScanner for change detection. Now the module archive is 1.5M less in size. Hopefully it’s faster too.

2012/3/10: v0.32

1. added RenderResultCache to fine control cache early reloading and cache read through. The new CacheableRunner makes it easy to do whole page cache in actions.

Sample: this code within an action will cache the result for 5 seconds under the name of “My Key”

			
CacheableRunner cacheableRunner = new CacheableRunner("5s", "My Key") {
	@Override
	protected RenderResult render() {
		// preparing data
		return new MyTemplate().render(data);;
	}
};

render(cacheableRunner);// the render(...) is defined in the JapidController 

In the above code the index class is a Japid generated template.

2. Added ignoreCache() and ignoreCacheNowAndNext()methods in JapidController. The above two methods set a flag for cache to ignore get requests from the current session so clients will need to read from DB.

3. add JapidController.dontRedirect() which can be used before calling another action in an action. This is like server-side forwarding.

2012/2/24: v0.31
1. added directive in script to add any http response headers. The usage example:

			
`setHeader Cache-Control	max-age=600

see headers.html for more examples. HTTP header settings can be inherited by children templates.

2012/2/22: v0.3

1. added cache support in JapidController, which has been moved to the Play-Jpiad-{version}.jar. The helper method in the JapidController is:

				
runWithCache(ActionController, String ttl, Object… keys)

To add cache control to a controller action, make sure your controller extends JapidController, and


public static void panel2(final String who) {
runWithCache(new ActionRunner(){
@Override
public RenderResult run() {
return new panel2().render(who);
}
}, “6s”, who);
}

In the above example, the result of the action invocation will be cached for 6 second under of the key of the who value( not the “who” literal).

2. added special tag called invoke as in #{invoke MyApplication.action(param)/} that can be used in templates to dynamically include render results from other action invocations. The invoke tag can take optional cache control parameter such as time-to-live and key. For example:

`args models.japidsample.Post post 
`import controllers.japid.SampleController

	<p>This is the composite content header</p>
	<div>#{invoke SampleController.authorPanel(post.getAuthor())/}</div>
	<div>this one has full cache control</div>
	<div>#{invoke SampleController.authorPanel(post.getAuthor()), "10s", post.getAuthor()/}</div>
	<div>this one has cache control using the default signature. </div>
	<div>#{invoke SampleController.authorPanel(post.getAuthor()), "10s"/}</div>

h3. 2012/2/14: v0.2

1. added support for back-quote as line oriented script block prefix, for example:

`extends mylayout.html
`args boolean mycondition
		
`if (mycondition) {
	<p>true</p>
`} else {
	<p>false</p>
`}

The ` sign indicates that the rest of the line is treated as Java code block. It does not need to be the first char of a line.

2. “play japid:mkdir” now creates optional packages for controllers.
3. added code in JapidPlugin to remove Orphaned Java source file in the japidviews directory.

2012/2/12: v0.12

1. added support for auto-loading in DEV mode, with the latest head version in 1.0 and 1.1 branches.
2. added play command “play japid:mkdir” to create the required package structure in the app/japidviews directory.
3. removed some cache optimization in RouterAdapter to make it compatible with Play’s code base.

2010/2/10: v0.1

the initial release