My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package action;

import java.util.Collection;
import java.util.LinkedList;

import net.sourceforge.stripes.action.DefaultHandler;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.UrlBinding;
import example.model.HubView;
import example.model.Post;
import example.model.Tag;

@UrlBinding("/blog/home")
public class HubAction extends BaseAction implements HubView {

private Collection<Post> posts;
private boolean singlePost = false;
private boolean editable = false;

@DefaultHandler
public Resolution show() {
String pathInfo = context.getRequest().getPathInfo();
if ( pathInfo.length() > 6) {
selected = Long.valueOf(pathInfo.substring(6));
Post post = load(Post.class, selected);
posts = new LinkedList<Post>();
posts.add(post);
singlePost = true;
if (myPost(post))
editable = true;
} else
posts = pm().getMostRecent(Post.class, 5);
return new ForwardResolution("/hub.jsp");
}

public Collection<Post> getPosts() {return posts;}
public Collection<Tag> getTags() {return pm().get(Tag.class);}

public boolean isSinglePost() {
return singlePost;
}

public boolean isEditable() {
return editable;
}

}

Change log

r356 by thewebsemantic on Jan 5, 2010   Diff
[No log message]
Go to: 
Project members, sign in to write a code review

Older revisions

r245 by thewebsemantic on Dec 22, 2009   Diff
[No log message]
r217 by thewebsemantic on Dec 21, 2009   Diff
[No log message]
r215 by thewebsemantic on Dec 21, 2009   Diff
[No log message]
All revisions of this file

File info

Size: 1299 bytes, 48 lines
Powered by Google Project Hosting