Style Intelligence v12.0

inetsoft.report
Class XSessionManager

java.lang.Object
  extended by inetsoft.report.XSessionManager

public class XSessionManager
extends Object

XSessionManager provides the API for processing report data queries. It can be used to find all query parameters, or execute the queries and populate the report with query output. It supports all queries bound to a report element through the Designer.

If a report has query binding defined in the designer, the report must be executed using XSessionManager before it is processed. Otherwise the queries are not executed.


Field Summary
static int ALL_PARAMETER
          All parameter flag.
static String CACHED_DATA
          Cached data hint.
static int NO_EXECUTING
          Flag indicates not to execute parameters.
static int QUERY_PARAMETER
          Query parameter flag.
static int REPORT_CONDITION_PARAMETER
          Report condition parameter flag.
static int USER_DEFINED_PARAMETER
          User defined parameter flag.
 
Constructor Summary
XSessionManager()
          Create a session manager with specific key.
XSessionManager(XDataService service, Object session)
          Create a session manager from a data service and session.
 
Method Summary
 void bind(Object uinfo)
          Bind to the data service engine.
 void cancel(ReportSheet report)
          Cancel report and clean up background queries if supported.
static void clear()
          Clear cached session manager.
 void clearCache()
          Clear data cache.
 void destroyReport(ReportSheet report)
          Destroy report to clear up temporary resources.
protected  void execute(inetsoft.report.internal.BindableElement elem, inetsoft.report.internal.binding.BindingAttr binding, VariableTable vars, Principal user, Hashtable queries)
          Execute a query on an element.
 boolean execute(ReportSheet report)
          Execute a report.
protected  boolean execute(ReportSheet report, boolean force)
          Execute a report.
protected  void execute(ReportSheet report, ReportElement elem, VariableTable vars, Vector chart_tables, Principal user, String[] qrs, Hashtable queries)
          Execute an element.
 void execute(ReportSheet report, VariableTable vars)
          Execute a report.
 void execute(ReportSheet report, VariableTable vars, Principal user)
          Execute a report.
 void execute(ReportSheet report, VariableTable vars, Principal user, String[] qrs)
          Execute a report.
 void executeChoiceQuery(UserVariable var, XQueryRepository rep)
          Execute queries for selection list parameters and populate choice list.
 void executeChoiceQuery(UserVariable var, XQueryRepository rep, String ename)
          Execute queries for selection list parameters and populate choice list.
 void finalize()
          Clean up.
protected  inetsoft.report.internal.binding.BindingAttr getBindingAttr(ReportElement elem)
          Get source attr from a report element.
 XDataService getDataService()
          Get the data source object of this session manager.
static List getExecutingQueries()
          Get the ids of all executing queries during a sample period.
 UserVariable[] getQueryParameters(ReportSheet report, boolean promptOnly)
          Get the query parameters in the report.
 UserVariable[] getQueryParameters(ReportSheet report, boolean promptOnly, int pflag)
          Get the query parameters in the report.
 UserVariable[] getQueryParameters(ReportSheet report, boolean promptOnly, int pflag, VariableTable nopromptVars)
          Get the query parameters in the report.
 String getQueryVariableName(String qname, String vname)
          Get query variable name.
 Object getSession()
          Get the session object of this session.
static XSessionManager getSessionManager()
          Get a singlton session manager.
 XNodeTableLens getXNodeTableLens(XQuery query, VariableTable qvars, Principal user)
          Get the XNodeTableLens from a query.
 XNodeTableLens getXNodeTableLens(XQuery query, VariableTable qvars, Principal user, XQueryRepository rep, Hashtable queries)
          Get the XNodeTableLens from a query.
 XNodeTableLens getXNodeTableLens(XQuery query, VariableTable qvars, Principal user, XQueryRepository rep, Hashtable queries, long ts)
          Get the XNodeTableLens from a query.
 boolean isCacheData()
          Check if query result should be cached.
 boolean isVariableNameUnique()
          Check if the query variable names are unique.
 TableLens performJoins(TableLens baseTable, VariableTable vars, inetsoft.report.internal.binding.BindingAttr binding, inetsoft.report.internal.BindableElement elem, Principal user)
          Create join tables by executing the joined query and join with the base table.
 void prepareJoinBinding(inetsoft.report.internal.binding.BindingAttr binding, ReportSheet report)
          Prepare the BindingAttr for joining.
 XQuery prepareQuery(ReportElement elem, VariableTable vars)
          Create or retrieve query for an element.
static void removeQueryInfo(String queryId)
          Remove the query info from the current static query map.
static void restart()
          Restart the session manager.
 void setCacheData(boolean useCache)
          Set if query result should be cached.
 void setDataService(XDataService service)
          Set the data source object of this session manager.
 void setSession(Object session)
          Set the session object of this session.
 void setVariableNameUnique(boolean unique)
          Set if the query variable names are unique.
 void tearDown()
          Tear down manager.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUERY_PARAMETER

public static final int QUERY_PARAMETER
Query parameter flag.

See Also:
Constant Field Values

REPORT_CONDITION_PARAMETER

public static final int REPORT_CONDITION_PARAMETER
Report condition parameter flag.

See Also:
Constant Field Values

USER_DEFINED_PARAMETER

public static final int USER_DEFINED_PARAMETER
User defined parameter flag.

See Also:
Constant Field Values

ALL_PARAMETER

public static final int ALL_PARAMETER
All parameter flag.

See Also:
Constant Field Values

NO_EXECUTING

public static final int NO_EXECUTING
Flag indicates not to execute parameters.

See Also:
Constant Field Values

CACHED_DATA

public static final String CACHED_DATA
Cached data hint.

See Also:
Constant Field Values
Constructor Detail

XSessionManager

public XSessionManager()
                throws RemoteException
Create a session manager with specific key.

Throws:
RemoteException

XSessionManager

public XSessionManager(XDataService service,
                       Object session)
Create a session manager from a data service and session. The session should be the object returned by the service.bind() call.

Method Detail

getSessionManager

public static XSessionManager getSessionManager()
                                         throws RemoteException
Get a singlton session manager. The manager is already bound to a session. The bind() method does not need to be called.

Throws:
RemoteException

clear

public static void clear()
Clear cached session manager.


restart

public static void restart()
Restart the session manager.


tearDown

public void tearDown()
Tear down manager.


getDataService

public XDataService getDataService()
Get the data source object of this session manager.


setDataService

public void setDataService(XDataService service)
Set the data source object of this session manager.


getSession

public Object getSession()
Get the session object of this session. The session is either passed in from the constructor, or created when bind() method is called.


setSession

public void setSession(Object session)
Set the session object of this session.


isVariableNameUnique

public boolean isVariableNameUnique()
Check if the query variable names are unique.


setVariableNameUnique

public void setVariableNameUnique(boolean unique)
Set if the query variable names are unique. If the names are unique, variables used in two different queries are considered the same if they share the same name. By default this option is true.


bind

public void bind(Object uinfo)
          throws RemoteException
Bind to the data service engine.

Parameters:
uinfo - user information. Must be unique in each session.
Throws:
RemoteException

getQueryParameters

public UserVariable[] getQueryParameters(ReportSheet report,
                                         boolean promptOnly)
                                  throws RemoteException
Get the query parameters in the report.

Parameters:
report - the specified report.
promptOnly - true if only include the user variables that are declared as 'Prompt User'.
Returns:
list of variables or null if no variable is needed.
Throws:
RemoteException

getQueryParameters

public UserVariable[] getQueryParameters(ReportSheet report,
                                         boolean promptOnly,
                                         int pflag)
                                  throws RemoteException
Get the query parameters in the report.

Parameters:
report - the specified report.
promptOnly - true if only include the user variables that are declared as 'Prompt User'.
pflag - the specified parameter flag. queries and data models.
Returns:
list of variables or null if no variable is needed.
Throws:
RemoteException

getQueryParameters

public UserVariable[] getQueryParameters(ReportSheet report,
                                         boolean promptOnly,
                                         int pflag,
                                         VariableTable nopromptVars)
                                  throws RemoteException
Get the query parameters in the report.

Parameters:
promptOnly - true if only include the user variables that are declared as 'Prompt User'.
pflag - the specified parameter flag.
nopromptVars - this table will be populated with the default value for non-prompting parameters upon return.
Returns:
list of variables or null if no variable is needed.
Throws:
RemoteException

executeChoiceQuery

public void executeChoiceQuery(UserVariable var,
                               XQueryRepository rep)
Execute queries for selection list parameters and populate choice list.


executeChoiceQuery

public void executeChoiceQuery(UserVariable var,
                               XQueryRepository rep,
                               String ename)
Execute queries for selection list parameters and populate choice list.


execute

public boolean execute(ReportSheet report)
                throws Exception
Execute a report. If the report needs parameters, this method prompts users with a parameter dialog.

Parameters:
report - report to execute.
Returns:
false if the variable entry is cancelled by user.
Throws:
Exception

execute

protected boolean execute(ReportSheet report,
                          boolean force)
                   throws Exception
Execute a report. If the report needs parameters, this method prompts users with a parameter dialog.

Parameters:
report - report to execute.
Returns:
false if the variable entry is cancelled by user.
Throws:
Exception

execute

public void execute(ReportSheet report,
                    VariableTable vars)
             throws Exception
Execute a report. The report parameters are passed in through the VariableTable. This method will not prompt user for parameters.

Parameters:
report - report to execute.
vars - report parameters.
Throws:
Exception

execute

public void execute(ReportSheet report,
                    VariableTable vars,
                    Principal user)
             throws Exception
Execute a report. The report parameters are passed in through the VariableTable. This method will not prompt user for parameters.

Parameters:
report - report to execute.
vars - report parameters.
user - a Principal object that identifies the user executing the query.
Throws:
Exception

execute

public void execute(ReportSheet report,
                    VariableTable vars,
                    Principal user,
                    String[] qrs)
             throws Exception
Execute a report. The report parameters are passed in through the VariableTable. This method will not prompt user for parameters.

Parameters:
report - report to execute.
vars - report parameters.
user - a Principal object that identifies the user executing the query.
qrs - the queries visible to the user executing the report
Throws:
Exception

cancel

public void cancel(ReportSheet report)
            throws Exception
Cancel report and clean up background queries if supported.

Throws:
Exception

destroyReport

public void destroyReport(ReportSheet report)
                   throws Exception
Destroy report to clear up temporary resources.

Throws:
Exception

prepareQuery

public XQuery prepareQuery(ReportElement elem,
                           VariableTable vars)
                    throws Exception
Create or retrieve query for an element.

Throws:
Exception

getXNodeTableLens

public XNodeTableLens getXNodeTableLens(XQuery query,
                                        VariableTable qvars,
                                        Principal user)
                                 throws Exception
Get the XNodeTableLens from a query.

Parameters:
query - the specified query.
qvars - the specified variable table.
user - the specified principal.
Throws:
Exception

getXNodeTableLens

public XNodeTableLens getXNodeTableLens(XQuery query,
                                        VariableTable qvars,
                                        Principal user,
                                        XQueryRepository rep,
                                        Hashtable queries)
                                 throws Exception
Get the XNodeTableLens from a query.

Parameters:
query - the specified query.
qvars - the specified variable table.
user - the specified principal.
rep - the specified local query repository.
queries - the queries
Throws:
Exception

getXNodeTableLens

public XNodeTableLens getXNodeTableLens(XQuery query,
                                        VariableTable qvars,
                                        Principal user,
                                        XQueryRepository rep,
                                        Hashtable queries,
                                        long ts)
                                 throws Exception
Get the XNodeTableLens from a query.

Parameters:
query - the specified query.
qvars - the specified variable table.
user - the specified principal.
rep - the specified local query repository.
queries - the queries.
ts - touch timestamp of data changes.
Throws:
Exception

getQueryVariableName

public String getQueryVariableName(String qname,
                                   String vname)
Get query variable name.

Parameters:
qname - the specified query name.
vname - the specified variable name.
Returns:
the newly created query variable name.

execute

protected void execute(ReportSheet report,
                       ReportElement elem,
                       VariableTable vars,
                       Vector chart_tables,
                       Principal user,
                       String[] qrs,
                       Hashtable queries)
                throws Exception
Execute an element.

Throws:
Exception

execute

protected void execute(inetsoft.report.internal.BindableElement elem,
                       inetsoft.report.internal.binding.BindingAttr binding,
                       VariableTable vars,
                       Principal user,
                       Hashtable queries)
                throws Exception
Execute a query on an element.

Throws:
Exception

getBindingAttr

protected inetsoft.report.internal.binding.BindingAttr getBindingAttr(ReportElement elem)
Get source attr from a report element.


finalize

public void finalize()
Clean up.

Overrides:
finalize in class Object

clearCache

public void clearCache()
Clear data cache.


setCacheData

public void setCacheData(boolean useCache)
Set if query result should be cached.

Parameters:
useCache - - true to cache query result

isCacheData

public boolean isCacheData()
Check if query result should be cached.

Returns:
true to cache query result, false otherwise.

prepareJoinBinding

public void prepareJoinBinding(inetsoft.report.internal.binding.BindingAttr binding,
                               ReportSheet report)
Prepare the BindingAttr for joining. The original binding is not modified.


performJoins

public TableLens performJoins(TableLens baseTable,
                              VariableTable vars,
                              inetsoft.report.internal.binding.BindingAttr binding,
                              inetsoft.report.internal.BindableElement elem,
                              Principal user)
                       throws Exception
Create join tables by executing the joined query and join with the base table.

Throws:
Exception

removeQueryInfo

public static void removeQueryInfo(String queryId)
Remove the query info from the current static query map. Mark the query as a completed query.


getExecutingQueries

public static List getExecutingQueries()
Get the ids of all executing queries during a sample period.


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