Class ExportManager
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.plugins.contentio.export.sql.ExportManager
-
- All Implemented Interfaces:
LogEnabled
,Component
,Configurable
,Serviceable
public class ExportManager extends AbstractLogEnabled implements Configurable, Component, Serviceable
This component handles content export in database
-
-
Field Summary
Fields Modifier and Type Field Description protected ContentTypeExtensionPoint
_contentTypeExtensionPoint
Content type extension point.protected CreateSqlTableComponent
_createSqlTableComponent
The create sql table component.protected DeleteSqlTableComponent
_deleteSqlTableComponent
The delete sql table component.protected FillSqlTableComponent
_fillSqlTableComponent
The fill sql table component.protected I18nUtils
_i18nTranslator
The i18n translator.static String
CONTENT_EXPORT_POOL_NAME
Connection pool namestatic String
CONTENT_TABLE_NAME
The name of the table for mapping column namestatic String
DEFAULT_SEPARATOR
The default separatorstatic String
DEFAULT_TABLE_PREFIX
The default prefixstatic String
MAPPING_COLUMN_NAME
The name of the table for mapping column namestatic String
MAPPING_TABLE_NAME
The name of the table for mapping table namestatic String
RICH_TEXT_DATA_TABLE_NAME
The name of the table for datas from rich textstatic String
ROLE
The component role
-
Constructor Summary
Constructors Constructor Description ExportManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_configureContentTypeToExport(Configuration configuration, String tablePrefix)
Configure the content type to exportprotected void
_configureReservedWords(Configuration configuration)
Configure the reserved wordsprotected void
_configureSQLMapping(Configuration configuration)
Configure the sql mappingvoid
configure(Configuration configuration)
void
export()
Export the configured content types to the CONTENT_EXPORT_POOL_NAME db poolExportConfiguration
getExportConfiguration()
Get export configurationprotected void
initialize()
Initializationvoid
service(ServiceManager sManager)
void
setExportConfiguration(ExportConfiguration exportConfiguration)
Set export configuration-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
DEFAULT_TABLE_PREFIX
public static final String DEFAULT_TABLE_PREFIX
The default prefix- See Also:
- Constant Field Values
-
CONTENT_EXPORT_POOL_NAME
public static final String CONTENT_EXPORT_POOL_NAME
Connection pool name- See Also:
- Constant Field Values
-
RICH_TEXT_DATA_TABLE_NAME
public static final String RICH_TEXT_DATA_TABLE_NAME
The name of the table for datas from rich text- See Also:
- Constant Field Values
-
MAPPING_TABLE_NAME
public static final String MAPPING_TABLE_NAME
The name of the table for mapping table name- See Also:
- Constant Field Values
-
MAPPING_COLUMN_NAME
public static final String MAPPING_COLUMN_NAME
The name of the table for mapping column name- See Also:
- Constant Field Values
-
CONTENT_TABLE_NAME
public static final String CONTENT_TABLE_NAME
The name of the table for mapping column name- See Also:
- Constant Field Values
-
DEFAULT_SEPARATOR
public static final String DEFAULT_SEPARATOR
The default separator- See Also:
- Constant Field Values
-
_contentTypeExtensionPoint
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
Content type extension point.
-
_i18nTranslator
protected I18nUtils _i18nTranslator
The i18n translator.
-
_deleteSqlTableComponent
protected DeleteSqlTableComponent _deleteSqlTableComponent
The delete sql table component.
-
_createSqlTableComponent
protected CreateSqlTableComponent _createSqlTableComponent
The create sql table component.
-
_fillSqlTableComponent
protected FillSqlTableComponent _fillSqlTableComponent
The fill sql table component.
-
-
Constructor Detail
-
ExportManager
public ExportManager()
-
-
Method Detail
-
service
public void service(ServiceManager sManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
_configureContentTypeToExport
protected void _configureContentTypeToExport(Configuration configuration, String tablePrefix) throws ConfigurationException
Configure the content type to export- Parameters:
configuration
- the configurationtablePrefix
- the table prefix- Throws:
ConfigurationException
- if an error occurred
-
_configureReservedWords
protected void _configureReservedWords(Configuration configuration) throws ConfigurationException
Configure the reserved words- Parameters:
configuration
- the configuration- Throws:
ConfigurationException
- if an error occurred
-
_configureSQLMapping
protected void _configureSQLMapping(Configuration configuration)
Configure the sql mapping- Parameters:
configuration
- the configuration
-
export
public void export() throws SQLException, AmetysRepositoryException, ContextException, IOException
Export the configured content types to the CONTENT_EXPORT_POOL_NAME db pool- Throws:
SQLException
- If a sql error occurredContextException
- if a context error occurredAmetysRepositoryException
- if a ametys repository error occurredIOException
- if an IO error occurred
-
initialize
protected void initialize()
Initialization
-
getExportConfiguration
public ExportConfiguration getExportConfiguration()
Get export configuration- Returns:
- the export configuration
-
setExportConfiguration
public void setExportConfiguration(ExportConfiguration exportConfiguration)
Set export configuration- Parameters:
exportConfiguration
- the export configuration
-
-