spring-config.context.ep-core-batchjobs-context.xml Maven / Gradle / Ivy
The newest version!
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"> <!-- JOB GENERAL CONFIGURATION --> <bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.MapJobRegistry" /> <bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher"> <property name="jobRepository" ref="jobRepository" /> </bean> <bean id="jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"> <property name="dataSource" ref="mainDataSource" /> <property name="transactionManager" ref="transactionManager" /> </bean> <bean id="jobOperator" class="org.springframework.batch.core.launch.support.SimpleJobOperator"> <property name="jobLauncher" ref="jobLauncher" /> <property name="jobExplorer" ref="jobExplorer" /> <property name="jobRepository" ref="jobRepository" /> <property name="jobRegistry" ref="jobRegistry" /> </bean> <bean id="jobExplorer" class="org.springframework.batch.core.explore.support.JobExplorerFactoryBean"> <property name="dataSource" ref="mainDataSource" /> </bean> <bean class="org.springframework.batch.core.configuration.support.AutomaticJobRegistrar"> <property name="applicationContextFactories"> <bean class="org.springframework.batch.core.configuration.support.ClasspathXmlApplicationContextsFactoryBean"> <property name="resources"> <list> <value>classpath*:/spring-config/jobs/*-job.xml</value> <value>classpath*:/spring-config/jobs/install/*-job.xml</value> </list> </property> </bean> </property> <property name="jobLoader"> <bean class="org.springframework.batch.core.configuration.support.DefaultJobLoader"> <property name="jobRegistry" ref="jobRegistry" /> </bean> </property> </bean> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate"> <property name="dataSource" ref="mainDataSource" /> </bean> <!-- <bean id="castorMarshaller" class="org.springframework.oxm.castor.CastorMarshaller"> <property name="targetClasses"> <array> <value>io.github.jsoagger.core.server.batch.common.record.CSVInputFileDefinition</value> </array> </property> <property name="mappingLocation" value="classpath:/spring-config/castor-mapping.xml" /> <property name="mappingLocation" value="/spring-config/castor-mapping.xml" /> </bean>--> <!-- LISTENERS --> <bean id="SkipListener" class="io.github.jsoagger.core.server.batch.common.listener.SkipListener" lazy-init="true" scope="step"> <property name="jobLogger" value="#{jobExecutionContext['job.logger']}" /> <property name="printResultToConsole" value="#{jobParameters['printResultToConsole']?:'true'}" /> </bean> <bean id="LogFilePostProcessorTask" class="io.github.jsoagger.core.server.batch.common.batchlet.LogFilePostProcessorTask" lazy-init="true" scope="job"> <property name="jobLogger" value="#{jobExecutionContext['job.logger']}" /> <property name="workDir" value="#{jobParameters['working.dir']}" /> <property name="logFilePath" value="#{jobExecutionContext['log.file.path']}" /> </bean> <bean id="VLCSVToBeanReader" class="io.github.jsoagger.core.server.batch.common.importer.CSVToBeanReader" scope="step"> <property name="commentChar" value="#{jobParameters['comment.char']?:'#'}" /> <property name="inputFilePath" value="#{jobParameters['input.file.path']}" /> <property name="separatorChar" value="#{jobParameters['separator.char']?:'|'}" /> <property name="jobLogger" value="#{jobExecutionContext['job.logger']}" /> </bean> <bean id="DynamicAttributeEnumConverter" class="io.github.jsoagger.core.server.batch.editor.EnumConverter" scope="prototype"> <property name="enumClass" value="io.github.jsoagger.core.model.api.typed.DynamicAttributeType" /> </bean> <bean id="ElementSourceEnumConverter" class="io.github.jsoagger.core.server.batch.editor.EnumConverter" scope="prototype"> <property name="enumClass" value="io.github.jsoagger.core.model.part.PartSource" /> </bean> <bean id="VLLineBeanToTypeWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToTypeWriter" scope="step"/> <bean id="VLEPAdminUserWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.EpAdminUserWriter" scope="step"> <property name="domain" value="#{jobParameters['domain']}" /> </bean> <bean id="VLLineBeanToLifecycleWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToLifecycleWriter" scope="step"/> <!-- Export section --> <bean id="VLJDBCItemReader" class="io.github.jsoagger.core.server.batch.common.exporter.JDBCCustomItemExportReader" scope="job"> <property name="dataSource" ref="mainDataSource" /> <property name="sqlFromClassPath" value="#{jobParameters['sql.script.classpath']}" /> <property name="sql" value="#{jobParameters['sql.script.content']}" /> <property name="rowMapper" ref="VLJDBCExportColumnMapRowMapper" /> </bean> <bean id="VLExternalFileResource" class="org.springframework.core.io.FileSystemResource" scope="step"> <constructor-arg type="java.lang.String" value="#{jobParameters['output.file.path']}" /> </bean> <bean id="VLFlatItemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter" scope="step"> <property name="resource" ref="VLExternalFileResource" /> <property name="lineAggregator" ref="VLJDBCExporterLineAggregator" /> </bean> <bean id="BusinessRuleExporterItemWriter" class="org.springframework.batch.item.file.FlatFileItemWriter" scope="step"> <property name="resource" ref="VLExternalFileResource" /> <property name="lineAggregator" ref="BusinessRuleXMLLineAggregatorExporter" /> <property name="headerCallback"> <bean class="io.github.jsoagger.core.server.batch.common.exporter.HeaderCallBack"/> </property> <property name="footerCallback"> <bean class="io.github.jsoagger.core.server.batch.common.exporter.FooterCallBack"/> </property> </bean> <bean id="BusinessRuleXMLLineAggregatorExporter" class="io.github.jsoagger.core.server.batch.common.exporter.BusinessRuleXMLLineAggregatorExporter" scope="step"> <property name="command" value="#{jobParameters['export.command']}" /> </bean> <bean id="VLJDBCExporterLineAggregator" class="io.github.jsoagger.core.server.batch.common.exporter.JDBCExporterLineAggregator" scope="step"> <property name="delimiter" value="#{jobParameters['separator.char']}" /> <property name="fieldExtractor" ref="VLJDBCExporterFieldExtractor" /> </bean> <bean id="VLJDBCExporterFieldExtractor" class="io.github.jsoagger.core.server.batch.common.exporter.JDBCExporterFieldExtractor" scope="step"> <property name="jobName" value="#{jobParameters['job.name']}" /> <property name="jobType" value="#{jobParameters['job.type']}" /> <property name="workingDir" value="#{jobParameters['working.dir']}" /> <property name="command" value="#{jobParameters['export.command']}" /> <property name="domainClass" value="#{jobParameters['domainClass']}" /> </bean> <bean id="PrimaryContentToFilePropertyEditor" class="io.github.jsoagger.core.server.batch.editor.PrimaryContentToFilePropertyEditor" scope="prototype" /> <bean id="VLDeleteItemCompositeProcessor" class="org.springframework.batch.item.support.CompositeItemProcessor" scope="step"> <property name="delegates"> <list> <ref bean="VLCSVToDeleteBeanProcessor" /> </list> </property> </bean> <bean id="VLCSVToDeleteBeanReader" class="io.github.jsoagger.core.server.batch.common.deleter.CSVToDeleteBeanReader" scope="step"> <property name="commentChar" value="#{jobParameters['comment.char']?:'#'}" /> <property name="inputFilePath" value="#{jobParameters['input.file.path']}" /> <property name="separatorChar" value="#{jobParameters['separator.char']?:'|'}" /> <property name="jobLogger" value="#{jobExecutionContext['job.logger']}" /> </bean> <bean id="VLLineBeanDomainProcessor" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanDomainProcessor" scope="step"> <property name="domain" value="#{jobParameters['domain']}" /> </bean> <!-- Row processor --> <bean id="VLCSVToBeanProcessor2" class="io.github.jsoagger.core.server.batch.common.importer.CSVToBeanProcessor2" scope="step" > <property name="containerPath" value="#{jobParameters['domain']}"/> </bean> <bean id="VLCSVToBeanProcessor" class="io.github.jsoagger.core.server.batch.common.importer.CSVToBeanProcessor" scope="step" > <property name="containerPath" value="#{jobParameters['domain']}"/> </bean> <bean id="AttachmentsContentProcessor" class="io.github.jsoagger.core.server.batch.common.importer.util.AttachmentsContentProcessor" scope="step" > <property name="containerPath" value="#{jobParameters['domain']}"/> <property name="attachmentsDir" value="#{jobParameters['attachments.folder.path']}" /> </bean> <bean id="LinkTypeDependendRowsProcessor" class="io.github.jsoagger.core.server.batch.common.importer.util.LinkTypeDependendRowsProcessor" scope="step" /> <bean id="VLZipperBatchlet" class="io.github.jsoagger.core.server.batch.common.batchlet.ZipperBatchlet" scope="step" /> <!-- Property editors--> <bean id="ThumbToFilePropertyEditor" class="io.github.jsoagger.core.server.batch.editor.ThumbToFilePropertyEditor" scope="prototype" /> <bean id="VLENTemplateTypePropertyEditor" class="io.github.jsoagger.core.server.batch.editor.ENTemplateTypePropertyEditor" scope="prototype" /> <bean id="VLFilePathToContentStringPropertyEditor" class="io.github.jsoagger.core.server.batch.editor.FilePathToContentStringPropertyEditor" scope="prototype" /> <bean id="VLDateStringPropertyEditor" class="io.github.jsoagger.core.server.batch.editor.DateStringPropertyEditor" scope="prototype" /> <bean id="DateStringPropertyEditor" class="io.github.jsoagger.core.server.batch.editor.DateStringPropertyEditor" scope="prototype" /> <bean id="PermissionBykeyPropertyEditor" class="io.github.jsoagger.core.server.batch.editor.PermissionBykeyPropertyEditor" scope="prototype" /> <bean id="ContainedFullPathEditor" class="io.github.jsoagger.core.server.batch.editor.ContainedFullPathEditor" scope="prototype" /> <bean id="ObjectFullIdentifierPropetyEditor" class="io.github.jsoagger.core.server.batch.editor.ObjectFullIdentifierPropetyEditor" scope="prototype" /> <bean id="ObjectCategoryByNumberEditor" class="io.github.jsoagger.core.server.batch.editor.ObjectCategoryByNumberEditor" scope="prototype" /> <bean id="ProductInstanceByNumberEditor" class="io.github.jsoagger.core.server.batch.editor.ProductInstanceByNumberEditor" scope="prototype" /> <bean id="ContainerInfoByLogicalPathEditor" class="io.github.jsoagger.core.server.batch.editor.ContainerInfoByLogicalPathEditor" scope="prototype" /> <bean id="SoftAttributesMapperIndexesEditor" class="io.github.jsoagger.core.server.batch.editor.SoftAttributesMapperIndexesEditor" scope="prototype" /> <bean id="TypeSoftAttributeLinkAttributeEditor" class="io.github.jsoagger.core.server.batch.editor.TypeSoftAttributeLinkAttributeEditor" scope="prototype" /> <bean id="IterationToMasterLinkProcessor" class="io.github.jsoagger.core.server.batch.common.importer.util.IterationToMasterLinkProcessor" scope="prototype" /> <bean id="DefaultDependentNodeProcessor" class="io.github.jsoagger.core.server.batch.common.importer.util.DefaultDependentNodeProcessor" scope="prototype" /> <bean id="FolderInfoByFullPathEditor" class="io.github.jsoagger.core.server.batch.editor.FolderInfoByFullPathEditor" scope="prototype" /> <bean id="ElementMasterByNumberEditor" class="io.github.jsoagger.core.server.batch.editor.ElementMasterByNumberEditor" scope="prototype" /> <bean id="MasterByNumberEditor" class="io.github.jsoagger.core.server.batch.editor.MasterByNumberEditor" scope="prototype" /> <bean id="LifecycleInfoByNameEditor" class="io.github.jsoagger.core.server.batch.editor.LifecycleInfoByNameEditor" scope="prototype" /> <bean id="TypeInfoByLogicalPathEditor" class="io.github.jsoagger.core.server.batch.editor.TypeInfoByLogicalPathEditor" scope="prototype" /> <bean id="ElementByVersionIterationEditor" class="io.github.jsoagger.core.server.batch.editor.ElementByVersionIterationEditor" scope="prototype" /> <bean id="ByExactNumberVersionIterationEditor" class="io.github.jsoagger.core.server.batch.editor.ByExactNumberVersionIterationEditor" scope="prototype" /> <bean id="BooleanStringPropertyEditor" class="io.github.jsoagger.core.server.batch.editor.BooleanStringPropertyEditor" scope="prototype" /> <bean id="AccountByLoginEditor" class="io.github.jsoagger.core.server.batch.editor.AccountByLoginEditor" scope="prototype" /> <bean id="ContainerByFullPathEditor" class="io.github.jsoagger.core.server.batch.editor.ContainerByFullPathEditor" scope="prototype" /> <bean id="GroupParentPropertyEditor" class="io.github.jsoagger.core.server.batch.editor.GroupParentPropertyEditor" scope="prototype" /> <bean id="GroupByGroupIdEditor" class="io.github.jsoagger.core.server.batch.editor.GroupByGroupIdEditor" scope="prototype" /> <bean id="RoleByRoleIdEditor" class="io.github.jsoagger.core.server.batch.editor.RoleByRoleIdEditor" scope="prototype" /> <bean id="PersistableByFullIdEditor" class="io.github.jsoagger.core.server.batch.editor.PersistableByFullIdEditor" scope="prototype" /> <bean id="AttributeByLogicalNameEditor" class="io.github.jsoagger.core.server.batch.editor.AttributeByLogicalNameEditor" scope="prototype" /> <bean id="TypeByLogicalPathEditor" class="io.github.jsoagger.core.server.batch.editor.TypeByLogicalPathEditor" scope="prototype" /> <bean id="FilePathToPrimaryContentPropertyEditor" class="io.github.jsoagger.core.server.batch.editor.FilePathToPrimaryContentPropertyEditor" scope="step" > <property name="domain" value="/" /> <property name="attachmentsDir" value="#{jobParameters['attachments.folder.path']}" /> </bean> <bean id="FilePathToAttachmentPropertyEditor" class="io.github.jsoagger.core.server.batch.editor.FilePathToAttachmentPropertyEditor" scope="step"> <property name="domain" value="/" /> <property name="attachmentsDir" value="#{jobParameters['attachments.folder.path']}" /> </bean> <bean id="ObjectCategoryParentEditor" class="io.github.jsoagger.core.server.batch.editor.ObjectCategoryParentEditor" scope="prototype" /> <bean id="OwnerByReferencePropertyEditor" class="io.github.jsoagger.core.server.batch.editor.OwnerByReferencePropertyEditor" scope="prototype" /> <bean id="LineBeanToStandardContainerMemberWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToStandardContainerMemberWriter" scope="prototype" /> <bean id="LineBeanToStandardContainerWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToStandardContainerWriter" scope="prototype" /> <bean id="LineBeanToRoleMemberWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToRoleMemberWriter" scope="prototype" /> <bean id="LineBeanToRolePermissionWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToRolePermissionWriter" scope="prototype" /> <bean id="LineBeanToPermissionWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToPermissionWriter" scope="prototype" /> <bean id="LineBeanToEnTemplateWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToEnTemplateWriter" scope="prototype" /> <bean id="LineBeanToFolderTemplateWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToFolderTemplateWriter" scope="step" /> <bean id="LineBeanToContentFormatWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToContentFormatWriter" scope="step" /> <bean id="LineBeanToThumbGenericWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToThumbGenericWriter" scope="step" /> <bean id="LineBeanToContactMechanismWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToContactMechanismWriter" scope="step" /> <bean id="LineBeanToCategoryWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToCategoryWriter" scope="step" /> <bean id="VLLineBeanToPrimaryContentWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToPrimaryContentWriter" scope="step" /> <bean id="LineBeanToTypedLinkEntityWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToTypedLinkEntityWriter" scope="step" /> <bean id="VLLineBeanToThumbWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToThumbWriter" scope="step" /> <bean id="VLLineBeanToRCThumbWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToRCThumbWriter" scope="step" /> <bean id="VLLineBeanToRootEntityWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToRootEntityWriter" scope="step" /> <bean id="WorkInfoEditor" class="io.github.jsoagger.core.server.batch.editor.WorkInfoEditor" scope="prototype" /> <bean id="VersionInfoEditor" class="io.github.jsoagger.core.server.batch.editor.VersionInfoEditor" scope="prototype" /> <bean id="IterationInfoEditor" class="io.github.jsoagger.core.server.batch.editor.IterationInfoEditor" scope="prototype" /> <bean id="VLJDBCExportColumnMapRowMapper" class="org.springframework.jdbc.core.ColumnMapRowMapper" scope="step" /> <bean id="VLLineBeanToLinkconstraintWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToLinkConstraintWriter" scope="step" /> <bean id="VLLineBeanAddConstraintLinkAgregationToExistingWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanAddConstraintLinkAgregationToExistingWriter" scope="step" /> <bean id="VLLineBeanCompositeProcessor" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanCompositeProcessor" scope="step" /> <bean id="VLLineBeanCompositeWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanCompositeWriter" scope="step" /> <bean id="VLLineBeanToElementWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToElementWriter" scope="step" /> <bean id="VLLineBeanToDocumentWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToDocumentWriter" scope="step" /> <bean id="VLCSVToDeleteBeanProcessor" class="io.github.jsoagger.core.server.batch.common.deleter.CSVToDeleteBeanProcessor" scope="step" /> <bean id="LineBeanToTypeSoftAttrLinkWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToTypeSoftAttrLinkWriter" scope="step" /> <bean id="LineBeanToBusinessRuleWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToBusinessRuleWriter" scope="step" > <property name="attachmentsDir" value="#{jobParameters['attachments.folder.path']}" /> </bean> <bean id="LineBeanToProductInstanceWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToProductInstanceWriter" scope="step" /> <bean id="LineBeanToRoleWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToRoleWriter" scope="step" /> <bean id="LineBeanToViewDefinitionWriter" class="io.github.jsoagger.core.server.batch.common.api.impl.LineBeanToViewDefinitionWriter" scope="step" /> <!-- NEEDED FOR USING JOB scope and STEP scope --> <bean class="org.springframework.batch.core.scope.StepScope" /> <bean class="org.springframework.batch.core.scope.JobScope" /> <bean id="FileMoveBatchlet" class="io.github.jsoagger.core.server.batch.common.batchlet.FileMoveBatchlet" scope="step" /> <bean id="FilesCopyBatchlet" class="io.github.jsoagger.core.server.batch.common.batchlet.FilesCopyBatchlet" scope="step" /> <bean id="UnZipperBatchlet" class="io.github.jsoagger.core.server.batch.common.batchlet.UnZipperBatchlet" scope="step" /> <bean id="LogFilePreProcessorTask" class="io.github.jsoagger.core.server.batch.common.batchlet.LogFilePreProcessorTask" lazy-init="true" scope="job" /> <bean id="SendNotificationTask" class="io.github.jsoagger.core.server.batch.common.batchlet.SendNotificationTask" lazy-init="true" scope="job" /> <bean id="EndJobListenerSendMail" class="io.github.jsoagger.core.server.batch.common.listener.EndJobListenerSendMail" lazy-init="true" scope="job" /> <!-- Converters--> <bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean" lazy-init="true"> <property name="converters"> <list> <bean class="io.github.jsoagger.core.server.service.rest.utils.ContainerFullIdConverter"/> <bean class="io.github.jsoagger.core.server.service.rest.utils.OptionalRestObjectFullIdConverter"/> <bean class="io.github.jsoagger.core.server.service.rest.utils.MandatoryRestObjectFullIdConverter"/> </list> </property> </bean> </beans>