1 package net.sourceforge.blogentis.modules.actions;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 import net.sourceforge.blogentis.turbine.BlogParameterParser;
26 import net.sourceforge.blogentis.turbine.SecureBlogAction;
27 import net.sourceforge.blogentis.utils.BlogConstants;
28 import net.sourceforge.blogentis.utils.MappedConfiguration;
29
30 import org.apache.turbine.util.RunData;
31 import org.apache.velocity.context.Context;
32
33 /***
34 * @author abas
35 */
36 public class BlogBoxPropMod
37 extends SecureBlogAction {
38
39 protected String[] getPermissions() {
40 return new String[] {BlogConstants.PERM_ADMIN_BLOG};
41 }
42
43 public void doPerform(RunData data, Context context)
44 throws Exception {
45
46 }
47
48 public void doComments(RunData data, Context context)
49 throws Exception {
50 BlogParameterParser pp = (BlogParameterParser)data.getParameters();
51 MappedConfiguration conf = pp.getBlog().getConfiguration();
52 conf.setProperty("RecentComments.feedSize", pp
53 .getIntObject("feedSize", new Integer(15)));
54 conf.save();
55 }
56
57 public void doPosts(RunData data, Context context)
58 throws Exception {
59 BlogParameterParser pp = (BlogParameterParser)data.getParameters();
60 MappedConfiguration conf = pp.getBlog().getConfiguration();
61 conf.setProperty("RecentPosts.feedSize", pp
62 .getIntObject("feedSize", new Integer(15)));
63 conf.setProperty("RecentPosts.feedOffset", pp
64 .getIntObject("feedOffset", new Integer(0)));
65 conf.save();
66 }
67 }