org.zanata.client.commands
Class PushPullCommand<O extends PushPullOptions>

java.lang.Object
  extended by org.zanata.client.commands.ConfigurableCommand<O>
      extended by org.zanata.client.commands.ConfigurableProjectCommand<O>
          extended by org.zanata.client.commands.PushPullCommand<O>
All Implemented Interfaces:
ZanataCommand
Direct Known Subclasses:
PullCommand, PushCommand, RawPullCommand, RawPushCommand

public abstract class PushPullCommand<O extends PushPullOptions>
extends ConfigurableProjectCommand<O>

Author:
Sean Flanigan sflaniga@redhat.com

Field Summary
protected  ETagCache eTagCache
           
protected static String PROJECT_TYPE_OFFLINE_PO
           
protected  ISourceDocResource sourceDocResource
           
protected  ITranslatedDocResource translationResources
           
protected  URI uri
           
 
Fields inherited from class org.zanata.client.commands.ConfigurableProjectCommand
PROJECT_TYPE_FILE, PROJECT_TYPE_GETTEXT, PROJECT_TYPE_PROPERTIES, PROJECT_TYPE_PUBLICAN, PROJECT_TYPE_UTF8_PROPERTIES, PROJECT_TYPE_XLIFF, PROJECT_TYPE_XML
 
Constructor Summary
PushPullCommand(O opts)
           
PushPullCommand(O opts, ZanataProxyFactory factory, ISourceDocResource sourceDocResource, ITranslatedDocResource translationResources, URI uri)
           
 
Method Summary
protected  boolean belongsToCurrentModule(String qualifiedDocName)
           
protected  void confirmWithUser(String message)
           
protected  void debug(Object jaxbElement)
           
protected static void expectYes(Console console)
           
protected  List<org.zanata.rest.dto.resource.ResourceMeta> getDocListForProjectIterationFromServer()
           
static LocaleList getLocaleMapList(LocaleList projectLocales, String[] locales)
          Filters the project's list of locales
protected  List<String> getQualifiedDocNamesForCurrentModuleFromServer()
           
protected  void loadETagCache()
           
protected  String qualifiedDocName(String localDocName)
           
protected  void storeETagCache()
           
protected  String unqualifiedDocName(String qualifiedDocName)
           
 
Methods inherited from class org.zanata.client.commands.ConfigurableProjectCommand
getProjectType
 
Methods inherited from class org.zanata.client.commands.ConfigurableCommand
deprecate, getDeprecationMessage, getName, getOpts, getRequestFactory, isDeprecated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.zanata.client.commands.ZanataCommand
run
 

Field Detail

PROJECT_TYPE_OFFLINE_PO

protected static final String PROJECT_TYPE_OFFLINE_PO
See Also:
Constant Field Values

sourceDocResource

protected final ISourceDocResource sourceDocResource

translationResources

protected final ITranslatedDocResource translationResources

uri

protected URI uri

eTagCache

protected ETagCache eTagCache
Constructor Detail

PushPullCommand

public PushPullCommand(O opts,
                       ZanataProxyFactory factory,
                       ISourceDocResource sourceDocResource,
                       ITranslatedDocResource translationResources,
                       URI uri)

PushPullCommand

public PushPullCommand(O opts)
Method Detail

confirmWithUser

protected void confirmWithUser(String message)
                        throws IOException
Throws:
IOException

expectYes

protected static void expectYes(Console console)
                         throws IOException
Throws:
IOException

debug

protected void debug(Object jaxbElement)

qualifiedDocName

protected String qualifiedDocName(String localDocName)

unqualifiedDocName

protected String unqualifiedDocName(String qualifiedDocName)

belongsToCurrentModule

protected boolean belongsToCurrentModule(String qualifiedDocName)

getQualifiedDocNamesForCurrentModuleFromServer

protected List<String> getQualifiedDocNamesForCurrentModuleFromServer()

getDocListForProjectIterationFromServer

protected List<org.zanata.rest.dto.resource.ResourceMeta> getDocListForProjectIterationFromServer()

getLocaleMapList

public static LocaleList getLocaleMapList(LocaleList projectLocales,
                                          String[] locales)
Filters the project's list of locales

Parameters:
projectLocales - locales defined by the project's zanata.xml
locales - locales requested by the user (eg Maven param, command line option)
Returns:
the filtered list of locales
Throws:
ConfigException - if one of the locales was not found in zanata.xml

loadETagCache

protected void loadETagCache()

storeETagCache

protected void storeETagCache()


Copyright © 2013 Zanata Project. All Rights Reserved.