Fix appid

pull/1/head
Victor Dubiniuk 8 years ago
parent 840a124b66
commit 447610b260

@ -1,10 +1,10 @@
<?php <?php
namespace OCA\Documents; namespace OCA\Richdocuments;
use \OCA\Documents\AppInfo\Application; use \OCA\Richdocuments\AppInfo\Application;
$app = new Application(); $app = new Application();
$response = $app->getContainer()->query('\OCA\Documents\Controller\SettingsController')->adminIndex(); $response = $app->getContainer()->query('\OCA\Richdocuments\Controller\SettingsController')->adminIndex();
return $response->render(); return $response->render();

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Frank Karlitschek * @author Frank Karlitschek
* @copyright 2013-2014 Frank Karlitschek karlitschek@kde.org * @copyright 2013-2014 Frank Karlitschek karlitschek@kde.org
@ -21,23 +21,23 @@
* *
*/ */
namespace OCA\Documents\AppInfo; namespace OCA\Richdocuments\AppInfo;
use OCA\Documents\Filter\Office; use OCA\Richdocuments\Filter\Office;
use OCA\Documents\Config; use OCA\Richdocuments\Config;
$app = new Application(); $app = new Application();
$c = $app->getContainer(); $c = $app->getContainer();
\OCP\App::registerAdmin('documents', 'admin'); \OCP\App::registerAdmin('richdocuments', 'admin');
\OCP\App::registerPersonal('documents', 'personal'); \OCP\App::registerPersonal('richdocuments', 'personal');
$navigationEntry = function () use ($c) { $navigationEntry = function () use ($c) {
return [ return [
'id' => 'documents_index', 'id' => 'richdocuments_index',
'order' => 2, 'order' => 2,
'href' => $c->query('ServerContainer')->getURLGenerator()->linkToRoute('documents.document.index'), 'href' => $c->query('ServerContainer')->getURLGenerator()->linkToRoute('richdocuments.document.index'),
'icon' => $c->query('ServerContainer')->getURLGenerator()->imagePath('documents', 'documents.svg'), 'icon' => $c->query('ServerContainer')->getURLGenerator()->imagePath('richdocuments', 'documents.svg'),
'name' => $c->query('L10N')->t('Collabora Online Development Edition') 'name' => $c->query('L10N')->t('Collabora Online Development Edition')
]; ];
}; };
@ -49,7 +49,7 @@ if (isset($request->server['REQUEST_URI'])) {
$url = $request->server['REQUEST_URI']; $url = $request->server['REQUEST_URI'];
if (preg_match('%index.php/apps/files(/.*)?%', $url)) { if (preg_match('%index.php/apps/files(/.*)?%', $url)) {
\OCP\Util::addScript('documents', 'viewer/viewer'); \OCP\Util::addScript('richdocuments', 'viewer/viewer');
} }
} }
@ -311,4 +311,4 @@ if ($c->query('AppConfig')->isConverterEnabled()){
} }
//Listen to delete file signal //Listen to delete file signal
\OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Documents\Storage", "onDelete"); \OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Richdocuments\Storage", "onDelete");

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -9,19 +9,19 @@
* later. * later.
*/ */
namespace OCA\Documents\AppInfo; namespace OCA\Richdocuments\AppInfo;
use \OCP\AppFramework\App; use \OCP\AppFramework\App;
use \OCA\Documents\Controller\UserController; use \OCA\Richdocuments\Controller\UserController;
use \OCA\Documents\Controller\SessionController; use \OCA\Richdocuments\Controller\SessionController;
use \OCA\Documents\Controller\DocumentController; use \OCA\Richdocuments\Controller\DocumentController;
use \OCA\Documents\Controller\SettingsController; use \OCA\Richdocuments\Controller\SettingsController;
use \OCA\Documents\AppConfig; use \OCA\Richdocuments\AppConfig;
class Application extends App { class Application extends App {
public function __construct (array $urlParams = array()) { public function __construct (array $urlParams = array()) {
parent::__construct('documents', $urlParams); parent::__construct('richdocuments', $urlParams);
$container = $this->getContainer(); $container = $this->getContainer();

@ -5,7 +5,7 @@
<overwrite>false</overwrite> <overwrite>false</overwrite>
<charset>utf8</charset> <charset>utf8</charset>
<table> <table>
<name>*dbprefix*documents_session</name> <name>*dbprefix*richdocuments_session</name>
<declaration> <declaration>
<field> <field>
@ -43,7 +43,7 @@
</field> </field>
<index> <index>
<name>documents_session_ei_idx</name> <name>richdocuments_session_ei_idx</name>
<primary>true</primary> <primary>true</primary>
<unique>true</unique> <unique>true</unique>
<field> <field>
@ -56,7 +56,7 @@
</table> </table>
<table> <table>
<name>*dbprefix*documents_member</name> <name>*dbprefix*richdocuments_member</name>
<declaration> <declaration>
<field> <field>
@ -119,7 +119,7 @@
</table> </table>
<table> <table>
<name>*dbprefix*documents_op</name> <name>*dbprefix*richdocuments_op</name>
<declaration> <declaration>
<field> <field>
@ -162,7 +162,7 @@
</field> </field>
<index> <index>
<name>seq_pKey</name> <name>richdocs_seq_pKey</name>
<primary>true</primary> <primary>true</primary>
<field> <field>
<name>seq</name> <name>seq</name>
@ -170,7 +170,7 @@
</field> </field>
</index> </index>
<index> <index>
<name>documents_op_eis_idx</name> <name>richdocuments_op_eis_idx</name>
<unique>true</unique> <unique>true</unique>
<field> <field>
<name>es_id</name> <name>es_id</name>
@ -185,7 +185,7 @@
</declaration> </declaration>
</table> </table>
<table> <table>
<name>*dbprefix*documents_invite</name> <name>*dbprefix*richdocuments_invite</name>
<declaration> <declaration>
<field> <field>
@ -218,7 +218,7 @@
</declaration> </declaration>
</table> </table>
<table> <table>
<name>*dbprefix*documents_revisions</name> <name>*dbprefix*richdocuments_revisions</name>
<declaration> <declaration>
<field> <field>
@ -259,7 +259,7 @@
</field> </field>
<index> <index>
<name>documents_rev_eis_idx</name> <name>richdocuments_rev_eis_idx</name>
<unique>true</unique> <unique>true</unique>
<field> <field>
<name>es_id</name> <name>es_id</name>

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<info> <info>
<id>documents</id> <id>richdocuments</id>
<name>Collabora Online Development Edition</name> <name>Collabora Online Development Edition</name>
<description>An ownCloud app to work with office documents</description> <description>An ownCloud app to work with office documents</description>
<licence>AGPL</licence> <licence>AGPL</licence>
@ -13,7 +13,6 @@
<owncloud min-version="8.1" max-version="9.0" /> <owncloud min-version="8.1" max-version="9.0" />
</dependencies> </dependencies>
<public> <public>
<documents>public.php</documents> <richdocuments>public.php</richdocuments>
</public> </public>
<ocsid>168711</ocsid>
</info> </info>

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013-2014 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013-2014 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -9,9 +9,9 @@
* later. * later.
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
$application = new \OCA\Documents\AppInfo\Application(); $application = new \OCA\Richdocuments\AppInfo\Application();
$application->registerRoutes($this, [ $application->registerRoutes($this, [
'routes' => [ 'routes' => [
//users //users

@ -1,51 +0,0 @@
<?php
/**
* ownCloud - Documents App
*
* @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
*
* This file is licensed under the Affero General Public License version 3 or
* later.
*/
$config = \OC::$server->getConfig();
$dbConnection = \OC::$server->getDatabaseConnection();
$installedVersion = $config->getAppValue('documents', 'installed_version');
$cleanup = $dbConnection->prepare('DELETE FROM `*PREFIX*documents_member` WHERE `last_activity`=0 or `last_activity` is NULL');
$cleanup->execute();
if (version_compare($installedVersion, '0.7', '<=')) {
$config->setAppValue('documents', 'unstable', 'false');
$session = new \OCA\Documents\Db\Session();
$query = $dbConnection->prepare('UPDATE `*PREFIX*documents_session` SET `genesis_url`=? WHERE `es_id`=?');
foreach ($session->getCollection() as $sessionData){
$sessionData['genesis_url'] = \OCA\Documents\Genesis::DOCUMENTS_DIRNAME . $sessionData['genesis_url'];
$query->execute(array(
$sessionData['genesis_url'],
$sessionData['es_id']
));
}
}
if (version_compare($installedVersion, '0.8', '<')) {
$query = $dbConnection->prepare('UPDATE `*PREFIX*documents_member` SET `is_guest`=1 WHERE `uid` LIKE \'%(guest)\' ');
$query->execute(array());
}
if (version_compare($installedVersion, '0.9', '<')) {
$query = $dbConnection->prepare('UPDATE `*PREFIX*documents_op` SET `optype`=? WHERE `seq`=?');
$ops = new \OCA\Documents\Db\Op();
foreach ($ops->getCollection() as $opData){
$opSpec = json_decode($opData['opspec'], true);
$query->execute(
array(
$opSpec['optype'],
$opData['seq']
)
);
}
}

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -9,7 +9,7 @@
* later. * later.
*/ */
namespace OCA\Documents\Controller; namespace OCA\Richdocuments\Controller;
use \OCP\AppFramework\Controller; use \OCP\AppFramework\Controller;
use \OCP\IRequest; use \OCP\IRequest;
@ -19,13 +19,13 @@ use \OCP\AppFramework\Http\ContentSecurityPolicy;
use \OCP\AppFramework\Http\JSONResponse; use \OCP\AppFramework\Http\JSONResponse;
use \OCP\AppFramework\Http\TemplateResponse; use \OCP\AppFramework\Http\TemplateResponse;
use \OCA\Documents\Db; use \OCA\Richdocuments\Db;
use \OCA\Documents\Helper; use \OCA\Richdocuments\Helper;
use \OCA\Documents\Storage; use \OCA\Richdocuments\Storage;
use \OCA\Documents\Download; use \OCA\Richdocuments\Download;
use \OCA\Documents\DownloadResponse; use \OCA\Richdocuments\DownloadResponse;
use \OCA\Documents\File; use \OCA\Richdocuments\File;
use OCA\Documents\Genesis; use OCA\Richdocuments\Genesis;
use \OC\Files\View; use \OC\Files\View;
class DocumentController extends Controller{ class DocumentController extends Controller{
@ -49,12 +49,12 @@ class DocumentController extends Controller{
* @NoCSRFRequired * @NoCSRFRequired
*/ */
public function index(){ public function index(){
\OC::$server->getNavigationManager()->setActiveEntry( 'documents_index' ); \OC::$server->getNavigationManager()->setActiveEntry( 'richdocuments_index' );
$maxUploadFilesize = \OCP\Util::maxUploadFilesize("/"); $maxUploadFilesize = \OCP\Util::maxUploadFilesize("/");
$response = new TemplateResponse('documents', 'documents', [ $response = new TemplateResponse('richdocuments', 'documents', [
'enable_previews' => $this->settings->getSystemValue('enable_previews', true), 'enable_previews' => $this->settings->getSystemValue('enable_previews', true),
'useUnstable' => $this->settings->getAppValue('documents', 'unstable', 'false'), 'useUnstable' => $this->settings->getAppValue('richdocuments', 'unstable', 'false'),
'savePath' => $this->settings->getUserValue($this->uid, 'documents', 'save_path', '/'), 'savePath' => $this->settings->getUserValue($this->uid, 'richdocuments', 'save_path', '/'),
'uploadMaxFilesize' => $maxUploadFilesize, 'uploadMaxFilesize' => $maxUploadFilesize,
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize), 'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
'allowShareWithLink' => $this->settings->getAppValue('core', 'shareapi_allow_links', 'yes'), 'allowShareWithLink' => $this->settings->getAppValue('core', 'shareapi_allow_links', 'yes'),
@ -240,7 +240,7 @@ class DocumentController extends Controller{
$fullPath = '/files' . $path; $fullPath = '/files' . $path;
$fileInfo = \OC\Files\Filesystem::getFileInfo($path); $fileInfo = \OC\Files\Filesystem::getFileInfo($path);
if ($fileInfo){ if ($fileInfo){
if($fileInfo->getMimeType() !== \OCA\Documents\Filter\Office::NATIVE_MIMETYPE){ if($fileInfo->getMimeType() !== \OCA\Richdocuments\Filter\Office::NATIVE_MIMETYPE){
$file = new File($fileInfo->getId()); $file = new File($fileInfo->getId());
$genesis = new Genesis($file); $genesis = new Genesis($file);
$fullPath = $genesis->getPath(); $fullPath = $genesis->getPath();

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -9,17 +9,17 @@
* later. * later.
*/ */
namespace OCA\Documents\Controller; namespace OCA\Richdocuments\Controller;
use \OCP\AppFramework\Controller; use \OCP\AppFramework\Controller;
use \OCP\IRequest; use \OCP\IRequest;
use \OCP\AppFramework\Http; use \OCP\AppFramework\Http;
use \OCP\AppFramework\Http\JSONResponse; use \OCP\AppFramework\Http\JSONResponse;
use \OCA\Documents\Db; use \OCA\Richdocuments\Db;
use \OCA\Documents\File; use \OCA\Richdocuments\File;
use \OCA\Documents\Helper; use \OCA\Richdocuments\Helper;
use OCA\Documents\Filter; use OCA\Richdocuments\Filter;
use \OC\Files\View; use \OC\Files\View;
class BadRequestException extends \Exception { class BadRequestException extends \Exception {
@ -219,7 +219,7 @@ class SessionController extends Controller{
if ($this->uid){ if ($this->uid){
$view = new View('/' . $this->uid . '/files'); $view = new View('/' . $this->uid . '/files');
$dir = \OC::$server->getConfig()->getUserValue($this->uid, 'documents', 'save_path', ''); $dir = \OC::$server->getConfig()->getUserValue($this->uid, 'richdocuments', 'save_path', '');
$path = Helper::getNewFileName($view, $dir . 'New Document.odt'); $path = Helper::getNewFileName($view, $dir . 'New Document.odt');
} else { } else {
throw $e; throw $e;

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -9,7 +9,7 @@
* later. * later.
*/ */
namespace OCA\Documents\Controller; namespace OCA\Richdocuments\Controller;
use \OCP\AppFramework\Controller; use \OCP\AppFramework\Controller;
use \OCP\IRequest; use \OCP\IRequest;
@ -17,9 +17,9 @@ use \OCP\IL10N;
use \OCP\AppFramework\Http\JSONResponse; use \OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Http\TemplateResponse;
use OCA\Documents\AppConfig; use OCA\Richdocuments\AppConfig;
use OCA\Documents\Converter; use OCA\Richdocuments\Converter;
use OCA\Documents\Filter; use OCA\Richdocuments\Filter;
class SettingsController extends Controller{ class SettingsController extends Controller{

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -10,13 +10,13 @@
*/ */
namespace OCA\Documents\Controller; namespace OCA\Richdocuments\Controller;
use \OCP\AppFramework\Controller; use \OCP\AppFramework\Controller;
use \OCP\IRequest; use \OCP\IRequest;
use \OCP\AppFramework\Http\JSONResponse; use \OCP\AppFramework\Http\JSONResponse;
use \OCA\Documents\Db; use \OCA\Richdocuments\Db;
class UserController extends Controller { class UserController extends Controller {

@ -25,11 +25,11 @@
/*global runtime, define, document, core, odf, gui, ops*/ /*global runtime, define, document, core, odf, gui, ops*/
define("webodf/editor/EditorSession", [ define("webodf/editor/EditorSession", [
"dojo/text!" + OC.filePath('documents', 'css', 'fonts.css') "dojo/text!" + OC.filePath('richdocuments', 'css', 'fonts.css')
], function (fontsCSS) { // fontsCSS is retrieved as a string, using dojo's text retrieval AMD plugin ], function (fontsCSS) { // fontsCSS is retrieved as a string, using dojo's text retrieval AMD plugin
"use strict"; "use strict";
fontsCSS = fontsCSS.replace(/\.\/fonts/g, OC.appswebroots['documents']+'/css/fonts'); fontsCSS = fontsCSS.replace(/\.\/fonts/g, OC.appswebroots['richdocuments']+'/css/fonts');
runtime.loadClass("core.Async"); runtime.loadClass("core.Async");
runtime.loadClass("core.DomUtils"); runtime.loadClass("core.DomUtils");

@ -43,7 +43,7 @@ define("owncloud/ServerFactory", [
server = new PullBoxServer(args); server = new PullBoxServer(args);
server.getGenesisUrl = function(sid) { server.getGenesisUrl = function(sid) {
return OC.generateUrl('apps/documents/ajax/genesis/{es_id}', {es_id: sid}) + '?requesttoken=' + encodeURIComponent(oc_requesttoken); return OC.generateUrl('apps/richdocuments/ajax/genesis/{es_id}', {es_id: sid}) + '?requesttoken=' + encodeURIComponent(oc_requesttoken);
}; };
return server; return server;
}; };

@ -13,9 +13,9 @@ $(document).ready(function(){
data.url = $('#docs_url').val(); data.url = $('#docs_url').val();
} }
OC.msg.startAction('#documents-admin-msg', t('documents', 'Saving...')); OC.msg.startAction('#documents-admin-msg', t('richdocuments', 'Saving...'));
$.post( $.post(
OC.filePath('documents', 'ajax', 'admin.php'), OC.filePath('richdocuments', 'ajax', 'admin.php'),
data, data,
documentsSettings.afterSave documentsSettings.afterSave
); );

@ -78,7 +78,7 @@ $.widget('oc.documentGrid', {
_load : function (){ _load : function (){
var that = this; var that = this;
var def = new $.Deferred(); var def = new $.Deferred();
$.getJSON(OC.generateUrl('apps/documents/ajax/documents/list')) $.getJSON(OC.generateUrl('apps/richdocuments/ajax/documents/list'))
.done(function (data) { .done(function (data) {
that.options.documents = data.documents; that.options.documents = data.documents;
that.options.sessions = data.sessions; that.options.sessions = data.sessions;
@ -86,7 +86,7 @@ $.widget('oc.documentGrid', {
def.resolve(); def.resolve();
}) })
.fail(function(data){ .fail(function(data){
console.log(t('documents','Failed to load documents.')); console.log(t('richdocuments','Failed to load documents.'));
}); });
return def; return def;
}, },
@ -121,7 +121,7 @@ $.widget('oc.documentGrid', {
if (!hasDocuments){ if (!hasDocuments){
$(this.options.context).before('<div id="emptycontent">' $(this.options.context).before('<div id="emptycontent">'
+ t('documents', 'No documents were found. Upload or create a document to get started!') + t('richdocuments', 'No documents were found. Upload or create a document to get started!')
+ '</div>' + '</div>'
); );
} else { } else {
@ -239,7 +239,7 @@ var documentsMain = {
$('#memberList .memberListButton').css({opacity : 0.3}); $('#memberList .memberListButton').css({opacity : 0.3});
$('#ocToolbar').children(':not(#document-title)').hide(); $('#ocToolbar').children(':not(#document-title)').hide();
$('<div id="connection-lost"></div>').prependTo('#memberList'); $('<div id="connection-lost"></div>').prependTo('#memberList');
$('<div id="warning-connection-lost">' + t('documents', 'No connection to server. Trying to reconnect.') +'<img src="'+ OC.imagePath('core', 'loading-dark.gif') +'" alt="" /></div>').prependTo('#ocToolbar'); $('<div id="warning-connection-lost">' + t('richdocuments', 'No connection to server. Trying to reconnect.') +'<img src="'+ OC.imagePath('core', 'loading-dark.gif') +'" alt="" /></div>').prependTo('#ocToolbar');
}, },
hideLostConnection : function() { hideLostConnection : function() {
@ -289,7 +289,7 @@ var documentsMain = {
documentsMain.isEditorMode = true; documentsMain.isEditorMode = true;
documentsMain.overlay.documentOverlay('show'); documentsMain.overlay.documentOverlay('show');
$(window).on('beforeunload', function(){ $(window).on('beforeunload', function(){
return t('documents', "Leaving this page in Editor mode might cause unsaved data. It is recommended to use 'Close' button instead."); return t('richdocuments', "Leaving this page in Editor mode might cause unsaved data. It is recommended to use 'Close' button instead.");
}); });
$(window).on("unload", documentsMain.onTerminate); $(window).on("unload", documentsMain.onTerminate);
}, },
@ -308,7 +308,7 @@ var documentsMain = {
$(documentsMain.toolbar).appendTo('#header'); $(documentsMain.toolbar).appendTo('#header');
if (!response || !response.status || response.status==='error'){ if (!response || !response.status || response.status==='error'){
documentsMain.onEditorShutdown(t('documents', 'Failed to load this document. Please check if it can be opened with an external editor. This might also mean it has been unshared or deleted recently.')); documentsMain.onEditorShutdown(t('richdocuments', 'Failed to load this document. Please check if it can be opened with an external editor. This might also mean it has been unshared or deleted recently.'));
return; return;
} }
@ -320,11 +320,11 @@ var documentsMain = {
} }
var pollUrl = documentsMain.isGuest var pollUrl = documentsMain.isGuest
? OC.generateUrl('apps/documents/session/guest/poll/{token}', {'token' : $("[name='document']").val()}) ? OC.generateUrl('apps/richdocuments/session/guest/poll/{token}', {'token' : $("[name='document']").val()})
: OC.generateUrl('apps/documents/session/user/poll'), : OC.generateUrl('apps/richdocuments/session/user/poll'),
saveUrl = documentsMain.isGuest saveUrl = documentsMain.isGuest
? OC.generateUrl('apps/documents/session/guest/save/{token}', {'token' : $("[name='document']").val()}) ? OC.generateUrl('apps/richdocuments/session/guest/save/{token}', {'token' : $("[name='document']").val()})
: OC.generateUrl('apps/documents/session/user/save') : OC.generateUrl('apps/richdocuments/session/user/save')
; ;
documentsMain.canShare = !documentsMain.isGuest documentsMain.canShare = !documentsMain.isGuest
&& typeof OC.Share !== 'undefined' && response.permissions & OC.PERMISSION_SHARE; && typeof OC.Share !== 'undefined' && response.permissions & OC.PERMISSION_SHARE;
@ -341,7 +341,7 @@ var documentsMain = {
documentsMain.loadDocument(); documentsMain.loadDocument();
if (documentsMain.isGuest){ if (documentsMain.isGuest){
$('#odf-close').text(t('documents', 'Save') ); $('#odf-close').text(t('richdocuments', 'Save') );
$('#odf-close').removeClass('icon-view-close'); $('#odf-close').removeClass('icon-view-close');
} }
}); });
@ -352,9 +352,9 @@ var documentsMain = {
console.log('joining session '+fileId); console.log('joining session '+fileId);
var url; var url;
if (documentsMain.isGuest){ if (documentsMain.isGuest){
url = OC.generateUrl('apps/documents/session/guest/join/{token}', {token: fileId}); url = OC.generateUrl('apps/richdocuments/session/guest/join/{token}', {token: fileId});
} else { } else {
url = OC.generateUrl('apps/documents/session/user/join/{file_id}', {file_id: fileId}); url = OC.generateUrl('apps/richdocuments/session/user/join/{file_id}', {file_id: fileId});
} }
$.post( $.post(
url, url,
@ -364,7 +364,7 @@ var documentsMain = {
}, },
view : function(id){ view : function(id){
OC.addScript('documents', 'viewer/viewer', function() { OC.addScript('richdocuments', 'viewer/viewer', function() {
documentsMain.prepareGrid(); documentsMain.prepareGrid();
$(window).off('beforeunload'); $(window).off('beforeunload');
$(window).off('unload'); $(window).off('unload');
@ -396,7 +396,7 @@ var documentsMain = {
docElem.insertAfter('.documentslist .template'); docElem.insertAfter('.documentslist .template');
docElem.show(); docElem.show();
$.post( $.post(
OC.generateUrl('apps/documents/ajax/documents/create'), OC.generateUrl('apps/richdocuments/ajax/documents/create'),
{ mimetype : mimetype }, { mimetype : mimetype },
function(response){ function(response){
if (response && response.fileid){ if (response && response.fileid){
@ -414,7 +414,7 @@ var documentsMain = {
}, },
changeNick: function(memberId, name, node){ changeNick: function(memberId, name, node){
var url = OC.generateUrl('apps/documents/ajax/user/rename'); var url = OC.generateUrl('apps/richdocuments/ajax/user/rename');
$.ajax({ $.ajax({
url: url, url: url,
type: "POST", type: "POST",
@ -489,7 +489,7 @@ var documentsMain = {
}, },
loadDocument: function() { loadDocument: function() {
var url = OC.generateUrl('apps/documents/load/{file_id}', {file_id: documentsMain.fileId}); var url = OC.generateUrl('apps/richdocuments/load/{file_id}', {file_id: documentsMain.fileId});
$.post( $.post(
url, url,
{}, {},
@ -498,7 +498,7 @@ var documentsMain = {
if (result.message){ if (result.message){
documentsMain.IU.notify(result.message); documentsMain.IU.notify(result.message);
} }
documentsMain.onEditorShutdown(t('documents', 'Failed to load this document. Please check if it can be opened with an external editor. This might also mean it has been unshared or deleted recently.')); documentsMain.onEditorShutdown(t('richdocuments', 'Failed to load this document. Please check if it can be opened with an external editor. This might also mean it has been unshared or deleted recently.'));
return; return;
} }
@ -511,7 +511,7 @@ var documentsMain = {
}, },
saveDocumentBack: function() { saveDocumentBack: function() {
var url = OC.generateUrl('apps/documents/save/{file_id}', {file_id: documentsMain.fileId}); var url = OC.generateUrl('apps/richdocuments/save/{file_id}', {file_id: documentsMain.fileId});
$.post( $.post(
url, url,
{ basename : documentsMain.baseName }, { basename : documentsMain.baseName },
@ -520,7 +520,7 @@ var documentsMain = {
if (result.message){ if (result.message){
documentsMain.IU.notify(result.message); documentsMain.IU.notify(result.message);
} }
documentsMain.onEditorShutdown(t('documents', 'Failed to save this document. Please check if it can be saved with an external editor. This might also mean it has been unshared or deleted recently.')); documentsMain.onEditorShutdown(t('richdocuments', 'Failed to save this document. Please check if it can be saved with an external editor. This might also mean it has been unshared or deleted recently.'));
return; return;
} }
} }
@ -528,7 +528,7 @@ var documentsMain = {
}, },
closeDocument: function() { closeDocument: function() {
var url = OC.generateUrl('apps/documents/close/{file_id}', {file_id: documentsMain.fileId}); var url = OC.generateUrl('apps/richdocuments/close/{file_id}', {file_id: documentsMain.fileId});
$.post( $.post(
url, url,
{ basename : documentsMain.baseName } { basename : documentsMain.baseName }
@ -536,7 +536,7 @@ var documentsMain = {
}, },
renameDocument: function(name) { renameDocument: function(name) {
var url = OC.generateUrl('apps/documents/ajax/documents/rename/{file_id}', {file_id: documentsMain.fileId}); var url = OC.generateUrl('apps/richdocuments/ajax/documents/rename/{file_id}', {file_id: documentsMain.fileId});
$.post( $.post(
url, url,
{ name : name }, { name : name },
@ -592,9 +592,9 @@ var documentsMain = {
onTerminate: function(){ onTerminate: function(){
var url = ''; var url = '';
if (documentsMain.isGuest){ if (documentsMain.isGuest){
url = OC.generateUrl('apps/documents/ajax/user/disconnectGuest/{member_id}', {member_id: documentsMain.memberId}); url = OC.generateUrl('apps/richdocuments/ajax/user/disconnectGuest/{member_id}', {member_id: documentsMain.memberId});
} else { } else {
url = OC.generateUrl('apps/documents/ajax/user/disconnect/{member_id}', {member_id: documentsMain.memberId}); url = OC.generateUrl('apps/richdocuments/ajax/user/disconnect/{member_id}', {member_id: documentsMain.memberId});
} }
$.ajax({ $.ajax({
type: "POST", type: "POST",
@ -613,7 +613,7 @@ var documentsMain = {
if (documentsMain.isGuest){ if (documentsMain.isGuest){
return; return;
} }
documentsMain.UI.showProgress(t('documents', 'Loading documents...')); documentsMain.UI.showProgress(t('richdocuments', 'Loading documents...'));
documentsMain.docs.documentGrid('render'); documentsMain.docs.documentGrid('render');
documentsMain.UI.hideProgress(); documentsMain.UI.hideProgress();
} }

@ -1,48 +1,48 @@
t('documents', 'Align Left'); t('richdocuments', 'Align Left');
t('documents', 'Alignment'); t('richdocuments', 'Alignment');
t('documents', 'Align Right'); t('richdocuments', 'Align Right');
t('documents', 'Annotate'); t('richdocuments', 'Annotate');
t('documents', 'Background'); t('richdocuments', 'Background');
t('documents', 'Bold'); t('richdocuments', 'Bold');
t('documents', 'Bottom'); t('richdocuments', 'Bottom');
t('documents', 'Cancel'); t('richdocuments', 'Cancel');
t('documents', 'Center'); t('richdocuments', 'Center');
t('documents', 'Clone'); t('richdocuments', 'Clone');
t('documents', 'Clone this Style'); t('richdocuments', 'Clone this Style');
t('documents', 'Close'); t('richdocuments', 'Close');
t('documents', 'Color'); t('richdocuments', 'Color');
t('documents', 'Create'); t('richdocuments', 'Create');
t('documents', 'Decrease Indent'); t('richdocuments', 'Decrease Indent');
t('documents', 'Default Style'); t('richdocuments', 'Default Style');
t('documents', 'Delete'); t('richdocuments', 'Delete');
t('documents', 'Family'); t('richdocuments', 'Family');
t('documents', 'Font'); t('richdocuments', 'Font');
t('documents', 'Font Effects'); t('richdocuments', 'Font Effects');
t('documents', 'Format'); t('richdocuments', 'Format');
t('documents', 'Increase Indent'); t('richdocuments', 'Increase Indent');
t('documents', 'Insert Image'); t('richdocuments', 'Insert Image');
t('documents', 'Invite Members'); t('richdocuments', 'Invite Members');
t('documents', 'Italic'); t('richdocuments', 'Italic');
t('documents', 'Justified'); t('richdocuments', 'Justified');
t('documents', 'Justify'); t('richdocuments', 'Justify');
t('documents', 'Left'); t('richdocuments', 'Left');
t('documents', 'Loading'); t('richdocuments', 'Loading');
t('documents', 'Members'); t('richdocuments', 'Members');
t('documents', 'New Name:'); t('richdocuments', 'New Name:');
t('documents', 'OK'); t('richdocuments', 'OK');
t('documents', 'Open'); t('richdocuments', 'Open');
t('documents', 'Options'); t('richdocuments', 'Options');
t('documents', 'Paragraph...'); t('richdocuments', 'Paragraph...');
t('documents', 'Paragraph Styles'); t('richdocuments', 'Paragraph Styles');
t('documents', 'Redo'); t('richdocuments', 'Redo');
t('documents', 'Right'); t('richdocuments', 'Right');
t('documents', 'Save'); t('richdocuments', 'Save');
t('documents', 'Size'); t('richdocuments', 'Size');
t('documents', 'Spacing'); t('richdocuments', 'Spacing');
t('documents', 'Strikethrough'); t('richdocuments', 'Strikethrough');
t('documents', 'Style'); t('richdocuments', 'Style');
t('documents', 'Text'); t('richdocuments', 'Text');
t('documents', 'Top'); t('richdocuments', 'Top');
t('documents', 'Underline'); t('richdocuments', 'Underline');
t('documents', 'Undo'); t('richdocuments', 'Undo');
t('documents', 'Unknown Author'); t('richdocuments', 'Unknown Author');

@ -5,7 +5,7 @@ $(document).ready(function(){
savePath : $('#documents-default-path').val() savePath : $('#documents-default-path').val()
}; };
OC.msg.startSaving('#documents-personal .msg'); OC.msg.startSaving('#documents-personal .msg');
$.post(OC.filePath('documents', 'ajax', 'personal.php'), data, documentsSettings.afterSave); $.post(OC.filePath('richdocuments', 'ajax', 'personal.php'), data, documentsSettings.afterSave);
}, },
afterSave : function(data){ afterSave : function(data){
OC.msg.finishedSaving('#documents-personal .msg', data); OC.msg.finishedSaving('#documents-personal .msg', data);

@ -5,7 +5,7 @@ $(document).ready(function(){
var data = { var data = {
unstable : $('#webodf-unstable').attr('checked')==="checked" unstable : $('#webodf-unstable').attr('checked')==="checked"
}; };
$.post(OC.generateUrl('apps/documents/ajax/config/unstable'), data, documentsSettings.afterSave); $.post(OC.generateUrl('apps/richdocuments/ajax/config/unstable'), data, documentsSettings.afterSave);
}, },
afterSave : function(){ afterSave : function(){
documentsMain.useUnstable = $('#webodf-unstable').attr('checked')==="checked"; documentsMain.useUnstable = $('#webodf-unstable').attr('checked')==="checked";

@ -60,7 +60,7 @@ var odfViewer = {
OC.PERMISSION_UPDATE, OC.PERMISSION_UPDATE,
OC.imagePath('core', 'actions/rename'), OC.imagePath('core', 'actions/rename'),
odfViewer.onEdit, odfViewer.onEdit,
t('documents', 'Edit') t('richdocuments', 'Edit')
); );
OCA.Files.fileActions.setDefault(mimeReadWrite, 'Edit'); OCA.Files.fileActions.setDefault(mimeReadWrite, 'Edit');
} }
@ -78,7 +78,7 @@ var odfViewer = {
onEdit : function(fileName, context){ onEdit : function(fileName, context){
var fileId = context.$file.attr('data-id'); var fileId = context.$file.attr('data-id');
window.location = OC.generateUrl('apps/documents/index#{file_id}', {file_id: fileId}); window.location = OC.generateUrl('apps/richdocuments/index#{file_id}', {file_id: fileId});
}, },
onView: function(filename, context) { onView: function(filename, context) {
@ -119,7 +119,7 @@ $(document).ready(function() {
&& typeof OCA.Files.fileActions !== 'undefined' && typeof OCA.Files.fileActions !== 'undefined'
) { ) {
$.get( $.get(
OC.filePath('documents', 'ajax', 'mimes.php'), OC.filePath('richdocuments', 'ajax', 'mimes.php'),
{}, {},
odfViewer.register odfViewer.register
); );

@ -5,7 +5,7 @@ define("owncloud/widgets/ocShare",
return declare("OcShare", [_WidgetBase, _TemplatedMixin], { return declare("OcShare", [_WidgetBase, _TemplatedMixin], {
templateString: '<div class="dijit" style="float:left;margin-top:3px">' templateString: '<div class="dijit" style="float:left;margin-top:3px">'
+ '<button id="odf-invite" class="drop icon-share svg" data-dojo-attach-event="onclick: showDropdown">' + + '<button id="odf-invite" class="drop icon-share svg" data-dojo-attach-event="onclick: showDropdown">' +
t('documents', 'Share') + t('richdocuments', 'Share') +
'</button></div>', '</button></div>',
postCreate: function () { postCreate: function () {
this.inherited(arguments); this.inherited(arguments);
@ -21,7 +21,7 @@ define("owncloud/widgets/ocShare",
var target = OC.Share.showLink; var target = OC.Share.showLink;
OC.Share.showLink = function () { OC.Share.showLink = function () {
var r = target.apply(this, arguments); var r = target.apply(this, arguments);
$('#linkText').val($('#linkText').val().replace('index.php/s/', 'public.php?service=documents&t=')); $('#linkText').val($('#linkText').val().replace('index.php/s/', 'public.php?service=richdocuments&t='));
return r; return r;
}; };
})(); })();

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2015 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2015 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -9,12 +9,12 @@
* later. * later.
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
use \OCP\IConfig; use \OCP\IConfig;
class AppConfig{ class AppConfig{
private $appName = 'documents'; private $appName = 'richdocuments';
private $defaults = [ private $defaults = [
'converter' => 'off', 'converter' => 'off',
'converter_url' => 'http://localhost:16080', 'converter_url' => 'http://localhost:16080',

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -10,9 +10,9 @@
* later. * later.
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
use OCA\Documents\AppInfo\Application; use OCA\Richdocuments\AppInfo\Application;
class Converter { class Converter {
@ -41,7 +41,7 @@ class Converter {
if (!$exists){ if (!$exists){
\OC::$server->getLogger()->warn( \OC::$server->getLogger()->warn(
'Conversion test failed. Raw output:' . $result, 'Conversion test failed. Raw output:' . $result,
['app' => 'documents'] ['app' => 'richdocuments']
); );
return false; return false;
@ -61,7 +61,7 @@ class Converter {
if (empty($output)){ if (empty($output)){
\OC::$server->getLogger()->warn( \OC::$server->getLogger()->warn(
'Empty conversion output', 'Empty conversion output',
['app' => 'documents'] ['app' => 'richdocuments']
); );
throw new \RuntimeException('Empty conversion output'); throw new \RuntimeException('Empty conversion output');
@ -129,7 +129,7 @@ class Converter {
if (curl_errno($ch)){ if (curl_errno($ch)){
\OC::$server->getLogger()->debug( \OC::$server->getLogger()->debug(
'cURL error' . curl_errno($ch) . ':' . curl_error($ch), 'cURL error' . curl_errno($ch) . ':' . curl_error($ch),
['app' => 'documents'] ['app' => 'richdocuments']
); );
} }

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -9,7 +9,7 @@
* later. * later.
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
/** /**
* Generic DB class * Generic DB class
@ -49,7 +49,7 @@ abstract class Db {
/** /**
* Get single record by primary key * Get single record by primary key
* @param int $value primary key value * @param int $value primary key value
* @return \OCA\Documents\Db * @return \OCA\Richdocuments\Db
*/ */
public function load($value){ public function load($value){
if (!is_array($value)){ if (!is_array($value)){
@ -69,7 +69,7 @@ abstract class Db {
* Get single record matching condition * Get single record matching condition
* @param string $field for WHERE condition * @param string $field for WHERE condition
* @param mixed $value matching value(s) * @param mixed $value matching value(s)
* @return \OCA\Documents\Db * @return \OCA\Richdocuments\Db
* @throws Exception * @throws Exception
*/ */
public function loadBy($field, $value){ public function loadBy($field, $value){

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -10,7 +10,7 @@
* later. * later.
*/ */
namespace OCA\Documents\Db; namespace OCA\Richdocuments\Db;
/** /**
* @method boolean getIsGuest() * @method boolean getIsGuest()
@ -19,24 +19,24 @@ namespace OCA\Documents\Db;
* @method int getStatus() * @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 ACTIVITY_THRESHOLD = 90; // 1.5 Minutes
const MEMBER_STATUS_ACTIVE = 1; const MEMBER_STATUS_ACTIVE = 1;
const MEMBER_STATUS_INACTIVE = 2; 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 (?, ?, ?, ?, ?, ?)'; 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(){ public static function getGuestPostfix(){
return '(' . \OC::$server->getL10n('documents')->t('guest') . ')'; return '(' . \OC::$server->getL10n('richdocuments')->t('guest') . ')';
} }

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -9,15 +9,15 @@
* later. * 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){ public static function addOpsArray($esId, $memberId, $ops){
$opObj = new Op(); $opObj = new Op();

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -10,11 +10,11 @@
* later. * later.
*/ */
namespace OCA\Documents\Db; namespace OCA\Richdocuments\Db;
use OCP\Security\ISecureRandom; use OCP\Security\ISecureRandom;
use OCA\Documents\Filter; use OCA\Richdocuments\Filter;
/** /**
* Session management * Session management
@ -26,29 +26,29 @@ use OCA\Documents\Filter;
* @method string getGenesisHash() * @method string getGenesisHash()
* *
*/ */
class Session extends \OCA\Documents\Db { class Session extends \OCA\Richdocuments\Db {
/** /**
* DB table * DB table
*/ */
const DB_TABLE = '`*PREFIX*documents_session`'; const DB_TABLE = '`*PREFIX*richdocuments_session`';
protected $tableName = '`*PREFIX*documents_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 (?, ?, ?, ?, ?)'; 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 * Start a editing session or return an existing one
* @param string $uid of the user starting a session * @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 * @return array
* @throws \Exception * @throws \Exception
*/ */
public static function start($uid, $file){ public static function start($uid, $file){
// Create a directory to store genesis // Create a directory to store genesis
$genesis = new \OCA\Documents\Genesis($file); $genesis = new \OCA\Richdocuments\Genesis($file);
$oldSession = new Session(); $oldSession = new Session();
$oldSession->loadBy('file_id', $file->getFileId()); $oldSession->loadBy('file_id', $file->getFileId());
@ -72,8 +72,8 @@ class Session extends \OCA\Documents\Db {
->getData() ->getData()
; ;
$memberColor = \OCA\Documents\Helper::getMemberColor($uid); $memberColor = \OCA\Richdocuments\Helper::getMemberColor($uid);
$member = new \OCA\Documents\Db\Member([ $member = new \OCA\Richdocuments\Db\Member([
$sessionData['es_id'], $sessionData['es_id'],
$uid, $uid,
$memberColor, $memberColor,
@ -95,11 +95,11 @@ class Session extends \OCA\Documents\Db {
} }
$displayName = $file->isPublicShare() $displayName = $file->isPublicShare()
? $uid . ' ' . \OCA\Documents\Db\Member::getGuestPostfix() ? $uid . ' ' . \OCA\Richdocuments\Db\Member::getGuestPostfix()
: \OC::$server->getUserSession()->getUser()->getDisplayName($uid) : \OC::$server->getUserSession()->getUser()->getDisplayName($uid)
; ;
$userId = $file->isPublicShare() ? $displayName : \OC::$server->getUserSession()->getUser()->getUID(); $userId = $file->isPublicShare() ? $displayName : \OC::$server->getUserSession()->getUser()->getUID();
$op = new \OCA\Documents\Db\Op(); $op = new \OCA\Richdocuments\Db\Op();
$op->addMember( $op->addMember(
$sessionData['es_id'], $sessionData['es_id'],
$sessionData['member_id'], $sessionData['member_id'],
@ -119,17 +119,17 @@ class Session extends \OCA\Documents\Db {
$session = new Session(); $session = new Session();
$session->deleteBy('es_id', $esId); $session->deleteBy('es_id', $esId);
$member = new \OCA\Documents\Db\Member(); $member = new \OCA\Richdocuments\Db\Member();
$member->deleteBy('es_id', $esId); $member->deleteBy('es_id', $esId);
$op= new \OCA\Documents\Db\Op(); $op= new \OCA\Richdocuments\Db\Op();
$op->deleteBy('es_id', $esId); $op->deleteBy('es_id', $esId);
} }
public function syncOps($memberId, $currentHead, $clientHead, $clientOps){ public function syncOps($memberId, $currentHead, $clientHead, $clientOps){
$hasOps = count($clientOps)>0; $hasOps = count($clientOps)>0;
$op = new \OCA\Documents\Db\Op(); $op = new \OCA\Richdocuments\Db\Op();
// TODO handle the case ($currentHead == "") && ($seqHead != "") // TODO handle the case ($currentHead == "") && ($seqHead != "")
if ($clientHead == $currentHead) { if ($clientHead == $currentHead) {
@ -137,7 +137,7 @@ class Session extends \OCA\Documents\Db {
if ($hasOps) { if ($hasOps) {
// incoming ops without conflict // incoming ops without conflict
// Add incoming ops, respond with a new head // 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 = array(
'result' => 'added', 'result' => 'added',
'head_seq' => $newHead ? $newHead : $currentHead 'head_seq' => $newHead ? $newHead : $currentHead
@ -169,7 +169,7 @@ class Session extends \OCA\Documents\Db {
public function updateGenesisHash($esId, $genesisHash){ public function updateGenesisHash($esId, $genesisHash){
return $this->execute( return $this->execute(
'UPDATE `*PREFIX*documents_session` SET `genesis_hash`=? WHERE `es_id`=?', 'UPDATE `*PREFIX*richdocuments_session` SET `genesis_hash`=? WHERE `es_id`=?',
array( array(
$genesisHash, $esId $genesisHash, $esId
) )
@ -180,7 +180,7 @@ class Session extends \OCA\Documents\Db {
$result = $this->execute(' $result = $this->execute('
SELECT `s`.*, COUNT(`m`.`member_id`) AS `users` SELECT `s`.*, COUNT(`m`.`member_id`) AS `users`
FROM ' . $this->tableName . ' AS `s` 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`.`status`=' . Db\Member::MEMBER_STATUS_ACTIVE . '
AND `m`.`uid` != ? AND `m`.`uid` != ?
WHERE `s`.`es_id` = ? WHERE `s`.`es_id` = ?

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -9,7 +9,7 @@
* later. * later.
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
use \OCP\AppFramework\Http; use \OCP\AppFramework\Http;
use \OCP\IRequest; use \OCP\IRequest;
@ -44,7 +44,7 @@ class DownloadResponse extends \OCP\AppFramework\Http\Response {
$this->ETag = $info['etag']; $this->ETag = $info['etag'];
$content = $this->view->file_get_contents($this->path); $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']); $size = strlen($data['content']);

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -20,7 +20,7 @@
* *
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
use \OC\Files\View; use \OC\Files\View;
@ -190,7 +190,7 @@ class File {
$mimetype = $this->ownerView->getMimeType($this->path); $mimetype = $this->ownerView->getMimeType($this->path);
if (!Filter::isSupportedMimetype($mimetype)){ 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');
} }
} }

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -10,7 +10,7 @@
* later. * later.
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
class Filter { class Filter {
protected static $filters = array(); protected static $filters = array();

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - RichDocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -10,7 +10,7 @@
* later. * later.
*/ */
namespace OCA\Documents\Filter; namespace OCA\Richdocuments\Filter;
class Office { class Office {
const NATIVE_MIMETYPE = 'application/vnd.oasis.opendocument.text'; const NATIVE_MIMETYPE = 'application/vnd.oasis.opendocument.text';
@ -55,14 +55,14 @@ class Office {
$this->readSpec = $mimeSpec['read']; $this->readSpec = $mimeSpec['read'];
$this->writeSpec = $mimeSpec['write']; $this->writeSpec = $mimeSpec['write'];
\OCA\Documents\Filter::add($mimeSpec['write']['target'], $this); \OCA\Richdocuments\Filter::add($mimeSpec['write']['target'], $this);
} }
public function read($data){ public function read($data){
return array( return array(
'mimetype' => $this->readSpec['target'], 'mimetype' => $this->readSpec['target'],
'content' => 'content' =>
\OCA\Documents\Converter::convert( \OCA\Richdocuments\Converter::convert(
$data['content'], $data['content'],
$this->readSpec['format'], $this->readSpec['format'],
$this->readSpec['extension'] $this->readSpec['extension']
@ -74,7 +74,7 @@ class Office {
return array( return array(
'mimetype' => $this->writeSpec['target'], 'mimetype' => $this->writeSpec['target'],
'content' => 'content' =>
\OCA\Documents\Converter::convert( \OCA\Richdocuments\Converter::convert(
$data['content'], $data['content'],
$this->writeSpec['format'], $this->writeSpec['format'],
$this->writeSpec['extension'] $this->writeSpec['extension']

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -20,7 +20,7 @@
* *
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
use \OC\Files\View; use \OC\Files\View;

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -10,11 +10,11 @@
* later. * later.
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
class Helper { class Helper {
const APP_ID = 'documents'; const APP_ID = 'richdocuments';
public static function getNewFileName($view, $path, $prepend = ' '){ public static function getNewFileName($view, $path, $prepend = ' '){
$fileNum = 1; $fileNum = 1;
@ -162,12 +162,12 @@ class Helper {
if (empty($cmd)){ if (empty($cmd)){
\OC::$server->getLogger()->warn( \OC::$server->getLogger()->warn(
'Pure configuration issue. Missing open office binary that is mandatory for conversion.', 'Pure configuration issue. Missing open office binary that is mandatory for conversion.',
['app' => 'documents'] ['app' => 'richdocuments']
); );
\OC::$server->getLogger()->debug( \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.', '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.'); throw new \RuntimeException('Missing open office binary that is mandatory for conversion.');

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Frank Karlitschek * @author Frank Karlitschek
* @copyright 2013-2014 Frank Karlitschek frank@owncloud.org * @copyright 2013-2014 Frank Karlitschek frank@owncloud.org
@ -22,7 +22,7 @@
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
class Storage { class Storage {
public static $MIMETYPE_LIBREOFFICE_WORDPROCESSOR = array( public static $MIMETYPE_LIBREOFFICE_WORDPROCESSOR = array(

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -10,10 +10,10 @@
* later. * later.
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
use \OCA\Documents\AppInfo\Application; use \OCA\Richdocuments\AppInfo\Application;
$app = new Application(); $app = new Application();
$response = $app->getContainer()->query('\OCA\Documents\Controller\SettingsController')->personalIndex(); $response = $app->getContainer()->query('\OCA\Richdocuments\Controller\SettingsController')->personalIndex();
return $response->render(); return $response->render();

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -11,7 +11,7 @@
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
\OCP\JSON::checkAppEnabled('documents'); \OCP\JSON::checkAppEnabled('documents');
@ -33,8 +33,8 @@ if (isset($_GET['t'])) {
} }
$tmpl->assign('hasPassword', true); $tmpl->assign('hasPassword', true);
} else { } else {
\OCP\Util::addStyle( 'documents', '3rdparty/webodf/dojo-app'); \OCP\Util::addStyle( 'richdocuments', '3rdparty/webodf/dojo-app');
\OCP\Util::addScript('documents', 'documents'); \OCP\Util::addScript('richdocuments', 'documents');
if ($file->getFileId()){ if ($file->getFileId()){
$session = new Db\Session(); $session = new Db\Session();
$session->loadBy('file_id', $file->getFileId()); $session->loadBy('file_id', $file->getFileId());

@ -1,7 +1,7 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2013 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -10,10 +10,10 @@
* later. * later.
*/ */
namespace OCA\Documents; namespace OCA\Richdocuments;
use \OCA\Documents\AppInfo\Application; use \OCA\Richdocuments\AppInfo\Application;
$app = new Application(); $app = new Application();
$response = $app->getContainer()->query('\OCA\Documents\Controller\SettingsController')->settingsIndex(); $response = $app->getContainer()->query('\OCA\Richdocuments\Controller\SettingsController')->settingsIndex();
return $response->render(); return $response->render();

@ -1,5 +1,5 @@
<?php <?php
script('documents', 'admin'); script('richdocuments', 'admin');
?> ?>
<div class="section" id="documents"> <div class="section" id="documents">
<h2><?php p($l->t('Documents')) ?></h2> <h2><?php p($l->t('Documents')) ?></h2>

@ -1,9 +1,9 @@
<?php <?php
style( 'documents', 'share' ); style( 'richdocuments', 'share' );
style( 'documents', 'style' ); style( 'richdocuments', 'style' );
style( 'documents', '3rdparty/webodf/dojo-app' ); style( 'richdocuments', '3rdparty/webodf/dojo-app' );
script('documents', 'share'); script('richdocuments', 'share');
script('documents', 'documents'); script('richdocuments', 'documents');
script('files', 'file-upload'); script('files', 'file-upload');
script('files', 'jquery.iframe-transport'); script('files', 'jquery.iframe-transport');
script('files', 'jquery.fileupload'); script('files', 'jquery.fileupload');

@ -1,5 +1,5 @@
<?php <?php
script('documents', 'personal'); script('richdocuments', 'personal');
?> ?>
<div class="section" id="documents-personal"> <div class="section" id="documents-personal">
<h2><?php p($l->t('Documents')); ?></h2> <h2><?php p($l->t('Documents')); ?></h2>

@ -1,5 +1,5 @@
<?php <?php
style( 'documents', 'style' ); style( 'richdocuments', 'style' );
?> ?>
<div id="notification-container"> <div id="notification-container">
<div id="notification" style="display: none;"></div> <div id="notification" style="display: none;"></div>

@ -1,5 +1,5 @@
<?php <?php
script('documents', 'settings'); script('richdocuments', 'settings');
?> ?>
<div id="documents" class="section"> <div id="documents" class="section">
<h2><?php p($l->t('Documents')) ?></h2> <h2><?php p($l->t('Documents')) ?></h2>

@ -9,5 +9,5 @@ require_once __DIR__.'/../../../lib/base.php';
if(!class_exists('PHPUnit_Framework_TestCase')) { if(!class_exists('PHPUnit_Framework_TestCase')) {
require_once('PHPUnit/Autoload.php'); require_once('PHPUnit/Autoload.php');
} }
\OC_App::loadApp('documents'); \OC_App::loadApp('richdocuments');
OC_Hook::clear(); OC_Hook::clear();

@ -1,6 +1,6 @@
<?php <?php
/** /**
* ownCloud - Documents App * ownCloud - Richdocuments App
* *
* @author Victor Dubiniuk * @author Victor Dubiniuk
* @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com * @copyright 2014 Victor Dubiniuk victor.dubiniuk@gmail.com
@ -9,10 +9,10 @@
* later. * later.
*/ */
namespace OCA\Documents\Controller; namespace OCA\Richdocuments\Controller;
class DocumentControllerTest extends \PHPUnit_Framework_TestCase { class DocumentControllerTest extends \PHPUnit_Framework_TestCase {
private $appName = 'documents'; private $appName = 'richdocuments';
private $request; private $request;
private $l10n; private $l10n;
private $settings; private $settings;

Loading…
Cancel
Save