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

Commit

Permalink
Merge branch 'master' of github.com:zanata/zanata into integration/ma…
Browse files Browse the repository at this point in the history
…ster
  • Loading branch information
Patrick Huang committed Feb 14, 2013
2 parents 49986fd + 69ec5c8 commit 8ee674b
Show file tree
Hide file tree
Showing 17 changed files with 276 additions and 100 deletions.
12 changes: 12 additions & 0 deletions functional-test/pom.xml
Expand Up @@ -67,6 +67,14 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
<exclusion>
<artifactId>xercesImpl</artifactId>
<groupId>xerces</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand All @@ -85,6 +93,10 @@
</artifactId>
<groupId>junit</groupId>
</exclusion>
<exclusion>
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down
21 changes: 17 additions & 4 deletions pom.xml
Expand Up @@ -297,8 +297,6 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>0.11.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -382,15 +380,30 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<id>enforce-ban-duplicate-classes</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<banDuplicateClasses>
<ignoreClasses combine.children="append">
<!-- caused by Lombok (but fortunately lombok is "provided") -->
<ignoreClass>com.sun.jna.*</ignoreClass>
</ignoreClasses>
</banDuplicateClasses>
</rules>
</configuration>
</execution>

<execution>
<id>enforce-no-repositories</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<fail>true</fail>
<rules>
<requireNoRepositories>
<allowedRepositories combine.children="append">
Expand Down
26 changes: 26 additions & 0 deletions zanata-model/pom.xml
Expand Up @@ -127,6 +127,32 @@
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
<exclusions>
<exclusion>
<artifactId>
geronimo-stax-api_1.0_spec
</artifactId>
<groupId>
org.apache.geronimo.specs
</groupId>
</exclusion>
<exclusion>
<artifactId>
commons-io
</artifactId>
<groupId>
org.apache.commons
</groupId>
</exclusion>
<exclusion>
<artifactId>
solr-lucene-analyzers
</artifactId>
<groupId>
org.apache.solr
</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
106 changes: 91 additions & 15 deletions zanata-war/pom.xml
Expand Up @@ -63,6 +63,68 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-ban-duplicate-classes</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<!-- TODO enforce this once we've cleaned up
the remaining duplicates which are caused by
multiple jars for openid4java, drools, gwt
and lucene-analyzers -->
<fail>false</fail>
<rules>
<banDuplicateClasses>
<ignoreClasses combine.children="append">
<!-- caused by beanutils and jboss-embedded-thirdparty-all -->
<ignoreClass>org.apache.commons.collections.*</ignoreClass>

<!-- caused by jboss-embedded-thirdparty-all -->
<ignoreClass>antlr.*</ignoreClass>
<ignoreClass>com.sun.activation.*</ignoreClass>
<ignoreClass>com.sun.xml.*</ignoreClass>
<ignoreClass>com.sun.istack.*</ignoreClass>
<ignoreClass>hsqlServlet</ignoreClass>
<ignoreClass>javassist.*</ignoreClass>
<ignoreClass>javax.activation.*</ignoreClass>
<ignoreClass>javax.annotation.*</ignoreClass>
<ignoreClass>javax.ejb.*</ignoreClass>
<ignoreClass>javax.interceptor.*</ignoreClass>
<ignoreClass>javax.persistence.*</ignoreClass>
<ignoreClass>javax.transaction.*</ignoreClass>
<ignoreClass>javax.xml.XMLConstants</ignoreClass>
<ignoreClass>javax.xml.bind.*</ignoreClass>
<ignoreClass>javax.xml.namespace.*</ignoreClass>
<ignoreClass>javax.xml.stream.FactoryLocator</ignoreClass>
<ignoreClass>org.apache.commons.logging.*</ignoreClass>
<ignoreClass>org.apache.log4j.*</ignoreClass>
<ignoreClass>org.dom4j.*</ignoreClass>
<ignoreClass>org.hsqldb.*</ignoreClass>
<ignoreClass>org.jboss.crypto.*</ignoreClass>
<ignoreClass>org.jboss.deployment.*</ignoreClass>
<ignoreClass>org.jboss.Main*</ignoreClass>
<ignoreClass>org.jboss.mx.*</ignoreClass>
<ignoreClass>org.jboss.security.*</ignoreClass>
<ignoreClass>org.jboss.system.*</ignoreClass>
<ignoreClass>org.jboss.Version</ignoreClass>
<ignoreClass>org.quartz.*</ignoreClass>

<!-- caused by gwt jars -->
<ignoreClass>com.google.gwt.*</ignoreClass>
<ignoreClass>com.google.web.bindery.*</ignoreClass>
</ignoreClasses>
</banDuplicateClasses>
</rules>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
Expand Down Expand Up @@ -1044,7 +1106,13 @@
<scope>test</scope>
<classifier>v1.5.0</classifier>
</dependency>


<!-- NB: This must be before jboss-seam, because beanutils includes old commons collections classes -->
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</dependency>

<!-- Seam Dependencies -->

<dependency>
Expand Down Expand Up @@ -1165,12 +1233,26 @@
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<exclusions>
<!-- we use javax.persistence:persistence-api -->
<exclusion>
<artifactId>ejb3-persistence</artifactId>
<groupId>org.hibernate</groupId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<scope>${hibernate.scope}</scope>
<exclusions>
<!-- we use javax.persistence:persistence-api -->
<exclusion>
<artifactId>ejb3-persistence</artifactId>
<groupId>org.hibernate</groupId>
</exclusion>
</exclusions>
</dependency>

<!-- TODO remove annotations and jmx after we move to v3.6 (AS7) -->
Expand Down Expand Up @@ -1296,6 +1378,12 @@
<dependency>
<groupId>org.apache.solr</groupId>
<artifactId>solr-core</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -1312,26 +1400,14 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-commons-annotations</artifactId>
</exclusion>
<!-- we use javax.persistence:persistence-api -->
<exclusion>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>ejb3-persistence</artifactId>
<version>1.0.2.GA</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
Expand All @@ -1353,7 +1429,7 @@
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<!-- TODO does this need to use ${hibernate.scope} for jboss7 profile? -->
<version>1.0.2</version>
<scope>provided</scope>
</dependency>

Expand Down
Expand Up @@ -33,7 +33,6 @@
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.web.RequestParameter;
import org.jboss.seam.log.Log;
import org.zanata.rest.dto.ProjectType;
import org.zanata.service.ConfigurationService;

@Name("configurationAction")
Expand All @@ -45,13 +44,15 @@ public class ConfigurationAction implements Serializable
private String iterationSlug;
@RequestParameter
private String projectSlug;
@RequestParameter
private String projectType;

@Logger
Log log;
private Log log;
@In
ConfigurationService configurationServiceImpl;
private ConfigurationService configurationServiceImpl;

public void getData(ProjectType projectType)
public void getData()
{
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.setContentType("application/xml");
Expand All @@ -63,7 +64,7 @@ public void getData(ProjectType projectType)
ServletOutputStream os = response.getOutputStream();

os.write(
this.configurationServiceImpl.getConfigurationFileContents(this.projectSlug, this.iterationSlug, projectType.name().toLowerCase()).getBytes());
configurationServiceImpl.getConfigurationFileContents(this.projectSlug, this.iterationSlug, this.projectType).getBytes());
os.flush();
os.close();
FacesContext.getCurrentInstance().responseComplete();
Expand Down
Expand Up @@ -25,6 +25,8 @@

import javax.faces.event.ValueChangeEvent;
import javax.persistence.EntityNotFoundException;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;

import lombok.extern.slf4j.Slf4j;

Expand Down Expand Up @@ -117,18 +119,19 @@ public void validateSuppliedId()
// start
}

// public ProjectType getProjecType()
// {
// if (getInstance().getProjectType() == null)
// {
//
// }
// }
//
// public void setProjectType(ProjectType projectType)
// {
// getInstance().setProjectType(projectType);
// }
public ProjectType getProjectType()
{
if (getInstance().getProjectType() == null)
{
getInstance().setProjectType(getInstance().getProject().getDefaultProjectType());
}
return getInstance().getProjectType();
}

public void setProjectType(ProjectType projectType)
{
getInstance().setProjectType(projectType);
}

public void validateProjectSlug()
{
Expand Down
Expand Up @@ -52,6 +52,7 @@
import org.zanata.model.HProject;
import org.zanata.model.HProjectIteration;
import org.zanata.process.CopyTransProcessHandle;
import org.zanata.rest.dto.ProjectType;
import org.zanata.rest.dto.stats.ContainerTranslationStatistics;
import org.zanata.rest.dto.stats.TranslationStatistics;
import org.zanata.rest.dto.stats.TranslationStatistics.StatUnit;
Expand Down Expand Up @@ -307,6 +308,16 @@ public HProjectIteration getProjectIteration()
return this.projectIteration;
}

public String getProjectType()
{
ProjectType result = getProjectIteration().getProjectType();
if (result != null)
{
return result.name();
}
return null;
}

public HProject getProject()
{
return this.getProjectIteration().getProject();
Expand Down
Expand Up @@ -26,7 +26,6 @@
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.zanata.model.HPerson;
import org.zanata.model.HPersonEmailValidationKey;


Expand Down
Expand Up @@ -22,6 +22,7 @@

import java.util.List;

import org.apache.commons.lang.StringUtils;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
Expand Down Expand Up @@ -55,7 +56,7 @@ public String getConfigurationFileContents(String projectSlug, String iterationS
var.append(" <url>").append(applicationConfiguration.getServerPath()).append("/</url>\n");
var.append(" <project>").append(projectSlug).append("</project>\n");
var.append(" <project-version>").append(iterationSlug).append("</project-version>\n");
if (projectType != null)
if (!StringUtils.isEmpty(projectType))
{
var.append(" <project-type>").append(projectType).append("</project-type>\n");
}
Expand Down

0 comments on commit 8ee674b

Please sign in to comment.