Overview

Namespaces

  • Apptus
    • ESales
      • Connector
        • Report
        • Time
    • Util
      • Cache
  • PHP

Classes

  • Ad
  • Ads
  • ArgMap
  • Attribute
  • AttributeValidation
  • Authorization
  • Category
  • CategoryData
  • CategoryList
  • CategoryNode
  • CloudConnector
  • ClusterUriIterator
  • Completion
  • Completions
  • CompressionMode
  • Connector
  • ConnectorSettingsBuilder
  • Correction
  • Corrections
  • Count
  • CssClass
  • CustomerKeyAuthentication
  • DynamicPage
  • EventDataJobResult
  • FacetList
  • FacetRange
  • Facets
  • Filter
  • FilterBuilder
  • ImportData
  • JavaScriptNotifier
  • MessageAuthentication
  • OnPremConnector
  • Order
  • OrderLine
  • Panel
  • PanelContent
  • Path
  • Phrase
  • Phrases
  • Product
  • Products
  • Reporter
  • ResultType
  • Session
  • Status
  • Subpanel
  • Value
  • Values
  • Variant

Interfaces

  • Facet
  • Result

Exceptions

  • BusyClusterException
  • ClusterUnavailableException
  • DuplicateSubpanelException
  • FetchClusterException
  • IOException
  • MalformedJsonException
  • MalformedURLException
  • MissingSubpanelException
  • PanelException
  • ParseException
  • ReportException
  • RequestFailedException
  • ResultTypeException
  • Overview
  • Namespace
  • Class
  • Tree

Class Connector

Abstract super class for Apptus\ESales\Connector\CloudConnector and Apptus\ESales\Connector\OnPremConnector.

Imports can be carried out using the import* methods such as Apptus\ESales\Connector\Connector::importConfiguration().
Exports can in a similar manner be done with the export* methods such as Apptus\ESales\Connector\Connector::exportConfiguration().

The XML data formats are documented in the section Importing data on Apptus Zone (http://zone.apptus.com).
The format for configuration and panels isn't documented publicly. They are generated by eSales Manager and these exports and imports should be used for backup and migration only. Manually editing these files isn't supported and should not be done.

The procedure for imports can be found in the eSales tutorial on Apptus Zone (http://zone.apptus.com).

Use the Apptus\ESales\Connector\Connector::session() method to get Apptus\ESales\Connector\Session instances. These are used to notify eSales and query panels. View the Apptus\ESales\Connector\Session documentation for details.

Direct known subclasses

Apptus\ESales\Connector\CloudConnector, Apptus\ESales\Connector\OnPremConnector
Abstract
Namespace: Apptus\ESales\Connector
See: Apptus\ESales\Connector\CloudConnector
See: Apptus\ESales\Connector\OnPremConnector
Located at Connector/Connector.php
Methods summary
final public Apptus\ESales\Connector\Session
# session( string $sessionKey, string $customerKey = null, string $market = null )

Gets a session for the specified session key.

Gets a session for the specified session key.

Calling this method does not affect the session in the eSales server. A notification or panel query on the object created by this method, is necessary for the properties to stick to the session.

When calling this method with null in place of customerKey and/or market, the server will keep the current values of these properties for this session.

Parameters

$sessionKey
session key to identify the session.
$customerKey
customer key for the session.
$market
market for the session.

Returns

Apptus\ESales\Connector\Session
A new Session.

Throws

InvalidArgumentException
public string
# status( )

Return a status report from the eSales cluster as a string with an XML document.

Return a status report from the eSales cluster as a string with an XML document.

Returns

string
The status report in XML.

Throws

Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
public Apptus\ESales\Connector\EventDataJobResult
# createRemoveCustomerDataJob( string $customerKey )

Start a GDPR job on the cluster to remove all data related to the given customer key.

Start a GDPR job on the cluster to remove all data related to the given customer key.

Data will be removed both from memory and disk. "Linked" customer keys will also be removed (i.e. customer keys that have been notified in the same session).

Parameters

$customerKey
The customer key to remove.

Returns

Apptus\ESales\Connector\EventDataJobResult
An object containing the job ID of the created job.

Throws

Apptus\ESales\Connector\IOException
public Apptus\ESales\Connector\EventDataJobResult
# createExportCustomerDataJob( string $customerKey )

Start a GDPR job on the cluster to export all data related to the given customer key.

Start a GDPR job on the cluster to export all data related to the given customer key.

"Linked" customer keys will also be exported (i.e. customer keys that have been notified in the same session). Status of the job can be checked with Apptus\ESales\Connector\Connector::checkCustomerDataJobStatus() and when the status is Status::DONE, the resulting zip file can be downloaded using Apptus\ESales\Connector\Connector::downloadExportCustomerDataJobResult().

Parameters

$customerKey
The customer key to export.

Returns

Apptus\ESales\Connector\EventDataJobResult
An object containing the job ID of the created job.

Throws

Apptus\ESales\Connector\IOException
public Apptus\ESales\Connector\EventDataJobResult
# checkCustomerDataJobStatus( string $jid )

Check the status of a GDPR customer data job.

Check the status of a GDPR customer data job.

Parameters

$jid
The job ID.

Returns

Apptus\ESales\Connector\EventDataJobResult
An object containing the status of the job.

Throws

Apptus\ESales\Connector\IOException
Apptus\ESales\Connector\ClusterUnavailableException
public An
# downloadExportCustomerDataJobResult( string $jid )

Download the result of a GDPR export customer data job.

Download the result of a GDPR export customer data job.

Parameters

$jid
The job ID.

Returns

An
InputStream with the resulting zip file.

Throws

Apptus\ESales\Connector\ClusterUnavailableException
public integer
# downloadExportCustomerDataJobResultToDestination( string $jid, destination $destination )

Download the result of a GDPR export customer data job.

Download the result of a GDPR export customer data job.

Parameters

$jid
The job ID.
$destination
to save the resulting zip file.

Returns

integer
The number of bytes downloaded.

Throws

Apptus\ESales\Connector\IOException
Apptus\ESales\Connector\ClusterUnavailableException
final public
# importProducts( resource|string $importFile, string $name = null, boolean $force = null )

Imports products from the specified file or string to the eSales cluster.

Imports products from the specified file or string to the eSales cluster.

Parameters

$importFile
opened file or a string with the XML.
$name
unique identifier for the request. If null, a generated id will be used.
$force

the import should be forced through even if it is considered dangerous (e.g. if it drastically reduces the product count). Setting this to false or null will cause dangerous imports to be rejected with an exception, while true will suppress the rejection and let the import go through.

Throws

Apptus\ESales\Connector\IOException
if the file could not be read.
Apptus\ESales\Connector\BusyClusterException
if the cluster is busy with another task
Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
final public
# importPanels( resource|string $importFile, string $name = null )

Imports panels from the specified file or string to the eSales cluster.

Imports panels from the specified file or string to the eSales cluster.

Parameters

$importFile
opened file or a string with the XML.
$name
unique identifier for the request. If null, a generated id will be used.

Throws

Apptus\ESales\Connector\IOException
if the file could not be read.
Apptus\ESales\Connector\BusyClusterException
if the cluster is busy with another task
Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
final public
# importConfiguration( resource|string $importFile, string $name = null )

Imports configuration from the specified file or string to the eSales cluster.

Imports configuration from the specified file or string to the eSales cluster.

Parameters

$importFile
opened file or a string with the XML.
$name
unique identifier for the request. If null, a generated id will be used.

Throws

Apptus\ESales\Connector\IOException
if the file could not be read.
Apptus\ESales\Connector\BusyClusterException
if the cluster is busy with another task
Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
final public
# importSynonyms( resource|string $importFile, string $name = null )

Imports synonyms from the specified file to the eSales cluster.

Imports synonyms from the specified file to the eSales cluster.

Parameters

$importFile
opened file or a string with the XML.
$name
unique identifier for the request. If null, a generated id will be used.

Throws

Apptus\ESales\Connector\IOException
if the file could not be read.
Apptus\ESales\Connector\BusyClusterException
if the cluster is busy with another task
Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
final public
# importAds( resource|string $importFile, string $name = null )

Imports ads from the specified file to the eSales cluster.

Imports ads from the specified file to the eSales cluster.

Parameters

$importFile
opened file or a string with the XML.
$name
unique identifier for the request. If null, a generated id will be used.

Throws

Apptus\ESales\Connector\IOException
if the file could not be read.
Apptus\ESales\Connector\BusyClusterException
if the cluster is busy with another task
Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
final public integer|string
# exportProducts( resource|string|null $dest = null )

Exports everything from the eSales cluster as an update file.

Exports everything from the eSales cluster as an update file.

Parameters

$dest
opened destination file or a string with a filename.

Returns

integer|string
The number of bytes written or the XML string itself if no file was given.

Throws

Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
Apptus\ESales\Connector\IOException
if the file could not be written to.
final public integer|string
# exportPanels( resource|string|null $dest = null )

Exports panels from the eSales cluster to a definition file.

Exports panels from the eSales cluster to a definition file.

Parameters

$dest
opened destination file or a string with a filename.

Returns

integer|string
The number of bytes written or the XML string itself if no file was given.

Throws

Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
Apptus\ESales\Connector\IOException
if the file could not be written to.
final public integer|string
# exportConfiguration( resource|string|null $dest = null )

Exports configuration from the eSales cluster to an update file.

Exports configuration from the eSales cluster to an update file.

Parameters

$dest
opened destination file or a string with a filename.

Returns

integer|string
The number of bytes written or the XML string itself if no file was given.

Throws

Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
Apptus\ESales\Connector\IOException
if the file could not be written to.
final public integer|string
# exportSynonyms( resource|string|null $dest = null )

Exports synonyms from the eSales cluster as an update file.

Exports synonyms from the eSales cluster as an update file.

Parameters

$dest
opened destination file or a string with a filename.

Returns

integer|string
The number of bytes written or the XML string itself if no file was given.

Throws

Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
Apptus\ESales\Connector\IOException
if the file could not be written to.
final public integer|string
# exportAds( resource|string|null $dest = null )

Exports ads from the eSales cluster as an update file.

Exports ads from the eSales cluster as an update file.

Parameters

$dest
opened destination file or a string with a filename.

Returns

integer|string
The number of bytes written or the XML string itself if no file was given.

Throws

Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
Apptus\ESales\Connector\IOException
if the file could not be written to.
public array
# availableMarkets( )

Returns a list of available markets from the eSales cluster. Never returns null.

Returns a list of available markets from the eSales cluster. Never returns null.

Returns

array
An indexed array of markets.

Throws

Apptus\ESales\Connector\RequestFailedException
public Apptus\ESales\Connector\Reporter
# reporter( string $market, Apptus\ESales\Connector\Time\TimeInterval $interval )

Creates a reporter for a market during a specified time interval.

Creates a reporter for a market during a specified time interval.

The reporter can be used to fetch reports from the eSales cluster.

Parameters

$market
market for the reports.
$interval
time interval to fetch reports for.

Returns

Apptus\ESales\Connector\Reporter
A Reporter object that can be used to fetch reports.
public Apptus\ESales\Connector\Reporter
# reporterForUnknownMarket( Apptus\ESales\Connector\Time\TimeInterval $interval )

Creates a reporter for the unknown market (sessions without a market property), during a specified time interval.

Creates a reporter for the unknown market (sessions without a market property), during a specified time interval.

The reporter can be used to fetch reports from the eSales cluster.

Parameters

$interval
time interval for the reports.

Returns

Apptus\ESales\Connector\Reporter
A Reporter object that can be used to fetch reports.
public string
# latestNotifications( string $type = null )

Return the last 100 notifications received by the eSales cluster.

Return the last 100 notifications received by the eSales cluster.

Parameters

$type
of notification to fetch. If null all types of notifications will be included.

Returns

string
A string containing the last 100 notifications

Throws

Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
public string
# serverLog( integer $index, string $name )

Gets a log from a server. Server index should be an index in the range [0, number_of_servers - 1]. The servers are indexed in the same order as they appear in the cluster string. The server indexes can also be retrieved from the status command. Name is the name of a log. Available log names can be retrieved from Apptus\ESales\Connector\Connector::serverLogNames().

Gets a log from a server. Server index should be an index in the range [0, number_of_servers - 1]. The servers are indexed in the same order as they appear in the cluster string. The server indexes can also be retrieved from the status command. Name is the name of a log. Available log names can be retrieved from Apptus\ESales\Connector\Connector::serverLogNames().

Parameters

$index
An index in the range [0, number of servers - 1]
$name
The name of the log to be retrieved.

Returns

string
The log as a string

Throws

Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
public array
# serverLogNames( )

Gets a list of available log names.

Gets a list of available log names.

Returns

array
A list of available log names.

Throws

Apptus\ESales\Connector\RequestFailedException
if the request to the cluster fails.
public static string
# getVersion( )

Gets connector version.

Gets connector version.

Returns

string
Connector version.
Apptus ESales Connector PHP API documentation generated by ApiGen