PhotArk Developer Guide
Prerequisites
- JDK 5.0+ (J2SE 1.5.0+)
- Apache Maven (2.0.10+)
- Subversion (1.6+) or Tortoise SVN (1.6x+)
Getting the source code
PhotArk subversion repository is located at http://svn.apache.org/repos/asf/incubator/photark/trunk/
The repository can also be viewed online at http://svn.apache.org/viewvc/incubator/photark/trunk/
Checking out code from subversion
Server
svn checkout http://svn.apache.org/repos/asf/incubator/photark/server/trunk/
Mobile
svn checkout http://svn.apache.org/repos/asf/incubator/photark/mobile/trunk/
Building the source code
mvn clean install
Importing PhotArk modules into Eclipse
If this is the first time you are using your workspace with maven m2 local repository, you will need to tell your Eclipse workspace the location of the directory, and you can do this with the following command :
mvn -Declipse.workspace=[path-to-eclipse-workspace] eclipse:add-maven-repo
To generate the necessary eclipse project files to import PhotArk modules into Eclipse, you can use the maven eclipse plugin:
mvn eclipse:eclipse
Deploying PhotArk in Web Application
After building the source code, deploy photoArk-webapp/target/photark.war in your favorite web application server (e.g Apache Tomcat)
Point your browser to :
http://localhost:8080/photark/
Automating PhotArk deployment to Apache Tomcat
If you are using Apache Tomcat, you can configure your maven settings.xml to point to your Tomcat installation and then use mvn tomcat:deploy to have PhotArk deployed to the application server
Edit your maven settings.xml (e.g ~/.m2/settings.xml)
<servers> <server> <id>tomcat</id> <username>username</username> <password>password</password> </server> </servers>
Deploying PhotArk
mvn tomcat:deploy
Re-deploying PhotArk
mvn tomcat:undeploy tomcat:deploy
Configuring Tomcat Security
Access to PhotArk admin area is currently configured under a "secured resource" and require users to be in the "photark-admin" role. With the basic tomcat deployment, edit %TOMCAT_HOME%/conf/tomcat-users.xml and configure a new/existent user with the proper role (see example below)
<?xml version='1.0' encoding='utf-8'?> <tomcat-users> <role rolename="photark-admin"/> <user username="photark-admin" password="password" roles="photark-admin"/> </tomcat-users>