Class OlapChart

java.lang.Object
fr.becpg.repo.olap.data.OlapChart

public class OlapChart extends Object
Store Chart infos
Version:
$Id: $Id
Author:
"Matthieu Laborie"
  • Field Details

    • nodeRef

      private org.alfresco.service.cmr.repository.NodeRef nodeRef
    • fileName

      private String fileName
    • olapQueryId

      private String olapQueryId
    • queryName

      private String queryName
    • queryId

      private String queryId
    • mdx

      private String mdx
    • cube

      private String cube
    • type

      private String type
    • xml

      private String xml
    • SAIKU_EXTENSION

      public static final String SAIKU_EXTENSION
      Extension of a saved OLAP query document.
      See Also:
    • logger

      private static final org.apache.commons.logging.Log logger
  • Constructor Details

    • OlapChart

      public OlapChart(org.alfresco.service.cmr.model.FileInfo fileInfo)

      Constructor for OlapChart.

      Parameters:
      fileInfo - a FileInfo object.
    • OlapChart

      public OlapChart(String queryName)

      Constructor for OlapChart.

      Parameters:
      queryName - a String object.
  • Method Details

    • readFileName

      private String readFileName(org.alfresco.service.cmr.model.FileInfo fileInfo)
      Reads the identity of a stored chart.

      #24931: a resource shipped by beCPG is identified by bcpg:olapQueryId, which no translation touches, while its name carries the label the user reads. A query the user saved from Saiku has no such id, so its name remains its identity, as it was before.

      Parameters:
      fileInfo - the stored document
      Returns:
      the name every reference resolves on, extension included
    • readQueryName

      private static String readQueryName(org.alfresco.service.cmr.model.FileInfo fileInfo)
      Reads the display label of a stored chart, in the locale of the caller.

      The label falls back to the name without its extension. Strip it from the end only: a plain replace turns "Sales.saikudash" into "Salesdash", which is neither a usable label nor a name any caller can map back to the stored file.

      Parameters:
      fileInfo - the stored document
      Returns:
      the label to display
    • stripExtension

      private static String stripExtension(String name)
    • extensionOf

      private static String extensionOf(String name)
    • getFileName

      public String getFileName()

      Getter for the field fileName.

      Returns:
      the stored file name, extension included
    • getQueryName

      public String getQueryName()

      Getter for the field queryName.

      Returns:
      a String object.
    • getQueryId

      public String getQueryId()
      Returns the identity callers address this chart by: the technical id when beCPG ships the resource, the id its content declares otherwise.

      Every caller must go through this getter rather than the field, the dashlet preference and getOlapChart being matched on what it returns.

      Returns:
      a String object.
    • getMdx

      public String getMdx()

      Getter for the field mdx.

      Returns:
      a String object.
    • getCube

      public String getCube()

      Getter for the field cube.

      Returns:
      a String object.
    • getType

      public String getType()

      Getter for the field type.

      Returns:
      a String object.
    • getXml

      public String getXml()

      Getter for the field xml.

      Returns:
      a String object.
    • getNodeRef

      public org.alfresco.service.cmr.repository.NodeRef getNodeRef()

      Getter for the field nodeRef.

      Returns:
      a NodeRef object.
    • load

      Parse Xml response
      Parameters:
      xml - a String object.
      Throws:
      MalformedURLException - if any.
      SAXException - if any.
      IOException - if any.
      ParserConfigurationException - if any.
      FactoryConfigurationError - if any.
      TransformerException - if any.
      org.json.JSONException - if any.
    • isJsonQuery

      private static boolean isJsonQuery(String content)
    • loadFromJson

      private void loadFromJson(String json) throws org.json.JSONException
      Reads the few attributes this class exposes from a Saiku 4.8 query document.
      Parameters:
      json - the query as stored by the 4.8 workspace
      Throws:
      org.json.JSONException - if the document is not readable
    • toJSONObject

      public org.json.JSONObject toJSONObject() throws org.json.JSONException

      toJSONObject.

      Returns:
      a JSONObject object.
      Throws:
      org.json.JSONException - if any.
    • setQueryId

      public void setQueryId(String queryId)

      Setter for the field queryId.

      Parameters:
      queryId - a String object.