eZPublishCommunityProject(LegacyStack)  2013.9
eZBinaryFileType Class Reference

The class eZBinaryFileType handles files and association with content objects. More...

+ Inheritance diagram for eZBinaryFileType:
+ Collaboration diagram for eZBinaryFileType:

Public Member Functions

 checkFileUploads ()
 
 customObjectAttributeHTTPAction ($http, $action, $contentObjectAttribute, $parameters)
 
 deleteStoredObjectAttribute ($contentObjectAttribute, $version=null)
 
 editTemplate ($contentobjectAttribute)
 
 eZBinaryFileType ()
 
 fetchClassAttributeHTTPInput ($http, $base, $classAttribute)
 
 fetchObjectAttributeHTTPInput ($http, $base, $contentObjectAttribute)
 
 fileHandler ()
 
 fromString ($objectAttribute, $string)
 
 handleDownload ($object, $objectVersion, $objectLanguage, $objectAttribute)
 
 hasObjectAttributeContent ($contentObjectAttribute)
 
 hasStoredFileInformation ($object, $objectVersion, $objectLanguage, $objectAttribute)
 
 informationTemplate ($contentobjectAttribute)
 
 initializeObjectAttribute ($contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
 
 insertHTTPFile ($object, $objectVersion, $objectLanguage, $objectAttribute, $httpFile, $mimeData, &$result)
 
 insertRegularFile ($object, $objectVersion, $objectLanguage, $objectAttribute, $filePath, &$result)
 
 isHTTPFileInsertionSupported ()
 
 isIndexable ()
 
 isRegularFileInsertionSupported ()
 
 metaData ($contentObjectAttribute)
 
 objectAttributeContent ($contentObjectAttribute)
 
 serializeContentClassAttribute ($classAttribute, $attributeNode, $attributeParametersNode)
 
 serializeContentObjectAttribute ($package, $objectAttribute)
 
 storedFileInformation ($object, $objectVersion, $objectLanguage, $objectAttribute)
 
 storeObjectAttribute ($contentObjectAttribute)
 
 supportsBatchInitializeObjectAttribute ()
 
 title ($contentObjectAttribute, $name="original_filename")
 
 toString ($objectAttribute)
 
 trashStoredObjectAttribute ($contentObjectAttribute, $version=null)
 
 unserializeContentClassAttribute ($classAttribute, $attributeNode, $attributeParametersNode)
 
 unserializeContentObjectAttribute ($package, $objectAttribute, $attributeNode)
 
 validateObjectAttributeHTTPInput ($http, $base, $contentObjectAttribute)
 
 viewTemplate ($contentobjectAttribute)
 
- Public Member Functions inherited from eZDataType
 attribute ($attr)
 
 attributes ()
 
 batchInitializeObjectAttributeData ($classAttribute)
 
 classAttributeContent ($classAttribute)
 
 classAttributeRemovableInformation ($classAttribute, $includeAll=true)
 
 classDisplayInformation ($classAttribute, $mergeInfo=false)
 
 cloneClassAttribute ($oldClassAttribute, $newClassAttribute)
 
 contentActionList ($classAttribute)
 Return content action(s) which can be performed on object containing the current datatype. More...
 
 createContentObjectAttributeDOMNode ($objectAttribute)
 Create empty content object attribute DOM node. More...
 
 customClassAttributeHTTPAction ($http, $action, $classAttribute)
 
 customObjectAttributeHTTPAction ($http, $action, $objectAttribute, $parameters)
 
 customSorting ()
 
 customSortingSQL ($params)
 
 deleteStoredClassAttribute ($classAttribute, $version=null)
 
 deleteStoredObjectAttribute ($objectAttribute, $version=null)
 
 diff ($old, $new, $options=false)
 
 editTemplate ($contentobjectAttribute)
 
 eZDataType ($dataTypeString, $name, $properties=array())
 
 fetchActionValue ($action, $actionName, &$value)
 
 fetchClassAttributeHTTPInput ($http, $base, $classAttribute)
 
 fetchCollectionAttributeHTTPInput ($collection, $collectionAttribute, $http, $base, $objectAttribute)
 
 fetchObjectAttributeHTTPInput ($http, $base, $objectAttribute)
 
 fixRelatedObjectItem ($contentObjectAttribute, $objectID, $mode)
 
 fixupClassAttributeHTTPInput ($http, $base, $classAttribute)
 
 fixupCollectionAttributeHTTPInput ($http, $base, $objectAttribute)
 
 fixupObjectAttributeHTTPInput ($http, $base, $objectAttribute)
 
 fromString ($objectAttribute, $string)
 
 getDBAExtensionFilePath ()
 
 getDBAFileName ()
 
 getDBAFilePath ($checkExtensions=true)
 
 handleCustomObjectHTTPActions ($http, $attributeDataBaseName, $customActionAttributeArray, $customActionParameters)
 
 handleDownload ($object, $objectVersion, $objectLanguage, $objectAttribute)
 
 hasAttribute ($attr)
 
 hasInformationCollection ()
 
 hasObjectAttributeContent ($contentObjectAttribute)
 
 hasStoredFileInformation ($object, $objectVersion, $objectLanguage, $objectAttribute)
 
 importDBDataFromDBAFile ($dbaFilePath=false)
 
 informationTemplate ($contentobjectAttribute)
 
 initializeClassAttribute ($classAttribute)
 
 initializeObjectAttribute ($objectAttribute, $currentVersion, $originalContentObjectAttribute)
 
 insertHTTPFile ($object, $objectVersion, $objectLanguage, $objectAttribute, $httpFile, $mimeData, &$result)
 
 insertRegularFile ($object, $objectVersion, $objectLanguage, $objectAttribute, $filePath, &$result)
 
 insertSimpleString ($object, $objectVersion, $objectLanguage, $objectAttribute, $string, &$result)
 
 isA ()
 
 isAddToBasketValidationRequired ()
 
 isClassAttributeRemovable ($classAttribute)
 
 isHTTPFileInsertionSupported ()
 
 isIndexable ()
 
 isInformationCollector ()
 
 isRegularFileInsertionSupported ()
 
 isSimpleStringInsertionSupported ()
 
 isTranslatable ()
 Indicates if datatype supports being translated. More...
 
 metaData ($contentObjectAttribute)
 
 objectAttributeContent ($objectAttribute)
 
 objectDisplayInformation ($objectAttribute, $mergeInfo=false)
 
 onPublish ($contentObjectAttribute, $contentObject, $publishedNodes)
 
 postInitializeObjectAttribute ($objectAttribute, $currentVersion, $originalContentObjectAttribute)
 
 postStore ($objectAttribute)
 
 postUnserializeContentObjectAttribute ($package, $objectAttribute)
 
 preStoreClassAttribute ($classAttribute, $version)
 
 preStoreDefinedClassAttribute ($classAttribute)
 
 preStoreModifiedClassAttribute ($classAttribute)
 
 preStoreVersionedClassAttribute ($classAttribute, $version)
 Hook function which is called before an content class attribute is stored. More...
 
 productOptionInformation ($objectAttribute, $optionID, $productItem)
 
 removeRelatedObjectItem ($contentObjectAttribute, $objectID)
 
 repairContentObjectAttribute ($contentObjectAttribute)
 
 restoreTrashedObjectAttribute ($objectAttribute)
 Restores the content object attribute $objectAttribute from trash Default implementation does nothing. More...
 
 resultTemplate (&$collectionAttribute)
 
 serializeContentClassAttribute ($classAttribute, $attributeNode, $attributeParametersNode)
 
 serializeContentObjectAttribute ($package, $objectAttribute)
 
 sortKey ($objectAttribute)
 
 sortKeyType ()
 
 storeClassAttribute ($classAttribute, $version)
 
 storeDefinedClassAttribute ($classAttribute)
 
 storedFileInformation ($object, $objectVersion, $objectLanguage, $objectAttribute)
 
 storeModifiedClassAttribute ($classAttribute)
 
 storeObjectAttribute ($objectAttribute)
 
 storeVersionedClassAttribute ($classAttribute, $version)
 
 supportsBatchInitializeObjectAttribute ()
 
 templateList ()
 
 title ($objectAttribute, $name=null)
 
 toString ($objectAttribute)
 
 trashStoredObjectAttribute ($objectAttribute, $version=null)
 
 unserializeContentClassAttribute ($classAttribute, $attributeNode, $attributeParametersNode)
 
 unserializeContentObjectAttribute ($package, $objectAttribute, $attributeNode)
 
 validateAddToBasket ($objectAttribute, $data, &$errors)
 
 validateClassAttributeHTTPInput ($http, $base, $classAttribute)
 
 validateCollectionAttributeHTTPInput ($http, $base, $objectAttribute)
 
 validateObjectAttributeHTTPInput ($http, $base, $objectAttribute)
 
 viewTemplate ($contentobjectAttribute)
 

Public Attributes

const DATA_TYPE_STRING = "ezbinaryfile"
 
const MAX_FILESIZE_FIELD = 'data_int1'
 
const MAX_FILESIZE_VARIABLE = '_ezbinaryfile_max_filesize_'
 
- Public Attributes inherited from eZDataType
 $DataTypeString
 The datatype string ID, used for uniquely identifying a datatype. More...
 
 $Name
 The descriptive name of the datatype, usually used for displaying to the user. More...
 

Private Member Functions

 isDeletingFile (eZHTTPTool $http, eZContentObjectAttribute $contentObjectAttribute)
 Checks if current HTTP request is asking for current binary file deletion. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from eZDataType
static allowedTypes ()
 
static create ($dataTypeString)
 
static loadAndRegisterAllTypes ()
 
static loadAndRegisterType ($type)
 
static register ($dataTypeString, $className)
 
static registeredDataTypes ()
 

Detailed Description

The class eZBinaryFileType handles files and association with content objects.

Member Function Documentation

eZBinaryFileType::checkFileUploads ( )

Checks if file uploads are enabled, if not it gives a warning.

Referenced by customObjectAttributeHTTPAction(), fetchObjectAttributeHTTPInput(), and validateObjectAttributeHTTPInput().

eZBinaryFileType::customObjectAttributeHTTPAction (   $http,
  $action,
  $contentObjectAttribute,
  $parameters 
)
eZBinaryFileType::deleteStoredObjectAttribute (   $contentObjectAttribute,
  $version = null 
)

Delete stored attribute

Referenced by customObjectAttributeHTTPAction().

eZBinaryFileType::editTemplate (   $contentobjectAttribute)
Returns
the template name to use for editing the attribute.
Note
Default is to return the datatype string which is OK for most datatypes, if you want dynamic templates reimplement this function and return a template name.
The returned template name does not include the .tpl extension.
See Also
viewTemplate, informationTemplate
eZBinaryFileType::eZBinaryFileType ( )
eZBinaryFileType::fetchClassAttributeHTTPInput (   $http,
  $base,
  $classAttribute 
)
eZBinaryFileType::fetchObjectAttributeHTTPInput (   $http,
  $base,
  $contentObjectAttribute 
)

Fetches the http post var integer input and stores it in the data instance.

eZBinaryFileType::fileHandler ( )
Returns
the binary file handler.

Referenced by editTemplate(), informationTemplate(), and viewTemplate().

eZBinaryFileType::fromString (   $objectAttribute,
  $string 
)
eZBinaryFileType::handleDownload (   $object,
  $objectVersion,
  $objectLanguage,
  $objectAttribute 
)

Updates download count for binary file.

eZBinaryFileType::hasObjectAttributeContent (   $contentObjectAttribute)
eZBinaryFileType::hasStoredFileInformation (   $object,
  $objectVersion,
  $objectLanguage,
  $objectAttribute 
)

We support file information

eZBinaryFileType::informationTemplate (   $contentobjectAttribute)
Returns
the template name to use for information collection for the attribute.
Note
Default is to return the datatype string which is OK for most datatypes, if you want dynamic templates reimplement this function and return a template name.
The returned template name does not include the .tpl extension.
See Also
viewTemplate, editTemplate
eZBinaryFileType::initializeObjectAttribute (   $contentObjectAttribute,
  $currentVersion,
  $originalContentObjectAttribute 
)

Sets value according to current version

eZBinaryFileType::insertHTTPFile (   $object,
  $objectVersion,
  $objectLanguage,
  $objectAttribute,
  $httpFile,
  $mimeData,
$result 
)

Inserts the file using the eZBinaryFile class.

eZBinaryFileType::insertRegularFile (   $object,
  $objectVersion,
  $objectLanguage,
  $objectAttribute,
  $filePath,
$result 
)

Inserts the file using the eZBinaryFile class.

Referenced by fromString().

eZBinaryFileType::isDeletingFile ( eZHTTPTool  $http,
eZContentObjectAttribute  $contentObjectAttribute 
)
private

Checks if current HTTP request is asking for current binary file deletion.

Parameters
eZHTTPTool$http
eZContentObjectAttribute$contentObjectAttribute
Returns
bool

Referenced by fetchObjectAttributeHTTPInput().

eZBinaryFileType::isHTTPFileInsertionSupported ( )

HTTP file insertion is supported.

eZBinaryFileType::isIndexable ( )
eZBinaryFileType::isRegularFileInsertionSupported ( )

HTTP file insertion is supported.

eZBinaryFileType::metaData (   $contentObjectAttribute)
eZBinaryFileType::objectAttributeContent (   $contentObjectAttribute)
eZBinaryFileType::serializeContentClassAttribute (   $classAttribute,
  $attributeNode,
  $attributeParametersNode 
)
eZBinaryFileType::serializeContentObjectAttribute (   $package,
  $objectAttribute 
)
eZBinaryFileType::storedFileInformation (   $object,
  $objectVersion,
  $objectLanguage,
  $objectAttribute 
)

Extracts file information for the binaryfile entry.

eZBinaryFileType::storeObjectAttribute (   $contentObjectAttribute)

Does nothing, since the file has been stored. See fetchObjectAttributeHTTPInput for the actual storing.

eZBinaryFileType::supportsBatchInitializeObjectAttribute ( )
eZBinaryFileType::title (   $contentObjectAttribute,
  $name = "original_filename" 
)

Returns the object title.

eZBinaryFileType::toString (   $objectAttribute)
Returns
string representation of an contentobjectattribute data for simplified export
eZBinaryFileType::trashStoredObjectAttribute (   $contentObjectAttribute,
  $version = null 
)

The object is being moved to trash, do any necessary changes to the attribute. Rename file and update db row with new name, so that access to the file using old links no longer works.

eZBinaryFileType::unserializeContentClassAttribute (   $classAttribute,
  $attributeNode,
  $attributeParametersNode 
)
eZBinaryFileType::unserializeContentObjectAttribute (   $package,
  $objectAttribute,
  $attributeNode 
)
eZBinaryFileType::validateObjectAttributeHTTPInput (   $http,
  $base,
  $contentObjectAttribute 
)

Validates the input and returns true if the input was valid for this datatype.

eZBinaryFileType::viewTemplate (   $contentobjectAttribute)
Returns
the template name which the handler decides upon.

Member Data Documentation

const eZBinaryFileType::DATA_TYPE_STRING = "ezbinaryfile"
const eZBinaryFileType::MAX_FILESIZE_FIELD = 'data_int1'
const eZBinaryFileType::MAX_FILESIZE_VARIABLE = '_ezbinaryfile_max_filesize_'

The documentation for this class was generated from the following file: