|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.AbstractWabitObject
ca.sqlpower.wabit.WabitWorkspace
public class WabitWorkspace
The WabitWorkspace is the root WabitObject of a WabitSession. It directly corresponds with the root workspace node in the XML representation of a Wabit workspace. It belongs to exactly one WabitSession.
| Nested Class Summary | |
|---|---|
static class |
WabitWorkspace.WabitObjectOrder
FIXME This enum defines the WabitObject child classes a
WabitWorkspace takes as well as the ordinal order of these child
classes such that the class going before does not depend on the class
that goes after. |
| Field Summary | |
|---|---|
static java.lang.String |
SYSTEM_WORKSPACE_UUID
A workspace with this uuid is a system workspace. |
| Fields inherited from interface ca.sqlpower.sql.DataSourceCollection |
|---|
DOS_CR_LF |
| Constructor Summary | |
|---|---|
WabitWorkspace()
Creates a new Wabit workspace. |
|
| Method Summary | ||
|---|---|---|
void |
addChart(Chart chart)
|
|
void |
addChart(Chart chart,
int index)
|
|
protected void |
addChildImpl(WabitObject child,
int index)
This is the object specific implementation of #addChild(WabitObject). |
|
void |
addDatabaseListChangeListener(ca.sqlpower.sql.DatabaseListChangeListener l)
|
|
void |
addDataSource(ca.sqlpower.sql.SPDataSource dbcs)
|
|
void |
addDataSource(WabitDataSource ds)
|
|
void |
addDataSource(WabitDataSource ds,
int index)
|
|
void |
addDataSourceType(ca.sqlpower.sql.JDBCDataSourceType dataSourceType)
|
|
void |
addGroup(Group g)
|
|
void |
addGroup(Group g,
int index)
|
|
void |
addImage(WabitImage image)
|
|
void |
addImage(WabitImage image,
int index)
|
|
void |
addOlapQuery(OlapQuery newQuery)
|
|
void |
addOlapQuery(OlapQuery newQuery,
int index)
|
|
void |
addQuery(QueryCache query,
WabitSession session)
|
|
void |
addQuery(QueryCache query,
WabitSession session,
int index)
|
|
void |
addReport(Report report)
|
|
void |
addReport(Report report,
int index)
|
|
void |
addReportTask(ReportTask task)
|
|
void |
addReportTask(ReportTask task,
int index)
|
|
void |
addTemplate(Template template)
|
|
void |
addTemplate(Template template,
int index)
|
|
void |
addUndoableEditListener(javax.swing.event.UndoableEditListener l)
|
|
void |
addUser(User u)
|
|
void |
addUser(User u,
int index)
|
|
boolean |
allowsChildren()
Returns true if this object may contain children. |
|
int |
childPositionOffset(java.lang.Class<? extends WabitObject> childType)
Returns the position in the list that would be returned by getChildren() that the first object of type childClass is, or where it would be if there were any children of that type. |
|
boolean |
dsAlreadyAdded(ca.sqlpower.sql.SPDataSource dbcs)
|
|
|
findByUuid(java.lang.String uuid,
java.lang.Class<T> expectedType)
Locates the WabitObject inside this workspace which has the given UUID, returning null if the item is not found. |
|
java.util.List<Chart> |
getCharts()
|
|
java.util.List<WabitObject> |
getChildren()
Returns an unmodifiable list of the children in this WabitObject. |
|
java.util.List<ca.sqlpower.sql.SPDataSource> |
getConnections()
|
|
|
getConnections(java.lang.Class<C> classType)
|
|
ca.sqlpower.sql.SPDataSource |
getDataSource(java.lang.String name)
|
|
|
getDataSource(java.lang.String name,
java.lang.Class<C> classType)
|
|
java.util.List<WabitDataSource> |
getDataSources()
Returns an unmodifiable view of the data sources in this workspace. |
|
java.util.List<ca.sqlpower.sql.JDBCDataSourceType> |
getDataSourceTypes()
|
|
java.util.List<WabitObject> |
getDependencies()
Returns a list of all WabitObjects that this Wabit object is
dependent on. |
|
WabitObject |
getEditorPanelModel()
|
|
java.util.List<Group> |
getGroups()
|
|
java.util.List<WabitImage> |
getImages()
|
|
java.util.List<OlapQuery> |
getOlapQueries()
|
|
WabitObject |
getParent()
Returns the parent of this WabitObject. |
|
java.util.List<QueryCache> |
getQueries()
|
|
Report |
getReportByName(java.lang.String name)
Returns the first Report child having the given name, or null if no reports have the requested name. |
|
java.util.List<Report> |
getReports()
|
|
java.util.List<ReportTask> |
getReportTasks()
|
|
java.net.URI |
getServerBaseURI()
|
|
WabitSession |
getSession()
Helper method to find the session of a WabitObject. |
|
java.util.List<Template> |
getTemplates()
|
|
java.util.List<User> |
getUsers()
|
|
boolean |
isMagicDisabled()
|
|
boolean |
isServerWorkspace()
|
|
boolean |
isSystemWorkspace()
|
|
void |
mergeDataSource(ca.sqlpower.sql.SPDataSource dbcs)
|
|
void |
mergeDataSourceType(ca.sqlpower.sql.JDBCDataSourceType dst)
|
|
int |
mergeIntoWorkspace(WabitWorkspace workspace)
This method will merge all of the objects in this workspace into the given workspace. |
|
void |
read(java.io.File location)
|
|
void |
read(java.io.InputStream inStream)
|
|
protected boolean |
removeChildImpl(WabitObject child)
This is the object specific implementation of removeChild. |
|
void |
removeDatabaseListChangeListener(ca.sqlpower.sql.DatabaseListChangeListener l)
|
|
void |
removeDataSource(ca.sqlpower.sql.SPDataSource dbcs)
|
|
boolean |
removeDataSourceType(ca.sqlpower.sql.JDBCDataSourceType dataSourceType)
|
|
void |
removeDependency(WabitObject dependency)
Removes the given object as a dependency of this object. |
|
boolean |
removeGroup(Group g)
|
|
boolean |
removeReportTask(ReportTask task)
|
|
void |
removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
|
|
boolean |
removeUser(User u)
|
|
void |
setEditorPanelModel(WabitObject editorPanelModel)
|
|
void |
setMagicDisabled(boolean magicDisabled)
|
|
void |
setServerBaseURI(java.net.URI serverBaseURI)
|
|
void |
setSession(WabitSession session)
Sets the session which this workspace belongs to. |
|
void |
write()
DataSourceCollection interface method which is currently not supported. |
|
void |
write(java.io.File location)
DataSourceCollection interface method which is currently not supported. |
|
void |
write(java.io.OutputStream out)
DataSourceCollection interface method which is currently not supported. |
|
| Methods inherited from class ca.sqlpower.wabit.AbstractWabitObject |
|---|
addChild, addWabitListener, begin, beginTransaction, cleanup, commit, commitTransaction, equals, fireChildAdded, fireChildRemoved, firePropertyChange, firePropertyChange, firePropertyChange, fireTransactionEnded, fireTransactionRollback, fireTransactionStarted, generateNewUUID, getChildren, getName, getUUID, isForegroundThread, removeChild, removeWabitListener, rollback, rollbackTransaction, runInBackground, runInForeground, setName, setParent, setUUID, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ca.sqlpower.sql.DataSourceCollection |
|---|
toString |
| Field Detail |
|---|
public static final java.lang.String SYSTEM_WORKSPACE_UUID
| Constructor Detail |
|---|
public WabitWorkspace()
| Method Detail |
|---|
public java.util.List<WabitObject> getChildren()
WabitObject
getChildren in interface WabitObjectpublic void setSession(WabitSession session)
This setter does not fire an event because it is not supposed to be called after the workspace has been initialized.
session - The session this workspace belongs to.public WabitSession getSession()
AbstractWabitObject
getSession in class AbstractWabitObjectpublic void addDataSource(WabitDataSource ds)
public void addDataSource(WabitDataSource ds,
int index)
public java.util.List<WabitDataSource> getDataSources()
TODO change this to List<WabitDataSource> getDatabases()
public void addQuery(QueryCache query,
WabitSession session)
public void addQuery(QueryCache query,
WabitSession session,
int index)
public void addTemplate(Template template)
public void addTemplate(Template template,
int index)
public void addReport(Report report)
public void addReport(Report report,
int index)
public void addImage(WabitImage image)
public void addImage(WabitImage image,
int index)
public java.util.List<WabitImage> getImages()
public void addChart(Chart chart)
public void addChart(Chart chart,
int index)
public java.util.List<Chart> getCharts()
public int childPositionOffset(java.lang.Class<? extends WabitObject> childType)
WabitObject
childPositionOffset in interface WabitObjectpublic java.util.List<QueryCache> getQueries()
public java.util.List<Report> getReports()
public java.util.List<Template> getTemplates()
public Report getReportByName(java.lang.String name)
name - The name to search. If null, null will be returned.public void addUser(User u)
public void addUser(User u,
int index)
public boolean removeUser(User u)
public java.util.List<User> getUsers()
public void addGroup(Group g)
public void addGroup(Group g,
int index)
public boolean removeGroup(Group g)
public java.util.List<Group> getGroups()
public void addReportTask(ReportTask task)
public void addReportTask(ReportTask task,
int index)
public boolean removeReportTask(ReportTask task)
public java.util.List<ReportTask> getReportTasks()
public boolean isSystemWorkspace()
public WabitObject getParent()
WabitObjectWabitObject
tree.
getParent in interface WabitObjectgetParent in class AbstractWabitObjectpublic boolean allowsChildren()
WabitObject
allowsChildren in interface WabitObjectWabitObject.childPositionOffset(Class)public void addDataSource(ca.sqlpower.sql.SPDataSource dbcs)
addDataSource in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public boolean dsAlreadyAdded(ca.sqlpower.sql.SPDataSource dbcs)
public void removeDataSource(ca.sqlpower.sql.SPDataSource dbcs)
removeDataSource in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public void addDataSourceType(ca.sqlpower.sql.JDBCDataSourceType dataSourceType)
addDataSourceType in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public void addDatabaseListChangeListener(ca.sqlpower.sql.DatabaseListChangeListener l)
addDatabaseListChangeListener in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public java.util.List<ca.sqlpower.sql.SPDataSource> getConnections()
getConnections in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public <C extends ca.sqlpower.sql.SPDataSource> java.util.List<C> getConnections(java.lang.Class<C> classType)
getConnections in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public ca.sqlpower.sql.SPDataSource getDataSource(java.lang.String name)
getDataSource in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>
public <C extends ca.sqlpower.sql.SPDataSource> C getDataSource(java.lang.String name,
java.lang.Class<C> classType)
getDataSource in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public java.util.List<ca.sqlpower.sql.JDBCDataSourceType> getDataSourceTypes()
getDataSourceTypes in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public void mergeDataSource(ca.sqlpower.sql.SPDataSource dbcs)
mergeDataSource in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public void mergeDataSourceType(ca.sqlpower.sql.JDBCDataSourceType dst)
mergeDataSourceType in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>
public void read(java.io.File location)
throws java.io.IOException
read in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>java.io.IOException
public void read(java.io.InputStream inStream)
throws java.io.IOException
read in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>java.io.IOExceptionpublic boolean removeDataSourceType(ca.sqlpower.sql.JDBCDataSourceType dataSourceType)
removeDataSourceType in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public java.net.URI getServerBaseURI()
getServerBaseURI in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public void setServerBaseURI(java.net.URI serverBaseURI)
public void removeDatabaseListChangeListener(ca.sqlpower.sql.DatabaseListChangeListener l)
removeDatabaseListChangeListener in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>
public void write()
throws java.io.IOException
write in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>java.io.IOException
public void write(java.io.File location)
throws java.io.IOException
write in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>java.io.IOException
public void write(java.io.OutputStream out)
throws java.io.IOException
write in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>java.io.IOExceptionpublic void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
addUndoableEditListener in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
removeUndoableEditListener in interface ca.sqlpower.sql.DataSourceCollection<ca.sqlpower.sql.SPDataSource>public void setEditorPanelModel(WabitObject editorPanelModel)
public WabitObject getEditorPanelModel()
public void addOlapQuery(OlapQuery newQuery)
public void addOlapQuery(OlapQuery newQuery,
int index)
public java.util.List<OlapQuery> getOlapQueries()
public void removeDependency(WabitObject dependency)
WabitObject
removeDependency in interface WabitObjectpublic java.util.List<WabitObject> getDependencies()
WabitObjectWabitObjects that this Wabit object is
dependent on. Children of a WabitObject are not dependencies and will not
be returned in this list. If there are no objects this Wabit object is
dependent on an empty list should be returned. These are only the
immediate dependencies of this object. If you want to find the
dependencies of this object's dependencies as well it may be useful to
look at WorkspaceGraphModel to make a full graph of all of the
dependencies.
getDependencies in interface WabitObject
public <T extends WabitObject> T findByUuid(java.lang.String uuid,
java.lang.Class<T> expectedType)
T - The expected type of the itemuuid - The UUID of the itemexpectedType - The type of the item with the given UUID. If you are uncertain
what type of object it is, or you do not want a
ClassCastException in case the item is of the wrong type, use
WabitObject.class for this parameter.
protected boolean removeChildImpl(WabitObject child)
AbstractWabitObject
removeChildImpl in class AbstractWabitObjectAbstractWabitObject.removeChild(WabitObject)
protected void addChildImpl(WabitObject child,
int index)
AbstractWabitObject#addChild(WabitObject). There are checks in the
#addChild(WabitObject) method to ensure that the object given
here is a valid child type of this object.
This method should be overwritten if children are allowed.
addChildImpl in class AbstractWabitObjectchild - The child to add to this object.index - The index to add the child at.public int mergeIntoWorkspace(WabitWorkspace workspace)
workspace - The workspace to move all of the current workspace's children
into.
public boolean isServerWorkspace()
public boolean isMagicDisabled()
public void setMagicDisabled(boolean magicDisabled)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||