public interface ILinkEmbedController
Callback interface used to determine how object should be processed during saving.
Modifier and Type | Method and Description |
---|---|
int |
getObjectStoringLocation(int id,
byte[] entityData,
java.lang.String semanticName,
java.lang.String contentType,
java.lang.String recomendedExtension)
Determines where object should be stored.
|
java.lang.String |
getUrl(int id,
int referrer)
Returns an URL to an external object.
|
void |
saveExternal(int id,
byte[] entityData)
Saves external object.
|
int getObjectStoringLocation(int id, byte[] entityData, java.lang.String semanticName, java.lang.String contentType, java.lang.String recomendedExtension)
Determines where object should be stored. This method is called once for each object id. It is not guaranteed that there won't be two objects with same data, semanticName and contentType but with different id.
id
- Object id. This id is saving operation-wide unique.entityData
- Object binary data. This parameter can be null, if object binary data is not generated yet.semanticName
- Some short text, describing meaning of object. Controller may use this as a part of external object name, but it is up to dispatcher to ensure that names will be unique and contain only allowed characters.contentType
- MIME type of object.recomendedExtension
- File name extension, recommended for this MIME type.java.lang.String getUrl(int id, int referrer)
Returns an URL to an external object.
This method always called if getObjectStoringLocation(int,byte[],String,String,String)
returned LinkEmbedDecision.Link
and may be called if getObjectStoringLocation(int,byte[],String,String,String)
returned LinkEmbedDecision.Embed
but embedding is impossible.
Can be called multiple time for same object id.
id
- Object id. This id is saving operation-wide unique.referrer
- id of referrencing object or 0, if object is referrenced by the root document. May be used to generate relative link.void saveExternal(int id, byte[] entityData)
Saves external object.
id
- Object id. This id is saving operation-wide unique.entityData
- Object binary data. This parameter cannot be null.