Project

General

Profile

« Previous | Next » 

Revision 46362

LayoutToRecordStylesheet xslt must be passed as property

View differences:

modules/dnet-msro-service/branches/saxonHE/src/main/java/eu/dnetlib/msro/workflows/nodes/index/UpdateIndexJobNode.java
30 30
import org.apache.commons.logging.LogFactory;
31 31
import org.springframework.beans.factory.annotation.Autowired;
32 32
import org.springframework.beans.factory.annotation.Required;
33
import org.springframework.beans.factory.annotation.Value;
34
import org.springframework.core.io.Resource;
33 35

  
34 36
public class UpdateIndexJobNode extends BlackboardJobNode {
35 37

  
......
54 56
	/**
55 57
	 * Stylesheet which transforms a layout to another stylesheet which converts a input record to a index record.
56 58
	 */
57
	private org.springframework.core.io.Resource layoutToRecordStylesheet;
59
	@Value("${service.index.layoutToRecordStylesheet}")
60
	private Resource layoutToRecordStylesheet;
58 61

  
59 62
	/**
60 63
	 * service locator.
......
104 107
	protected ResultSet<String> prepareForIndexing(final ResultSet<?> resultSet, final String format, final String layout)
105 108
			throws ISLookUpException, IOException, TransformerException {
106 109

  
110
		log.info("Using layout to record stylesheet: "+getLayoutToRecordStylesheet().getURI());
107 111
		final Transformer layoutTransformer = saxonTransformerFactory.newTransformer(new StreamSource(getLayoutToRecordStylesheet().getInputStream()));
108 112

  
109 113
		final DOMResult layoutToXsltXslt = new DOMResult();
......
159 163
		return this.layoutToRecordStylesheet;
160 164
	}
161 165

  
162
	@Required
163
	public void setLayoutToRecordStylesheet(final org.springframework.core.io.Resource layoutToRecordStylesheet) {
166
	public void setLayoutToRecordStylesheet(final Resource layoutToRecordStylesheet) {
164 167
		this.layoutToRecordStylesheet = layoutToRecordStylesheet;
165 168
	}
166 169

  
modules/dnet-msro-service/branches/saxonHE/src/main/resources/eu/dnetlib/msro/service/applicationContext-msro-service.properties
28 28
#This property is the default value used by the bean 'mdBuilderTemplateXslt' and injected in MdBuilderJobNode node ~ A.M.
29 29
msro.wf.nodes.mdbuilder.xslt.template = classpath:/eu/dnetlib/msro/workflows/xslt/mdBuilder.xslt.st
30 30

  
31
service.index.layoutToRecordStylesheet=eu/dnetlib/msro/workflows/xslt/layoutToRecordStylesheet.xsl
32

  
modules/dnet-msro-service/branches/saxonHE/src/main/resources/eu/dnetlib/msro/service/applicationContext-msro-nodes.xml
118 118
	<!-- Index -->
119 119
	<bean id="wfNodeUpdateIndex" class="eu.dnetlib.msro.workflows.nodes.index.UpdateIndexJobNode"
120 120
		scope="prototype"
121
		p:layoutToRecordStylesheet="classpath:/eu/dnetlib/msro/workflows/xslt/layoutToRecordStylesheet.xsl"
122 121
		p:defaultIndexId="${service.msro.index.defaultIndex}"/>
123 122

  
124 123
	<bean id="wfNodeCreateIndex" class="eu.dnetlib.msro.workflows.nodes.index.CreateIndexJobNode"

Also available in: Unified diff