|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.extensions.DefaultFilter net.sf.basedb.clients.web.extensions.Settings
public class Settings
Class for keeping settings for the extensions system. Settings
are kept in the file WEB-INF/extensions/settings.xml
.
Extension points and extensions can be disabled/enabled by
enableExtensionPoint(String, boolean)
and
enableExtension(String, boolean)
.
This class also implements the ExtensionsFilter
interface, and can be used on the
Registry.useExtensions(net.sf.basedb.util.extensions.ClientContext, ExtensionsFilter, String...)
method. This means that disabling/enabling extensions and extension points
will immediately be visible in the web interface. Sorting is delegated
to the DefaultFilter
.
Field Summary | |
---|---|
private static String |
AUTO_INSTALL
|
private ExtensionsDirectory |
directory
|
private Presets.Preset |
disabledExtensionPoints
|
private Presets.Preset |
disabledExtensions
|
private File |
file
|
private boolean |
hasChanged
|
private Presets |
presets
|
private Presets.Preset |
settings
|
Fields inherited from class net.sf.basedb.util.extensions.DefaultFilter |
---|
INDEX_COMPARATOR_CTX, INDEX_COMPARATOR_EXT |
Constructor Summary | |
---|---|
Settings(ExtensionsDirectory directory,
File file)
Create a new Settings object. |
Method Summary | |
---|---|
void |
enableExtension(String extensionId,
boolean enable)
Enable/disable an extension. |
void |
enableExtensionPoint(String extensionPointId,
boolean enable)
Enable/disable an extension point. |
int |
getAutoInstall()
Get the interval, in seconds, between automatic checks for new/modified/deleted extensions. |
boolean |
isEnabled(Extension extension)
Check if an extension is enabled or disabled. |
boolean |
isEnabled(ExtensionPoint extensionPoint)
Check if an extension point is enabled or disabled. |
void |
save()
Save the settings to disk. |
void |
setAutoInstall(int autoInstall)
Change the interval, in seconds, between automatic checks for new/modified/deleted extensions. |
Methods inherited from class net.sf.basedb.util.extensions.DefaultFilter |
---|
sort |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.basedb.util.extensions.ExtensionsFilter |
---|
sort |
Field Detail |
---|
private static final String AUTO_INSTALL
private final ExtensionsDirectory directory
private final File file
private boolean hasChanged
private Presets presets
private Presets.Preset settings
private Presets.Preset disabledExtensions
private Presets.Preset disabledExtensionPoints
Constructor Detail |
---|
public Settings(ExtensionsDirectory directory, File file)
save()
is called. The settings file
must be an XML file that can be read by the Presets
class.
file
- The file to load/save settings inMethod Detail |
---|
public boolean isEnabled(ExtensionPoint extensionPoint)
ExtensionsFilter
isEnabled
in interface ExtensionsFilter
isEnabled
in class DefaultFilter
extensionPoint
- The extension point to check
public boolean isEnabled(Extension extension)
ExtensionsFilter
isEnabled
in interface ExtensionsFilter
isEnabled
in class DefaultFilter
extension
- The extension to check
public void enableExtension(String extensionId, boolean enable)
extensionId
- The ID of the extension to enable/disableenable
- TRUE to enable the extension, FALSE to disable itpublic void enableExtensionPoint(String extensionPointId, boolean enable)
extensionPointId
- The ID of the extension point to enable/disableenable
- TRUE to enable the extension point, FALSE to disable itpublic int getAutoInstall()
public void setAutoInstall(int autoInstall)
autoInstall
- The interval in seconds, or 0 to disable the
featurepublic void save()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |