Class OlapChart
- Version:
- $Id: $Id
- Author:
- "Matthieu Laborie"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate Stringprivate static final org.apache.commons.logging.Logprivate Stringprivate org.alfresco.service.cmr.repository.NodeRefprivate Stringprivate Stringprivate Stringstatic final StringExtension of a saved OLAP query document.private Stringprivate String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringextensionOf(String name) getCube()Getter for the fieldcube.Getter for the fieldfileName.getMdx()Getter for the fieldmdx.org.alfresco.service.cmr.repository.NodeRefGetter for the fieldnodeRef.Returns the identity callers address this chart by: the technical id when beCPG ships the resource, the id its content declares otherwise.Getter for the fieldqueryName.getType()Getter for the fieldtype.getXml()Getter for the fieldxml.private static booleanisJsonQuery(String content) voidParse Xml responseprivate voidloadFromJson(String json) Reads the few attributes this class exposes from a Saiku 4.8 query document.private StringreadFileName(org.alfresco.service.cmr.model.FileInfo fileInfo) Reads the identity of a stored chart.private static StringreadQueryName(org.alfresco.service.cmr.model.FileInfo fileInfo) Reads the display label of a stored chart, in the locale of the caller.voidsetQueryId(String queryId) Setter for the fieldqueryId.private static StringstripExtension(String name) org.json.JSONObjecttoJSONObject.
-
Field Details
-
nodeRef
private org.alfresco.service.cmr.repository.NodeRef nodeRef -
fileName
-
olapQueryId
-
queryName
-
queryId
-
mdx
-
cube
-
type
-
xml
-
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- aFileInfoobject.
-
OlapChart
Constructor for OlapChart.
- Parameters:
queryName- aStringobject.
-
-
Method Details
-
readFileName
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
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
-
extensionOf
-
getFileName
Getter for the field
fileName.- Returns:
- the stored file name, extension included
-
getQueryName
Getter for the field
queryName.- Returns:
- a
Stringobject.
-
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
getOlapChartbeing matched on what it returns.- Returns:
- a
Stringobject.
-
getMdx
Getter for the field
mdx.- Returns:
- a
Stringobject.
-
getCube
Getter for the field
cube.- Returns:
- a
Stringobject.
-
getType
Getter for the field
type.- Returns:
- a
Stringobject.
-
getXml
Getter for the field
xml.- Returns:
- a
Stringobject.
-
getNodeRef
public org.alfresco.service.cmr.repository.NodeRef getNodeRef()Getter for the field
nodeRef.- Returns:
- a
NodeRefobject.
-
load
public void load(String xml) throws MalformedURLException, SAXException, IOException, ParserConfigurationException, FactoryConfigurationError, TransformerException, org.json.JSONException Parse Xml response- Parameters:
xml- aStringobject.- 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
-
loadFromJson
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.JSONExceptiontoJSONObject.
- Returns:
- a
JSONObjectobject. - Throws:
org.json.JSONException- if any.
-
setQueryId
Setter for the field
queryId.- Parameters:
queryId- aStringobject.
-