Class VersionsRootHelper
java.lang.Object
org.ametys.plugins.repository.migration.jcr.VersionsRootHelper
- All Implemented Interfaces:
Component
,Serviceable
A helper for the root versions object.
-
Field Summary
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
The Ametys object resolverstatic final String
Avalon Role -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet or create the root object to store versions.boolean
true
if the repository has registered plugins.boolean
true
if the root object to store versions is present.boolean
isAKnownPlugin
(String plugin) true
if the repository has already been launched with this plugin before.void
service
(ServiceManager manager) void
Update the plugin names in the root versions object.
-
Field Details
-
ROLE
Avalon Role -
_resolver
The Ametys object resolver
-
-
Constructor Details
-
VersionsRootHelper
public VersionsRootHelper()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
hasRootObject
true
if the root object to store versions is present. It's the node /ametys:versions.- Returns:
true
if the root object to store versions is present, otherwisefalse
.- Throws:
AmetysRepositoryException
- if an error occurs
-
getRootObject
Get or create the root object to store versions. It's the node /ametys:versions.- Returns:
- the root object to store versions
- Throws:
AmetysRepositoryException
- if an error occurs
-
hasKnownPlugins
true
if the repository has registered plugins. Read the attribute /ametys:versions/@ametys:knownPlugins.- Returns:
true
if there is at least one registered plugin
-
isAKnownPlugin
true
if the repository has already been launched with this plugin before. Read the attribute /ametys:versions/@ametys:knownPlugins.- Parameters:
plugin
- the name of the plugin- Returns:
true
if the plugin is already known
-
updateKnownPlugins
Update the plugin names in the root versions object. Write the attribute /ametys:versions/@ametys:knownPlugins. Make sure not to "forget" plugins that are not here anymore, for example if we are in safe mode, there can be less plugins and that might cause problem if some extensions have failOnOldData.
-