public class PythonUtils extends Object
| Constructor and Description |
|---|
PythonUtils(JsonSimpleConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Map<String,List<String>> index,
String field,
String value)
Add the provided key/value pair into the index.
|
String |
basicDisplayType(String mimeType)
A basic method for selecting common display templates from a given MIME
type.
|
AccessControlSchema |
getAccessSchema(String plugin)
Return an empty access control schema from the given plugin
|
String |
getDisplayMimeType(String[] indexerFormats,
DigitalObject object,
String preview)
Find the MIME type to use at display time, giving first priority to the
preview payload, then to the source payload.
|
JsonSimple |
getJsonObject(InputStream in)
Parse a JSON object from an inputstream
|
org.ontoware.rdf2go.model.Model |
getRdfModel(InputStream rdfIn)
Parse RDF data from an inputstream
|
org.ontoware.rdf2go.model.Model |
getRdfModel(Payload payload)
Parse RDF data stored in a payload
|
InputStream |
getResource(String path)
Get a resource from one of the compiled classes on the classpath
|
List<String> |
getRolesWithAccess(String recordId)
Find the list of roles with access to the given object
|
List<String> |
getRolesWithAccess(String recordId,
String plugin)
Find the list of roles with access to the given object, but only looking
at a single plugin.
|
List<String> |
getUsersWithAccess(String recordId)
Find the list of users with access to the given object
|
List<String> |
getUsersWithAccess(String recordId,
String plugin)
Find the list of users with access to the given object, but only looking
at a single plugin.
|
org.dom4j.Document |
getXmlDocument(InputStream xmlIn)
Parse an XML document from an inputstream
|
org.dom4j.Document |
getXmlDocument(Payload payload)
Parse an XML document stored in a payload
|
org.dom4j.Document |
getXmlDocument(String xmlData)
Parse an XML document from a string
|
void |
registerNamespace(String prefix,
String uri)
Register a namespace for our XML parser
|
void |
removeAccessSchema(AccessControlSchema schema,
String plugin)
Remove an access control schema from a security plugin
|
boolean |
sendMessage(String messageQueue,
String message)
Send a message to the given message queue
|
void |
setAccessSchema(AccessControlSchema schema,
String plugin)
Submit a new access control schema to a security plugin
|
void |
shutdown()
Try to closing any objects that require closure
|
String |
solrDocument(Map<String,List<String>> fields)
Generate a Solr document from a map of provided key/value pairs.
|
String |
solrField(String field,
String value)
Generate an XML snippet representing a key/value pair in a Solr doc.
|
void |
unregisterNamespace(String prefix)
UN-register a namespace for our XML parser
|
public PythonUtils(JsonSimpleConfig config) throws PluginException
PluginExceptionpublic void shutdown()
public boolean sendMessage(String messageQueue, String message)
messageQueue - to connect tomessage - to sendpublic InputStream getResource(String path)
path - To the requested resourcepublic org.dom4j.Document getXmlDocument(Payload payload)
payload - holding the documentpublic org.dom4j.Document getXmlDocument(String xmlData)
xmlData - to parsepublic org.dom4j.Document getXmlDocument(InputStream xmlIn)
xmlIn, - the inputstream to read and parsepublic void registerNamespace(String prefix, String uri)
prefix - of the namespaceuri - of the namespacepublic void unregisterNamespace(String prefix)
prefix - of the namespacepublic JsonSimple getJsonObject(InputStream in)
in, - the inputstream to read and parsepublic org.ontoware.rdf2go.model.Model getRdfModel(Payload payload)
payload - containing the datapublic org.ontoware.rdf2go.model.Model getRdfModel(InputStream rdfIn)
rdfIn, - the inputstream to read and parsepublic AccessControlSchema getAccessSchema(String plugin)
plugin - to request the schema frompublic void setAccessSchema(AccessControlSchema schema, String plugin)
schema - to submitplugin - to submit topublic void removeAccessSchema(AccessControlSchema schema, String plugin)
schema - to removeplugin - to remove topublic List<String> getRolesWithAccess(String recordId)
recordId - the object to querypublic List<String> getRolesWithAccess(String recordId, String plugin)
recordId - the object to queryplugin - the plugin we are interested inpublic List<String> getUsersWithAccess(String recordId)
recordId - the object to querypublic List<String> getUsersWithAccess(String recordId, String plugin)
recordId - the object to queryplugin - the plugin we are interested inpublic String getDisplayMimeType(String[] indexerFormats, DigitalObject object, String preview)
indexerFormats - The list of types so far allocated by the rules
script.object - The object being indexed.preview - The preview payloadpublic String basicDisplayType(String mimeType)
preview - The MIME type.public void add(Map<String,List<String>> index, String field, String value)
index - : Data structure to add data intofield - : The field namevalue - : The value to storepublic String solrDocument(Map<String,List<String>> fields)
fields - : The lists of evaluated fields for the documentCopyright © 2009-2013. All Rights Reserved.