eZ Publish  [trunk]
eZPackageCreationHandler Class Reference

The class eZPackageCreationHandler does. More...

+ Inheritance diagram for eZPackageCreationHandler:

List of all members.

Public Member Functions

 attribute ($name)
 attributes ()
 checkPackageMaintainer ($package, &$persistentData)
 commitPackageChangelog ($package, $http, $step, &$persistentData, $tpl)
 commitPackageInformation ($package, $http, $step, &$persistentData, $tpl)
 commitPackageMaintainer ($package, $http, $step, &$persistentData, $tpl)
 commitPackageThumbnail ($package, $http, $step, &$persistentData, $tpl)
 commitStep ($package, $http, $step, &$persistentData, $tpl)
 commitStepMethodMap ()
 createPackage (&$package, $http, &$persistentData, &$cleanupFiles, $storePackage=true)
 eZPackageCreationHandler ($id, $name, $steps)
 finalize (&$package, $http, &$persistentData)
 generatePackageInformation (&$packageInformation, $package, $http, $step, &$persistentData)
 generateStepMap ($package, &$persistentData)
 hasAttribute ($name)
 initialChangelogEntry ($package, $http, $step, &$persistentData, $tpl)
 initializePackageChangelog ($package, $http, $step, &$persistentData, $tpl)
 initializePackageInformation ($package, $http, $step, &$persistentData, $tpl)
 initializePackageMaintainer ($package, $http, $step, &$persistentData, $tpl)
 initializePackageThumbnail ($package, $http, $step, &$persistentData, $tpl)
 initializeStep ($package, $http, $step, &$persistentData, $tpl)
 initializeStepMethodMap ()
 loadStep ($package, $http, $currentStepID, &$persistentData, $tpl, &$module)
 loadStepMethodMap ()
 packageInitialState ($package, &$persistentData)
 packageInstallType ($package, &$persistentData)
 packageType ($package, &$persistentData)
stepMap ()
 stepTemplate ($step)
 validateAndAdvanceStep ($package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
 validatePackageChangelog ($package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
 validatePackageInformation ($package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
 validatePackageMaintainer ($package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
 validatePackageThumbnail ($package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
 validateStep ($package, $http, $currentStepID, &$stepMap, &$persistentData, &$errorList)
 validateStepMethodMap ()

Static Public Member Functions

static appendLicence ($package)
static creatorLimitationList ()
static & creatorList ($checkRoles=false)
static instance ($handlerName)
 Returns a shared instance of the eZPackageCreationHandler class pr $handlerName as defined in package.ini[CreationSettings]HandlerAlias.
 packageChangelogStep ()
 packageInformationStep ()
 packageMaintainerStep ()
 packageThumbnailStep ()

Detailed Description

The class eZPackageCreationHandler does.

Definition at line 18 of file ezpackagecreationhandler.php.


Member Function Documentation

static eZPackageCreationHandler::appendLicence ( package) [static]

Appends the GPL licence file to the package object $package.

Definition at line 952 of file ezpackagecreationhandler.php.

Referenced by createPackage().

Definition at line 104 of file ezpackagecreationhandler.php.

Referenced by generateStepMap(), and stepTemplate().

eZPackageCreationHandler::checkPackageMaintainer ( package,
&$  persistentData 
)

Checks if the maintainer step is required and return true if so, otherwise false. The maintainer step is not required if the user has no maintainer roles to use or if the package already has a maintainer with the same name as the current user.

Definition at line 883 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::commitPackageChangelog ( package,
http,
step,
&$  persistentData,
tpl 
)

Parses the changelog entry text and turns into an array with change entries.

Definition at line 784 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::commitPackageInformation ( package,
http,
step,
&$  persistentData,
tpl 
)

Commits package information.

Definition at line 712 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::commitPackageMaintainer ( package,
http,
step,
&$  persistentData,
tpl 
)

Commits maintainer step data. Does nothing for now.

Definition at line 873 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::commitPackageThumbnail ( package,
http,
step,
&$  persistentData,
tpl 
)

Commits thumbnail step data. Does nothing for now.

Definition at line 944 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::commitStep ( package,
http,
step,
&$  persistentData,
tpl 
)

This is called after a step has validated it's information. It can be used to put values in the $persistentData variable for later retrieval.

Definition at line 237 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::createPackage ( &$  package,
http,
&$  persistentData,
&$  cleanupFiles,
storePackage = true 
)

Creates a new package in $package and initializes it with the basic data. The information is taken from the $persistentData which must be filled in prior to this function is called.

Returns:
true if the package was created or false if it was only re-initialized.
See also:
packageType, packageInitialState and packageInstallType

Definition at line 483 of file ezpackagecreationhandler.php.

Referenced by eZContentClassPackageCreator\finalize(), eZExtensionPackageCreator\finalize(), eZContentObjectPackageCreator\finalize(), and eZStylePackageCreator\finalize().

Returns:
a list of the available creators usable as a limitation in the role system.

Definition at line 263 of file ezpackagecreationhandler.php.

static& eZPackageCreationHandler::creatorList ( checkRoles = false) [static]
Returns:
a list of the available creators.

Definition at line 279 of file ezpackagecreationhandler.php.

Referenced by creatorLimitationList().

eZPackageCreationHandler::finalize ( &$  package,
http,
&$  persistentData 
)

Finalizes the creation process with the gathered information. This is usually the function that creates the package and adds the proper elements.

Reimplemented in eZStylePackageCreator, eZContentObjectPackageCreator, eZExtensionPackageCreator, and eZContentClassPackageCreator.

Definition at line 255 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::generatePackageInformation ( &$  packageInformation,
package,
http,
step,
&$  persistentData 
)

This is called on the package information step to initialize the name, summary and description fields. Reimplementing this function allows the creator to fill in some default values for the information fields.

Note:
The default does nothing.

Reimplemented in eZStylePackageCreator, eZContentObjectPackageCreator, eZExtensionPackageCreator, and eZContentClassPackageCreator.

Definition at line 593 of file ezpackagecreationhandler.php.

Referenced by initializePackageInformation().

eZPackageCreationHandler::generateStepMap ( package,
&$  persistentData 
)

Will go over the steps and make sure that:

  • The next and previous links are correct
  • Steps that aren't needed are removed

It will also make sure that steps can be looked up by their ID.

Definition at line 43 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::initialChangelogEntry ( package,
http,
step,
&$  persistentData,
tpl 
)
Returns:
The initial changelog entry for a package. It is possible to get different initial texts by reimplementing this function.
Note:
This function is called from initializePackageChangelog()

Definition at line 454 of file ezpackagecreationhandler.php.

Referenced by initializePackageChangelog().

eZPackageCreationHandler::initializePackageChangelog ( package,
http,
step,
&$  persistentData,
tpl 
)

Initializes the package changelog step with some values taken from the current users and the funcvtion initialChangelogEntry().

Definition at line 720 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::initializePackageInformation ( package,
http,
step,
&$  persistentData,
tpl 
)

Initializes the package information step with some default values. It will call generatePackageInformation() after the values are initialized.

Definition at line 601 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::initializePackageMaintainer ( package,
http,
step,
&$  persistentData,
tpl 
)

Initializes the package maintainer step with some values taken from the current user.

Definition at line 821 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::initializePackageThumbnail ( package,
http,
step,
&$  persistentData,
tpl 
)

Initializes the package thumbnail step.

Definition at line 913 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::initializeStep ( package,
http,
step,
&$  persistentData,
tpl 
)

This is called the first time the step is entered (ie. not on validations) and can be used to fill in values in the $persistentData variable for use in the template or later retrieval.

Definition at line 161 of file ezpackagecreationhandler.php.

static eZPackageCreationHandler::instance ( handlerName) [static]

Returns a shared instance of the eZPackageCreationHandler class pr $handlerName as defined in package.ini[CreationSettings]HandlerAlias.

Parameters:
string$handlerName
Returns:
eZPackageCreationHandler

Definition at line 336 of file ezpackagecreationhandler.php.

Referenced by creatorList(), eZContentObjectPackageCreator\initializeObjectLimits(), initializePackageInformation(), eZContentObjectPackageCreator\loadObjectLimits(), and validatePackageInformation().

eZPackageCreationHandler::loadStep ( package,
http,
currentStepID,
&$  persistentData,
tpl,
&$  module 
)

Called each time a step is loaded, and can be used to fetch and process input data in each step.

Definition at line 177 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::packageInitialState ( package,
&$  persistentData 
)
Returns:
the initial state of the package.

The state of a package generally tells how stable a package is, see eZPackage::stateList() for more information on possible states.

Note:
The default returns 'alpha'

Reimplemented in eZStylePackageCreator, eZExtensionPackageCreator, eZContentObjectPackageCreator, and eZContentClassPackageCreator.

Definition at line 443 of file ezpackagecreationhandler.php.

Referenced by createPackage().

eZPackageCreationHandler::packageInstallType ( package,
&$  persistentData 
)
Returns:
the type installation this package uses.

This method is called from the createPackage() method and will return 'install' by default. If you want the creator to have a different install type reimplement this function in the creator.

Reimplemented in eZStylePackageCreator, and eZExtensionPackageCreator.

Definition at line 431 of file ezpackagecreationhandler.php.

Referenced by createPackage().

Returns:
A ready to use creation step which takes care of fetching a thumbnail image.

Definition at line 414 of file ezpackagecreationhandler.php.

Referenced by eZStylePackageCreator\eZStylePackageCreator().

eZPackageCreationHandler::packageType ( package,
&$  persistentData 
)
Returns:
The package type taken from $package if the package exists, otherwise false. If the creator should have a specific package type this function should be reimplemented. See eZPackage::typeList() for more information on available types.
Note:
This function is called from createPackage and checkPackageMaintainer()

Reimplemented in eZStylePackageCreator, eZExtensionPackageCreator, eZContentObjectPackageCreator, and eZContentClassPackageCreator.

Definition at line 467 of file ezpackagecreationhandler.php.

Referenced by checkPackageMaintainer(), and createPackage().

Returns:
a process step map which has proper next/previous links, method maps and allows lookup of steps by ID.

Definition at line 139 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::validateAndAdvanceStep ( package,
http,
currentStepID,
&$  stepMap,
&$  persistentData,
&$  errorList 
)

Definition at line 219 of file ezpackagecreationhandler.php.

Referenced by validateStep().

eZPackageCreationHandler::validatePackageChangelog ( package,
http,
currentStepID,
&$  stepMap,
&$  persistentData,
&$  errorList 
)

Checks if the POST variables contains a name and email for the changelog person and the changelog field contains some text.

Definition at line 743 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::validatePackageInformation ( package,
http,
currentStepID,
&$  stepMap,
&$  persistentData,
&$  errorList 
)

Reads in the package information values from POST variables and makes sure that the package name and package summary is filled in, the version is in correct format and that a package does not already exists with the same name.

Definition at line 631 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::validatePackageMaintainer ( package,
http,
currentStepID,
&$  stepMap,
&$  persistentData,
&$  errorList 
)

Checks if the POST variables has a name and email for the person.

Definition at line 838 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::validatePackageThumbnail ( package,
http,
currentStepID,
&$  stepMap,
&$  persistentData,
&$  errorList 
)

Checks if the POST variables has a proper thumbnail image.

Definition at line 921 of file ezpackagecreationhandler.php.

eZPackageCreationHandler::validateStep ( package,
http,
currentStepID,
&$  stepMap,
&$  persistentData,
&$  errorList 
)

This is called after a step is finished. Reimplement this function to validate the step values and give back errors.

Returns:
false if the next step should not be fetched (ie. errors) or true if the all is OK and the next step should be fetched. It is also possible to return a step identifier, in which case this will be the next step.

Definition at line 198 of file ezpackagecreationhandler.php.


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