diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/appconfig.php | 6 | ||||
-rw-r--r-- | lib/converter.php | 12 | ||||
-rw-r--r-- | lib/db.php | 8 | ||||
-rw-r--r-- | lib/db/member.php | 16 | ||||
-rw-r--r-- | lib/db/op.php | 12 | ||||
-rw-r--r-- | lib/db/session.php | 40 | ||||
-rw-r--r-- | lib/downloadresponse.php | 6 | ||||
-rw-r--r-- | lib/file.php | 6 | ||||
-rw-r--r-- | lib/filter.php | 4 | ||||
-rw-r--r-- | lib/filter/office.php | 10 | ||||
-rw-r--r-- | lib/genesis.php | 4 | ||||
-rw-r--r-- | lib/helper.php | 10 | ||||
-rw-r--r-- | lib/storage.php | 4 |
13 files changed, 69 insertions, 69 deletions
diff --git a/lib/appconfig.php b/lib/appconfig.php index 1f4463d0..a83ceae3 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -1,6 +1,6 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2015 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -9,12 +9,12 @@ * later. */ -namespace OCA\Documents; +namespace OCA\Richdocuments; use \OCP\IConfig; class AppConfig{ - private $appName = 'documents'; + private $appName = 'richdocuments'; private $defaults = [ 'converter' => 'off', 'converter_url' => 'http://localhost:16080', diff --git a/lib/converter.php b/lib/converter.php index 3d325e3d..2ddfbc96 100644 --- a/lib/converter.php +++ b/lib/converter.php @@ -1,7 +1,7 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -10,9 +10,9 @@ * later. */ -namespace OCA\Documents; +namespace OCA\Richdocuments; -use OCA\Documents\AppInfo\Application; +use OCA\Richdocuments\AppInfo\Application; class Converter { @@ -41,7 +41,7 @@ class Converter { if (!$exists){ \OC::$server->getLogger()->warn( 'Conversion test failed. Raw output:' . $result, - ['app' => 'documents'] + ['app' => 'richdocuments'] ); return false; @@ -61,7 +61,7 @@ class Converter { if (empty($output)){ \OC::$server->getLogger()->warn( 'Empty conversion output', - ['app' => 'documents'] + ['app' => 'richdocuments'] ); throw new \RuntimeException('Empty conversion output'); @@ -129,7 +129,7 @@ class Converter { if (curl_errno($ch)){ \OC::$server->getLogger()->debug( 'cURL error' . curl_errno($ch) . ':' . curl_error($ch), - ['app' => 'documents'] + ['app' => 'richdocuments'] ); } @@ -1,6 +1,6 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -9,7 +9,7 @@ * later. */ -namespace OCA\Documents; +namespace OCA\Richdocuments; /** * Generic DB class @@ -49,7 +49,7 @@ abstract class Db { /** * Get single record by primary key * @param int $value primary key value - * @return \OCA\Documents\Db + * @return \OCA\Richdocuments\Db */ public function load($value){ if (!is_array($value)){ @@ -69,7 +69,7 @@ abstract class Db { * Get single record matching condition * @param string $field for WHERE condition * @param mixed $value matching value(s) - * @return \OCA\Documents\Db + * @return \OCA\Richdocuments\Db * @throws Exception */ public function loadBy($field, $value){ diff --git a/lib/db/member.php b/lib/db/member.php index a0db4dba..d44f420a 100644 --- a/lib/db/member.php +++ b/lib/db/member.php @@ -1,7 +1,7 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -10,7 +10,7 @@ * later. */ -namespace OCA\Documents\Db; +namespace OCA\Richdocuments\Db; /** * @method boolean getIsGuest() @@ -19,24 +19,24 @@ namespace OCA\Documents\Db; * @method int getStatus() */ -class Member extends \OCA\Documents\Db{ +class Member extends \OCA\Richdocuments\Db{ - const DB_TABLE = '`*PREFIX*documents_member`'; + const DB_TABLE = '`*PREFIX*richdocuments_member`'; const ACTIVITY_THRESHOLD = 90; // 1.5 Minutes const MEMBER_STATUS_ACTIVE = 1; const MEMBER_STATUS_INACTIVE = 2; - protected $tableName = '`*PREFIX*documents_member`'; + protected $tableName = '`*PREFIX*richdocuments_member`'; - protected $insertStatement = 'INSERT INTO `*PREFIX*documents_member` (`es_id`, `uid`, `color`, `last_activity`, `is_guest`, `token`) + protected $insertStatement = 'INSERT INTO `*PREFIX*richdocuments_member` (`es_id`, `uid`, `color`, `last_activity`, `is_guest`, `token`) VALUES (?, ?, ?, ?, ?, ?)'; - protected $loadStatement = 'SELECT * FROM `*PREFIX*documents_member` WHERE `member_id`= ?'; + protected $loadStatement = 'SELECT * FROM `*PREFIX*richdocuments_member` WHERE `member_id`= ?'; public static function getGuestPostfix(){ - return '(' . \OC::$server->getL10n('documents')->t('guest') . ')'; + return '(' . \OC::$server->getL10n('richdocuments')->t('guest') . ')'; } diff --git a/lib/db/op.php b/lib/db/op.php index e795da6d..ee8cf760 100644 --- a/lib/db/op.php +++ b/lib/db/op.php @@ -1,6 +1,6 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -9,15 +9,15 @@ * later. */ -namespace OCA\Documents\Db; +namespace OCA\Richdocuments\Db; -class Op extends \OCA\Documents\Db { +class Op extends \OCA\Richdocuments\Db { - const DB_TABLE = '`*PREFIX*documents_op`'; + const DB_TABLE = '`*PREFIX*richdocuments_op`'; - protected $tableName = '`*PREFIX*documents_op`'; + protected $tableName = '`*PREFIX*richdocuments_op`'; - protected $insertStatement = 'INSERT INTO `*PREFIX*documents_op` (`es_id`, `optype`, `member`, `opspec`) VALUES (?, ?, ?, ?)'; + protected $insertStatement = 'INSERT INTO `*PREFIX*richdocuments_op` (`es_id`, `optype`, `member`, `opspec`) VALUES (?, ?, ?, ?)'; public static function addOpsArray($esId, $memberId, $ops){ $opObj = new Op(); diff --git a/lib/db/session.php b/lib/db/session.php index 31b2ab30..583cd342 100644 --- a/lib/db/session.php +++ b/lib/db/session.php @@ -1,7 +1,7 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -10,11 +10,11 @@ * later. */ -namespace OCA\Documents\Db; +namespace OCA\Richdocuments\Db; use OCP\Security\ISecureRandom; -use OCA\Documents\Filter; +use OCA\Richdocuments\Filter; /** * Session management @@ -26,29 +26,29 @@ use OCA\Documents\Filter; * @method string getGenesisHash() * */ -class Session extends \OCA\Documents\Db { +class Session extends \OCA\Richdocuments\Db { /** * DB table */ - const DB_TABLE = '`*PREFIX*documents_session`'; - protected $tableName = '`*PREFIX*documents_session`'; + const DB_TABLE = '`*PREFIX*richdocuments_session`'; + protected $tableName = '`*PREFIX*richdocuments_session`'; - protected $insertStatement = 'INSERT INTO `*PREFIX*documents_session` (`es_id`, `genesis_url`, `genesis_hash`, `owner`, `file_id`) + protected $insertStatement = 'INSERT INTO `*PREFIX*richdocuments_session` (`es_id`, `genesis_url`, `genesis_hash`, `owner`, `file_id`) VALUES (?, ?, ?, ?, ?)'; - protected $loadStatement = 'SELECT * FROM `*PREFIX*documents_session` WHERE `es_id`= ?'; + protected $loadStatement = 'SELECT * FROM `*PREFIX*richdocuments_session` WHERE `es_id`= ?'; /** * Start a editing session or return an existing one * @param string $uid of the user starting a session - * @param \OCA\Documents\File $file - file object + * @param \OCA\Richdocuments\File $file - file object * @return array * @throws \Exception */ public static function start($uid, $file){ // Create a directory to store genesis - $genesis = new \OCA\Documents\Genesis($file); + $genesis = new \OCA\Richdocuments\Genesis($file); $oldSession = new Session(); $oldSession->loadBy('file_id', $file->getFileId()); @@ -72,8 +72,8 @@ class Session extends \OCA\Documents\Db { ->getData() ; - $memberColor = \OCA\Documents\Helper::getMemberColor($uid); - $member = new \OCA\Documents\Db\Member([ + $memberColor = \OCA\Richdocuments\Helper::getMemberColor($uid); + $member = new \OCA\Richdocuments\Db\Member([ $sessionData['es_id'], $uid, $memberColor, @@ -95,11 +95,11 @@ class Session extends \OCA\Documents\Db { } $displayName = $file->isPublicShare() - ? $uid . ' ' . \OCA\Documents\Db\Member::getGuestPostfix() + ? $uid . ' ' . \OCA\Richdocuments\Db\Member::getGuestPostfix() : \OC::$server->getUserSession()->getUser()->getDisplayName($uid) ; $userId = $file->isPublicShare() ? $displayName : \OC::$server->getUserSession()->getUser()->getUID(); - $op = new \OCA\Documents\Db\Op(); + $op = new \OCA\Richdocuments\Db\Op(); $op->addMember( $sessionData['es_id'], $sessionData['member_id'], @@ -119,17 +119,17 @@ class Session extends \OCA\Documents\Db { $session = new Session(); $session->deleteBy('es_id', $esId); - $member = new \OCA\Documents\Db\Member(); + $member = new \OCA\Richdocuments\Db\Member(); $member->deleteBy('es_id', $esId); - $op= new \OCA\Documents\Db\Op(); + $op= new \OCA\Richdocuments\Db\Op(); $op->deleteBy('es_id', $esId); } public function syncOps($memberId, $currentHead, $clientHead, $clientOps){ $hasOps = count($clientOps)>0; - $op = new \OCA\Documents\Db\Op(); + $op = new \OCA\Richdocuments\Db\Op(); // TODO handle the case ($currentHead == "") && ($seqHead != "") if ($clientHead == $currentHead) { @@ -137,7 +137,7 @@ class Session extends \OCA\Documents\Db { if ($hasOps) { // incoming ops without conflict // Add incoming ops, respond with a new head - $newHead = \OCA\Documents\Db\Op::addOpsArray($this->getEsId(), $memberId, $clientOps); + $newHead = \OCA\Richdocuments\Db\Op::addOpsArray($this->getEsId(), $memberId, $clientOps); $result = array( 'result' => 'added', 'head_seq' => $newHead ? $newHead : $currentHead @@ -169,7 +169,7 @@ class Session extends \OCA\Documents\Db { public function updateGenesisHash($esId, $genesisHash){ return $this->execute( - 'UPDATE `*PREFIX*documents_session` SET `genesis_hash`=? WHERE `es_id`=?', + 'UPDATE `*PREFIX*richdocuments_session` SET `genesis_hash`=? WHERE `es_id`=?', array( $genesisHash, $esId ) @@ -180,7 +180,7 @@ class Session extends \OCA\Documents\Db { $result = $this->execute(' SELECT `s`.*, COUNT(`m`.`member_id`) AS `users` FROM ' . $this->tableName . ' AS `s` - LEFT JOIN `*PREFIX*documents_member` AS `m` ON `s`.`es_id`=`m`.`es_id` + LEFT JOIN `*PREFIX*richdocuments_member` AS `m` ON `s`.`es_id`=`m`.`es_id` AND `m`.`status`=' . Db\Member::MEMBER_STATUS_ACTIVE . ' AND `m`.`uid` != ? WHERE `s`.`es_id` = ? diff --git a/lib/downloadresponse.php b/lib/downloadresponse.php index a24ca447..01115b30 100644 --- a/lib/downloadresponse.php +++ b/lib/downloadresponse.php @@ -1,6 +1,6 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -9,7 +9,7 @@ * later. */ -namespace OCA\Documents; +namespace OCA\Richdocuments; use \OCP\AppFramework\Http; use \OCP\IRequest; @@ -44,7 +44,7 @@ class DownloadResponse extends \OCP\AppFramework\Http\Response { $this->ETag = $info['etag']; $content = $this->view->file_get_contents($this->path); - $data = \OCA\Documents\Filter::read($content, $info['mimetype']); + $data = \OCA\Richdocuments\Filter::read($content, $info['mimetype']); $size = strlen($data['content']); diff --git a/lib/file.php b/lib/file.php index fb6ae9fb..4668e569 100644 --- a/lib/file.php +++ b/lib/file.php @@ -1,6 +1,6 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -20,7 +20,7 @@ * */ -namespace OCA\Documents; +namespace OCA\Richdocuments; use \OC\Files\View; @@ -190,7 +190,7 @@ class File { $mimetype = $this->ownerView->getMimeType($this->path); if (!Filter::isSupportedMimetype($mimetype)){ - throw new \Exception( $this->path . ' is ' . $mimetype . ' and is not supported by Documents app'); + throw new \Exception( $this->path . ' is ' . $mimetype . ' and is not supported by RichDocuments app'); } } diff --git a/lib/filter.php b/lib/filter.php index bfd6b598..9b5a93f1 100644 --- a/lib/filter.php +++ b/lib/filter.php @@ -1,7 +1,7 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -10,7 +10,7 @@ * later. */ -namespace OCA\Documents; +namespace OCA\Richdocuments; class Filter { protected static $filters = array(); diff --git a/lib/filter/office.php b/lib/filter/office.php index c4f000ea..bfbde6c1 100644 --- a/lib/filter/office.php +++ b/lib/filter/office.php @@ -1,7 +1,7 @@ <?php /** - * ownCloud - Documents App + * ownCloud - RichDocuments App * * @author Victor Dubiniuk * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -10,7 +10,7 @@ * later. */ -namespace OCA\Documents\Filter; +namespace OCA\Richdocuments\Filter; class Office { const NATIVE_MIMETYPE = 'application/vnd.oasis.opendocument.text'; @@ -55,14 +55,14 @@ class Office { $this->readSpec = $mimeSpec['read']; $this->writeSpec = $mimeSpec['write']; - \OCA\Documents\Filter::add($mimeSpec['write']['target'], $this); + \OCA\Richdocuments\Filter::add($mimeSpec['write']['target'], $this); } public function read($data){ return array( 'mimetype' => $this->readSpec['target'], 'content' => - \OCA\Documents\Converter::convert( + \OCA\Richdocuments\Converter::convert( $data['content'], $this->readSpec['format'], $this->readSpec['extension'] @@ -74,7 +74,7 @@ class Office { return array( 'mimetype' => $this->writeSpec['target'], 'content' => - \OCA\Documents\Converter::convert( + \OCA\Richdocuments\Converter::convert( $data['content'], $this->writeSpec['format'], $this->writeSpec['extension'] diff --git a/lib/genesis.php b/lib/genesis.php index 345e7a78..de0e0c87 100644 --- a/lib/genesis.php +++ b/lib/genesis.php @@ -1,6 +1,6 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -20,7 +20,7 @@ * */ -namespace OCA\Documents; +namespace OCA\Richdocuments; use \OC\Files\View; diff --git a/lib/helper.php b/lib/helper.php index e67d32ad..46e682c8 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -1,7 +1,7 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Victor Dubiniuk * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com @@ -10,11 +10,11 @@ * later. */ -namespace OCA\Documents; +namespace OCA\Richdocuments; class Helper { - const APP_ID = 'documents'; + const APP_ID = 'richdocuments'; public static function getNewFileName($view, $path, $prepend = ' '){ $fileNum = 1; @@ -162,12 +162,12 @@ class Helper { if (empty($cmd)){ \OC::$server->getLogger()->warn( 'Pure configuration issue. Missing open office binary that is mandatory for conversion.', - ['app' => 'documents'] + ['app' => 'richdocuments'] ); \OC::$server->getLogger()->debug( 'If openoffice or libreoffice is already installed please specify the path to it using preview_libreoffice_path config. Refer to admin manual for details.', - ['app' => 'documents'] + ['app' => 'richdocuments'] ); throw new \RuntimeException('Missing open office binary that is mandatory for conversion.'); diff --git a/lib/storage.php b/lib/storage.php index 31e28e5f..ce65d39c 100644 --- a/lib/storage.php +++ b/lib/storage.php @@ -1,7 +1,7 @@ <?php /** - * ownCloud - Documents App + * ownCloud - Richdocuments App * * @author Frank Karlitschek * @copyright 2013-2014 Frank Karlitschek frank@owncloud.org @@ -22,7 +22,7 @@ */ -namespace OCA\Documents; +namespace OCA\Richdocuments; class Storage { public static $MIMETYPE_LIBREOFFICE_WORDPROCESSOR = array( |