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:wopiis 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 Modifier and Type Field Description static StringAPP_NAME_FIELDstatic StringNAME-
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
Constructors Constructor Description WOPIJsonEnricher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetXPath(Property property)voidwrite(com.fasterxml.jackson.core.JsonGenerator jg, BlobProperty blobProperty)When implementing this method, the providedJsonGeneratorexpect you write a field name and a field value (or many).protected voidwriteWOPIBlobInfo(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 Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
APP_NAME_FIELD
public static final String APP_NAME_FIELD
- See Also:
- Constant Field Values
-
-
Method Detail
-
write
public void write(com.fasterxml.jackson.core.JsonGenerator jg, BlobProperty blobProperty) throws IOExceptionDescription copied from class:AbstractJsonEnricherWhen implementing this method, the providedJsonGeneratorexpect you write a field name and a field value (or many).- Specified by:
writein classAbstractJsonEnricher<BlobProperty>- Parameters:
jg- TheJsonGeneratorto 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
-
-