Class CollectedProductJsonArrayToMerchantCenterXMLFileTransformer
java.lang.Object
com.broadleafcommerce.datafeed.service.publisher.file.transformer.AbstractJsonArrayToXMLFileTransformer<CollectedProduct,MerchantCenterXMLProduct>
 
com.broadleafcommerce.datafeed.feedprovider.google.sftp.publisher.file.CollectedProductJsonArrayToMerchantCenterXMLFileTransformer
- All Implemented Interfaces:
- DataFeedFileTransformer,- org.springframework.core.Ordered
public class CollectedProductJsonArrayToMerchantCenterXMLFileTransformer
extends AbstractJsonArrayToXMLFileTransformer<CollectedProduct,MerchantCenterXMLProduct>
implements DataFeedFileTransformer 
DataFeedFileTransformer for transforming a source JSON array of CollectedProduct
 into an XML containing MerchantCenterXMLProduct entries.
 This should follow Google-specific XML requirements as discussed in Google documentation
- 
Field SummaryFields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructorsConstructorDescriptionCollectedProductJsonArrayToMerchantCenterXMLFileTransformer(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, DataFeedElementTransformer<CollectedProduct, MerchantCenterXMLProduct> elementTransformer, int maxSourceElementsToReadInBatch) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanHandle(DataFeedPublishRequestDetails requestDetails) Reports whether this component can handle processing a file transformation for the givenDataFeedPublishRequestDetails.createLocalOutputFile(DataFeedPublishRequestDetails publishRequest) This follows the naming conventions described by Google.protected voidwritePostDefinition(BufferedWriter bufferedWriter, com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper, AbstractFileFeedPublisher.FilePublishContext filePublishContext) This is a hook point allowing implementations to write anything to the output file after the main elements are serialized.protected voidwritePreDefinition(BufferedWriter bufferedWriter, com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper, AbstractFileFeedPublisher.FilePublishContext filePublishContext) This is a hook point allowing implementations to write anything to the output file before the main elements are serialized.Methods inherited from class com.broadleafcommerce.datafeed.service.publisher.file.transformer.AbstractJsonArrayToXMLFileTransformerbuildFailedResponse, buildSuccessResponse, buildXMLMapper, getElementTransformer, getMaxSourceElementsToReadInBatch, getObjectMapper, getTypeFactory, transformMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.datafeed.service.publisher.file.transformer.DataFeedFileTransformergetOrder, transform
- 
Constructor Details- 
CollectedProductJsonArrayToMerchantCenterXMLFileTransformerpublic CollectedProductJsonArrayToMerchantCenterXMLFileTransformer(com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, DataFeedElementTransformer<CollectedProduct, MerchantCenterXMLProduct> elementTransformer, int maxSourceElementsToReadInBatch) 
 
- 
- 
Method Details- 
canHandleDescription copied from interface:DataFeedFileTransformerReports whether this component can handle processing a file transformation for the givenDataFeedPublishRequestDetails.- Specified by:
- canHandlein interface- DataFeedFileTransformer
- Parameters:
- requestDetails- request details around the publish process
- Returns:
- true if this component can handle the transformation for the given file, false otherwise
 
- 
createLocalOutputFileThis follows the naming conventions described by Google.- Specified by:
- createLocalOutputFilein interface- DataFeedFileTransformer
- Parameters:
- publishRequest- the publish request details
- Returns:
- the newly created temporary output file inside temporary directory
- Throws:
- Exception- if something went wrong
- See Also:
 
- 
writePreDefinitionprotected void writePreDefinition(BufferedWriter bufferedWriter, com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper, AbstractFileFeedPublisher.FilePublishContext filePublishContext) throws IOException Description copied from class:AbstractJsonArrayToXMLFileTransformerThis is a hook point allowing implementations to write anything to the output file before the main elements are serialized. For example, an implementation could use this method to write an XML declaration and any desired tags.- Specified by:
- writePreDefinitionin class- AbstractJsonArrayToXMLFileTransformer<CollectedProduct,- MerchantCenterXMLProduct> 
- Parameters:
- bufferedWriter- a buffered writer for writing to the file. Implementations MUST NOT CLOSE this writer. Opening/closing this writer is already handled by the calling method.
- xmlMapper- the configured XML mapper for XML-POJO transformation
- filePublishContext- details around the file publish process
- Throws:
- IOException- if there was an I/O issue
 
- 
writePostDefinitionprotected void writePostDefinition(BufferedWriter bufferedWriter, com.fasterxml.jackson.dataformat.xml.XmlMapper xmlMapper, AbstractFileFeedPublisher.FilePublishContext filePublishContext) throws IOException Description copied from class:AbstractJsonArrayToXMLFileTransformerThis is a hook point allowing implementations to write anything to the output file after the main elements are serialized. For example, an implementation could use this method to close any tags that were previously written inAbstractJsonArrayToXMLFileTransformer.writePreDefinition(BufferedWriter, XmlMapper, FilePublishContext).- Specified by:
- writePostDefinitionin class- AbstractJsonArrayToXMLFileTransformer<CollectedProduct,- MerchantCenterXMLProduct> 
- Parameters:
- bufferedWriter- a buffered writer for writing to the file. Implementations MUST NOT CLOSE this writer. Opening/closing this writer is already handled by the calling method.
- xmlMapper- the configured XML mapper for XML-POJO transformation
- filePublishContext- details around the file publish process
- Throws:
- IOException- if there was an I/O issue
 
 
-