/**
  * @param \GIB\GradingTool\Domain\Model\Project $project
  * @return array
  */
 public function getProcessedProjectData(\GIB\GradingTool\Domain\Model\Project $project)
 {
     /** @var \TYPO3\Form\Core\Model\FormDefinition $formDefinition */
     $formDefinition = $this->formPersistenceManager->load($this->settings['forms']['projectData']);
     $fieldArray = $this->buildFieldArray($formDefinition['renderables'], $project->getProjectDataArray());
     return $fieldArray;
 }
 /**
  * Edit the (administrator-only) project data
  *
  * @param \GIB\GradingTool\Domain\Model\Project $project
  */
 public function editProjectDataAction(\GIB\GradingTool\Domain\Model\Project $project)
 {
     $factory = $this->objectManager->get('TYPO3\\Form\\Factory\\ArrayFormFactory');
     $formName = $this->getFormNameRespectingLocale($this->settings['forms']['projectData']);
     $overrideConfiguration = $this->formPersistenceManager->load($formName);
     $formDefinition = $factory->build($overrideConfiguration);
     if (is_array($project->getProjectDataArray())) {
         // we already have form data, so we apply it
         foreach ($project->getProjectDataArray() as $projectDataField => $projectDataContent) {
             $formDefinition->addElementDefaultValue($projectDataField, $projectDataContent);
         }
     }
     $response = new \TYPO3\Flow\Http\Response($this->controllerContext->getResponse());
     $form = $formDefinition->bind($this->controllerContext->getRequest(), $response);
     $renderedForm = $form->render();
     $this->view->assignMultiple(array('renderedForm' => $renderedForm, 'project' => $project));
 }