Lines Matching full:file

5  * Realtime collaboration for any file.
7 DrawioFileSync = function(file) argument
13 this.ui = file.ui;
14 this.file = file;
70 EditorUi.logError('Error: Pusher Limit', null, this.file.getId());
84 var user = this.file.getCurrentUser();
96 this.file.stats.msgSent++;
110 this.file.stats.msgReceived++;
113 if (this.enabled && !this.file.inConflictState &&
114 !this.file.redirectDialogShowing)
127 this.file.redirectToNewApp(mxUtils.bind(this, function()
140 // Checks if file was changed
150 // null, 'data_' + len + '_file_' + this.file.getHash() +
240 this.channelId = this.file.getChannelId();
245 this.key = this.file.getChannelKey();
272 …EditorUi.debug('Sync.start', [this, 'v' + DrawioFileSync.PROTOCOL], 'rev', this.file.getCurrentRev…
284 this.lastModified = this.file.getLastModifiedDate();
329 if (!this.file.inConflictState && this.enabled)
403 else if (this.file.invalidChecksum)
418 ((!this.ui.isOffline(true) && this.isConnected() && !this.file.invalidChecksum) ?
436 if (!this.file.isModified() && !this.file.inConflictState &&
437 this.file.autosaveThread == null && !this.file.savingFile &&
438 !this.file.redirectDialogShowing)
450 var history = this.file.isRevisionHistorySupported();
464 …(this.file.isEditable() ? '' : '<div class="geStatusAlert">' + mxUtils.htmlEntities(mxResources.ge…
510 this.file.addAllSavedStatus();
535 * Installs all required listeners for syncing the current file.
557 if (!this.file.savingFile)
566 this.file.stats.joined++;
595 return this.ui.getCurrentFile() == this.file &&
596 this.file.sync == this && !this.file.invalidChecksum &&
597 !this.file.redirectDialogShowing;
613 this.file.getLatestVersion(mxUtils.bind(this, function(latestFile)
620 var current = this.file.getCurrentRevisionId();
622 // Retries if the file has not changed
629 this.file.mergeFile(latestFile, mxUtils.bind(this, function()
631 this.lastModified = this.file.getLastModifiedDate();
640 }), (retryCount + 1) * this.file.optimisticSyncDelay);
657 if (this.file.savingFile)
677 this.file.handleFileError(err);
680 return !this.file.savingFile && this.notifyThread != thread;
705 this.file.loadPatchDescriptor(mxUtils.bind(this, function(desc)
736 this.file.loadDescriptor(mxUtils.bind(this, function(desc)
741 this.file.setDescriptorRevisionId(desc, this.file.getCurrentRevisionId());
747 this.file.inConflictState = true;
748 this.file.handleFileError();
752 this.file.inConflictState = true;
753 this.file.handleFileError(err);
762 this.file.setDescriptor(desc);
763 this.file.descriptorChanged();
771 var etag = this.file.getDescriptorRevisionId(desc);
772 var current = this.file.getCurrentRevisionId();
783 var secret = this.file.getDescriptorSecret(desc);
787 this.file.stats.bytesReceived += data.length;
836 this.file.stats.cacheHits++;
841 this.file.stats.cacheFail++;
864 var etag = this.file.getDescriptorRevisionId(desc);
865 var current = this.file.getCurrentRevisionId();
869 this.file.patchDescriptor(this.file.getDescriptor(), desc);
885 var secret = this.file.getDescriptorSecret(desc);
903 if (current != this.file.getCurrentRevisionId())
932 this.file.stats.bytesReceived += req.getText().length;
938 if (current != this.file.getCurrentRevisionId())
1006 this.file.stats.cacheHits++;
1014 this.file.stats.cacheMiss++;
1020 this.file.stats.cacheFail++;
1049 this.file.updateFile(mxUtils.bind(this, function()
1051 this.lastModified = this.file.getLastModifiedDate();
1075 this.file.stats.merged++;
1077 this.file.shadowPages = (this.file.shadowPages != null) ?
1078 this.file.shadowPages : this.ui.getPagesForNode(
1079 mxUtils.parseXml(this.file.shadowData).documentElement)
1082 this.file.backupPatch = (this.file.isModified()) ?
1083 this.ui.diffPages(this.file.shadowPages,
1085 var ignored = this.file.ignorePatches(patches);
1086 var etag = this.file.getDescriptorRevisionId(desc);
1093 this.file.shadowPages = this.ui.patchPages(this.file.shadowPages, patches[i]);
1096 var current = (checksum != null) ? this.ui.getHashValueForPages(this.file.shadowPages) : null;
1101 'from', this.file.getCurrentRevisionId(), 'to', etag,
1102 'etag', this.file.getDescriptorEtag(desc),
1103 'backup', this.file.backupPatch,
1112 var from = this.ui.hashValue(this.file.getCurrentRevisionId());
1115 this.file.checksumError(error, patches, 'From: ' + from + '\nTo: ' + to +
1129 this.file.patch(patches,
1131 this.file.backupPatch : null);
1136 // var user = this.file.getCurrentUser();
1139 // EditorUi.logEvent({category: 'PATCH-SYNC-FILE-' + this.file.getHash(),
1141 // this.file.stats.bytesReceived + '-msgs-' + this.file.stats.msgReceived,
1151 this.file.invalidChecksum = false;
1152 this.file.inConflictState = false;
1153 this.file.patchDescriptor(this.file.getDescriptor(), desc);
1154 this.file.backupPatch = null;
1163 this.file.inConflictState = true;
1164 this.file.invalidChecksum = true;
1165 this.file.descriptorChanged();
1174 if (this.file.errorReportsEnabled)
1176 var from = this.ui.hashValue(this.file.getCurrentRevisionId());
1179 this.file.sendErrorReport('Error in merge',
1182 '\nPatches:\n' + this.file.compressReportData(
1187 var user = this.file.getCurrentUser();
1191 this.file.getMode() + '.' +
1192 this.file.getId(), uid, e);
1203 * Invokes when the file descriptor was changed.
1207 this.lastModified = this.file.getLastModifiedDate();
1213 var current = this.file.getCurrentRevisionId();
1219 this.file.stats.bytesSent += data.length;
1220 this.file.stats.msgSent++;
1287 * Invoked when a save request for a file was sent regardless of the response.
1303 this.lastModified = this.file.getLastModifiedDate();
1305 var secret = this.file.getDescriptorSecret(this.file.getDescriptor());
1306 var etag = this.file.getDescriptorRevisionId(lastDesc);
1307 var current = this.file.getCurrentRevisionId();
1309 var shadow = (this.file.shadowPages != null) ?
1310 this.file.shadowPages : this.ui.getPagesForNode(
1311 mxUtils.parseXml(this.file.shadowData).documentElement)
1312 var lastSecret = this.file.getDescriptorSecret(lastDesc);
1319 this.file.p2pCollab.sendMessage('diff', {
1329 * Invoked after a file was saved to add cache entry (which in turn notifies
1334 this.lastModified = this.file.getLastModifiedDate();
1338 if (!this.ui.isOffline(true) && !this.file.inConflictState && !this.file.redirectDialogShowing)
1346 var secret = this.file.getDescriptorSecret(this.file.getDescriptor());
1347 var etag = this.file.getDescriptorRevisionId(lastDesc);
1348 var current = this.file.getCurrentRevisionId();
1352 this.file.stats.msgSent++;
1369 'etag', this.file.getCurrentEtag(), 'notify');
1374 var shadow = (this.file.shadowPages != null) ?
1375 this.file.shadowPages : this.ui.getPagesForNode(
1376 mxUtils.parseXml(this.file.shadowData).documentElement)
1377 var lastSecret = this.file.getDescriptorSecret(lastDesc);
1383 this.file.stats.bytesSent += data.length;
1384 this.file.stats.msgSent++;
1423 'from', etag, 'to', current, 'etag', this.file.getCurrentEtag(),
1431 // var user = this.file.getCurrentUser();
1434 // EditorUi.logEvent({category: 'DIFF-SYNC-FILE-' + this.file.getHash(),
1436 // this.file.stats.bytesSent + '-msgs-' +
1437 // this.file.stats.msgSent, label: this.clientId});
1447 // load file if cache entry failed
1448 this.file.shadowPages = pages;
1452 * Creates the properties for the file descriptor.
1468 * Creates the properties for the file descriptor.
1476 * Creates the properties for the file descriptor.
1484 this.file.stats.conflicts++;
1497 this.file.stats.timeouts++;
1546 var user = this.file.getCurrentUser();
1558 this.file.stats.msgSent++;