public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     myPartnerUtils::addPartnerToCriteria(new CuePointPeer(), $this->getPartnerId(), $this->private_partner_data, $this->partnerGroup());
     // when session is not admin, allow access to user entries only
     if (!$this->getKs() || !$this->getKs()->isAdmin()) {
         CuePointPeer::setDefaultCriteriaFilterByKuser();
     }
     if (!CuePointPlugin::isAllowedPartner($this->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::SERVICE_FORBIDDEN, $this->serviceName . '->' . $this->actionName);
     }
 }
Beispiel #2
0
 public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     $this->applyPartnerFilterForClass('CuePoint');
     // when session is not admin, allow access to user entries only
     if (!$this->getKs() || !$this->getKs()->isAdmin()) {
         KalturaCriterion::enableTag(KalturaCriterion::TAG_USER_SESSION);
         CuePointPeer::setUserContentOnly(true);
     }
     if (!CuePointPlugin::isAllowedPartner($this->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::FEATURE_FORBIDDEN, CuePointPlugin::PLUGIN_NAME);
     }
     if (!$this->getPartner()->getEnabledService(PermissionName::FEATURE_KALTURA_LIVE_STREAM)) {
         throw new KalturaAPIException(KalturaErrors::FEATURE_FORBIDDEN, 'Kaltura Live Streams');
     }
 }
Beispiel #3
0
 public function initService($serviceId, $serviceName, $actionName)
 {
     parent::initService($serviceId, $serviceName, $actionName);
     // Play-Server and Media-Server list entries of all partners
     // This is not too expensive as the requests are cached conditionally and performed on sphinx
     $allowedSystemPartners = array(Partner::MEDIA_SERVER_PARTNER_ID, Partner::PLAY_SERVER_PARTNER_ID);
     if (in_array($this->getPartnerId(), $allowedSystemPartners) && $actionName == 'list') {
         myPartnerUtils::resetPartnerFilter('entry');
     } else {
         $this->applyPartnerFilterForClass('CuePoint');
     }
     // when session is not admin, allow access to user entries only
     if (!$this->getKs() || !$this->getKs()->isAdmin()) {
         KalturaCriterion::enableTag(KalturaCriterion::TAG_USER_SESSION);
         CuePointPeer::setUserContentOnly(true);
     }
     if (!CuePointPlugin::isAllowedPartner($this->getPartnerId())) {
         throw new KalturaAPIException(KalturaErrors::FEATURE_FORBIDDEN, CuePointPlugin::PLUGIN_NAME);
     }
 }
    public static function contributeToSchema($type)
    {
        //TBD add thumb asset support to xsd
        $coreType = kPluginableEnumsManager::apiToCore('SchemaType', $type);
        if ($coreType != SchemaType::SYNDICATION && $coreType != CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::SERVE_API) && $coreType != CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::INGEST_API)) {
            return null;
        }
        $xsd = '
		
	<!-- ' . self::getPluginName() . ' -->
	
	<xs:complexType name="T_scene_thumbCuePoint">
		<xs:complexContent>
			<xs:extension base="T_scene">
				<xs:sequence>
					<xs:element name="title" minOccurs="1" maxOccurs="1" type="xs:string"> </xs:element>
					<xs:element name="description" minOccurs="1" maxOccurs="1" type="xs:string"> </xs:element>
					<xs:element name="subType" minOccurs="0" maxOccurs="1" type="KalturaThumbCuePointSubType">
						<xs:annotation>
							<xs:documentation>Indicates the thumb cue point sub type 1 = Slide 2 = Chapter</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element ref="scene-extension" minOccurs="0" maxOccurs="unbounded" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	
	<xs:element name="scene-thumb-cue-point" type="T_scene_thumbCuePoint" substitutionGroup="scene">
		<xs:annotation>
			<xs:documentation>Single thumb cue point element</xs:documentation>
			<xs:appinfo>
				<example>
					<scene-thumb-cue-point sceneId="{scene id}" entryId="{entry id}">
						<sceneStartTime>00:00:05.3</sceneStartTime>
						<tags>
							<tag>my_tag</tag>
						</tags>
					</scene-thumb-cue-point>
				</example>
			</xs:appinfo>
		</xs:annotation>
	</xs:element>
	
		';
        return $xsd;
    }
    public static function contributeToSchema($type)
    {
        $coreType = kPluginableEnumsManager::apiToCore('SchemaType', $type);
        if ($coreType == SchemaType::SYNDICATION || $coreType == CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::SERVE_API)) {
            return '
		
	<!-- ' . self::getPluginName() . ' -->
	
	<xs:complexType name="T_scene_annotation">
		<xs:complexContent>
			<xs:extension base="T_scene">
				<xs:sequence>
					<xs:element name="sceneEndTime" minOccurs="1" maxOccurs="1" type="xs:time">
						<xs:annotation>
							<xs:documentation>Cue point end time</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="sceneText" minOccurs="0" maxOccurs="1" type="xs:string">
						<xs:annotation>
							<xs:documentation>Free text description</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="parent" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>System name of the parent annotation</xs:documentation>
						</xs:annotation>
						<xs:simpleType>
							<xs:restriction base="xs:string">
								<xs:maxLength value="120"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:element>
					<xs:element name="parentId" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>ID of the parent annotation</xs:documentation>
						</xs:annotation>
						<xs:simpleType>
							<xs:restriction base="xs:string">
								<xs:maxLength value="250"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:element>
					
					<xs:element ref="scene-extension" minOccurs="0" maxOccurs="unbounded" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	
	<xs:element name="scene-annotation" type="T_scene_annotation" substitutionGroup="scene">
		<xs:annotation>
			<xs:documentation>Single annotation element</xs:documentation>
			<xs:appinfo>
				<example>
					<scene-annotation sceneId="{scene id}" entryId="{entry id}">
						<sceneStartTime>00:00:05.3</sceneStartTime>
						<tags>
							<tag>sample</tag>
							<tag>my_tag</tag>
						</tags>
						<sceneEndTime>00:00:10</sceneEndTime>
						<sceneText>my annotation</sceneText>
					</scene-annotation>
				</example>
			</xs:appinfo>
		</xs:annotation>
	</xs:element>
		';
        }
        if ($coreType == CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::INGEST_API)) {
            return '
		
	<!-- ' . self::getPluginName() . ' -->
	
	<xs:complexType name="T_scene_annotation">
		<xs:complexContent>
			<xs:extension base="T_scene">
				<xs:sequence>
					<xs:element name="sceneEndTime" minOccurs="1" maxOccurs="1" type="xs:time">
						<xs:annotation>
							<xs:documentation>Cue point end time</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="sceneText" minOccurs="0" maxOccurs="1" type="xs:string">
						<xs:annotation>
							<xs:documentation>Free text description</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:choice minOccurs="0" maxOccurs="1">
						<xs:element name="parent" minOccurs="1" maxOccurs="1">
							<xs:annotation>
								<xs:documentation>System name of the parent annotation</xs:documentation>
							</xs:annotation>
							<xs:simpleType>
								<xs:restriction base="xs:string">
									<xs:maxLength value="120"/>
								</xs:restriction>
							</xs:simpleType>
						</xs:element>
						<xs:element name="parentId" minOccurs="1" maxOccurs="1">
							<xs:annotation>
								<xs:documentation>ID of the parent annotation</xs:documentation>
							</xs:annotation>
							<xs:simpleType>
								<xs:restriction base="xs:string">
									<xs:maxLength value="250"/>
								</xs:restriction>
							</xs:simpleType>
						</xs:element>
					</xs:choice>
					
					<xs:element ref="scene-extension" minOccurs="0" maxOccurs="unbounded" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	
	<xs:element name="scene-annotation" type="T_scene_annotation" substitutionGroup="scene">
		<xs:annotation>
			<xs:documentation>Single annotation element</xs:documentation>
			<xs:appinfo>
				<example title="Single annotation example">
					<scene-annotation entryId="{entry id}">
						<sceneStartTime>00:00:05.3</sceneStartTime>
						<tags>
							<tag>sample</tag>
							<tag>my_tag</tag>
						</tags>
						<sceneEndTime>00:00:10</sceneEndTime>
						<sceneText>my annotation</sceneText>
					</scene-annotation>
				</example>
				<example title="Multiple related annotations example">
					<scene-annotation entryId="{entry id}" systemName="MY_ANNOTATION_PARENT_SYSTEM_NAME">
						<sceneStartTime>00:00:05.3</sceneStartTime>
						<tags>
							<tag>sample</tag>
							<tag>my_tag</tag>
						</tags>
						<sceneEndTime>00:00:10</sceneEndTime>
						<sceneText>my annotation parent</sceneText>
					</scene-annotation>
					<scene-annotation entryId="{entry id}">
						<sceneStartTime>00:00:05.3</sceneStartTime>
						<tags>
							<tag>sample</tag>
							<tag>my_tag</tag>
						</tags>
						<sceneEndTime>00:00:10</sceneEndTime>
						<sceneText>my annotation child</sceneText>
						<parent>MY_ANNOTATION_PARENT_SYSTEM_NAME</parent>
					</scene-annotation>
				</example>
			</xs:appinfo>
		</xs:annotation>
	</xs:element>
		';
        }
        return null;
    }
Beispiel #6
0
 /**
  * @param array<CuePoint> $cuePoints
  * @return string xml
  */
 public static function generateXml(array $cuePoints)
 {
     $schemaType = CuePointPlugin::getApiValue(CuePointSchemaType::SERVE_API);
     $xsdUrl = "http://" . kConf::get('cdn_host') . "/api_v3/service/schema/action/serve/type/{$schemaType}";
     $scenes = new SimpleXMLElement('<scenes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="' . $xsdUrl . '" />');
     $pluginInstances = KalturaPluginManager::getPluginInstances('IKalturaCuePointXmlParser');
     foreach ($cuePoints as $cuePoint) {
         $scene = null;
         foreach ($pluginInstances as $pluginInstance) {
             $scene = $pluginInstance->generateXml($cuePoint, $scenes, $scene);
         }
     }
     $xmlContent = $scenes->asXML();
     $xml = new KDOMDocument();
     libxml_use_internal_errors(true);
     libxml_clear_errors();
     if (!$xml->loadXML($xmlContent)) {
         $errorMessage = kXml::getLibXmlErrorDescription($xmlContent);
         throw new kCuePointException("XML is invalid:\n{$errorMessage}", kCuePointException::XML_INVALID);
     }
     $xsdPath = SchemaService::getSchemaPath($schemaType);
     libxml_clear_errors();
     if (!$xml->schemaValidate($xsdPath)) {
         $errorMessage = kXml::getLibXmlErrorDescription($xmlContent);
         throw new kCuePointException("XML is invalid:\n{$errorMessage}", kCuePointException::XML_INVALID);
     }
     return $xmlContent;
 }
Beispiel #7
0
 public function shouldReIndexEntry(array $modifiedColumns = array())
 {
     //This case handles adding/deleting an existing cue point
     if (!count($modifiedColumns)) {
         return true;
     }
     $indexOnEntryTypes = CuePointPlugin::getIndexOnEntryTypes();
     if (!count($indexOnEntryTypes)) {
         return false;
     }
     if (!in_array($this->getType(), $indexOnEntryTypes)) {
         return false;
     }
     //If modified columns has values we need to check that the fileds updated are the once that should trigger re-in
     $fieldsToMonitor = array(CuePointPeer::TEXT, CuePointPeer::TAGS, CuePointPeer::NAME);
     if (count(array_intersect($fieldsToMonitor, $modifiedColumns)) > 0) {
         return true;
     }
     return false;
 }
Beispiel #8
0
 public static function dependsOn()
 {
     $cuePointDependency = new KalturaDependency(CuePointPlugin::getPluginName());
     $quizDependency = new KalturaDependency(QuizPlugin::getPluginName());
     return array($cuePointDependency, $quizDependency);
 }
    public static function contributeToSchema($type)
    {
        $coreType = kPluginableEnumsManager::apiToCore('SchemaType', $type);
        if ($coreType == SchemaType::SYNDICATION || $coreType == BulkUploadXmlPlugin::getSchemaTypeCoreValue(XmlSchemaType::BULK_UPLOAD_XML) || $coreType == BulkUploadXmlPlugin::getSchemaTypeCoreValue(XmlSchemaType::BULK_UPLOAD_RESULT_XML)) {
            return '
		
	<!-- ' . self::getPluginName() . ' -->
	
	<xs:element name="scene-customData" type="T_customData" substitutionGroup="scene-extension">
		<xs:annotation>
			<xs:documentation>XML for custom metadata</xs:documentation>
			<xs:appinfo>
				<example>
					<scene-ad-cue-point entryId="{entry id}">
						<sceneStartTime>00:00:05</sceneStartTime>
						<sceneTitle>my ad title</sceneTitle>
						<sourceUrl>http://source.to.my/ad.xml</sourceUrl>
						<adType>1</adType>
						<protocolType>1</protocolType>
						<scene-customData metadataProfile="MY_AD_METADATA_PROFILE_SYSTEM_NAME">
							<metadata>
								<adData>my ad custom data</adData>
							</metadata>
						</scene-customData>
					</scene-ad-cue-point>
				</example>
			</xs:appinfo>
		</xs:annotation>
	</xs:element>
			';
        }
        if ($coreType == CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::INGEST_API)) {
            return '
		
	<!-- ' . self::getPluginName() . ' -->
	
	<xs:complexType name="T_customData">
		<xs:sequence>
			<xs:any namespace="##local" processContents="skip" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Custom metadata XML according to schema profile</xs:documentation>
				</xs:annotation>		
			</xs:any>			
		</xs:sequence>
		
		<xs:attribute name="metadataId" use="optional" type="xs:int">
			<xs:annotation>
				<xs:documentation>Id of the custom metadata object</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="metadataProfile" use="optional" type="xs:string">
			<xs:annotation>
				<xs:documentation>Custom metadata schema profile system name</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="metadataProfileId" use="optional" type="xs:int">
			<xs:annotation>
				<xs:documentation>Custom metadata schema profile id</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		
	</xs:complexType>
	
	<xs:element name="scene-customData" type="T_customData" substitutionGroup="scene-extension">
		<xs:annotation>
			<xs:documentation>XML for custom metadata</xs:documentation>
			<xs:appinfo>
				<example>
					<scene-ad-cue-point entryId="{entry id}">
						<sceneStartTime>00:00:05</sceneStartTime>
						<sceneTitle>my ad title</sceneTitle>
						<sourceUrl>http://source.to.my/ad.xml</sourceUrl>
						<adType>1</adType>
						<protocolType>1</protocolType>
						<scene-customData metadataProfile="MY_AD_METADATA_PROFILE_SYSTEM_NAME">
							<metadata>
								<adData>my ad custom data</adData>
							</metadata>
						</scene-customData>
					</scene-ad-cue-point>
				</example>
			</xs:appinfo>
		</xs:annotation>
	</xs:element>
			';
        }
        if ($coreType == CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::SERVE_API)) {
            return '
		
	<!-- ' . self::getPluginName() . ' -->
	
	<xs:complexType name="T_customData">
		<xs:sequence>
			<xs:any namespace="##local" processContents="skip" minOccurs="1" maxOccurs="1">
				<xs:annotation>
					<xs:documentation>Custom metadata XML according to schema profile</xs:documentation>
				</xs:annotation>		
			</xs:any>			
		</xs:sequence>
		
		<xs:attribute name="metadataId" use="required" type="xs:int">
			<xs:annotation>
				<xs:documentation>Id of the custom metadata object</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="metadataVersion" use="required" type="xs:int">
			<xs:annotation>
				<xs:documentation>Custom metadata version</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="metadataProfile" use="optional" type="xs:string">
			<xs:annotation>
				<xs:documentation>Custom metadata schema profile system name</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="metadataProfileId" use="required" type="xs:int">
			<xs:annotation>
				<xs:documentation>Custom metadata schema profile id</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="metadataProfileName" use="optional" type="xs:string">
			<xs:annotation>
				<xs:documentation>Custom metadata schema profile name</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		<xs:attribute name="metadataProfileVersion" use="required" type="xs:int">
			<xs:annotation>
				<xs:documentation>Custom metadata schema profile version</xs:documentation>
			</xs:annotation>
		</xs:attribute>
		
	</xs:complexType>
	
	<xs:element name="scene-customData" type="T_customData" substitutionGroup="scene-extension">
		<xs:annotation>
			<xs:documentation>XML for custom metadata</xs:documentation>
			<xs:appinfo>
				<example>
					<scene-ad-cue-point entryId="{entry id}">
						<sceneStartTime>00:00:05</sceneStartTime>
						<sceneTitle>my ad title</sceneTitle>
						<sourceUrl>http://source.to.my/ad.xml</sourceUrl>
						<adType>1</adType>
						<protocolType>1</protocolType>
						<scene-customData	metadataId="{metadata id}" 
										metadataVersion="1" 
										metadataProfile="MY_METADATA_PROFILE_SYSTEM_NAME}"  
										metadataProfileId="{metadata profile id}"  
										metadataProfileName="my metadata profile" 
										metadataProfileVersion="1" 
						>
							<metadata>
								<adData>my ad custom data</adData>
							</metadata>
						</scene-customData>
					</scene-ad-cue-point>
				</example>
			</xs:appinfo>
		</xs:annotation>
	</xs:element>
			';
        }
        return null;
    }
Beispiel #10
0
    public static function contributeToSchema($type)
    {
        $coreType = kPluginableEnumsManager::apiToCore('SchemaType', $type);
        if ($coreType != SchemaType::SYNDICATION && $coreType != CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::SERVE_API) && $coreType != CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::INGEST_API)) {
            return null;
        }
        $xsd = '

		<!-- ' . self::getPluginName() . ' -->

		<xs:complexType name="T_scene_questionCuePoint">
			<xs:complexContent>
				<xs:extension base="T_scene">
				<xs:sequence>
					<xs:element name="question" minOccurs="1" maxOccurs="1" type="xs:string"> </xs:element>
					<xs:element name="hint" minOccurs="0" maxOccurs="1" type="xs:string"> </xs:element>
					<xs:element name="explanation" minOccurs="0" maxOccurs="1" type="xs:string"> </xs:element>
					<xs:element name="optionalAnswers" minOccurs="0" maxOccurs="1" type="KalturaOptionalAnswersArray"></xs:element>
					<xs:element name="correctAnswerKeys" minOccurs="0" maxOccurs="1" type="KalturaStringArray"></xs:element>
				</xs:sequence>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>

		<xs:element name="scene-question-cue-point" type="T_scene_questionCuePoint" substitutionGroup="scene">
			<xs:annotation>
				<xs:documentation>Single question cue point element</xs:documentation>
				<xs:appinfo>
					<example>
						<scene-question-cue-point sceneId="{scene id}" entryId="{entry id}">
							<sceneStartTime>00:00:05.3</sceneStartTime>
							<tags>
								<tag>my_tag</tag>
							</tags>
						</scene-question-cue-point>
					</example>
				</xs:appinfo>
			</xs:annotation>
		</xs:element>

		<xs:complexType name="T_scene_answerCuePoint">
			<xs:complexContent>
				<xs:extension base="T_scene">
				<xs:sequence>
					<xs:element name="answerKey" minOccurs="1" maxOccurs="1" type="xs:string"> </xs:element>
					<xs:element name="quizUserEntryId" minOccurs="1" maxOccurs="1" type="xs:string"> </xs:element>
					<xs:element name="parentId" minOccurs="1" maxOccurs="1" type="xs:string">
						<xs:annotation>
							<xs:documentation>ID of the parent questionCuePoint</xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
				</xs:extension>
			</xs:complexContent>
		</xs:complexType>

		<xs:element name="scene-answer-cue-point" type="T_scene_answerCuePoint" substitutionGroup="scene">
			<xs:annotation>
				<xs:documentation>Single answer cue point element</xs:documentation>
				<xs:appinfo>
					<example>
						<scene-answer-cue-point sceneId="{scene id}" entryId="{entry id}">
							<sceneStartTime>00:00:05.3</sceneStartTime>
							<tags>
								<tag>my_tag</tag>
							</tags>
						</scene-answer-cue-point>
					</example>
				</xs:appinfo>
			</xs:annotation>
		</xs:element>

		';
        return $xsd;
    }
 /**
  * Check which server plugins should be used
  * @param KalturaCrossKalturaDistributionProfile $distributionProfile
  * @throws Exception
  */
 protected function initPlugins(KalturaCrossKalturaDistributionProfile $distributionProfile)
 {
     // check if should distribute caption assets
     $this->distributeCaptions = false;
     if ($distributionProfile->distributeCaptions == true) {
         if (class_exists('CaptionPlugin') && class_exists('KalturaCaptionClientPlugin') && KalturaPluginManager::getPluginInstance(CaptionPlugin::getPluginName())) {
             $this->distributeCaptions = true;
         } else {
             throw new Exception('Missing CaptionPlugin');
         }
     }
     // check if should distribute cue points
     $this->distributeCuePoints = false;
     if ($distributionProfile->distributeCuePoints == true) {
         if (class_exists('CuePointPlugin') && class_exists('KalturaCuePointClientPlugin') && KalturaPluginManager::getPluginInstance(CuePointPlugin::getPluginName())) {
             $this->distributeCuePoints = true;
         } else {
             throw new Exception('Missing CuePointPlugin');
         }
     }
 }
 private function createSphinxMatchPhrase($conditionStr)
 {
     $partnerId = kCurrentContext::$partner_id ? kCurrentContext::$partner_id : kCurrentContext::$ks_partner_id;
     if (isset($this->cuePointTypeIn)) {
         $conditions = array();
         $types = explode(',', $this->cuePointTypeIn);
         foreach ($types as $type) {
             $prefix = CuePointPlugin::ENTRY_CUE_POINT_INDEX_PREFIX . $partnerId . "_" . $type;
             $cuePointSubType = $this->getCuePointSubTypeEqual();
             if ($cuePointSubType) {
                 $prefix .= " " . CuePointPlugin::ENTRY_CUE_POINT_INDEX_SUB_TYPE . $cuePointSubType;
             }
             $postfix = CuePointPlugin::ENTRY_CUE_POINT_INDEX_SUFFIX . $partnerId . "_" . $type;
             $conditions[] = $prefix . " << " . $conditionStr . " << " . $postfix;
         }
         $condition = implode(' | ', $conditions);
     } else {
         $condition = CuePointPlugin::PLUGIN_NAME . "_" . $partnerId . " << {$conditionStr} << " . CuePointPlugin::SEARCH_TEXT_SUFFIX;
     }
     return '@' . CuePointPlugin::getSearchFieldName(CuePointPlugin::SEARCH_FIELD_DATA) . " " . $condition;
 }
Beispiel #13
0
 public static function shouldReIndexEntry(BaseObject $object, array $modifiedColumns)
 {
     if (!$object instanceof CuePoint) {
         return false;
     }
     $indexOnEntryTypes = CuePointPlugin::getIndexOnEntryTypes();
     if (!count($indexOnEntryTypes)) {
         return false;
     }
     if (!in_array($object->getType(), $indexOnEntryTypes)) {
         return false;
     }
     $fieldsToMonitor = array(CuePointPeer::TEXT, CuePointPeer::TAGS, CuePointPeer::NAME);
     if (count(array_intersect($fieldsToMonitor, $modifiedColumns)) > 0) {
         return true;
     }
     return false;
 }
Beispiel #14
0
 /**
  * return field name as appears in index schema
  * @param string $fieldName
  */
 public static function getSearchFieldName($fieldName)
 {
     if ($fieldName == self::SEARCH_FIELD_DATA) {
         return 'plugins_data';
     }
     return CuePointPlugin::getPluginName() . '_' . $fieldName;
 }
Beispiel #15
0
 /**
  * @return array
  */
 public static function getAdditionalDescriptions()
 {
     return array(CuePointPlugin::getApiValue(self::SERVE_API) => 'Cue point serve', CuePointPlugin::getApiValue(self::INGEST_API) => 'Cue point ingest');
 }
Beispiel #16
0
    public static function contributeToSchema($type)
    {
        $coreType = kPluginableEnumsManager::apiToCore('SchemaType', $type);
        if ($coreType != SchemaType::SYNDICATION && $coreType != CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::SERVE_API) && $coreType != CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::INGEST_API)) {
            return null;
        }
        $xsd = '
		
	<!-- ' . self::getPluginName() . ' -->
	
	<xs:complexType name="T_scene_codeCuePoint">
		<xs:complexContent>
			<xs:extension base="T_scene">
				<xs:sequence>
					<xs:element name="sceneEndTime" minOccurs="0" maxOccurs="1" type="xs:time">
						<xs:annotation>
							<xs:documentation>Cue point end time</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="code" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>Textual code</xs:documentation>
						</xs:annotation>
						<xs:simpleType>
							<xs:restriction base="xs:string">
								<xs:maxLength value="250"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:element>
					<xs:element name="description" minOccurs="0" maxOccurs="1" type="xs:string">
						<xs:annotation>
							<xs:documentation>Free text description</xs:documentation>
						</xs:annotation>
					</xs:element>
	
					<xs:element ref="scene-extension" minOccurs="0" maxOccurs="unbounded" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	
	<xs:element name="scene-code-cue-point" type="T_scene_codeCuePoint" substitutionGroup="scene">
		<xs:annotation>
			<xs:documentation>Single code cue point element</xs:documentation>
			<xs:appinfo>
				<example>
					<scene-code-cue-point sceneId="{scene id}" entryId="{entry id}">
						<sceneStartTime>00:00:05.3</sceneStartTime>
						<tags>
							<tag>sample</tag>
							<tag>my_tag</tag>
						</tags>
						<code>MY_CODE</code>
						<description>my code cue point description</description>
					</scene-code-cue-point>
				</example>
			</xs:appinfo>
		</xs:annotation>
	</xs:element>
		';
        return $xsd;
    }
Beispiel #17
0
    public static function contributeToSchema($type)
    {
        $coreType = kPluginableEnumsManager::apiToCore('SchemaType', $type);
        if ($coreType != SchemaType::SYNDICATION && $coreType != CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::SERVE_API) && $coreType != CuePointPlugin::getSchemaTypeCoreValue(CuePointSchemaType::INGEST_API)) {
            return null;
        }
        $xsd = '		
		
	<!-- ' . self::getPluginName() . ' -->
		
	<xs:complexType name="T_scene_adCuePoint">
		<xs:complexContent>
			<xs:extension base="T_scene">
				<xs:sequence>
					<xs:element name="sceneEndTime" minOccurs="0" maxOccurs="1" type="xs:time">
						<xs:annotation>
							<xs:documentation>Cue point end time</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="sceneTitle" minOccurs="0" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>Textual title</xs:documentation>
						</xs:annotation>
						<xs:simpleType>
							<xs:restriction base="xs:string">
								<xs:maxLength value="250"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:element>
					<xs:element name="sourceUrl" minOccurs="0" maxOccurs="1" type="xs:string">
						<xs:annotation>
							<xs:documentation>The URL of the ad XML</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="adType" minOccurs="1" maxOccurs="1" type="KalturaAdType">
						<xs:annotation>
							<xs:documentation>Indicates the ad type</xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="protocolType" minOccurs="1" maxOccurs="1" type="KalturaAdProtocolType">
						<xs:annotation>
							<xs:documentation>Indicates the ad protocol type</xs:documentation>
						</xs:annotation>
					</xs:element>
					
					<xs:element ref="scene-extension" minOccurs="0" maxOccurs="unbounded" />
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	
	<xs:element name="scene-ad-cue-point" type="T_scene_adCuePoint" substitutionGroup="scene">
		<xs:annotation>
			<xs:documentation>Single ad cue point element</xs:documentation>
			<xs:appinfo>
				<example>
					<scene-ad-cue-point sceneId="{scene id}" entryId="{entry id}" systemName="MY_AD_CUE_POINT_SYSTEM_NAME">
						<sceneStartTime>00:00:05</sceneStartTime>
						<tags>
							<tag>sample</tag>
							<tag>my_tag</tag>
						</tags>
						<sceneTitle>my ad title</sceneTitle>
						<sourceUrl>http://source.to.my/ad.xml</sourceUrl>
						<adType>1</adType>
						<protocolType>1</protocolType>
					</scene-ad-cue-point>
				</example>
			</xs:appinfo>
		</xs:annotation>
	</xs:element>
		';
        return $xsd;
    }
 public static function dependsOn()
 {
     $bulkUploadXmlDependency = new KalturaDependency(self::BULK_UPLOAD_XML_PLUGIN_NAME);
     $cuePointDependency = new KalturaDependency(CuePointPlugin::getPluginName());
     return array($bulkUploadXmlDependency, $cuePointDependency);
 }