Package org.alfresco.repo.importer
Class ImporterBootstrap
- java.lang.Object
-
- org.springframework.extensions.surf.util.AbstractLifecycleBean
-
- org.alfresco.repo.importer.ImporterBootstrap
-
- All Implemented Interfaces:
java.util.EventListener,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
public class ImporterBootstrap extends org.springframework.extensions.surf.util.AbstractLifecycleBeanBootstrap Repository store.- Author:
- David Caruana
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVIEW_CHILDASSOCTYPE_PROPERTYstatic java.lang.StringVIEW_ENCODINGstatic java.lang.StringVIEW_LOCATION_VIEWstatic java.lang.StringVIEW_MESSAGES_PROPERTYstatic java.lang.StringVIEW_PATH_PROPERTYstatic java.lang.StringVIEW_UUID_BINDING
-
Constructor Summary
Constructors Constructor Description ImporterBootstrap()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddBootstrapViews(java.util.List<java.util.Properties> bootstrapViews)Sets the bootstrap viewsvoidbootstrap()Bootstrap the Repositoryjava.util.PropertiesgetConfiguration()Gets the Configuration values for binding place holdersstatic java.io.FilegetFile(java.lang.String view)Get a File representation of an XML viewjava.lang.StringgetLocale()Get Localeorg.alfresco.service.cmr.repository.StoreRefgetStoreRef()Gets the Store ReferencebooleanhasPerformedBootstrap()Determine if bootstrap was performed?protected voidonBootstrap(org.springframework.context.ApplicationEvent event)protected voidonShutdown(org.springframework.context.ApplicationEvent event)voidsetAllowWrite(boolean write)Set whether we write or notvoidsetAuthenticationContext(AuthenticationContext authenticationContext)Set the authentication componentvoidsetBootstrapViews(java.util.List<java.util.Properties> bootstrapViews)Sets the bootstrap viewsvoidsetConfiguration(java.util.Properties configuration)Sets the Configuration values for binding place holdersvoidsetImporterService(ImporterService importerService)Sets the importer servicevoidsetLocale(java.lang.String locale)Sets the LocalevoidsetLog(boolean logEnabled)Deprecated.Was never usedvoidsetMustNotExistStoreUrls(java.util.List<java.lang.String> storeUrls)If any of the store urls exist, the bootstrap does not take placevoidsetNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)Sets the namespace servicevoidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)Sets the node servicevoidsetRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)Sets the retrying transaction helper specific to the importer bootstrap.voidsetStoreUrl(java.lang.String storeUrl)Sets the Store Ref to bootstrap intovoidsetTransactionService(TransactionService transactionService)Sets the Transaction ServicevoidsetUseExistingStore(boolean useExistingStore)Set whether the importer bootstrap should only perform an import if the store being referenced doesn't already exist.voidsetUuidBinding(ImporterBinding.UUID_BINDING uuidBinding)Set the behaviour for generating UUIDs in the import.
-
-
-
Field Detail
-
VIEW_PATH_PROPERTY
public static final java.lang.String VIEW_PATH_PROPERTY
- See Also:
- Constant Field Values
-
VIEW_CHILDASSOCTYPE_PROPERTY
public static final java.lang.String VIEW_CHILDASSOCTYPE_PROPERTY
- See Also:
- Constant Field Values
-
VIEW_MESSAGES_PROPERTY
public static final java.lang.String VIEW_MESSAGES_PROPERTY
- See Also:
- Constant Field Values
-
VIEW_LOCATION_VIEW
public static final java.lang.String VIEW_LOCATION_VIEW
- See Also:
- Constant Field Values
-
VIEW_ENCODING
public static final java.lang.String VIEW_ENCODING
- See Also:
- Constant Field Values
-
VIEW_UUID_BINDING
public static final java.lang.String VIEW_UUID_BINDING
- See Also:
- Constant Field Values
-
-
Method Detail
-
setAllowWrite
public void setAllowWrite(boolean write)
Set whether we write or not- Parameters:
write- true (default) if the import must go ahead, otherwise no import will occur
-
setUseExistingStore
public void setUseExistingStore(boolean useExistingStore)
Set whether the importer bootstrap should only perform an import if the store being referenced doesn't already exist.- Parameters:
useExistingStore- true to allow imports into an existing store, otherwise false (default) to only import if the store doesn't exist.
-
setUuidBinding
public void setUuidBinding(ImporterBinding.UUID_BINDING uuidBinding)
Set the behaviour for generating UUIDs in the import. Values are set by theImporterBinding.UUID_BINDINGenum and default toImporterBinding.UUID_BINDING.CREATE_NEW_WITH_UUID. This setting overrides the UUID binding behaviour specified in the view properties.- Parameters:
uuidBinding- the UUID generation behaviour
-
setTransactionService
public void setTransactionService(TransactionService transactionService)
Sets the Transaction Service- Parameters:
transactionService- the transaction service
-
setRetryingTransactionHelper
public void setRetryingTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
Sets the retrying transaction helper specific to the importer bootstrap. This transaction helper's parameters are tuned to the longer-running import transaction.- Parameters:
retryingTransactionHelper- the retrying transaction helper
-
setNamespaceService
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Sets the namespace service- Parameters:
namespaceService- the namespace service
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Sets the node service- Parameters:
nodeService- the node service
-
setImporterService
public void setImporterService(ImporterService importerService)
Sets the importer service- Parameters:
importerService- the importer service
-
setAuthenticationContext
public void setAuthenticationContext(AuthenticationContext authenticationContext)
Set the authentication component- Parameters:
authenticationContext- AuthenticationContext
-
setBootstrapViews
public void setBootstrapViews(java.util.List<java.util.Properties> bootstrapViews)
Sets the bootstrap views
-
addBootstrapViews
public void addBootstrapViews(java.util.List<java.util.Properties> bootstrapViews)
Sets the bootstrap views
-
setStoreUrl
public void setStoreUrl(java.lang.String storeUrl)
Sets the Store Ref to bootstrap into- Parameters:
storeUrl- String
-
setMustNotExistStoreUrls
public void setMustNotExistStoreUrls(java.util.List<java.lang.String> storeUrls)
If any of the store urls exist, the bootstrap does not take place- Parameters:
storeUrls- the list of store urls to check
-
getStoreRef
public org.alfresco.service.cmr.repository.StoreRef getStoreRef()
Gets the Store Reference- Returns:
- store reference
-
setConfiguration
public void setConfiguration(java.util.Properties configuration)
Sets the Configuration values for binding place holders- Parameters:
configuration- Properties
-
getConfiguration
public java.util.Properties getConfiguration()
Gets the Configuration values for binding place holders- Returns:
- configuration
-
setLocale
public void setLocale(java.lang.String locale)
Sets the Locale- Parameters:
locale- (language_country_variant)
-
getLocale
public java.lang.String getLocale()
Get Locale- Returns:
- locale
-
setLog
public void setLog(boolean logEnabled)
Deprecated.Was never used
-
hasPerformedBootstrap
public boolean hasPerformedBootstrap()
Determine if bootstrap was performed?- Returns:
- true => bootstrap was performed
-
bootstrap
public void bootstrap()
Bootstrap the Repository
-
getFile
public static java.io.File getFile(java.lang.String view)
Get a File representation of an XML view- Parameters:
view- the view location- Returns:
- the file
-
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event)
- Specified by:
onBootstrapin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent event)
- Specified by:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
-