Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1256 → Rev 1257

/PhotoAlbum/trunk/src/ak/photoalbum/webapp/CacheAction.java
3,6 → 3,7
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;
10,20 → 11,31
import org.apache.log4j.Logger;
import ak.photoalbum.logic.Logic;
 
public final class BuildCacheAction
public final class CacheAction
extends Action
{
private static final Logger logger = Logger.getLogger(IndexAction.class);
private static final Logger logger = Logger.getLogger(CacheAction.class);
 
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception
{
PathForm theForm = (PathForm)form;
String branch = theForm.getBranch();
CacheForm theForm = (CacheForm)form;
String branch = theForm.getBranch();
String action = theForm.getAction();
// FIXME: show progress bar
 
// FIXME: show progress bar
Logic.getLogic().buildCache(branch);
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");
 
return mapping.findForward("success");
}