Updated project structure, and created ant build file
This commit is contained in:
parent
09cce4d80a
commit
d1fbc1c50b
20 changed files with 125 additions and 62 deletions
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
/build
|
||||||
|
/WebContent/WEB-INF/web.xml
|
||||||
|
/WebContent/WEB-INF/web_debug.xml
|
||||||
|
/WebContent/WEB-INF/web_server.xml
|
||||||
|
/WebContent/WEB-INF/lib/Zutil.jar
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="hide" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
|
|
||||||
<classpathentry kind="output" path=""/>
|
|
||||||
</classpath>
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.6
|
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.6
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
XDOCLETBUILDERACTIVE=false
|
|
||||||
XDOCLETHOME=
|
|
||||||
XDOCLETUSEGLOBAL=false
|
|
||||||
XDOCLETVERSION=1.2.1
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
|
||||||
<wb-module deploy-name="Zallery">
|
|
||||||
<wb-resource deploy-path="/" source-path="/WebContent"/>
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
|
|
||||||
<dependent-module archiveName="ZUtil.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ZUtil/ZUtil">
|
|
||||||
<dependency-type>uses</dependency-type>
|
|
||||||
</dependent-module>
|
|
||||||
<property name="context-root" value="Zallery"/>
|
|
||||||
<property name="java-output-path" value="/Zallery/build/classes"/>
|
|
||||||
</wb-module>
|
|
||||||
</project-modules>
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<faceted-project>
|
|
||||||
<runtime name="Apache Tomcat v7.0"/>
|
|
||||||
<fixed facet="jst.web"/>
|
|
||||||
<fixed facet="jst.java"/>
|
|
||||||
<installed facet="jst.java" version="6.0"/>
|
|
||||||
<installed facet="jst.web" version="2.5"/>
|
|
||||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
|
||||||
</faceted-project>
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Window
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
#Mon Aug 16 22:06:03 CEST 2010
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.wst.ws.service.policy.projectEnabled=false
|
|
||||||
BIN
WebContent/WEB-INF/lib/xuggle-xuggler-5.4.jar
Normal file
BIN
WebContent/WEB-INF/lib/xuggle-xuggler-5.4.jar
Normal file
Binary file not shown.
46
Zallery.iml
Normal file
46
Zallery.iml
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="EclipseModuleManager">
|
||||||
|
<libelement value="file:///Test/lib/commons-cli-1.2.jar" />
|
||||||
|
<libelement value="file:///Test/lib/slf4j-api-1.6.4.jar" />
|
||||||
|
<libelement value="file://$USER_HOME$/Documents/Programmering/Java/libs/xuggler/xuggle-xuggler-5.4.jar" />
|
||||||
|
<conelement value="org.eclipse.jst.j2ee.internal.web.container" />
|
||||||
|
<conelement value="org.eclipse.jst.j2ee.internal.module.container" />
|
||||||
|
<conelement value="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0" />
|
||||||
|
<src_description expected_position="0">
|
||||||
|
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
|
||||||
|
</src_description>
|
||||||
|
</component>
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="false">
|
||||||
|
<output url="file://$MODULE_DIR$/build/classes" />
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/WebContent" type="java-resource" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/build" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$MODULE_DIR$/WebContent/WEB-INF/lib" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
<jarDirectory url="file://$MODULE_DIR$/WebContent/WEB-INF/lib" recursive="false" />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module-library">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$MODULE_DIR$/lib" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
<jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
|
<orderEntry type="module" module-name="Zutil" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
65
build.xml
Normal file
65
build.xml
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project name="Zallery" >
|
||||||
|
|
||||||
|
<!-- ________________________ PROPERTIES AND SETTINGS ________________________ -->
|
||||||
|
|
||||||
|
<!--common properties-->
|
||||||
|
<property name="gitRoot" value="." />
|
||||||
|
<property name="srcDir" value="${gitRoot}/src" />
|
||||||
|
<property name="libDir" value="${gitRoot}/lib" />
|
||||||
|
<property name="libDir2" value="${gitRoot}/WebContent/WEB-INF/lib" />
|
||||||
|
<property name="buildRoot" value="${gitRoot}/build" />
|
||||||
|
<property name="buildDir" value="${buildRoot}/production" />
|
||||||
|
<property name="releaseDir" value="${buildRoot}/release" />
|
||||||
|
|
||||||
|
<!--define standard arguments for javac-->
|
||||||
|
<presetdef name="javac">
|
||||||
|
<javac includeantruntime="false" />
|
||||||
|
</presetdef>
|
||||||
|
|
||||||
|
<!-- ________________________ CLASSPATHS ________________________ -->
|
||||||
|
|
||||||
|
<!--classpath included when building-->
|
||||||
|
<path id="classpath.build">
|
||||||
|
<fileset dir="${libDir}">
|
||||||
|
<include name="**/*.jar"/>
|
||||||
|
</fileset>
|
||||||
|
<fileset dir="${libDir2}">
|
||||||
|
<include name="**/*.jar"/>
|
||||||
|
</fileset>
|
||||||
|
<pathelement location="${buildDir}" />
|
||||||
|
</path>
|
||||||
|
|
||||||
|
<!-- ________________________ EXECUTION TARGETS ________________________ -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ________________________ BUILD TARGETS ________________________ -->
|
||||||
|
|
||||||
|
<!--clean all build paths-->
|
||||||
|
<target name="clean">
|
||||||
|
<delete includeemptydirs="true" failonerror="false">
|
||||||
|
<fileset dir="${buildRoot}" includes="**/*"/>
|
||||||
|
</delete>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<!--build product code-->
|
||||||
|
<target name="release" depends="build">
|
||||||
|
<war destfile="${releaseDir}/Zallery.war" webxml="WebContent/WEB-INF/web.xml">
|
||||||
|
<fileset dir="WebContent"/>
|
||||||
|
<fileset dir="${srcDir}"/>
|
||||||
|
<lib dir="WebContent/WEB-INF/lib"/>
|
||||||
|
<classes dir="${buildDir}"/>
|
||||||
|
</war>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
<target name="build">
|
||||||
|
<mkdir dir="${buildDir}" />
|
||||||
|
<get src="http://ci.koc.se/jenkins/job/Zutil/lastSuccessfulBuild/artifact/build/release/Zutil.jar" dest="${libDir2}" verbose="true" usetimestamp="true"/>
|
||||||
|
<javac target="1.7" srcdir="${srcDir}" destdir="${buildDir}" debug="yes" debugLevel="lines,vars,source">
|
||||||
|
<classpath refid="classpath.build" />
|
||||||
|
<include name="**/*.java" />
|
||||||
|
</javac>
|
||||||
|
</target>
|
||||||
|
|
||||||
|
</project>
|
||||||
BIN
lib/servlet-api.jar
Normal file
BIN
lib/servlet-api.jar
Normal file
Binary file not shown.
|
|
@ -27,6 +27,7 @@ import zall.util.msg.UserMessage;
|
||||||
import zall.util.msg.UserMessage.MessageType;
|
import zall.util.msg.UserMessage.MessageType;
|
||||||
import zutil.db.DBConnection;
|
import zutil.db.DBConnection;
|
||||||
import zutil.db.bean.DBBean;
|
import zutil.db.bean.DBBean;
|
||||||
|
import zutil.db.bean.DBBeanSQLResultHandler;
|
||||||
import zutil.log.LogUtil;
|
import zutil.log.LogUtil;
|
||||||
|
|
||||||
public class Zallery extends HttpServlet{
|
public class Zallery extends HttpServlet{
|
||||||
|
|
@ -78,7 +79,7 @@ public class Zallery extends HttpServlet{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void destroy(){
|
public void destroy(){
|
||||||
DBBean.cancelGBC();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException{
|
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException{
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ public class Image extends Media{
|
||||||
case ORIGINAL:
|
case ORIGINAL:
|
||||||
return folder.getFile( filename, Size.ORIGINAL );
|
return folder.getFile( filename, Size.ORIGINAL );
|
||||||
default:
|
default:
|
||||||
File file = folder.getFile( FileUtil.changeExtension(filename, IMAGE_FORMAT), size );
|
File file = folder.getFile( FileUtil.replaceExtension(filename, IMAGE_FORMAT), size );
|
||||||
File orgFile = folder.getFile( filename, Size.ORIGINAL );
|
File orgFile = folder.getFile( filename, Size.ORIGINAL );
|
||||||
if( !file.exists() ){
|
if( !file.exists() ){
|
||||||
if(orgFile.exists() && orgFile.canRead() ){
|
if(orgFile.exists() && orgFile.canRead() ){
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import zutil.db.DBConnection;
|
||||||
import zutil.db.bean.DBBean;
|
import zutil.db.bean.DBBean;
|
||||||
import zutil.db.bean.DBBeanSQLResultHandler;
|
import zutil.db.bean.DBBeanSQLResultHandler;
|
||||||
import zutil.db.bean.DBBean.*;
|
import zutil.db.bean.DBBean.*;
|
||||||
import zutil.db.handler.SimpleSQLHandler;
|
import zutil.db.handler.SimpleSQLResult;
|
||||||
|
|
||||||
@DBTable("User")
|
@DBTable("User")
|
||||||
public class User extends DBBean{
|
public class User extends DBBean{
|
||||||
|
|
@ -141,7 +141,7 @@ public class User extends DBBean{
|
||||||
"SELECT email FROM User WHERE email=? LIMIT 1");
|
"SELECT email FROM User WHERE email=? LIMIT 1");
|
||||||
sql.setString(1, email);
|
sql.setString(1, email);
|
||||||
|
|
||||||
String tmp = DBConnection.exec(sql, new SimpleSQLHandler<String>());
|
String tmp = DBConnection.exec(sql, new SimpleSQLResult<String>());
|
||||||
return tmp != null;
|
return tmp != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,9 @@ public class Video extends Media{
|
||||||
public File getFile(Size size) throws IOException{
|
public File getFile(Size size) throws IOException{
|
||||||
if( filename != null ){
|
if( filename != null ){
|
||||||
if( size == Size.SMALL )
|
if( size == Size.SMALL )
|
||||||
return folder.getFile( FileUtil.changeExtension(filename, Image.IMAGE_FORMAT), size );
|
return folder.getFile( FileUtil.replaceExtension(filename, Image.IMAGE_FORMAT), size );
|
||||||
else if( size == Size.MEDIUM )
|
else if( size == Size.MEDIUM )
|
||||||
return folder.getFile( FileUtil.changeExtension(filename, VIDEO_FORMAT), size );
|
return folder.getFile( FileUtil.replaceExtension(filename, VIDEO_FORMAT), size );
|
||||||
else
|
else
|
||||||
return folder.getFile( filename, size );
|
return folder.getFile( filename, size );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ public class FBUser {
|
||||||
public void load(){
|
public void load(){
|
||||||
try {
|
try {
|
||||||
InputStream stream = fbc.getServiceURL( uid ).openStream();
|
InputStream stream = fbc.getServiceURL( uid ).openStream();
|
||||||
String data = IOUtil.getContent( stream );
|
String data = IOUtil.readContentAsString( stream );
|
||||||
DataNode node = JSONParser.read( data );
|
DataNode node = JSONParser.read( data );
|
||||||
|
|
||||||
logger.finer("User("+uid+") data from Facebook: "+data);
|
logger.finer("User("+uid+") data from Facebook: "+data);
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ public class FacebookConnect {
|
||||||
String[] attrib = value.split("\\.", 2);
|
String[] attrib = value.split("\\.", 2);
|
||||||
String signature = Base64Decoder.decodeToHex( attrib[0] );
|
String signature = Base64Decoder.decodeToHex( attrib[0] );
|
||||||
System.out.println( signature );
|
System.out.println( signature );
|
||||||
attrib[1] = Base64Decoder.addPadding( attrib[1] );
|
//attrib[1] = Base64Decoder.addPadding( attrib[1] );
|
||||||
String data = Base64Decoder.decode( attrib[1] );
|
String data = Base64Decoder.decode( attrib[1] );
|
||||||
DataNode map = JSONParser.read( data );
|
DataNode map = JSONParser.read( data );
|
||||||
System.out.println(map);
|
System.out.println(map);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue