Class cern.lhcias.csgui.Services.configurationMgr
java.lang.Object
|
+----cern.lhcias.csgui.Services.configurationMgr
- public class configurationMgr
- extends Object
This class handles all the configurations of the TagsView and the windows which
contains them. A "window configuration" contains the description of the window
itself, the type of the TagsView to create, a "TagsView configuration" and
informations on how to instanciate the TagsView. It can also be a set of "window
configurations", thus enabling to load multiple windows with a single action. A list
of window configurations is maintened on the server. To each window configuration is
associated a name. This list may be retrieved with the method loadWindowConfigurationList
. It is possible to add a new window configuration to this list using the
publishWindowConfiguration method. A TagsView configuration is, depending on the TagsView,
either a String or a pointer (such as an URL) to a remote configuration file. This
TagsView configuration will be passed to the TagsView upon creation. If it is a pointer to
a remote configuration file, it is up to the TagsView to load the configuration file. This
can be done using the loadConfigurationFile method. The TagsViews can use
saveConfigurationFile to save their configurations. If the TagsView uses the
loadInitConfigurationFile method to load a configuration file, then the initializations of
the tags in the real-time database and the initializations of the dataservers will be done
automatically before returning. This implies that the configuration file uses the standard
way of defining tags and dataservers. This implementation uses a Web server and a set of
remote programs to offer the service.
DATASERVER
- String used in configuration files to define lines which contain some DataServers'
configuration.
DBCONFIG
- String used as the ViewType name of DataBase configuration files.
INCLUDE
- statement used in configuration files to include other configuration files.
TAGDEF
- String used in configuration files to define lines which contain some tags'
configuration.
configurationMgr(String,
String, String, TagArrays, CentralManager)
-
addOpenViewListener(OpenViewListener)
-
initDataBase(String)
- This method reads the configuration file config and search for lines starting with
TAGDEF.
initDataServers(String)
- This method reads the configuration file config and search for lines starting with
DATASERVER.
loadConfigurationFile(String)
- Loads the configuration file named configName.
loadIncSubstConfigurationFile(String,
Vector, boolean, boolean)
- Loads the configuration file located at "adresse" and returns a Vector of
Strings representing the content of the file.
loadInitConfigurationFile(String)
- Loads a configuration file and initialize all Tags and DataServers found in it before
returning the configuration.
loadWindowConfigurationList()
- loads the list of window configurations in a Vector, in the following way: name1,window
conf1,name2,window conf2,...
openMultipleViews(String,
Vector, boolean)
- Given a configuration description, it opens the correct TagsView(s).
openView(String, boolean)
- Given a configuration description, it opens the correct TagsView.
publishWindowConfiguration(TagsView,
String)
- Adds the configuration of a TagsView in the list of known configurations together with
windowing information (current size of tv).
removeOpenViewListener(OpenViewListener)
-
saveConfigurationFile(String,
String[])
- Saves a configuration file on a Web server.

TAGDEF
public static final String TAGDEF
- String used in configuration files to define lines which contain some tags'
configuration.

DBCONFIG
public static final String DBCONFIG
- String used as the ViewType name of DataBase configuration files.

DATASERVER
public static final String DATASERVER
- String used in configuration files to define lines which contain some DataServers'
configuration.

INCLUDE
public static final String INCLUDE
- statement used in configuration files to include other configuration files.

configurationMgr
public configurationMgr(String postCGIPg,
String PublishURL,
String ConfigurationList,
TagArrays ta,
CentralManager cm)
- Parameters:
- postCGIPg - the URL of the pg needed to save the configuration file.
- PublishURL - the URL of the pg needed to add a window configuration.
- ConfigurationList - the URL of the list of window configurations.
- ta - the TagArrays used to store the Tags.

addOpenViewListener
public synchronized void addOpenViewListener(OpenViewListener listener)

removeOpenViewListener
public synchronized void removeOpenViewListener(OpenViewListener listener)

loadConfigurationFile
public Vector loadConfigurationFile(String configName)
- Loads the configuration file named configName. Here, it is assumed that the configName
is a URL. So it reads the file located at the URL configName and returns the content in a
Vector.

loadInitConfigurationFile
public Vector loadInitConfigurationFile(String configName)
- Loads a configuration file and initialize all Tags and DataServers found in it before
returning the configuration. It calls initDataServers and initDataBase

loadIncSubstConfigurationFile
public Vector loadIncSubstConfigurationFile(String adresse,
Vector Values,
boolean recurse,
boolean toEvaluate)
- Loads the configuration file located at "adresse" and returns a Vector of
Strings representing the content of the file. If the vector Values is not null, it will
substitue parts of the file according to what is described in the vector (see method
substitutes). If recurse is set to true, then recursive reading is done for the lines
which starts with recurseHeader. The following syntax is assumed: recurseHeader
original_substring1 substringToReplace1 original_substring2 substringToReplace2 ... If
toEvaluate is true then the method will try to evaluate encountered expressions. It also
calls initDataServers and initDataBase

saveConfigurationFile
public String saveConfigurationFile(String configName,
String configLines[])
- Saves a configuration file on a Web server. If configName is null and is "",
then a name will be created for this configuration. The correct configName is returned to
the calling method.

publishWindowConfiguration
public void publishWindowConfiguration(TagsView tv,
String confName)
- Adds the configuration of a TagsView in the list of known configurations together with
windowing information (current size of tv).

initDataBase
public void initDataBase(String config)
- This method reads the configuration file config and search for lines starting with
TAGDEF. When it encounters such a line, it sends the remaining part of the line to
TagArrays.addConfig()

initDataServers
public void initDataServers(String config)
- This method reads the configuration file config and search for lines starting with
DATASERVER. When it encounters such a line, it sends the remaining part of the line to
CentralManager.setDataServer()

openMultipleViews
public void openMultipleViews(String config,
Vector configurations,
boolean newWindow)
- Given a configuration description, it opens the correct TagsView(s). If config is a
configuration of type "MultipleWindows", then the different TagsViews are
created.
- Parameters:
- config - the configuration description
- configurations - the list of configurations (names + descriptions) as loaded by
loadConfigurationList()
- newWindow - if true, then TagsView is created in a new window.

openView
public void openView(String config,
boolean newWindow)
- Given a configuration description, it opens the correct TagsView.
- Parameters:
- config - the configuration description
- newWindow - if true, then TagsView is created in a new window.

loadWindowConfigurationList
public Vector loadWindowConfigurationList()
- loads the list of window configurations in a Vector, in the following way: name1,window
conf1,name2,window conf2,...