Style Intelligence v12.0

inetsoft.uql.erm
Class XLogicalModel

java.lang.Object
  extended by inetsoft.uql.erm.XLogicalModel
All Implemented Interfaces:
XCube, inetsoft.util.xml.XMLStorage.XMLFragment, inetsoft.util.XMLSerializable, Serializable, Cloneable, Comparable

public class XLogicalModel
extends Object
implements Cloneable, Serializable, Comparable, XCube, inetsoft.util.XMLSerializable, inetsoft.util.xml.XMLStorage.XMLFragment

A business logic view of a relational database model.

Since:
6.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface inetsoft.uql.XCube
ESSBASE, MODEL, MONDRIAN, SAP, SQLSERVER
 
Constructor Summary
XLogicalModel(String name)
          Create a new instance of XLogicalModel.
XLogicalModel(String name, XLogicalModel base)
          Create a new instance of XLogicalModel.
 
Method Summary
 void addDataModelListener(DataModelListener l)
          Add a listener that is notified when this model has been changed.
 void addDimension(XDimension dimension)
          Add a dimension to this model.
 void addEntity(int index, XEntity entity)
          Add an entity to this model.
 void addEntity(XEntity entity)
          Add an entity to this model.
 void addLogicalModel(XLogicalModel child)
          Add a child XLogicalModel.
 void addMeasure(XMeasure measure)
          Add a measure to this model.
 void addVariable(XVariable var)
          Add a variable to this query.
protected  XLogicalModel applyRuntime(Principal user, boolean hideAttributes)
          Create a new logical model, a clone of extended model or self, hide invisible entities and attributes.
 Object clone()
          Create a copy of this object.
 int compareTo(XLogicalModel obj)
          Compares this object with the specified object for order.
 boolean containLogicalModel(String name)
          Check if child XLogicalModel exists.
 boolean equals(Object obj)
          Determine if the specified object is equivalent to this object.
 XLogicalModel getBaseModel()
          Get the base model.
 String getConnection()
          Get a connection of this model.
 XDataModel getDataModel()
          Get data model.
 String getDataSource()
          Get the datasource name of this logical model.
 Enumeration getDefinedVariables()
          Get the names of all variables need to be defined in this query.
 Enumeration getDefinedVariables(XDataModel parent)
          Get the names of all variables need to be defined in this query.
 String getDescription()
          Get a description of this model.
 XDimension getDimension(String name)
          Get the dimension with the specified name.
 int getDimensionCount()
          Get the number of dimensions in this model.
 Enumeration getDimensions()
          Get a list of all dimensions in this model.
 Enumeration getEntities()
          Get a list of all entities in this model.
 Enumeration getEntitiesForTable(String table)
          Get a list of all entities in this model that are mapped to the specified table.
 XEntity getEntity(String name)
          Get the entity with the specified name.
 XEntity getEntityAt(int idx)
          Get specified entity by index from this model.
 int getEntityCount()
          Get the count of entity.
 XEntity getEntityForColumn(String table, String column)
          Get the entity in this model that is mapped to the specified column.
 int getEntityIndex(String name)
          Get the position of the entity.
 boolean getEntityOrder()
          Get the logical model order.
 XLogicalModel getLogicalModel(String name)
          Get child XLogicalModel with specified name.
 XLogicalModel getLogicalModelByConnection(String connection, boolean strict)
          Get child XLogicalModel with specified connection.
 String[] getLogicalModelNames()
          Get the names of child models.
 XCubeMember getMeasure(String name)
          Get the measure with the specified name.
 int getMeasureCount()
          Get the number of measures in this model.
 Enumeration getMeasures()
          Get a list of all measures in this model.
 String getName()
          Get the name of this model.
 String getPartition()
          Get the physical model which this logical model represents.
 String getPartitionUsed(XPartition partition)
          Get the extended view which used this extended partition.
 int getPriority()
          Get the priority of this model.
 String getType()
          Get cube type.
 XVariable getVariable(String name)
          Get a variable defined in this query.
 Enumeration getVariableNames()
          Get the names of all variables used in this query.
 boolean isBaseEntity(String name)
          Determine if the entity is from the base model.
 boolean isEntityVisible(String name)
          Check the specified entity is visible or not.
 boolean moveEntity(String name, boolean up)
          Move entity up or down.
 void parseXML(Element tag)
          Read in the definition of this object from an XML tag.
 void removeDataModelListener(DataModelListener l)
          Remove a DataModelListener from the notification list.
 void removeDimension(String name)
          Remove the dimension with the specified name from this model.
 void removeEntity(String name)
          Remove the entity with the specified name from this model.
 void removeLogicalModel(String name)
          remove a child XLogicalModel.
 void removeMeasure(String name)
          Remove the measure with the specified name from this model.
 void removeVariable(String name)
          Remove a variable from this query.
 void renameDatasource(String oname, String nname)
          Rename child logicla model.
 void renameLogicalModel(String oname, XLogicalModel extend)
          rename a child XLogicalModel.
 void setBaseModel(XLogicalModel base)
          Set the base model.
 void setConnection(String connection)
          Set the connection of this model.
 void setDataModel(XDataModel model)
          Set data model.
 void setDataSource(String datasource)
          Deprecated.  
 void setDescription(String description)
          Set the description of this model.
 void setDimension(XDimension dimension, int index)
          Set a dimension to this model.
 void setEntityOrder(boolean entityOrder)
          Set the logical model order.
 void setEntityVisible(String name, boolean visible)
          Set visibility of the entity.
 void setName(String name)
          Set the name of this model.
 void setPartition(String partition)
          Set the physical model which this logical model represents.
 void setPriority(int priority)
          Set the priority of this model.
 void setRuntime(boolean runtime)
          Set is runtime mode or not.
 void updateEntity(String oname, XEntity entity)
          Update an entity to this model.
 void updateReference()
          Update child model reference.
 void writeEnd(PrintWriter writer)
           
 void writeStart(PrintWriter writer)
           
 void writeXML(PrintWriter writer)
          Write an XML element representation of this object.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XLogicalModel

public XLogicalModel(String name)
Create a new instance of XLogicalModel.

Parameters:
name - the name of the model.

XLogicalModel

public XLogicalModel(String name,
                     XLogicalModel base)
Create a new instance of XLogicalModel.

Parameters:
name - the name of the model.
base - the base model
Method Detail

addDimension

public void addDimension(XDimension dimension)
Add a dimension to this model.

Parameters:
dimension - the dimension to add.

setDimension

public void setDimension(XDimension dimension,
                         int index)
Set a dimension to this model.

Parameters:
dimension - the dimension to add.
index - the index to add.

getDimensionCount

public int getDimensionCount()
Get the number of dimensions in this model.

Returns:
the number of dimensions in this model.

setDataSource

@Deprecated
public void setDataSource(String datasource)
Deprecated. 

Set the datasource name of this logical model.

Parameters:
datasource - the datasource name.

getDataSource

public String getDataSource()
Get the datasource name of this logical model.

Returns:
datasource the datasource name.

getDimension

public XDimension getDimension(String name)
Get the dimension with the specified name.

Specified by:
getDimension in interface XCube
Parameters:
name - the name of the dimension.
Returns:
a dimension or null if no dimension with the specified name exists.

getDimensions

public Enumeration getDimensions()
Get a list of all dimensions in this model.

Specified by:
getDimensions in interface XCube
Returns:
an Enumeration containing all the dimensions in this model.

removeDimension

public void removeDimension(String name)
Remove the dimension with the specified name from this model.

Parameters:
name - the name of the dimension to remove.

getEntityCount

public int getEntityCount()
Get the count of entity.

Returns:
the count of entity.

addEntity

public void addEntity(XEntity entity)
Add an entity to this model.

Parameters:
entity - the entity to add.

addEntity

public void addEntity(int index,
                      XEntity entity)
Add an entity to this model.

Parameters:
entity - the entity to add.

updateEntity

public void updateEntity(String oname,
                         XEntity entity)
Update an entity to this model.

Parameters:
oname - old entity name.
entity - the entity to add.

getEntity

public XEntity getEntity(String name)
Get the entity with the specified name.

Parameters:
name - the name of the entity.
Returns:
an entity or null if no entity with the specified name exists.

isBaseEntity

public boolean isBaseEntity(String name)
Determine if the entity is from the base model.


getEntities

public Enumeration getEntities()
Get a list of all entities in this model.

Returns:
an Enumeration that contains all the entities in this model.

getEntityAt

public XEntity getEntityAt(int idx)
Get specified entity by index from this model.

Parameters:
idx - the index of the entity to get.

removeEntity

public void removeEntity(String name)
Remove the entity with the specified name from this model.

Parameters:
name - the name of the entity to remove.

addMeasure

public void addMeasure(XMeasure measure)
Add a measure to this model.

Parameters:
measure - the measure to add.

getMeasureCount

public int getMeasureCount()
Get the number of measures in this model.

Returns:
the number of measures in this model.

getMeasure

public XCubeMember getMeasure(String name)
Get the measure with the specified name.

Specified by:
getMeasure in interface XCube
Parameters:
name - the name of the measure.
Returns:
a measure or null if no measure with the specified name exists in this model.

getMeasures

public Enumeration getMeasures()
Get a list of all measures in this model.

Specified by:
getMeasures in interface XCube
Returns:
an Enumeration containing all the measures in this model.

removeMeasure

public void removeMeasure(String name)
Remove the measure with the specified name from this model.

Parameters:
name - the name of the measure to remove.

getName

public String getName()
Get the name of this model.

Specified by:
getName in interface XCube
Returns:
the model name.

setName

public void setName(String name)
Set the name of this model.

Parameters:
name - the model name.

getConnection

public String getConnection()
Get a connection of this model.

Returns:
a connection.

setConnection

public void setConnection(String connection)
Set the connection of this model.

Parameters:
connection - connection of this model.

getDescription

public String getDescription()
Get a description of this model.

Returns:
a description.

setDescription

public void setDescription(String description)
Set the description of this model.

Parameters:
description - a description.

addDataModelListener

public void addDataModelListener(DataModelListener l)
Add a listener that is notified when this model has been changed.

Parameters:
l - the listener to add.

removeDataModelListener

public void removeDataModelListener(DataModelListener l)
Remove a DataModelListener from the notification list.

Parameters:
l - the listener to remove.

getPriority

public int getPriority()
Get the priority of this model.

Returns:
the priority of this model.

setPriority

public void setPriority(int priority)
Set the priority of this model.

Parameters:
priority - the priority of this model.

getEntitiesForTable

public Enumeration getEntitiesForTable(String table)
Get a list of all entities in this model that are mapped to the specified table.

Parameters:
table - the name of the table.
Returns:
an Enumeration of XEntity objects.

getEntityForColumn

public XEntity getEntityForColumn(String table,
                                  String column)
Get the entity in this model that is mapped to the specified column.

Parameters:
table - the name of the table.
column - the name of the column.
Returns:
the entity or null if no entity in this model is mapped to the specified column.

getDefinedVariables

public Enumeration getDefinedVariables()
Get the names of all variables need to be defined in this query.


getDefinedVariables

public Enumeration getDefinedVariables(XDataModel parent)
Get the names of all variables need to be defined in this query.


getVariableNames

public Enumeration getVariableNames()
Get the names of all variables used in this query. The variables are either UserVariable or QueryVariable.


getVariable

public XVariable getVariable(String name)
Get a variable defined in this query.

Parameters:
name - variable name.
Returns:
variable definition.

addVariable

public void addVariable(XVariable var)
Add a variable to this query.

Parameters:
var - variable definition.

removeVariable

public void removeVariable(String name)
Remove a variable from this query.

Parameters:
name - variable name.

clone

public Object clone()
Create a copy of this object.

Overrides:
clone in class Object
Returns:
a copy of this object.

equals

public boolean equals(Object obj)
Determine if the specified object is equivalent to this object.

Overrides:
equals in class Object
Parameters:
obj - the object to compare.
Returns:
true if the objects are equivalent.

compareTo

public int compareTo(XLogicalModel obj)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Specified by:
compareTo in interface Comparable
Parameters:
obj - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

getPartition

public String getPartition()
Get the physical model which this logical model represents.

Returns:
the name of the partition.

setPartition

public void setPartition(String partition)
Set the physical model which this logical model represents.

Parameters:
partition - the name of the partition.

getEntityOrder

public boolean getEntityOrder()
Get the logical model order.

Returns:
if entities sort default order.

setEntityOrder

public void setEntityOrder(boolean entityOrder)
Set the logical model order.

Parameters:
entityOrder - the value of the entityOrder.

writeXML

public void writeXML(PrintWriter writer)
Write an XML element representation of this object.

Specified by:
writeXML in interface inetsoft.util.XMLSerializable
Parameters:
writer - the output stream to which to write the XML data.

writeStart

public void writeStart(PrintWriter writer)
Specified by:
writeStart in interface inetsoft.util.xml.XMLStorage.XMLFragment

writeEnd

public void writeEnd(PrintWriter writer)
Specified by:
writeEnd in interface inetsoft.util.xml.XMLStorage.XMLFragment

parseXML

public void parseXML(Element tag)
              throws Exception
Read in the definition of this object from an XML tag.

Specified by:
parseXML in interface inetsoft.util.XMLSerializable
Parameters:
tag - the XML Element representing this object.
Throws:
Exception

getEntityIndex

public int getEntityIndex(String name)
Get the position of the entity.


setBaseModel

public void setBaseModel(XLogicalModel base)
Set the base model.


getBaseModel

public XLogicalModel getBaseModel()
Get the base model.


setRuntime

public void setRuntime(boolean runtime)
Set is runtime mode or not.

Parameters:
runtime - apply visible of entities and attributes.

setEntityVisible

public void setEntityVisible(String name,
                             boolean visible)
Set visibility of the entity.

Parameters:
name - the name of specified entity.

isEntityVisible

public boolean isEntityVisible(String name)
Check the specified entity is visible or not.

Parameters:
name - the name of the specified entity.

addLogicalModel

public void addLogicalModel(XLogicalModel child)
Add a child XLogicalModel.


containLogicalModel

public boolean containLogicalModel(String name)
Check if child XLogicalModel exists.


getLogicalModel

public XLogicalModel getLogicalModel(String name)
Get child XLogicalModel with specified name.


getPartitionUsed

public String getPartitionUsed(XPartition partition)
Get the extended view which used this extended partition.


getLogicalModelByConnection

public XLogicalModel getLogicalModelByConnection(String connection,
                                                 boolean strict)
Get child XLogicalModel with specified connection.


getLogicalModelNames

public String[] getLogicalModelNames()
Get the names of child models.


renameDatasource

public void renameDatasource(String oname,
                             String nname)
Rename child logicla model.


removeLogicalModel

public void removeLogicalModel(String name)
remove a child XLogicalModel.


renameLogicalModel

public void renameLogicalModel(String oname,
                               XLogicalModel extend)
rename a child XLogicalModel.


applyRuntime

protected XLogicalModel applyRuntime(Principal user,
                                     boolean hideAttributes)
Create a new logical model, a clone of extended model or self, hide invisible entities and attributes.


moveEntity

public boolean moveEntity(String name,
                          boolean up)
Move entity up or down.


updateReference

public void updateReference()
Update child model reference.


getDataModel

public XDataModel getDataModel()
Get data model.


setDataModel

public void setDataModel(XDataModel model)
Set data model.


getType

public String getType()
Get cube type.

Specified by:
getType in interface XCube
Returns:
cube type.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.