ePages 6.11.0 - DE_EPAGES/FactFinder/API/FactFinder.pm

Package DE_EPAGES::FactFinder::API::FactFinder

some helper functions

@EXPORT_OK
InitShop
DeleteShop
CreateUser
DeleteUser
GetAllUsers
UpdateUser
ExistsUser
CreateChannel
DeleteChannel
GetAllChannels
ExistsChannel
GetVisibleLanguages
UploadFile
TriggerExtraSchedule
IsTriggerExtraScheduleAllowed
SanityCheck
GetRecommendation
GetProductsFromSearchResult
BuildMatrix

Functions

BuildMatrix
CreateChannel
CreateUser
DeleteChannel
DeleteShop
DeleteUser
ExistsChannel
ExistsUser
GetAllChannels
GetAllUsers
GetProductsFromSearchResult
GetRecommendation
GetVisibleLanguages
InitShop
IsTriggerExtraScheduleAllowed
SanityCheck
TriggerExtraSchedule
UpdateUser
UploadFile

BuildMatrix

Rebuilds recommendation engine matrix

Syntax
BuildMatrix( $Shop, $Channel, $Remote );
Input
$Shop (object)
shop
$Channel (object)
factfinder channel
$Remote (object (optional))
RemoteFactFinder

CreateChannel

Creates a factfinder channel remote and locally in the db

Syntax
$Channel = $Object->CreateChannel( $Shop, $Language, $Folder, $Remote );
Input
$Shop (object)
Shop
$Language (hash.ref)
Language
$Folder (object (optional))
Folder to save the channel to
$Remote (object (optional))
RemoteFactFinder
Return
$Channel (object)
Channel

CreateUser

Creates a FACT-Finder User

Syntax
CreateUser($Shop);
Input
$Shop (object)
shop
Return
$hUserData (hash.ref)
created user data. Keys are:
  • FactFinder_Account
  • FactFinder_PasswordMD5
  • DeleteChannel

    Deletes a remote channel

    Syntax
    $Object->DeleteChannel( $Shop, $Channel, $Remote);
    Example
    $Object->DeleteChannel( $Shop, $Channel );
    Input
    $Shop (object)
    Shop
    $Channel (object)
    Channel
    $Remote (object (optional))
    RemoteFactFinder

    DeleteShop

    Removes FACT-FINDER account from shop.

    Syntax
    DeleteShop( $Shop );
    Input
    $Shop (object)
    Shop

    DeleteUser

    deletes a remote user

    Syntax
    $Object->DeleteUser( $Shop, $Remote);
    Example
    $Object->DeleteUser( $Shop, $Remote );
    Input
    $Shop (ref.array)])
    Shop | object [ElementOf(boolean|integer|String|object|ref.hash
    $Remote (ref.array)])
    RemoteFactFinder | object (optional) [ElementOf(boolean|integer|String|object|ref.hash

    ExistsChannel

    Checks if a channel exists.

    Syntax
    $Exists = ExistsChannel( $Shop, $Remote );
    Input
    $Shop (object)
    Shop
    $Remote (object (optional))
    RemoteFactFinder
    Return
    $Exists (boolean)
    True if channel exists, else false

    ExistsUser

    Get FACT-Finder Userlist

    Syntax
    ExistsUser( $Shop, $Remote );
    Input
    $Shop (object (optional))
    shop
    $Remote (object (optional))
    RemoteFactFinder
    Return
    $Exists (boolean)
    true if user exists, else false

    GetAllChannels

    Lists all remote channels

    Syntax
    $List = GetAllChannels( $Shop, $Remote );
    Input
    $Shop (object)
    Shop
    $Remote (object (optional))
    RemoteFactFinder
    Return
    $aChannels (array.ref)
    list of channels

    GetAllUsers

    Get FACT-Finder Userlist

    Syntax
    GetAllUsers( $Shop, $Remote);
    Example
    $Users = GetAllUsers( $Shop, $Remote );
    Input
    $Shop (object (optional))
    shop
    $Remote (object (optional))
    RemoteFactFinder
    Return
    $Users (ref.array.object (SOM-Tree))
    user list

    GetProductsFromSearchResult

    Returns an array of products (tle-hashed) for use in SF

    Syntax
    GetProductsFromSearchResult( $Shop, $aRecord );
    Input
    $Shop (object)
    shop
    $aRecords (array.ref)
    XML Record structure
    Return
    $aProducts (array.ref.hash)
    product array (tle-hashed)

    GetRecommendation

    gets product list from FACT-Finder recommendation engine.

    Syntax
    GetRecommendation( $Product, $Channel );
    Input
    $Product (object)
    product
    $Channel (object)
    factfinder channel
    $Remote (object (optional))
    RemoteFactFinder
    Return
    $aProductList (array.ref)
    array of tle-hashed products

    GetVisibleLanguages

    returns the locales selected in the shop

    Syntax
    GetVisibleLanguages($Shop);
    Input
    $Shop
    the shop
    Return
    $Result (array.ref)
    array ref to the languages

    InitShop

    Initializes Shop for FACT-FINDER

    Syntax
    InitShop( $Shop );
    Input
    $Shop (object)
    Shop
    $IsPremium (boolean)
    initialize as premium
    Return
    $Initialized (integer)
    0 if nothing done , 1 if initialization done

    IsTriggerExtraScheduleAllowed

    Returns true if an extra schedule can be triggered

    Syntax
    $Object->IsTriggerExtraScheduleAllowed( $Shop, $Input2);
    Input
    $Shop (object)
    shop
    Return
    $IsAllowed (boolean)
    trigger extra schedule allowed

    SanityCheck

    Check if all necessary system vars are set. If not the Error('RequiredValueMissing') is thrown.

    Syntax
    SanityCheck( );
    Return
    $Ok (boolean)
    true if ok

    TriggerExtraSchedule

    Mark shop for extra export scheduler

    Syntax
    TriggerExtraSchedule( $Shop );
    Input
    $Shop (object)
    Shop

    UpdateUser

    Update user permissions after a change in the channel list.

    Syntax
    UpdateUser($Shop, $Remote)
    Input
    $Shop (object (optional))
    shop
    $Remote (object (optional))
    RemoteFactFinder

    UploadFile

    Upload product export file

    Syntax
    $Object->UploadFile( $Shop, $Channel);
    Input
    $Shop (object)
    Shop
    $Channel (object)
    channel
    $FileURL (string)
    file url
    $Remote (object (optional))
    remote factfinder