Subversion Repositories general

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
936 dev 1
package ak.photoalbum.webapp;
2
 
3
import javax.servlet.ServletException;
4
import javax.servlet.ServletConfig;
5
import javax.servlet.http.HttpServlet;
6
 
7
public class InitServlet
8
  extends HttpServlet
9
{
10
  public void init()
11
    throws ServletException
12
  {
13
    ServletConfig config = getServletConfig();
14
 
15
    String  imagesRoot;
16
    String  imagesMask;
17
    String  cacheDir;
18
    String  thumbnailFormat;
19
    Integer smallWidth   = null;
20
    Integer smallHeight  = null;
21
    Integer mediumWidth  = null;
22
    Integer mediumHeight = null;
23
    Integer columns      = null;
24
    String  dirTemplate;
25
    String  dirThumbnailPositions;
26
 
27
    imagesRoot      = config.getInitParameter("images root");
28
    imagesMask      = config.getInitParameter("images mask");
29
    cacheDir        = config.getInitParameter("cache dir");
30
    thumbnailFormat = config.getInitParameter("thumbnail format");
31
 
32
    if(config.getInitParameter("small width") != null)
33
      smallWidth = new Integer(config.getInitParameter("small width"));
34
    if(config.getInitParameter("small height") != null)
35
      smallHeight = new Integer(config.getInitParameter("small height"));
36
    if(config.getInitParameter("medium width") != null)
37
      mediumWidth = new Integer(config.getInitParameter("medium width"));
38
    if(config.getInitParameter("medium heught") != null)
39
      mediumHeight = new Integer(config.getInitParameter("medium heught"));
40
    if(config.getInitParameter("columns") != null)
41
      columns = new Integer(config.getInitParameter("columns"));
42
 
43
    dirTemplate           = config.getInitParameter("dir template");
44
    dirThumbnailPositions = config.getInitParameter("dir thumbnails positions");
45
 
46
    Logic.getLogic().init(imagesRoot, imagesMask, cacheDir, thumbnailFormat,
47
      smallWidth, smallHeight, mediumWidth, mediumHeight, columns,
48
      dirTemplate, dirThumbnailPositions);
49
  }
50
}