Skip to content

Commit 8b12536

Browse files
committed
Moving by default to CollaboraOnline.
1 parent 920c561 commit 8b12536

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

wopi/wopi-configuration/src/main/config/properties/org/silverpeas/wbe/wopi/wopiSettings.properties

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,47 +25,47 @@
2525
# Permits to enable or not the WOPI exchanges.
2626
wopi.enabled = false
2727

28-
# Permits to enable the lock feature on WOPI exchanges (not necessary with LibreOffice Online).
29-
# For LibreOffice by default
28+
# Permits to enable the lock feature on WOPI exchanges (not necessary with CollaboraOffice Online).
29+
# For CollaboraOffice by default
3030
wopi.lock.enabled = false
3131

3232
# Timestamp verification can be done on put file operation. The request header containing the
3333
# timestamp to verify MUST be specified to enable the check.
34-
# For LibreOffice by default
35-
wopi.putFile.timestamp.field = X-LOOL-WOPI-Timestamp
34+
# For CollaboraOffice by default
35+
wopi.putFile.timestamp.field = X-COOL-WOPI-Timestamp
3636

3737
# When timestamp verification is enabled, in case of conflict, a json response is required.
3838
# This parameter MUST contains the entirely JSON response needed by the WOPI client.
39-
# For LibreOffice by default
40-
wopi.putFile.timestamp.conflict.json.response = {"LOOLStatusCode":1010}
39+
# For CollaboraOffice by default
40+
wopi.putFile.timestamp.conflict.json.response = {"COOLStatusCode":1010}
4141

4242
# This field name is looked into request headers in order to get an information about a close
4343
# of an editor on a particular file.
44-
# For LibreOffice by default
45-
wopi.client.exit.field=X-LOOL-WOPI-IsExitSave
44+
# For CollaboraOffice by default
45+
wopi.client.exit.field=X-COOL-WOPI-IsExitSave
4646

4747
# The base URL of the WOPI host. If empty, the WOPI host is the Silverpeas's server itself.
4848
# So no need to specify this parameter in most of cases
4949
wopi.host.service.baseUrl =
5050

51-
# The base URL of the WOPI client (LibreOffice Online for example)
51+
# The base URL of the WOPI client (CollaboraOffice Online for example)
5252
wopi.client.baseUrl =
5353

5454
# The path to discover the capabilities of client.
55-
# For LibreOffice by default
55+
# For CollaboraOffice by default
5656
wopi.client.discovery.path = /hosting/discovery
5757

5858
# The time to live in hours of the discovery cache
5959
wopi.client.discovery.timeToLive = 12
6060

6161
# The path to access WOPI client administration.
62-
# For LibreOffice by default
63-
wopi.client.admin.path = /loleaflet/dist/admin/admin.html
62+
# For CollaboraOffice (Collabora Indeed) by default
63+
wopi.client.admin.path = /browser/dist/admin/admin.html
6464

6565
# Some parts of the user interface can be hidden or shown based or what the integration needs.
6666
# The UI defaults MUST be set on iframe loading.
6767
# In Silverpeas's system, it is done by a hidden input.
68-
# See https://github.com/LibreOffice/online/blob/master/wsd/reference.md#user-interface-modifications
68+
# See https://github.com/CollaboraOnline/online/blob/master/wsd/reference.md#user-interface-modifications
6969
wopi.ui.defaults =
7070

7171
# The name of the hidden input in charge of UI defaults

wopi/wopi-war/src/main/java/org/silverpeas/wbe/wopi/WopiFileResource.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public Response sendFileData() {
106106
.put("Size", file.size())
107107
.put("UserId", user.getId())
108108
.put("Version", file.version())
109-
.put(LAST_MODIFIED_TIME_FIELD, toIso8601(file.lastModificationDate(), true))
109+
.put(LAST_MODIFIED_TIME_FIELD, formatLastModifiedTime(file))
110110
// Host capabilities
111111
.put("SupportsContainers", false)
112112
.put("SupportsDeleteFile", false)
@@ -231,11 +231,25 @@ public Response receiveFileContentData() {
231231
.filter(f -> getBooleanValue(request.getHeader(f)))
232232
.ifPresent(f -> getHostManager().revokeFile(file));
233233
final String json = JSONCodec.encodeObject(
234-
o -> o.put(LAST_MODIFIED_TIME_FIELD, toIso8601(file.lastModificationDate(), true)));
234+
o -> o.put(LAST_MODIFIED_TIME_FIELD, formatLastModifiedTime(file)));
235235
return Response.ok().type(MediaType.APPLICATION_JSON).entity(json).build();
236236
});
237237
}
238238

239+
/**
240+
* Formats for 'LastModifiedTime' field which MUST contains the ISO8601 round-trip time format
241+
* indicating the new/updated file's modified time in storage after successful save.
242+
* <p>
243+
* WARNING six digits of nano part MUST exists event if there is no nano data.
244+
* </p>
245+
* @param file a {@link WbeFile} instance (which is indeed into the WOPI context a
246+
* {@link WbeFileWrapper} instance).
247+
* @return an ISO8601 formatted string.
248+
*/
249+
private String formatLastModifiedTime(final WbeFile file) {
250+
return toIso8601(file.lastModificationDate(), true).replace("Z", ".000000Z");
251+
}
252+
239253
@Override
240254
protected WbeFileWrapper wrapWbeFile(final WbeFile file) {
241255
return new org.silverpeas.wbe.wopi.WopiFileWrapper(file);

0 commit comments

Comments
 (0)