Skip to content

Commit

Permalink
Merge branch 'master' into openshift
Browse files Browse the repository at this point in the history
* 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
tiagolo committed Apr 10, 2014
2 parents ab9b3bc + ca51c9c commit 6410e2c
Show file tree
Hide file tree
Showing 67 changed files with 4,081 additions and 1,028 deletions.
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Opensource project to resource management

#### General Configuration

Get module wildfly here: https://docs.google.com/file/d/0B25_MAAKa3jEVFRCRnp5Sm9zZE0/edit
and unpack in WILDFLY_HOME/modules/com
Get MySQL Module for WildFly [here](https://github.com/cejug/hurraa/wiki/hurraa-wildfly-driver-module/mysql.zip)
and unpack in "WILDFLY_HOME/modules/com", in the end you should have a structure like this "WILDFLY_HOME/modules/com/mysql/main" verify this structure before following the next steps

Like the following video shows: http://www.youtube.com/watch?v=l1daP7PZxNA#t=2729 After 45 minutes

Expand All @@ -27,11 +27,11 @@ Create a env variable WILDFLY_HOME for arquillian.xml config

1. LINUX - most of linux distributions: create a file wf.sh in /etc/profile.d with this content
```bash
export WILDFLY_HOME=/your_path_to/wildfly-8.0.0.CR1
export WILDFLY_HOME=/your_path_to/wildfly-8.0.0.Final
```
2. MAC - add this content into /etc/profile
```bash
WILDFLY_HOME=/your_path_to/wildfly-8.0.0.CR1
WILDFLY_HOME=/your_path_to/wildfly-8.0.0.Final/
```


Expand All @@ -56,8 +56,3 @@ WILDFLY_HOME=/your_path_to/wildfly-8.0.0.CR1
</driver>
</drivers>
```
#### Wildfly Restriction
Workaround to resolve the problem of the wildfly with the class MultableResponse. Edit the file standalone.xml and add as attribute of the tag servlet-container the property bellow:
```xml
allow-non-standard-wrappers="true"
```
484 changes: 484 additions & 0 deletions configWildfly8.sh

Large diffs are not rendered by default.

315 changes: 154 additions & 161 deletions pom.xml
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>
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();
}

}
Loading

0 comments on commit 6410e2c

Please sign in to comment.