Resource handlers
APEX Office Edit comes with a fully configured RESTful service module handling the following document operations described in the table below.
Handler purpose | URI template | Method |
---|---|---|
Create a new document | files/create/:type | GET |
Get a document information | files/:fileid | GET |
Get a document contents | files/:fileid/contents | GET |
Update a document contents | files/:fileid/contents | POST |
Save a document as a copy with a new filename and rename a document | files/:fileid | POST |
Additionally, the RESTful service contains handlers supporting integration with an Oracle APEX application.
Handler purpose | URI template | Method |
---|---|---|
Test if RESTful service module is available | files/knockknock | GET |
Get a document meta-data | files/meta/ | GET |
Create a new document
URI Template | Method | Source Type | Format |
---|---|---|---|
files/create/:type | GET | PL/SQL | JSON |
The plug-in uses the handler to create a new document of the selected type. Whenever the end-user requests a new file to be created, the handler is executed, and the new file is created using the configuration set at the APEX page designer level.
Get a document information
URI Template | Method | Source Type | Format |
---|---|---|---|
files/:fileid | GET | PL/SQL | JSON |
The AOE host server uses the handler to fetch the document information required to load and modify a document. The handler evaluates the end-user permissions on the requested document and returns the configuration of the AOE document editor.
Defined parameters
Name | Bind Variable | Source Type | Access Method | Data Type |
---|---|---|---|---|
access_token | access_token | URI | IN | STRING |
Other bind variables used
Bind Variable | Description |
---|---|
:fileid | URI template parameter |
:status_code | Native REST bind variable to assign HTTP status code |
:content_type | Native REST bind variable to assign response content type |
Get the contents of a document
URI Template | Method | Source Type | Format |
---|---|---|---|
files/:fileid/contents | GET | PL/SQL | JSON |
The AOE host server uses the handler to fetch the document contents. After successfully downloading a document's contents, the handler executes PL/SQL callback defined for reading documents.
Defined parameters
Name | Bind Variable | Source Type | Access Method | Data Type |
---|---|---|---|---|
access_token | access_token | URI | IN | STRING |
Other bind variables used
Bind Variable | Description |
---|---|
:fileid | URI template parameter |
:status_code | Native REST bind variable to assign HTTP status code |
:content_type | Native REST bind variable to assign response content type |
Update a document's contents
URI Template | Method | Source Type | Format |
---|---|---|---|
files/:fileid/contents | POST | PL/SQL | JSON |
The AOE host server uses the REST handler to update the currently opened document contents. After successfully updating a document, the handler executes PL/SQL callback defined for updating documents.
Defined parameters
Name | Bind Variable | Source Type | Access Method | Data Type |
---|---|---|---|---|
access_token | access_token | URI | IN | STRING |
X-LOOL-WOPI-ExtendedData | data | HTTP Header | IN | STRING |
X-LOOL-WOPI-Timestamp | passed_header_timestamp | HTTP Header | IN | STRING |
X-LOOL-WOPI-IsAutosave | autosaveflag | HTTP Header | IN | STRING |
X-LOOL-WOPI-IsExitSave | is_exit_save | HTTP Header | IN | STRING |
X-LOOL-WOPI-IsModifiedByUser | ismodifiedbyuser | HTTP Header | IN | STRING |
Other bind variables used
Bind Variable | Description |
---|---|
:fileid | URI template parameter |
:status_code | Native REST bind variable to assign HTTP status code |
Save a document as a copy with a new filename and rename a document
URI Template | Method | Source Type | Format |
---|---|---|---|
files/:fileid | POST | PL/SQL | JSON |
The AOE host server uses the REST handler to create a new document based on an existing, currently opened document. After successfully updating a document, the handler executes PL/SQL callback defined for updating documents.
Defined parameters
Name | Bind Variable | Source Type | Access Method | Data Type |
---|---|---|---|---|
access_token | access_token | URI | IN | STRING |
X-WOPI-OverwriteRelativeTarget | h_should_overwrite | HTTP Header | IN | STRING |
X-WOPI-RelativeTarget | filename | HTTP Header | IN | STRING |
X-WOPI-SuggestedTarget | suggested_name | HTTP Header | IN | STRING |
X-WOPI-Override | wopi_override | HTTP Header | IN | STRING |
Other bind variables used
Bind Variable | Description |
---|---|
:fileid | URI template parameter |
:status_code | Native REST bind variable to assign HTTP status code |
:body | Native REST bind variable referencing document content |
Test if the RESTful service module is available
URI Template | Method | Source Type | Format |
---|---|---|---|
files/knockknock | GET | PL/SQL | JSON |
The plug-in uses the REST handler to check if the RESTful service is available. If it's unavailable or returns an invalid response, the plug-in shows an error.
Get a document meta-data
URI Template | Method | Source Type | Format |
---|---|---|---|
files/knockknock | GET | PL/SQL | JSON |
The plug-in uses the REST handler to fetch a document's meta-data, such as filename, version, last modification time, and document owner.
Defined parameters
Name | Bind Variable | Source Type | Access Method | Data Type |
---|---|---|---|---|
access_token | access_token | URI | IN | STRING |
Other bind variables used
Bind Variable | Description |
---|---|
:status_code | Native REST bind variable to assign HTTP status code |