Database Reference
In-Depth Information
cannot run in embedded mode without a log4j .jar file in the class path. We need to find
one and copy it to the utility library. There should be one or more in the oracle EPm
directory structure (perhaps in 'common/loggers'). If there is more than one, take the
one with the highest version number.
(8) Test a JAPI program —run the following script to prove that everything is
working.
import com.essbase.api.session.IEssbase
essHome = IEssbase.Home.create(IEssbase.JAPI_VERSION)
println 'JAPI found.'
essSvr = essHome.signOn(' user ', ' pass ', false, null, 'embedded',
' ess_server ')
println 'Embedded mode enabled.'
essSvr.disconnect(); essHome.signOff();
println 'Congratulations, you are ready to start getting Groovy
with Essbase!'
(9) (Optional) Explore IDE integration —While it is not necessary to code groovy in
an IDE, they can offer significant advantages such as code completion and syntax high-
lighting. however, it may be best to concentrate on learning the language first, creating
files with a familiar editor. once a developer is comfortable with that technique, it may
then be time to move on to an IDE.
There are two prominent IDEs with strong groovy support: Eclipse and IntelliJ IDEA.
Eclipse's support is provided through an installable plug-in, and IDEA's is included in
the product installation. I will not pick a side here. They are both fine IDEs.
9.5.14 Setting Up and Tearing Down Essbase Objects
The code in this chapter takes a pretty quick-and-dirty approach to creating and dis-
posing of objects from the Essbase JAPI. This is a necessary approach to get as much
information onto the page as possible. In production code, it will be better to be a little
more disciplined and careful with our objects. We want to make sure we are not leav-
ing open connections and locked resources on the Essbase server. The previous chapter
demonstrates using try/catch/finally blocks to ensure this. The table 9.1 illustrates com-
mon ways of creating several of the most common JAPI objects and the code that should
be run to clean them up.
9.6 wrapping it up
no harried developer is going to drop everything and start learning a new language
or technology because a book says they should. There had better be a good reason. We
feel there are many excellent reasons to adopt groovy as an automation tool for Essbase
environments. Because there is so little startup work, it can be approached incremen-
tally. Developers can learn bit by bit, accomplishing new and robust automation tasks
each step along the way. Small scripts can be added as new steps to existing batches, or
groovy can become the muscle and bone of the entire automation solution. Because it
integrates so tightly with Java and eases interactions with the Essbase Java API so much,
we do not need to shy away from JAPI programming. Instead, we can write ever more
elegant, powerful, and efficient scripts that make our automations sing. We can call the
tune and have Essbase dance to it.
Search WWH ::




Custom Search