lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject svn commit: r887875 - in /lucene/solr/trunk/contrib/dataimporthandler/src: extras/main/java/org/apache/solr/handler/dataimport/ main/java/org/apache/solr/handler/dataimport/
Date Mon, 07 Dec 2009 10:27:48 GMT
Author: noble
Date: Mon Dec  7 10:27:47 2009
New Revision: 887875

URL: http://svn.apache.org/viewvc?rev=887875&view=rev
Log:
SOLR-1627

Modified:
    lucene/solr/trunk/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/CachedSqlEntityProcessor.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/FileListEntityProcessor.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/LogTransformer.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/NumberFormatTransformer.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/PlainTextEntityProcessor.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/SqlEntityProcessor.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/URLDataSource.java
    lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/extras/main/java/org/apache/solr/handler/dataimport/MailEntityProcessor.java
Mon Dec  7 10:27:47 2009
@@ -568,7 +568,7 @@
     try {
       String val = context.getEntityAttribute(prop);
       if (val != null) {
-        val = context.getVariableResolver().replaceTokens(val);
+        val = context.replaceTokens(val);
         v = Integer.valueOf(val);
       }
     } catch (NumberFormatException e) {
@@ -581,7 +581,7 @@
     boolean v = ifNull;
     String val = context.getEntityAttribute(prop);
     if (val != null) {
-      val = context.getVariableResolver().replaceTokens(val);
+      val = context.replaceTokens(val);
       v = Boolean.valueOf(val);
     }
     return v;
@@ -591,7 +591,7 @@
     String v = ifNull;
     String val = context.getEntityAttribute(prop);
     if (val != null) {
-      val = context.getVariableResolver().replaceTokens(val);
+      val = context.replaceTokens(val);
       v = val;
     }
     return v;

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/CachedSqlEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/CachedSqlEntityProcessor.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/CachedSqlEntityProcessor.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/CachedSqlEntityProcessor.java
Mon Dec  7 10:27:47 2009
@@ -50,7 +50,7 @@
       return getFromRowCacheTransformed();
     if (!isFirst)
       return null;
-    String query = resolver.replaceTokens(context.getEntityAttribute("query"));
+    String query = context.replaceTokens(context.getEntityAttribute("query"));
     isFirst = false;
     if (simpleCache != null) {
       return getSimpleCacheData(query);
@@ -63,7 +63,7 @@
   protected List<Map<String, Object>> getAllNonCachedRows() {
     List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
     String q = getQuery();
-    initQuery(resolver.replaceTokens(q));
+    initQuery(context.replaceTokens(q));
     if (rowIterator == null)
       return rows;
     while (rowIterator.hasNext()) {

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorBase.java
Mon Dec  7 10:27:47 2009
@@ -40,8 +40,6 @@
 
   protected Context context;
 
-  protected VariableResolverImpl resolver;
-
   protected Iterator<Map<String, Object>> rowIterator;
 
   protected List<Transformer> transformers;
@@ -54,7 +52,6 @@
   public void init(Context context) {
     rowIterator = null;
     this.context = context;
-    resolver = (VariableResolverImpl) context.getVariableResolver();    
     if (isFirstInit) {
       firstInit(context);
     }
@@ -180,7 +177,7 @@
     Map<Object, List<Map<String, Object>>> rowIdVsRows = cacheWithWhereClause
             .get(query);
     List<Map<String, Object>> rows = null;
-    Object key = resolver.resolve(cacheVariableName);
+    Object key = context.resolve(cacheVariableName);
     if (key == null) {
       throw new DataImportHandlerException(DataImportHandlerException.WARN,
               "The cache lookup value : " + cacheVariableName + " is resolved to be null
in the entity :" +

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
Mon Dec  7 10:27:47 2009
@@ -166,6 +166,7 @@
     Map<String, Object> transformedRow = row;
     List<Map<String, Object>> rows = null;
     boolean stopTransform = checkStopTransform(row);
+    VariableResolverImpl resolver = (VariableResolverImpl) context.getVariableResolver();
     for (Transformer t : transformers) {
       if (stopTransform) break;
       try {
@@ -269,7 +270,7 @@
   }
 
   public VariableResolverImpl getVariableResolver() {
-    return resolver;
+    return (VariableResolverImpl) context.getVariableResolver();
   }
 
   public Context getContext() {

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/FileListEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/FileListEntityProcessor.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/FileListEntityProcessor.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/FileListEntityProcessor.java
Mon Dec  7 10:27:47 2009
@@ -109,14 +109,14 @@
     super.init(context);
     fileName = context.getEntityAttribute(FILE_NAME);
     if (fileName != null) {
-      fileName = resolver.replaceTokens(fileName);
+      fileName = context.replaceTokens(fileName);
       fileNamePattern = Pattern.compile(fileName);
     }
     baseDir = context.getEntityAttribute(BASE_DIR);
     if (baseDir == null)
       throw new DataImportHandlerException(DataImportHandlerException.SEVERE,
               "'baseDir' is a required attribute");
-    baseDir = resolver.replaceTokens(baseDir);
+    baseDir = context.replaceTokens(baseDir);
     File dir = new File(baseDir);
     if (!dir.isDirectory())
       throw new DataImportHandlerException(DataImportHandlerException.SEVERE,
@@ -127,7 +127,7 @@
       recursive = Boolean.parseBoolean(r);
     excludes = context.getEntityAttribute(EXCLUDES);
     if (excludes != null) {
-      excludes = resolver.replaceTokens(excludes);
+      excludes = context.replaceTokens(excludes);
       excludesPattern = Pattern.compile(excludes);
     }
   }
@@ -144,11 +144,11 @@
 
     Matcher m = PLACE_HOLDER_PATTERN.matcher(dateStr);
     if (m.find()) {
-      Object o = resolver.resolve(m.group(1));
+      Object o = context.resolve(m.group(1));
       if (o instanceof Date)  return (Date)o;
       dateStr = (String) o;
     } else  {
-      dateStr = resolver.replaceTokens(dateStr);
+      dateStr = context.replaceTokens(dateStr);
     }
     m = EvaluatorBag.IN_SINGLE_QUOTES.matcher(dateStr);
     if (m.find()) {
@@ -181,14 +181,14 @@
 
     Matcher m = PLACE_HOLDER_PATTERN.matcher(sizeStr);
     if (m.find()) {
-      Object o = resolver.resolve(m.group(1));
+      Object o = context.resolve(m.group(1));
       if (o instanceof Number) {
         Number number = (Number) o;
         return number.longValue();
       }
       sizeStr = (String) o;
     } else  {
-      sizeStr = resolver.replaceTokens(sizeStr);
+      sizeStr = context.replaceTokens(sizeStr);
     }
 
     return Long.parseLong(sizeStr);

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/HTMLStripTransformer.java
Mon Dec  7 10:27:47 2009
@@ -39,11 +39,10 @@
   @Override
   @SuppressWarnings("unchecked")
   public Object transformRow(Map<String, Object> row, Context context) {
-    VariableResolver resolver = context.getVariableResolver();
     List<Map<String, String>> fields = context.getAllEntityFields();
     for (Map<String, String> field : fields) {
       String col = field.get(DataImporter.COLUMN);
-      String splitHTML = resolver.replaceTokens(field.get(STRIP_HTML));
+      String splitHTML = context.replaceTokens(field.get(STRIP_HTML));
       if (!TRUE.equals(splitHTML))
         continue;
       Object tmpVal = row.get(col);

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
Mon Dec  7 10:27:47 2009
@@ -63,7 +63,7 @@
 
     String bsz = initProps.getProperty("batchSize");
     if (bsz != null) {
-      bsz = context.getVariableResolver().replaceTokens(bsz);
+      bsz = context.replaceTokens(bsz);
       try {
         batchSize = Integer.parseInt(bsz);
         if (batchSize == -1)
@@ -97,8 +97,8 @@
 
   protected Callable<Connection> createConnectionFactory(final Context context,
                                        final Properties initProps) {
-    final VariableResolver resolver = context.getVariableResolver();
-    resolveVariables(resolver, initProps);
+//    final VariableResolver resolver = context.getVariableResolver();
+    resolveVariables(context, initProps);
     final String jndiName = initProps.getProperty(JNDI_NAME);
     final String url = initProps.getProperty(URL);
     final String driver = initProps.getProperty(DRIVER);
@@ -127,7 +127,7 @@
     return factory = new Callable<Connection>() {
       public Connection call() throws Exception {
         // Resolve variables again because the variables may have changed
-        resolveVariables(resolver, initProps);
+        resolveVariables(context, initProps);
         LOG.info("Creating a connection for entity "
                 + context.getEntityAttribute(DataImporter.NAME) + " with URL: "
                 + url);
@@ -198,10 +198,10 @@
     };
   }
 
-  private void resolveVariables(VariableResolver resolver, Properties initProps) {
+  private void resolveVariables(Context ctx, Properties initProps) {
     for (Map.Entry<Object, Object> entry : initProps.entrySet()) {
       if (entry.getValue() != null) {
-        entry.setValue(resolver.replaceTokens((String) entry.getValue()));
+        entry.setValue(ctx.replaceTokens((String) entry.getValue()));
       }
     }
   }

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/LogTransformer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/LogTransformer.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/LogTransformer.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/LogTransformer.java
Mon Dec  7 10:27:47 2009
@@ -35,28 +35,27 @@
 public class LogTransformer extends Transformer {
   Logger LOG = LoggerFactory.getLogger(LogTransformer.class);
 
-  public Object transformRow(Map<String, Object> row, Context context) {
-    VariableResolver vr = context.getVariableResolver();
-    String expr = context.getEntityAttribute(LOG_TEMPLATE);
-    String level = vr.replaceTokens(context.getEntityAttribute(LOG_LEVEL));
+  public Object transformRow(Map<String, Object> row, Context ctx) {
+    String expr = ctx.getEntityAttribute(LOG_TEMPLATE);
+    String level = ctx.replaceTokens(ctx.getEntityAttribute(LOG_LEVEL));
 
     if (expr == null || level == null) return row;
 
     if ("info".equals(level)) {
       if (LOG.isInfoEnabled())
-        LOG.info(vr.replaceTokens(expr));
+        LOG.info(ctx.replaceTokens(expr));
     } else if ("trace".equals(level)) {
       if (LOG.isTraceEnabled())
-        LOG.trace(vr.replaceTokens(expr));
+        LOG.trace(ctx.replaceTokens(expr));
     } else if ("warn".equals(level)) {
       if (LOG.isWarnEnabled())
-        LOG.warn(vr.replaceTokens(expr));
+        LOG.warn(ctx.replaceTokens(expr));
     } else if ("error".equals(level)) {
       if (LOG.isErrorEnabled())
-        LOG.error(vr.replaceTokens(expr));
+        LOG.error(ctx.replaceTokens(expr));
     } else if ("debug".equals(level)) {
       if (LOG.isDebugEnabled())
-        LOG.debug(vr.replaceTokens(expr));
+        LOG.debug(ctx.replaceTokens(expr));
     }
 
     return row;

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/NumberFormatTransformer.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/NumberFormatTransformer.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/NumberFormatTransformer.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/NumberFormatTransformer.java
Mon Dec  7 10:27:47 2009
@@ -51,14 +51,13 @@
 
   @SuppressWarnings("unchecked")
   public Object transformRow(Map<String, Object> row, Context context) {
-    VariableResolver resolver = context.getVariableResolver();
     for (Map<String, String> fld : context.getAllEntityFields()) {
-      String style = resolver.replaceTokens(fld.get(FORMAT_STYLE));
+      String style = context.replaceTokens(fld.get(FORMAT_STYLE));
       if (style != null) {
         String column = fld.get(DataImporter.COLUMN);
         String srcCol = fld.get(RegexTransformer.SRC_COL_NAME);
         Locale locale = null;
-        String localeStr = resolver.replaceTokens(fld.get(LOCALE));
+        String localeStr = context.replaceTokens(fld.get(LOCALE));
         if (srcCol == null)
           srcCol = column;
         if (localeStr != null) {

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/PlainTextEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/PlainTextEntityProcessor.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/PlainTextEntityProcessor.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/PlainTextEntityProcessor.java
Mon Dec  7 10:27:47 2009
@@ -47,7 +47,7 @@
   public Map<String, Object> nextRow() {
     if (ended) return null;
     DataSource<Reader> ds = context.getDataSource();
-    String url = context.getVariableResolver().replaceTokens(context.getEntityAttribute(URL));
+    String url = context.replaceTokens(context.getEntityAttribute(URL));
     Reader r = null;
     try {
       r = ds.getData(url);

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/SqlEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/SqlEntityProcessor.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/SqlEntityProcessor.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/SqlEntityProcessor.java
Mon Dec  7 10:27:47 2009
@@ -68,7 +68,7 @@
   public Map<String, Object> nextRow() {    
     if (rowIterator == null) {
       String q = getQuery();
-      initQuery(resolver.replaceTokens(q));
+      initQuery(context.replaceTokens(q));
     }
     return getNext();
   }
@@ -78,7 +78,7 @@
       String deltaQuery = context.getEntityAttribute(DELTA_QUERY);
       if (deltaQuery == null)
         return null;
-      initQuery(resolver.replaceTokens(deltaQuery));
+      initQuery(context.replaceTokens(deltaQuery));
     }
     return getNext();
   }
@@ -88,7 +88,7 @@
       String deletedPkQuery = context.getEntityAttribute(DEL_PK_QUERY);
       if (deletedPkQuery == null)
         return null;
-      initQuery(resolver.replaceTokens(deletedPkQuery));
+      initQuery(context.replaceTokens(deletedPkQuery));
     }
     return getNext();
   }
@@ -100,7 +100,7 @@
         return null;
       LOG.info("Running parentDeltaQuery for Entity: "
               + context.getEntityAttribute("name"));
-      initQuery(resolver.replaceTokens(parentDeltaQuery));
+      initQuery(context.replaceTokens(parentDeltaQuery));
     }
     return getNext();
   }
@@ -132,11 +132,11 @@
         sb.append(" and ");
       }
       first = false;
-      Object val = resolver.resolve("dataimporter.delta." + primaryKey);
+      Object val = context.resolve("dataimporter.delta." + primaryKey);
       if (val == null) {
         Matcher m = DOT_PATTERN.matcher(primaryKey);
         if (m.find()) {
-          val = resolver.resolve("dataimporter.delta." + m.group(1));
+          val = context.resolve("dataimporter.delta." + m.group(1));
         }
       }
       sb.append(primaryKey).append(" = ");

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/URLDataSource.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/URLDataSource.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/URLDataSource.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/URLDataSource.java
Mon Dec  7 10:27:47 2009
@@ -126,7 +126,7 @@
     if (expr == null) {
       return null;
     }
-    return context.getVariableResolver().replaceTokens(expr);
+    return context.replaceTokens(expr);
   }
 
   private static final Pattern URIMETHOD = Pattern.compile("\\w{3,}:/");

Modified: lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java?rev=887875&r1=887874&r2=887875&view=diff
==============================================================================
--- lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java
(original)
+++ lucene/solr/trunk/contrib/dataimporthandler/src/main/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java
Mon Dec  7 10:27:47 2009
@@ -104,7 +104,7 @@
     }
     String xslt = context.getEntityAttribute(XSL);
     if (xslt != null) {
-      xslt = resolver.replaceTokens(xslt);
+      xslt = context.replaceTokens(xslt);
       try {
         Source xsltSource = new StreamSource(xslt);
         // create an instance of TransformerFactory
@@ -141,7 +141,7 @@
             flags = XPathRecordReader.FLATTEN;
           }
           String xpath = field.get(XPATH);
-          xpath = resolver.replaceTokens(xpath);
+          xpath = context.replaceTokens(xpath);
           xpathReader.addField(field.get(DataImporter.COLUMN),
                   xpath,
                   Boolean.parseBoolean(field.get(DataImporter.MULTI_VALUED)),
@@ -198,7 +198,7 @@
     Map<String, Object> r = null;
     while (true) {
       if (rowIterator == null)
-        initQuery(resolver.replaceTokens(context.getEntityAttribute(URL)));
+        initQuery(context.replaceTokens(context.getEntityAttribute(URL)));
       r = getNext();
       if (r == null) {
         Object hasMore = context.getSessionAttribute(HAS_MORE, Context.SCOPE_ENTITY);
@@ -208,7 +208,7 @@
             if (url == null)
               url = context.getEntityAttribute(URL);
             addNamespace();
-            initQuery(resolver.replaceTokens(url));
+            initQuery(context.replaceTokens(url));
             r = getNext();
             if (r == null)
               return null;
@@ -236,8 +236,7 @@
       Object val = context.getSessionAttribute(name, Context.SCOPE_ENTITY);
       if (val != null) namespace.put(name, val);
     }
-    resolver.addNamespace(entityName, namespace);
-
+    ((VariableResolverImpl)context.getVariableResolver()).addNamespace(entityName, namespace);
   }
 
   private void addCommonFields(Map<String, Object> r) {



Mime
View raw message