org.zanata.client.commands.push
Class OfflinePoStrategy

java.lang.Object
  extended by org.zanata.client.commands.push.AbstractCommonPushStrategy<PushOptions>
      extended by org.zanata.client.commands.push.AbstractPushStrategy
          extended by org.zanata.client.commands.push.AbstractGettextPushStrategy
              extended by org.zanata.client.commands.push.GettextDirStrategy
                  extended by org.zanata.client.commands.push.OfflinePoStrategy

public class OfflinePoStrategy
extends GettextDirStrategy

Similar to GettextDirStrategy but uses msgctxt to map text flow id.

Author:
David Mason, damason@redhat.com

Constructor Summary
OfflinePoStrategy(ISourceDocResource sourceDocResource, URI uri)
           
 
Method Summary
 Set<String> findDocNames(File srcDir, List<String> includes, List<String> excludes, boolean useDefaultExclude, boolean caseSensitive, boolean excludeLocaleFilenames)
          This implementation retrieves document names from the server.
protected  org.zanata.adapter.po.PoReader2 getPoReader()
           
 String[] getSrcFiles(File srcDir, List<String> includes, List<String> excludes, boolean excludeLocaleFilenames, boolean useDefaultExclude, boolean isCaseSensitive)
          Scan srcDir to return a list of all source files.
 String[] getSrcFiles(File srcDir, List<String> includes, List<String> excludes, List<String> fileExtensions, boolean useDefaultExcludes, boolean isCaseSensitive)
          excludes should already contain paths for translation files that are to be excluded.
 boolean isTransOnly()
          Indicates if this strategy must work without access to source files.
 org.zanata.rest.dto.resource.Resource loadSrcDoc(File sourceDir, String docName)
           
 
Methods inherited from class org.zanata.client.commands.push.AbstractGettextPushStrategy
visitTranslationResources
 
Methods inherited from class org.zanata.client.commands.push.AbstractPushStrategy
docNameToFilename, docNameToFilename, getExtensions, getFileExtension, init
 
Methods inherited from class org.zanata.client.commands.push.AbstractCommonPushStrategy
getOpts, setPushOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OfflinePoStrategy

public OfflinePoStrategy(ISourceDocResource sourceDocResource,
                         URI uri)
Method Detail

getPoReader

protected org.zanata.adapter.po.PoReader2 getPoReader()
Overrides:
getPoReader in class AbstractGettextPushStrategy

isTransOnly

public boolean isTransOnly()
Description copied from class: AbstractPushStrategy
Indicates if this strategy must work without access to source files. No attempt should be made to read, write or push source documents for a trans-only strategy.

Overrides:
isTransOnly in class AbstractPushStrategy
Returns:
true if this strategy only allows interactions with translation files.

findDocNames

public Set<String> findDocNames(File srcDir,
                                List<String> includes,
                                List<String> excludes,
                                boolean useDefaultExclude,
                                boolean caseSensitive,
                                boolean excludeLocaleFilenames)
                         throws IOException
This implementation retrieves document names from the server. All parameters are ignored as there is no disk scanning.

Overrides:
findDocNames in class AbstractGettextPushStrategy
Throws:
IOException

getSrcFiles

public String[] getSrcFiles(File srcDir,
                            List<String> includes,
                            List<String> excludes,
                            boolean excludeLocaleFilenames,
                            boolean useDefaultExclude,
                            boolean isCaseSensitive)
Description copied from class: AbstractPushStrategy
Scan srcDir to return a list of all source files.

Overrides:
getSrcFiles in class AbstractPushStrategy
Parameters:
srcDir - base directory in which to find source files
includes - empty to find all source files, non-empty to find only the documents in this list
excludeLocaleFilenames - adds entries to excludes to ignore any file with a locale id suffix before the file extension.
useDefaultExclude - true to also exclude a set of default excludes for common temp file and source control filenames
isCaseSensitive - case sensitive search for includes and excludes options
Returns:
document paths for source files found in srcDir

getSrcFiles

public String[] getSrcFiles(File srcDir,
                            List<String> includes,
                            List<String> excludes,
                            List<String> fileExtensions,
                            boolean useDefaultExcludes,
                            boolean isCaseSensitive)
Description copied from class: AbstractCommonPushStrategy
excludes should already contain paths for translation files that are to be excluded.

Overrides:
getSrcFiles in class AbstractCommonPushStrategy<PushOptions>

loadSrcDoc

public org.zanata.rest.dto.resource.Resource loadSrcDoc(File sourceDir,
                                                        String docName)
                                                 throws IOException
Overrides:
loadSrcDoc in class AbstractGettextPushStrategy
Throws:
IOException


Copyright © 2013 Zanata Project. All Rights Reserved.