ePages 6.11.0 - DE_EPAGES/ProductPortal/API/CSV/PortalExportDriver.pm

Package DE_EPAGES::ProductPortal::API::CSV::PortalExportDriver

This module implements a csv driver to export object portal products

Base
DE_EPAGES::Presentation::API::CSV::MonitoredExportDriver;
Example
use DE_EPAGES::ProductPortal::API::CSV::PortalExportDriver;

my $Driver = DE_EPAGES::ProductPortal::API::CSV::PortalExportDriver->new(
    Handler => $Handler
);
$Driver->($FileName, $hFileFormat, $aColumnNames, $ViewObject);

Functions

allProducts
currencyID
dayUnitName
deliveryPeriod
descriptionAttribute
drive
exportCSV
exportLine
formatPrice
getExportValues
imageAttribute
imageUrl
isProductValidPortal
isProductValidPortalExt1
items
languageID
portalSite
productPrice
productUrl
removeHtmlTags
shippingMethod
shippingPrice
startMonitor
taxModel
useAddToBasket
writeHeader

allProducts

Returns the product identifiers to be exported. If the option "ExportAllVariation" is selected all SubProducts of a MasterProduct are exported, else only default SubProducts are exported.

Syntax
$aProductIDs = $self->allProducts;
Return
$aProductIDs (ref.array.int)
product identifier

currencyID

Exports to site of portal.

Syntax
$CurrencyID = $self->currencyID;
Return
$CurrencyID (object)
Portal site

dayUnitName

returns the name of the time unit day in the current language the value is being cached

Syntax
my $name = dayUnitName;
Output
$dayUnitName (string)
localized name of the time unit day

deliveryPeriod

returns the delivery period followed by the localized name of the time unit day

Syntax
$Period = deliveryPeriod($Product);
Input
$Product (object)
product
Return
$DeliveryPeriod (string)
deliveryperiod

descriptionAttribute

used description attribute of portal config.

Syntax
$DescriptionAttribute = $self->descriptionAttribute;
Return
$DescriptionAttribute (string)
description attribute

drive

Overwrite standard drive methode to start monitor 'PortalMonitor'.

Syntax
$self->drive($aObjects);

exportCSV

starts the csv export

Syntax
$self->exportCSV($FileName, $hFileFormat, $aColumnNames, $ViewObject, $NoMonitor);
Input
$FileName (string)
export to file
$hFileFormat (ref.hash)
file format DE_EPAGES::Presentation::API::CSV::MonitoredExportDriver::exportCSV
$aColumnNames (ref.array.string)
name of column
$ViewObject (PortalConfig)
export based on this object
$NoMonitor (boolean)
deactivate monitor, eg. for scripts/scheduler

exportLine

Export one line, increments monitor.

Syntax
$aProductIDs = $self->exportLine;

formatPrice

formats prices (from shipping or products) to portal specific format.

Syntax
$FormattedValue = $self->formatPrice($Value);
Example
$FormattedShippingValue = $self->formatPrice($self->shippingPrice($Product));
Input
$Value (float)
price
Return
$FormattedValue (string)
formatted price

getExportValues

helper method of exportLine to convert column names to methods names of this exporter and calls the method to get the values of the exported object. The order of return values depends on order of column names.

Syntax
$self->getExportValues($Object);
Return
$aValues (ref.array.string)
list of values

imageAttribute

used image attribute of portal config.

Syntax
$ImageAttribute = $self->imageAttribute;
Return
$ImageAttribute (string)
image attribute

imageUrl

Returns url to product image.

Syntax
$URL = $self->imageUrl($Product, $ImageAttribute);
Example
$URL = $self->imageUrl($Product, $self->imageAttribute);
Return
$URL (string)
image url

isProductValidPortal

Throws error if not valid, (not visible).

Syntax
$self->isProductValidPortal;

isProductValidPortalExt1

Throws error if not valid (not visible, no name or no price).

Syntax
$self->isProductValidPortalExt1;

items

Returns all product identifier of portal config, initialize monitor.

Syntax
$aProductIDs = $self->items;
Return
$aProductIDs (ref.array.int)
product identifier

languageID

Exports to site of portal.

Syntax
$LanguageID = $self->languageID;
Return
$LanguageID (object)
language

portalSite

Exports to site of portal.

Syntax
$PortalSite = $self->portalSite;
Return
$PortalSite (object)
Portal site

productPrice

get price of product with vars of portal config.

Syntax
$Value = $self->productPrice($Product);
Return
$Value (float)
price

productUrl

Returns url to product.

Syntax
$URL = $self->productUrl($Product);
Return
$URL (string)
product url

removeHtmlTags

Removes all html tags and consolidates spaces. Removes newlines after converting.

Syntax
my $NoHtml = $self->removeHtmlTags($HTML);
Input
$HTML (string)
html string
Return
$NoHtml (string)
string without html tags

shippingMethod

used shipping method of portal config.

Syntax
$ShippingMethod = $self->shippingMethod;
Return
$ShippingMethod (object)
shipping method

shippingPrice

get shipping price for product with vars of portal config.

Syntax
$Value = $self->shippingPrice($Product);
Return
$Value (float)
price

startMonitor

starts the monitor (if plain "\rexport products (%d / %d)")

Syntax
$self->startMonitor($PageTypeName);
Input
$PageTypeName (string)
name of pagetype

taxModel

Tax model used for export.

Syntax
$TaxModel = $self->taxModel;
Return
$TaxModel (int)
tax model

useAddToBasket

use add to basket link.

Syntax
$UseAddToBasket = $self->useAddToBasket;
Return
$UseAddToBasket (boolean)
use add to basket link

writeHeader

Writes the header line using the attribute names of the columns.

Syntax
$self->writeHeader();