Class TalisStore

java.lang.Object
  extended by TalisStore
All Implemented Interfaces:
groovy.lang.GroovyObject

public class TalisStore
extends Object
implements groovy.lang.GroovyObject

TalisStore is a Groovy utility class which wraps TalisStoreLoader and uploads RDF files to the Talis Platform. See Using Groovy to Upload RDF files to the Talis Platform for details on using this script and also on using the config file TalisConfig.groovy to set the store, user and password.

Author:
Richard Hancock

Constructor Summary
TalisStore()
           
 
Method Summary
 groovy.lang.MetaClass getMetaClass()
           
 Object getProperty(String name)
           
 Object invokeMethod(String name, Object args)
           
static Object list()
          Lists the RDF files in the current directory.
static int load()
          Loads the RDF files in the current directory.
static int load(String fileOrDirectory)
          Loads either a specific RDF file or scans the nominated directory and uploads all the RDF files found.
static int load(String store, String user, String password)
          Loads the RDF files in the current directory.
static int load(String store, String user, String password, String fileOrDirectory)
          Loads RDF files by explicitly setting the store, user and password and nominating either a specific RDF file to upload or a directory to scan and upload all the RDF files found.
static Object main(Object args)
          Depending on the parameters passed, loads either a specific RDF file or scans the current or nominated directory and uploads all the RDF files found.
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setProperty(String name, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TalisStore

public TalisStore()
Method Detail

list

public static Object list()
Lists the RDF files in the current directory. Reads the store, user and password from the config file TalisConfig.groovy which is expected to be on the classpath.

See Also:
TalisStoreLoader.listDirectory(java.lang.String)

load

public static int load()
Loads the RDF files in the current directory. Reads the store, user and password from the config file TalisConfig.groovy which is expected to be on the classpath. See Using Groovy to Upload RDF files to the Talis Platform for details on using the config file TalisConfig.groovy to set the store, user and password and making the config file available on the classpath.

Returns:
number of RDF files uploaded to the Talis store
See Also:
TalisStoreLoader.loadDirectory()

load

public static int load(String fileOrDirectory)
Loads either a specific RDF file or scans the nominated directory and uploads all the RDF files found. Reads the store, user and password from the config file TalisConfig.groovy which is expected to be on the classpath. See Using Groovy to Upload RDF files to the Talis Platform for details on using the config file TalisConfig.groovy to set the store, user and password and making the config file available on the classpath.

Parameters:
fileOrDirectory - Path to either a specific RDF file or a directory containing RDF files
Returns:
number of RDF files uploaded to the Talis store
See Also:
TalisStoreLoader.loadRdfFile(java.io.File), TalisStoreLoader.loadDirectory()

load

public static int load(String store,
                       String user,
                       String password)
Loads the RDF files in the current directory. Explicitly sets the store, user and password.

Parameters:
store - Talis store name
user - Talis store username
password - Talis store password
Returns:
number of RDF files uploaded to the Talis store
See Also:
TalisStoreLoader.loadDirectory()

load

public static int load(String store,
                       String user,
                       String password,
                       String fileOrDirectory)
Loads RDF files by explicitly setting the store, user and password and nominating either a specific RDF file to upload or a directory to scan and upload all the RDF files found.

Parameters:
store - Talis store name
user - Talis store username
password - Talis store password
fileOrDirectory - Path to either a specific RDF file or a directory containing RDF files
Returns:
number of RDF files uploaded to the Talis store
See Also:
TalisStoreLoader.loadRdfFile(java.io.File), TalisStoreLoader.loadDirectory()

main

public static Object main(Object args)
Depending on the parameters passed, loads either a specific RDF file or scans the current or nominated directory and uploads all the RDF files found. The store, user and password may be passed as parameters or read from the config file TalisConfig.groovy which is expected to be on the classpath. See Using Groovy to Upload RDF files to the Talis Platform for details on using the config file TalisConfig.groovy to set the store, user and password and making the config file available on the classpath. The four options for running the script are:
  1. Command line> TalisStore. No paramteres passed. Loads RDF files from the current directory. Reads store, user and password from config file.
  2. Command line> TalisStore fileOrDirectory. Loads RDF files from the specified directory or the nominated file. Reads store, user and password from config file.
  3. Command line> TalisStore store user password. Explicitly sets the store, user and password and loads RDF files from the current directory.
  4. Command line> TalisStore store user password fileOrDirectory. Explicitly sets the store, user and password. Loads RDF files from the specified directory or the nominated file.

Parameters:
args - as described above
See Also:
TalisStoreLoader.loadRdfFile(java.io.File), TalisStoreLoader.loadDirectory()

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject

invokeMethod

public Object invokeMethod(String name,
                           Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject

setProperty

public void setProperty(String name,
                        Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject


Copyright © 2010. All Rights Reserved.