Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLAT-25025: New RSVP UserEntry Type #13142

Merged
merged 1 commit into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions configurations/plugins.template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ CaptionAssetEventNotifications
AttachmentAssetEventNotifications
TranscriptAssetEventNotifications
DropFolderEventNotifications
ScheduleEventNotifications
Kontiki
Velocix
Wowza
Expand Down Expand Up @@ -146,3 +147,4 @@ Interactivity
;Room
VirtualEvent
;SessionCuePoint
Rsvp
78 changes: 78 additions & 0 deletions plugins/rsvp/RvspPlugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php
/**
* Plugin enabling the storage of entries that relates to a user attending a session
* @package plugins.rsvp
*/

class RsvpPlugin extends KalturaPlugin implements IKalturaPermissions, IKalturaEnumerator, IKalturaObjectLoader
{
const PLUGIN_NAME = 'rsvp';

/* (non-PHPdoc)
* @see IKalturaPlugin::getPluginName()
*/
public static function getPluginName()
{
return self::PLUGIN_NAME;
}

/* (non-PHPdoc)
* @see IKalturaPermissions::isAllowedPartner()
*/
public static function isAllowedPartner($partnerId)
{
return true;
}

/* (non-PHPdoc)
* @see IKalturaEnumerator::getEnums()
*/
public static function getEnums($baseEnumName = null)
{
if (is_null($baseEnumName))
{
return array('RsvpUserEntryType');
}
if ($baseEnumName === 'UserEntryType')
{
return array('RsvpUserEntryType');
}
return array();
}

public static function getRsvpUserEntryTypeCoreValue($valueName)
{
$value = self::getApiValue($valueName);
return kPluginableEnumsManager::apiToCore('UserEntryType', $value);
}

/**
* @return string external API value of dynamic enum.
*/
public static function getApiValue($valueName)
{
return self::getPluginName() . IKalturaEnumerator::PLUGIN_VALUE_DELIMITER . $valueName;
}

public static function loadObject($baseClass, $enumValue, array $constructorArgs = null)
{
if (($baseClass === 'KalturaUserEntry') && ($enumValue == self::getRsvpUserEntryTypeCoreValue(RsvpUserEntryType::RSVP)))
{
return new KalturaRsvpUserEntry();
}
if (($baseClass === 'UserEntry') && ($enumValue == self::getRsvpUserEntryTypeCoreValue(RsvpUserEntryType::RSVP)))
{
return new RsvpUserEntry();
}
return null;
}

public static function getObjectClass($baseClass, $enumValue)
{
if ($baseClass === 'UserEntry' && $enumValue == self::getRsvpUserEntryTypeCoreValue(RsvpUserEntryType::RSVP))
{
return RsvpUserEntry::RSVP_OM_CLASS;
}
return null;
}
}
22 changes: 22 additions & 0 deletions plugins/rsvp/lib/api/KalturaRsvpUserEntry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php
/**
* @package plugins.rsvp
* @subpackage api
* @relatedService UserEntryService
*/

class KalturaRsvpUserEntry extends KalturaUserEntry
{
/* (non-PHPdoc)
* @see KalturaObject::toObject()
*/
public function toObject($dbObject = null, $propertiesToSkip = array())
{
if (is_null($dbObject))
{
$dbObject = new RsvpUserEntry();
}

return parent::toObject($dbObject, $propertiesToSkip);
}
}
20 changes: 20 additions & 0 deletions plugins/rsvp/lib/api/filters/KalturaRsvpUserEntryFilter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
/**
* @package plugins.rsvp
* @subpackage api.filters
*/

class KalturaRsvpUserEntryFilter extends KalturaRsvpUserEntryBaseFilter
{
public function getListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null)
{
$this->typeEqual = RsvpPlugin::getApiValue(RsvpUserEntryType::RSVP);
$response = parent::getListResponse($pager, $responseProfile);
return $response;
}

public function getCoreFilter()
{
return new RsvpUserEntryFilter();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* @package plugins.rsvp
* @relatedService UserEntryService
* @subpackage api.filters.base
* @abstract
*/

abstract class KalturaRsvpUserEntryBaseFilter extends KalturaUserEntryFilter
{
static private $map_between_objects = array
(
);

static private $order_by_map = array
(
);

public function getMapBetweenObjects()
{
return array_merge(parent::getMapBetweenObjects(), self::$map_between_objects);
}

public function getOrderByMap()
{
return array_merge(parent::getOrderByMap(), self::$order_by_map);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
/**
* @package plugins.rsvp
* @subpackage api.filters.enum
*/

class KalturaRsvpUserEntryOrderBy extends KalturaUserEntryOrderBy
{
}
16 changes: 16 additions & 0 deletions plugins/rsvp/lib/model/RsvpUserEntry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php
/**
* @package plugins.rsvp
* @subpackage model
*/

class RsvpUserEntry extends UserEntry
{
const RSVP_OM_CLASS = 'RsvpUserEntry';

public function __construct()
{
$this->setType(RsvpPlugin::getRsvpUserEntryTypeCoreValue(RsvpUserEntryType::RSVP));
parent::__construct();
}
}
30 changes: 30 additions & 0 deletions plugins/rsvp/lib/model/enums/RsvpUserEntryType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php
/**
* @package plugins.rsvp
* @subpackage model.enum
*/

class RsvpUserEntryType implements IKalturaPluginEnum, UserEntryType
{
const RSVP = 'RSVP';

/* (non-PHPdoc)
* @see IKalturaPluginEnum::getAdditionalValues()
*/
public static function getAdditionalValues()
{
return array(
'RSVP' => self::RSVP,
);
}

/* (non-PHPdoc)
* @see IKalturaPluginEnum::getAdditionalDescriptions()
*/
public static function getAdditionalDescriptions()
{
return array(
self::RSVP => 'RSVP User Entry Type',
);
}
}
10 changes: 10 additions & 0 deletions plugins/rsvp/lib/model/filters/RsvpUserEntryFilter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
/**
* @package plugins.rsvp
* @subpackage model.filters
*/

class RsvpUserEntryFilter extends UserEntryFilter
{

}
11 changes: 11 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Ursa-21.10.0
## Rsvp Plugin ##
* Issue Type: Task
* Issue ID: PLAT-25025

### Configuration ###
To enable this plugin add the following to your plugins.ini file:

- Rsvp

### Deployment ###
php /opt/kaltura/app/deployment/base/scripts/installPlugins.php

## Enable ScheduleEventNotificationPlugin
- Issue Type: Task
Expand Down