ca.sqlpower.architect
Interface ArchitectSession

All Superinterfaces:
UserPrompterFactory
All Known Subinterfaces:
ArchitectSwingSession
All Known Implementing Classes:
ArchitectSessionImpl, ArchitectSwingSessionImpl

public interface ArchitectSession
extends UserPrompterFactory


Field Summary
static java.lang.String PREFS_PL_INI_PATH
           
 
Method Summary
 UserPrompter createUserPrompter(java.lang.String question, java.lang.String okText, java.lang.String notOkText, java.lang.String cancelText)
          Creates a new user prompter instance with the given settings.
 ArchitectSessionContext getContext()
          Returns the context that created this session.
 DDLGenerator getDDLGenerator()
          The DDL Generator currently in use for this session.
 java.lang.String getName()
          Gets the value of name
 OLAPRootObject getOLAPRootObject()
          Returns the OLAP root object, which contains all the OLAP sessions that are part of this Architect session.
 ProfileManager getProfileManager()
           
 CoreProject getProject()
          Returns the project associated with this session.
 SQLObjectRoot getRootObject()
          Returns the top level object in the SQLObject hierarchy.
 SQLDatabase getTargetDatabase()
          Returns the database in use for this session.
 void setDDLGenerator(DDLGenerator generator)
          Sets the new DDL Generator currently in use for this session.
 void setName(java.lang.String argName)
          Sets the value of name
 void setProject(CoreProject project)
          This method is only used to create the correct type of project for an ArchitectSwingSessionImpl and should not be called anywhere else.
 void setSourceDatabaseList(java.util.List<SQLDatabase> databases)
          Replaces the entire list of source databases for this session.
 

Field Detail

PREFS_PL_INI_PATH

static final java.lang.String PREFS_PL_INI_PATH
See Also:
Constant Field Values
Method Detail

getProfileManager

ProfileManager getProfileManager()

getContext

ArchitectSessionContext getContext()
Returns the context that created this session.


getTargetDatabase

SQLDatabase getTargetDatabase()
Returns the database in use for this session. In a gui session, this would be the playpen database.


getRootObject

SQLObjectRoot getRootObject()
Returns the top level object in the SQLObject hierarchy. It has no parent and its children are SQLDatabase's.


setName

void setName(java.lang.String argName)
Sets the value of name

Parameters:
argName - Value to assign to this.name

getName

java.lang.String getName()
Gets the value of name

Returns:
the value of name

getProject

CoreProject getProject()
Returns the project associated with this session. The project holds the playpen objects, and can save and load itself in an XML format.


setProject

void setProject(CoreProject project)
This method is only used to create the correct type of project for an ArchitectSwingSessionImpl and should not be called anywhere else.


setSourceDatabaseList

void setSourceDatabaseList(java.util.List<SQLDatabase> databases)
                           throws ArchitectException
Replaces the entire list of source databases for this session. This method is used reflectively by the code that does loading and saving, so DON'T DELETE THIS METHOD even if it looks like it's unused.

Parameters:
databases -
Throws:
ArchitectException

getDDLGenerator

DDLGenerator getDDLGenerator()
The DDL Generator currently in use for this session.


setDDLGenerator

void setDDLGenerator(DDLGenerator generator)
Sets the new DDL Generator currently in use for this session.


createUserPrompter

UserPrompter createUserPrompter(java.lang.String question,
                                java.lang.String okText,
                                java.lang.String notOkText,
                                java.lang.String cancelText)
Description copied from interface: UserPrompterFactory
Creates a new user prompter instance with the given settings. User prompter instances can be stateful (for example, an "always accept" button will cause that prompter to continue returning "OK" forever), so it is important to obtain a new user prompter from this factory for every overall operation.

Specified by:
createUserPrompter in interface UserPrompterFactory
Parameters:
question - The question the new prompter will pose when solociting a response from the user. This question string is not exactly plain text: it is formatted according to to rules laid out in the MessageFormat class. The most important implications are that the single quote (') character and the open curly brace ({) characters are special and have to be escaped in order to appear in the message. The other important thing (the benefit, that is) is that constructions of the form {0} are placeholders that will be substituted every time the question is asked via the UserPrompter.promptUser(Object[]) method is called. See MessageFormat for details.

Also, UserPrompter implementations will ensure that newline characters (\n) show up as new lines when the question is presented to the user.

okText - The text to associate with the OK response. Try to use a word or phrase from the question instead of a generic word like "OK" or "Yes".
notOkText - The text to associate with the "not OK" response. Try to use a word or phrase from the question instead of a generic word like "No".
cancelText - The text to associate with response that cancels the whole operation.

getOLAPRootObject

OLAPRootObject getOLAPRootObject()
Returns the OLAP root object, which contains all the OLAP sessions that are part of this Architect session.

Note: We would prefer not to let ArchitectSession reference anything in the OLAP editor, since we do not want the core Architect API to include OLAP support. We are currently trying to come up with a way to put this somewhere else.



Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca