ePages 6.11.0 - DE_EPAGES/Presentation/API/History.pm

Package DE_EPAGES::Presentation::API::History

Implements helper functions for the event history and favorites. Use the TLE function DE_EPAGES::Presentation::API::TLE::HistoryHandler::SaveHistory to add new history entries from within a template. Use the ChangeAction CopyHistoryToFavorite to convert a history entry to a favorite.

@EXPORT_OK
InsertHistory
GetHistory
GetFavorites
ReplaceHistory
GetHistoryName

Functions

GetFavorites
GetHistory
InsertHistory
ReplaceHistory

GetFavorites

Returns the list of favorites of the user. If the user currently has more than $MaxEntries favorites, then the oldest entries are deleted until the number of favorites is $MaxEntries.

Syntax
$ahFavorites = GetFavorites($UserID);
$ahFavorites = GetFavorites($UserID, $MaxEntries);
Input
$UserID (int)
user identifier
$MaxEntries (int)
maximum count of entries (optional)
Return
$ahFavorites (reference to array of hashes)
favorite events with following keys:
  • EventFavoriteID - view anchor indentifier (primary key)- int
  • ObjectID - object id (optional)- int
  • UserID - user id - int
  • Name - title or name of page - nvarchar(255)
  • URI - Uniform Resource Identifiers of get request - varchar(500)

GetHistory

Returns objects of EventHistory by alternate key SessionID. Deletes old history events if the number is larger than $MaxEntries.

Syntax
$ahEvents = GetHistory($SessionID, $MaxEntries);
Input
$SessionID (int)
internal session id
$MaxEntries (int)
maximum count of entries (optional, default=10)
Return
$ahEvents (reference to array of hashes)
with following keys:
  • EventHistoryID - view history indentifier (primary key)- int
  • SessionID - internal session id - int
  • Name - title or name of page - nvarchar(255)
  • ObjectID - object id (optional)- int
  • URI - Uniform Resource Identifiers of get request - varchar(500)

InsertHistory

Creates an entry of EventHistory.

Syntax
$EventHistoryID = InsertHistory($hEventHistory);
Input
$hEventHistory (reference to hash)
with following keys:
  • EventHistoryID - view anchor indentifier (primary key)(optional)- int
  • ObjectID - object id (optional)- int
  • IntSessionID - internal session id - int
  • Name - title or name of page (optional)- nvarchar(255)
  • URI - Uniform Resource Identifiers of get request - varchar(500)
Return
$EventHistoryID (int)
view anchor indentifier (primary key)

ReplaceHistory

Replaces EventFavorite and EventHistory of old object with entries of new object. This function replaces only the object id in the URI (no names or path infos).

Syntax
ReplaceHistory($OldObject, $NewObject);
Input
$OldObject (object)
old object
$NewObject (object)
new object