Class GenericBootstrapPatch
java.lang.Object
org.alfresco.repo.admin.patch.AbstractPatch
org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch
- All Implemented Interfaces:
Patch,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationEventPublisherAware
- Direct Known Subclasses:
SharedFolderPatch
Generic patch that uses existing
importers to import snippets into the system. These snippets would otherwise have been bootstrapped by a clean install.
By providing this class with a bootstrap view and an importer, it can check whether the path exists and perform the import if it doesn't.
- Author:
- Derek Hulley
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Propertiesprotected Stringprotected static final Stringprotected ImporterBootstrapprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class org.alfresco.repo.admin.patch.AbstractPatch
applicationEventPublisher, authenticationContext, ERR_PROPERTY_NOT_SET, namespaceService, nodeService, patchService, searchService, tenantAdminService, transactionHelper, transactionService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringThis method does the work.protected voidCheck that the schema version properties have been set appropriately.voidsetBootstrapView(Properties bootstrapView) voidsetCheckPath(String checkPath) Set the XPath statement that must be executed to check whether the import data is already present or not.voidsetImporterBootstrap(ImporterBootstrap importerBootstrap) Methods inherited from class org.alfresco.repo.admin.patch.AbstractPatch
applies, apply, applyAsync, checkPropertyNotNull, getAlternatives, getDependsOn, getDescription, getFixesFromSchema, getFixesToSchema, getId, getTargetSchema, init, isDeferred, isForce, isIgnored, reportProgress, requiresTransaction, setAlternatives, setApplicationEventPublisher, setApplyToTenants, setAuthenticationContext, setDeferred, setDependsOn, setDescription, setFixesFromSchema, setFixesToSchema, setForce, setId, setIgnored, setNamespaceService, setNodeService, setPatchService, setRequiresTransaction, setSearchService, setTargetSchema, setTenantAdminService, setTransactionService, toString
-
Field Details
-
MSG_EXISTS
- See Also:
-
MSG_CREATED
- See Also:
-
MSG_DEFERRED
- See Also:
-
ERR_MULTIPLE_FOUND
- See Also:
-
importerBootstrap
-
checkPath
-
bootstrapView
-
-
Constructor Details
-
GenericBootstrapPatch
public GenericBootstrapPatch()
-
-
Method Details
-
setImporterBootstrap
- Parameters:
importerBootstrap- the bootstrap bean that performs the user store bootstrap
-
setCheckPath
Set the XPath statement that must be executed to check whether the import data is already present or not.- Parameters:
checkPath- an XPath statement
-
setBootstrapView
- Parameters:
bootstrapView- the bootstrap location- See Also:
-
checkProperties
protected void checkProperties()Description copied from class:AbstractPatchCheck that the schema version properties have been set appropriately. Derived classes can override this method to perform their own validation provided that this method is called by the derived class.- Overrides:
checkPropertiesin classAbstractPatch
-
applyInternal
Description copied from class:AbstractPatchThis method does the work. All transactions and thread-safety will be taken care of by this class. Any exception will result in the transaction being rolled back. Integrity checks are downgraded for the duration of the transaction.- Specified by:
applyInternalin classAbstractPatch- Returns:
- Returns the report (only success messages).
- Throws:
Exception- anything can be thrown. This must be used for all failures.- See Also:
-