public abstract class PushPullCommand<O extends PushPullOptions> extends ConfigurableProjectCommand<O>
Modifier and Type | Class and Description |
---|---|
protected static class |
PushPullCommand.TranslatedPercent |
Modifier and Type | Field and Description |
---|---|
protected ETagCache |
eTagCache |
protected static String |
PROJECT_TYPE_OFFLINE_PO |
protected SourceDocResourceClient |
sourceDocResourceClient |
protected StatisticsResourceClient |
statsClient |
protected TransDocResourceClient |
transDocResourceClient |
PROJECT_TYPE_GETTEXT, PROJECT_TYPE_PROPERTIES, PROJECT_TYPE_PUBLICAN, PROJECT_TYPE_UTF8_PROPERTIES, PROJECT_TYPE_XLIFF, PROJECT_TYPE_XML
Constructor and Description |
---|
PushPullCommand(O opts) |
PushPullCommand(O opts,
RestClientFactory clientFactory) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
belongsToCurrentModule(String qualifiedDocName) |
protected void |
confirmWithUser(String message) |
protected void |
debug(Object jaxbElement) |
protected ContainerTranslationStatistics |
getDetailStatisticsForProjectVersion(LocaleList locales) |
protected List<ResourceMeta> |
getDocListForProjectIterationFromServer() |
protected Map<String,Map<LocaleId,PushPullCommand.TranslatedPercent>> |
getDocsTranslatedPercent(LocaleList locales) |
static LocaleList |
getLocaleMapList(LocaleList projectLocales,
String[] locales)
Filters the project's list of locales
|
protected List<String> |
getQualifiedDocNamesForCurrentModuleFromServer() |
protected void |
loadETagCache(File cacheDir) |
protected boolean |
needToGetStatistics(boolean pullTarget) |
protected com.google.common.base.Optional<Map<String,Map<LocaleId,PushPullCommand.TranslatedPercent>>> |
prepareStatsIfApplicable(boolean pullTarget,
LocaleList locales)
this stats map will have docId as key, the value is another map with
localeId as key and translated percent as value.
|
protected String |
qualifiedDocName(String localDocName) |
protected boolean |
shouldPullThisLocale(com.google.common.base.Optional<Map<String,Map<LocaleId,PushPullCommand.TranslatedPercent>>> optionalStats,
String localDocName,
LocaleId serverLocale) |
protected void |
storeETagCache(File cacheDir) |
protected String |
unqualifiedDocName(String qualifiedDocName) |
getProjectType
deprecate, expectYes, getClientFactory, getDeprecationMessage, getName, getOpts, isDeprecated, run, runWithActions, setClientFactory
protected static final String PROJECT_TYPE_OFFLINE_PO
protected ETagCache eTagCache
protected SourceDocResourceClient sourceDocResourceClient
protected TransDocResourceClient transDocResourceClient
protected final StatisticsResourceClient statsClient
public PushPullCommand(O opts, RestClientFactory clientFactory)
public PushPullCommand(O opts)
protected void confirmWithUser(String message) throws IOException
IOException
protected void debug(Object jaxbElement)
protected boolean belongsToCurrentModule(String qualifiedDocName)
protected List<String> getQualifiedDocNamesForCurrentModuleFromServer()
protected List<ResourceMeta> getDocListForProjectIterationFromServer()
public static LocaleList getLocaleMapList(LocaleList projectLocales, String[] locales)
projectLocales
- locales defined by the project on the server or in zanata.xml
(only for backward compatibility)locales
- locales requested by the user (eg Maven param, command line
option)ConfigException
- if one of the requested locales was not found on the server
or in zanata.xml (only for backward compatibility)protected void loadETagCache(File cacheDir)
protected void storeETagCache(File cacheDir)
protected Map<String,Map<LocaleId,PushPullCommand.TranslatedPercent>> getDocsTranslatedPercent(LocaleList locales)
protected ContainerTranslationStatistics getDetailStatisticsForProjectVersion(LocaleList locales)
protected com.google.common.base.Optional<Map<String,Map<LocaleId,PushPullCommand.TranslatedPercent>>> prepareStatsIfApplicable(boolean pullTarget, LocaleList locales)
pullTarget
- whether we need to pull translation targetlocales
- protected boolean needToGetStatistics(boolean pullTarget)
Copyright © 2017 Zanata Project. All rights reserved.