public function __invoke($params)
 {
     SqlStorage::createTable();
     $code = 666;
     $workspaceModel = new core_kernel_persistence_smoothsql_SmoothModel(array(core_kernel_persistence_smoothsql_SmoothModel::OPTION_PERSISTENCE => 'default', core_kernel_persistence_smoothsql_SmoothModel::OPTION_READABLE_MODELS => array($code), core_kernel_persistence_smoothsql_SmoothModel::OPTION_WRITEABLE_MODELS => array($code), core_kernel_persistence_smoothsql_SmoothModel::OPTION_NEW_TRIPLE_MODEL => $code, core_kernel_persistence_smoothsql_SmoothModel::OPTION_SEARCH_SERVICE => ComplexSearchService::SERVICE_ID));
     $model = ModelManager::getModel();
     $model->setOption(core_kernel_persistence_smoothsql_SmoothModel::OPTION_SEARCH_SERVICE, ComplexSearchService::SERVICE_ID);
     $wrapedModel = WrapperModel::wrap($model, $workspaceModel);
     $wrapedModel->setServiceLocator($this->getServiceLocator());
     ModelManager::setModel($wrapedModel);
     LockManager::setImplementation(new LockSystem());
     $oldRepository = $this->getServiceManager()->get(Repository::SERVICE_ID);
     $this->registerService('taoWorkspace/innerRevision', $oldRepository);
     $newService = new RevisionWrapper(array(RevisionWrapper::OPTION_INNER_IMPLEMENTATION => 'taoWorkspace/innerRevision', RepositoryService::OPTION_FS => 'revisions'));
     $this->registerService(Repository::SERVICE_ID, $newService);
 }
/**  
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; under version 2
 * of the License (non-upgradable).
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 * 
 * Copyright (c) 2015 (original work) Open Assessment Technologies SA;
 *               
 * 
 */
use oat\taoWorkspace\model\lockStrategy\LockSystem;
use oat\generis\model\data\ModelManager;
use oat\tao\model\lock\LockManager;
use oat\taoWorkspace\model\generis\WrapperModel;
use oat\taoWorkspace\model\lockStrategy\SqlStorage;
SqlStorage::createTable();
$code = 666;
$workspaceModel = new \core_kernel_persistence_smoothsql_SmoothModel(array(\core_kernel_persistence_smoothsql_SmoothModel::OPTION_PERSISTENCE => 'default', \core_kernel_persistence_smoothsql_SmoothModel::OPTION_READABLE_MODELS => array($code), \core_kernel_persistence_smoothsql_SmoothModel::OPTION_WRITEABLE_MODELS => array($code), \core_kernel_persistence_smoothsql_SmoothModel::OPTION_NEW_TRIPLE_MODEL => $code));
$wrapedModel = WrapperModel::wrap(ModelManager::getModel(), $workspaceModel);
ModelManager::setModel($wrapedModel);
LockManager::setImplementation(new LockSystem());
 public function reload()
 {
     $this->map = SqlStorage::getMap($this->getUserId());
 }
Ejemplo n.º 4
0
 protected function release(Lock $lock)
 {
     $workcopy = $lock->getWorkCopy();
     // deletes the dependencies
     DeleteHelper::deepDelete($workcopy);
     // deletes the workcopy
     $this->getWorkspaceModel()->getRdfsInterface()->getResourceImplementation()->delete($workcopy);
     SqlStorage::remove($lock);
     WorkspaceMap::getCurrentUserMap()->reload();
     return true;
 }