Rev 1257 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
936 | dev | 1 | package ak.photoalbum.webapp; |
2 | |||
3 | import javax.servlet.http.HttpServletRequest; |
||
4 | import javax.servlet.http.HttpServletResponse; |
||
1257 | dev | 5 | import javax.servlet.ServletException; |
936 | dev | 6 | import org.apache.struts.action.Action; |
7 | import org.apache.struts.action.ActionMapping; |
||
8 | import org.apache.struts.action.ActionForm; |
||
9 | import org.apache.struts.action.ActionForward; |
||
10 | import org.apache.log4j.Logger; |
||
1249 | dev | 11 | import ak.photoalbum.logic.Logic; |
936 | dev | 12 | |
1257 | dev | 13 | public final class CacheAction |
936 | dev | 14 | extends Action |
15 | { |
||
16 | public ActionForward execute(ActionMapping mapping, ActionForm form, |
||
17 | HttpServletRequest request, HttpServletResponse response) |
||
18 | throws Exception |
||
19 | { |
||
1257 | dev | 20 | CacheForm theForm = (CacheForm)form; |
21 | String branch = theForm.getBranch(); |
||
22 | String action = theForm.getAction(); |
||
23 | |||
24 | // FIXME: show progress bar |
||
1250 | dev | 25 | |
1257 | dev | 26 | if("build".equals(action)) |
27 | Logic.getLogic().buildCache(branch); |
||
28 | else if("rebuild".equals(action)) |
||
29 | Logic.getLogic().rebuildCache(branch); |
||
30 | else if("reload".equals(action)) |
||
31 | Logic.getLogic().reloadCache(branch); |
||
32 | else if("delete".equals(action)) |
||
33 | Logic.getLogic().deleteCache(branch); |
||
34 | else |
||
35 | throw new ServletException("unknown action"); |
||
936 | dev | 36 | |
37 | return mapping.findForward("success"); |
||
38 | } |
||
39 | } |