Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1248 → Rev 1249

/PhotoAlbum/trunk/src/ak/photoalbum/webapp/PageItem.java
File deleted
/PhotoAlbum/trunk/src/ak/photoalbum/webapp/ImageAction.java
7,6 → 7,7
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.log4j.Logger;
import ak.photoalbum.logic.Logic;
 
public final class ImageAction
extends BaseAction
18,6 → 19,7
throws Exception
{
PathForm theForm = (PathForm)form;
String branch = theForm.getBranch();
String path = theForm.getPath();
Logic logic = Logic.getLogic();
 
24,20 → 26,20
logger.info("get image " + mapping.getParameter() + " for " + path);
 
if("dir".equals(mapping.getParameter())) {
response.setContentType(logic.getThumbnailMime());
logic.writeDir(path, response.getOutputStream());
response.setContentType(logic.getThumbnailMime(branch));
logic.writeDir(branch, path, response.getOutputStream());
}
else if("small".equals(mapping.getParameter())) {
response.setContentType(logic.getThumbnailMime());
logic.writeSmall(path, response.getOutputStream());
response.setContentType(logic.getThumbnailMime(branch));
logic.writeSmall(branch, path, response.getOutputStream());
}
else if("medium".equals(mapping.getParameter())) {
response.setContentType(logic.getThumbnailMime());
logic.writeMedium(path, response.getOutputStream());
response.setContentType(logic.getThumbnailMime(branch));
logic.writeMedium(branch, path, response.getOutputStream());
}
else if("origin".equals(mapping.getParameter())) {
response.setContentType(logic.getOriginMime(path));
logic.writeOrigin(path, response.getOutputStream());
response.setContentType(logic.getOriginMime(branch, path));
logic.writeOrigin(branch, path, response.getOutputStream());
}
 
return null;
/PhotoAlbum/trunk/src/ak/photoalbum/webapp/PathForm.java
9,8 → 9,19
public class PathForm
extends ActionForm
{
protected String branch;
protected String path;
 
public String getBranch()
{
return branch;
}
 
public void setBranch(String branch)
{
this.branch = branch;
}
 
public String getPath()
{
return path;
/PhotoAlbum/trunk/src/ak/photoalbum/webapp/BuildCacheAction.java
8,6 → 8,7
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.log4j.Logger;
import ak.photoalbum.logic.Logic;
 
public final class BuildCacheAction
extends Action
/PhotoAlbum/trunk/src/ak/photoalbum/webapp/ServletResourceFactory.java
2,6 → 2,7
 
import java.io.InputStream;
import javax.servlet.ServletContext;
import ak.photoalbum.logic.ResourceFactory;
 
public class ServletResourceFactory
implements ResourceFactory
/PhotoAlbum/trunk/src/ak/photoalbum/webapp/IndexAction.java
9,6 → 9,8
import org.apache.struts.action.ActionForward;
import org.apache.log4j.Logger;
import ak.photoalbum.util.FileUtils;
import ak.photoalbum.logic.Logic;
import ak.photoalbum.logic.IndexEntry;
 
public final class IndexAction
extends BaseAction
20,6 → 22,7
throws Exception
{
IndexForm theForm = (IndexForm)form;
String branch = theForm.getBranch();
String dir = theForm.getPath();
int page = theForm.getPageInt();
IndexEntry entry = new IndexEntry();
33,8 → 36,8
if(dir == null) dir = ""; // the images root
 
logger.info("get index for " + dir);
Logic.getLogic().getEntry(dir, entry, top, prev, current, next);
if(!Logic.getLogic().listDirectory(dir, page, index, pages))
Logic.getLogic().getEntry(branch, dir, entry, top, prev, current, next);
if(!Logic.getLogic().listDirectory(branch, dir, page, index, pages))
return mapping.findForward("error");
 
request.setAttribute("dir", FileUtils.replaceFileSeparator(dir, " - "));
/PhotoAlbum/trunk/src/ak/photoalbum/webapp/BaseAction.java
10,6 → 10,7
import org.apache.struts.action.ActionForward;
import org.apache.log4j.Logger;
import ak.photoalbum.util.FileUtils;
import ak.photoalbum.logic.LogicSecurityException;
 
public abstract class BaseAction
extends Action
/PhotoAlbum/trunk/src/ak/photoalbum/webapp/InitServlet.java
6,6 → 6,7
import javax.servlet.ServletResponse;
import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import ak.photoalbum.logic.Logic;
 
public class InitServlet
extends GenericServlet
/PhotoAlbum/trunk/src/ak/photoalbum/webapp/PageAction.java
6,6 → 6,8
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.log4j.Logger;
import ak.photoalbum.logic.Logic;
import ak.photoalbum.logic.IndexEntry;
 
public final class PageAction
extends BaseAction
17,6 → 19,7
throws Exception
{
PathForm theForm = (PathForm)form;
String branch = theForm.getBranch();
String page = theForm.getPath();
IndexEntry entry = new IndexEntry();
IndexEntry index = new IndexEntry();
27,7 → 30,7
if(page == null) page = ""; // the images root
 
logger.info("get page " + page);
Logic.getLogic().getEntry(page, entry, index, prev, current, next);
Logic.getLogic().getEntry(branch, page, entry, index, prev, current, next);
 
request.setAttribute("page", page);
request.setAttribute("entry", entry);