eZ Publish  [trunk]
eZImageType Class Reference

The class eZImageType handles image accounts and association with content objects. More...

+ Inheritance diagram for eZImageType:
+ Collaboration diagram for eZImageType:

List of all members.

Public Member Functions

 customObjectAttributeHTTPAction ($http, $action, $contentObjectAttribute, $parameters)
 deleteStoredObjectAttribute ($contentObjectAttribute, $version=null)
 eZImageType ()
 fetchClassAttributeHTTPInput ($http, $base, $classAttribute)
 fetchObjectAttributeHTTPInput ($http, $base, $contentObjectAttribute)
 Fetch object attribute http input, override the ezDataType method This method is triggered when submiting a http form which includes Image class Image is stored into file system every time there is a file input and validation result is valid.
 fromString ($objectAttribute, $string)
 hasObjectAttributeContent ($contentObjectAttribute)
 hasStoredFileInformation ($object, $objectVersion, $objectLanguage, $objectAttribute)
 initializeObjectAttribute ($contentObjectAttribute, $currentVersion, $originalContentObjectAttribute)
 insertHTTPFile ($object, $objectVersion, $objectLanguage, $objectAttribute, $httpFile, $mimeData, &$result)
 insertRegularFile ($object, $objectVersion, $objectLanguage, $objectAttribute, $filePath, &$result)
 isHTTPFileInsertionSupported ()
 isRegularFileInsertionSupported ()
 metaData ($contentObjectAttribute)
 objectAttributeContent ($contentObjectAttribute)
 onPublish ($contentObjectAttribute, $contentObject, $publishedNodes)
 restoreTrashedObjectAttribute ($contentObjectAttribute)
 Restores the content object attribute $objectAttribute from trash Default implementation does nothing.
 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)
 Validate the object attribute input in http.

Public Attributes

const DATA_TYPE_STRING = "ezimage"
const FILESIZE_FIELD = 'data_int1'
const FILESIZE_VARIABLE = '_ezimage_max_filesize_'

Detailed Description

The class eZImageType handles image accounts and association with content objects.

Note:
The method initializeObjectAttribute was removed in 3.8, the new storage technique removes the need to have it.

Definition at line 20 of file ezimagetype.php.


Member Function Documentation

eZImageType::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 476 of file ezimagetype.php.

eZImageType::deleteStoredObjectAttribute ( objectAttribute,
version = null 
)

Clean up stored object attribute

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 176 of file ezimagetype.php.

Definition at line 26 of file ezimagetype.php.

eZImageType::fetchClassAttributeHTTPInput ( http,
base,
classAttribute 
)

Fetches the HTTP input for the content class attribute.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 464 of file ezimagetype.php.

eZImageType::fetchObjectAttributeHTTPInput ( http,
base,
contentObjectAttribute 
)

Fetch object attribute http input, override the ezDataType method This method is triggered when submiting a http form which includes Image class Image is stored into file system every time there is a file input and validation result is valid.

Parameters:
$httphttp object
$base
$contentObjectAttribute: the content object attribute being handled
Returns:
true if content object is not null, false if content object is null

Reimplemented from eZDataType.

Definition at line 279 of file ezimagetype.php.

eZImageType::fromString ( objectAttribute,
string 
)

Reimplemented from eZDataType.

Definition at line 611 of file ezimagetype.php.

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

Reimplemented from eZDataType.

Definition at line 510 of file ezimagetype.php.

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

We support file information

Reimplemented from eZDataType.

Definition at line 401 of file ezimagetype.php.

eZImageType::initializeObjectAttribute ( objectAttribute,
currentVersion,
originalContentObjectAttribute 
)

Initializes the object attribute with some data.

Note:
Default implementation does nothing.

Reimplemented from eZDataType.

Definition at line 32 of file ezimagetype.php.

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

Inserts the file using the Image Handler eZImageAliasHandler.

Reimplemented from eZDataType.

Definition at line 355 of file ezimagetype.php.

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

Inserts the file using the Image Handler eZImageAliasHandler.

Reimplemented from eZDataType.

Definition at line 378 of file ezimagetype.php.

HTTP file insertion is supported.

Reimplemented from eZDataType.

Definition at line 339 of file ezimagetype.php.

Regular file insertion is supported.

Reimplemented from eZDataType.

Definition at line 347 of file ezimagetype.php.

eZImageType::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 525 of file ezimagetype.php.

eZImageType::objectAttributeContent ( objectAttribute)

Returns the content data for the given content object attribute.

Reimplemented from eZDataType.

Definition at line 518 of file ezimagetype.php.

eZImageType::onPublish ( contentObjectAttribute,
contentObject,
publishedNodes 
)

Performs necessary actions with attribute data after object is published, it means that you have access to published nodes.

Returns:
True if the value was stored correctly.
Note:
The method is entirely up to the datatype, for instance it could reuse the available types in the the attribute or store in a separate object.
Might be transaction unsafe.

Reimplemented from eZDataType.

Definition at line 430 of file ezimagetype.php.

Restores the content object attribute $objectAttribute from trash Default implementation does nothing.

Parameters:
eZContentObjectAttribute$objectAttribute

Reimplemented from eZDataType.

Definition at line 110 of file ezimagetype.php.

eZImageType::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 533 of file ezimagetype.php.

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

Reimplemented from eZDataType.

Definition at line 556 of file ezimagetype.php.

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

Extracts file information for the image entry.

Reimplemented from eZDataType.

Definition at line 410 of file ezimagetype.php.

eZImageType::storeObjectAttribute ( objectAttribute)

Stores the datatype data to the database which is related to the object attribute.

Returns:
True if the value was stored correctly.
Note:
The method is entirely up to the datatype, for instance it could reuse the available types in the the attribute or store in a separate object.
See also:
fetchObjectAttributeHTTPInput

Reimplemented from eZDataType.

Definition at line 317 of file ezimagetype.php.

Reimplemented from eZDataType.

Definition at line 629 of file ezimagetype.php.

eZImageType::title ( contentObjectAttribute,
name = 'original_filename' 
)

Will return one of the following items from the original alias.

  • alternative_text - If it's not empty
  • Default paramater in $name if it exists
  • original_filename, this is the default fallback.

Reimplemented from eZDataType.

Definition at line 494 of file ezimagetype.php.

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

Reimplemented from eZDataType.

Definition at line 603 of file ezimagetype.php.

eZImageType::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 45 of file ezimagetype.php.

eZImageType::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 544 of file ezimagetype.php.

eZImageType::unserializeContentObjectAttribute ( package,
objectAttribute,
attributeNode 
)

Unserialize contentobject attribute

Parameters:
package
objectAttributecontentobject attribute object
attributeNodeezdomnode object

Reimplemented from eZDataType.

Definition at line 576 of file ezimagetype.php.

eZImageType::validateObjectAttributeHTTPInput ( http,
base,
contentObjectAttribute 
)

Validate the object attribute input in http.

If there is validation failure, there failure message will be put into $contentObjectAttribute->ValidationError

Parameters:
$http,:http object
$base,:
$contentObjectAttribute,:content object attribute being validated
Returns:
validation result- eZInputValidator::STATE_INVALID or eZInputValidator::STATE_ACCEPTED
See also:
kernel/classes/eZDataTypevalidateObjectAttributeHTTPInput($http, $base, $objectAttribute)

Reimplemented from eZDataType.

Definition at line 199 of file ezimagetype.php.


Member Data Documentation

const eZImageType::DATA_TYPE_STRING = "ezimage"

Definition at line 24 of file ezimagetype.php.

const eZImageType::FILESIZE_FIELD = 'data_int1'

Definition at line 22 of file ezimagetype.php.

const eZImageType::FILESIZE_VARIABLE = '_ezimage_max_filesize_'

Definition at line 23 of file ezimagetype.php.


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