You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2022/05/08 23:32:36 UTC

svn commit: r1900712 - in /manifoldcf/branches/release-2.22-branch: ./ connectors/ldapmapper/ framework/core/src/main/java/org/apache/manifoldcf/core/i18n/

Author: kwright
Date: Sun May  8 23:32:36 2022
New Revision: 1900712

URL: http://svn.apache.org/viewvc?rev=1900712&view=rev
Log:
Pull up fixes for patch release 2.22.1 from trunk

Modified:
    manifoldcf/branches/release-2.22-branch/   (props changed)
    manifoldcf/branches/release-2.22-branch/build.xml
    manifoldcf/branches/release-2.22-branch/connectors/ldapmapper/build.xml
    manifoldcf/branches/release-2.22-branch/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/MCFVelocityResourceLoader.java
    manifoldcf/branches/release-2.22-branch/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java

Propchange: manifoldcf/branches/release-2.22-branch/
------------------------------------------------------------------------------
  Merged /manifoldcf/trunk:r1900668,1900677,1900711

Modified: manifoldcf/branches/release-2.22-branch/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-2.22-branch/build.xml?rev=1900712&r1=1900711&r2=1900712&view=diff
==============================================================================
--- manifoldcf/branches/release-2.22-branch/build.xml (original)
+++ manifoldcf/branches/release-2.22-branch/build.xml Sun May  8 23:32:36 2022
@@ -102,7 +102,6 @@
     <property name="servlet-api.version" value="3.1.0"/>
     <property name="stax-api.version" value="1.0.1"/>
     <property name="streambuffer.version" value="1.5.7"/>
-    <property name="velocity.version" value="1.7"/>
     <property name="velocity-engine-core.version" value="2.3"/>
     <property name="wss4j.version" value="1.5.12"/>
     <property name="xmlgraphics-commons.version" value="1.4"/>
@@ -2067,12 +2066,6 @@ Use Apache Forrest version forrest-0.9-d
         <mkdir dir="lib"/>
         <antcall target="download-via-maven"><param name="target" value="lib"/>
             <param name="project-path" value="org/apache/velocity"/>
-            <param name="artifact-version" value="${velocity.version}"/>
-            <param name="artifact-name" value="velocity"/>
-            <param name="artifact-type" value="jar"/>
-        </antcall>
-        <antcall target="download-via-maven"><param name="target" value="lib"/>
-            <param name="project-path" value="org/apache/velocity"/>
             <param name="artifact-version" value="${velocity-engine-core.version}"/>
             <param name="artifact-name" value="velocity-engine-core"/>
             <param name="artifact-type" value="jar"/>

Modified: manifoldcf/branches/release-2.22-branch/connectors/ldapmapper/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-2.22-branch/connectors/ldapmapper/build.xml?rev=1900712&r1=1900711&r2=1900712&view=diff
==============================================================================
--- manifoldcf/branches/release-2.22-branch/connectors/ldapmapper/build.xml (original)
+++ manifoldcf/branches/release-2.22-branch/connectors/ldapmapper/build.xml Sun May  8 23:32:36 2022
@@ -32,7 +32,7 @@
 
     <target name="deliver-connector" depends="mcf-connector-build.deliver-connector">
         <antcall target="general-add-mapping-connector">
-            <param name="connector-label" value="Regular expression mapper"/>
+            <param name="connector-label" value="LDAP mapper"/>
             <param name="connector-class" value="org.apache.manifoldcf.authorities.mappers.ldap.LDAPMapper"/>
         </antcall>
     </target>

Modified: manifoldcf/branches/release-2.22-branch/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/MCFVelocityResourceLoader.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-2.22-branch/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/MCFVelocityResourceLoader.java?rev=1900712&r1=1900711&r2=1900712&view=diff
==============================================================================
--- manifoldcf/branches/release-2.22-branch/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/MCFVelocityResourceLoader.java (original)
+++ manifoldcf/branches/release-2.22-branch/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/MCFVelocityResourceLoader.java Sun May  8 23:32:36 2022
@@ -19,11 +19,13 @@
 package org.apache.manifoldcf.core.i18n;
 
 import java.io.*;
+import org.apache.velocity.util.ExtProperties;
 
 /** Our own Velocity resource loader, which uses our class resolution to find Velocity template resources.
 */
 public class MCFVelocityResourceLoader extends org.apache.velocity.runtime.resource.loader.ResourceLoader
 {
+    
   protected Class classInstance;
   
   /** Constructor.
@@ -37,7 +39,19 @@ public class MCFVelocityResourceLoader e
   {
     return 0L;
   }
-  
+
+  @Override
+  public Reader getResourceReader(String source, String encoding)
+    throws org.apache.velocity.exception.ResourceNotFoundException
+  {
+    try
+    {
+      return new InputStreamReader(getResourceStream(source), encoding);
+    } catch (UnsupportedEncodingException e) {
+      throw new org.apache.velocity.exception.ResourceNotFoundException("Encoding '"+encoding+"' is illegal");
+    }
+  }
+    
   public InputStream getResourceStream(String source)
     throws org.apache.velocity.exception.ResourceNotFoundException
   {
@@ -47,15 +61,16 @@ public class MCFVelocityResourceLoader e
     return rval;
   }
 
-  public void init(org.apache.commons.collections.ExtendedProperties configuration)
+  @Override
+  public void init(ExtProperties configurations)
   {
-    // Does nothing
   }
 
+  @Override
   public boolean isSourceModified(org.apache.velocity.runtime.resource.Resource resource)
   {
     // This obviously supports caching, which we don't need and may mess us up if the caching is cross-instance
     return true;
   }
 
-}
\ No newline at end of file
+}

Modified: manifoldcf/branches/release-2.22-branch/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/release-2.22-branch/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java?rev=1900712&r1=1900711&r2=1900712&view=diff
==============================================================================
--- manifoldcf/branches/release-2.22-branch/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java (original)
+++ manifoldcf/branches/release-2.22-branch/framework/core/src/main/java/org/apache/manifoldcf/core/i18n/Messages.java Sun May  8 23:32:36 2022
@@ -25,6 +25,7 @@ import java.util.ResourceBundle;
 import java.util.Set;
 import java.util.HashSet;
 import java.util.Vector;
+import java.util.Properties;
 
 import java.io.InputStream;
 
@@ -32,6 +33,7 @@ import org.apache.manifoldcf.core.system
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
 import org.apache.velocity.app.VelocityEngine;
 import org.apache.velocity.runtime.RuntimeConstants;
+import org.apache.velocity.util.ExtProperties;
 
 public class Messages
 {
@@ -53,17 +55,17 @@ public class Messages
     throws ManifoldCFException
   {
     VelocityEngine engine = new VelocityEngine();
-    // Now configure it
-    org.apache.commons.collections.ExtendedProperties configuration = new org.apache.commons.collections.ExtendedProperties();
+    Properties configuration = new Properties();
     // This is the property that describes the id's of the resource loaders.
-    configuration.setProperty(VelocityEngine.RESOURCE_LOADER,"mcf");
+    configuration.setProperty(VelocityEngine.RESOURCE_LOADERS,"mcf");
     // This is the property which describes the resource loader itself
-    configuration.setProperty("mcf."+VelocityEngine.RESOURCE_LOADER+".instance",new MCFVelocityResourceLoader(classInstance));
-    engine.setExtendedProperties(configuration);
-    engine.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
-      "org.apache.velocity.runtime.log.Log4JLogChute" );
-    engine.setProperty("runtime.log.logsystem.log4j.logger",
-      "velocity");
+    engine.setProperties(configuration);
+    engine.addProperty(VelocityEngine.RESOURCE_LOADER+".mcf.instance",new MCFVelocityResourceLoader(classInstance));
+    //engine.setProperty( RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
+    //  "org.apache.velocity.runtime.log.Log4JLogChute" );
+    //engine.setProperty("runtime.log.logsystem.log4j.logger",
+    //  "velocity");
+    //"runtime.log.instance"
     return engine;
   }