public function index()
    {
        $importer = $this->getCurrentImporter();

        $this->propagate($importer);

        $formContainer = new tao_actions_form_Import(
            $importer,
            $this->getAvailableImportHandlers(),
            $this->getCurrentClass()
        );
        $importForm = $formContainer->getForm();

        if ($importForm->isSubmited() && $importForm->isValid()) {
            /** @var QueueDispatcher $queueDispatcher */
            $queueDispatcher = $this->getServiceLocator()->get(QueueDispatcher::SERVICE_ID);

            $task = $queueDispatcher->createTask(
                new ImportByHandler(),
                [
                    ImportByHandler::PARAM_IMPORT_HANDLER => get_class($importer),
                    ImportByHandler::PARAM_FORM_VALUES => $importer instanceof TaskParameterProviderInterface ? $importer->getTaskParameters($importForm) : [],
                    ImportByHandler::PARAM_PARENT_CLASS => $this->getCurrentClass()->getUri(),
                    ImportByHandler::PARAM_OWNER => \common_session_SessionManager::getSession()->getUser()->getIdentifier(),
                ],
                __('Import a %s into "%s"', $importer->getLabel(), $this->getCurrentClass()->getLabel()));

            return $this->returnTaskJson($task);
        }

        $context = Context::getInstance();
        $this->setData('import_extension', $context->getExtensionName());
        $this->setData('import_module', $context->getModuleName());
        $this->setData('import_action', $context->getActionName());

        $this->setData('myForm', $importForm->render());
        $this->setData('formTitle', __('Import '));
        $this->setView('form/import.tpl', 'tao');
    }
public function index()
    {
        $importer = $this->getCurrentImporter();

        $this->propagate($importer);

        $formContainer = new tao_actions_form_Import(
            $importer,
            $this->getAvailableImportHandlers(),
            $this->getCurrentClass()
        );
        $importForm = $formContainer->getForm();

        if ($importForm->isSubmited() && $importForm->isValid()) {
            /** @var QueueDispatcher $queueDispatcher */
            $queueDispatcher = $this->getServiceLocator()->get(QueueDispatcher::SERVICE_ID);

            $task = $queueDispatcher->createTask(
                new ImportByHandler(),
                [
                    ImportByHandler::PARAM_IMPORT_HANDLER => get_class($importer),
                    ImportByHandler::PARAM_FORM_VALUES => $importer instanceof TaskParameterProviderInterface ? $importer->getTaskParameters($importForm) : [],
                    ImportByHandler::PARAM_PARENT_CLASS => $this->getCurrentClass()->getUri(),
                    ImportByHandler::PARAM_OWNER => \common_session_SessionManager::getSession()->getUser()->getIdentifier(),
                ],
                __('Import a %s into "%s"', $importer->getLabel(), $this->getCurrentClass()->getLabel()));

            return $this->returnTaskJson($task);
        }

        $context = Context::getInstance();
        $this->setData('import_extension', $context->getExtensionName());
        $this->setData('import_module', $context->getModuleName());
        $this->setData('import_action', $context->getActionName());

        $this->setData('myForm', $importForm->render());
        $this->setData('formTitle', __('Import '));
        $this->setView('form/import.tpl', 'tao');
    }
public function index ( ) { $ importer = $ this -> getCurrentImporter ( ) ; $ this -> propagate ( $ importer ) ; $ formContainer = new tao_actions_form_Import ( $ importer , $ this -> getAvailableImportHandlers ( ) , $ this -> getCurrentClass ( ) ) ; $ importForm = $ formContainer -> getForm ( ) ; if ( $ importForm -> isSubmited ( ) && $ importForm -> isValid ( ) ) { /** @var QueueDispatcher $queueDispatcher */ $ queueDispatcher = $ this -> getServiceLocator ( ) -> get ( QueueDispatcher :: SERVICE_ID ) ; $ task = $ queueDispatcher -> createTask ( new ImportByHandler ( ) , [ ImportByHandler :: PARAM_IMPORT_HANDLER => get_class ( $ importer ) , ImportByHandler :: PARAM_FORM_VALUES => $ importer instanceof TaskParameterProviderInterface ? $ importer -> getTaskParameters ( $ importForm ) : [ ] , ImportByHandler :: PARAM_PARENT_CLASS => $ this -> getCurrentClass ( ) -> getUri ( ) , ImportByHandler :: PARAM_OWNER => \ common_session_SessionManager :: getSession ( ) -> getUser ( ) -> getIdentifier ( ) , ] , __ ( 'Import a %s into "%s"' , $ importer -> getLabel ( ) , $ this -> getCurrentClass ( ) -> getLabel ( ) ) ) ; return $ this -> returnTaskJson ( $ task ) ; } $ context = Context :: getInstance ( ) ; $ this -> setData ( 'import_extension' , $ context -> getExtensionName ( ) ) ; $ this -> setData ( 'import_module' , $ context -> getModuleName ( ) ) ; $ this -> setData ( 'import_action' , $ context -> getActionName ( ) ) ; $ this -> setData ( 'myForm' , $ importForm -> render ( ) ) ; $ this -> setData ( 'formTitle' , __ ( 'Import ' ) ) ; $ this -> setView ( 'form/import.tpl' , 'tao' ) ; }
initialize the classUri and execute the upload action

@requiresRight id WRITE
initialize the classUri and execute the upload action