public class RemoteEntityServiceImpl extends DefaultComponent implements RemoteEntityService
Modifier and Type | Field and Description |
---|---|
static String |
REMOTESOURCES_XP_NAME |
Constructor and Description |
---|
RemoteEntityServiceImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
canDereference(URI remoteEntity) |
boolean |
canSuggestRemoteEntity() |
void |
dereferenceInto(DocumentModel localEntity,
URI remoteEntity,
boolean override,
boolean lazyResourceFetch)
Dereference a remote entity into an existing document model.
|
void |
dereferenceIntoFromModel(DocumentModel localEntity,
URI remoteEntity,
com.hp.hpl.jena.rdf.model.Model rdfModel,
boolean override,
boolean lazyResourceFetch)
Dereference a remote entity into an existing document model from a
pre-fetched RDF description of the entity.
|
Set<String> |
getAdmissibleTypes(URI remoteEntity)
Introspect the referenced entity to suggest which Nuxeo types can be used
to dereference this entity.
|
void |
registerExtension(Extension extension)
Registers the given extension.
|
void |
removeSameAsLink(DocumentModel doc,
URI uriToRemove)
Helper API to unlink a local entity from a remote entity identified by
it's URI.
|
List<EntitySuggestion> |
suggestRemoteEntity(String keywords,
String type,
int maxSuggestions)
Perform query on registered remote entity sources to suggests entity
definitions that match the name given as keywords and the requested
entity type.
|
void |
unregisterExtension(Extension extension)
Unregisters the given extension.
|
activate, applicationStarted, deactivate, getAdapter, registerContribution, unregisterContribution
public static final String REMOTESOURCES_XP_NAME
public void registerExtension(Extension extension) throws Exception
Extensible
registerExtension
in interface Extensible
registerExtension
in class DefaultComponent
extension
- the extension to registerException
- if any error occurspublic void unregisterExtension(Extension extension) throws Exception
Extensible
unregisterExtension
in interface Extensible
unregisterExtension
in class DefaultComponent
extension
- the extension to unregisterException
- if any error occurspublic boolean canSuggestRemoteEntity()
canSuggestRemoteEntity
in interface RemoteEntitySource
public boolean canDereference(URI remoteEntity)
canDereference
in interface RemoteEntitySource
public void dereferenceInto(DocumentModel localEntity, URI remoteEntity, boolean override, boolean lazyResourceFetch) throws DereferencingException
RemoteEntitySource
override
is set to
true
.
It is the responsibility of the method caller to save the updated
document model back to the repository.dereferenceInto
in interface RemoteEntitySource
localEntity
- local document model to store a copy of the entity
attributeremoteEntity
- the URI of the entity to dereferenceoverride
- replace non-empty local fields with values from the
remote entitylazyResourceFetch
- if true, delay the fetch of the content of
referenced resources (e.g. JPEG images) to first access.DereferencingException
public void dereferenceIntoFromModel(DocumentModel localEntity, URI remoteEntity, com.hp.hpl.jena.rdf.model.Model rdfModel, boolean override, boolean lazyResourceFetch) throws DereferencingException
RemoteEntitySource
override
is set to true
.
This is typically useful for the SemanticAnalysisService that might
receive pre-fetched entity link suggestion and description from the
enhancement engines.
It is the responsibility of the method caller to save the updated
document model back to the repository.dereferenceIntoFromModel
in interface RemoteEntitySource
localEntity
- local document model to store a copy of the entity
attributeremoteEntity
- the URI of the entity to dereferenceoverride
- replace non-empty local fields with values from the
remote entitylazyResourceFetch
- if true, delay the fetch of the content of
referenced resources (e.g. JPEG images) to first access.DereferencingException
public List<EntitySuggestion> suggestRemoteEntity(String keywords, String type, int maxSuggestions) throws IOException
suggestRemoteEntity
in interface RemoteEntitySource
IOException
public Set<String> getAdmissibleTypes(URI remoteEntity) throws DereferencingException
RemoteEntitySource
getAdmissibleTypes
in interface RemoteEntitySource
remoteEntity
- the URI of the entity to dereferenceDereferencingException
public void removeSameAsLink(DocumentModel doc, URI uriToRemove) throws ClientException
RemoteEntityService
removeSameAsLink
in interface RemoteEntityService
ClientException
Copyright © 2011 Nuxeo SA. All Rights Reserved.