diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2012-12-29 14:14:08 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2012-12-29 14:14:08 +1300 |
commit | 65913d45863159b9652865bc4f23eb62120d9b62 (patch) | |
tree | ce9f48f3ee8716ee93ad359f3acc4c71be0741fd | |
parent | 9c2ed26b25a0454c2e90943386050d6c05e7ae5d (diff) | |
download | trackermap-web-65913d45863159b9652865bc4f23eb62120d9b62.tar.gz trackermap-web-65913d45863159b9652865bc4f23eb62120d9b62.tar.bz2 trackermap-web-65913d45863159b9652865bc4f23eb62120d9b62.zip |
Add debug and release database config
-rw-r--r-- | pom.xml | 41 | ||||
-rw-r--r-- | src/main/java/org/traccar/web/client/Traccar.java | 6 | ||||
-rw-r--r-- | src/main/java/org/traccar/web/client/view/ArchivePanel.java | 8 | ||||
-rw-r--r-- | src/main/resources/META-INF/persistence_debug.xml (renamed from src/main/resources/META-INF/persistence.xml) | 6 | ||||
-rw-r--r-- | src/main/resources/META-INF/persistence_release.xml | 12 | ||||
-rw-r--r-- | src/main/webapp/WEB-INF/jetty-web.xml | 10 | ||||
-rw-r--r-- | src/main/webapp/WEB-INF/web.xml | 2 |
7 files changed, 64 insertions, 21 deletions
@@ -144,6 +144,7 @@ <webappDirectory>${webappDirectory}</webappDirectory> </configuration> </plugin> + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> @@ -153,6 +154,46 @@ <target>1.6</target> </configuration> </plugin> + + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.7</version> + <executions> + <execution> + <id>debug</id> + <phase>process-resources</phase> + <configuration> + <target> + <delete + file="${webappDirectory}/WEB-INF/classes/META-INF/persistence.xml" /> + <copy + file="${webappDirectory}/WEB-INF/classes/META-INF/persistence_debug.xml" + tofile="${webappDirectory}/WEB-INF/classes/META-INF/persistence.xml" /> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + <execution> + <id>release</id> + <phase>prepare-package</phase> + <configuration> + <target> + <delete + file="${webappDirectory}/WEB-INF/classes/META-INF/persistence.xml" /> + <copy + file="${webappDirectory}/WEB-INF/classes/META-INF/persistence_release.xml" + tofile="${webappDirectory}/WEB-INF/classes/META-INF/persistence.xml" /> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> </build> diff --git a/src/main/java/org/traccar/web/client/Traccar.java b/src/main/java/org/traccar/web/client/Traccar.java index 68f633cf..2bb84f4a 100644 --- a/src/main/java/org/traccar/web/client/Traccar.java +++ b/src/main/java/org/traccar/web/client/Traccar.java @@ -27,8 +27,8 @@ public class Traccar implements EntryPoint, LoginController.LoginHandler { */ @Override public void onModuleLoad() { - //new LoginController().login(this); - onLogin(); // TODO: remove from production + new LoginController().login(this); + //onLogin(); // TODO: remove from production /*try { GlobalDatabaseService.getInstance().getPositions( @@ -71,7 +71,7 @@ public class Traccar implements EntryPoint, LoginController.LoginHandler { devicePanel.setWidth("20%"); devicePanel.setShowResizeBar(true); - devicePanel.updateDevices(testDevices()); // TODO: remove from production + //devicePanel.updateDevices(testDevices()); // TODO: remove from production mapPanel = new MapPanel(); mapPanel.setWidth("80%"); diff --git a/src/main/java/org/traccar/web/client/view/ArchivePanel.java b/src/main/java/org/traccar/web/client/view/ArchivePanel.java index b2ce329d..3929be2e 100644 --- a/src/main/java/org/traccar/web/client/view/ArchivePanel.java +++ b/src/main/java/org/traccar/web/client/view/ArchivePanel.java @@ -1,12 +1,12 @@ package org.traccar.web.client.view; -import com.smartgwt.client.widgets.toolbar.ToolStrip; +import com.smartgwt.client.widgets.form.fields.DateTimeItem; +import com.smartgwt.client.widgets.form.fields.SelectItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.SectionStack; import com.smartgwt.client.widgets.layout.SectionStackSection; -import com.smartgwt.client.widgets.form.fields.SelectItem; -import com.smartgwt.client.widgets.form.fields.DateTimeItem; +import com.smartgwt.client.widgets.toolbar.ToolStrip; import com.smartgwt.client.widgets.toolbar.ToolStripButton; /** @@ -18,7 +18,7 @@ public class ArchivePanel extends SectionStack { private ListGrid list; public ArchivePanel() { - SectionStackSection section = new SectionStackSection("Archive"); + SectionStackSection section = new SectionStackSection("Archive"); section.setCanCollapse(false); section.setExpanded(true); diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence_debug.xml index e4573c9a..a070dfac 100644 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence_debug.xml @@ -3,14 +3,14 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name="traccar"> - <provider>org.hibernate.ejb.HibernatePersistence</provider> + <!--<jta-data-source>java:/DefaultDS</jta-data-source>--> <properties> - <property name="hibernate.show_sql" value="true"/> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.connection.url" value="jdbc:mysql://localhost/test"/> <property name="hibernate.connection.username" value="root"/> <property name="hibernate.connection.password" value="root"/> - <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> + <property name="hibernate.show_sql" value="true"/> + <!--<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>--> <property name="hibernate.hbm2ddl.auto" value="validate"/> </properties> </persistence-unit> diff --git a/src/main/resources/META-INF/persistence_release.xml b/src/main/resources/META-INF/persistence_release.xml new file mode 100644 index 00000000..dc5ac2db --- /dev/null +++ b/src/main/resources/META-INF/persistence_release.xml @@ -0,0 +1,12 @@ +<persistence xmlns="http://java.sun.com/xml/ns/persistence" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" + version="2.0"> + <persistence-unit name="traccar"> + <jta-data-source>java:/DefaultDS</jta-data-source> + <properties> + <property name="hibernate.show_sql" value="true"/> + <property name="hibernate.hbm2ddl.auto" value="validate"/> + </properties> + </persistence-unit> +</persistence> diff --git a/src/main/webapp/WEB-INF/jetty-web.xml b/src/main/webapp/WEB-INF/jetty-web.xml deleted file mode 100644 index f959e1b3..00000000 --- a/src/main/webapp/WEB-INF/jetty-web.xml +++ /dev/null @@ -1,10 +0,0 @@ -<Configure class="org.mortbay.jetty.webapp.WebAppContext"> - <Get name="securityHandler"> - <Set name="userRealm"> - <New class="org.mortbay.jetty.security.HashUserRealm"> - <Set name="name">Test Realm</Set> - <Set name="config"><SystemProperty name="jetty.home" default="."/>/src/test/realm.properties</Set> - </New> - </Set> - </Get> -</Configure> diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index a7412ce9..5c46f87c 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -25,7 +25,7 @@ <login-config> <auth-method>BASIC</auth-method> </login-config>--> - + <servlet> <servlet-name>databaseService</servlet-name> <servlet-class>org.traccar.web.server.database.DatabaseServiceImpl</servlet-class> |