Pass Disable{Print,Export,Copy} options to client and handle them

Change-Id: I59a9432bbdd06d8b184f96882c5f4009fcd0be54
This commit is contained in:
Pranav Kant
2016-12-13 17:54:42 +05:30
parent 3ce8c3158a
commit a76825728e
3 changed files with 17 additions and 1 deletions

View File

@ -52,13 +52,20 @@ L.Map.include({
return;
}
id = id || 'export'; // not any special download, simple export
if ((id === 'print' && this['wopi'].DisablePrint) ||
(id === 'export' && this['wopi'].DisableExport)) {
this.hideBusy();
return;
}
if (format === undefined || format === null) {
format = '';
}
if (options === undefined || options === null) {
options = '';
}
id = id || 'export'; // not any special download, simple export
this.showBusy(_('Downloading...'), false);
this._socket.sendMessage('downloadas ' +

View File

@ -10,6 +10,9 @@ L.Map.WOPI = L.Handler.extend({
HidePrintOption: false,
HideSaveOption: false,
HideExportOption: false,
DisablePrint: false,
DisableExport: false,
DisableCopy: false,
_appLoadedConditions: {
doclayerinit: false,
@ -57,6 +60,9 @@ L.Map.WOPI = L.Handler.extend({
this.HidePrintOption = !!wopiInfo['HidePrintOption'];
this.HideSaveOption = !!wopiInfo['HideSaveOption'];
this.HideExportOption = !!wopiInfo['HideExportOption'];
this.DisablePrint = !!wopiInfo['DisablePrint'];
this.DisableExport = !!wopiInfo['DisableExport'];
this.DisableCopy = !!wopiInfo['DisableCopy'];
this._map.fire('postMessage', {msgId: 'App_LoadingStatus', args: {Status: 'Frame_Ready'}});
},

View File

@ -269,6 +269,9 @@ bool DocumentBroker::load(std::shared_ptr<ClientSession>& session, const std::st
wopiInfo->set("HidePrintOption", wopifileinfo->_hidePrintOption);
wopiInfo->set("HideSaveOption", wopifileinfo->_hideSaveOption);
wopiInfo->set("HideExportOption", wopifileinfo->_hideExportOption);
wopiInfo->set("DisablePrint", wopifileinfo->_disablePrint);
wopiInfo->set("DisableExport", wopifileinfo->_disableExport);
wopiInfo->set("DisableCopy", wopifileinfo->_disableCopy);
std::ostringstream ossWopiInfo;
wopiInfo->stringify(ossWopiInfo);