2.17.2: 2011-06-17

net.sf.basedb.util
Class PluginConfigInfo

java.lang.Object
  extended by net.sf.basedb.util.PluginConfigInfo

public class PluginConfigInfo
extends Object

This class should be used to keep information about a plugin configuration that is loaded from an XML-file. It has a useful method to get all PlguinConfigInfo from an XML-document for a certain plugin.

Version:
2.5
Author:
martin

Field Summary
private  String description
          Description about the configuration
private  boolean exists
           
private  String name
          The name of the configuration
private  int orderInXml
          In which place the configuration comes in the file.
private  String pluginClass
          The plugin the configuration can be use with
 
Constructor Summary
PluginConfigInfo(String pluginClassName, String configName, String descr)
          Constructor to create a new instance with information for a plugin configuration.
 
Method Summary
 void checkInstallation(DbControl dc)
          Check the database if a configuration with the same name is already installed or not.
 boolean exists()
          If plug-in configuration with the same name already exists or not.
 String getDescription()
          Gets the description of the configuration
 String getName()
          Gets the configuration's name
 int getOrderInXml()
          Gets in wich order the configuration comes in the import file.
 String getPluginClass()
          Gets the class name of the plugin that this configuration is ment for
static List<PluginConfigInfo> loadConfigurationsForPlugin(Document doc, String pluginClassName)
          Loads PluginConfigInfo objects from xml-document for a plugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pluginClass

private String pluginClass
The plugin the configuration can be use with


name

private String name
The name of the configuration


description

private String description
Description about the configuration


orderInXml

private int orderInXml
In which place the configuration comes in the file. This is <0 if it hasn't been defined.


exists

private boolean exists
Constructor Detail

PluginConfigInfo

public PluginConfigInfo(String pluginClassName,
                        String configName,
                        String descr)
Constructor to create a new instance with information for a plugin configuration.

Parameters:
pluginClassName - The class name of PluginDefinition this configuration belongs to, seePluginConfiguration.getPluginDefinition()
configName - Name of the plugin configuration, seeCommonItem.getName()
descr - Description about the configuration see CommonItem.getDescription()
Method Detail

loadConfigurationsForPlugin

public static List<PluginConfigInfo> loadConfigurationsForPlugin(Document doc,
                                                                 String pluginClassName)
Loads PluginConfigInfo objects from xml-document for a plugin.

Parameters:
doc - The xml-document
pluginClassName - The specific
Returns:
A list with PluginConfigInfo or, null if no configurations were found in the file.

getPluginClass

public String getPluginClass()
Gets the class name of the plugin that this configuration is ment for

Returns:
String plugin class name.

getName

public String getName()
Gets the configuration's name

Returns:
String name

getDescription

public String getDescription()
Gets the description of the configuration

Returns:
String description

getOrderInXml

public int getOrderInXml()
Gets in wich order the configuration comes in the import file.

Returns:
Returns order/position in the xml file or <0 if not defined.

checkInstallation

public void checkInstallation(DbControl dc)
Check the database if a configuration with the same name is already installed or not. This method should be called before exists() is called.

Parameters:
dc - An open DbControl
Since:
2.9

exists

public boolean exists()
If plug-in configuration with the same name already exists or not. Before calling this method, checkInstallation(DbControl) must be called.

Returns:
TRUE if a configuration exists
Since:
2.9

2.17.2: 2011-06-17