public function saveItems()
	{
	    $test = new \core_kernel_classes_Resource($this->getRequestParameter('uri'));
	     
		if(!tao_helpers_Request::isAjax()){
			throw new common_exception_BadRequest('wrong request mode');
		}

        $itemUris = tao_helpers_form_GenerisTreeForm::getSelectedInstancesFromPost();
        foreach($this->getRequestParameters() as $key => $value) {
            if(preg_match("/^instance_/", $key)){
                $itemUris[] = tao_helpers_Uri::decode($value);
            }
        }

        $config = array('previous' => ($this->getRequestParameter('previous') === "true"));
        $testContent = array('itemUris' => $itemUris, 'config' => $config);
        $model = $this->getServiceManager()->get(TestModel::SERVICE_ID);
        $saved = $model->save($test, $testContent);
        $this->returnJson(array('saved'	=> $saved));
    }