/**
  * Build a new package.
  *
  * @return \Zend\View\Model\ViewModel|\Zend\Http\Response form template or redirect response
  */
 public function buildAction()
 {
     if ($this->getRequest()->isPost()) {
         $this->_buildForm->setData($this->params()->fromPost() + $this->params()->fromFiles());
         if ($this->_buildForm->isValid()) {
             $this->_buildPackage($this->_buildForm->getData());
             return $this->redirectToRoute('package', 'index');
         }
     } else {
         $this->_buildForm->setData(array('Platform' => $this->_config->defaultPlatform, 'DeployAction' => $this->_config->defaultAction, 'ActionParam' => $this->_config->defaultActionParam, 'Priority' => $this->_config->defaultPackagePriority, 'MaxFragmentSize' => $this->_config->defaultMaxFragmentSize, 'Warn' => $this->_config->defaultWarn, 'WarnMessage' => $this->_config->defaultWarnMessage, 'WarnCountdown' => $this->_config->defaultWarnCountdown, 'WarnAllowAbort' => $this->_config->defaultWarnAllowAbort, 'WarnAllowDelay' => $this->_config->defaultWarnAllowDelay, 'PostInstMessage' => $this->_config->defaultPostInstMessage));
     }
     return $this->printForm($this->_buildForm);
 }
 /**
  * Build a new package.
  *
  * @return \Zend\View\Model\ViewModel|\Zend\Http\Response form template or redirect response
  */
 public function buildAction()
 {
     if ($this->getRequest()->isPost()) {
         $this->_buildForm->setData($this->params()->fromPost() + $this->params()->fromFiles());
         if ($this->_buildForm->isValid()) {
             $data = $this->_buildForm->getData();
             $data['FileName'] = $data['File']['name'];
             $data['FileLocation'] = $data['File']['tmp_name'];
             $flashMessenger = $this->flashMessenger();
             try {
                 $this->_packageManager->buildPackage($data, true);
                 $flashMessenger->addSuccessMessage(array($this->_('Package \'%s\' was successfully created.') => $data['Name']));
                 $flashMessenger->addMessage($data['Name'], 'packageName');
             } catch (\Model\Package\RuntimeException $e) {
                 $flashMessenger->addErrorMessage($e->getMessage());
             }
             return $this->redirectToRoute('package', 'index');
         }
     } else {
         $this->_buildForm->setData(array('Platform' => $this->_config->defaultPlatform, 'DeployAction' => $this->_config->defaultAction, 'ActionParam' => $this->_config->defaultActionParam, 'Priority' => $this->_config->defaultPackagePriority, 'MaxFragmentSize' => $this->_config->defaultMaxFragmentSize, 'Warn' => $this->_config->defaultWarn, 'WarnMessage' => $this->_config->defaultWarnMessage, 'WarnCountdown' => $this->_config->defaultWarnCountdown, 'WarnAllowAbort' => $this->_config->defaultWarnAllowAbort, 'WarnAllowDelay' => $this->_config->defaultWarnAllowDelay, 'PostInstMessage' => $this->_config->defaultPostInstMessage));
     }
     return $this->printForm($this->_buildForm);
 }