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' into ZNTA-938
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Eng committed May 12, 2016
2 parents 121e866 + 463bef8 commit bee9298
Show file tree
Hide file tree
Showing 38 changed files with 489 additions and 475 deletions.
14 changes: 14 additions & 0 deletions docs/release-notes.md
@@ -1,3 +1,10 @@
## 4.0

<h5>New feature</h5>
* [ZNTA-746](https://zanata.atlassian.net/browse/ZNTA-746) - Add shorcut key for approve and reject translation

-----------------------

## 3.9
<h5>New Features</h5>
* [ZNTA-938](https://zanata.atlassian.net/browse/ZNTA-938) - Webhook event for translation update by user.
Expand Down Expand Up @@ -34,6 +41,13 @@
* [ZNTA-905](https://zanata.atlassian.net/browse/ZNTA-905) - Remove 0% matching translation memory entry
* [ZNTA-928](https://zanata.atlassian.net/browse/ZNTA-928) - Readonly project doesn't have "lock" icon in UI
* [ZNTA-54](https://zanata.atlassian.net/browse/ZNTA-54) - Allow delete language
* [ZNTA-1066](https://zanata.atlassian.net/browse/ZNTA-1066) - Delete project still indicates "Obsolete" in the notification
* [ZNTA-1068](https://zanata.atlassian.net/browse/ZNTA-1068) - Refresh page after adding language in project page
* [ZNTA-1074](https://zanata.atlassian.net/browse/ZNTA-1074) - Hide notification details section
* [ZNTA-1065](https://zanata.atlassian.net/browse/ZNTA-1065) - Drop-down user menu does not obscure the Glossary buttons
* [ZNTA-1086](https://zanata.atlassian.net/browse/ZNTA-1086) - NullPointerException when uploading from client (tested with cs-CZ)

* [ZNTA-981](https://zanata.atlassian.net/browse/ZNTA-981) - Remove file extension for gettext project file type

<h5>Infrastructure Changes</h5>
* Recommended platform: JBoss EAP 6 (6.4.6.GA or later).
Expand Down
1 change: 0 additions & 1 deletion functional-test/pom.xml
Expand Up @@ -1110,4 +1110,3 @@
</pluginManagement>
</build>
</project>

87 changes: 51 additions & 36 deletions pom.xml
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.zanata</groupId>
<artifactId>zanata-parent</artifactId>
<version>28-SNAPSHOT</version>
<version>29-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>

Expand Down Expand Up @@ -86,12 +86,12 @@
<gwteventservice.version>1.2.1</gwteventservice.version>
<okapi.version>0.22</okapi.version>

<zanata.assets.version>8.2</zanata.assets.version>
<zanata.api.version>3.9.0-SNAPSHOT</zanata.api.version>
<zanata.assets.version>9.0-SNAPSHOT</zanata.assets.version>
<zanata.api.version>4.0.0-SNAPSHOT</zanata.api.version>
<!-- This should always be the previous version of the used api version above (but only 3.0.1 or later will work) -->
<zanata.api.compat.version>3.8.3</zanata.api.compat.version>
<zanata.client.version>3.8.1</zanata.client.version>
<zanata.common.version>3.8.1</zanata.common.version>
<zanata.api.compat.version>3.9.0</zanata.api.compat.version>
<zanata.client.version>4.0.0-SNAPSHOT</zanata.client.version>
<zanata.common.version>4.0.0-SNAPSHOT</zanata.common.version>

<richfaces.version>4.5.11.Final</richfaces.version>

Expand Down Expand Up @@ -256,6 +256,14 @@
<artifactId>jcip-annotations</artifactId>
<groupId>net.jcip</groupId>
</exclusion>
<exclusion>
<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.2_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand Down Expand Up @@ -351,7 +359,7 @@
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.9</version>
<version>1.10</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -472,6 +480,12 @@
<version>1.0.1.Final</version>
</dependency>

<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>${resteasy.version}</version>
</dependency>

<dependency>
<groupId>org.jboss.shrinkwrap.descriptors</groupId>
<artifactId>shrinkwrap-descriptors-api-base</artifactId>
Expand Down Expand Up @@ -514,6 +528,18 @@
<version>${shrinkwrap.desc.version}</version>
</dependency>

<dependency>
<groupId>org.jboss.spec.javax.interceptor</groupId>
<artifactId>jboss-interceptors-api_1.1_spec</artifactId>
<version>1.0.1.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.1_spec</artifactId>
<version>1.0.1.Final</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.jboss.xnio</groupId>
<artifactId>xnio-api</artifactId>
Expand Down Expand Up @@ -968,7 +994,16 @@
<artifactId>cssparser</artifactId>
<version>0.9.18</version>
</dependency>

<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.richfaces</groupId>
<artifactId>richfaces-a4j</artifactId>
<version>${richfaces.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-orm</artifactId>
Expand Down Expand Up @@ -1134,34 +1169,6 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>${resteasy.version}</version>
<scope>${resteasy.scope}</scope>
<exclusions>
<exclusion>
<groupId>javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
<exclusion>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</exclusion>
<exclusion>
<artifactId>jcip-annotations</artifactId>
<groupId>net.jcip</groupId>
</exclusion>
<exclusion>
<groupId>org.jboss.spec.javax.annotation</groupId>
<artifactId>jboss-annotations-api_1.2_spec</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.spec.javax.ws.rs</groupId>
<artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxb-provider</artifactId>
Expand Down Expand Up @@ -1222,6 +1229,14 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.7.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
Expand Down
Expand Up @@ -162,7 +162,7 @@
</datasource>
<datasource jndi-name="java:jboss/datasources/zanataDatasource"
pool-name="zanataDatasource" enabled="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/zanata?characterEncoding=UTF-8</connection-url>
<connection-url>${zanata.db.url}</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>mysql-connector-java.jar</driver>
<pool>
Expand All @@ -171,7 +171,8 @@
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>root</user-name>
<user-name>${zanata.db.username}</user-name>
<password>${zanata.db.password}</password>
</security>
<statement>
<track-statements>NOWARN</track-statements>
Expand Down
4 changes: 0 additions & 4 deletions zanata-test-war/pom.xml
Expand Up @@ -59,10 +59,6 @@
<artifactId>guava</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>annotations</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
Expand Down
2 changes: 0 additions & 2 deletions zanata-war/pom.xml
Expand Up @@ -2504,5 +2504,3 @@


</project>


11 changes: 8 additions & 3 deletions zanata-war/src/main/java/org/zanata/action/ProjectHome.java
Expand Up @@ -918,9 +918,14 @@ public void updateStatus(char initial) {
}
}
update();
facesMessages.addGlobal(FacesMessage.SEVERITY_INFO,
msgs.format("jsf.project.status.updated",
EntityStatus.valueOf(initial)));
EntityStatus status = EntityStatus.valueOf(initial);
if (status.equals(EntityStatus.OBSOLETE)) {
facesMessages.addGlobal(FacesMessage.SEVERITY_INFO,
msgs.format("jsf.project.notification.deleted", getSlug()));
} else {
facesMessages.addGlobal(FacesMessage.SEVERITY_INFO,
msgs.format("jsf.project.status.updated", status));
}
}

@Transactional
Expand Down
Expand Up @@ -21,12 +21,13 @@
package org.zanata.dao;

import org.hibernate.Session;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import org.zanata.model.HAccountResetPasswordKey;

@Named("accountResetPasswordKeyDAO")

@javax.enterprise.context.Dependent
@RequestScoped
public class AccountResetPasswordKeyDAO extends
AbstractDAOImpl<HAccountResetPasswordKey, String> {

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

import java.io.Serializable;

import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
Expand All @@ -36,7 +37,6 @@
* href="mailto:sflaniga@redhat.com">sflaniga@redhat.com</a>
*
*/
@AllArgsConstructor
public final class TextFlowTargetStateEvent {
@Getter
private final DocumentLocaleKey key;
Expand All @@ -51,6 +51,16 @@ public final class TextFlowTargetStateEvent {
@Getter
private final ImmutableList<TextFlowTargetState> states;

public TextFlowTargetStateEvent(DocumentLocaleKey key,
Long projectIterationId, Long actorId,
ImmutableList<TextFlowTargetState> states) {
this.key = key;
this.projectIterationId = projectIterationId;
this.actorId = actorId;
this.states = states;
Preconditions.checkArgument(!states.isEmpty(), "states is empty");
}

public TextFlowTargetStateEvent(DocumentLocaleKey key,
Long projectIterationId, Long actorId, TextFlowTargetState state) {
this(key, projectIterationId, actorId, ImmutableList.of(state));
Expand Down
20 changes: 13 additions & 7 deletions zanata-war/src/main/java/org/zanata/file/SourceDocumentUpload.java
Expand Up @@ -168,7 +168,7 @@ public Response tryValidatedUploadSourceFile(GlobalDocumentId id,
processAdapterFile(tempFile.get(), id, uploadForm);
} else if (DocumentType.getByName(uploadForm.getFileType()) == DocumentType.GETTEXT) {
InputStream potStream = getInputStream(tempFile, uploadForm);
parsePotFile(potStream, id, uploadForm);
parsePotFile(potStream, id);
} else {
throw new ZanataServiceException("Unsupported source file: "
+ id.getDocId());
Expand Down Expand Up @@ -333,13 +333,19 @@ private void persistRawDocument(HDocument document, File rawFile,
documentDAO.flush();
}

private void parsePotFile(InputStream potStream, GlobalDocumentId id,
DocumentFileUploadForm uploadForm) {
// real upload filename not available, but the service only cares about
// the suffix.
/**
* This method should only process gettext project type
* @param potStream
* @param id
*/
private void parsePotFile(InputStream potStream, GlobalDocumentId id) {
//remove .pot extension from docId as per zanata-cli
String docIdWithoutExtension =
FilenameUtils.removeExtension(id.getDocId());

Resource doc = translationFileServiceImpl.parseUpdatedPotFile(potStream,
id.getDocId(), ".pot",
useOfflinePo(id));
docIdWithoutExtension, ".pot",
useOfflinePo(id));
doc.setLang(LocaleId.EN_US);
// TODO Copy Trans values

Expand Down
Expand Up @@ -93,7 +93,7 @@ protected void closeFTEntityManager(@Disposes @FullText FullTextEntityManager en

@Produces
@Default
@Dependent
@RequestScoped
protected Session getSession(EntityManager entityManager) {
return entityManager.unwrap(Session.class);
}
Expand Down
Expand Up @@ -213,11 +213,11 @@ public Resource parseUpdatedPotFile(InputStream fileContents, String docId,
return parsePotFile(fileContents, docId, offlinePo);
} catch (Exception e) {
throw new ZanataServiceException(
"Invalid POT file contents on file: " + fileName, e);
"Invalid POT file contents on file: " + docId, e);
}
} else {
throw new ZanataServiceException("Unsupported Document file: "
+ fileName);
+ docId);
}
}

Expand Down
Expand Up @@ -852,11 +852,10 @@ public String apply(TextFlowTarget input) {
ContentState currentState = ContentState.New;
if (hTarget != null) {
currentState = hTarget.getState();
}

if (mergeType == MergeType.IMPORT) {
removedTextFlowTargetIds.remove(hTarget.getId());
}
if (mergeType == MergeType.IMPORT) {
removedTextFlowTargetIds.remove(hTarget.getId());
}
}

TranslationMergeServiceFactory.MergeContext mergeContext =
new TranslationMergeServiceFactory.MergeContext(
Expand Down

0 comments on commit bee9298

Please sign in to comment.