ePages 6.10 - 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
CountAttributes
GetVisibleLanguages
ShowAttribute
UploadFile
TriggerExtraSchedule
IsTriggerExtraScheduleAllowed
SanityCheck

Functions

CountAttributes
CreateChannel
CreateUser
DeleteChannel
DeleteShop
DeleteUser
ExistsChannel
ExistsUser
GetAllChannels
GetAllUsers
GetVisibleLanguages
InitShop
IsTriggerExtraScheduleAllowed
SanityCheck
ShowAttribute
TriggerExtraSchedule
UpdateUser
UploadFile

CountAttributes

Returns the number of attributes for a product type, which could be shown to the handler for selection

Syntax
CountAttributes($ProductTypeID);
Input
$ProductTypeID
the producttype id
Return
$count

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

    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

    ShowAttribute

    checks if the attribute should be shown

    Syntax
    ShowAttribute($ProductTypeID,$AttributeID);
    Input
    $ProductTypeID
    the producttype id
    $AttributeID
    the attribute id
    $DifferentTypes
    if the attribute is defined in a different type
    (0 means that only the current type's attribute
    will be shown)
    $Visibility
    if the visibility should be tested
    Return
    (0\1)

    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