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