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
public class GenericBootstrapPatch extends AbstractPatch
Generic patch that uses existingimportersto 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
Fields Modifier and Type Field Description protected java.util.PropertiesbootstrapViewprotected java.lang.StringcheckPathprotected static java.lang.StringERR_MULTIPLE_FOUNDprotected ImporterBootstrapimporterBootstrapprotected static java.lang.StringMSG_CREATEDprotected static java.lang.StringMSG_DEFERREDprotected static java.lang.StringMSG_EXISTS-
Fields 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 Constructor Description GenericBootstrapPatch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringapplyInternal()This method does the work.protected voidcheckProperties()Check that the schema version properties have been set appropriately.voidsetBootstrapView(java.util.Properties bootstrapView)voidsetCheckPath(java.lang.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 Detail
-
MSG_EXISTS
protected static final java.lang.String MSG_EXISTS
- See Also:
- Constant Field Values
-
MSG_CREATED
protected static final java.lang.String MSG_CREATED
- See Also:
- Constant Field Values
-
MSG_DEFERRED
protected static final java.lang.String MSG_DEFERRED
- See Also:
- Constant Field Values
-
ERR_MULTIPLE_FOUND
protected static final java.lang.String ERR_MULTIPLE_FOUND
- See Also:
- Constant Field Values
-
importerBootstrap
protected ImporterBootstrap importerBootstrap
-
checkPath
protected java.lang.String checkPath
-
bootstrapView
protected java.util.Properties bootstrapView
-
-
Method Detail
-
setImporterBootstrap
public void setImporterBootstrap(ImporterBootstrap importerBootstrap)
- Parameters:
importerBootstrap- the bootstrap bean that performs the user store bootstrap
-
setCheckPath
public void setCheckPath(java.lang.String checkPath)
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
public void setBootstrapView(java.util.Properties bootstrapView)
- Parameters:
bootstrapView- the bootstrap location- See Also:
ImporterBootstrap.setBootstrapViews(List)
-
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
protected java.lang.String applyInternal() throws java.lang.ExceptionDescription 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:
java.lang.Exception- anything can be thrown. This must be used for all failures.- See Also:
AbstractPatch.apply()
-
-