@Setup(mode=SINGLETON, priority=2000) public class WOPIJsonEnricher extends AbstractJsonEnricher<BlobProperty>
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"
}
}
}
}
Modifier and Type | Field and Description |
---|---|
static String |
APP_NAME_FIELD |
static String |
NAME |
ENTITY_ENRICHER_NAME
ctx, registry
Constructor and Description |
---|
WOPIJsonEnricher() |
Modifier and Type | Method and Description |
---|---|
protected String |
getXPath(Property property) |
void |
write(com.fasterxml.jackson.core.JsonGenerator jg,
BlobProperty blobProperty)
When implementing this method, the provided
JsonGenerator 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) |
accept, write
getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
public static final String NAME
public static final String APP_NAME_FIELD
public WOPIJsonEnricher()
public void write(com.fasterxml.jackson.core.JsonGenerator jg, BlobProperty blobProperty) throws IOException
AbstractJsonEnricher
JsonGenerator
expect you write a field name and a field value
(or many).write
in class AbstractJsonEnricher<BlobProperty>
jg
- The JsonGenerator
to use.blobProperty
- The enriched entity.IOException
protected void writeWOPIBlobInfo(com.fasterxml.jackson.core.JsonGenerator jg, WOPIBlobInfo info, DocumentModel doc, String xpath) throws IOException
IOException
Copyright © 2019 Nuxeo. All rights reserved.