|
|
@ -48,15 +48,17 @@ class DocumentController extends Controller {
|
|
|
|
private $uid;
|
|
|
|
private $uid;
|
|
|
|
private $l10n;
|
|
|
|
private $l10n;
|
|
|
|
private $settings;
|
|
|
|
private $settings;
|
|
|
|
|
|
|
|
private $appConfig;
|
|
|
|
private $cache;
|
|
|
|
private $cache;
|
|
|
|
private $logger;
|
|
|
|
private $logger;
|
|
|
|
const ODT_TEMPLATE_PATH = '/assets/odttemplate.odt';
|
|
|
|
const ODT_TEMPLATE_PATH = '/assets/odttemplate.odt';
|
|
|
|
|
|
|
|
|
|
|
|
public function __construct($appName, IRequest $request, IConfig $settings, IL10N $l10n, $uid, ICacheFactory $cache, ILogger $logger){
|
|
|
|
public function __construct($appName, IRequest $request, IConfig $settings, IConfig $appConfig, IL10N $l10n, $uid, ICacheFactory $cache, ILogger $logger){
|
|
|
|
parent::__construct($appName, $request);
|
|
|
|
parent::__construct($appName, $request);
|
|
|
|
$this->uid = $uid;
|
|
|
|
$this->uid = $uid;
|
|
|
|
$this->l10n = $l10n;
|
|
|
|
$this->l10n = $l10n;
|
|
|
|
$this->settings = $settings;
|
|
|
|
$this->settings = $settings;
|
|
|
|
|
|
|
|
$this->appConfig = $appConfig;
|
|
|
|
$this->cache = $cache->create($appName);
|
|
|
|
$this->cache = $cache->create($appName);
|
|
|
|
$this->logger = $logger;
|
|
|
|
$this->logger = $logger;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -121,7 +123,7 @@ class DocumentController extends Controller {
|
|
|
|
private function getDiscovery(){
|
|
|
|
private function getDiscovery(){
|
|
|
|
\OC::$server->getLogger()->debug('getDiscovery(): Getting discovery.xml from the cache.');
|
|
|
|
\OC::$server->getLogger()->debug('getDiscovery(): Getting discovery.xml from the cache.');
|
|
|
|
|
|
|
|
|
|
|
|
$wopiRemote = $this->settings->getAppValue('richdocuments', 'wopi_url');
|
|
|
|
$wopiRemote = $this->appConfig->getAppValue('wopi_url');
|
|
|
|
|
|
|
|
|
|
|
|
// Provides access to information about the capabilities of a WOPI client
|
|
|
|
// Provides access to information about the capabilities of a WOPI client
|
|
|
|
// and the mechanisms for invoking those abilities through URIs.
|
|
|
|
// and the mechanisms for invoking those abilities through URIs.
|
|
|
@ -183,7 +185,7 @@ class DocumentController extends Controller {
|
|
|
|
|
|
|
|
|
|
|
|
if ($discovery_parsed === false) {
|
|
|
|
if ($discovery_parsed === false) {
|
|
|
|
$this->cache->remove('discovery.xml');
|
|
|
|
$this->cache->remove('discovery.xml');
|
|
|
|
$wopiRemote = $this->settings->getAppValue('richdocuments', 'wopi_url');
|
|
|
|
$wopiRemote = $this->appConfig->getAppValue('wopi_url');
|
|
|
|
|
|
|
|
|
|
|
|
return array(
|
|
|
|
return array(
|
|
|
|
'status' => 'error',
|
|
|
|
'status' => 'error',
|
|
|
@ -239,7 +241,7 @@ class DocumentController extends Controller {
|
|
|
|
* @NoCSRFRequired
|
|
|
|
* @NoCSRFRequired
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function index(){
|
|
|
|
public function index(){
|
|
|
|
$wopiRemote = $this->settings->getAppValue('richdocuments', 'wopi_url');
|
|
|
|
$wopiRemote = $this->appConfig->getAppValue('wopi_url');
|
|
|
|
if (($parts = parse_url($wopiRemote)) && isset($parts['scheme']) && isset($parts['host'])) {
|
|
|
|
if (($parts = parse_url($wopiRemote)) && isset($parts['scheme']) && isset($parts['host'])) {
|
|
|
|
$webSocketProtocol = "ws://";
|
|
|
|
$webSocketProtocol = "ws://";
|
|
|
|
if ($parts['scheme'] == "https") {
|
|
|
|
if ($parts['scheme'] == "https") {
|
|
|
@ -336,7 +338,7 @@ class DocumentController extends Controller {
|
|
|
|
|
|
|
|
|
|
|
|
if ($discovery_parsed === false) {
|
|
|
|
if ($discovery_parsed === false) {
|
|
|
|
$this->cache->remove('discovery.xml');
|
|
|
|
$this->cache->remove('discovery.xml');
|
|
|
|
$wopiRemote = $this->settings->getAppValue('richdocuments', 'wopi_url');
|
|
|
|
$wopiRemote = $this->appConfig->getAppValue('wopi_url');
|
|
|
|
|
|
|
|
|
|
|
|
return array(
|
|
|
|
return array(
|
|
|
|
'status' => 'error',
|
|
|
|
'status' => 'error',
|
|
|
|