Clover Coverage Report - Pebble 2.5-SNAPSHOT
Coverage timestamp: Sat Jun 12 2010 09:39:29 EST
../../../../../img/srcFileCovDistChart0.png 48% of files have more coverage
4   45   2   2
0   21   0,5   2
2     1  
1    
This report was generated with an evaluation server license. Purchase Clover or configure your license.
 
  ResetThemeAction       Line # 20 4 0% 2 6 0% 0.0
 
No Tests
 
1    package net.sourceforge.pebble.web.action;
2   
3    import net.sourceforge.pebble.web.controller.RequireSecurityToken;
4    import net.sourceforge.pebble.web.view.View;
5    import net.sourceforge.pebble.web.view.ForwardView;
6    import net.sourceforge.pebble.domain.Blog;
7    import net.sourceforge.pebble.Constants;
8    import net.sourceforge.pebble.util.Utilities;
9   
10    import javax.servlet.http.HttpServletRequest;
11    import javax.servlet.http.HttpServletResponse;
12    import javax.servlet.ServletException;
13   
14    /**
15    * Resets the theme associated with a blog back to "default".
16    *
17    * @author Simon Brown
18    */
19    @RequireSecurityToken
 
20    public class ResetThemeAction 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  0 toggle public View process(HttpServletRequest request, HttpServletResponse response) throws ServletException {
30  0 Blog blog = (Blog)getModel().get(Constants.BLOG_KEY);
31  0 Utilities.resetTheme(blog);
32  0 return new ForwardView("/reloadBlog.secureaction");
33    }
34   
35    /**
36    * Gets a list of all roles that are allowed to access this action.
37    *
38    * @return an array of Strings representing role names
39    * @param request
40    */
 
41  0 toggle public String[] getRoles(HttpServletRequest request) {
42  0 return new String[]{Constants.BLOG_OWNER_ROLE, Constants.BLOG_ADMIN_ROLE};
43    }
44   
45    }