eZ Publish  [4.2]
eZBinaryFileType Class Reference

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

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

List of all members.

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 Attributes

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

Detailed Description

The class eZBinaryFileType handles files and association with content objects.

Definition at line 38 of file ezbinaryfiletype.php.


Member Function Documentation

eZBinaryFileType::checkFileUploads ( )

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

Definition at line 239 of file ezbinaryfiletype.php.

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

eZBinaryFileType::customObjectAttributeHTTPAction ( http,
action,
objectAttribute,
parameters 
)

Executes a custom action for an object attribute which was defined on the web page.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 372 of file ezbinaryfiletype.php.

eZBinaryFileType::deleteStoredObjectAttribute ( contentObjectAttribute,
version = null 
)

Delete stored attribute

Reimplemented from eZDataType.

Definition at line 183 of file ezbinaryfiletype.php.

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

Reimplemented from eZDataType.

Definition at line 81 of file ezbinaryfiletype.php.

eZBinaryFileType::eZBinaryFileType ( )

Definition at line 46 of file ezbinaryfiletype.php.

eZBinaryFileType::fetchClassAttributeHTTPInput ( http,
base,
classAttribute 
)

Fetches the HTTP input for the content class attribute.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 555 of file ezbinaryfiletype.php.

eZBinaryFileType::fetchObjectAttributeHTTPInput ( http,
base,
contentObjectAttribute 
)

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

Reimplemented from eZDataType.

Definition at line 305 of file ezbinaryfiletype.php.

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

Definition at line 55 of file ezbinaryfiletype.php.

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

eZBinaryFileType::fromString ( objectAttribute,
string 
)

Reimplemented from eZDataType.

Definition at line 652 of file ezbinaryfiletype.php.

eZBinaryFileType::handleDownload ( object,
objectVersion,
objectLanguage,
objectAttribute 
)

Updates download count for binary file.

Reimplemented from eZDataType.

Definition at line 535 of file ezbinaryfiletype.php.

eZBinaryFileType::hasObjectAttributeContent ( contentObjectAttribute)
Returns:
true if the datatype finds any content in the attribute $contentObjectAttribute.

Reimplemented from eZDataType.

Definition at line 578 of file ezbinaryfiletype.php.

eZBinaryFileType::hasStoredFileInformation ( object,
objectVersion,
objectLanguage,
objectAttribute 
)

We support file information

Reimplemented from eZDataType.

Definition at line 512 of file ezbinaryfiletype.php.

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

Reimplemented from eZDataType.

Definition at line 99 of file ezbinaryfiletype.php.

eZBinaryFileType::initializeObjectAttribute ( contentObjectAttribute,
currentVersion,
originalContentObjectAttribute 
)

Sets value according to current version

Reimplemented from eZDataType.

Definition at line 112 of file ezbinaryfiletype.php.

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

Inserts the file using the eZBinaryFile class.

Reimplemented from eZDataType.

Definition at line 402 of file ezbinaryfiletype.php.

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

Inserts the file using the eZBinaryFile class.

Reimplemented from eZDataType.

Definition at line 453 of file ezbinaryfiletype.php.

Referenced by fromString().

eZBinaryFileType::isHTTPFileInsertionSupported ( )

HTTP file insertion is supported.

Reimplemented from eZDataType.

Definition at line 386 of file ezbinaryfiletype.php.

eZBinaryFileType::isIndexable ( )
Returns:
true if the datatype can be indexed

Reimplemented from eZDataType.

Definition at line 599 of file ezbinaryfiletype.php.

eZBinaryFileType::isRegularFileInsertionSupported ( )

HTTP file insertion is supported.

Reimplemented from eZDataType.

Definition at line 394 of file ezbinaryfiletype.php.

eZBinaryFileType::metaData ( contentObjectAttribute)
Returns:
the text which should be indexed in the search engine. An associative array can be returned to enable searching in specific parts of the data. E.g. array( 'first_column' => "foo", 'second_column' => "bar" );

Reimplemented from eZDataType.

Definition at line 604 of file ezbinaryfiletype.php.

eZBinaryFileType::objectAttributeContent ( objectAttribute)

Returns the content data for the given content object attribute.

Reimplemented from eZDataType.

Definition at line 587 of file ezbinaryfiletype.php.

eZBinaryFileType::serializeContentClassAttribute ( classAttribute,
attributeNode,
attributeParametersNode 
)

Adds the necessary dom structure to the attribute parameters.

Note:
The default is to add unsupported='true' to the attribute node, meaning that the datatype does not support serializing.

Reimplemented from eZDataType.

Definition at line 616 of file ezbinaryfiletype.php.

eZBinaryFileType::serializeContentObjectAttribute ( package,
objectAttribute 
)
Parameters:
package
objectAttributecontent attribute
Returns:
a DOM representation of the content object attribute

Reimplemented from eZDataType.

Definition at line 666 of file ezbinaryfiletype.php.

eZBinaryFileType::storedFileInformation ( object,
objectVersion,
objectLanguage,
objectAttribute 
)

Extracts file information for the binaryfile entry.

Reimplemented from eZDataType.

Definition at line 521 of file ezbinaryfiletype.php.

eZBinaryFileType::storeObjectAttribute ( contentObjectAttribute)

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

Reimplemented from eZDataType.

Definition at line 368 of file ezbinaryfiletype.php.

eZBinaryFileType::supportsBatchInitializeObjectAttribute ( )

Reimplemented from eZDataType.

Definition at line 744 of file ezbinaryfiletype.php.

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

Returns the object title.

Reimplemented from eZDataType.

Definition at line 567 of file ezbinaryfiletype.php.

eZBinaryFileType::toString ( objectAttribute)
Returns:
string representation of an contentobjectattribute data for simplified export

Reimplemented from eZDataType.

Definition at line 638 of file ezbinaryfiletype.php.

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.

Reimplemented from eZDataType.

Definition at line 132 of file ezbinaryfiletype.php.

eZBinaryFileType::unserializeContentClassAttribute ( classAttribute,
attributeNode,
attributeParametersNode 
)

Extracts values from the attribute parameters and sets it in the class attribute.

Note:
This function is called after the attribute has been stored and a second store is called after this function is done.

Reimplemented from eZDataType.

Definition at line 626 of file ezbinaryfiletype.php.

eZBinaryFileType::unserializeContentObjectAttribute ( package,
objectAttribute,
attributeNode 
)

Unserialize contentobject attribute

Parameters:
package
objectAttributecontentobject attribute object
attributeNodeezdomnode object

Reimplemented from eZDataType.

Definition at line 689 of file ezbinaryfiletype.php.

eZBinaryFileType::validateObjectAttributeHTTPInput ( http,
base,
contentObjectAttribute 
)

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

Reimplemented from eZDataType.

Definition at line 261 of file ezbinaryfiletype.php.

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

Reimplemented from eZDataType.

Definition at line 63 of file ezbinaryfiletype.php.


Member Data Documentation

const eZBinaryFileType::DATA_TYPE_STRING = "ezbinaryfile"

Definition at line 44 of file ezbinaryfiletype.php.

Definition at line 40 of file ezbinaryfiletype.php.

const eZBinaryFileType::MAX_FILESIZE_VARIABLE = '_ezbinaryfile_max_filesize_'

Definition at line 42 of file ezbinaryfiletype.php.


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