Package com.jedox.palojlib.main
Class Dimension
java.lang.Object
com.jedox.palojlib.main.CachedComponent
com.jedox.palojlib.main.Dimension
- All Implemented Interfaces:
IDimension
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jedox.palojlib.interfaces.IDimension
IDimension.DimensionType
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
static final int
protected LinkedHashMap<Integer,
Element> protected boolean
protected DimensionInfo
Fields inherited from class com.jedox.palojlib.main.CachedComponent
cacheTrustExpiry
-
Constructor Summary
ModifierConstructorDescriptionprotected
Dimension
(int contextId, int id, String name, Database database, IDimension.DimensionType type, String attributeDimensionId, String attributeCubeId, String maximumLevel, String maximumIndent, String maximumDepth, String token, String numberOfElements, String defaultRead, String defaultWrite, String defaultNA, String defaultTotal, String defaultParent) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String name, IElement.ElementType type) Create one attribute, this method does not invalidate the cache.void
addAttributes
(String[] names, IElement.ElementType[] types) Create new attributes in this dimensionvoid
addAttributeValues
(IAttribute attribute, IElement[] elements, Object[] values) Writes the attribute values for these elementsaddBaseElement
(String name, IElement.ElementType type) Create one element, this method does not invalidate the cache.void
addConsolidations
(IConsolidation[] consolidations) add the consolidations for the elements mentioned as parents in the consolidations set, the children will be added to the existing children list.void
addElements
(String[] names, IElement.ElementType[] types) Create a list of elementsvoid
appendElements
(IElement[] elements) Add new elements with the given type or simply change type of existing elementsprotected void
protected boolean
protected boolean
void
createVirtualDimension
(IAttribute attribute) Creates a virtual dimension specified by a dimension attribute.IElement[]
evaluateGlobalSubset
(String subsetname, IVariable[] subsetVariables) evaluate the given subset with the set of variablesprotected Attribute
getAttributeById
(int id) getAttributeByName
(String name) Get an attribute using its namegetAttributeByName
(String name, String language) get the attribute cube if existsprotected int
Get a list of attributes for this dimensionIElement[]
Get the list of the bases elements in the dimensionprotected int
protected Database
get the element set as default N/A for the dimensionget the element set as default parent for the dimensionget the element set as default read for the dimensionget the element set as default total for the dimensionget the element set as default write for the dimensionGet the dimension info objectIDimensionInfo
getElement
(String elementName, boolean withPermission) Get the a single element in the dimension, the dimension elements will not be read in this caseprotected Element
getElementById
(int id) getElementByName
(String name) Get an element using its nameIElement[]
Get the list of elements in the dimensionIElement[]
getElementsByName
(String[] names) Get an array of elements using their names, an exception will be thrown if at least one of them does not existString[]
get the list of global subsetsString[]
getGlobalSubsetVariables
(String subsetname) get the list of variables for the given global subsetint
getId()
Get the ID of the DimensiongetName()
Get the name of the dimensionIElement[]
Get the list of the root elements in the dimensionprotected DimensionInfo
getType()
Get the dimension typeIDimension.DimensionType
Get a list of all virtual dimensions derived from attributes of this dimensionboolean
check if at least one C-Element existsvoid
moveElements
(IElement[] elements, Integer[] positions) move a list of elements to new positionsnewConsolidation
(IElement parent, IElement child, double weight) create a consolidation object, no change is yet done to the dimensionreadAttributeValue
(IElement element, String attributeName, String language) protected DimensionInfo
int
clear all consolidations that exists in the dimensionvoid
removeAttributes
(IAttribute[] attributes) Removes the attributesvoid
removeAttributeValues
(IAttribute attribute, IElement[] elements) Removes the attribute values for these elements in this dimension, for the given language in the attribute.void
removeConsolidations
(IElement[] elements) remove the consolidations for these elements i.e.void
removeElements
(IElement[] elements) removes the elementsvoid
removeVirtualDimension
(IAttribute attribute) Removes a virtual dimension specified by a dimension attribute.void
rename a dimensionvoid
clear any cached information if exists, the expiry trust time will not be affectedvoid
setWithElementPermission
(boolean withPermission) decide whether elements should be read with permission or notvoid
updateConsolidations
(IConsolidation[] consolidations) update the consolidation for the elements mentioned as parents in the consolidations set.void
updateElementsType
(IElement[] elements, IElement.ElementType type) update the types of the elements, only ElementTypes type string and numeric can be usedIElement.ElementType
.Methods inherited from class com.jedox.palojlib.main.CachedComponent
endTrustTime, inTrustTime, setCacheTrustExpiry
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jedox.palojlib.interfaces.IDimension
getAttributesMap, getBasesElements, getChildrenMap, getDefaultNAElement, getDefaultParentElement, getDefaultReadElement, getDefaultTotalElement, getDefaultWriteElement, getElement, getElementByName, getElements, getElementsByName, getRootElements, getSingleElement, getSingleElement, getWeightsMap, setCacheTrustExpiry
-
Field Details
-
defaultExpiryDuration
public static final int defaultExpiryDuration- See Also:
-
info
-
cacheExists
protected boolean cacheExists -
elementsIdMap
-
elementsNameMap
-
hasConsolidatedElements
protected boolean hasConsolidatedElements
-
-
Constructor Details
-
Dimension
protected Dimension(int contextId, int id, String name, Database database, IDimension.DimensionType type, String attributeDimensionId, String attributeCubeId, String maximumLevel, String maximumIndent, String maximumDepth, String token, String numberOfElements, String defaultRead, String defaultWrite, String defaultNA, String defaultTotal, String defaultParent) throws PaloException, PaloJException - Throws:
PaloException
PaloJException
-
-
Method Details
-
getName
Description copied from interface:IDimension
Get the name of the dimension- Specified by:
getName
in interfaceIDimension
- Returns:
- name of the dimension
-
getType
Description copied from interface:IDimension
Get the dimension typeIDimension.DimensionType
- Specified by:
getType
in interfaceIDimension
- Returns:
- type
-
getDimensionInfo
Description copied from interface:IDimension
Get the dimension info objectIDimensionInfo
- Specified by:
getDimensionInfo
in interfaceIDimension
- Returns:
- dimension info object
-
getElements
Description copied from interface:IDimension
Get the list of elements in the dimension- Specified by:
getElements
in interfaceIDimension
- Returns:
- list of elements
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getRootElements
Description copied from interface:IDimension
Get the list of the root elements in the dimension- Specified by:
getRootElements
in interfaceIDimension
- Returns:
- list of root elements
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getBasesElements
Description copied from interface:IDimension
Get the list of the bases elements in the dimension- Specified by:
getBasesElements
in interfaceIDimension
- Returns:
- list of root elements
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
readAttributeValue
-
getElementByName
Description copied from interface:IDimension
Get an element using its name- Specified by:
getElementByName
in interfaceIDimension
- Parameters:
name
- name of the element- Returns:
- element object
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getDefaultReadElement
Description copied from interface:IDimension
get the element set as default read for the dimension- Specified by:
getDefaultReadElement
in interfaceIDimension
- Returns:
- get the element if exists, null if it does not exist
-
getDefaultParentElement
Description copied from interface:IDimension
get the element set as default parent for the dimension- Specified by:
getDefaultParentElement
in interfaceIDimension
- Returns:
- get the element if exists, null if it does not exist
-
getDefaultNAElement
Description copied from interface:IDimension
get the element set as default N/A for the dimension- Specified by:
getDefaultNAElement
in interfaceIDimension
- Returns:
- get the element if exists, null if it does not exist
-
getDefaultTotalElement
Description copied from interface:IDimension
get the element set as default total for the dimension- Specified by:
getDefaultTotalElement
in interfaceIDimension
- Returns:
- get the element if exists, null if it does not exist
-
getDefaultWriteElement
Description copied from interface:IDimension
get the element set as default write for the dimension- Specified by:
getDefaultWriteElement
in interfaceIDimension
- Returns:
- get the element if exists, null if it does not exist
-
getElementsByName
Description copied from interface:IDimension
Get an array of elements using their names, an exception will be thrown if at least one of them does not exist- Specified by:
getElementsByName
in interfaceIDimension
- Parameters:
names
- names array of the elements- Returns:
- element array object
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
hasConsolidatedElements
public boolean hasConsolidatedElements()Description copied from interface:IDimension
check if at least one C-Element exists- Specified by:
hasConsolidatedElements
in interfaceIDimension
- Returns:
- true, if at least one C-element exists
-
getAttributes
Description copied from interface:IDimension
Get a list of attributes for this dimension- Specified by:
getAttributes
in interfaceIDimension
- Returns:
- attributes dimension attributes
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getAttributeByName
Description copied from interface:IDimension
Get an attribute using its name- Specified by:
getAttributeByName
in interfaceIDimension
- Parameters:
name
- name of the attribute- Returns:
- attribute object
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getAttributeByName
public IAttribute getAttributeByName(String name, String language) throws PaloException, PaloJException - Specified by:
getAttributeByName
in interfaceIDimension
- Throws:
PaloException
PaloJException
-
addElements
public void addElements(String[] names, IElement.ElementType[] types) throws PaloException, PaloJException Description copied from interface:IDimension
Create a list of elements- Specified by:
addElements
in interfaceIDimension
- Parameters:
names
- the names of the new elementstypes
- the types of the new elements- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
appendElements
Description copied from interface:IDimension
Add new elements with the given type or simply change type of existing elements- Specified by:
appendElements
in interfaceIDimension
- Parameters:
elements
- element to append- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
moveElements
public void moveElements(IElement[] elements, Integer[] positions) throws PaloException, PaloJException Description copied from interface:IDimension
move a list of elements to new positions- Specified by:
moveElements
in interfaceIDimension
- Parameters:
elements
- elements to movepositions
- new positions- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
addBaseElement
public IElement addBaseElement(String name, IElement.ElementType type) throws PaloJException, PaloException Description copied from interface:IDimension
Create one element, this method does not invalidate the cache.- Specified by:
addBaseElement
in interfaceIDimension
- Parameters:
name
- the name of the new elementtype
- the type of the new element- Returns:
- the newly created Element
- Throws:
PaloJException
- exception from the library itselfPaloException
- exception from OLAP server
-
addAttribute
public void addAttribute(String name, IElement.ElementType type) throws PaloJException, PaloException Description copied from interface:IDimension
Create one attribute, this method does not invalidate the cache.- Specified by:
addAttribute
in interfaceIDimension
- Parameters:
name
- the name of the new attributetype
- the type of the new attribute- Throws:
PaloJException
- exception from the library itselfPaloException
- exception from OLAP server
-
addAttributes
public void addAttributes(String[] names, IElement.ElementType[] types) throws PaloJException, PaloException Description copied from interface:IDimension
Create new attributes in this dimension- Specified by:
addAttributes
in interfaceIDimension
- Parameters:
names
- names of the new attributestypes
- types of the new attributes- Throws:
PaloJException
- exception from the library itselfPaloException
- exception from OLAP server
-
removeConsolidations
Description copied from interface:IDimension
remove the consolidations for these elements i.e. their children- Specified by:
removeConsolidations
in interfaceIDimension
- Parameters:
elements
- dimension elements- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
removeAllConsolidations
Description copied from interface:IDimension
clear all consolidations that exists in the dimension- Specified by:
removeAllConsolidations
in interfaceIDimension
- Returns:
- number of C-Elements that were converted to base element
- Throws:
PaloException
PaloJException
-
updateConsolidations
public void updateConsolidations(IConsolidation[] consolidations) throws PaloException, PaloJException Description copied from interface:IDimension
update the consolidation for the elements mentioned as parents in the consolidations set.- Specified by:
updateConsolidations
in interfaceIDimension
- Parameters:
consolidations
- element parent-child relationships- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
newConsolidation
Description copied from interface:IDimension
create a consolidation object, no change is yet done to the dimension- Specified by:
newConsolidation
in interfaceIDimension
- Parameters:
parent
- parent elementchild
- child elementweight
- child weight- Returns:
- the consolidation object
-
removeAttributes
Description copied from interface:IDimension
Removes the attributes- Specified by:
removeAttributes
in interfaceIDimension
- Parameters:
attributes
- names of the attributes to be removed- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
removeElements
Description copied from interface:IDimension
removes the elements- Specified by:
removeElements
in interfaceIDimension
- Parameters:
elements
- names of the elements to be removed- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
addAttributeValues
public void addAttributeValues(IAttribute attribute, IElement[] elements, Object[] values) throws PaloJException, PaloException Description copied from interface:IDimension
Writes the attribute values for these elements- Specified by:
addAttributeValues
in interfaceIDimension
- Parameters:
attribute
- dimension attributeelements
- dimension elementsvalues
- attribute new values- Throws:
PaloJException
- exception from the library itselfPaloException
- exception from OLAP server
-
removeAttributeValues
public void removeAttributeValues(IAttribute attribute, IElement[] elements) throws PaloJException, PaloException Description copied from interface:IDimension
Removes the attribute values for these elements in this dimension, for the given language in the attribute.- Specified by:
removeAttributeValues
in interfaceIDimension
- Parameters:
attribute
- attributeelements
- list of elements, null value means all.- Throws:
PaloJException
- exception from the library itselfPaloException
- exception from OLAP server
-
addConsolidations
Description copied from interface:IDimension
add the consolidations for the elements mentioned as parents in the consolidations set, the children will be added to the existing children list. This will send one separate request per Element.- Specified by:
addConsolidations
in interfaceIDimension
- Parameters:
consolidations
- element parent-child relationships- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getAttributeCube
Description copied from interface:IDimension
get the attribute cube if exists- Specified by:
getAttributeCube
in interfaceIDimension
- Returns:
- get the attribute cube if exists, null if it does not exist
-
generateScript
- Specified by:
generateScript
in interfaceIDimension
-
getScriptContext
- Specified by:
getScriptContext
in interfaceIDimension
-
buildCache
- Throws:
PaloException
PaloJException
-
cacheExists
protected boolean cacheExists() -
checkCacheStatus
- Throws:
PaloException
PaloJException
-
getId
public int getId()Description copied from interface:IDimension
Get the ID of the Dimension- Specified by:
getId
in interfaceIDimension
- Returns:
- Dimension ID
-
rename
Description copied from interface:IDimension
rename a dimension- Specified by:
rename
in interfaceIDimension
- Parameters:
name
- new dimension name- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
updateElementsType
public void updateElementsType(IElement[] elements, IElement.ElementType type) throws PaloException, PaloJException Description copied from interface:IDimension
update the types of the elements, only ElementTypes type string and numeric can be usedIElement.ElementType
. Consolidated elements can not be included in the given list of elements.- Specified by:
updateElementsType
in interfaceIDimension
- Parameters:
elements
- the new elementstype
- string or numeric- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getElement
public IElement getElement(String elementName, boolean withPermission) throws PaloException, PaloJException Description copied from interface:IDimension
Get the a single element in the dimension, the dimension elements will not be read in this case- Specified by:
getElement
in interfaceIDimension
- Parameters:
elementName
- name of the elementwithPermission
- true will get the element permissions as well, default is false.- Returns:
- element if exists,otherwise null.
- Throws:
PaloException
- exception from OLAP serverPaloJException
- exception from the library itself
-
getGlobalSubsetVariables
Description copied from interface:IDimension
get the list of variables for the given global subset- Specified by:
getGlobalSubsetVariables
in interfaceIDimension
- Parameters:
subsetname
- name of the subset- Returns:
- list of variables
-
evaluateGlobalSubset
Description copied from interface:IDimension
evaluate the given subset with the set of variables- Specified by:
evaluateGlobalSubset
in interfaceIDimension
- Parameters:
subsetname
- name of the subsetsubsetVariables
- subset variables (can be empty)- Returns:
- the list of elements in the dimension that matches the subset
-
getGlobalSubsets
Description copied from interface:IDimension
get the list of global subsets- Specified by:
getGlobalSubsets
in interfaceIDimension
- Returns:
- list of global subsets
-
getElementById
- Throws:
PaloException
PaloJException
-
getServerDimensionInfo
- Throws:
PaloException
PaloJException
-
refreshDimensionInfo
- Throws:
PaloException
PaloJException
-
getAttributeById
- Throws:
PaloException
PaloJException
-
setWithElementPermission
public void setWithElementPermission(boolean withPermission) Description copied from interface:IDimension
decide whether elements should be read with permission or not- Specified by:
setWithElementPermission
in interfaceIDimension
- Parameters:
withPermission
- true means element permission will be read as well, default is false.
-
resetCache
public void resetCache()Description copied from interface:IDimension
clear any cached information if exists, the expiry trust time will not be affected- Specified by:
resetCache
in interfaceIDimension
-
getContextId
protected int getContextId() -
getDatabase
-
getAttributeDimensionId
protected int getAttributeDimensionId() -
createVirtualDimension
Description copied from interface:IDimension
Creates a virtual dimension specified by a dimension attribute.- Specified by:
createVirtualDimension
in interfaceIDimension
- Parameters:
attribute
- a string attribute of the dimension
-
removeVirtualDimension
Description copied from interface:IDimension
Removes a virtual dimension specified by a dimension attribute.- Specified by:
removeVirtualDimension
in interfaceIDimension
- Parameters:
attribute
- a string attribute of the dimension
-
getVirtualDimensions
Description copied from interface:IDimension
Get a list of all virtual dimensions derived from attributes of this dimension- Specified by:
getVirtualDimensions
in interfaceIDimension
- Returns:
- a list of virtual dimensions
-