* arguments mapping and validation works now (needs feed-back and proper testing)
authorJochen Rau <j.rau@web.de>
Fri, 27 Feb 2009 16:10:11 +0000 (16:10 +0000)
committerJochen Rau <j.rau@web.de>
Fri, 27 Feb 2009 16:10:11 +0000 (16:10 +0000)
* adapted some Validators
* renamed in some methods property->argument unless we have a Property Mapper

35 files changed:
typo3/sysext/extbase/Classes/Controller/TX_EXTMVC_Controller_AbstractController.php
typo3/sysext/extbase/Classes/Controller/TX_EXTMVC_Controller_ActionController.php
typo3/sysext/extbase/Classes/Controller/TX_EXTMVC_Controller_Argument.php
typo3/sysext/extbase/Classes/Controller/TX_EXTMVC_Controller_ArgumentsValidator.php
typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Persistence_InvalidChainIndex.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Persistence_InvalidSubject.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Persistence_NoValidatorFound.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Validation_Exception_InvalidChainIndex.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Validation_Exception_InvalidSubject.php [new file with mode: 0755]
typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Validation_Exception_NoValidatorFound.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/TX_EXTMVC_Validation_ValidatorInterface.php
typo3/sysext/extbase/Classes/Validation/TX_EXTMVC_Validation_ValidatorResolver.php
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Alphanumeric.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_EmailAddress.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Float.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Integer.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_NotEmpty.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Number.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_NumberRange.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Raw.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_RegularExpression.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Text.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_UUID.php [deleted file]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Alphanumeric.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_EmailAddress.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Float.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Integer.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_NotEmpty.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Number.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_NumberRange.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Raw.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_RegularExpression.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Text.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_UUID.php [new file with mode: 0644]
typo3/sysext/extbase/class.tx_extmvc_dispatcher.php

index fefdaa1..40417f7 100755 (executable)
@@ -24,6 +24,7 @@ declare(ENCODING = 'utf-8');
 require_once(t3lib_extMgm::extPath('extmvc') . 'Classes/Controller/TX_EXTMVC_Controller_ControllerInterface.php');
 require_once(t3lib_extMgm::extPath('extmvc') . 'Classes/Controller/TX_EXTMVC_Controller_Arguments.php');
 require_once(t3lib_extMgm::extPath('extmvc') . 'Classes/Exception/TX_EXTMVC_Exception_StopAction.php');
+require_once(t3lib_extMgm::extPath('extmvc') . 'Classes/Validation/TX_EXTMVC_Validation_ValidatorResolver.php');
 
 /**
  * An abstract base class for Controllers
@@ -61,9 +62,29 @@ abstract class TX_EXTMVC_Controller_AbstractController implements TX_EXTMVC_Cont
        protected $arguments;
        
        /**
-        * @var array An array of allowed property names (or regular expressions matching those)
+        * @var TX_EXTMVC_Controller_Arguments Arguments passed to the controller
+        */
+       protected $validator;
+       
+       /**
+        * @var array Validation errors
+        */
+       protected $errors = array();
+       
+       /**
+        * @var array Validation warnings
+        */
+       protected $warnings = array();
+       
+       /**
+        * @var array An array of allowed arguemnt names (or regular expressions matching those)
         */
-       protected $allowedProperties = array('.*');
+       protected $allowedArguments = array('.*');
+
+       /**
+        * @var array An array of names of the required arguments (or regular expressions matching those)
+        */
+       protected $requiredArguments = array();
 
        /**
         * Constructs the controller.
@@ -186,25 +207,40 @@ abstract class TX_EXTMVC_Controller_AbstractController implements TX_EXTMVC_Cont
         * @author Robert Lemke <robert@typo3.org>
         */
        protected function mapRequestArgumentsToLocalArguments() {
-               $this->setAllowedProperties(array_merge($this->arguments->getArgumentNames(), $this->arguments->getArgumentShortNames()));
-               $requestArguments = $this->request->getArguments();
-               foreach ($requestArguments as $requestArgument) {
-                       if ($this->isAllowedProperty($requestArgument->getName())) {
-                               $argument = $this->arguments->getArgument($requestArgument->getName());
-                               $argument->setValue($requestArgument->getValue());
+               $this->setAllowedArguments(array_merge($this->arguments->getArgumentNames(), $this->arguments->getArgumentShortNames()));
+               $this->validator = new TX_EXTMVC_Controller_ArgumentsValidator($this->arguments);
+               foreach ($this->request->getArguments() as $requestArgument) {
+                       if ($this->isAllowedArgument($requestArgument)) {
+                               $argumentName = $requestArgument->getName();
+                               $argumentValue = $requestArgument->getValue();
+                               if (!$this->setArgumentValue($argumentName, $argumentValue)) {                                  
+                                       if ($this->isRequiredArgument($requestArgument)) {
+                                               $this->errors[] = 'The argument "' . $argumentName . '" could not be set, but was marked as required.';
+                                       } else {
+                                               $this->warnings[] = 'The argument "' . $argumentName . '" could not be set.';
+                                       }
+                               }
+                       } else {
+                               $this->warnings[] = 'The argument "' . $requestArgument->getName() . '" was not allowed not be set.';
                        }
                }
+               
+               if(!$isValid) {
+                       // TODO Do something with the warnings and error messages
+                       // debug($this->errors);
+                       // debug($this->warnings);
+               }
        }
        
        /**
         * Defines the property names which are allowed for mapping.
         *
-        * @param  array $allowedProperties: An array of allowed property names. Each entry in this array may be a regular expression.
+        * @param  array $allowedArguments: An array of allowed argument names.
         * @return void
         * @author Robert Lemke <robert@typo3.org>
         */
-       protected function setAllowedProperties(array $allowedProperties) {
-               $this->allowedProperties = $allowedProperties;
+       protected function setAllowedArguments(array $allowedArguments) {
+               $this->allowedArguments = $allowedArguments;
        }
 
        /**
@@ -213,31 +249,85 @@ abstract class TX_EXTMVC_Controller_AbstractController implements TX_EXTMVC_Cont
         * @return array The allowed properties
         * @author Robert Lemke <robert@typo3.org>
         */
-       protected function getAllowedProperties() {
-               return $this->allowedProperties;
+       protected function getAllowedArguments() {
+               return $this->allowedArguments;
        }
        
        /**
-        * Checks if the give property is among the allowed properties.
+        * Checks if the give argument is among the allowed arguments. Each entry in this array may be a regular expression.
         *
-        * @param string $propertyName Property name to check for
-        * @return boolean TRUE if the property is allowed, else FALSE
+        * @param TX_EXTMVC_Controller_Argument $argument The Argument to check for
+        * @return boolean TRUE if the argument is allowed, else FALSE
         * @author Robert Lemke <robert@typo3.org>
+        * @author Jochen Rau <jochen.rau@typoplanet.de>
         * @see map()
         */
-       protected function isAllowedProperty($propertyName) {
-               if (current($this->allowedProperties) === '.*') return TRUE;
+       protected function isAllowedArgument(TX_EXTMVC_Controller_Argument $argument) {
+               if (current($this->allowedArguments) === '.*') return TRUE;
 
                $isAllowed = FALSE;
-               foreach ($this->allowedProperties as $allowedProperty) {
-                       if (preg_match('/^' . $allowedProperty . '$/', $propertyName) === 1) {
+               foreach ($this->allowedArguments as $allowedArgumentName) {
+                       if (preg_match('/^' . $allowedArgumentName . '$/', $argument->getName()) === 1) {
                                $isAllowed = TRUE;
                                break;
                        }
                }
                return $isAllowed;
        }
+
+       /**
+        * Checks if the given argument is required
+        *
+        * @param TX_EXTMVC_Controller_Argument $argument The argument to check for
+        * @return boolean TRUE if the property is required, else FALSE
+        * @author Jochen Rau <jochen.rau@typoplanet.de>
+        */
+       protected function isRequiredArgument($argument) {
+               if ($this->arguments[$argument->getName()] instanceof TX_EXTMVC_Controller_Argument) {
+                       return (boolean)$this->arguments[$argument->getName()]->isRequired();
+               } else {
+                       return FALSE;
+               }
+       }
+
+       
+       /**
+        * Sets the given value of the specified property at the target object.
+        *
+        * @param string $propertyName Name of the property to set
+        * @param string $propertyValue Value of the property
+        * @return boolean Returns TRUE, if the setting was successfull
+        * @author Robert Lemke <robert@typo3.org>
+        * @author Sebastian Kurfürst <sebastian@typo3.org>
+        * @see map()
+        */
+       protected function setArgumentValue($argumentName, $argumentValue) {
+               if ($this->validator !== NULL) {
+                       $validatorErrors = $this->createNewValidationErrorsObject();                    
+                       if (!$this->validator->isValidArgument($argumentName, $argumentValue, $validatorErrors)) {
+                               foreach ($validatorErrors as $error) {
+                                       $this->errors[] = $error;
+                               }
+                               return FALSE;
+                       }
+               }
+               $argument = $this->arguments[$argumentName];
+               $argument->setValue($argumentValue);
+               return TRUE;
+       }
        
+       /**
+        * This is a factory method to get a clean validation errors object
+        *
+        * @return TX_EXTMVC_Validation_Errors An empty errors object
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        */
+       protected function createNewValidationErrorsObject() {
+               return t3lib_div::makeInstance('TX_EXTMVC_Validation_Errors');
+       }
+
+
+               
 }
 
 ?>
\ No newline at end of file
index c959d10..02a031f 100644 (file)
@@ -99,7 +99,9 @@ class TX_EXTMVC_Controller_ActionController extends TX_EXTMVC_Controller_Abstrac
                // }
 
                $actionResult = call_user_func_array(array($this, $this->actionMethodName), $preparedArguments);
-               if (is_string($actionResult) && strlen($actionResult) > 0) {
+               if ($actionResult === NULL && $this->view instanceof TX_EXTMVC_View_ViewInterface) {
+                       $this->response->appendContent($this->view->render());
+               } elseif (is_string($actionResult) && strlen($actionResult) > 0) {
                        $this->response->appendContent($actionResult);
                }
        }
index 802f757..f2c35da 100644 (file)
@@ -66,6 +66,30 @@ class TX_EXTMVC_Controller_Argument {
         */
        protected $isValid = TRUE;
 
+       /**
+        * Any error (TX_EXTMVC_Error_Error) that occured while initializing this argument (e.g. a mapping error)
+        * @var array
+        */
+       protected $errors = array();
+
+       /**
+        * Any warning (TX_EXTMVC_Error_Warning) that occured while initializing this argument (e.g. a mapping warning)
+        * @var array
+        */
+       protected $warnings = array();
+
+       /**
+        * The property validator for this argument
+        * @var TX_EXTMVC_Validation_ValidatorInterface
+        */
+       protected $validator = NULL;
+
+       /**
+        * The property validator for this arguments datatype
+        * @var TX_EXTMVC_Validation_ValidatorInterface
+        */
+       protected $datatypeValidator = NULL;
+
        /**
         * Uid for the argument, if it has one
         * @var string
@@ -129,6 +153,15 @@ class TX_EXTMVC_Controller_Argument {
         */
        public function setDataType($dataType) {
                $this->dataType = ($dataType != '' ? $dataType : 'Text');
+
+               $dataTypeValidatorClassName = 'TX_EXTMVC_Validation_Validator_' . $this->dataType;
+               $classFilePathAndName = t3lib_extMgm::extPath('extmvc') . 'Classes/Validation/Validator/' . $dataTypeValidatorClassName . '.php';
+               if (isset($classFilePathAndName) && file_exists($classFilePathAndName)) {                       
+                       require_once($classFilePathAndName);
+                       $this->datatypeValidator = t3lib_div::makeInstance($dataTypeValidatorClassName);
+               } else {
+                       // TODO Should we throw an exception at this point?
+               }
                return $this;
        }
 
@@ -218,6 +251,82 @@ class TX_EXTMVC_Controller_Argument {
                return $this->isValid;
        }
        
+       /**
+        * Add an initialization error (e.g. a mapping error)
+        *
+        * @param TX_EXTMVC_Error_Error An error object
+        * @return void
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        */
+       public function addError(TX_EXTMVC_Error_Error $error) {
+               $this->errors[] = $error;
+       }
+
+       /**
+        * Get all initialization errors
+        *
+        * @return array An array containing TX_EXTMVC_Error_Error objects
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        * @see addError(TX_EXTMVC_Error_Error $error)
+        */
+       public function getErrors() {
+               return $this->errors;
+       }
+
+       /**
+        * Add an initialization warning (e.g. a mapping warning)
+        *
+        * @param TX_EXTMVC_Error_Warning A warning object
+        * @return void
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        */
+       public function addWarning(TX_EXTMVC_Error_Warning $warning) {
+               $this->warnings[] = $warning;
+       }
+
+       /**
+        * Get all initialization warnings
+        *
+        * @return array An array containing TX_EXTMVC_Error_Warning objects
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        * @see addWarning(TX_EXTMVC_Error_Warning $warning)
+        */
+       public function getWarnings() {
+               return $this->warnings;
+       }
+
+       /**
+        * Set an additional validator
+        *
+        * @param string Class name of a validator
+        * @return TX_EXTMVC_MVC_Controller_Argument Returns $this (used for fluent interface)
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        */
+       public function setValidator($className) {
+               $this->validator = t3lib_div::makeInstance($className);
+               return $this;
+       }
+
+       /**
+        * Returns the set validator
+        *
+        * @return TX_EXTMVC_Validation_ValidatorInterface The set validator, NULL if none was set
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        */
+       public function getValidator() {
+               return $this->validator;
+       }
+
+       /**
+        * Returns the set datatype validator
+        *
+        * @return TX_EXTMVC_Validation_ValidatorInterface The set datatype validator
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        */
+       public function getDatatypeValidator() {
+               return $this->datatypeValidator;
+       }
+       
        /**
         * Set the uid for the argument.
         *
index 9560799..c3738aa 100644 (file)
@@ -20,6 +20,7 @@ declare(ENCODING = 'utf-8');
  *                                                                        *
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
+require_once(t3lib_extMgm::extPath('extmvc') . 'Classes/Validation/TX_EXTMVC_Validation_Errors.php');
 
 /**
  * Validator for the controller arguments object
@@ -46,84 +47,26 @@ class TX_EXTMVC_controller_ArgumentsValidator {
        }
 
        /**
-        * Checks if classes of the given type can be validated with this
-        * validator.
-        *
-        * @param  string $className: Specifies the class type which is supposed to be validated. The check succeeds if this validator can handle the specified class or any subclass of it.
-        * @return boolean TRUE if this validator can validate the class type or FALSE if it can't
-        */
-       public function canValidate($className) {
-               return ($className === 'TX_EXTMVC_Controller_Arguments');
-       }
-
-       /**
-        * Validates the given object. Any errors will be stored in the passed errors
-        * object. If validation succeeds completely, this method returns TRUE. If at
-        * least one error occurred, the result is FALSE.
-        *
-        * @param object $object: The object which is supposed to be validated.
-        * @param TX_EXTMVC_Validation_Errors $errors: Here any occured validation error is stored
-        * @return boolean TRUE if validation succeeded completely, FALSE if at least one error occurred.
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        */
-       public function validate($object, TX_EXTMVC_Validation_Errors &$errors) {
-               if (!$object instanceof TX_EXTMVC_Controller_Arguments) throw new TX_EXTMVC_Validation_Exception_InvalidSubject('The specified object cannot be validated by this validator.', 1216720829);
-
-               $isValid = TRUE;
-               foreach ($object as $argument) {
-                       if ($argument->isRequired()) $isValid &= $this->validateProperty($object, $argument->getName(), $errors);
-               }
-
-               return (boolean)$isValid;
-       }
-
-       /**
-        * Validates a specific property ($propertyName) of the given object. Any errors will be stored
-        * in the given errors object. If validation succeeds, this method returns TRUE, else it will return FALSE.
-        * It also invokes any registered property editors.
-        *
-        * @param object $object: The object of which the property should be validated
-        * @param string $propertyName: The name of the property that should be validated
-        * @param TX_EXTMVC_Validation_Errors $errors: Here any occured validation error is stored
-        * @return boolean TRUE if the property could be validated, FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        */
-       public function validateProperty($object, $propertyName, TX_EXTMVC_Validation_Errors &$errors) {
-               if (!$object instanceof TX_EXTMVC_Controller_Arguments) throw new TX_EXTMVC_Validation_Exception_InvalidSubject('The specified object cannot be validated by this validator.', 1216720830);
-
-               $propertyValidatorErrors = $this->createNewValidationErrorsObject();
-
-               $isValid = TRUE;
-               if ($object[$propertyName]->getValidator() != NULL) $isValid &= $object[$propertyName]->getValidator()->isValidProperty($object[$propertyName]->getValue(), $propertyValidatorErrors);
-               $datatypeValidator = $object[$propertyName]->getDatatypeValidator();
-               $isValid &= $datatypeValidator->isValidProperty($object[$propertyName]->getValue(), $propertyValidatorErrors);
-
-               if (!$isValid) $errors[$propertyName] = $propertyValidatorErrors;
-
-               return (boolean)$isValid;
-       }
-
-       /**
-        * Returns TRUE, if the given property ($proptertyValue) is a valid value for the property ($propertyName) of the class ($className).
+        * Returns TRUE, if the given argument ($argumentValue) is a valid value for the property ($argumentName) of the class ($className).
         * Any errors will be stored in the given errors object. If at least one error occurred, the result is FALSE.
         *
-        * @param string $className: The propterty's class name
-        * @param string $propertyName: The name of the property for wich the value should be validated
-        * @param object $propertyValue: The value that should be validated
+        * @param string $argumentName: The name of the argument for wich the value should be validated
+        * @param object $argumentValue: The value that should be validated
         * @return boolean TRUE if the value could be validated for the given property, FALSE if an error occured
         */
-       public function isValidProperty($className, $propertyName, $propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-               $propertyValidatorErrors = $this->createNewValidationErrorsObject();
-
+       public function isValidArgument($argumentName, $argumentValue, TX_EXTMVC_Validation_Errors &$errors) {
                $isValid = TRUE;
-               if ($this->registeredArguments[$propertyName]->getValidator() != NULL) $isValid &= $this->registeredArguments[$propertyName]->getValidator()->isValidProperty($propertyValue->getValue(), $propertyValidatorErrors);
-               $isValid &= $this->registeredArguments[$propertyName]->getDatatypeValidator()->isValidProperty($propertyValue, $propertyValidatorErrors);
-
-               if (!$isValid) $errors[$propertyName] = $propertyValidatorErrors;
+               if ($this->registeredArguments[$argumentName]->getValidator() != NULL) {
+                       $isValid &= $this->registeredArguments[$argumentName]->getValidator()->isValidProperty($argumentValue, $errors);
+               } elseif ($this->registeredArguments[$argumentName]->getDatatypeValidator() != NULL) {
+                       $isValid = $this->registeredArguments[$argumentName]->getDatatypeValidator()->isValidProperty($argumentValue, $errors);                 
+               } else {
+                       throw new TX_EXTMVC_Validation_NoValidatorFound('No appropriate validator for the argument "' . $argumentName . '" was found.', 1235748909);
+               }
 
                return (boolean)$isValid;
        }
-
+       
        /**
         * This is a factory method to get a clean validation errors object
         *
@@ -133,5 +76,6 @@ class TX_EXTMVC_controller_ArgumentsValidator {
        protected function createNewValidationErrorsObject() {
                return t3lib_div::makeInstance('TX_EXTMVC_Validation_Errors');
        }
+
 }
 ?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Persistence_InvalidChainIndex.php b/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Persistence_InvalidChainIndex.php
deleted file mode 100644 (file)
index 8ac033d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * An "Invalid Chain Index" Exception for a validator chain
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_InvalidChainIndex extends TX_EXTMVC_Validation_Exception {
-
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Persistence_InvalidSubject.php b/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Persistence_InvalidSubject.php
deleted file mode 100755 (executable)
index 3d5b1c9..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * An "Invalid Subject" Exception
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_InvalidSubject extends TX_EXTMVC_Validation_Exception {
-
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Persistence_NoValidatorFound.php b/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Persistence_NoValidatorFound.php
deleted file mode 100644 (file)
index fe3441f..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * A "NoValidatorFound" Exception
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_NoValidatorFound extends TX_EXTMVC_Validation_Exception {
-
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Validation_Exception_InvalidChainIndex.php b/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Validation_Exception_InvalidChainIndex.php
new file mode 100644 (file)
index 0000000..8ac033d
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * @package FLOW3
+ * @subpackage Validation
+ * @version $ID:$
+ */
+
+/**
+ * An "Invalid Chain Index" Exception for a validator chain
+ *
+ * @package FLOW3
+ * @subpackage Validation
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_InvalidChainIndex extends TX_EXTMVC_Validation_Exception {
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Validation_Exception_InvalidSubject.php b/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Validation_Exception_InvalidSubject.php
new file mode 100755 (executable)
index 0000000..3d5b1c9
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * @package FLOW3
+ * @subpackage Validation
+ * @version $ID:$
+ */
+
+/**
+ * An "Invalid Subject" Exception
+ *
+ * @package FLOW3
+ * @subpackage Validation
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_InvalidSubject extends TX_EXTMVC_Validation_Exception {
+
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Validation_Exception_NoValidatorFound.php b/typo3/sysext/extbase/Classes/Validation/Exception/TX_EXTMVC_Validation_Exception_NoValidatorFound.php
new file mode 100644 (file)
index 0000000..fe3441f
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * @package FLOW3
+ * @subpackage Validation
+ * @version $ID:$
+ */
+
+/**
+ * A "NoValidatorFound" Exception
+ *
+ * @package FLOW3
+ * @subpackage Validation
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_NoValidatorFound extends TX_EXTMVC_Validation_Exception {
+
+}
+
+?>
\ No newline at end of file
index 13a33d5..9d070c0 100644 (file)
@@ -36,7 +36,6 @@ interface TX_EXTMVC_Validation_ValidatorInterface {
         *
         * @param  object $propertyValue: The value that should be validated
         * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
         */
        public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors);
 }
index 94c34ad..071c66a 100644 (file)
@@ -38,11 +38,25 @@ class TX_EXTMVC_Validation_ValidatorResolver {
         * @author Andreas Förthner <andreas.foerthner@netlogix.de>
         */
        public function resolveValidator($class) {
-               $validatorName = $class . 'Validator';
-               if (!$this->objectManager->isObjectRegistered($validatorName)) throw new TX_EXTMVC_Validation_Exception_NoValidatorFound('No validator with name ' . $validatorName . ' found!', 1211036055);
-               $validator = $this->objectManager->getObject($validatorName);
-               if (!($validator instanceof TX_EXTMVC_Validation_ObjectValidatorInterface)) throw new TX_EXTMVC_Validation_Exception_NoValidatorFound('The found validator class did not implement TX_EXTMVC_Validation_ObjectValidatorInterface', 1211036068);
-               return $validator;
+               try {
+                       $validatorClassName = $class . 'Validator';
+                       $classNameParts = explode('_', $className);
+                       if ($classNameParts[0] === 'ux') {
+                               array_shift($classNameParts);
+                       }
+                       if (count($classNameParts) > 2 && $classNameParts[0] === 'TX') {
+                               $classFilePathAndName = t3lib_extMgm::extPath(strtolower($classNameParts[1])) . 'Classes/';
+                               $classFilePathAndName .= implode(array_slice($classNameParts, 2, -1), '/') . '/';
+                               $classFilePathAndName .= implode('_', $classNameParts) . '.php';
+                       }
+                       if (isset($classFilePathAndName) && file_exists($classFilePathAndName)) require_once($classFilePathAndName);            
+                       // if (!$this->objectManager->isObjectRegistered($validatorName)) throw new \F3\FLOW3\Validation\Exception\NoValidatorFound('No validator with name ' . $validatorName . ' found!', 1211036055);
+                       // $validator = $this->objectManager->getObject($validatorName);
+                       // if (!($validator instanceof \F3\FLOW3\Validation\ObjectValidatorInterface)) throw new \F3\FLOW3\Validation\Exception\NoValidatorFound('The found validator class did not implement \F3\FLOW3\Validation\ObjectValidatorInterface', 1211036068);
+                       return $validator;
+               } catch (TX_EXTMVC_Validation_Exception_NoValidatorFound $exception) {
+                       $this->validator = NULL;
+               }
        }
 
        /**
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Alphanumeric.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Alphanumeric.php
deleted file mode 100644 (file)
index ad5fa7e..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * Validator for alphanumeric strings
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_Alphanumeric {
-
-       /**
-        * Returns TRUE, if the given property ($propertyValue) is a valid
-        * alphanumeric string, which is defined as [a-zA-Z0-9]*.
-        * Any errors will be stored in the given errors object.
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param mixed $propertyValue The value that should be validated
-        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
-        * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-
-               if (is_string($propertyValue) && preg_match('/^[a-z0-9]*$/i', $propertyValue)) return TRUE;
-
-               $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was not a valid integer. Got: "' . $propertyValue . '"', 1221551320));
-               return FALSE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_EmailAddress.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_EmailAddress.php
deleted file mode 100644 (file)
index 9887528..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * Validator for email addresses
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_EmailAddress {
-
-       /**
-        * Returns TRUE, if the given property ($proptertyValue) is a valid email address.
-        * Any errors will be stored in the given errors object.
-        * If at least one error occurred, the result is FALSE.
-        *
-        * The regexp is a modified version of the last one shown on
-        * http://www.regular-expressions.info/email.html
-        *
-        * Still it will probably miss a lot of technically valid addresses, see RFC822
-        * for the whole mumbo-jumbo. Or have a look at this:
-        *
-        * (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
-        * )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:
-        * \r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(
-        * ?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
-        * \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\0
-        * 31]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\
-        * ](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+
-        * (?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:
-        * (?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
-        * |(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)
-        * ?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\
-        * r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
-        *  \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)
-        * ?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t]
-        * )*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[
-        *  \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*
-        * )(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t]
-        * )+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)
-        * *:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+
-        * |\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r
-        * \n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:
-        * \r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t
-        * ]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031
-        * ]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](
-        * ?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?
-        * :(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?
-        * :\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?
-        * :(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?
-        * [ \t]))*"(?:(?:\r\n)?[ \t])*)*:(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\]
-        * \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|
-        * \\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>
-        * @,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"
-        * (?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t]
-        * )*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
-        * ".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?
-        * :[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[
-        * \]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:[^()<>@,;:\\".\[\] \000-
-        * \031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(
-        * ?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;
-        * :\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([
-        * ^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\"
-        * .\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\
-        * ]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\
-        * [\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\
-        * r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
-        * \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]
-        * |\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\] \0
-        * 00-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\
-        * .|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,
-        * ;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?
-        * :[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*
-        * (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
-        * \[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[
-        * ^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\]
-        * ]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*(
-        * ?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
-        * ".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(
-        * ?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[
-        * \["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t
-        * ])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t
-        * ])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?
-        * :\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|
-        * \Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*|(?:
-        * [^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".\[\
-        * ]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)
-        * ?[ \t])*(?:@(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["
-        * ()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)
-        * ?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>
-        * @,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*(?:,@(?:(?:\r\n)?[
-        *  \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,
-        * ;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t]
-        * )*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\
-        * ".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*)*:(?:(?:\r\n)?[ \t])*)?
-        * (?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\["()<>@,;:\\".
-        * \[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:
-        * \r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z|(?=[\[
-        * "()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[ \t]))*"(?:(?:\r\n)?[ \t])
-        * *))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])
-        * +|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*)(?:\
-        * .(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t])+|\Z
-        * |(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[ \t])*))*\>(?:(
-        * ?:\r\n)?[ \t])*))*)?;\s*)
-        * (from http://ex-parrot.com/~pdw/Mail-RFC822-Address.html)
-        *
-        * @param mixed $propertyValue The value that should be validated
-        * @param TX_EXTMVC_Validation\Errors $errors Any occured Error will be stored here
-        * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception\InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation\Errors &$errors) {
-
-               if(is_string($propertyValue) && preg_match('
-                               /
-                                       [a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*
-                                       @
-                                       (?:
-                                               (?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[a-z]{2}|aero|asia|biz|cat|com|edu|coop|gov|info|int|invalid|jobs|localdomain|mil|mobi|museum|name|net|org|pro|tel|travel)|
-                                               localhost|
-                                               (?:(?:\d{1,2}|1\d{1,2}|2[0-5][0-5])\.){3}(?:(?:\d{1,2}|1\d{1,2}|2[0-5][0-5]))
-                                       )
-                                       \b
-                               /ix', $propertyValue)) return TRUE;
-               $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was not a valid email address. Got: "' . $propertyValue . '"', 1221559976));
-               return FALSE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Float.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Float.php
deleted file mode 100644 (file)
index 1b37ebe..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * Validator for floats
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_Float {
-
-       /**
-        * Returns TRUE, if the given propterty ($proptertyValue) is a valid float.
-        * Any errors will be stored in the given errors object.
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param  object $propertyValue The value that should be validated
-        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
-        * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-
-               if (is_float($propertyValue)) return TRUE;
-               if (is_string($propertyValue) && strpos($propertyValue, '.') && preg_match('/^[0-9.e+-]+$/', $propertyValue)) return TRUE;
-
-               $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was not a valid float. Got: "' . $propertyValue . '"', 1221560288));
-               return FALSE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Integer.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Integer.php
deleted file mode 100644 (file)
index 28bd7fc..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * Validator for integers
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_Integer {
-
-       /**
-        * Returns TRUE, if the given propterty ($proptertyValue) is a valid integer.
-        * Any errors will be stored in the given errors object.
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param mixed $propertyValue The value that should be validated
-        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
-        * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-
-               if (filter_var($propertyValue, FILTER_VALIDATE_INT) !== FALSE) return TRUE;
-
-               $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was not a valid integer. Got: "' . $propertyValue . '"', 1221560494));
-               return FALSE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_NotEmpty.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_NotEmpty.php
deleted file mode 100644 (file)
index 483ec84..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * Validator for not empty values
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_NotEmpty {
-
-       /**
-        * Returns TRUE, if the given propterty ($proptertyValue) is not empty (NULL or empty string).
-        * Any errors will be stored in the given errors object.
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param mixed $propertyValue The value that should be validated
-        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
-        * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-               if ($propertyValue === NULL) {
-                       $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was NULL.', 1221560910));
-                       return FALSE;
-               }
-               if ($propertyValue === '') {
-                       $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was empty.', 1221560718));
-                       return FALSE;
-               }
-
-               return TRUE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Number.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Number.php
deleted file mode 100644 (file)
index 8a30f60..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * Validator for general numbers
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_Number {
-
-       /**
-        * Returns TRUE, if the given propterty ($proptertyValue) is a valid number.
-        * Any errors will be stored in the given errors object.
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param mixed $propertyValue The value that should be validated
-        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
-        * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-
-               if (is_numeric($propertyValue)) return TRUE;
-
-               $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was not a valid number. Got: "' . $propertyValue . '"', 1221563685));
-               return FALSE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_NumberRange.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_NumberRange.php
deleted file mode 100644 (file)
index 047fc11..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * Validator for general numbers
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_NumberRange {
-
-       /**
-        * The start value of the range
-        * @var number
-        */
-       protected $startRange;
-
-       /**
-        * The end value of the range
-        * @var number
-        */
-       protected $endRange;
-
-       /**
-        * Constructor
-        *
-        * @param number The start of the range
-        * @param number The end of the range
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        */
-       public function __construct($startRange, $endRange) {
-               if ($startRange > $endRange) {
-                       $this->endRange = $startRange;
-                       $this->startRange = $endRange;
-               } else {
-                       $this->endRange = $endRange;
-                       $this->startRange = $startRange;
-               }
-       }
-
-       /**
-        * Returns TRUE, if the given propterty ($proptertyValue) is a valid number in the given range.
-        * Any errors will be stored in the given errors object.
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param mixed $propertyValue The value that should be validated
-        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
-        * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-
-               if (!is_numeric($propertyValue)) $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was not a valid number. Got: "' . $propertyValue . '"', 1221563685));
-               if ($propertyValue < $this->startRange || $propertyValue > $this->endRange) $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was not in the valid range (' . $this->startRange . ', ' . $this->endRange . '). Got: "' . $propertyValue . '"', 1221561046));
-
-               if (count($errors) > 0) return FALSE;
-               return TRUE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Raw.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Raw.php
deleted file mode 100644 (file)
index 3e23191..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * A validator which accepts any input
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_Raw implements TX_EXTMVC_Validation_ValidatorInterface {
-
-       /**
-        * Always returns TRUE.
-        *
-        * @param mixed $propertyValue ignored
-        * @param TX_EXTMVC_Validation_Errors $errors ignored
-        * @return boolean Always TRUE
-        * @author Robert Lemke <robert@typo3.org>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-               return TRUE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_RegularExpression.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_RegularExpression.php
deleted file mode 100644 (file)
index 33492b0..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * Validator for regular expressions
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_RegularExpression {
-
-       /**
-        * @var string The regular expression
-        */
-       protected $regularExpression;
-
-       /**
-        * Creates a RegularExpression validator with the given expression
-        *
-        * @param string The regular expression, must be ready to use with preg_match()
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        */
-       public function __construct($regularExpression) {
-               $this->regularExpression = $regularExpression;
-       }
-
-       /**
-        * Returns TRUE, if the given propterty ($proptertyValue) matches the given regular expression.
-        * Any errors will be stored in the given errors object.
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param mixed $propertyValue The value that should be validated
-        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
-        * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-
-               if (!is_string($propertyValue) || preg_match($this->regularExpression, $propertyValue) === 0) {
-                       $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject did not match the pattern. Got: "' . $propertyValue . '"', 1221565130));
-                       return FALSE;
-               }
-
-               return TRUE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Text.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_Text.php
deleted file mode 100644 (file)
index 6650e49..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * Validator for text
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_Text {
-
-       /**
-        * Returns TRUE, if the given propterty ($propertyValue) is a valid text (contains no XML tags).
-        * Any errors will be stored in the given errors object.
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param mixed $propertyValue The value that should be validated
-        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
-        * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-
-               if (!is_string($propertyValue) || preg_match('/<[_/]*[a-z,A-Z,0-9]*>/', $propertyValue)) {
-                       $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was not a valid text (contained XML tags). Got: "' . $propertyValue . '"', 1221565786));
-                       return FALSE;
-               }
-
-               return TRUE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_UUID.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Persistence_UUID.php
deleted file mode 100644 (file)
index ef779fa..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-declare(ENCODING = 'utf-8');
-namespace TX_EXTMVC_Validation_Validator;
-
-/*                                                                        *
- * This script belongs to the FLOW3 framework.                            *
- *                                                                        *
- * It is free software; you can redistribute it and/or modify it under    *
- * the terms of the GNU Lesser General Public License as published by the *
- * Free Software Foundation, either version 3 of the License, or (at your *
- * option) any later version.                                             *
- *                                                                        *
- * This script is distributed in the hope that it will be useful, but     *
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
- * General Public License for more details.                               *
- *                                                                        *
- * You should have received a copy of the GNU Lesser General Public       *
- * License along with the script.                                         *
- * If not, see http://www.gnu.org/licenses/lgpl.html                      *
- *                                                                        *
- * The TYPO3 project - inspiring people to share!                         *
- *                                                                        */
-
-/**
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- */
-
-/**
- * Validator for Universally Unique Identifiers
- *
- * @package FLOW3
- * @subpackage Validation
- * @version $ID:$
- * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
- */
-class TX_EXTMVC_Validation_UUID {
-
-       /**
-        * Returns TRUE, if the given property ($propertyValue) is a formally valid UUID.
-        * Any errors will be stored in the given errors object.
-        * If at least one error occurred, the result is FALSE.
-        *
-        * @param mixed $propertyValue The value that should be validated
-        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
-        * @return boolean TRUE if the value could be validated. FALSE if an error occured
-        * @throws TX_EXTMVC_Validation_Exception_InvalidSubject if this validator cannot validate the given subject or the subject is not an object.
-        * @author Robert Lemke <robert@typo3.org>
-        * @author Karsten Dambekalns <karsten@typo3.org>
-        */
-       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
-               if (!is_string($propertyValue) || !preg_match('/([a-f0-9]){8}-([a-f0-9]){4}-([a-f0-9]){4}-([a-f0-9]){4}-([a-f0-9]){12}/', $propertyValue)) {
-                       $errors->append($this->objectFactory->create('TX_EXTMVC_Validation_Error', 'The given subject was not a valid UUID. Got: "' . $propertyValue . '"', 1221565853));
-                       return FALSE;
-               }
-
-               return TRUE;
-       }
-}
-
-?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Alphanumeric.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Alphanumeric.php
new file mode 100644 (file)
index 0000000..23af6df
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Validator for alphanumeric strings
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_Alphanumeric {
+
+       /**
+        * Returns TRUE, if the given property ($propertyValue) is a valid
+        * alphanumeric string, which is defined as [a-zA-Z0-9]*.
+        * Any errors will be stored in the given errors object.
+        * If at least one error occurred, the result is FALSE.
+        *
+        * @param mixed $propertyValue The value that should be validated
+        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
+        * @return boolean TRUE if the value could be validated. FALSE if an error occured
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+
+               if (is_string($propertyValue) && preg_match('/^[a-z0-9]*$/i', $propertyValue)) return TRUE;
+
+               $errors->append('The given subject was not a valid integer.');
+               return FALSE;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_EmailAddress.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_EmailAddress.php
new file mode 100644 (file)
index 0000000..3a09cdb
--- /dev/null
@@ -0,0 +1,49 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Validator for email addresses
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_EmailAddress {
+
+       /**
+        * Returns TRUE, if the given property ($proptertyValue) is a valid email address.
+        * Any errors will be stored in the given errors object.
+        * If at least one error occurred, the result is FALSE.
+        *
+        * @param mixed $propertyValue The value that should be validated
+        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
+        * @return boolean TRUE if the value could be validated. FALSE if an error occured
+        * @author Jochen Rau <jochen.rau@typoplanet.de>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+               if (filter_var($propertyValue, FILTER_VALIDATE_EMAIL) !== FALSE) return TRUE;
+               $errors->append('The given subject was not a valid email address.');
+               return FALSE;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Float.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Float.php
new file mode 100644 (file)
index 0000000..0d221ce
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Validator for floats
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_Float {
+
+       /**
+        * Returns TRUE, if the given propterty ($proptertyValue) is a valid float.
+        * Any errors will be stored in the given errors object.
+        * If at least one error occurred, the result is FALSE.
+        *
+        * @param  object $propertyValue The value that should be validated
+        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
+        * @return boolean TRUE if the value could be validated. FALSE if an error occured
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+
+               if (is_float($propertyValue)) return TRUE;
+               if (is_string($propertyValue) && strpos($propertyValue, '.') && preg_match('/^[0-9.e+-]+$/', $propertyValue)) return TRUE;
+
+               $errors->append('The given subject was not a valid float.');
+               return FALSE;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Integer.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Integer.php
new file mode 100644 (file)
index 0000000..ee363ed
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Validator for integers
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_Integer {
+
+       /**
+        * Returns TRUE, if the given propterty ($proptertyValue) is a valid integer.
+        * Any errors will be stored in the given errors object.
+        * If at least one error occurred, the result is FALSE.
+        *
+        * @param mixed $propertyValue The value that should be validated
+        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
+        * @return boolean TRUE if the value could be validated. FALSE if an error occured
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+               if (filter_var($propertyValue, FILTER_VALIDATE_INT) !== FALSE) return TRUE;
+
+               $errors->append('The given subject was not a valid integer.');
+               return FALSE;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_NotEmpty.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_NotEmpty.php
new file mode 100644 (file)
index 0000000..93b596d
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Validator for not empty values
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_NotEmpty {
+
+       /**
+        * Returns TRUE, if the given propterty ($proptertyValue) is not empty (NULL or empty string).
+        * Any errors will be stored in the given errors object.
+        * If at least one error occurred, the result is FALSE.
+        *
+        * @param mixed $propertyValue The value that should be validated
+        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
+        * @return boolean TRUE if the value could be validated. FALSE if an error occured
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+               if ($propertyValue === NULL) {
+                       $errors->append('The given subject was NULL.');
+                       return FALSE;
+               }
+               if ($propertyValue === '') {
+                       $errors->append('The given subject was empty.');
+                       return FALSE;
+               }
+
+               return TRUE;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Number.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Number.php
new file mode 100644 (file)
index 0000000..955af7b
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Validator for general numbers
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_Number {
+
+       /**
+        * Returns TRUE, if the given propterty ($proptertyValue) is a valid number.
+        * Any errors will be stored in the given errors object.
+        * If at least one error occurred, the result is FALSE.
+        *
+        * @param mixed $propertyValue The value that should be validated
+        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
+        * @return boolean TRUE if the value could be validated. FALSE if an error occured
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+
+               if (is_numeric($propertyValue)) return TRUE;
+
+               $errors->append('The given subject was not a valid number.');
+               return FALSE;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_NumberRange.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_NumberRange.php
new file mode 100644 (file)
index 0000000..a2fe523
--- /dev/null
@@ -0,0 +1,81 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Validator for general numbers
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_NumberRange {
+
+       /**
+        * The start value of the range
+        * @var number
+        */
+       protected $startRange;
+
+       /**
+        * The end value of the range
+        * @var number
+        */
+       protected $endRange;
+
+       /**
+        * Constructor
+        *
+        * @param number The start of the range
+        * @param number The end of the range
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        */
+       public function __construct($startRange, $endRange) {
+               if ($startRange > $endRange) {
+                       $this->endRange = $startRange;
+                       $this->startRange = $endRange;
+               } else {
+                       $this->endRange = $endRange;
+                       $this->startRange = $startRange;
+               }
+       }
+
+       /**
+        * Returns TRUE, if the given propterty ($proptertyValue) is a valid number in the given range.
+        * Any errors will be stored in the given errors object.
+        * If at least one error occurred, the result is FALSE.
+        *
+        * @param mixed $propertyValue The value that should be validated
+        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
+        * @return boolean TRUE if the value could be validated. FALSE if an error occured
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+
+               if (!is_numeric($propertyValue)) $errors->append('The given subject was not a valid number.');
+               if ($propertyValue < $this->startRange || $propertyValue > $this->endRange) $errors->append('The given subject was not in the valid range (' . $this->startRange . ', ' . $this->endRange . ').');
+
+               if (count($errors) > 0) return FALSE;
+               return TRUE;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Raw.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Raw.php
new file mode 100644 (file)
index 0000000..c7422c2
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * A validator which accepts any input
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_Raw implements TX_EXTMVC_Validation_ValidatorInterface {
+
+       /**
+        * Always returns TRUE.
+        *
+        * @param mixed $propertyValue ignored
+        * @param TX_EXTMVC_Validation_Errors $errors ignored
+        * @return boolean Always TRUE
+        * @author Robert Lemke <robert@typo3.org>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+               return TRUE;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_RegularExpression.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_RegularExpression.php
new file mode 100644 (file)
index 0000000..7ba7f04
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Validator for regular expressions
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_RegularExpression {
+
+       /**
+        * @var string The regular expression
+        */
+       protected $regularExpression;
+
+       /**
+        * Creates a RegularExpression validator with the given expression
+        *
+        * @param string The regular expression, must be ready to use with preg_match()
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        */
+       public function __construct($regularExpression) {
+               $this->regularExpression = $regularExpression;
+       }
+
+       /**
+        * Returns TRUE, if the given propterty ($proptertyValue) matches the given regular expression.
+        * Any errors will be stored in the given errors object.
+        * If at least one error occurred, the result is FALSE.
+        *
+        * @param mixed $propertyValue The value that should be validated
+        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
+        * @return boolean TRUE if the value could be validated. FALSE if an error occured
+        * @author Andreas Förthner <andreas.foerthner@netlogix.de>
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+
+               if (!is_string($propertyValue) || preg_match($this->regularExpression, $propertyValue) === 0) {
+                       $errors->append('The given subject did not match the pattern.');
+                       return FALSE;
+               }
+
+               return TRUE;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Text.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_Text.php
new file mode 100644 (file)
index 0000000..c3c0b99
--- /dev/null
@@ -0,0 +1,52 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Validator for text
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_Text {
+
+       /**
+        * Returns TRUE, if the given propterty ($propertyValue) is a valid text (contains no XML tags).
+        * Any errors will be stored in the given errors object.
+        * If at least one error occurred, the result is FALSE.
+        *
+        * @param mixed $propertyValue The value that should be validated
+        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
+        * @return boolean TRUE if the value could be validated. FALSE if an error occured
+        * @author Jochen Rau <jochen.rau@typoplanet.de>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+               if ($propertyValue !== filter_var($propertyValue, FILTER_SANITIZE_STRING)) {
+                       $errors->append('The given subject was not a valid text (contained XML tags)."');
+                       return FALSE;
+               }
+
+               return TRUE;
+       }
+}
+
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_UUID.php b/typo3/sysext/extbase/Classes/Validation/Validator/TX_EXTMVC_Validation_Validator_UUID.php
new file mode 100644 (file)
index 0000000..128e8da
--- /dev/null
@@ -0,0 +1,53 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Validator for Universally Unique Identifiers
+ *
+ * @version $ID:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+class TX_EXTMVC_Validation_Validator_UUID {
+
+       /**
+        * Returns TRUE, if the given property ($propertyValue) is a formally valid UUID.
+        * Any errors will be stored in the given errors object.
+        * If at least one error occurred, the result is FALSE.
+        *
+        * @param mixed $propertyValue The value that should be validated
+        * @param TX_EXTMVC_Validation_Errors $errors Any occured Error will be stored here
+        * @return boolean TRUE if the value could be validated. FALSE if an error occured
+        * @author Robert Lemke <robert@typo3.org>
+        * @author Karsten Dambekalns <karsten@typo3.org>
+        */
+       public function isValidProperty($propertyValue, TX_EXTMVC_Validation_Errors &$errors) {
+               if (!is_string($propertyValue) || !preg_match('/([a-f0-9]){8}-([a-f0-9]){4}-([a-f0-9]){4}-([a-f0-9]){4}-([a-f0-9]){12}/', $propertyValue)) {
+                       $errors->append('The given subject was not a valid UUID.');
+                       return FALSE;
+               }
+
+               return TRUE;
+       }
+}
+
+?>
\ No newline at end of file
index c7fe76a..94802d8 100644 (file)
@@ -89,18 +89,17 @@ class TX_EXTMVC_Dispatcher {
         */
        public function dispatch($content, $configuration) {
                // debug($configuration);
-               // TODO instantiate the configurationManager
+               $request = t3lib_div::makeInstance('TX_EXTMVC_Web_Request');
+               $request->setControllerExtensionKey(strtolower($configuration['extension']));
+               $request->setControllerName($configuration['controller']);
+               $request->setControllerActionName($configuration['action']);
                $arguments = t3lib_div::makeInstance('TX_EXTMVC_Controller_Arguments');
-               foreach (t3lib_div::GParrayMerged(strtolower('tx_' . $configuration['extension'])) as $key => $value) {
-                       $argument = new TX_EXTMVC_Controller_Argument($key);
+               foreach (t3lib_div::GParrayMerged('tx_' . strtolower($configuration['extension'])) as $key => $value) {
+                       $argument = new TX_EXTMVC_Controller_Argument($key, 'Raw');
                        $argument->setValue($value);
                        $argument->setValidity(FALSE);
                        $arguments->addArgument($argument);
                }
-               $request = t3lib_div::makeInstance('TX_EXTMVC_Web_Request');
-               $request->setControllerExtensionKey($configuration['extension']);
-               $request->setControllerName($configuration['controller']);
-               $request->setControllerActionName($configuration['action']);
                $request->setArguments($arguments);
                $response = t3lib_div::makeInstance('TX_EXTMVC_Web_Response');
 
@@ -108,6 +107,7 @@ class TX_EXTMVC_Dispatcher {
                $controller = t3lib_div::makeInstance($controllerObjectName);
                
                if (!$controller instanceof TX_EXTMVC_Controller_AbstractController) throw new TX_EXTMVC_Exception_InvalidController('Invalid controller "' . $controllerObjectName . '". The controller must be a valid request handling controller.', 1202921619);
+               // TODO Configuration management
                // $settings = $this->configurationManager->getSettings($extensionKey);
                // $controller->injectSettings($this->configurationManager->getSettings($request->getControllerExtensionKey()));
                $session = t3lib_div::makeInstance('TX_EXTMVC_Persistence_Session');