This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
rhbz736898 - Enable new pushType option in maven client.
This option will replace the now deprecated pushTrans and allows for three possible values: 'source', 'trans', 'both'. PushTrans may still be used but should be phased out in future releases.
- Loading branch information
Carlos Munoz
committed
Apr 30, 2012
1 parent
aae5947
commit 9a4be04
Showing
8 changed files
with
175 additions
and
31 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
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
64 changes: 64 additions & 0 deletions
64
zanata-client-commands/src/main/java/org/zanata/client/commands/push/PushType.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,64 @@ | ||
| /* | ||
| * Copyright 2010, 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.client.commands.push; | ||
|
|
||
| /** | ||
| * @author Carlos Munoz <a href="mailto:camunoz@redhat.com">camunoz@redhat.com</a> | ||
| */ | ||
| public enum PushType | ||
| { | ||
| /** Push source documents only */ | ||
| Source, | ||
| /** Push Translated documents only */ | ||
| Trans, | ||
| /** Push both Source and Translated documents */ | ||
| Both; | ||
|
|
||
| /** | ||
| * Parse a PushType value from a string case-insensitively, and diregarding leading | ||
| * and trailing spaces. | ||
| * | ||
| * @param str The string to parse. | ||
| * @return The parsed PushType enum value, or null if the string did not match a value. | ||
| */ | ||
| public static PushType fromString(String str) | ||
| { | ||
| PushType enumVal = null; | ||
|
|
||
| if( str != null ) | ||
| { | ||
| if( Source.toString().equalsIgnoreCase( str.trim() ) ) | ||
| { | ||
| enumVal = Source; | ||
| } | ||
| else if( Trans.toString().equalsIgnoreCase( str.trim() ) ) | ||
| { | ||
| enumVal = Trans; | ||
| } | ||
| else if( Both.toString().equalsIgnoreCase( str.trim() ) ) | ||
| { | ||
| enumVal = Both; | ||
| } | ||
| } | ||
|
|
||
| return enumVal; | ||
| } | ||
| } |
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
21 changes: 21 additions & 0 deletions
21
zanata-maven-plugin/src/test/resources/push-test/pom-config-pushType.xml
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,21 @@ | ||
| <project> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <artifactId>zanata-maven-plugin</artifactId> | ||
| <configuration> | ||
| <srcDir>srcDir</srcDir> | ||
| <transDir>transDir</transDir> | ||
| <sourceLang>es</sourceLang> | ||
| <pushType>trans</pushType> | ||
| <copyTrans>false</copyTrans> | ||
| <merge>import</merge> | ||
| <useSrcOrder>true</useSrcOrder> | ||
| <includes>includes</includes> | ||
| <excludes>excludes</excludes> | ||
| <defaultExcludes>false</defaultExcludes> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </project> |