it.eng.spagobi.tools.scheduler
Class Formula

java.lang.Object
  extended by it.eng.spagobi.tools.scheduler.Formula

public class Formula
extends java.lang.Object


Constructor Summary
Formula(it.eng.spago.base.SourceBean configuration)
           
 
Method Summary
 java.lang.String execute()
          Executes the formula (i.e.
static java.util.List<Formula> getAvailableFormulas()
          Returns a List with all the available formulas: they are configured in WEB-INF/conf/tools/scheduler/formulas.xml.
 java.lang.String getDescription()
           
static Formula getFormula(java.lang.String fName)
          Returns the formula corresponding to the specified name.
 java.lang.String getGroovyCode()
           
 java.lang.String getName()
           
 void setDescription(java.lang.String description)
           
 void setGrovyCode(java.lang.String groovyCode)
           
 void setName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Formula

public Formula(it.eng.spago.base.SourceBean configuration)
        throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getGroovyCode

public java.lang.String getGroovyCode()

setGrovyCode

public void setGrovyCode(java.lang.String groovyCode)

execute

public java.lang.String execute()
                         throws java.lang.Exception
Executes the formula (i.e. executes the Groovy script)

Returns:
the result as a String
Throws:
java.lang.Exception - if the groovy code is null or if the execution of the code generates an Excpetion

getAvailableFormulas

public static java.util.List<Formula> getAvailableFormulas()
Returns a List with all the available formulas: they are configured in WEB-INF/conf/tools/scheduler/formulas.xml. In case no formulas are found, an empty ArrayList is returned.

Returns:
the List of configured formulas.

getFormula

public static Formula getFormula(java.lang.String fName)
Returns the formula corresponding to the specified name. If this formula does not exists, null is returned.

Parameters:
fName - the name of the formula
Returns:
the formula corresponding to the specified name.