saada logo

 
  SAADA OVERVIEW
Home  
News  
Tutos and Links  
Download  
  Tutorial
Getting started  
Doing More  
SaadaQL  
The Web Interface  
VO Publishing  
Tips & Troubelshooting  
  COMMUNITY
Mailing List  
Saada Sites  
How to Contact us ?  
  DEVELOPER CORNER
Contributors  
Next Step  
Old Releases  
Inside Saada  
Using UWS  

 

SourceForge.net Logo


HOME ART > Tutorial > Doing More > Running Saada by Script
Standard Tasks

The Saada distribution comes with an Ant task file covering most of the usual actions.

These tasks can also be used as templates for implementing specific commands.




 Using the ant tasks

  • Ant task file : All the following tasks are described in SAADADB_HOME/bin/build.xml. This file must never be moved because it uses the saadadb.properties file located at the same place.
  • Ant : The ant tasks can be run by the ant utility installed on your host :
    % cd  SAADADB_HOME/bin
    % ant taskname
    
  • Saada Ant : Saada comes with an internal implementation of ant named sant which can be used either
    % cd  SAADADB_HOME/bin
    % ./sant taskname
    
  • Debug mode All tasks support the -Ddebug=on parameter which makes the processing very talkative.
  • Category : Some commands uses a -Dcategory= parameter. Allowed values are spectrum | Table | image | misc | flatfile

 Database Management

task name parameters Description
extended.attribute.add -Dname=name -Dcategory=category -Dtype=type [-Dcomment=comment] [-Ducd=ucd] [-Dutype=utype] [-Dunit=unit] [-Dpassword=password] [-Ddebug=on] Add a extended attribute to a category of data. May require the DB admin password. Types are [int long short float double boolean or string]
extended.attribute.remove -Dcategory=category -Dname=name [-Dpassword=password] [-Ddebug=on] Remove an extended attribute from a data category
extended.attribute.remove -Dname=name -Dnewname=newname -Dcategory=name [-Dcomment=comment] [-Ducd=ucd] [-Dutype=utype] [-Dunit=unit] [-Ddebug=on] Rename an extended attribute of a data category
xmode.set Set executable mode for scripts
admintool Start the administration tool
saadadb.jar.update Recompile the Saada code and run saadadb.jar.merge after
saadadb.jar.merge Merge all jar files in a big one which normally used by Saada commands. This task must be run after saadadb.jar.update
saadadb.compile.mapping Compile the code generated by the Saada data loader and pack it $SAADA_DB_NAMEgenerated.jar.

 Web Interface Management

task name parameters Description
tomcat.deploy Deploy the Web application on the Tomcat server declared at creation time. This task removes the former deployment and copies the WAR file in the webapps directory. Tomcat is meant to automatically reload the application (default behaviour).
tomcat.deploy.safe -Dusername=username -Dpassword=password Send to Tomcat a request to deploy the Web application. This way to proceed is smoother than the previous one but it requires to include the Tomcat credantials (username and password) in the command line.
tomcat.reload.safe -Dusername=username -Dpassword=password Send to Tomcat a request to reload the Web application. This task requires to include the Tomcat credantials (username and password) in the command line.
tomcat.start.safe -Dusername=username -Dpassword=password Send to Tomcat a request to start. This taskrequires to include the Tomcat credantials (username and password) in the command line.
tomcat.stop.safe -Dusername=username -Dpassword=password Send to Tomcat a request to stop. This taskrequires to include the Tomcat credantials (username and password) in the command line.

 Data Collection Management

task name parameters Description
collection.create -Dname=name -Dcomment=comment Create a new data collection
collection.remove -Dname=name Remove a data collection. All data are removed as well.
collection.empty -Dname=name Empty a data collection. All data are removed as well.
class.remove -Dname=name Remove a data class. All data are removed as well.
class.empty -Dname=name Empty a data class.All data are removed as well.
product.remove -Dremove=query [-Dnoindex=true] [-Dlinks=follow] Remove product from th DB (to be used carefully). Product are specified in by the -remove parameter which can either be a comma separated list of OIDs or a SAADAQL query.

ex : ant product.remove -Dremove=oid1,oid2,oid3 -Dnoindex=true -Dlinks=follow

ant product.remove "-Dremove=Select MISC From * In Starting WhereAttributeSaadanamesaada=’Pedro’" -Dnoindex=true -Dlinks=follow

In both case, all products to remove must belong to the same collection and to the same class.

If the -links parameter valus is "follow", all data linked with the product to removed are removed too.

If the -noindex is set to true, indexes are not rebuilt after the poduct deletion.

WARNING : This task can generate huge transactions

WARNING : If you want to empty a class or collection use the collection.emty or class.empty tasks preferably.

data.load -Dcollection=collection -Dfilename=filename -Dconfig=config -Drepository=no/move/copy -Dindex=true/false This task load data files by using a configuration created with the admin tool

 Index Management

task name parameters Description
index.collection.create -Dname=collection name -Dcategory=category Create SQL indexes for a collection. All columns of all collection tables are indexed
index.collection.remove -Dname=collection name -Dcategory=category Drop all SQL indexes for a collection.
index.table.create -Dtable=tableName Create SQL indexes for an SQL table, works for a data class either.

If tableName is a simple String, all columns the table are touched by the commmand. It tableName is like name(col1, ....) only columns liste in () are concerned

index.table.remove -Dtable=tableName Remove SQL indexes for an SQL table.

If tableName is a simple String, all columns the table are touched by the commmand. It tableName is like name(col1, ....) only columns liste in () are concerned

 Relationship Management

task name parameters Description
relation.create -Drelation=relation name -Dfrom=starting collection -Dto=ending collection -Dquery=correlator Create a relationship between 2 data collections Both starting and ending collections must be like collName_CATEGORY (e.g. MyCollection_ENTRY)

Refer to the doc for the query. It can be in SaadaQL or in SQL :

Example of SQL query :

INSERT INTO Relationname (oidprimary, oidsecondary)
     SELECT p.oidsaada, s.oidsaada
     FROM EPIC_ENTRY AS p, EPIC_FLATFILE AS s
     WHERE s.namesaada = p.namesaada
relation.empty -Dname=relation name Emty the relation given as parameter. Both join table and Saada indexes are flushed.
relation.remove -Dname=relation name Delete the relation given as parameter. Destroy both join tables and Saada indexes.
relation.populate -Dname=relation name Apply the correlator of the relationship. New links are appended to the existing ones.
relation.index -Dname=relation name Build the Saada indexes of the relation given as parameter

 TAP service management

task name parameters Description
vo.tap.remove remove the TAP service. The Obscore table is not affected by this task
vo.tap.create Create an empty TAP service.
vo.tap.obscore.create Create an empty ObsCore1.1 table
vo.tap.obscore.remove Remove the Obscore table
last update 2016-06-13