Style Intelligence v12.0

inetsoft.uql.asset
Class Worksheet

java.lang.Object
  extended by inetsoft.uql.asset.AbstractSheet
      extended by inetsoft.uql.asset.Worksheet
All Implemented Interfaces:
AssetObject, inetsoft.uql.asset.internal.VariableProvider, inetsoft.util.XMLSerializable, Serializable, Cloneable

public class Worksheet
extends AbstractSheet
implements inetsoft.uql.asset.internal.VariableProvider

Worksheet like a spreadsheet, contains condition/named group/variable/table Assemblies, of which a primary assembly for binding.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class inetsoft.uql.asset.AbstractSheet
ADD_ASSEMBLY, ANNOTATION_ASSET, ANNOTATION_LINE_ASSET, ANNOTATION_RECTANGLE_ASSET, BIND_ASSEMBLY, CALENDAR_ASSET, CHART_ASSET, CHECKBOX_ASSET, COMBOBOX_ASSET, CONDITION_ASSET, CROSSTAB_ASSET, CUBE_ASSET, CURRENTSELECTION_ASSET, CYLINDER_ASSET, DATE_RANGE_ASSET, DRILL_BOX_ASSET, EMBEDDEDTABLE_VIEW_ASSET, FONT_FAMILY, FORMULA_TABLE_ASSET, GAUGE_ASSET, GROUPCONTAINER_ASSET, heights, IMAGE_ASSET, LINE_ASSET, MIN_SIZE, NAMED_GROUP_ASSET, NO_MOVEMENT, OVAL_ASSET, PREF_COL, RADIOBUTTON_ASSET, RECTANGLE_ASSET, REMOVE_ASSEMBLY, RENAME_ASSEMBLY, SELECTION_LIST_ASSET, SELECTION_TREE_ASSET, SHEET_DESIGN_MODE, SHEET_RUNTIME_MODE, SLIDER_ASSET, SLIDING_SCALE_ASSET, SPINNER_ASSET, SUBMIT_ASSET, TAB_ASSET, TABLE_ASSET, TABLE_VIEW_ASSET, TEXT_ASSET, TEXTINPUT_ASSET, THERMOMETER_ASSET, TIME_SLIDER_ASSET, UPLOAD_ASSET, USER_FORMAT, VARIABLE_ASSET, VIEWSHEET_ASSET, VIEWSHEET_SNAPSHOT_ASSET, widths, X_MOVEMENT, Y_MOVEMENT
 
Constructor Summary
Worksheet()
          Constructor.
 
Method Summary
 boolean addAssembly(WSAssembly assembly)
          Add an assembly.
 boolean addOuterDependency(AssetEntry entry)
          Add an outer dependency.
 void addParseThread(Runnable runnable)
          Add a thread to init parse emebedded data.
 void autoLayout()
          Rearrange the assemblies into a tree like structure where the root is displayed on top, and children below, and so on.
 void checkDependencies()
          Check if the dependencies are valid.
 void checkValidity()
          Check if the worksheet is valid.
 Object clone()
          Clone the object.
 boolean containsAssembly(Assembly assembly)
          Check if contains an assembly.
 boolean containsAssembly(String name)
          Check if contains an assembly.
 void dispose()
          Dispose executing assembly.
 UserVariable[] getAllVariables()
          Get all variables in the condition value list.
 Assembly[] getAssemblies()
          Get all the assemblies.
 Assembly[] getAssemblies(boolean sort)
          Get all the assemblies.
 Assembly getAssembly(AssemblyEntry entry)
          Get an assembly by its entry.
 Assembly getAssembly(String name)
          Get an assembly by its name.
 Assembly getCubeTableAssembly(String name)
          Get cube table assembly.
 AssemblyRef[] getDependeds(AssemblyEntry entry)
          Get the assemblies depended on of an assembly in a sheet.
 AssemblyRef[] getDependeds(AssemblyEntry entry, boolean view, boolean out)
          Get the assemblies depended on of an assembly in a viewsheet.
 AssemblyRef[] getDependings(AssemblyEntry entry)
          Get the depending assemblies in a worksheet.
 String getDescription()
          Get the description of the worksheet.
protected  int getGap()
          Get the gap between two assemblies.
 AssetEntry[] getOuterDependencies()
          Get the outer dependencies.
 AssetEntry[] getOuterDependents()
          Get the outer dependents.
 WSAssembly getPrimaryAssembly()
          Get the primary assembly.
 String getPrimaryAssemblyName()
          Get the primary assembly name.
 Dimension getSize()
          Get the size of the worksheet.
 int getType()
          Get the type of the worksheet.
 TableAssembly getVSTableAssembly(String bname)
          Get the table assembly used in viewsheet by the name of the base assembly.
 WorksheetInfo getWorksheetInfo()
          Get the worksheet info.
 boolean isCondition()
          Check if is a condition worksheet.
 boolean isFrozen()
          Check if this worksheet is frozen.
 boolean isNamedGroup()
          Check if is a named group worksheet.
 boolean isOffline()
          return if it's offline worksheet or not.
 boolean isShowWarning()
          return if show warning dialog after rename or not.
 boolean isTable()
          Check if is a table worksheet.
 boolean isVariable()
          Check if is a variable worksheet.
 void parseXML(Element elem)
          Method to parse an xml segment.
 boolean removeAssembly(Assembly assembly)
          Remove an assembly.
 boolean removeAssembly(String name)
          Remove an assembly.
 void removeOuterDependencies()
          Remove all the outer dependencies.
 boolean removeOuterDependency(AssetEntry entry)
          Remove an outer dependency.
 boolean renameAssembly(String oname, String nname, boolean both)
          Rename an assembly.
 void renameOuterDependent(AssetEntry oentry, AssetEntry nentry)
          Rename an outer dependent.
 void replaceVariables(VariableTable vars)
          Replace all embeded user variables.
 void reset()
          Reset the worksheet.
 void setOffline(boolean offline)
          Set it's offline worksheet or not.
 boolean setPrimaryAssembly(Assembly assembly)
          Set the primary assembly.
 boolean setPrimaryAssembly(String name)
          Set the primary assembly.
 void setShowWarning(boolean w)
          set show warning dialog after rename or not.
 boolean setWorksheetInfo(WorksheetInfo winfo)
          Set the worksheet info.
 boolean update()
          Update the references in worksheet.
 boolean update(AssetRepository rep, AssetEntry entry, Principal user)
          Update this worksheet.
 boolean updateMirrors(AssetRepository engine, Principal user, String rid)
          Update the auto update outer mirrors in the worksheet.
protected  void writeContents(PrintWriter writer)
          Write the content part(child node) of XML segment.
 void writeData(JarOutputStream out)
          Write out data content in each assembly.
 void writeXML(PrintWriter writer)
          Write the xml segment to print writer.
 
Methods inherited from class inetsoft.uql.asset.AbstractSheet
addActionListener, addr, fireEvent, getActualBounds, getColWidth, getColX, getCreated, getCreatedBy, getLastModified, getLastModified, getLastModifiedBy, getLastSize, getLayoutBounds, getLocalQueryRepository, getRowHeight, getRowY, isFireEvent, isLayoutVisible, layout, layout, layout, moveY, parseWHXML, removeActionListener, removeActionListeners, resetSize, setColWidth, setCreated, setCreatedBy, setFireEvent, setLastModified, setLastModifiedBy, setLastSize, setLocalQueryRepository, setRowHeight, shrink, writeWHXML
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Worksheet

public Worksheet()
Constructor.

Method Detail

getType

public int getType()
Get the type of the worksheet.

Specified by:
getType in class AbstractSheet
Returns:
the type of the worksheet.

isCondition

public boolean isCondition()
Check if is a condition worksheet.

Returns:
true if yes, false otherwise.

isNamedGroup

public boolean isNamedGroup()
Check if is a named group worksheet.

Returns:
true if yes, false otherwise.

isVariable

public boolean isVariable()
Check if is a variable worksheet.

Returns:
true if yes, false otherwise.

isTable

public boolean isTable()
Check if is a table worksheet.

Returns:
true if yes, false otherwise.

getPrimaryAssemblyName

public String getPrimaryAssemblyName()
Get the primary assembly name.

Returns:
the primary assembly name, null if does not exist.

getPrimaryAssembly

public WSAssembly getPrimaryAssembly()
Get the primary assembly.

Returns:
the primary assembly, null if does not exist.

setPrimaryAssembly

public boolean setPrimaryAssembly(String name)
Set the primary assembly.

Parameters:
name - the specified primary assembly.
Returns:
true if successful, false otherwise.

setPrimaryAssembly

public boolean setPrimaryAssembly(Assembly assembly)
Set the primary assembly.

Parameters:
assembly - the specified primary assembly.
Returns:
true if successful, false otherwise.

getWorksheetInfo

public WorksheetInfo getWorksheetInfo()
Get the worksheet info.


setWorksheetInfo

public boolean setWorksheetInfo(WorksheetInfo winfo)
Set the worksheet info.

Returns:
true if the property change should cause the worksheet to be re-executed.

containsAssembly

public boolean containsAssembly(String name)
Check if contains an assembly.

Specified by:
containsAssembly in class AbstractSheet
Parameters:
name - the specified assembly name.
Returns:
true if yes, false otherwise.

containsAssembly

public boolean containsAssembly(Assembly assembly)
Check if contains an assembly.

Parameters:
assembly - the specified assembly.
Returns:
true if yes, false otherwise.

getAssembly

public Assembly getAssembly(AssemblyEntry entry)
Get an assembly by its entry.

Specified by:
getAssembly in class AbstractSheet
Parameters:
entry - the specified assembly entry.
Returns:
the assembly, null if not found.

getAssembly

public Assembly getAssembly(String name)
Get an assembly by its name.

Specified by:
getAssembly in class AbstractSheet
Parameters:
name - the specified assembly name.
Returns:
the assembly, null if not found.

getVSTableAssembly

public TableAssembly getVSTableAssembly(String bname)
Get the table assembly used in viewsheet by the name of the base assembly.

Parameters:
bname - the specified base assembly name.
Returns:
the assembly, null if not found.

getAssemblies

public Assembly[] getAssemblies()
Get all the assemblies.

Specified by:
getAssemblies in class AbstractSheet
Returns:
all the assemblies.

getAssemblies

public Assembly[] getAssemblies(boolean sort)
Get all the assemblies.

Parameters:
sort - true to sort the assembliies by dependency, false otherwise.
Returns:
all the assemblies.

addAssembly

public boolean addAssembly(WSAssembly assembly)
Add an assembly.

Parameters:
assembly - the specified assembly, null to remove it.
Returns:
true if successful, false otherwise.

removeAssembly

public boolean removeAssembly(String name)
Remove an assembly.

Parameters:
name - the specified assembly name.
Returns:
true if successful, false otherwise.

removeAssembly

public boolean removeAssembly(Assembly assembly)
Remove an assembly.

Parameters:
assembly - the specified assembly.
Returns:
true if successful, false otherwise.

renameAssembly

public boolean renameAssembly(String oname,
                              String nname,
                              boolean both)
Rename an assembly.

Parameters:
oname - the specified old assembly name.
nname - the specified new assembly name.
both - true to rename both assembly name and variable name, false to rename assembly name only.
Returns:
true if successful, false otherwise.

getGap

protected int getGap()
Get the gap between two assemblies.

Specified by:
getGap in class AbstractSheet
Returns:
the gap between two assemblies.

getSize

public Dimension getSize()
Get the size of the worksheet.

Specified by:
getSize in class AbstractSheet
Returns:
the size of the worksheet.

getDescription

public String getDescription()
Get the description of the worksheet.

Overrides:
getDescription in class AbstractSheet
Returns:
the description of the worksheet.

checkValidity

public void checkValidity()
                   throws Exception
Check if the worksheet is valid.

Specified by:
checkValidity in class AbstractSheet
Throws:
Exception

checkDependencies

public void checkDependencies()
                       throws InvalidDependencyException
Check if the dependencies are valid.

Specified by:
checkDependencies in class AbstractSheet
Throws:
InvalidDependencyException

replaceVariables

public void replaceVariables(VariableTable vars)
Replace all embeded user variables.

Parameters:
vars - the specified variable table.

getAllVariables

public UserVariable[] getAllVariables()
Get all variables in the condition value list.

Specified by:
getAllVariables in interface inetsoft.uql.asset.internal.VariableProvider
Returns:
the variable list.

getDependings

public AssemblyRef[] getDependings(AssemblyEntry entry)
Get the depending assemblies in a worksheet.

Parameters:
entry - the specified assembly entry.

update

public boolean update(AssetRepository rep,
                      AssetEntry entry,
                      Principal user)
Update this worksheet.

Specified by:
update in class AbstractSheet
Parameters:
rep - the specified asset repository.
entry - the specified entry stored in.
user - the specified principal.

update

public boolean update()
Update the references in worksheet.

Returns:
true if successful, false otherwise.

updateMirrors

public boolean updateMirrors(AssetRepository engine,
                             Principal user,
                             String rid)
Update the auto update outer mirrors in the worksheet.

Parameters:
engine - the specified asset repository.
user - the specified user.
rid - the specified report id.
Returns:
true if successful, false otherwise.

getOuterDependents

public AssetEntry[] getOuterDependents()
Get the outer dependents.

Specified by:
getOuterDependents in class AbstractSheet
Returns:
the outer dependents.

renameOuterDependent

public void renameOuterDependent(AssetEntry oentry,
                                 AssetEntry nentry)
Rename an outer dependent.

Specified by:
renameOuterDependent in class AbstractSheet
Parameters:
oentry - the specified old entry.
nentry - the specified new entry.

getOuterDependencies

public AssetEntry[] getOuterDependencies()
Get the outer dependencies.

Specified by:
getOuterDependencies in class AbstractSheet
Returns:
the outer dependencies.

addOuterDependency

public boolean addOuterDependency(AssetEntry entry)
Add an outer dependency.

Specified by:
addOuterDependency in class AbstractSheet
Parameters:
entry - the specified entry.
Returns:
true if successful, false otherwise.

removeOuterDependency

public boolean removeOuterDependency(AssetEntry entry)
Remove an outer dependency.

Specified by:
removeOuterDependency in class AbstractSheet
Parameters:
entry - the specified entry.
Returns:
true if successful, false otherwise.

removeOuterDependencies

public void removeOuterDependencies()
Remove all the outer dependencies.

Specified by:
removeOuterDependencies in class AbstractSheet

autoLayout

public void autoLayout()
Rearrange the assemblies into a tree like structure where the root is displayed on top, and children below, and so on.


reset

public void reset()
Reset the worksheet.

Specified by:
reset in class AbstractSheet

getDependeds

public AssemblyRef[] getDependeds(AssemblyEntry entry)
Get the assemblies depended on of an assembly in a sheet.

Specified by:
getDependeds in class AbstractSheet
Parameters:
entry - the specified assembly entry.

getDependeds

public AssemblyRef[] getDependeds(AssemblyEntry entry,
                                  boolean view,
                                  boolean out)
Get the assemblies depended on of an assembly in a viewsheet.

Specified by:
getDependeds in class AbstractSheet
Parameters:
entry - the specified assembly entry.
view - true to include view, false otherwise.
out - out to include out, false otherwise.

writeXML

public void writeXML(PrintWriter writer)
Write the xml segment to print writer.

Specified by:
writeXML in interface inetsoft.util.XMLSerializable
Parameters:
writer - the destination print writer.

writeContents

protected void writeContents(PrintWriter writer)
Write the content part(child node) of XML segment.


parseXML

public void parseXML(Element elem)
              throws Exception
Method to parse an xml segment.

Specified by:
parseXML in interface inetsoft.util.XMLSerializable
Parameters:
elem - the specified xml element.
Throws:
Exception

clone

public Object clone()
Clone the object.

Specified by:
clone in interface AssetObject
Overrides:
clone in class AbstractSheet
Returns:
the cloned object.

getCubeTableAssembly

public Assembly getCubeTableAssembly(String name)
Get cube table assembly.


isFrozen

public boolean isFrozen()
Check if this worksheet is frozen.


setOffline

public void setOffline(boolean offline)
Set it's offline worksheet or not.


isOffline

public boolean isOffline()
return if it's offline worksheet or not.


isShowWarning

public boolean isShowWarning()
return if show warning dialog after rename or not.


setShowWarning

public void setShowWarning(boolean w)
set show warning dialog after rename or not.


writeData

public void writeData(JarOutputStream out)
Write out data content in each assembly.

Overrides:
writeData in class AbstractSheet

dispose

public void dispose()
Dispose executing assembly.


addParseThread

public void addParseThread(Runnable runnable)
Add a thread to init parse emebedded data.

Parameters:
runnable - the parse thread.

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