com.openindex.openestate.tool.agency.export
Class AbstractExport

java.lang.Object
  extended by com.openindex.openestate.tool.agency.export.AbstractExport
Direct Known Subclasses:
AbstractCsvExport, AbstractXmlExport, WebsiteHtmlExport, WebsitePhpExport

public abstract class AbstractExport
extends Object

AbstractExport.
$Id: AbstractExport.java 1829 2012-10-14 14:24:52Z andy $

Author:
Andreas Rudolph

Field Summary
static String IMAGEMODE_BASE64
           
static String IMAGEMODE_DISABLED
           
static String IMAGEMODE_FILE
           
static String KEY_ID_PREFIX
           
static String KEY_IMAGE_ALL
           
static String KEY_IMAGE_COUNT
           
static String KEY_IMAGE_SCALE
           
static String KEY_IMAGE_SCALE_HEIGHT
           
static String KEY_IMAGE_SCALE_WIDTH
           
static String KEY_IMAGE_WATERMARK
           
static String KEY_IMAGE_WATERMARK_ALPHA
           
static String KEY_IMAGE_WATERMARK_HEIGHT
           
static String KEY_IMAGE_WATERMARK_POSITION
           
static String KEY_IMAGE_WATERMARK_WIDTH
           
static String KEY_IMAGEMODE
           
static String KEY_INCREMENTAL
           
static String KEY_LANGUAGE
           
static String KEY_MIME_TYPES
           
static String KEY_UNPUBLISHED_ADDRESS_HIDDEN
           
static String KEY_VIDEO_COUNT
           
static String KEY_ZIPPED
           
static String POSITION_BOTTOM_CENTER
           
static String POSITION_BOTTOM_LEFT
           
static String POSITION_BOTTOM_RIGHT
           
static String POSITION_CENTER_CENTER
           
static String POSITION_CENTER_LEFT
           
static String POSITION_CENTER_RIGHT
           
static String POSITION_TOP_CENTER
           
static String POSITION_TOP_LEFT
           
static String POSITION_TOP_RIGHT
           
 
Constructor Summary
AbstractExport()
          Erzeugt eine Instanz der Klasse 'AbstractExport'
 
Method Summary
protected  TransferImpl buildTransfer(AgencyExportSummary summary)
           
protected  boolean canExportAttachment(long estateId, EstateAttachmentImpl attach)
           
protected  boolean canTransportAttachment(long estateId, EstateAttachmentImpl attach)
           
 BufferedImage convertImage(org.xmldb.api.modules.BinaryResource res)
           
 BufferedImage convertImage(InputStream input)
           
abstract  AbstractExportPanel createSetupPanel()
           
abstract  File doExport(AgencyExportSummary summary, ImmoToolTask.Callback callback)
          Export durchführen.
 void doFinishExport(AgencyExportSummary summary, String[] responses, ImmoToolTask.Callback callback)
           
 void doFinishFtpTransport(FtpTransport transport, AgencyExportSummary summary, File exportDir, org.apache.commons.net.ftp.FTPClient client, String remotePath, ImmoToolTask.Callback callback)
           
 void doPrepareFtpTransport(FtpTransport transport, AgencyExportSummary summary, File exportDir, org.apache.commons.net.ftp.FTPClient client, String remotePath, ImmoToolTask.Callback callback)
           
 String getAddressPublishing()
           
 File getAttachmentDirectory(EstateAttachmentImpl attach, File file)
           
protected  boolean getEstateForUpdate(AgencyEstate estate)
          Vorbereitung einer Immobilie, bevor diese in den Transfer aufgenommen wird.
protected  String getEstateIdForRemoval(Long estateId, AgencyExportSummary summary)
           
 File getExportDirectory()
           
 String getIdPrefix()
           
 Integer getImageCount()
           
 String getImageMode()
           
 Locale getLocale()
           
 List<String> getMimeTypes()
           
abstract  String getName()
           
static String[] getPositions()
           
 List<String> getRequiredMimeTypes()
          Liefert die von der Export-Schnittstelle fest vorgeschriebenen MIME-Types.
 Integer getScaleImageHeight()
           
 Integer getScaleImageWidth()
           
abstract  String getTitle()
           
 Integer getVideoCount()
           
 Integer getWatermarkAlpha()
           
 Integer getWatermarkHeight()
           
 String getWatermarkPosition()
           
 Integer getWatermarkWidth()
           
 String getZipFileName()
           
protected  void handleAttachments(long estateId, EstateImpl estate, org.xmldb.api.base.Collection estateFileCollection)
           
protected  void handleAttachmentsAsBase64(long estateId, EstateImpl estate, org.xmldb.api.base.Collection estateFileCollection)
           
protected  void handleAttachmentsAsFiles(long estateId, EstateImpl estate, org.xmldb.api.base.Collection estateFileCollection)
           
protected  void handleErrors(AgencyExportSummary summary, Map<String,String> errors)
           
protected  void initWatermarkLogo()
           
 boolean isAllImagesExported()
           
 boolean isFullTransportWarningShown()
           
 boolean isImageModeBase64()
           
 boolean isImageModeDisabled()
           
 boolean isImageModeFile()
           
 boolean isIncremental()
           
 boolean isScaleImages()
           
 boolean isUnpublishedAddressHidden()
           
 boolean isWatermark()
           
 boolean isZipped()
           
static Map<String,AbstractExport> listAvailableExports()
           
 void load(Properties props)
           
protected  AgencyAgent loadAgent()
           
protected  AgencyContact loadAgentContact(long id)
           
protected  AgencyEstate loadEstate(Long id, org.xmldb.api.base.Collection estateCollection)
           
protected  File loadEstateAttachment(long estateId, String name, org.xmldb.api.base.Collection estateFileCollection)
           
protected  org.xmldb.api.base.Collection loadEstateCollection()
           
protected  Long[] loadEstateIds(org.xmldb.api.base.Collection estateCollection)
           
 void save(Properties props)
           
 void setAddressPublishing(String val)
           
 void setAllImagesExported(boolean val)
           
protected  void setFullTransportWarningShown(boolean val)
           
 void setIdPrefix(String val)
           
 void setImageCount(Integer val)
           
 void setImageMode(String val)
           
 void setIncremental(boolean val)
           
 void setLanguage(Locale val)
           
 void setScaleImageHeight(Integer val)
           
 void setScaleImages(boolean val)
           
 void setScaleImageWidth(Integer val)
           
 void setUnpublishedAddressHidden(boolean unpublishedAddressHidden)
           
 void setVideoCount(Integer val)
           
 void setWatermark(boolean watermark)
           
 void setWatermarkAlpha(Integer val)
           
 void setWatermarkHeight(Integer val)
           
 void setWatermarkPosition(String val)
           
 void setWatermarkWidth(Integer val)
           
 void setZipped(boolean val)
           
 boolean supportsEstateType(String estateType, String estateAction)
           
abstract  boolean supportsIncrementalUpdate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_INCREMENTAL

public static final String KEY_INCREMENTAL
See Also:
Constant Field Values

KEY_LANGUAGE

public static final String KEY_LANGUAGE
See Also:
Constant Field Values

KEY_ZIPPED

public static final String KEY_ZIPPED
See Also:
Constant Field Values

KEY_ID_PREFIX

public static final String KEY_ID_PREFIX
See Also:
Constant Field Values

KEY_IMAGE_ALL

public static final String KEY_IMAGE_ALL
See Also:
Constant Field Values

KEY_IMAGE_COUNT

public static final String KEY_IMAGE_COUNT
See Also:
Constant Field Values

KEY_IMAGE_SCALE

public static final String KEY_IMAGE_SCALE
See Also:
Constant Field Values

KEY_IMAGE_SCALE_WIDTH

public static final String KEY_IMAGE_SCALE_WIDTH
See Also:
Constant Field Values

KEY_IMAGE_SCALE_HEIGHT

public static final String KEY_IMAGE_SCALE_HEIGHT
See Also:
Constant Field Values

KEY_IMAGE_WATERMARK

public static final String KEY_IMAGE_WATERMARK
See Also:
Constant Field Values

KEY_IMAGE_WATERMARK_ALPHA

public static final String KEY_IMAGE_WATERMARK_ALPHA
See Also:
Constant Field Values

KEY_IMAGE_WATERMARK_POSITION

public static final String KEY_IMAGE_WATERMARK_POSITION
See Also:
Constant Field Values

KEY_IMAGE_WATERMARK_WIDTH

public static final String KEY_IMAGE_WATERMARK_WIDTH
See Also:
Constant Field Values

KEY_IMAGE_WATERMARK_HEIGHT

public static final String KEY_IMAGE_WATERMARK_HEIGHT
See Also:
Constant Field Values

KEY_MIME_TYPES

public static final String KEY_MIME_TYPES
See Also:
Constant Field Values

KEY_VIDEO_COUNT

public static final String KEY_VIDEO_COUNT
See Also:
Constant Field Values

KEY_UNPUBLISHED_ADDRESS_HIDDEN

public static final String KEY_UNPUBLISHED_ADDRESS_HIDDEN
See Also:
Constant Field Values

KEY_IMAGEMODE

public static final String KEY_IMAGEMODE
See Also:
Constant Field Values

IMAGEMODE_DISABLED

public static final String IMAGEMODE_DISABLED
See Also:
Constant Field Values

IMAGEMODE_FILE

public static final String IMAGEMODE_FILE
See Also:
Constant Field Values

IMAGEMODE_BASE64

public static final String IMAGEMODE_BASE64
See Also:
Constant Field Values

POSITION_TOP_LEFT

public static final String POSITION_TOP_LEFT
See Also:
Constant Field Values

POSITION_TOP_CENTER

public static final String POSITION_TOP_CENTER
See Also:
Constant Field Values

POSITION_TOP_RIGHT

public static final String POSITION_TOP_RIGHT
See Also:
Constant Field Values

POSITION_CENTER_LEFT

public static final String POSITION_CENTER_LEFT
See Also:
Constant Field Values

POSITION_CENTER_CENTER

public static final String POSITION_CENTER_CENTER
See Also:
Constant Field Values

POSITION_CENTER_RIGHT

public static final String POSITION_CENTER_RIGHT
See Also:
Constant Field Values

POSITION_BOTTOM_LEFT

public static final String POSITION_BOTTOM_LEFT
See Also:
Constant Field Values

POSITION_BOTTOM_CENTER

public static final String POSITION_BOTTOM_CENTER
See Also:
Constant Field Values

POSITION_BOTTOM_RIGHT

public static final String POSITION_BOTTOM_RIGHT
See Also:
Constant Field Values
Constructor Detail

AbstractExport

public AbstractExport()
Erzeugt eine Instanz der Klasse 'AbstractExport'

Method Detail

buildTransfer

protected TransferImpl buildTransfer(AgencyExportSummary summary)
                              throws AgencyExportException
Throws:
AgencyExportException

canExportAttachment

protected boolean canExportAttachment(long estateId,
                                      EstateAttachmentImpl attach)

canTransportAttachment

protected boolean canTransportAttachment(long estateId,
                                         EstateAttachmentImpl attach)

convertImage

public final BufferedImage convertImage(org.xmldb.api.modules.BinaryResource res)
                                 throws org.xmldb.api.base.XMLDBException,
                                        IOException
Throws:
org.xmldb.api.base.XMLDBException
IOException

convertImage

public BufferedImage convertImage(InputStream input)
                           throws org.xmldb.api.base.XMLDBException,
                                  IOException
Throws:
org.xmldb.api.base.XMLDBException
IOException

createSetupPanel

public abstract AbstractExportPanel createSetupPanel()

doExport

public abstract File doExport(AgencyExportSummary summary,
                              ImmoToolTask.Callback callback)
                       throws AgencyExportException,
                              ImmoToolTaskCancelledException
Export durchführen.

Parameters:
summary - Zusammenfassung des Exports
callback - Callback-Objekt des ausführenden Tasks
Returns:
temporäres Export-Verzeichnis
Throws:
AgencyExportException - Fehler beim Exportieren
ImmoToolTaskCancelledException

doFinishExport

public void doFinishExport(AgencyExportSummary summary,
                           String[] responses,
                           ImmoToolTask.Callback callback)
                    throws ImmoToolTaskCancelledException
Throws:
ImmoToolTaskCancelledException

doFinishFtpTransport

public void doFinishFtpTransport(FtpTransport transport,
                                 AgencyExportSummary summary,
                                 File exportDir,
                                 org.apache.commons.net.ftp.FTPClient client,
                                 String remotePath,
                                 ImmoToolTask.Callback callback)
                          throws AgencyExportException,
                                 ImmoToolTaskCancelledException
Throws:
AgencyExportException
ImmoToolTaskCancelledException

doPrepareFtpTransport

public void doPrepareFtpTransport(FtpTransport transport,
                                  AgencyExportSummary summary,
                                  File exportDir,
                                  org.apache.commons.net.ftp.FTPClient client,
                                  String remotePath,
                                  ImmoToolTask.Callback callback)
                           throws AgencyExportException,
                                  ImmoToolTaskCancelledException
Throws:
AgencyExportException
ImmoToolTaskCancelledException

getAddressPublishing

public String getAddressPublishing()

getAttachmentDirectory

public File getAttachmentDirectory(EstateAttachmentImpl attach,
                                   File file)
                            throws AgencyExportException
Throws:
AgencyExportException

getEstateForUpdate

protected boolean getEstateForUpdate(AgencyEstate estate)
Vorbereitung einer Immobilie, bevor diese in den Transfer aufgenommen wird.

Parameters:
estate - zu transferierende Immobilie
Returns:
true, wenn die Immobilie in den Transfer aufgenommen werden kann.

getEstateIdForRemoval

protected String getEstateIdForRemoval(Long estateId,
                                       AgencyExportSummary summary)

getExportDirectory

public File getExportDirectory()
                        throws AgencyExportException
Throws:
AgencyExportException

getIdPrefix

public String getIdPrefix()

getImageCount

public Integer getImageCount()

getImageMode

public String getImageMode()

getLocale

public Locale getLocale()

getMimeTypes

public List<String> getMimeTypes()

getName

public abstract String getName()

getPositions

public static String[] getPositions()

getRequiredMimeTypes

public List<String> getRequiredMimeTypes()
Liefert die von der Export-Schnittstelle fest vorgeschriebenen MIME-Types.

Returns:
Liste der fest vorgeschriebenen MIME-Types, oder null wenn keine Vorgaben existieren.

getScaleImageHeight

public Integer getScaleImageHeight()

getScaleImageWidth

public Integer getScaleImageWidth()

getTitle

public abstract String getTitle()

getVideoCount

public Integer getVideoCount()

getWatermarkAlpha

public Integer getWatermarkAlpha()

getWatermarkHeight

public Integer getWatermarkHeight()

getWatermarkPosition

public String getWatermarkPosition()

getWatermarkWidth

public Integer getWatermarkWidth()

getZipFileName

public String getZipFileName()

handleAttachments

protected void handleAttachments(long estateId,
                                 EstateImpl estate,
                                 org.xmldb.api.base.Collection estateFileCollection)
                          throws AgencyExportException
Throws:
AgencyExportException

handleAttachmentsAsBase64

protected void handleAttachmentsAsBase64(long estateId,
                                         EstateImpl estate,
                                         org.xmldb.api.base.Collection estateFileCollection)
                                  throws AgencyExportException
Throws:
AgencyExportException

handleAttachmentsAsFiles

protected void handleAttachmentsAsFiles(long estateId,
                                        EstateImpl estate,
                                        org.xmldb.api.base.Collection estateFileCollection)
                                 throws AgencyExportException
Throws:
AgencyExportException

handleErrors

protected void handleErrors(AgencyExportSummary summary,
                            Map<String,String> errors)

initWatermarkLogo

protected void initWatermarkLogo()

isAllImagesExported

public boolean isAllImagesExported()

isFullTransportWarningShown

public boolean isFullTransportWarningShown()

isImageModeBase64

public boolean isImageModeBase64()

isImageModeDisabled

public boolean isImageModeDisabled()

isImageModeFile

public boolean isImageModeFile()

isIncremental

public boolean isIncremental()

isScaleImages

public boolean isScaleImages()

isUnpublishedAddressHidden

public boolean isUnpublishedAddressHidden()

isWatermark

public boolean isWatermark()

isZipped

public boolean isZipped()

listAvailableExports

public static Map<String,AbstractExport> listAvailableExports()

load

public void load(Properties props)

loadAgent

protected AgencyAgent loadAgent()
                         throws ImmoToolDbException
Throws:
ImmoToolDbException

loadAgentContact

protected AgencyContact loadAgentContact(long id)
                                  throws ImmoToolDbException
Throws:
ImmoToolDbException

loadEstate

protected AgencyEstate loadEstate(Long id,
                                  org.xmldb.api.base.Collection estateCollection)
                           throws ImmoToolDbException
Throws:
ImmoToolDbException

loadEstateAttachment

protected File loadEstateAttachment(long estateId,
                                    String name,
                                    org.xmldb.api.base.Collection estateFileCollection)
                             throws ImmoToolDbException
Throws:
ImmoToolDbException

loadEstateCollection

protected org.xmldb.api.base.Collection loadEstateCollection()
                                                      throws ImmoToolDbException
Throws:
ImmoToolDbException

loadEstateIds

protected Long[] loadEstateIds(org.xmldb.api.base.Collection estateCollection)
                        throws ImmoToolDbException
Throws:
ImmoToolDbException

save

public void save(Properties props)

setAddressPublishing

public void setAddressPublishing(String val)

setAllImagesExported

public void setAllImagesExported(boolean val)

setFullTransportWarningShown

protected void setFullTransportWarningShown(boolean val)

setIdPrefix

public void setIdPrefix(String val)

setImageCount

public void setImageCount(Integer val)

setImageMode

public void setImageMode(String val)

setIncremental

public void setIncremental(boolean val)

setLanguage

public void setLanguage(Locale val)

setScaleImageHeight

public void setScaleImageHeight(Integer val)

setScaleImageWidth

public void setScaleImageWidth(Integer val)

setScaleImages

public void setScaleImages(boolean val)

setUnpublishedAddressHidden

public void setUnpublishedAddressHidden(boolean unpublishedAddressHidden)

setVideoCount

public void setVideoCount(Integer val)

setWatermark

public void setWatermark(boolean watermark)

setWatermarkAlpha

public void setWatermarkAlpha(Integer val)

setWatermarkHeight

public void setWatermarkHeight(Integer val)

setWatermarkPosition

public void setWatermarkPosition(String val)

setWatermarkWidth

public void setWatermarkWidth(Integer val)

setZipped

public void setZipped(boolean val)

supportsEstateType

public boolean supportsEstateType(String estateType,
                                  String estateAction)

supportsIncrementalUpdate

public abstract boolean supportsIncrementalUpdate()


Copyright © 2012 OpenEstate. All Rights Reserved.