forked from cejug/hurraa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into openshift
* master: (48 commits) Show the version number of pom.xml issue cejug#119 Password Confirmation field added. issue cejug#127. cejug#130 Updating VRaptor to RC2 to close cejug#128 Removing listar.jsp that is no longer needed Refactor OpenOccurrenceController Occurrence Changelog Open Occurrence form Craeting the Ocurrence Correction of User CRUD cejug#116 - Implementation of Problem Type CRUD cejug#116 - Implementation of Problem Type CRUD Configuration of the MySql module cejug#75 Add datepicker cejug#111 Now when change the lenguage try to redirect back to the url that originated the request equipment validations equipment validations crud equipament validation issue cejug#38 default pt_br ... Conflicts: pom.xml src/main/webapp/WEB-INF/web.xml
- Loading branch information
Showing
67 changed files
with
4,081 additions
and
1,028 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,163 +1,156 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.cejug.hurraa</groupId> | ||
<artifactId>hurraa</artifactId> | ||
<version>0.1-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
<name>Hurraa</name> | ||
<description>OpenSource project for IT resource management</description> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>br.com.caelum</groupId> | ||
<artifactId>vraptor</artifactId> | ||
<version>4.0.0-beta-4</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.liquibase</groupId> | ||
<artifactId>liquibase-core</artifactId> | ||
<version>3.0.7</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>opensymphony</groupId> | ||
<artifactId>sitemesh</artifactId> | ||
<version>2.4.2</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>jstl</artifactId> | ||
<version>1.2</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax</groupId> | ||
<artifactId>javaee-web-api</artifactId> | ||
<version>7.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.hibernate</groupId> | ||
<artifactId>hibernate-validator</artifactId> | ||
<version>5.0.1.Final</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.8.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jboss.arquillian.junit</groupId> | ||
<artifactId>arquillian-junit-container</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.wildfly</groupId> | ||
<artifactId>wildfly-arquillian-container-managed</artifactId> | ||
<version>8.0.0.CR1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jboss.arquillian</groupId> | ||
<artifactId>arquillian-bom</artifactId> | ||
<version>1.1.2.Final</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<build> | ||
<finalName>hurraa</finalName> | ||
<outputDirectory>${basedir}/src/main/webapp/WEB-INF/classes</outputDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.1</version> | ||
<configuration> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-eclipse-plugin</artifactId> | ||
<version>2.8</version> | ||
<configuration> | ||
<downloadSources>true</downloadSources> | ||
<downloadJavadocs>true</downloadJavadocs> | ||
<wtpversion>2.0</wtpversion> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.4</version> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<version>2.8</version> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.12</version> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<JBOSS_HOME>${env.WILDFLY_HOME}</JBOSS_HOME> | ||
</systemPropertyVariables> | ||
<skip>false</skip> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<!-- When built in OpenShift the 'openshift' profile will be used when invoking mvn. --> | ||
<!-- Use this profile for any OpenShift specific customization your app will need. --> | ||
<!-- By default that is to put the resulting archive into the 'deployments' folder. --> | ||
<!-- http://maven.apache.org/guides/mini/guide-building-for-different-environments.html --> | ||
<id>openshift</id> | ||
<build> | ||
<finalName>wildfly8</finalName> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.1.1</version> | ||
<configuration> | ||
<outputDirectory>deployments</outputDirectory> | ||
<warName>ROOT</warName> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.cejug.hurraa</groupId> | ||
<artifactId>hurraa</artifactId> | ||
<version>0.1-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
<name>Hurraa</name> | ||
<description>OpenSource project for IT resource management</description> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
<groupId>br.com.caelum</groupId> | ||
<artifactId>vraptor</artifactId> | ||
<version>4.0.0-RC2</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.liquibase</groupId> | ||
<artifactId>liquibase-core</artifactId> | ||
<version>3.0.7</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>opensymphony</groupId> | ||
<artifactId>sitemesh</artifactId> | ||
<version>2.4.2</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>jstl</artifactId> | ||
<version>1.2</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax</groupId> | ||
<artifactId>javaee-web-api</artifactId> | ||
<version>7.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.hibernate</groupId> | ||
<artifactId>hibernate-validator</artifactId> | ||
<version>5.0.1.Final</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.8.1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.jboss.arquillian.junit</groupId> | ||
<artifactId>arquillian-junit-container</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.wildfly</groupId> | ||
<artifactId>wildfly-arquillian-container-managed</artifactId> | ||
<version>8.0.0.CR1</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.jboss.arquillian</groupId> | ||
<artifactId>arquillian-bom</artifactId> | ||
<version>1.1.2.Final</version> | ||
<scope>import</scope> | ||
<type>pom</type> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<build> | ||
<finalName>hurraa</finalName> | ||
<outputDirectory>${basedir}/src/main/webapp/WEB-INF/classes</outputDirectory> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.1</version> | ||
<configuration> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-eclipse-plugin</artifactId> | ||
<version>2.8</version> | ||
<configuration> | ||
<downloadSources>true</downloadSources> | ||
<downloadJavadocs>true</downloadJavadocs> | ||
<wtpversion>2.0</wtpversion> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-war-plugin</artifactId> | ||
<version>2.4</version> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-deploy-plugin</artifactId> | ||
<version>2.8</version> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<version>2.12</version> | ||
<configuration> | ||
<systemPropertyVariables> | ||
<JBOSS_HOME>${env.WILDFLY_HOME}</JBOSS_HOME> | ||
</systemPropertyVariables> | ||
<skip>false</skip> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-resources-plugin</artifactId> | ||
<version>2.3</version> | ||
<configuration> | ||
<encoding>ISO-8859-1</encoding> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
|
||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
</build> | ||
</project> |
38 changes: 38 additions & 0 deletions
38
src/main/java/org/cejug/hurraa/controller/ChangeLocaleController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package org.cejug.hurraa.controller; | ||
|
||
import java.util.Locale; | ||
|
||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpSession; | ||
import javax.servlet.jsp.jstl.core.Config; | ||
|
||
import br.com.caelum.vraptor.Controller; | ||
import br.com.caelum.vraptor.Path; | ||
import br.com.caelum.vraptor.Result; | ||
|
||
/** | ||
* | ||
* @author eprogramming | ||
* @author Efraim Gentil (efriam.gentil@gmail.com) | ||
*/ | ||
@Controller | ||
public class ChangeLocaleController { | ||
|
||
|
||
@Path("/change-location/{lenguageName}/{country}") | ||
public void changeLocale(String lenguageName , String country , Result result, HttpSession session , HttpServletRequest request ){ | ||
Locale locale = new Locale( lenguageName , country ); | ||
Config.set( session, Config.FMT_FALLBACK_LOCALE, locale); | ||
Config.set (session, Config.FMT_LOCALE, locale); | ||
redirectBack(result , request); | ||
} | ||
|
||
public void redirectBack( Result result, HttpServletRequest request ){ | ||
String urlToGoBack = request.getHeader("Referer"); //Get the url that originated the request | ||
if(urlToGoBack != null) | ||
result.redirectTo( urlToGoBack ); | ||
else | ||
result.redirectTo( IndexController.class ).index(); | ||
} | ||
|
||
} |
Oops, something went wrong.