Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Model implementation using simpleStore for OCS
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Feb 23, 2016
1 parent 819e7bb commit 7cf1fb0
Show file tree
Hide file tree
Showing 8 changed files with 572 additions and 151 deletions.
2 changes: 1 addition & 1 deletion core/src/ocs.php
Expand Up @@ -32,7 +32,7 @@
require_once($confStorageDriver->getUserClassFileName());

/**
* @var Pydio\OCS\Router $coreLoader
* @var Pydio\OCS\OCSPlugin $coreLoader
*/
$coreLoader = $pServ->getPluginById("core.ocs");
$configs = $coreLoader->getConfigs();
Expand Down
Expand Up @@ -24,7 +24,7 @@

require_once("vendor/autoload.php");

class Router extends \AJXP_Plugin{
class OCSPlugin extends \AJXP_Plugin{

public function federatedEnabled(){
return $this->getConfigs()["ENABLE_FEDERATED_SHARING"] === true;
Expand Down Expand Up @@ -69,9 +69,10 @@ public function route($endpoint, $uriParts, $parameters){

}


}



public function buildResponse($status = "ok", $code = 200, $message = null, $data = null){

$ocs = array(
Expand Down
74 changes: 0 additions & 74 deletions core/src/plugins/core.ocs/service/class.OCS_DavBasicAuthNoPass.php

This file was deleted.

74 changes: 0 additions & 74 deletions core/src/plugins/core.ocs/service/class.OCS_DavServer.php

This file was deleted.

84 changes: 84 additions & 0 deletions core/src/plugins/core.ocs/src/Model/IStore.php
@@ -0,0 +1,84 @@
<?php
/*
* Copyright 2007-2015 Abstrium <contact (at) pydio.com>
* This file is part of Pydio.
*
* Pydio is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Pydio 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Pydio. If not, see <http://www.gnu.org/licenses/>.
*
* The latest code can be found at <http://pyd.io/>.
*/

namespace Pydio\OCS\Model;

defined('AJXP_EXEC') or die('Access not allowed');

interface IStore
{
/**
* Persists an invitation to store
* @param ShareInvitation $invitation
* @return ShareInvitation|false The invitation with its new ID.
*/
public function storeInvitation(ShareInvitation $invitation);

/**
* Find all invitatins for a given token
* @param string $linkToken
* @return ShareInvitation[]
*/
public function invitationsForLink($linkToken);

/**
* Find an invitation by ID
* @param $invitationId
* @return ShareInvitation|null
*/
public function invitationById(string $invitationId);

/**
* Delete an invitation
* @param ShareInvitation $invitation
* @return bool
*/
public function deleteInvitation(ShareInvitation $invitation);

/**
* Persists a remote share to the store
* @param RemoteShare $remoteShare
* @return RemoteShare|false The share with eventually its new ID.
*/
public function storeRemoteShare(RemoteShare $remoteShare);

/**
* Find all remote shares for a given user
* @param string $userName
* @return RemoteShare[]
*/
public function remoteSharesForUser($userName);

/**
* Find a remote share by its id
* @param string $remoteShareId
* @return RemoteShare
*/
public function remoteShareById($remoteShareId);

/**
* Delete an existing remote share
* @param RemoteShare $remoteShare
* @return bool
*/
public function deleteRemoteShare(RemoteShare $remoteShare);

}

0 comments on commit 7cf1fb0

Please sign in to comment.