@DeclareRoles(value="org.imixs.ACCESSLEVEL.MANAGERACCESS") @RunAs(value="org.imixs.ACCESSLEVEL.MANAGERACCESS") @Path(value="/wopi") @Produces(value="application/json") public class WopiHostService extends Object
A WOPI host does not need to implement every WOPI operation. WOPI hosts express their capabilities using properties in CheckFileInfo, such as SupportsLocks. In addition, WOPI actions specify the WOPI operations that must be supported in order to use that action, in the form of Action requirements.
This service implements a minimum set of operations required in order to support the two major WOPI scenarios - viewing and editing.
The files are contained in a workflow instance (workitem) or in a snapshot ItemCollection.
The /id/ in the Rest API URLs is a combination a workitem $uniqueID followed by the filename
/wopi/xxxxxxx-0000-0000-0000-yyyy_{FILENAME}
If a snapshot exits than the API automatically loads the file content from the snapshot.
https://wopi.readthedocs.io/projects/wopirest/en/latest/,
https://sdk.collaboraonline.com/docs/installation/CODE_Docker_image.html,
https://sdk.collaboraonline.com/docs/How_to_integrate.html,
https://sdk.collaboraonline.com/docs/Step_by_step_tutorial.html| Constructor and Description |
|---|
WopiHostService() |
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response |
getFileContents(String uniqueid,
String file,
String accessToken)
Opens a file and returns the file content as an octet-stream
The method expects an id consisting of a $uniqueid followed by the filename
/wopi/xxxxxxx-0000-0000-0000-yyyy_{FILENAME}
If the file content was already modified before, the content is fetched from the
local wopi file cache |
javax.ws.rs.core.Response |
getFileInfo(String uniqueid,
String file,
String accessToken)
Returns the file details.
|
String |
ping()
GET Method just to test the service readiness
|
javax.ws.rs.core.Response |
postFileContents(String uniqueid,
String file,
InputStream contentStream,
String accessToken,
javax.ws.rs.core.UriInfo info)
This method stores a modified file content form the wopi client into the local wopi file cache.
|
@GET @Path(value="/ping") public String ping()
requestBodyStream - @GET
@Path(value="/{uniqueid : ([0-9a-f]{8}-.*|[0-9a-f]{11}-.*)}/files/{file}")
@Produces(value="application/json")
public javax.ws.rs.core.Response getFileInfo(@PathParam(value="uniqueid")
String uniqueid,
@PathParam(value="file")
String file,
@QueryParam(value="access_token")
String accessToken)
The method expects an id consisting of a $uniqueid followed by the filename
/wopi/xxxxxxx-0000-0000-0000-yyyy_{FILENAME}
name - - A string that specifies a fileresponse - - The response to a CheckFileInfo call is JSON (as specified
in RFC 4627) containing a number of properties, most of which
are optional.@GET
@Path(value="/{uniqueid : ([0-9a-f]{8}-.*|[0-9a-f]{11}-.*)}/files/{file}/contents")
public javax.ws.rs.core.Response getFileContents(@PathParam(value="uniqueid")
String uniqueid,
@PathParam(value="file")
String file,
@QueryParam(value="access_token")
String accessToken)
The method expects an id consisting of a $uniqueid followed by the filename
/wopi/xxxxxxx-0000-0000-0000-yyyy_{FILENAME}
If the file content was already modified before, the content is fetched from the local wopi file cache
name - - the file name to be opened@POST
@PUT
@Path(value="/{uniqueid : ([0-9a-f]{8}-.*|[0-9a-f]{11}-.*)}/files/{file}/contents")
public javax.ws.rs.core.Response postFileContents(@PathParam(value="uniqueid")
String uniqueid,
@PathParam(value="file")
String file,
InputStream contentStream,
@QueryParam(value="access_token")
String accessToken,
@Context
javax.ws.rs.core.UriInfo info)
The method expects a $uniqueID and filename
/wopi/xxxxxxx-0000-0000-0000-yyyy/files/{FILENAME}
The method returns a json file info object
name - content - Copyright © 2021 Imixs Software Solutions GmbH. All rights reserved.