public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $maxLengthFields = array(YouTubeDistributionField::MEDIA_DESCRIPTION => self::MEDIA_DESCRIPTION_MAXIMUM_LENGTH, YouTubeDistributionField::MEDIA_TITLE => self::MEDIA_TITLE_MAXIMUM_LENGTH, YouTubeDistributionField::WEB_METADATA_CUSTOM_ID => self::METADATA_CUSTOM_ID_MAXIMUM_LENGTH, YouTubeDistributionField::MOVIE_METADATA_CUSTOM_ID => self::METADATA_CUSTOM_ID_MAXIMUM_LENGTH, YouTubeDistributionField::TV_METADATA_CUSTOM_ID => self::METADATA_CUSTOM_ID_MAXIMUM_LENGTH, YouTubeDistributionField::TV_METADATA_EPISODE => self::TV_METADATA_EPISODE_MAXIMUM_LENGTH, YouTubeDistributionField::TV_METADATA_EPISODE_TITLE => self::TV_METADATA_EPISODE_TITLE_MAXIMUM_LENGTH, YouTubeDistributionField::TV_METADATA_SEASON => self::TV_METADATA_SEASON_MAXIMUM_LENGTH, YouTubeDistributionField::TV_METADATA_SHOW_TITLE => self::TV_METADATA_SHOW_TITLE_MAXIMUM_LENGTH, YouTubeDistributionField::TV_METADATA_TMS_ID => self::TV_METADATA_TMS_ID_MAXIMUM_LENGTH, YouTubeDistributionField::MOVIE_METADATA_TITLE => self::MOVIE_METADATA_TITLE_MAXIMUM_LENGTH, YouTubeDistributionField::MOVIE_METADATA_TMS_ID => self::MOVIE_METADATA_TMS_ID_MAXIMUM_LENGTH);
     $inListOrNullFields = array(YouTubeDistributionField::MEDIA_RATING => explode(',', self::MEDIA_RATING_VALID_VALUES), YouTubeDistributionField::ALLOW_COMMENTS => explode(',', self::ALLOW_COMMENTS_VALID_VALUES), YouTubeDistributionField::ALLOW_EMBEDDING => explode(',', self::ALLOW_EMBEDDING_VALID_VALUES), YouTubeDistributionField::ALLOW_RATINGS => explode(',', self::ALLOW_RATINGS_VALID_VALUES), YouTubeDistributionField::ALLOW_RESPONSES => explode(',', self::ALLOW_RESPONSES_VALID_VALUES), YouTubeDistributionField::ADVERTISING_INVIDEO => explode(',', self::ADVERTISING_INVIDEO_VALID_VALUES), YouTubeDistributionField::ADVERTISING_ADSENSE_FOR_VIDEO => explode(',', self::ADVERTISING_ADSENSE_FOR_VIDEO_VALUES), YouTubeDistributionField::DISTRIBUTION_RESTRICTION_DISTRIBUTION_RULE => explode(',', self::DISTRIBUTION_RESTRICTION_DISTRIBUTION_RULE_VALUES), YouTubeDistributionField::URGENT_REFERENCE_FILE => explode(',', self::URGENT_REFERENCE_FILE_VALUES), YouTubeDistributionField::KEEP_FINGERPRINT => explode(',', self::KEEP_FINGERPRINT_VALUES));
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!$allFieldValues || !is_array($allFieldValues)) {
         KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
         return $validationErrors;
     }
     $validationErrors = array_merge($validationErrors, $this->validateMaxLength($maxLengthFields, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateInListOrNull($inListOrNullFields, $allFieldValues, $action));
     $fieldName = YouTubeDistributionField::NOTIFICATION_EMAIL;
     $value = $allFieldValues[$fieldName];
     //multiple email support
     $values = explode(' ', $value);
     foreach ($values as $val) {
         if (!is_null($val) && !kString::isEmailString($val)) {
             $errorMsg = $this->getUserFriendlyFieldName($fieldName) . ' value must be an email string [value:' . $val . ']';
             $validationError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, $this->getUserFriendlyFieldName($fieldName));
             $validationError->setValidationErrorType(DistributionValidationErrorType::CUSTOM_ERROR);
             $validationError->setValidationErrorParam($errorMsg);
             $validationErrors[] = $validationError;
         }
     }
     //TODO: check if MEDIA_CATEGORY is a valid YouTube category according to YouTube's XML.
     return $validationErrors;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     //validation of flavor format
     $flavorAsset = null;
     $flavorAssets = assetPeer::retrieveByIds(explode(',', $entryDistribution->getFlavorAssetIds()));
     // if we have specific flavor assets for this distribution, grab the first one
     if (count($flavorAssets)) {
         $flavorAsset = reset($flavorAssets);
         $fileExt = $flavorAsset->getFileExt();
         $allowedExts = explode(',', self::FLAVOR_VALID_FORMATS);
         if (!in_array($fileExt, $allowedExts)) {
             KalturaLog::debug('flavor asset id [' . $flavorAsset->getId() . '] does not have a valid extension [' . $fileExt . ']');
             $errorMsg = 'Flavor format must be one of [' . self::FLAVOR_VALID_FORMATS . ']';
             $validationError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA);
             $validationError->setValidationErrorType(DistributionValidationErrorType::CUSTOM_ERROR);
             $validationError->setValidationErrorParam($errorMsg);
             $validationError->setDescription($errorMsg);
             $validationErrors[] = $validationError;
         }
     }
     $inListOrNullFields = array(IdeticDistributionField::GENRE => explode(',', self::GENRE_VALID_VALUES));
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!$allFieldValues || !is_array($allFieldValues)) {
         KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
         return $validationErrors;
     }
     $validationErrors = array_merge($validationErrors, $this->validateInListOrNull($inListOrNullFields, $allFieldValues, $action));
     //validating Slot is a whole number
     $validationErrors = array_merge($validationErrors, $this->validateIsWholeNumber(IdeticDistributionField::SLOT, $allFieldValues, $action));
     return $validationErrors;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!$allFieldValues || !is_array($allFieldValues)) {
         KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
         return $validationErrors;
     }
     $this->validateReferenceId($entryDistribution, $action, $validationErrors);
     return $validationErrors;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!is_array($allFieldValues)) {
         $allFieldValues = array();
     }
     $validationErrors = array_merge($validationErrors, $this->validateMaxLength($this->maxLengthValidation, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateInListOrNull($this->inListOrNullValidation, $allFieldValues, $action));
     return $validationErrors;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $maxLengthFields = array(YouTubeApiDistributionField::MEDIA_TITLE => self::MEDIA_TITLE_MAXIMUM_LENGTH, YouTubeApiDistributionField::MEDIA_DESCRIPTION => self::MEDIA_DESCRIPTION_MAXIMUM_LENGTH, YouTubeApiDistributionField::MEDIA_KEYWORDS => self::MEDIA_KEYWORDS_MAXIMUM_LENGTH);
     $inListOrNullFields = array(YouTubeApiDistributionField::ALLOW_COMMENTS => explode(',', self::ALLOW_COMMENTS_VALID_VALUES), YouTubeApiDistributionField::ALLOW_EMBEDDING => explode(',', self::ALLOW_EMBEDDING_VALID_VALUES), YouTubeApiDistributionField::ALLOW_RATINGS => explode(',', self::ALLOW_RATINGS_VALID_VALUES), YouTubeApiDistributionField::ALLOW_RESPONSES => explode(',', self::ALLOW_RESPONSES_VALID_VALUES));
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!$allFieldValues || !is_array($allFieldValues)) {
         KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
         return $validationErrors;
     }
     $validationErrors = array_merge($validationErrors, $this->validateMaxLength($maxLengthFields, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateInListOrNull($inListOrNullFields, $allFieldValues, $action));
     $videoTagsValue = isset($allFieldValues[YouTubeApiDistributionField::MEDIA_KEYWORDS]) ? $allFieldValues[YouTubeApiDistributionField::MEDIA_KEYWORDS] : null;
     $validationErrors = array_merge($validationErrors, $this->validateTags($videoTagsValue, $action));
     return $validationErrors;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $maxLengthFields = array(DailymotionDistributionField::VIDEO_TITLE => self::VIDEO_TITLE_MAXIMUM_LENGTH, DailymotionDistributionField::VIDEO_DESCRIPTION => self::VIDEO_DESCRIPTION_MAXIMUM_LENGTH);
     $inListOrNullFields = array(DailymotionDistributionField::VIDEO_TYPE => explode(',', self::VIDEO_TYPE_ALLOWED_VALUES), DailymotionDistributionField::VIDEO_GEO_BLOCKING_OPERATION => explode(',', self::VIDEO_GEO_BLOCKING_OPERATION_ALLOWED_VALUES));
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!$allFieldValues || !is_array($allFieldValues)) {
         KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
         return $validationErrors;
     }
     $validationErrors = array_merge($validationErrors, $this->validateMaxLength($maxLengthFields, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateInListOrNull($inListOrNullFields, $allFieldValues, $action));
     $videoTagsValue = isset($allFieldValues[DailymotionDistributionField::VIDEO_TAGS]) ? $allFieldValues[DailymotionDistributionField::VIDEO_TAGS] : null;
     $validationErrors = array_merge($validationErrors, $this->validateTags($videoTagsValue, $action));
     return $validationErrors;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $profile = DistributionProfilePeer::retrieveByPK($entryDistribution->getDistributionProfileId());
     if (!$profile) {
         KalturaLog::err("Distribution  profile [" . $entryDistribution->getDistributionProfileId() . "] not found");
         $validationErrors[] = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, 'profile', 'distribution profile not found');
         return $validationErrors;
     }
     if (strlen($profile->getFeedTitle()) <= 0) {
         $newError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, 'Feed title');
         $newError->setValidationErrorType(DistributionValidationErrorType::STRING_EMPTY);
         $validationErrors[] = $newError;
     }
     if (strlen($profile->getFeedLink()) <= 0) {
         $newError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, 'Feed link');
         $newError->setValidationErrorType(DistributionValidationErrorType::STRING_EMPTY);
         $validationErrors[] = $newError;
     }
     return $validationErrors;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $maxLengthFields = array(YahooDistributionField::VIDEO_DESCRIPTION => self::VIDEO_DESCRIPTION_MAXIMUM_LENGTH, YahooDistributionField::VIDEO_FEEDITEM_ID => self::FEED_ITEM_ID_MAXIMUM_LENGTH);
     $inListOrNullFields = array();
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!$allFieldValues || !is_array($allFieldValues)) {
         KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
         return $validationErrors;
     }
     $validationErrors = array_merge($validationErrors, $this->validateMaxLength($maxLengthFields, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateInListOrNull($inListOrNullFields, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateTwoThumbnailsExist($entryDistribution, $action));
     //$validationErrors = array_merge($validationErrors, $this->validateVideoStreamFormatAndBitrate($entryDistribution, $action));
     //$validationErrors = array_merge($validationErrors, $this->validateThumbnailsDimensions($entryDistribution, $action));
     //TODO: validate only video stream formats and remove bitrate and thumb dimensions
     $emailField = YahooDistributionField::CONTACT_EMAIL;
     $emailValue = $allFieldValues[$emailField];
     if ($emailValue && !kString::isEmailString($emailValue)) {
         $validationError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, $this->getUserFriendlyFieldName($emailField));
         $validationError->setValidationErrorType(DistributionValidationErrorType::INVALID_FORMAT);
         $validationError->setValidationErrorParam('email');
         $validationError->setDescription('Not an email string');
         $validationErrors[] = $validationError;
     }
     //TODO: validate that if contact_email is given, contact_telephone is given
     $telephoneField = YahooDistributionField::CONTACT_TELEPHONE;
     $telephoneValue = $allFieldValues[$telephoneField];
     //if Email is given than telephone must be given too
     if ($emailValue && !$telephoneValue) {
         $validationError = $this->createValidationError($action, DistributionErrorType::MISSING_METADATA, $this->getUserFriendlyFieldName($telephoneField));
         $validationError->setValidationErrorType(DistributionValidationErrorType::CUSTOM_ERROR);
         $validationError->setValidationErrorParam('Telephone is missing');
         $validationError->setDescription('Telephone is required');
         $validationErrors[] = $validationError;
     }
     return $validationErrors;
 }
Esempio n. 9
0
    protected function getDefaultFieldConfigArray()
    {
        $fieldConfigArray = parent::getDefaultFieldConfigArray();
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::PROVIDER_ID);
        $fieldConfig->setUserFriendlyFieldName('Entry id');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(entryId)" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::CSID);
        $fieldConfig->setUserFriendlyFieldName('CSID');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/csid" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::SOURCE);
        $fieldConfig->setUserFriendlyFieldName('Source');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/source" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::SOURCE_FRIENDLY_NAME);
        $fieldConfig->setUserFriendlyFieldName('Source friendly name');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/source_friendly_name" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::PAGE_GROUP);
        $fieldConfig->setUserFriendlyFieldName('Page group');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/page_group" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::TITLE);
        $fieldConfig->setUserFriendlyFieldName('Entry name');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::NAME));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::DESCRIPTION);
        $fieldConfig->setUserFriendlyFieldName('Entry description');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(description)" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::DESCRIPTION));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::TAGS_PUBLIC);
        $fieldConfig->setUserFriendlyFieldName('Entry tags');
        $fieldConfig->setEntryMrssXslt('<xsl:for-each select="tags/tag">
						<xsl:if test="position() &gt; 1">
							<xsl:text>,</xsl:text>
						</xsl:if>
						<xsl:value-of select="." />
					</xsl:for-each>');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::TAGS));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::START_DATE);
        $fieldConfig->setUserFriendlyFieldName('Distribution sunrise');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunrise" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::ACTIVATE_END_DATE);
        $fieldConfig->setUserFriendlyFieldName('Distribution sunset');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunset" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::SEARCHABLE_END_DATE);
        $fieldConfig->setUserFriendlyFieldName('Distribution sunset');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunset" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::ARCHIVE_END_DATE);
        $fieldConfig->setUserFriendlyFieldName('Distribution sunset');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunset" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::TAGS_MSNVIDEO_CAT);
        $fieldConfig->setUserFriendlyFieldName('MSNVideo_Cat');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/msnvideo_cat" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::TAGS_MSNVIDEO_TOP);
        $fieldConfig->setUserFriendlyFieldName('MSNVideo_Top');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/msnvideo_top" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::TAGS_MSNVIDEO_TOP_CAT);
        $fieldConfig->setUserFriendlyFieldName('MSNVideo_Top_Cat');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/msnvideo_top_cat" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        // placeholders for dynamic fields
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::RELATED_LINK_N_TITLE);
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::RELATED_LINK_N_URL);
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::TAGS_PREMIUM_N_MARKET);
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::TAGS_PREMIUM_N_NAMESPACE);
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(MsnDistributionField::TAGS_PREMIUM_N_VALUE);
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        return $fieldConfigArray;
    }
Esempio n. 10
0
 /**
  * @return array<kDistributionThumbDimensions>
  */
 public function getRequiredThumbDimensionsObjects()
 {
     $requiredThumbs = parent::getRequiredThumbDimensionsObjects();
     if (!is_null($this->overrideRequiredThumbs)) {
         $requiredThumbs = array();
         $requiredThumbs[] = $this->overrideRequiredThumbs;
     }
     return $requiredThumbs;
 }
 public function preSave(PropelPDO $con = null)
 {
     if ($this->isNew()) {
         $this->setUniqueHashForFeedUrl(md5(time() . rand(0, time())));
     }
     return parent::preSave($con);
 }
 protected function getDefaultFieldConfigArray()
 {
     $fieldConfigArray = parent::getDefaultFieldConfigArray();
     // entry name
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(CrossKalturaDistributionField::BASE_ENTRY_NAME);
     $fieldConfig->setUserFriendlyFieldName('Name');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::NAME));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     // entry description
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(CrossKalturaDistributionField::BASE_ENTRY_DESCRIPTION);
     $fieldConfig->setUserFriendlyFieldName('Description');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(description)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::DESCRIPTION));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     // entry user id
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(CrossKalturaDistributionField::BASE_ENTRY_USER_ID);
     $fieldConfig->setUserFriendlyFieldName('User ID');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(userId)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::PUSER_ID));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     // entry tags
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(CrossKalturaDistributionField::BASE_ENTRY_TAGS);
     $fieldConfig->setUserFriendlyFieldName('Tags');
     $fieldConfig->setEntryMrssXslt('<xsl:for-each select="tags/tag">
                             			<xsl:if test="position() &gt; 1">
                             				<xsl:text>,</xsl:text>
                             			</xsl:if>
                             			<xsl:value-of select="normalize-space(.)" />
                             		</xsl:for-each>');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::TAGS));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     // entry categories
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(CrossKalturaDistributionField::BASE_ENTRY_CATEGORIES);
     $fieldConfig->setUserFriendlyFieldName('Categories');
     $fieldConfig->setEntryMrssXslt('<xsl:for-each select="category">
                             			<xsl:if test="position() &gt; 1">
                             				<xsl:text>,</xsl:text>
                             			</xsl:if>
                             			<xsl:value-of select="normalize-space(.)" />
                             		</xsl:for-each>');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::CATEGORIES));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     // entry partner data
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(CrossKalturaDistributionField::BASE_ENTRY_PARTNER_DATA);
     $fieldConfig->setUserFriendlyFieldName('Entry Partner Data');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(partnerData)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::PARTNER_DATA));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     // entry start date
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(CrossKalturaDistributionField::BASE_ENTRY_START_DATE);
     $fieldConfig->setUserFriendlyFieldName('Distribution sunrise');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunrise" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     // entry end date
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(CrossKalturaDistributionField::BASE_ENTRY_END_DATE);
     $fieldConfig->setUserFriendlyFieldName('Distribution sunset');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunset" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     // entry reference id
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(CrossKalturaDistributionField::BASE_ENTRY_REFERENCE_ID);
     $fieldConfig->setUserFriendlyFieldName('Reference ID');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(referenceID)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     // entry license type
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(CrossKalturaDistributionField::BASE_ENTRY_LICENSE_TYPE);
     $fieldConfig->setUserFriendlyFieldName('License type');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(licenseType)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::LICENSE_TYPE));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     return $fieldConfigArray;
 }
    protected function getDefaultFieldConfigArray()
    {
        $fieldConfigArray = parent::getDefaultFieldConfigArray();
        //TODO: implement
        //media fields
        //short title
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(IdeticDistributionField::SHORT_TITLE);
        $fieldConfig->setUserFriendlyFieldName('Entry name');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::NAME));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //title
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(IdeticDistributionField::TITLE);
        $fieldConfig->setUserFriendlyFieldName('Entry name');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::NAME));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //synopsis
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(IdeticDistributionField::SYNOPSIS);
        $fieldConfig->setUserFriendlyFieldName('Entry description');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(description)" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::DESCRIPTION));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //tags
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(IdeticDistributionField::KEYWORD);
        $fieldConfig->setUserFriendlyFieldName('Entry tags');
        $fieldConfig->setEntryMrssXslt('<xsl:for-each select="tags/tag">
						<xsl:if test="position() &gt; 1">
							<xsl:text>,</xsl:text>
						</xsl:if>
						<xsl:value-of select="." />
					</xsl:for-each>');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::TAGS));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //genre
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(IdeticDistributionField::GENRE);
        $fieldConfig->setUserFriendlyFieldName('Idetic genre');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/IdeticGenre" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array("/*[local-name()='metadata']/*[local-name()='IdeticGenre']"));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //slot
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(IdeticDistributionField::SLOT);
        $fieldConfig->setUserFriendlyFieldName('Idetic slot');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/IdeticSlot" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array("/*[local-name()='metadata']/*[local-name()='IdeticSlot']"));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //folder
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(IdeticDistributionField::FOLDER);
        $fieldConfig->setUserFriendlyFieldName('Idetic folder');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/IdeticFolder" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array("/*[local-name()='metadata']/*[local-name()='IdeticFolder']"));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //start of availability
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(IdeticDistributionField::START_OF_AVAILABILITY);
        $fieldConfig->setUserFriendlyFieldName('Distribution sunrise');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunrise" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //end of availability
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(IdeticDistributionField::END_OF_AVAILABILITY);
        $fieldConfig->setUserFriendlyFieldName('Distribution sunset');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunset" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        return $fieldConfigArray;
    }
Esempio n. 14
0
 protected function getDefaultFieldConfigArray()
 {
     $fieldConfigArray = parent::getDefaultFieldConfigArray();
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TITLE);
     $fieldConfig->setUserFriendlyFieldName('Video title');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::NAME));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::DESCRIPTION);
     $fieldConfig->setUserFriendlyFieldName('Video description');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(description)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::DESCRIPTION));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::SCHEDULE_PUBLISHING_TIME);
     $fieldConfig->setUserFriendlyFieldName('Schedule Sunrise Time');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunrise" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::CALL_TO_ACTION_TYPE);
     $fieldConfig->setUserFriendlyFieldName('Call To Action Type');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/CallToActionType" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::CALL_TO_ACTION_LINK);
     $fieldConfig->setUserFriendlyFieldName('Call To Action Link');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/CallToActionLink" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::CALL_TO_ACTION_LINK_CAPTION);
     $fieldConfig->setUserFriendlyFieldName('Call To Action Link Caption');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/CallToActionLinkCaption" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_COUNTRIES);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingCountries" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_CITIES);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingCities" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_REGIONS);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingRegions" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_ZIP_CODES);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingZipCodes" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_EXCLUDED_COUNTRIES);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingExcludedCountries" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_EXCLUDED_CITIES);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingExcludedCities" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_EXCLUDED_REGIONS);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingExcludedRegions" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_EXCLUDED_ZIPCODES);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingExcludedZipCodes" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_TIMEZONES);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingTimezones" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_AGE_MAX);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingAgeMax" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_AGE_MIN);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingAgeMin" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_GENDERS);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingGenders" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(FacebookDistributionField::TARGETING_LOCALES);
     $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to limit the audience of the video');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/TargetingLocale" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     //	   	$fieldConfig = new DistributionFieldConfig();
     //	    $fieldConfig->setFieldName(FacebookDistributionField::PLACE);
     //	    $fieldConfig->setUserFriendlyFieldName('ID of location to tag in video');
     //	    $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/Place" />');
     //	    $fieldConfigArray[] = $fieldConfig;
     //
     //	    $fieldConfig = new DistributionFieldConfig();
     //	    $fieldConfig->setFieldName(FacebookDistributionField::TAGS);
     //	    $fieldConfig->setUserFriendlyFieldName('IDs (comma separated) of persons to tag in video');
     //	    $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/Tags" />');
     //	    $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     //
     //
     //	   	$fieldConfig = new DistributionFieldConfig();
     //	    $fieldConfig->setFieldName(FacebookDistributionField::FEED_TARGETING);
     //	    $fieldConfig->setUserFriendlyFieldName('Key IDs for ad targeting objects used to promote the video in specific audience feeds');
     //	    $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/FeedTargeting" />');
     //	    $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     return $fieldConfigArray;
 }
 protected function getDefaultFieldConfigArray()
 {
     $fieldConfigArray = parent::getDefaultFieldConfigArray();
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_TITLE);
     $fieldConfig->setUserFriendlyFieldName('Entry name');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_SUMMARY);
     $fieldConfig->setUserFriendlyFieldName('Entry description');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(description)" />');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_UPDATED);
     $fieldConfig->setUserFriendlyFieldName('Entry Updated At');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(updatedAt)" />');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_AUTHOR_NAME);
     $fieldConfig->setUserFriendlyFieldName('Feed Author Name');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/feed_author_name" />');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_ASSET_ID);
     $fieldConfig->setUserFriendlyFieldName('Entry ID');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(entryId)" />');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_OFFERING_START);
     $fieldConfig->setUserFriendlyFieldName('Distribution start date');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunrise" />');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_OFFERING_END);
     $fieldConfig->setUserFriendlyFieldName('Distribution end date');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunset" />');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_CATEGORY_TERM);
     $fieldConfig->setUserFriendlyFieldName('Synacor HBO Category');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/SynacorHboCategory" />');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_GENRE_TERM);
     $fieldConfig->setUserFriendlyFieldName('Synacor HBO Genre');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/SynacorHboGenre" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_ASSET_TYPE);
     $fieldConfig->setUserFriendlyFieldName('Synacor HBO Asset Type');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/SynacorHboAssetType" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_RATING);
     $fieldConfig->setUserFriendlyFieldName('Synacor HBO Rating');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/SynacorHboRating" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_SERIES_TITLE);
     $fieldConfig->setUserFriendlyFieldName('Synacor HBO Series Title');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/SynacorHboSeriesTitle" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(SynacorHboDistributionField::ENTRY_BRAND);
     $fieldConfig->setUserFriendlyFieldName('Synacor HBO Brand');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/SynacorHboBrand" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     return $fieldConfigArray;
 }
 protected function getDefaultFieldConfigArray()
 {
     $fieldConfigArray = parent::getDefaultFieldConfigArray();
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::MEDIA_TITLE);
     $fieldConfig->setUserFriendlyFieldName('Entry name');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::NAME));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::MEDIA_DESCRIPTION);
     $fieldConfig->setUserFriendlyFieldName(self::METADATA_FIELD_DESCRIPTION . ' / Entry description');
     $fieldConfig->setEntryMrssXslt('
     			<xsl:choose>
                 	<xsl:when test="customData/metadata/' . self::METADATA_FIELD_DESCRIPTION . ' != \'\'">
                 		<xsl:value-of select="customData/metadata/' . self::METADATA_FIELD_DESCRIPTION . '" />
                 	</xsl:when>
                 	<xsl:otherwise>
                 		<xsl:value-of select="string(description)" />
                 	</xsl:otherwise>
                 </xsl:choose>');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::DESCRIPTION, "/*[local-name()='metadata']/*[local-name()='" . self::METADATA_FIELD_DESCRIPTION . "']"));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::MEDIA_KEYWORDS);
     $fieldConfig->setUserFriendlyFieldName(self::METADATA_FIELD_TAGS . ' / Entry tags');
     $fieldConfig->setEntryMrssXslt('<xsl:choose>
                 	<xsl:when test="customData/metadata/' . self::METADATA_FIELD_TAGS . ' != \'\'">
                 		<xsl:value-of select="normalize-space(customData/metadata/' . self::METADATA_FIELD_TAGS . ')" />
                 	</xsl:when>
                 	<xsl:otherwise>
                 		<xsl:for-each select="tags/tag">
                 			<xsl:if test="position() &gt; 1">
                 				<xsl:text>,</xsl:text>
                 			</xsl:if>
                 			<xsl:value-of select="normalize-space(.)" />
                 		</xsl:for-each>
                 	</xsl:otherwise>
                 </xsl:choose>');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::TAGS, "/*[local-name()='metadata']/*[local-name()='" . self::METADATA_FIELD_TAGS . "']"));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::MEDIA_CATEGORY);
     $fieldConfig->setUserFriendlyFieldName(self::METADATA_FIELD_CATEGORY);
     $fieldConfig->setEntryMrssXslt('
     			<xsl:choose>
                 	<xsl:when test="customData/metadata/' . self::METADATA_FIELD_CATEGORY . ' != \'\'">
                 		<xsl:value-of select="customData/metadata/' . self::METADATA_FIELD_CATEGORY . '" />
                 	</xsl:when>
                 	<xsl:otherwise>
                 		<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/default_category" />
                 	</xsl:otherwise>
                 </xsl:choose>');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array("/*[local-name()='metadata']/*[local-name()='default_category']", "/*[local-name()='metadata']/*[local-name()='" . self::METADATA_FIELD_CATEGORY . "']"));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::MEDIA_PLAYLIST_IDS);
     $fieldConfig->setUserFriendlyFieldName(self::METADATA_FIELD_PLAYLIST_IDS);
     $fieldConfig->setEntryMrssXslt('<xsl:if test="customData/metadata/' . self::METADATA_FIELD_PLAYLIST_IDS . ' != \'\'">' . '<xsl:value-of select="normalize-space(customData/metadata/' . self::METADATA_FIELD_PLAYLIST_IDS . ')" />' . '</xsl:if>');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::START_DATE);
     $fieldConfig->setUserFriendlyFieldName('Distribution sunrise');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunrise" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::END_DATE);
     $fieldConfig->setUserFriendlyFieldName('Distribution sunset');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunset" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::ALLOW_COMMENTS);
     $fieldConfig->setUserFriendlyFieldName('Allow comments');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_comments" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::ALLOW_RESPONSES);
     $fieldConfig->setUserFriendlyFieldName('Allow responses');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_responses" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::ALLOW_RATINGS);
     $fieldConfig->setUserFriendlyFieldName('Allow ratings');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_ratings" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::ALLOW_EMBEDDING);
     $fieldConfig->setUserFriendlyFieldName('Allow embedding');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_embedding" />');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     // The following allows defining an alternative slug header for an uploaded video, which
     // affects the "raw file" field of a YouTube video entry.
     // A typical MRSS XSLT value would be the entry's title (similar to MEDIA_TITLE)
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(YouTubeApiDistributionField::ALT_RAW_FILENAME);
     $fieldConfig->setUserFriendlyFieldName('Alternative Raw File Name ');
     $fieldConfig->setEntryMrssXslt('');
     // Empty by default to indicate that the feature is switched off.
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     return $fieldConfigArray;
 }
 protected function getDefaultFieldConfigArray()
 {
     $fieldConfigArray = parent::getDefaultFieldConfigArray();
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(DailymotionDistributionField::VIDEO_TITLE);
     $fieldConfig->setUserFriendlyFieldName('Entry name');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::NAME));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(DailymotionDistributionField::VIDEO_DESCRIPTION);
     $fieldConfig->setUserFriendlyFieldName(self::METADATA_FIELD_DESCRIPTION . ' / Entry description');
     $fieldConfig->setEntryMrssXslt('
     			<xsl:choose>
                 	<xsl:when test="customData/metadata/' . self::METADATA_FIELD_DESCRIPTION . ' != \'\'">
                 		<xsl:value-of select="customData/metadata/' . self::METADATA_FIELD_DESCRIPTION . '" />
                 	</xsl:when>
                 	<xsl:otherwise>
                 		<xsl:value-of select="string(description)" />
                 	</xsl:otherwise>
                 </xsl:choose>');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::DESCRIPTION, "/*[local-name()='metadata']/*[local-name()='" . self::METADATA_FIELD_DESCRIPTION . "']"));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(DailymotionDistributionField::VIDEO_TAGS);
     $fieldConfig->setUserFriendlyFieldName(self::METADATA_FIELD_TAGS . ' / Entry tags');
     $fieldConfig->setEntryMrssXslt('<xsl:choose>
                 	<xsl:when test="customData/metadata/' . self::METADATA_FIELD_TAGS . ' != \'\'">
                 		<xsl:value-of select="normalize-space(customData/metadata/' . self::METADATA_FIELD_TAGS . ')" />
                 	</xsl:when>
                 	<xsl:otherwise>
                 		<xsl:for-each select="tags/tag">
                 			<xsl:if test="position() &gt; 1">
                 				<xsl:text>,</xsl:text>
                 			</xsl:if>
                 			<xsl:value-of select="normalize-space(.)" />
                 		</xsl:for-each>
                 	</xsl:otherwise>
                 </xsl:choose>');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::TAGS, "/*[local-name()='metadata']/*[local-name()='" . self::METADATA_FIELD_TAGS . "']"));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(DailymotionDistributionField::VIDEO_CHANNEL);
     $fieldConfig->setUserFriendlyFieldName(self::METADATA_FIELD_CATEGORY);
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/' . self::METADATA_FIELD_CATEGORY . '" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array("/*[local-name()='metadata']/*[local-name()='" . self::METADATA_FIELD_CATEGORY . "']"));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(DailymotionDistributionField::VIDEO_LANGUAGE);
     $fieldConfig->setUserFriendlyFieldName('Video language');
     $fieldConfig->setEntryMrssXslt('<xsl:text>en</xsl:text>');
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(DailymotionDistributionField::VIDEO_TYPE);
     $fieldConfig->setUserFriendlyFieldName(self::METADATA_FIELD_TYPE);
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/' . self::METADATA_FIELD_TYPE . '" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array("/*[local-name()='metadata']/*[local-name()='" . self::METADATA_FIELD_TYPE . "']"));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(DailymotionDistributionField::VIDEO_GEO_BLOCKING_OPERATION);
     $fieldConfig->setUserFriendlyFieldName('Geo blocking allow / deny');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(DailymotionDistributionField::VIDEO_GEO_BLOCKING_COUNTRY_LIST);
     $fieldConfig->setUserFriendlyFieldName('Geo blocking country list');
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     return $fieldConfigArray;
 }
Esempio n. 18
0
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!$allFieldValues || !is_array($allFieldValues)) {
         KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
         return $validationErrors;
     }
     $validationErrors = array_merge($validationErrors, $this->validateMaxLength($this->maxLengthValidation, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateInListOrNull($this->inListOrNullValidation, $allFieldValues, $action));
     if ($this->getDisableEpisodeNumberCustomValidation() !== true) {
         $validationErrors = array_merge($validationErrors, $this->validateEpisodeNumber($allFieldValues, $action));
     }
     $validationErrors = array_merge($validationErrors, $this->validateContentRatingReason($allFieldValues, $action));
     return $validationErrors;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!$allFieldValues || !is_array($allFieldValues)) {
         KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
         return $validationErrors;
     }
     $validationErrors = array_merge($validationErrors, $this->validateMaxLength($this->maxLengthValidation, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateInListOrNull($this->inListOrNullValidation, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateMaxLengthCategoryName($allFieldValues[UverseClickToOrderDistributionField::CATEGORY_ENTRY_ID], $action));
     return $validationErrors;
 }
Esempio n. 20
0
 protected function getDefaultFieldConfigArray()
 {
     $fieldConfigArray = parent::getDefaultFieldConfigArray();
     // Set the default XSL expression for AUTOMATIC_DISTRIBUTION_CONDITIONS
     $fieldConfig = $fieldConfigArray[ConfigurableDistributionField::AUTOMATIC_DISTRIBUTION_CONDITIONS];
     if ($fieldConfig) {
         $fieldConfig->setEntryMrssXslt('<xsl:if test="customData/metadata/WorkflowStatus = \'Approved\'">Approved For Automatic Distribution</xsl:if>');
     }
     // media fields
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(TvinciDistributionField::METADATA_SCHEMA_ID);
     $fieldConfig->setUserFriendlyFieldName('Schema Id');
     $fieldConfig->setEntryMrssXslt('2');
     // See TvinciDistributionField::METADATA_SCHEMA_ID
     $fieldConfig->setUpdateOnChange(false);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(TvinciDistributionField::MEDIA_TITLE);
     $fieldConfig->setUserFriendlyFieldName('Entry name');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::NAME));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(TvinciDistributionField::MEDIA_DESCRIPTION);
     $fieldConfig->setUserFriendlyFieldName('Entry description');
     $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(description)" />');
     $fieldConfig->setUpdateOnChange(true);
     $fieldConfig->setUpdateParams(array(entryPeer::DESCRIPTION));
     $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     $activatePublishingXSLT = '<xsl:choose>' . '<xsl:when test="customData/metadata/Activate = \'Yes\'">true</xsl:when>' . '<xsl:otherwise>false</xsl:otherwise>' . '</xsl:choose>';
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::ACTIVATE_PUBLISHING, 'Activate Publishing', 'Activate', false, DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER, $activatePublishingXSLT);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::MEDIA_TYPE, 'Media Type', 'MediaType');
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_SHORT_TITLE, 'Short Title', 'ShortTitle', false);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_DIMENSION, 'Dimension', 'Dimension', false);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_BILLING_TYPE, 'Billing Type', 'BillingType', false);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::GEO_BLOCK_RULE, 'Geo Block Rule', 'GeoBlockRule');
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::WATCH_PERMISSIONS_RULE, 'Watch Permission Rule', 'WatchPermissionRule');
     // Language
     $languageXSLT = '<xsl:choose>' . '<xsl:when test="customData/metadata/Language != \'\'">' . '<xsl:value-of select="customData/metadata/Language"/>' . '</xsl:when>' . '<xsl:otherwise><xsl:text>eng</xsl:text></xsl:otherwise>' . '</xsl:choose>';
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::LANGUAGE, 'Language', 'Language', false, DistributionFieldRequiredStatus::NOT_REQUIRED, $languageXSLT);
     // Dates
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::START_DATE, 'Start Date', 'StartDate', false, DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::END_DATE, 'End Date', 'FinalEndDate', false, DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::CATALOG_START_DATE, 'Catalog Start Date', 'CatalogStartDate', false, DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::CATALOG_END_DATE, 'Catalog End Date', 'CatalogEndDate', false, DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_RUNTIME, 'Runtime', 'Runtime');
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_RELEASE_YEAR, 'Release Year', 'ReleaseYear');
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_RELEASE_DATE, 'Release Date', 'ReleaseDate');
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_GENRE, 'Genre', 'Genre', true);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_SUB_GENRE, 'Sub Genre', 'SubGenre', true);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_RATING, 'Rating', 'Rating', true);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_PARENTAL_RATING, 'Parental Rating', 'ParentalRating', true);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_COUNTRY, 'Country', 'Country', true);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_CAST, 'Cast', 'Cast', true);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_MAIN_CAST, 'Main Cast', 'MainCast', true);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_DIRECTOR, 'Director', 'Director', true);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_AUDIO_LANGUAGE, 'Audio Language', 'AudioLanguage', true);
     $this->addMetadataDistributionFieldConfig($fieldConfigArray, TvinciDistributionField::METADATA_STUDIO, 'Studio', 'Studio', true);
     // Video assets configuration (see KalturaTvinciDistributionJobProviderData::initPlayManifestUrls())
     $fieldConfig = new DistributionFieldConfig();
     $fieldConfig->setFieldName(TvinciDistributionField::VIDEO_ASSETS_CONFIGURATION);
     $fieldConfig->setUserFriendlyFieldName('Video assets configuration');
     $fieldConfig->setEntryMrssXslt('');
     $fieldConfig->setUpdateOnChange(false);
     $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
     return $fieldConfigArray;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     return $validationErrors;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!$allFieldValues || !is_array($allFieldValues)) {
         KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
         return $validationErrors;
     }
     $validationErrors = array_merge($validationErrors, $this->validateMaxLength($this->maxLengthValidation, $allFieldValues, $action));
     //validate required channel fields
     $channelTitleValue = $this->getChannelTitle();
     if (empty($channelTitleValue)) {
         $validationError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, 'Channel title profile configuration');
         $validationError->setValidationErrorType(DistributionValidationErrorType::STRING_EMPTY);
         $validationErrors[] = $validationError;
     }
     $channelLinkValue = $this->getChannelLink();
     if (empty($channelLinkValue)) {
         $validationError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, 'Channel link profile configuration');
         $validationError->setValidationErrorType(DistributionValidationErrorType::STRING_EMPTY);
         $validationErrors[] = $validationError;
     }
     $channelDescriptionValue = $this->getChannelDescription();
     if (empty($channelDescriptionValue)) {
         $validationError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, 'Channel description profile configuration');
         $validationError->setValidationErrorType(DistributionValidationErrorType::STRING_EMPTY);
         $validationErrors[] = $validationError;
     }
     //verify channel image title exist if channel image url exists and vice versa
     $channelImageTitleValue = $this->getChannelImageTitle();
     $channelImageUrlValue = $this->getChannelImageUrl();
     if (!empty($channelImageTitleValue) && empty($channelImageUrlValue)) {
         $validationError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, 'Channel image url profile configuration');
         $validationError->setValidationErrorType(DistributionValidationErrorType::STRING_EMPTY);
         $validationErrors[] = $validationError;
     }
     if (!empty($channelImageUrlValue) && empty($channelImageTitleValue)) {
         $validationError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, 'Channel image title profile configuration');
         $validationError->setValidationErrorType(DistributionValidationErrorType::STRING_EMPTY);
         $validationErrors[] = $validationError;
     }
     // validate thumbnail assets
     $requiredThumbAssetDim = $this->getRequiredThumbDimensions();
     if (empty($requiredThumbAssetDim)) {
         $errorMsg = 'no thumbnail was configured';
         $validationError = $this->createValidationError($action, DistributionErrorType::INVALID_DATA);
         $validationError->setValidationErrorType(DistributionValidationErrorType::CUSTOM_ERROR);
         $validationError->setValidationErrorParam($errorMsg);
         $validationError->setDescription($errorMsg);
         $validationErrors[] = $validationError;
     }
     return $validationErrors;
 }
    protected function getDefaultFieldConfigArray()
    {
        $fieldConfigArray = parent::getDefaultFieldConfigArray();
        // media fields
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::MEDIA_TITLE);
        $fieldConfig->setUserFriendlyFieldName('Entry name');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::NAME));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::MEDIA_DESCRIPTION);
        $fieldConfig->setUserFriendlyFieldName('Entry description');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(description)" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::DESCRIPTION));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::MEDIA_KEYWORDS);
        $fieldConfig->setUserFriendlyFieldName('Entry tags');
        $fieldConfig->setEntryMrssXslt('<xsl:for-each select="tags/tag">
						<xsl:if test="position() &gt; 1">
							<xsl:text>,</xsl:text>
						</xsl:if>
						<xsl:value-of select="." />
					</xsl:for-each>');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::TAGS));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::MEDIA_RATING);
        $fieldConfig->setUserFriendlyFieldName('Media rating');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::MEDIA_CATEGORY);
        $fieldConfig->setUserFriendlyFieldName('Media category');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/default_category" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::WEB_METADATA_CUSTOM_ID);
        $fieldConfig->setUserFriendlyFieldName('Entry ID');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(entryId)" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::WEB_METADATA_NOTES);
        $fieldConfig->setUserFriendlyFieldName('Web metadata notes');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::MOVIE_METADATA_CUSTOM_ID);
        $fieldConfig->setUserFriendlyFieldName('Movie metadata custom ID');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::MOVIE_METADATA_DIRECTOR);
        $fieldConfig->setUserFriendlyFieldName('Movie metadata director');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::MOVIE_METADATA_NOTES);
        $fieldConfig->setUserFriendlyFieldName('Movie metadata notes');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::MOVIE_METADATA_TITLE);
        $fieldConfig->setUserFriendlyFieldName('Movie metadata title');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::MOVIE_METADATA_TMS_ID);
        $fieldConfig->setUserFriendlyFieldName('Movie metadata TMS ID');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::DATE_RECORDED);
        $fieldConfig->setUserFriendlyFieldName('Date recorded');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::START_TIME);
        $fieldConfig->setUserFriendlyFieldName('Distribution sunrise');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunrise" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::END_TIME);
        $fieldConfig->setUserFriendlyFieldName('Distribution sunset');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunset" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::URGENT_REFERENCE_FILE);
        $fieldConfig->setUserFriendlyFieldName('Urgent reference file');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::KEEP_FINGERPRINT);
        $fieldConfig->setUserFriendlyFieldName('Keep fingerprint');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        // community fields
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ALLOW_COMMENTS);
        $fieldConfig->setUserFriendlyFieldName('Allow comments');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_comments" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ALLOW_RESPONSES);
        $fieldConfig->setUserFriendlyFieldName('Allow responses');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_responses" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ALLOW_RATINGS);
        $fieldConfig->setUserFriendlyFieldName('Allow ratings');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_ratings" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ALLOW_EMBEDDING);
        $fieldConfig->setUserFriendlyFieldName('Allow embedding');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_embedding" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        // youtube extra data
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::POLICY_COMMERCIAL);
        $fieldConfig->setUserFriendlyFieldName('Commercial policy');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/commerical_policy" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::POLICY_UGC);
        $fieldConfig->setUserFriendlyFieldName('UGC policy');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/ugc_policy" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::NOTIFICATION_EMAIL);
        $fieldConfig->setUserFriendlyFieldName('Notification Email');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/notification_email" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ACCOUNT_USERNAME);
        $fieldConfig->setUserFriendlyFieldName('Account username');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/account_username" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ACCOUNT_PASSWORD);
        $fieldConfig->setUserFriendlyFieldName('Account password');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        // the password should not be added in contributeMRSS
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::OWNER_NAME);
        $fieldConfig->setUserFriendlyFieldName('Account username');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/account_username" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::TARGET);
        $fieldConfig->setUserFriendlyFieldName('YouTube target');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/target" />');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::LANGUAGE);
        $fieldConfig->setUserFriendlyFieldName('YouTube language');
        $fieldConfig->setEntryMrssXslt('<xsl:text>en</xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::TV_METADATA_CUSTOM_ID);
        $fieldConfig->setUserFriendlyFieldName('TV metadata custom id');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::TV_METADATA_EPISODE);
        $fieldConfig->setUserFriendlyFieldName('TV metadata episode');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::TV_METADATA_EPISODE_TITLE);
        $fieldConfig->setUserFriendlyFieldName('TV metadata episode title');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::TV_METADATA_SHOW_TITLE);
        $fieldConfig->setUserFriendlyFieldName('TV metadata show title');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::TV_METADATA_SEASON);
        $fieldConfig->setUserFriendlyFieldName('TV metadata season');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::TV_METADATA_NOTES);
        $fieldConfig->setUserFriendlyFieldName('TV metadata notes');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::TV_METADATA_TMS_ID);
        $fieldConfig->setUserFriendlyFieldName('TV metadata TMS ID');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::PLAYLISTS);
        $fieldConfig->setUserFriendlyFieldName('YouTube playlists');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/YouTubePlaylist" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array("/*[local-name()='metadata']/*[local-name()='YouTubePlaylist']"));
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ADVERTISING_ADSENSE_FOR_VIDEO);
        $fieldConfig->setUserFriendlyFieldName('Advertising adsense for video');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ADVERTISING_INVIDEO);
        $fieldConfig->setUserFriendlyFieldName('Advertising in video');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::THIRD_PARTY_AD_SERVER_AD_TYPE);
        $fieldConfig->setUserFriendlyFieldName('Third party ad server ad type');
        $fieldConfig->setEntryMrssXslt('<xsl:text>1</xsl:text>');
        $fieldConfig->setUpdateOnChange(false);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::THIRD_PARTY_AD_SERVER_PARTNER_ID);
        $fieldConfig->setUserFriendlyFieldName('Third party ad server partner ID');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/ad_server_partner_id" />');
        $fieldConfig->setUpdateOnChange(false);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::THIRD_PARTY_AD_SERVER_VIDEO_ID);
        $fieldConfig->setUserFriendlyFieldName('Entry ID');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(entryId)" />');
        $fieldConfig->setUpdateOnChange(false);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ADVERTISING_ALLOW_PRE_ROLL_ADS);
        $fieldConfig->setUserFriendlyFieldName('Allow Pre Roll Ads');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_pre_roll_ads" />');
        $fieldConfig->setUpdateOnChange(false);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ADVERTISING_ALLOW_MID_ROLL_ADS);
        $fieldConfig->setUserFriendlyFieldName('Allow Mid Roll Ads');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_mid_roll_ads" />');
        $fieldConfig->setUpdateOnChange(false);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::ADVERTISING_ALLOW_POST_ROLL_ADS);
        $fieldConfig->setUserFriendlyFieldName('Allow Post Roll Ads');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/allow_post_roll_ads" />');
        $fieldConfig->setUpdateOnChange(false);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::LOCATION_COUNTRY);
        $fieldConfig->setUserFriendlyFieldName('Location country');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::LOCATION_LOCATION_TEXT);
        $fieldConfig->setUserFriendlyFieldName('Location text');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::LOCATION_ZIP_CODE);
        $fieldConfig->setUserFriendlyFieldName('Location zip code');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YouTubeDistributionField::DISTRIBUTION_RESTRICTION_DISTRIBUTION_RULE);
        $fieldConfig->setUserFriendlyFieldName('Distribution restriction rule');
        $fieldConfig->setEntryMrssXslt('<xsl:text></xsl:text>');
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_ACTOR, 'Asset actor', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_BROADCASTER, 'Asset broadcaster', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_CONTENT_TYPE, 'Asset content type', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_CUSTOM_ID, 'Asset custom id', '<xsl:value-of select="string(entryId)" />');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_DESCRIPTION, 'Asset description', '<xsl:value-of select="string(description)" />');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_DIRECTOR, 'Asset director', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_EIDR, 'Asset EIDR', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_END_YEAR, 'Asset end year', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_EPISODE, 'Asset episode', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_GENRE, 'Asset genre', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_GRID, 'Asset GRid', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_ISAN, 'Asset ISAN', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_KEYWORDS, 'Asset keywords', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_NOTES, 'Asset notes', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_ORIGINAL_RELEASE_DATE, 'Asset original release date', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_ORIGINAL_RELEASE_MEDIUM, 'Asset original medium', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_PRODUCER, 'Asset producer', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_RATING_SYSTEM, 'Asset rating system', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_RATING_VALUE, 'Asset rating value', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_SEASON, 'Asset season', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_SHOW_AND_MOVIE_PROGRAMMING, 'Asset show and movie programming', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_SHOW_TITLE, 'Asset show title', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_SPOKEN_LANGUAGE, 'Asset spoken language', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_START_YEAR, 'Asset start year', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_SUBTITLED_LANGUAGE, 'Asset subtitles language', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_TITLE, 'Asset title', '<xsl:value-of select="string(title)" />');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_TYPE, 'Asset type', '<xsl:text>web</xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_TMS_ID, 'Asset TMS ID', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_UPC, 'Asset UPC', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_URL, 'Asset URL', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ASSET_WRITER, 'Asset Writer', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::VIDEO_ALLOW_COMMENT_RATINGS, 'Video allow comment ratings', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::VIDEO_ALLOW_SYNDICATION, 'Video allow syndication', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::VIDEO_CHANNEL, 'Video channel', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::VIDEO_HIDE_VIEW_COUNT, 'Video hide view count', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::VIDEO_DOMAIN_BLACK_LIST, 'Video domain black list', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::VIDEO_DOMAIN_WHITE_LIST, 'Video domain white list', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::VIDEO_NOTIFY_SUBSCRIBERS, 'Video notify subscribers', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::VIDEO_PUBLIC, 'Video public', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::VIDEO_CHANNEL, 'Video channel', '<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/account_username" />');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::CLAIM_TYPE, 'Claim type', '<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/claim_type" />');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::CLAIM_BLOCK_OUTSIDE_OWNERSHIP, 'Video block outside ownership', '<xsl:text></xsl:text>');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::ADVERTISING_INSTREAM_STANDARD, 'Instream standard', '<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/instream_standard" />');
        $this->addDistributionFieldConfig($fieldConfigArray, YouTubeDistributionField::DISABLE_FINGERPRINTING, 'Disable fingerprinting/claiming', '<xsl:text></xsl:text>');
        if ($this->getFeedSpecVersion() == YouTubeDistributionFeedSpecVersion::VERSION_2) {
            $this->removeDistributionFieldConfigs($fieldConfigArray, $this->specV1OnlyFields);
        } else {
            $this->removeDistributionFieldConfigs($fieldConfigArray, $this->specV2OnlyFields);
        }
        return $fieldConfigArray;
    }
    protected function getDefaultFieldConfigArray()
    {
        $fieldConfigArray = parent::getDefaultFieldConfigArray();
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::CHANNEL_TITLE);
        $fieldConfig->setUserFriendlyFieldName('Channel title');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/channel_title" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_ENTRY_ID);
        $fieldConfig->setUserFriendlyFieldName('item entry id');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(entryId)" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_CREATED_AT);
        $fieldConfig->setUserFriendlyFieldName('item created at');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(createdAt)" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_UPDATED_AT);
        $fieldConfig->setUserFriendlyFieldName('item updated at');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(updatedAt)" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_START_DATE);
        $fieldConfig->setUserFriendlyFieldName('entry valid time');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunrise" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_END_DATE);
        $fieldConfig->setUserFriendlyFieldName('entry expiration time');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunset" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_TITLE);
        $fieldConfig->setUserFriendlyFieldName('item title');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_DESCRIPTION);
        $fieldConfig->setUserFriendlyFieldName('item description');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(description)" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //tags
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_TAGS);
        $fieldConfig->setUserFriendlyFieldName('Entry tags');
        $fieldConfig->setEntryMrssXslt('<xsl:for-each select="tags/tag">
						<xsl:if test="position() &gt; 1">
							<xsl:text>,</xsl:text>
						</xsl:if>
						<xsl:value-of select="." />
					</xsl:for-each>');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::TAGS));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //categories
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_CATEGORIES);
        $fieldConfig->setUserFriendlyFieldName('Entry categories');
        $fieldConfig->setEntryMrssXslt('<xsl:for-each select="category">
						<xsl:if test="position() &gt; 1">
							<xsl:text>,</xsl:text>
						</xsl:if>
						<xsl:value-of select="." />
					</xsl:for-each>');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_METADATA_SHORT_TITLE);
        $fieldConfig->setUserFriendlyFieldName('metadata short title');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/AttUverseShortTitle" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_METADATA_TUNEIN);
        $fieldConfig->setUserFriendlyFieldName('metadata tunein');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/AttUverseTunein" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_METADATA_CONTENT_RATING);
        $fieldConfig->setUserFriendlyFieldName('metadata content rating');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/AttUverseContentRating" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_METADATA_LEGAL_DISCLAIMER);
        $fieldConfig->setUserFriendlyFieldName('metadata legal disclaimer');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/AttUverseLegalDisclaimer" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(AttUverseDistributionField::ITEM_METADATA_GENRE);
        $fieldConfig->setUserFriendlyFieldName('metadata genre');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="customData/metadata/AttUverseGenre" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        return $fieldConfigArray;
    }
Esempio n. 25
0
    protected function getDefaultFieldConfigArray()
    {
        $fieldConfigArray = parent::getDefaultFieldConfigArray();
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::CONTACT_TELEPHONE);
        $fieldConfig->setUserFriendlyFieldName('Contact telephone');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/contact_telephone" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::CONTACT_EMAIL);
        $fieldConfig->setUserFriendlyFieldName('Contact email');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/contact_email" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_MODIFIED_DATE);
        $fieldConfig->setUserFriendlyFieldName('Video modified date');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(updatedAt)" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_FEEDITEM_ID);
        $fieldConfig->setUserFriendlyFieldName('feed item id');
        //TODO: insert /, Category, /, and then entryId, for example: ID="/nat/041405flagirl
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(entryId)" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_TITLE);
        $fieldConfig->setUserFriendlyFieldName('Entry name');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(title)" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::NAME));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_DESCRIPTION);
        $fieldConfig->setUserFriendlyFieldName('Entry description');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(description)" />');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::DESCRIPTION));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_ROUTING);
        $fieldConfig->setUserFriendlyFieldName('Entry categories');
        $fieldConfig->setEntryMrssXslt('<xsl:for-each select="category">
						<xsl:if test="position() &gt; 1">
							<xsl:text>,</xsl:text>
						</xsl:if>
						<xsl:value-of select="." />
					</xsl:for-each>');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::CATEGORIES));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_KEYWORDS);
        $fieldConfig->setUserFriendlyFieldName('Entry tags');
        $fieldConfig->setEntryMrssXslt('<xsl:for-each select="tags/tag">
						<xsl:if test="position() &gt; 1">
							<xsl:text>,</xsl:text>
						</xsl:if>
						<xsl:value-of select="." />
					</xsl:for-each>');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setUpdateParams(array(entryPeer::TAGS));
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_VALID_TIME);
        $fieldConfig->setUserFriendlyFieldName('entry valid time');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunrise" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_EXPIRATION_TIME);
        $fieldConfig->setUserFriendlyFieldName('entry expiration time');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="distribution[@entryDistributionId=$entryDistributionId]/sunset" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //link title
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_LINK_TITLE);
        $fieldConfig->setUserFriendlyFieldName('video link title');
        $fieldConfig->setEntryMrssXslt('<xsl:for-each select="customData/metadata/YahooLinkTitle">
						<xsl:if test="position() &gt; 1">
							<xsl:text>;</xsl:text>
						</xsl:if>
						<xsl:value-of select="." />
					</xsl:for-each>');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        //link url
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_LINK_URL);
        $fieldConfig->setUserFriendlyFieldName('video link url');
        $fieldConfig->setEntryMrssXslt('<xsl:for-each select="customData/metadata/YahooLinkUrl">
						<xsl:if test="position() &gt; 1">
							<xsl:text>;</xsl:text>
						</xsl:if>
						<xsl:value-of select="." />
					</xsl:for-each>');
        $fieldConfig->setUpdateOnChange(true);
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::REQUIRED_BY_PROVIDER);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        $fieldConfig = new DistributionFieldConfig();
        $fieldConfig->setFieldName(YahooDistributionField::VIDEO_DURATION);
        $fieldConfig->setUserFriendlyFieldName('video duration');
        $fieldConfig->setEntryMrssXslt('<xsl:value-of select="string(media/duration)" />');
        $fieldConfig->setIsRequired(DistributionFieldRequiredStatus::NOT_REQUIRED);
        $fieldConfigArray[$fieldConfig->getFieldName()] = $fieldConfig;
        return $fieldConfigArray;
    }
 public function getOptionalAssetDistributionRules()
 {
     $ret = parent::getOptionalAssetDistributionRules();
     if (!class_exists('CaptionPlugin') || !CaptionPlugin::isAllowedPartner($this->getPartnerId())) {
         return $ret;
     }
     $isCaptionCondition = new kAssetDistributionPropertyCondition();
     $isCaptionCondition->setPropertyName(assetPeer::translateFieldName(assetPeer::TYPE, BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME));
     $isCaptionCondition->setPropertyValue(CaptionPlugin::getAssetTypeCoreValue(CaptionAssetType::CAPTION));
     $captionDistributionRule = new kAssetDistributionRule();
     $captionDistributionRule->setAssetDistributionConditions(array($isCaptionCondition));
     $ret[] = $captionDistributionRule;
     return $ret;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     $allFieldValues = $this->getAllFieldValues($entryDistribution);
     if (!$allFieldValues || !is_array($allFieldValues)) {
         KalturaLog::err('Error getting field values from entry distribution id [' . $entryDistribution->getId() . '] profile id [' . $this->getId() . ']');
         return $validationErrors;
     }
     $validationErrors = array_merge($validationErrors, $this->validateMaxLength($this->maxLengthValidation, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateInListOrNull($this->inListOrNullValidation, $allFieldValues, $action));
     $validationErrors = array_merge($validationErrors, $this->validateEndDateNotPrecedesStartDatet($allFieldValues, $entryDistribution, $action));
     return $validationErrors;
 }
 public function validateForSubmission(EntryDistribution $entryDistribution, $action)
 {
     $validationErrors = parent::validateForSubmission($entryDistribution, $action);
     // make sure that all flavor assets marked for distribution have a flavor params id assigned to them
     $flavorAssetIds = explode(',', $entryDistribution->getFlavorAssetIds());
     if (count($flavorAssetIds)) {
         $c = new Criteria();
         $c->addAnd(assetPeer::ID, $flavorAssetIds, Criteria::IN);
         $flavorTypes = KalturaPluginManager::getExtendedTypes(assetPeer::OM_CLASS, assetType::FLAVOR);
         $c->add(assetPeer::TYPE, $flavorTypes, Criteria::IN);
         $flavorAssets = assetPeer::doSelect($c);
         foreach ($flavorAssets as $asset) {
             /* @var $asset flavorAsset */
             if (strlen($asset->getFlavorParamsId()) <= 0) {
                 $validationErrors[] = $this->createValidationError($action, DistributionErrorType::INVALID_DATA, 'flavor asset', 'flavor asset must be assigned to a flavor params id');
             }
         }
     }
     return $validationErrors;
 }