Class EssPlanningSnapshot

java.lang.Object
com.appliedolap.essbase.EssPlanningSnapshot
All Implemented Interfaces:
AutoCloseable

public class EssPlanningSnapshot extends Object implements AutoCloseable
An EPM Cloud artifact snapshot, read as a source for building an Essbase cube.

The snapshot is the .zip a Planning application exports to. This finds the dimensions in it and builds them into a cube, which is as close as an Essbase server can get to the shape of the Planning application that produced it.

 EssPlanningSnapshot snapshot = EssPlanningSnapshot.open(Path.of("Artifact Snapshot.zip"));
 snapshot.getPlanTypes();                       // [Vision, Plan1]
 Report report = snapshot.importInto(cube, "Vision");
 

Best effort, and it says what it could not do. Planning outlines use member ids where Essbase uses names, allow duplicate names where a plain Essbase outline does not, and carry properties Essbase will refuse in combinations that only the server can judge. Every dimension is attempted independently and the EssPlanningSnapshot.Report says what happened to each, so one awkward dimension costs that dimension rather than the import.

Two files in the snapshot describe the outline and neither is sufficient alone. The dimension .csv files carry the names, parents and properties - the hierarchy. The batch-outline-edit .xml carries the attribute associations, which the CSVs do not, but addresses members by Planning GUID; the CSVs' UUID column is what turns those back into names. Both are read.

  • Method Details

    • open

      public static EssPlanningSnapshot open(Path snapshot) throws IOException
      Opens a snapshot.
      Parameters:
      snapshot - the artifact snapshot .zip
      Throws:
      IOException - if it cannot be read
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • getApplicationNames

      public List<String> getApplicationNames()
      The Planning applications in the snapshot.

      A snapshot holds more than the application - Shared Services, FDMEE, the document repository - and the application's own folder is the one named HP-<name>.

    • getPlanTypes

      public List<String> getPlanTypes()
      The plan types - the cubes - the snapshot describes.

      One of these is what importInto(com.appliedolap.essbase.EssCube, java.lang.String) needs, because a Planning application's dimensions are shared across its cubes and each records its own consolidation, storage and formula per member. Building for the wrong one silently produces a different outline.

    • getDimensionEntries

      public Map<String,String> getDimensionEntries(String planType)
      Every dimension file in the snapshot, by dimension name.

      Three places hold them: the application's shared standard dimensions, its shared attribute dimensions, and a cube's own standard dimensions. A cube's own wins where a name is in both.

    • readDimension

      public EssPlanningDimensionFile readDimension(String entry) throws IOException
      Reads one dimension out of the snapshot.
      Throws:
      IOException
    • preview

      public List<EssPlanningSnapshot.DimensionSummary> preview(String planType)
      What the snapshot holds for a plan type, without changing anything.

      For showing someone what they are about to import and letting them choose. Reads every dimension file, so it is a real piece of work rather than a directory listing - but it is the only way to say how many members a dimension has, which is most of what makes the choice.

      Parameters:
      planType - which cube's members to count
      Returns:
      one summary per dimension, standard dimensions first
    • importInto

      public EssPlanningSnapshot.Report importInto(EssCube cube, String planType)
      Builds every dimension in the snapshot into a cube.

      The cube must exist and should be empty; this adds to whatever is there rather than replacing it. Each dimension is created, then its members, then the storage types that could only be set once the hierarchy existed, then the attribute associations - each step independent, so a step that Essbase refuses costs that step rather than the import.

      Parameters:
      cube - where to build
      planType - which cube of the Planning application to take the properties from
      Returns:
      what happened, dimension by dimension
    • importInto

      public EssPlanningSnapshot.Report importInto(EssCube cube, String planType, Collection<String> only)
      Builds the dimensions the caller picked.
      Parameters:
      cube - where to build
      planType - which cube of the Planning application to take the properties from
      only - the dimension names to build, or null for all of them
      Returns:
      what happened, dimension by dimension