Class EssScriptImpl

java.lang.Object
com.appliedolap.essbase.AbstractEssObject
com.appliedolap.essbase.impl.EssScriptImpl
All Implemented Interfaces:
EssObject, EssScript

public class EssScriptImpl extends AbstractEssObject implements EssScript
A calculation or MDX script on a cube.
  • Method Details

    • getName

      public String getName()
      Description copied from interface: EssObject
      Gets the name of this object. This will generally be the "nice" and "unique" name of this object, such as the application name, cube, member, variable, or whatever.
      Specified by:
      getName in interface EssObject
      Returns:
      the simple name of this object
    • getType

      public EssObject.Type getType()
      Description copied from interface: EssObject
      Gets the type of this object.
      Specified by:
      getType in interface EssObject
      Returns:
      the object type
    • getScriptType

      public EssScript.ScriptType getScriptType()
      Description copied from interface: EssScript
      Which kind of script this is.
      Specified by:
      getScriptType in interface EssScript
      Returns:
      the type, never null
    • getCube

      public EssCube getCube()
      Description copied from interface: EssScript
      The cube this script belongs to.
      Specified by:
      getCube in interface EssScript
      Returns:
      the cube
    • getModifiedTime

      public Long getModifiedTime()
      Specified by:
      getModifiedTime in interface EssScript
    • getSize

      public Long getSize()
      Specified by:
      getSize in interface EssScript
    • getContent

      public String getContent()
      Description copied from interface: EssScript
      The script's text, fetched from the server.
      Specified by:
      getContent in interface EssScript
      Returns:
      the content
    • save

      public void save(String content)
      Description copied from interface: EssScript
      Replaces the script's text on the server.
      Specified by:
      save in interface EssScript
      Parameters:
      content - the new text
    • validate

      public Optional<String> validate()
      Description copied from interface: EssScript
      Checks the script without running it.

      Worth doing before a save as well as before a run: Essbase validates against the live outline, so it catches a member name that no longer exists.

      Specified by:
      validate in interface EssScript
      Returns:
      empty when the script is valid, otherwise the server's complaint
    • delete

      public void delete()
      Specified by:
      delete in interface EssScript
    • execute

      public void execute()
      Runs the script as a job and waits.

      The two types are parameterised differently, and neither is guessable. A calculation goes in file as its bare name; putting it in script answers "Invalid file name 'CalcAll'. Does not have an extension." An MDX script goes in script as its file name with the .mdx extension; putting it in file runs and then fails inside Essbase with "NULL argument (5) passed to ESSAPI function executeMdxScript".

      Specified by:
      execute in interface EssScript