use settings from ${user.home}/forkalsrud.org/
This commit is contained in:
parent
a6d3fc333f
commit
639ab48cd1
6 changed files with 27 additions and 168 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -2,4 +2,8 @@
|
||||||
cache.properties
|
cache.properties
|
||||||
/build
|
/build
|
||||||
/db
|
/db
|
||||||
|
/.classpath
|
||||||
|
/.project
|
||||||
|
/.settings
|
||||||
|
/.springBeans
|
||||||
|
|
||||||
|
|
|
||||||
5
pom.xml
5
pom.xml
|
|
@ -43,16 +43,13 @@
|
||||||
<groupId>org.mortbay.jetty</groupId>
|
<groupId>org.mortbay.jetty</groupId>
|
||||||
<artifactId>maven-jetty-plugin</artifactId>
|
<artifactId>maven-jetty-plugin</artifactId>
|
||||||
<version>6.1.14</version>
|
<version>6.1.14</version>
|
||||||
<configuration>
|
|
||||||
<webAppSourceDirectory>${basedir}/webapp</webAppSourceDirectory>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-eclipse-plugin</artifactId>
|
<artifactId>maven-eclipse-plugin</artifactId>
|
||||||
<configuration>
|
<configuration>
|
||||||
<wtpversion>1.5</wtpversion>
|
<wtpversion>1.5</wtpversion>
|
||||||
<wtpContextName>album</wtpContextName>
|
<wtpContextName>photo</wtpContextName>
|
||||||
<wtpdefaultserver>J2EE Preview</wtpdefaultserver>
|
<wtpdefaultserver>J2EE Preview</wtpdefaultserver>
|
||||||
<additionalProjectnatures>
|
<additionalProjectnatures>
|
||||||
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
|
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
|
|
||||||
# point to our own maven repository
|
|
||||||
maven.repo.remote=http://www.forkalsrud.org/maven-proxy/repository
|
|
||||||
|
|
||||||
# warn about use of deprecated classes/methods
|
|
||||||
maven.compile.deprecation=true
|
|
||||||
|
|
||||||
# WAR plugin
|
|
||||||
#maven.war.final.name=ROOT.war
|
|
||||||
maven.war.src=webapp
|
|
||||||
|
|
||||||
# PMD plugin
|
|
||||||
maven.pmd.cpd.enable=true
|
|
||||||
|
|
||||||
#maven.jblanket.enable=true
|
|
||||||
134
project.xml
134
project.xml
|
|
@ -1,134 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project>
|
|
||||||
<pomVersion>1</pomVersion>
|
|
||||||
<artifactId>album</artifactId>
|
|
||||||
<name>album</name>
|
|
||||||
<groupId>forkalsrud</groupId>
|
|
||||||
<currentVersion>2</currentVersion>
|
|
||||||
<organization>
|
|
||||||
<name>forkalsrud.org</name>
|
|
||||||
<url>http://www.forkalsrud.org/</url>
|
|
||||||
</organization>
|
|
||||||
<inceptionYear>2008</inceptionYear>
|
|
||||||
<package>org.forkalsrud.album</package>
|
|
||||||
<shortDescription>Photo Album</shortDescription>
|
|
||||||
<siteAddress>http://www.forkalsrud.org/album/</siteAddress>
|
|
||||||
<repository>
|
|
||||||
<connection>scm:pserver:forkalsrud.org:/home/cvsroot</connection>
|
|
||||||
</repository>
|
|
||||||
<developers>
|
|
||||||
<developer>
|
|
||||||
<name>Knut Forkalsrud</name>
|
|
||||||
<id>1</id>
|
|
||||||
<email>knut@forkalsrud.org</email>
|
|
||||||
<url>http://www.forkalsrud.org/~knut/</url>
|
|
||||||
<timezone>PST</timezone>
|
|
||||||
</developer>
|
|
||||||
<developer>
|
|
||||||
<name>Erik Forkalsrud</name>
|
|
||||||
<id>2</id>
|
|
||||||
<email>erik@forkalsrud.org</email>
|
|
||||||
<url>http://www.forkalsrud.org/~erik/</url>
|
|
||||||
<timezone>PST</timezone>
|
|
||||||
</developer>
|
|
||||||
</developers>
|
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring</artifactId>
|
|
||||||
<version>2.0.6</version>
|
|
||||||
<type>jar</type>
|
|
||||||
<properties>
|
|
||||||
<war.bundle>true</war.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-logging</groupId>
|
|
||||||
<artifactId>commons-logging</artifactId>
|
|
||||||
<version>1.0.4</version>
|
|
||||||
<type>jar</type>
|
|
||||||
<properties>
|
|
||||||
<war.bundle>true</war.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-digester</groupId>
|
|
||||||
<artifactId>commons-digester</artifactId>
|
|
||||||
<version>1.7</version>
|
|
||||||
<type>jar</type>
|
|
||||||
<properties>
|
|
||||||
<war.bundle>true</war.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-collections</groupId>
|
|
||||||
<artifactId>commons-collections</artifactId>
|
|
||||||
<version>3.1</version>
|
|
||||||
<type>jar</type>
|
|
||||||
<properties>
|
|
||||||
<war.bundle>true</war.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-lang</groupId>
|
|
||||||
<artifactId>commons-lang</artifactId>
|
|
||||||
<version>2.0</version>
|
|
||||||
<type>jar</type>
|
|
||||||
<properties>
|
|
||||||
<war.bundle>true</war.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>velocity</groupId>
|
|
||||||
<artifactId>velocity</artifactId>
|
|
||||||
<version>1.5</version>
|
|
||||||
<type>jar</type>
|
|
||||||
<properties>
|
|
||||||
<war.bundle>true</war.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>velocity-tools</groupId>
|
|
||||||
<artifactId>velocity-tools-view</artifactId>
|
|
||||||
<version>1.2</version>
|
|
||||||
<type>jar</type>
|
|
||||||
<properties>
|
|
||||||
<war.bundle>true</war.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.drew</groupId>
|
|
||||||
<artifactId>metadata-extractor</artifactId>
|
|
||||||
<version>2.3.1</version>
|
|
||||||
<type>jar</type>
|
|
||||||
<properties>
|
|
||||||
<war.bundle>true</war.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.drew</groupId>
|
|
||||||
<artifactId>metadata-extractor-source</artifactId>
|
|
||||||
<type>source</type>
|
|
||||||
<jar>metadata-extractor-2.3.1-src.jar</jar>
|
|
||||||
<properties>
|
|
||||||
<war.bundle>false</war.bundle>
|
|
||||||
</properties>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>servletapi</groupId>
|
|
||||||
<artifactId>servletapi</artifactId>
|
|
||||||
<version>2.4</version>
|
|
||||||
<type>jar</type>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
<build>
|
|
||||||
<sourceDirectory>src</sourceDirectory>
|
|
||||||
</build>
|
|
||||||
<reports>
|
|
||||||
<report>maven-junit-report-plugin</report>
|
|
||||||
<report>maven-jcoverage-plugin</report>
|
|
||||||
<report>maven-pmd-plugin</report>
|
|
||||||
<report>maven-javadoc-plugin</report>
|
|
||||||
<report>maven-jdepend-plugin</report>
|
|
||||||
</reports>
|
|
||||||
</project>
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package org.forkalsrud.album.web;
|
package org.forkalsrud.album.web;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.FileReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
|
@ -83,17 +84,30 @@ public class AlbumServlet
|
||||||
public void init()
|
public void init()
|
||||||
throws ServletException
|
throws ServletException
|
||||||
{
|
{
|
||||||
|
Properties props = new Properties();
|
||||||
|
|
||||||
|
File forkalsrudOrg = new File(System.getProperty("user.home"), "forkalsrud.org");
|
||||||
|
if (! forkalsrudOrg.exists()) {
|
||||||
|
forkalsrudOrg.mkdirs();
|
||||||
|
}
|
||||||
|
File photoConf = new File(forkalsrudOrg, "photo.properties");
|
||||||
|
if (photoConf.exists()) {
|
||||||
|
try {
|
||||||
|
props.load(new FileReader(photoConf));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new ServletException("unable to load settings from " + photoConf.getPath(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
log4jInit("/log4j.properties");
|
log4jInit("/log4j.properties");
|
||||||
System.out.println("in init of Album");
|
System.out.println("in init of Album");
|
||||||
base = new File(getServletConfig().getInitParameter("base")).getAbsoluteFile();
|
base = new File(props.getProperty("base", "photos")).getAbsoluteFile();
|
||||||
basePrefix = "/" + base.getName();
|
basePrefix = "/" + base.getName();
|
||||||
|
|
||||||
String dbDirName = getServletConfig().getInitParameter("dbdir");
|
String dbDirName = props.getProperty("dbdir");
|
||||||
File dbDir = dbDirName != null ? new File(dbDirName) : new File(System.getProperty("java.io.tmpdir"), "album");
|
File dbDir = dbDirName != null ? new File(dbDirName) : new File(System.getProperty("java.io.tmpdir"), "album");
|
||||||
dbDir.mkdir();
|
dbDir.mkdirs();
|
||||||
db.init(dbDir);
|
db.init(dbDir);
|
||||||
// cacheManager = CacheManager.create();
|
|
||||||
// imageCache = cacheManager.getCache("imageCache");
|
|
||||||
pictureScaler = new PictureScaler();
|
pictureScaler = new PictureScaler();
|
||||||
lastCacheFlushTime = System.currentTimeMillis();
|
lastCacheFlushTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
xmlns="http://java.sun.com/xml/ns/javaee"
|
xmlns="http://java.sun.com/xml/ns/javaee"
|
||||||
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||||
id="WebApp_ID"
|
id="photo"
|
||||||
version="2.5">
|
version="2.5">
|
||||||
|
|
||||||
<display-name>album</display-name>
|
<display-name>photo</display-name>
|
||||||
<welcome-file-list>
|
<welcome-file-list>
|
||||||
<welcome-file>index.html</welcome-file>
|
<welcome-file>index.html</welcome-file>
|
||||||
</welcome-file-list>
|
</welcome-file-list>
|
||||||
|
|
@ -15,14 +15,7 @@
|
||||||
<servlet>
|
<servlet>
|
||||||
<servlet-name>album</servlet-name>
|
<servlet-name>album</servlet-name>
|
||||||
<servlet-class>org.forkalsrud.album.web.AlbumServlet</servlet-class>
|
<servlet-class>org.forkalsrud.album.web.AlbumServlet</servlet-class>
|
||||||
<init-param>
|
<load-on-startup>1</load-on-startup>
|
||||||
<param-name>base</param-name>
|
|
||||||
<param-value>photos</param-value>
|
|
||||||
</init-param>
|
|
||||||
<init-param>
|
|
||||||
<param-name>dbdir</param-name>
|
|
||||||
<param-value>db</param-value>
|
|
||||||
</init-param>
|
|
||||||
</servlet>
|
</servlet>
|
||||||
|
|
||||||
<servlet>
|
<servlet>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue