Package org.nuxeo.wopi
Class WOPIServiceImpl
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.wopi.WOPIServiceImpl
- All Implemented Interfaces:
Adaptable,Component,Extensible,TimestampedService,WOPIService
- Since:
- 10.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classclass -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CheckFileInfoUpdaterprotected Stringstatic final Stringprotected WOPIServiceImpl.WOPIDiscoveryInvalidatorprotected PublicKeystatic final Stringstatic final Stringprotected PublicKeystatic final Stringprotected static final Stringstatic final Stringstatic final StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.http.impl.client.CloseableHttpClientbooleancheckDownloadBlob(DocumentModel doc, String xpath, Blob blob) Checks whether the download of the blob is allowed.protected voidconfigureProxy(org.apache.http.impl.client.HttpClientBuilder builder) protected byte[]protected voidgetActionURL(Blob blob, String action) Returns the WOPI action url given abloband anaction.protected byte[]protected StringgetExtension(Blob blob) protected KeyValueStoregetWOPIBlobInfo(Blob blob) Returns aWOPIBlobInfofor the given blob if it is supported by WOPI,nullotherwise.protected booleanbooleanReturns @{code true} if WOPI is enabled,falseotherwise.booleanisSupported(Blob blob) Returnstrueif the givenblobis supported by WOPI,falseotherwise.protected voidprotected booleanloadDiscovery(byte[] discoveryBytes) booleanRefreshes the WOPI discovery: fetches the data from the discovery URL, stores it and loads it in memory.protected voidprotected voidvoidstart(ComponentContext context) Start the component.voidstop(ComponentContext context) Stop the component.protected voidstoreDiscovery(byte[] discoveryBytes) protected voidupdateCheckFileInfoProperties(Map<String, Serializable> checkFileInfoProperties) booleanverifyProofKey(String proofKeyHeader, String oldProofKeyHeader, String url, String accessToken, String timestampHeader) Verifies that the request originate from Office Online.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
XP_CHECK_FILE_INFO_UPDATER
- See Also:
-
PLACEHOLDER_IS_LICENSED_USER
- See Also:
-
PLACEHOLDER_IS_LICENSED_USER_VALUE
- See Also:
-
WOPI_PROPERTY_NAMESPACE
- See Also:
-
SUPPORTED_APP_NAMES_PROPERTY_KEY
- See Also:
-
DOWNLOAD_REASON
- See Also:
-
WOPI_DISCOVERY_INVAL_PUBSUB_TOPIC
- See Also:
-
extensionAppNames
-
extensionActionURLs
-
proofKey
-
oldProofKey
-
discoveryURL
-
invalidator
-
checkFileInfoUpdater
-
-
Constructor Details
-
WOPIServiceImpl
public WOPIServiceImpl()
-
-
Method Details
-
start
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
stop
Description copied from interface:ComponentStop the component.- Specified by:
stopin interfaceComponent- Overrides:
stopin classDefaultComponent
-
hasDiscoveryURL
protected boolean hasDiscoveryURL() -
registerInvalidator
protected void registerInvalidator() -
unregisterInvalidator
protected void unregisterInvalidator() -
loadDiscovery
protected void loadDiscovery() -
loadDiscovery
protected boolean loadDiscovery(byte[] discoveryBytes) -
fireRefreshDiscovery
protected void fireRefreshDiscovery() -
getSupportedAppNames
-
registerApp
-
isEnabled
public boolean isEnabled()Description copied from interface:WOPIServiceReturns @{code true} if WOPI is enabled,falseotherwise.The WOPI discovery XML file has been loaded.
- Specified by:
isEnabledin interfaceWOPIService
-
getWOPIBlobInfo
Description copied from interface:WOPIServiceReturns aWOPIBlobInfofor the given blob if it is supported by WOPI,nullotherwise.- Specified by:
getWOPIBlobInfoin interfaceWOPIService
-
isSupported
Description copied from interface:WOPIServiceReturnstrueif the givenblobis supported by WOPI,falseotherwise.This method relies on checking that the blob's filename extension is supported by the WOPI discovery.
- Specified by:
isSupportedin interfaceWOPIService
-
getActionURL
Description copied from interface:WOPIServiceReturns the WOPI action url given abloband anaction.- Specified by:
getActionURLin interfaceWOPIService
-
getExtension
-
verifyProofKey
public boolean verifyProofKey(String proofKeyHeader, String oldProofKeyHeader, String url, String accessToken, String timestampHeader) Description copied from interface:WOPIServiceVerifies that the request originate from Office Online.- Specified by:
verifyProofKeyin interfaceWOPIService
-
refreshDiscovery
public boolean refreshDiscovery()Description copied from interface:WOPIServiceRefreshes the WOPI discovery: fetches the data from the discovery URL, stores it and loads it in memory.- Specified by:
refreshDiscoveryin interfaceWOPIService- Returns:
trueif refreshing the discovery has succeeded,falseotherwise
-
fetchDiscovery
protected byte[] fetchDiscovery() -
buildHttpClient
protected org.apache.http.impl.client.CloseableHttpClient buildHttpClient() -
configureProxy
protected void configureProxy(org.apache.http.impl.client.HttpClientBuilder builder) -
getDiscovery
protected byte[] getDiscovery() -
storeDiscovery
protected void storeDiscovery(byte[] discoveryBytes) -
getKeyValueStore
-
checkDownloadBlob
Description copied from interface:WOPIServiceChecks whether the download of the blob is allowed.- Specified by:
checkDownloadBlobin interfaceWOPIService- Returns:
trueif download is allowed
-
updateCheckFileInfoProperties
public Map<String,Serializable> updateCheckFileInfoProperties(Map<String, Serializable> checkFileInfoProperties) - Specified by:
updateCheckFileInfoPropertiesin interfaceWOPIService
-