public function setType() { $this->type = kPluginableEnumsManager::coreToApi("KalturaBulkUploadType", BulkUploadXmlPlugin::getApiValue(BulkUploadXmlType::XML)); }
public static function getPluginSchema($type) { $coreType = kPluginableEnumsManager::apiToCore('SchemaType', $type); if ($coreType != self::getSchemaTypeCoreValue(DropFolderXmlSchemaType::DROP_FOLDER_XML)) { return null; } $xmlApiType = BulkUploadXmlPlugin::getApiValue(XmlSchemaType::BULK_UPLOAD_XML); $baseXsdElement = BulkUploadXmlPlugin::getPluginSchema($xmlApiType); $xsd = '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">'; foreach ($baseXsdElement->children('http://www.w3.org/2001/XMLSchema') as $element) { /* @var $element SimpleXMLElement */ $xsd .= ' ' . $element->asXML(); } $xsd .= ' <xs:complexType name="T_dropFolderFileContentResource"> <xs:choice minOccurs="0" maxOccurs="1"> <xs:element name="fileSize" type="xs:long" minOccurs="1" maxOccurs="1"> <xs:annotation> <xs:documentation> The expected size of the file<br/> Used for validation </xs:documentation> </xs:annotation> </xs:element> <xs:element name="fileChecksum" minOccurs="1" maxOccurs="1"> <xs:annotation> <xs:documentation> The expected checksum of the file<br/> md5 or sha1<br/> Used for validation </xs:documentation> </xs:annotation> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute name="type" use="optional" default="md5"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="md5"/> <xs:enumeration value="sha1"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:choice> <xs:attribute name="filePath" use="required"> <xs:annotation> <xs:documentation> The name of the file in the drop folder </xs:documentation> </xs:annotation> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="500"/> </xs:restriction> </xs:simpleType> </xs:attribute> <xs:attribute name="dropFolderFileId" type="xs:string" use="optional"> <xs:annotation> <xs:documentation> The id of the drop folder file object </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <xs:element name="dropFolderFileContentResource" type="T_dropFolderFileContentResource" substitutionGroup="contentResource-extension"> <xs:annotation> <xs:documentation>Specifies that content file location is within a Kaltura defined drop folder</xs:documentation> <xs:appinfo> <example title="Using file size validation example"> <item> <action>add</action> <type>1</type> <media>...</media> <content>...</content> <thumbnail> <dropFolderFileContentResource filePath="file.jpg"> <fileSize>453453344</fileSize> </dropFolderFileContentResource> </thumbnail> </item> </example> <example title="Using checksum validation example"> <item> <action>add</action> <type>1</type> <media>...</media> <content>...</content> <thumbnail> <dropFolderFileContentResource filePath="file.jpg"> <fileChecksum type="md5">sdfsjodf90sfsdfzfasdfwrg34</fileChecksum> </dropFolderFileContentResource> </thumbnail> </item> </example> </xs:appinfo> </xs:annotation> </xs:element> '; $schemaContributors = KalturaPluginManager::getPluginInstances('IKalturaSchemaContributor'); foreach ($schemaContributors as $key => $schemaContributor) { /* @var $schemaContributor IKalturaSchemaContributor */ $elements = $schemaContributor->contributeToSchema($xmlApiType); if ($elements) { $xsd .= $elements; } } $xsd .= ' </xs:schema>'; return new SimpleXMLElement($xsd); }
/** * @return array */ public static function getAdditionalDescriptions() { return array(BulkUploadXmlPlugin::getApiValue(self::BULK_UPLOAD_XML) => 'Bulk upload', BulkUploadXmlPlugin::getApiValue(self::BULK_UPLOAD_RESULT_XML) => 'Bulk upload results'); }