3,7 → 3,6 |
import java.util.List; |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletResponse; |
import javax.servlet.ServletException; |
import org.apache.struts.action.Action; |
import org.apache.struts.action.ActionMapping; |
import org.apache.struts.action.ActionForm; |
11,31 → 10,20 |
import org.apache.log4j.Logger; |
import ak.photoalbum.logic.Logic; |
|
public final class CacheAction |
public final class BuildCacheAction |
extends Action |
{ |
private static final Logger logger = Logger.getLogger(CacheAction.class); |
private static final Logger logger = Logger.getLogger(IndexAction.class); |
|
public ActionForward execute(ActionMapping mapping, ActionForm form, |
HttpServletRequest request, HttpServletResponse response) |
throws Exception |
{ |
CacheForm theForm = (CacheForm)form; |
String branch = theForm.getBranch(); |
String action = theForm.getAction(); |
|
// FIXME: show progress bar |
PathForm theForm = (PathForm)form; |
String branch = theForm.getBranch(); |
|
if("build".equals(action)) |
Logic.getLogic().buildCache(branch); |
else if("rebuild".equals(action)) |
Logic.getLogic().rebuildCache(branch); |
else if("reload".equals(action)) |
Logic.getLogic().reloadCache(branch); |
else if("delete".equals(action)) |
Logic.getLogic().deleteCache(branch); |
else |
throw new ServletException("unknown action"); |
// FIXME: show progress bar |
Logic.getLogic().buildCache(branch); |
|
return mapping.findForward("success"); |
} |