eZ Publish  [trunk]
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_'

Private Member Functions

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

Detailed Description

The class eZBinaryFileType handles files and association with content objects.

Definition at line 18 of file ezbinaryfiletype.php.


Member Function Documentation

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

Definition at line 219 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 357 of file ezbinaryfiletype.php.

eZBinaryFileType::deleteStoredObjectAttribute ( contentObjectAttribute,
version = null 
)

Delete stored attribute

Reimplemented from eZDataType.

Definition at line 163 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 61 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 540 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 285 of file ezbinaryfiletype.php.

Returns:
the binary file handler.

Definition at line 35 of file ezbinaryfiletype.php.

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

eZBinaryFileType::fromString ( objectAttribute,
string 
)

Reimplemented from eZDataType.

Definition at line 637 of file ezbinaryfiletype.php.

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

Updates download count for binary file.

Reimplemented from eZDataType.

Definition at line 520 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 563 of file ezbinaryfiletype.php.

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

We support file information

Reimplemented from eZDataType.

Definition at line 497 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 79 of file ezbinaryfiletype.php.

eZBinaryFileType::initializeObjectAttribute ( contentObjectAttribute,
currentVersion,
originalContentObjectAttribute 
)

Sets value according to current version

Reimplemented from eZDataType.

Definition at line 92 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 387 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 438 of file ezbinaryfiletype.php.

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

Definition at line 738 of file ezbinaryfiletype.php.

Referenced by fetchObjectAttributeHTTPInput().

HTTP file insertion is supported.

Reimplemented from eZDataType.

Definition at line 371 of file ezbinaryfiletype.php.

Returns:
true if the datatype can be indexed

Reimplemented from eZDataType.

Definition at line 584 of file ezbinaryfiletype.php.

HTTP file insertion is supported.

Reimplemented from eZDataType.

Definition at line 379 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 589 of file ezbinaryfiletype.php.

Returns the content data for the given content object attribute.

Reimplemented from eZDataType.

Definition at line 572 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 601 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 651 of file ezbinaryfiletype.php.

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

Extracts file information for the binaryfile entry.

Reimplemented from eZDataType.

Definition at line 506 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 353 of file ezbinaryfiletype.php.

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

Returns the object title.

Reimplemented from eZDataType.

Definition at line 552 of file ezbinaryfiletype.php.

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

Reimplemented from eZDataType.

Definition at line 623 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 112 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 611 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 674 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 241 of file ezbinaryfiletype.php.

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

Reimplemented from eZDataType.

Definition at line 43 of file ezbinaryfiletype.php.


Member Data Documentation

const eZBinaryFileType::DATA_TYPE_STRING = "ezbinaryfile"

Definition at line 24 of file ezbinaryfiletype.php.

Definition at line 20 of file ezbinaryfiletype.php.

const eZBinaryFileType::MAX_FILESIZE_VARIABLE = '_ezbinaryfile_max_filesize_'

Definition at line 22 of file ezbinaryfiletype.php.


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