This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(translation update webhook): Add webhook event for translation u…
- Loading branch information
Alex Eng
committed
Apr 22, 2016
1 parent
d77e080
commit dcaaf83
Showing
19 changed files
with
531 additions
and
219 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
28 changes: 28 additions & 0 deletions
28
zanata-war/src/main/java/org/zanata/events/DocStatsEvent.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,28 @@ | ||
package org.zanata.events; | ||
|
||
import java.util.Map; | ||
|
||
import org.zanata.common.ContentState; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
|
||
/** | ||
* @author Alex Eng <a href="mailto:aeng@redhat.com">aeng@redhat.com</a> | ||
*/ | ||
@AllArgsConstructor | ||
@Getter | ||
@EqualsAndHashCode | ||
public class DocStatsEvent { | ||
private final DocumentLocaleKey key; | ||
|
||
private final Long projectVersionId; | ||
|
||
/** | ||
* Updated content states with word counts | ||
*/ | ||
private final Map<ContentState, Integer> contentStates; | ||
|
||
private final Long lastModifiedTargetId; | ||
} |
38 changes: 0 additions & 38 deletions
38
zanata-war/src/main/java/org/zanata/events/DocumentStatisticUpdatedEvent.java
This file was deleted.
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
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
88 changes: 88 additions & 0 deletions
88
zanata-war/src/main/java/org/zanata/events/webhook/DocumentStatsEvent.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,88 @@ | ||
/* | ||
* Copyright 2016, Red Hat, Inc. and individual contributors as indicated by the | ||
* @author tags. See the copyright.txt file in the distribution for a full | ||
* listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it under the | ||
* terms of the GNU Lesser General Public License as published by the Free | ||
* Software Foundation; either version 2.1 of the License, or (at your option) | ||
* any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this software; if not, write to the Free Software Foundation, | ||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF | ||
* site: http://www.fsf.org. | ||
*/ | ||
package org.zanata.events.webhook; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
import org.codehaus.jackson.annotate.JsonPropertyOrder; | ||
import org.zanata.common.ContentState; | ||
import org.zanata.common.LocaleId; | ||
import org.zanata.events.WebhookEventType; | ||
import org.zanata.rest.dto.User; | ||
|
||
/** | ||
* | ||
* Event for when a translation being updated in Zanata | ||
* | ||
* @author Alex Eng <a href="mailto:aeng@redhat.com">aeng@redhat.com</a> | ||
*/ | ||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
@JsonPropertyOrder({"user", "project", "version", "docId", "locale", "contentStates"}) | ||
@EqualsAndHashCode | ||
public class DocumentStatsEvent extends WebhookEventType { | ||
/** | ||
* User information | ||
* {@link org.zanata.rest.dto.User} | ||
*/ | ||
private final User user; | ||
|
||
/** | ||
* Target project slug. | ||
* {@link org.zanata.model.HProject#slug} | ||
*/ | ||
private final String project; | ||
|
||
/** | ||
* Target project version slug. | ||
* {@link org.zanata.model.HProjectIteration#slug} | ||
*/ | ||
private final String version; | ||
|
||
/** | ||
* Target document full path id. | ||
* {@link org.zanata.model.HDocument#docId} | ||
*/ | ||
private final String docId; | ||
|
||
/** | ||
* Target locale id. | ||
* {@link LocaleId} | ||
*/ | ||
private final LocaleId locale; | ||
|
||
/** | ||
* Updated content states with word counts | ||
*/ | ||
private final Map<ContentState, Integer> contentStates; | ||
|
||
@Override | ||
public String getType() { | ||
return this.getClass().getName(); | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.