org.zanata.client.commands.pull
Class XmlStrategy

java.lang.Object
  extended by org.zanata.client.commands.pull.AbstractPullStrategy
      extended by org.zanata.client.commands.pull.XmlStrategy
All Implemented Interfaces:
PullStrategy

public class XmlStrategy
extends AbstractPullStrategy

Author:
Sean Flanigan sflaniga@redhat.com

Constructor Summary
protected XmlStrategy(PullOptions opts)
           
 
Method Summary
 org.zanata.rest.StringSet getExtensions()
          Which extensions (eg gettext, comment) does this strategy need to fetch from the server?
 File getTransFileToWrite(String docName, LocaleMapping localeMapping)
          Provides the file reference that will be used to write a Translation file for a given Resource.
 boolean needsDocToWriteTrans()
          Does this strategy need the source document (Resource) when writing translations?
 void writeSrcFile(org.zanata.rest.dto.resource.Resource doc)
           
 org.zanata.common.io.FileDetails writeTransFile(org.zanata.rest.dto.resource.Resource doc, String docName, LocaleMapping locale, org.zanata.rest.dto.resource.TranslationsResource targetDoc)
          pre: docWithLocalName.getName() must match docName if docWithLocalName is not null
 
Methods inherited from class org.zanata.client.commands.pull.AbstractPullStrategy
getOpts, isTransOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlStrategy

protected XmlStrategy(PullOptions opts)
Method Detail

needsDocToWriteTrans

public boolean needsDocToWriteTrans()
Description copied from interface: PullStrategy
Does this strategy need the source document (Resource) when writing translations?

Returns:

writeSrcFile

public void writeSrcFile(org.zanata.rest.dto.resource.Resource doc)
                  throws IOException
Throws:
IOException

getTransFileToWrite

public File getTransFileToWrite(String docName,
                                LocaleMapping localeMapping)
Description copied from interface: PullStrategy
Provides the file reference that will be used to write a Translation file for a given Resource. Ideally, this method should be used by concrete implementations of the strategy to write the file.

Parameters:
docName - may be null if needsDocToWriteTrans() returns false
localeMapping - Locale mapping to use.
Returns:
A File reference (might not exist physically) to which a Translation Resource will be written.

writeTransFile

public org.zanata.common.io.FileDetails writeTransFile(org.zanata.rest.dto.resource.Resource doc,
                                                       String docName,
                                                       LocaleMapping locale,
                                                       org.zanata.rest.dto.resource.TranslationsResource targetDoc)
                                                throws IOException
Description copied from interface: PullStrategy
pre: docWithLocalName.getName() must match docName if docWithLocalName is not null

Parameters:
doc - may be null if needsDocToWriteTrans() returns false
docName - may be null if needsDocToWriteTrans() returns false
Returns:
Details of the file that was written. May be null if the Strategy cannot provide details.
Throws:
IOException

getExtensions

public org.zanata.rest.StringSet getExtensions()
Description copied from interface: PullStrategy
Which extensions (eg gettext, comment) does this strategy need to fetch from the server?

Returns:


Copyright © 2013 Zanata Project. All Rights Reserved.