File Source: reindexblogaction.java
/*
P/P * Method: net.sourceforge.pebble.web.action.ReindexBlogAction__static_init
*/
1 package net.sourceforge.pebble.web.action;
2
3 import net.sourceforge.pebble.Constants;
4 import net.sourceforge.pebble.domain.Blog;
5 import net.sourceforge.pebble.util.Utilities;
6 import net.sourceforge.pebble.web.security.RequireSecurityToken;
7 import net.sourceforge.pebble.web.view.ForwardView;
8 import net.sourceforge.pebble.web.view.View;
9
/*
P/P * Method: void net.sourceforge.pebble.web.action.ReindexBlogAction()
*/
10 import javax.servlet.ServletException;
11 import javax.servlet.http.HttpServletRequest;
12 import javax.servlet.http.HttpServletResponse;
13
14 /**
15 * Rebuilds the indexes associated with a blog.
16 *
17 * @author Simon Brown
18 */
19 @RequireSecurityToken
20 public class ReindexBlogAction extends SecureAction {
21
22 /**
23 * Peforms the processing associated with this action.
24 *
25 * @param request the HttpServletRequest instance
26 * @param response the HttpServletResponse instance
27 * @return the name of the next view
28 */
29 public View process(HttpServletRequest request, HttpServletResponse response) throws ServletException {
/*
P/P * Method: View process(HttpServletRequest, HttpServletResponse)
*
* Preconditions:
* this.model != null
* this.model.data != null
*
* Presumptions:
* java.util.HashMap:get(...)@63 != null
*
* Postconditions:
* return_value == &new ForwardView(process#1)
* new ForwardView(process#1) num objects == 1
* return_value.uri == &".reloadBlog.secureaction"
*/
30 Blog blog = (Blog)getModel().get(Constants.BLOG_KEY);
31 Utilities.buildIndexes(blog);
32
33 return new ForwardView("/reloadBlog.secureaction");
34 }
35
36 /**
37 * Gets a list of all roles that are allowed to access this action.
38 *
39 * @return an array of Strings representing role names
40 * @param request
41 */
42 public String[] getRoles(HttpServletRequest request) {
/*
P/P * Method: String[] getRoles(HttpServletRequest)
*
* Presumptions:
* init'ed(net.sourceforge.pebble.Constants.BLOG_ADMIN_ROLE)
* init'ed(net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE)
*
* Postconditions:
* return_value == &new String[](getRoles#1)
* new String[](getRoles#1) num objects == 1
* return_value.length == 2
* return_value[0] == net.sourceforge.pebble.Constants.BLOG_ADMIN_ROLE
* (soft) init'ed(return_value[0])
* return_value[1] == net.sourceforge.pebble.Constants.BLOG_OWNER_ROLE
* (soft) init'ed(return_value[1])
*/
43 return new String[]{Constants.BLOG_ADMIN_ROLE, Constants.BLOG_OWNER_ROLE};
44 }
45
46 }
SofCheck Inspector Build Version : 2.22510
| reindexblogaction.java |
2010-Jun-25 19:40:34 |
| reindexblogaction.class |
2010-Jul-19 20:23:38 |