|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.nuxeo.ecm.platform.filemanager.core.listener.MimetypeIconUpdater
public class MimetypeIconUpdater
Listener responsible for computing the mimetype of a new or edited blob and the common:icon field if necessary.
The common:size is also maintained as the length of the main blob to preserve backward compatibility.
The logic of this event listener is divided into static public methods to make it easy to override this event listener with a custom implementation.
Field Summary | |
---|---|
BlobsExtractor |
blobExtractor
|
static java.lang.String |
ICON_FIELD
|
static java.lang.String |
ICON_SCHEMA
|
static java.lang.String |
MAIN_BLOB_FIELD
|
static java.lang.String |
MAIN_EXTERNAL_FILENAME_FIELD
Deprecated. |
Constructor Summary | |
---|---|
MimetypeIconUpdater()
|
Method Summary | |
---|---|
MimetypeRegistry |
getMimetypeRegistry()
|
void |
handleEvent(Event event)
Handle the given event. |
void |
recursivelyUpdateBlobs(DocumentModel doc,
MimetypeRegistry mimetypeService,
java.util.Iterator<Property> dirtyChildren)
Deprecated. now we use BlobsExtractor that cache path fields. |
void |
setDefaultIcon(DocumentModel doc)
If the icon field is empty, initialize it to the document type icon |
void |
updateBlobProperty(DocumentModel doc,
MimetypeRegistry mimetypeService,
Property dirtyProperty)
Update the mimetype of a blob along with the icon and size fields of the document if the blob is the main blob of the document. |
void |
updateFilename(DocumentModel doc)
Backward compatibility for external filename field: if edited, it might affect the main blob mimetype |
void |
updateIconField(MimetypeEntry mimetypeEntry,
DocumentModel doc)
Compute the main icon of a Nuxeo document based on the mimetype of the main attached blob with of fallback on the document type generic icon. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ICON_SCHEMA
public static final java.lang.String ICON_FIELD
public static final java.lang.String MAIN_BLOB_FIELD
@Deprecated public static final java.lang.String MAIN_EXTERNAL_FILENAME_FIELD
public final BlobsExtractor blobExtractor
Constructor Detail |
---|
public MimetypeIconUpdater()
Method Detail |
---|
public MimetypeRegistry getMimetypeRegistry() throws java.lang.Exception
java.lang.Exception
public void handleEvent(Event event) throws ClientException
EventListener
Event.cancel()
handleEvent
in interface EventListener
event
- the event
ClientException
@Deprecated public void recursivelyUpdateBlobs(DocumentModel doc, MimetypeRegistry mimetypeService, java.util.Iterator<Property> dirtyChildren) throws java.lang.Exception
BlobsExtractor
that cache path fields.
java.lang.Exception
public void updateBlobProperty(DocumentModel doc, MimetypeRegistry mimetypeService, Property dirtyProperty) throws java.lang.Exception
java.lang.Exception
public void updateFilename(DocumentModel doc) throws PropertyException
PropertyException
public void setDefaultIcon(DocumentModel doc) throws java.lang.Exception
java.lang.Exception
public void updateIconField(MimetypeEntry mimetypeEntry, DocumentModel doc) throws java.lang.Exception
java.lang.Exception
|
Nuxeo Enterprise Platform 5.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |