|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.fascinator.common.PythonUtils
public class PythonUtils
The purpose of this class is to expose common Java classes and methods we use to Python scripts. Messaging is a duplicate of com.googlecode.fascinator.MessagingServices since Common library cannot acces it.
| Constructor Summary | |
|---|---|
PythonUtils(JsonSimpleConfig config)
|
|
| Method Summary | |
|---|---|
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(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,
java.lang.String plugin)
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,
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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PythonUtils(JsonSimpleConfig config)
throws PluginException
PluginException| Method Detail |
|---|
public void shutdown()
public boolean sendMessage(java.lang.String messageQueue,
java.lang.String message)
messageQueue - to connect tomessage - to send
public java.io.InputStream getResource(java.lang.String path)
path - To the requested resource
public org.dom4j.Document getXmlDocument(Payload payload)
payload - holding the document
public org.dom4j.Document getXmlDocument(java.lang.String xmlData)
xmlData - to parse
public org.dom4j.Document getXmlDocument(java.io.InputStream xmlIn)
xmlIn, - the inputstream to read and parse
public 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 parse
public org.ontoware.rdf2go.model.Model getRdfModel(Payload payload)
payload - containing the data
public org.ontoware.rdf2go.model.Model getRdfModel(java.io.InputStream rdfIn)
rdfIn, - the inputstream to read and parse
public AccessControlSchema getAccessSchema(java.lang.String plugin)
plugin - to request the schema from
public void setAccessSchema(AccessControlSchema schema,
java.lang.String plugin)
schema - to submitplugin - to submit to
public void removeAccessSchema(AccessControlSchema schema,
java.lang.String plugin)
schema - to removeplugin - to remove topublic java.util.List<java.lang.String> getRolesWithAccess(java.lang.String recordId)
recordId - the object to query
public 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 in
public java.util.List<java.lang.String> getUsersWithAccess(java.lang.String recordId)
recordId - the object to query
public 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 in
public 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 payload
public 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 document
public java.lang.String solrField(java.lang.String field,
java.lang.String value)
field - : The fieldvalue - : The value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||