Package org.nuxeo.wopi
Class WOPIJsonEnricher
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<Enriched<EntityType>>
org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher<BlobProperty>
org.nuxeo.wopi.WOPIJsonEnricher
- All Implemented Interfaces:
Marshaller<Enriched<BlobProperty>>
,Writer<Enriched<BlobProperty>>
@Setup(mode=SINGLETON,
priority=2000)
public class WOPIJsonEnricher
extends AbstractJsonEnricher<BlobProperty>
Gets the WOPI action URLs available for each blob of the document.
Enabled when parameter enrichers.blob:wopi
is present.
Blob format is:
{
"entity-type":"document",
"properties": {
"file:content": {
"name": "...",
"mime-type": "...",
...,
"wopi": {
"appName": "Word",
"view": "http://localhost:8080/nuxeo/wopi/view/REPOSITORY/DOC_ID/file:content",
"edit": "http://localhost:8080/nuxeo/wopi/edit/REPOSITORY/DOC_ID/file:content"
}
},
"other:xpath": {
"name": "...",
"mime-type": "...",
...,
"wopi": {
"appName": "Excel",
"view": "http://localhost:8080/nuxeo/wopi/view/REPOSITORY/DOC_ID/other:xpath",
"edit": "http://localhost:8080/nuxeo/wopi/edit/REPOSITORY/DOC_ID/other:xpath"
}
}
}
}
- Since:
- 10.3
-
Field Summary
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher
ENTITY_ENRICHER_NAME, MAPPER
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
void
write
(com.fasterxml.jackson.core.JsonGenerator jg, BlobProperty blobProperty) When implementing this method, the providedJsonGenerator
expect you write a field name and a field value (or many).protected void
writeWOPIBlobInfo
(com.fasterxml.jackson.core.JsonGenerator jg, WOPIBlobInfo info, DocumentModel doc, String xpath) Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.enrichers.AbstractJsonEnricher
accept, safeReadBuffer, write
Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
-
Field Details
-
NAME
- See Also:
-
APP_NAME_FIELD
- See Also:
-
-
Constructor Details
-
WOPIJsonEnricher
public WOPIJsonEnricher()
-
-
Method Details
-
write
public void write(com.fasterxml.jackson.core.JsonGenerator jg, BlobProperty blobProperty) throws IOException Description copied from class:AbstractJsonEnricher
When implementing this method, the providedJsonGenerator
expect you write a field name and a field value (or many).- Specified by:
write
in classAbstractJsonEnricher<BlobProperty>
- Parameters:
jg
- TheJsonGenerator
to use.blobProperty
- The enriched entity.- Throws:
IOException
-
writeWOPIBlobInfo
protected void writeWOPIBlobInfo(com.fasterxml.jackson.core.JsonGenerator jg, WOPIBlobInfo info, DocumentModel doc, String xpath) throws IOException - Throws:
IOException
-
getXPath
-