Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Merge branch 'pom-cleanup' into wrappedconnections
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Jul 5, 2013
2 parents 0d2eae2 + c9d12eb commit 7a0589c
Show file tree
Hide file tree
Showing 54 changed files with 1,070 additions and 657 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,8 @@
# Zanata change log summary

## zanata-3.1.0
* Add descriptions on project type selectors

## zanata-3.0.0
* Allow adapter parameters to be set on source document upload
* Add attention key shortcut: Alt+X
Expand Down
12 changes: 1 addition & 11 deletions functional-test/pom.xml
Expand Up @@ -35,7 +35,6 @@

<ds.jndi.name>zanataDatasource</ds.jndi.name>
<!--<ds.hibernate.dialect>org.hibernate.dialect.H2Dialect</ds.hibernate.dialect>-->
<!-- use profile -Pusemysql to switch to mysql database -->
<ds.driver.class>org.h2.Driver</ds.driver.class>
<ds.connection.url>jdbc:h2:file:${project.build.directory}/h2/zanata;AUTO_SERVER=TRUE</ds.connection.url>
<ds.username>sa</ds.username>
Expand Down Expand Up @@ -240,22 +239,13 @@
</configfile>
<!-- see above zipUrlInstaller/extractDir-->
<!-- cargo will force todir and tofile to be relative to container home directory -->
<configfile>
<file>${project.basedir}/src/test/resources/as7module/zanata/module.xml</file>
<todir>${cargo.install.relative.to.container.home}/modules/org/zanata/settings/main</todir>
</configfile>
<configfile>
<file>${project.basedir}/src/test/resources/conf/zanata.properties</file>
<todir>${cargo.install.relative.to.container.home}/modules/org/zanata/settings/main</todir>
</configfile>

<!-- enable javamelody -->
<configfile>
<file>${project.basedir}/src/test/resources/as7module/sun/module.xml</file>
<todir>${cargo.install.relative.to.container.home}/modules/system/layers/base/sun/jdk/main</todir>
</configfile>

<!-- security -->
<!-- security and jndi for properties -->
<configfile>
<file>${project.basedir}/src/test/resources/conf/standalone.xml</file>
<todir>configuration</todir>
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions functional-test/src/test/resources/conf/standalone.xml
Expand Up @@ -219,6 +219,7 @@
<bindings>
<simple name="java:global/zanata/security/auth-policy-names/internal" value="zanata.internal"/>
<simple name="java:global/zanata/security/admin-users" value="admin"/>
<simple name="java:global/zanata/email/default-from-address" value="no-reply@zanata.org" />
</bindings>
<remote-naming/>
</subsystem>
Expand Down
34 changes: 0 additions & 34 deletions functional-test/src/test/resources/conf/zanata.properties

This file was deleted.

44 changes: 0 additions & 44 deletions zanata-model/pom.xml
Expand Up @@ -251,48 +251,4 @@

</dependencies>

<profiles>
<profile>
<id>mysql</id>
<properties>
<env.dbunit.type>MYSQL</env.dbunit.type>
<ds.jndi.name>zanataDatasource</ds.jndi.name>
<ds.hibernate.dialect>org.zanata.ZanataMySQL5InnoDBDialect</ds.hibernate.dialect>
<ds.driver.class>com.mysql.jdbc.Driver</ds.driver.class>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
</component>
</components>
<componentProperties>
<persistenceunit>zanataDatabase</persistenceunit>
<outputfilename>schema.ddl</outputfilename>
<drop>false</drop>
<create>true</create>
<export>false</export>
<format>true</format>
</componentProperties>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
103 changes: 4 additions & 99 deletions zanata-war/pom.xml
Expand Up @@ -489,53 +489,6 @@
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>hibernate3-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<components>
<component>
<name>hbm2ddl</name>
<implementation>jpaconfiguration</implementation>
</component>
</components>
<componentProperties>
<export>false</export>
<update>false</update>
<drop>false</drop>
<create>false</create>
<outputfilename>schema.ddl</outputfilename>
<persistenceunit>zanataTestDatasourcePU</persistenceunit>
</componentProperties>
</configuration>
<!--
<executions>
<execution>
<phase>process-test-classes</phase>
<goals>
<goal>hbm2ddl</goal>
</goals>
</execution>
</executions>
-->
<dependencies>
<!--
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
-->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.3.170</version>
</dependency>
</dependencies>
</plugin>


<!--
This is to make the GWT plugin happy (http://code.google.com/p/google-web-toolkit/issues/detail?id=4600).
Taken from https://issues.sonatype.org/browse/MNGECLIPSE-864?focusedCommentId=148457&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-148457
Expand Down Expand Up @@ -730,7 +683,9 @@
</goals>
</pluginExecutionFilter>
<action>
<execute />
<execute>
<runOnIncremental>false</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
Expand Down Expand Up @@ -903,7 +858,7 @@

<profile>
<!-- This profile tells GWT to use an alternative GWT module which has
only one permutation, and to compile in draft mode -->
only two permutations, and to compile in draft mode -->
<id>chromefirefox</id>
<properties>
<zanata.gwt.module>org.zanata.webtrans.ApplicationChromeFirefox</zanata.gwt.module>
Expand All @@ -922,56 +877,6 @@
</build>
</profile>

<profile>
<id>eclipse</id>
<build>
<finalName>zanata-dev</finalName>
<resources>
<resource>
<directory>src/main/resources-dev</directory>
<filtering>false</filtering>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<wtpversion>2.0</wtpversion>

<additionalBuildcommands>
<buildCommand>
<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
</buildCommand>
<buildCommand>
<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
</buildCommand>
</additionalBuildcommands>

<additionalProjectnatures>
<projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>
<projectnature>com.google.gdt.eclipse.core.webAppNature</projectnature>
</additionalProjectnatures>

<classpathContainers>
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
<classpathContainer>com.google.gwt.eclipse.core.GWT_CONTAINER</classpathContainer>
</classpathContainers>
<excludes>
<!-- These are provided by the GWT container -->
<exclude>com.google.gwt:gwt-servlet</exclude>
<exclude>com.google.gwt:gwt-user</exclude>
</excludes>
</configuration>
</plugin>

</plugins>

</build>
</profile>

<profile>
<id>it-coverage</id>
<!-- In order to combine unit test and integration test coverage together, it requires below two commands:
Expand Down
Expand Up @@ -85,6 +85,7 @@
import org.zanata.rest.dto.stats.TranslationStatistics.StatUnit;
import org.zanata.rest.service.FileService;
import org.zanata.rest.service.StatisticsResource;
import org.zanata.rest.service.VirusScanner;
import org.zanata.security.SecurityFunctions;
import org.zanata.security.ZanataIdentity;
import org.zanata.service.DocumentService;
Expand Down Expand Up @@ -144,6 +145,9 @@ public class ProjectIterationFilesAction implements Serializable
@In
private StatisticsResource statisticsServiceImpl;

@In
private VirusScanner virusScanner;

@In
private ZanataMessages zanataMessages;

Expand Down Expand Up @@ -409,7 +413,8 @@ else if (docId.contains("/"))
tempFileStream = new FileInputStream(tempFile);
try
{
FileService.virusScan(tempFile);
String name = projectSlug+":"+iterationSlug+":"+docId;
virusScanner.scan(tempFile, name);
Blob fileContents = documentDAO.getLobHelper().createBlob(tempFileStream, (int) tempFile.length());
rawDocument.setContent(fileContents);
documentDAO.addRawDocument(document, rawDocument);
Expand Down
26 changes: 9 additions & 17 deletions zanata-war/src/main/java/org/zanata/action/SlugHome.java
Expand Up @@ -23,6 +23,7 @@
import static org.zanata.common.EntityStatus.OBSOLETE;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
Expand All @@ -47,7 +48,6 @@ public abstract class SlugHome<E> extends EntityHome<E>
private static final long serialVersionUID = 1L;

private List<SelectItem> statusList = new ArrayList<SelectItem>();
private List<SelectItem> projectTypeList = new ArrayList<SelectItem>();

@SuppressWarnings("unchecked")
@Override
Expand Down Expand Up @@ -90,34 +90,26 @@ public List<SelectItem> getStatusList()
return statusList;
}

public List<SelectItem> getProjectTypeList()
public List<ProjectType>getProjectTypeList()
{
if (projectTypeList.isEmpty())
{
projectTypeList.add(new SelectItem(null, getMessages().get("jsf.projectType.NoSelection")));
for (ProjectType projectType : ProjectType.values())
{
SelectItem option = new SelectItem(projectType, projectType.name());
projectTypeList.add(option);
}
}
Collections.sort(projectTypeList, new Comparator<SelectItem>()
List<ProjectType> projectTypes = Arrays.asList(ProjectType.values());
Collections.sort(projectTypes, new Comparator<ProjectType>()
{
@Override
public int compare(SelectItem o1, SelectItem o2)
public int compare(ProjectType o1, ProjectType o2)
{
if (o1.getValue() == null)
if (o1 == null)
{
return -1;
}
if (o2.getValue() == null)
if (o2 == null)
{
return 1;
}
return o1.getLabel().compareTo(o2.getLabel());
return o1.toString().compareTo(o2.toString());
}
});
return projectTypeList;
return projectTypes;
}

}

0 comments on commit 7a0589c

Please sign in to comment.