manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1603759 - in /manifoldcf/trunk: connectors/forcedmetadata/ connectors/forcedmetadata/connector/src/main/java/org/apache/manifoldcf/agents/transformation/forcedmetadata/ connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/m...
Date Thu, 19 Jun 2014 08:46:09 GMT
Author: kwright
Date: Thu Jun 19 08:46:08 2014
New Revision: 1603759

URL: http://svn.apache.org/r1603759
Log:
Forced metadata transformer now becomes metadata adjuster

Added:
    manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_zh_CN.properties   (with props)
    manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_FieldMapping.html   (with props)
Modified:
    manifoldcf/trunk/connectors/forcedmetadata/build.xml
    manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/java/org/apache/manifoldcf/agents/transformation/forcedmetadata/ForcedMetadataConnector.java
    manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_en_US.properties
    manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_ja_JP.properties
    manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification.js
    manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_ForcedMetadata.html
    manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/viewSpecification.html
    manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/RepositoryDocument.java

Modified: manifoldcf/trunk/connectors/forcedmetadata/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/forcedmetadata/build.xml?rev=1603759&r1=1603758&r2=1603759&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/forcedmetadata/build.xml (original)
+++ manifoldcf/trunk/connectors/forcedmetadata/build.xml Thu Jun 19 08:46:08 2014
@@ -32,7 +32,7 @@
 
     <target name="deliver-connector" depends="mcf-connector-build.deliver-connector">
         <antcall target="general-add-transformation-connector">
-            <param name="connector-label" value="Forced metadata"/>
+            <param name="connector-label" value="Metadata adjuster"/>
             <param name="connector-class" value="org.apache.manifoldcf.agents.transformation.forcedmetadata.ForcedMetadataConnector"/>
         </antcall>
     </target>

Modified: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/java/org/apache/manifoldcf/agents/transformation/forcedmetadata/ForcedMetadataConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/java/org/apache/manifoldcf/agents/transformation/forcedmetadata/ForcedMetadataConnector.java?rev=1603759&r1=1603758&r2=1603759&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/java/org/apache/manifoldcf/agents/transformation/forcedmetadata/ForcedMetadataConnector.java (original)
+++ manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/java/org/apache/manifoldcf/agents/transformation/forcedmetadata/ForcedMetadataConnector.java Thu Jun 19 08:46:08 2014
@@ -35,14 +35,19 @@ public class ForcedMetadataConnector ext
   // There will be node for every parameter/value pair.
   
   public static final String NODE_PAIR = "pair";
-  public static final String ATTR_PARAMETER = "parameter";
-  public static final String ATTR_VALUE = "value";
-  
+  public static final String ATTRIBUTE_PARAMETER = "parameter";
+  public static final String NODE_FIELDMAP = "fieldmap";
+  public static final String NODE_KEEPMETADATA = "keepAllMetadata";
+  public static final String ATTRIBUTE_SOURCE = "source";
+  public static final String ATTRIBUTE_TARGET = "target";
+  public static final String ATTRIBUTE_VALUE = "value";
+
   // Templates
   
   private static final String VIEW_SPEC = "viewSpecification.html";
   private static final String EDIT_SPEC_HEADER = "editSpecification.js";
   private static final String EDIT_SPEC_FORCED_METADATA = "editSpecification_ForcedMetadata.html";
+  private static final String EDIT_SPEC_FIELDMAPPING = "editSpecification_FieldMapping.html";
 
   /** Get a pipeline version string, given a pipeline specification object.  The version string is used to
   * uniquely describe the pertinent details of the specification and the configuration, to allow the Connector 
@@ -58,53 +63,8 @@ public class ForcedMetadataConnector ext
   public String getPipelineDescription(Specification spec)
     throws ManifoldCFException, ServiceInterruption
   {
-    // Pull out the forced metadata, and pack them.
-    // We *could* use XML or JSON, but then we'd have to parse it later, and that's far more expensive than what we actually are going to do.
-    // Plus, these must be ordered to make strings comparable.
-    Map<String,Set<String>> parameters = new HashMap<String,Set<String>>();
-    for (int i = 0; i < spec.getChildCount(); i++)
-    {
-      SpecificationNode sn = spec.getChild(i);
-      if (sn.getType().equals(NODE_PAIR))
-      {
-        String parameter = sn.getAttributeValue(ATTR_PARAMETER);
-        String value = sn.getAttributeValue(ATTR_VALUE);
-        Set<String> params = parameters.get(parameter);
-        if (params == null)
-        {
-          params = new HashSet<String>();
-          parameters.put(parameter,params);
-        }
-        params.add(value);
-      }
-    }
-    
-    // Construct the string
-    StringBuilder sb = new StringBuilder();
-    // Get the keys and sort them
-    String[] keys = new String[parameters.size()];
-    int j = 0;
-    for (String key : parameters.keySet())
-    {
-      keys[j++] = key;
-    }
-    java.util.Arrays.sort(keys);
-    // Pack the list of keys
-    packList(sb,keys,'+');
-    // Now, go through each key and individually pack the values
-    for (String key : keys)
-    {
-      Set<String> values = parameters.get(key);
-      String[] valueArray = new String[values.size()];
-      j = 0;
-      for (String value : values)
-      {
-        valueArray[j++] = value;
-      }
-      java.util.Arrays.sort(valueArray);
-      packList(sb,valueArray,'+');
-    }
-    return sb.toString();
+    SpecPacker sp = new SpecPacker(spec);
+    return sp.toPackedString();
   }
 
   /** Add (or replace) a document in the output data store using the connector.
@@ -126,27 +86,51 @@ public class ForcedMetadataConnector ext
   public int addOrReplaceDocumentWithException(String documentURI, String pipelineDescription, RepositoryDocument document, String authorityNameString, IOutputAddActivity activities)
     throws ManifoldCFException, ServiceInterruption, IOException
   {
-    // Unpack the forced metadata and add it to the document
-    int index = 0;
-    List<String> keys = new ArrayList<String>();
-    index = unpackList(keys,pipelineDescription,index,'+');
-    // For each key, unpack its list of values
-    for (String key : keys)
+    // Unpack the forced metadata
+    SpecPacker sp = new SpecPacker(pipelineDescription);
+    // We have to create a copy of the Repository Document, since we might be rearranging things
+    RepositoryDocument docCopy = document.duplicate();
+    docCopy.clearFields();
+    // Do the mapping first!!
+    Iterator<String> fields = document.getFields();
+    while (fields.hasNext())
+    {
+      String field = fields.next();
+      Object[] fieldData = document.getField(field);
+      String target = sp.getMapping(field);
+      if (target != null)
+      {
+        if (fieldData instanceof Date[])
+          docCopy.addField(target,(Date[])fieldData);
+        else if (fieldData instanceof Reader[])
+          docCopy.addField(target,(Reader[])fieldData);
+        else if (fieldData instanceof String[])
+          docCopy.addField(target,(String[])fieldData);
+      }
+      else
+      {
+        if (sp.keepAllMetadata())
+        {
+          if (fieldData instanceof Date[])
+            docCopy.addField(field,(Date[])fieldData);
+          else if (fieldData instanceof Reader[])
+            docCopy.addField(field,(Reader[])fieldData);
+          else if (fieldData instanceof String[])
+            docCopy.addField(field,(String[])fieldData);
+        }
+      }
+    }
+
+    Iterator<String> keys = sp.getParameterKeys();
+    while (keys.hasNext())
     {
-      List<String> values = new ArrayList<String>();
-      index = unpackList(values,pipelineDescription,index,'+');
-      String[] valueArray = (String[])values.toArray(new String[0]);
-      // Go through the value list and modify the repository document.
-      // This blows away existing values for the fields, if any.
-      // NOTE WELL: Upstream callers who set Reader metadata values (or anything that needs to be closed)
-      // are responsible for closing those resources, whether or not they remain in the RepositoryDocument
-      // object after indexing is done!!
-      document.addField(key,valueArray);
+      String key = keys.next();
+      docCopy.addField(key,sp.getParameterValues(key));
     }
     // Finally, send the modified repository document onward to the next pipeline stage.
     // If we'd done anything to the stream, we'd have needed to create a new RepositoryDocument object and copied the
     // data into it, and closed the new stream after sendDocument() was called.
-    return activities.sendDocument(documentURI,document,authorityNameString);
+    return activities.sendDocument(documentURI,docCopy,authorityNameString);
   }
 
   // UI support methods.
@@ -195,10 +179,11 @@ public class ForcedMetadataConnector ext
     // Output specification header
     
     // Add Forced Metadata to tab array
+    tabsArray.add(Messages.getString(locale, "ForcedMetadata.FieldMappingTabName"));
     tabsArray.add(Messages.getString(locale, "ForcedMetadata.ForcedMetadata"));
 
     Map<String, Object> paramMap = new HashMap<String, Object>();
-    paramMap.put("SeqNum",Integer.toString(connectionSequenceNumber));
+    paramMap.put("SEQNUM",Integer.toString(connectionSequenceNumber));
 
     Messages.outputResourceWithVelocity(out,locale,EDIT_SPEC_HEADER,paramMap);
   }
@@ -221,12 +206,15 @@ public class ForcedMetadataConnector ext
   {
     // Output specification body
     Map<String, Object> paramMap = new HashMap<String, Object>();
-    paramMap.put("TabName", tabName);
-    paramMap.put("SeqNum",Integer.toString(connectionSequenceNumber));
-    paramMap.put("SelectedNum",Integer.toString(actualSequenceNumber));
+    paramMap.put("TABNAME", tabName);
+    paramMap.put("SEQNUM",Integer.toString(connectionSequenceNumber));
+    paramMap.put("SELECTEDNUM",Integer.toString(actualSequenceNumber));
 
     fillInForcedMetadataTab(paramMap, os);
+    fillInFieldMappingSpecificationMap(paramMap, os);
+
     Messages.outputResourceWithVelocity(out,locale,EDIT_SPEC_FORCED_METADATA,paramMap);
+    Messages.outputResourceWithVelocity(out,locale,EDIT_SPEC_FIELDMAPPING,paramMap);
   }
   
   /** Process a specification post.
@@ -245,8 +233,8 @@ public class ForcedMetadataConnector ext
     throws ManifoldCFException
   {
     // Process specification post
-    String prefix = "s"+connectionSequenceNumber+"_";
-    String forcedCount = variableContext.getParameter(prefix+"forcedmetadata_count");
+    String seqPrefix = "s"+connectionSequenceNumber+"_";
+    String forcedCount = variableContext.getParameter(seqPrefix+"forcedmetadata_count");
     if (forcedCount != null)
     {
       int count = Integer.parseInt(forcedCount);
@@ -263,28 +251,92 @@ public class ForcedMetadataConnector ext
       // Now, go through form data
       for (int j = 0; j < count; j++)
       {
-        String op = variableContext.getParameter(prefix+"forcedmetadata_"+j+"_op");
+        String op = variableContext.getParameter(seqPrefix+"forcedmetadata_"+j+"_op");
         if (op != null && op.equals("Delete"))
           continue;
-        String paramName = variableContext.getParameter(prefix+"forcedmetadata_"+j+"_name");
-        String paramValue = variableContext.getParameter(prefix+"forcedmetadata_"+j+"_value");
+        String paramName = variableContext.getParameter(seqPrefix+"forcedmetadata_"+j+"_name");
+        String paramValue = variableContext.getParameter(seqPrefix+"forcedmetadata_"+j+"_value");
         SpecificationNode sn = new SpecificationNode(NODE_PAIR);
-        sn.setAttribute(ATTR_PARAMETER,paramName);
-        sn.setAttribute(ATTR_VALUE,paramValue);
+        sn.setAttribute(ATTRIBUTE_PARAMETER,paramName);
+        sn.setAttribute(ATTRIBUTE_VALUE,paramValue);
         os.addChild(os.getChildCount(),sn);
       }
       // Look for add operation
-      String addOp = variableContext.getParameter(prefix+"forcedmetadata_op");
+      String addOp = variableContext.getParameter(seqPrefix+"forcedmetadata_op");
       if (addOp != null && addOp.equals("Add"))
       {
-        String paramName = variableContext.getParameter(prefix+"forcedmetadata_name");
-        String paramValue = variableContext.getParameter(prefix+"forcedmetadata_value");
+        String paramName = variableContext.getParameter(seqPrefix+"forcedmetadata_name");
+        String paramValue = variableContext.getParameter(seqPrefix+"forcedmetadata_value");
         SpecificationNode sn = new SpecificationNode(NODE_PAIR);
-        sn.setAttribute(ATTR_PARAMETER,paramName);
-        sn.setAttribute(ATTR_VALUE,paramValue);
+        sn.setAttribute(ATTRIBUTE_PARAMETER,paramName);
+        sn.setAttribute(ATTRIBUTE_VALUE,paramValue);
         os.addChild(os.getChildCount(),sn);
       }
     }
+    
+    String x = variableContext.getParameter(seqPrefix+"fieldmapping_count");
+    if (x != null && x.length() > 0)
+    {
+      // About to gather the fieldmapping nodes, so get rid of the old ones.
+      int i = 0;
+      while (i < os.getChildCount())
+      {
+        SpecificationNode node = os.getChild(i);
+        if (node.getType().equals(NODE_FIELDMAP) || node.getType().equals(NODE_KEEPMETADATA))
+          os.removeChild(i);
+        else
+          i++;
+      }
+      int count = Integer.parseInt(x);
+      i = 0;
+      while (i < count)
+      {
+        String prefix = seqPrefix+"fieldmapping_";
+        String suffix = "_"+Integer.toString(i);
+        String op = variableContext.getParameter(prefix+"op"+suffix);
+        if (op == null || !op.equals("Delete"))
+        {
+          // Gather the fieldmap etc.
+          String source = variableContext.getParameter(prefix+"source"+suffix);
+          String target = variableContext.getParameter(prefix+"target"+suffix);
+          if (target == null)
+            target = "";
+          SpecificationNode node = new SpecificationNode(NODE_FIELDMAP);
+          node.setAttribute(ATTRIBUTE_SOURCE,source);
+          node.setAttribute(ATTRIBUTE_TARGET,target);
+          os.addChild(os.getChildCount(),node);
+        }
+        i++;
+      }
+      
+      String addop = variableContext.getParameter(seqPrefix+"fieldmapping_op");
+      if (addop != null && addop.equals("Add"))
+      {
+        String source = variableContext.getParameter(seqPrefix+"fieldmapping_source");
+        String target = variableContext.getParameter(seqPrefix+"fieldmapping_target");
+        if (target == null)
+          target = "";
+        SpecificationNode node = new SpecificationNode(NODE_FIELDMAP);
+        node.setAttribute(ATTRIBUTE_SOURCE,source);
+        node.setAttribute(ATTRIBUTE_TARGET,target);
+        os.addChild(os.getChildCount(),node);
+      }
+      
+      // Gather the keep all metadata parameter to be the last one
+      SpecificationNode node = new SpecificationNode(NODE_KEEPMETADATA);
+      String keepAll = variableContext.getParameter(seqPrefix+"keepallmetadata");
+      if (keepAll != null)
+      {
+        node.setAttribute(ATTRIBUTE_VALUE, keepAll);
+      }
+      else
+      {
+        node.setAttribute(ATTRIBUTE_VALUE, "false");
+      }
+      // Add the new keepallmetadata config parameter 
+      os.addChild(os.getChildCount(), node);
+    }
+
     return null;
   }
   
@@ -303,15 +355,50 @@ public class ForcedMetadataConnector ext
   {
     // View specification
     Map<String, Object> paramMap = new HashMap<String, Object>();
-    paramMap.put("SeqNum",Integer.toString(connectionSequenceNumber));
+    paramMap.put("SEQNUM",Integer.toString(connectionSequenceNumber));
     
     // Fill in the map with data from all tabs
     fillInForcedMetadataTab(paramMap, os);
+    fillInFieldMappingSpecificationMap(paramMap, os);
 
     Messages.outputResourceWithVelocity(out,locale,VIEW_SPEC,paramMap);
   }
 
-  protected void fillInForcedMetadataTab(Map<String,Object> paramMap, Specification os)
+  protected static void fillInFieldMappingSpecificationMap(Map<String,Object> paramMap, Specification os)
+  {
+    // Prep for field mappings
+    List<Map<String,String>> fieldMappings = new ArrayList<Map<String,String>>();
+    String keepAllMetadataValue = "true";
+    for (int i = 0; i < os.getChildCount(); i++)
+    {
+      SpecificationNode sn = os.getChild(i);
+      if (sn.getType().equals(NODE_FIELDMAP)) {
+        String source = sn.getAttributeValue(ATTRIBUTE_SOURCE);
+        String target = sn.getAttributeValue(ATTRIBUTE_TARGET);
+        String targetDisplay;
+        if (target == null)
+        {
+          target = "";
+          targetDisplay = "(remove)";
+        }
+        else
+          targetDisplay = target;
+        Map<String,String> fieldMapping = new HashMap<String,String>();
+        fieldMapping.put("SOURCE",source);
+        fieldMapping.put("TARGET",target);
+        fieldMapping.put("TARGETDISPLAY",targetDisplay);
+        fieldMappings.add(fieldMapping);
+      }
+      else if (sn.getType().equals(NODE_KEEPMETADATA))
+      {
+        keepAllMetadataValue = sn.getAttributeValue(ATTRIBUTE_VALUE);
+      }
+    }
+    paramMap.put("FIELDMAPPINGS",fieldMappings);
+    paramMap.put("KEEPALLMETADATA",keepAllMetadataValue);
+  }
+
+  protected static void fillInForcedMetadataTab(Map<String,Object> paramMap, Specification os)
   {
     // First, sort everything
     Map<String,Set<String>> params = new HashMap<String,Set<String>>();
@@ -320,8 +407,8 @@ public class ForcedMetadataConnector ext
       SpecificationNode sn = os.getChild(i);
       if (sn.getType().equals(NODE_PAIR))
       {
-        String parameter = sn.getAttributeValue(ATTR_PARAMETER);
-        String value = sn.getAttributeValue(ATTR_VALUE);
+        String parameter = sn.getAttributeValue(ATTRIBUTE_PARAMETER);
+        String value = sn.getAttributeValue(ATTRIBUTE_VALUE);
         Set<String> values = params.get(parameter);
         if (values == null)
         {
@@ -364,7 +451,167 @@ public class ForcedMetadataConnector ext
       }
     }
     
-    paramMap.put("Parameters",pObject);
+    paramMap.put("PARAMETERS",pObject);
+  }
+
+  protected static class SpecPacker {
+    
+    private final Map<String,String> sourceTargets = new HashMap<String,String>();
+    private final boolean keepAllMetadata;
+    private final Map<String,Set<String>> parameters = new HashMap<String,Set<String>>();
+
+    public SpecPacker(Specification os) {
+      boolean keepAllMetadata = true;
+      for (int i = 0; i < os.getChildCount(); i++) {
+        SpecificationNode sn = os.getChild(i);
+        
+        if(sn.getType().equals(NODE_KEEPMETADATA)) {
+          String value = sn.getAttributeValue(ATTRIBUTE_VALUE);
+          keepAllMetadata = Boolean.parseBoolean(value);
+        } else if (sn.getType().equals(NODE_FIELDMAP)) {
+          String source = sn.getAttributeValue(ATTRIBUTE_SOURCE);
+          String target = sn.getAttributeValue(ATTRIBUTE_TARGET);
+          
+          if (target == null) {
+            target = "";
+          }
+          sourceTargets.put(source, target);
+        }
+        else if (sn.getType().equals(NODE_PAIR))
+        {
+          String parameter = sn.getAttributeValue(ATTRIBUTE_PARAMETER);
+          String value = sn.getAttributeValue(ATTRIBUTE_VALUE);
+          Set<String> params = parameters.get(parameter);
+          if (params == null)
+          {
+            params = new HashSet<String>();
+            parameters.put(parameter,params);
+          }
+          params.add(value);
+        }
+      }
+      this.keepAllMetadata = keepAllMetadata;
+    }
+    
+    public SpecPacker(String packedString) {
+      
+      int index = 0;
+      
+      // Mappings
+      final List<String> packedMappings = new ArrayList<String>();
+      index = unpackList(packedMappings,packedString,index,'+');
+      String[] fixedList = new String[2];
+      for (String packedMapping : packedMappings) {
+        unpackFixedList(fixedList,packedMapping,0,':');
+        sourceTargets.put(fixedList[0], fixedList[1]);
+      }
+      
+      // Keep all metadata
+      if (packedString.length() > index)
+        keepAllMetadata = (packedString.charAt(index++) == '+');
+      else
+        keepAllMetadata = true;
+      
+      List<String> keys = new ArrayList<String>();
+      index = unpackList(keys,packedString,index,'+');
+      // For each key, unpack its list of values
+      for (String key : keys)
+      {
+        List<String> values = new ArrayList<String>();
+        index = unpackList(values,packedString,index,'+');
+        Set<String> valueSet = new HashSet<String>();
+        for (String value : values)
+        {
+          valueSet.add(value);
+        }
+        parameters.put(key,valueSet);
+      }
+
+    }
+    
+    public String toPackedString() {
+      StringBuilder sb = new StringBuilder();
+      int i;
+      
+      // Mappings
+      final String[] sortArray = new String[sourceTargets.size()];
+      i = 0;
+      for (String source : sourceTargets.keySet()) {
+        sortArray[i++] = source;
+      }
+      java.util.Arrays.sort(sortArray);
+      
+      List<String> packedMappings = new ArrayList<String>();
+      String[] fixedList = new String[2];
+      for (String source : sortArray) {
+        String target = sourceTargets.get(source);
+        StringBuilder localBuffer = new StringBuilder();
+        fixedList[0] = source;
+        fixedList[1] = target;
+        packFixedList(localBuffer,fixedList,':');
+        packedMappings.add(localBuffer.toString());
+      }
+      packList(sb,packedMappings,'+');
+
+      // Keep all metadata
+      if (keepAllMetadata)
+        sb.append('+');
+      else
+        sb.append('-');
+      
+      // Get the keys and sort them
+      final String[] keys = new String[parameters.size()];
+      int j = 0;
+      for (String key : parameters.keySet())
+      {
+        keys[j++] = key;
+      }
+      java.util.Arrays.sort(keys);
+      // Pack the list of keys
+      packList(sb,keys,'+');
+      // Now, go through each key and individually pack the values
+      for (String key : keys)
+      {
+        Set<String> values = parameters.get(key);
+        String[] valueArray = new String[values.size()];
+        j = 0;
+        for (String value : values)
+        {
+          valueArray[j++] = value;
+        }
+        java.util.Arrays.sort(valueArray);
+        packList(sb,valueArray,'+');
+      }
+
+      return sb.toString();
+    }
+    
+    public String getMapping(String source) {
+      return sourceTargets.get(source);
+    }
+    
+    public boolean keepAllMetadata() {
+      return keepAllMetadata;
+    }
+    
+    public Iterator<String> getParameterKeys()
+    {
+      return parameters.keySet().iterator();
+    }
+    
+    public String[] getParameterValues(String key)
+    {
+      Set<String> values = parameters.get(key);
+      if (values == null)
+        return null;
+      String[] rval = new String[values.size()];
+      int i = 0;
+      for (String value : values)
+      {
+        rval[i++] = value;
+      }
+      return rval;
+    }
   }
 
 }

Modified: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_en_US.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_en_US.properties?rev=1603759&r1=1603758&r2=1603759&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_en_US.properties (original)
+++ manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_en_US.properties Thu Jun 19 08:46:08 2014
@@ -13,13 +13,25 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-ForcedMetadata.ForcedMetadata=Forced metadata
-ForcedMetadata.ForcedMetadataNameMustNotBeNull=Forced metadata name must not be null
-ForcedMetadata.ForcedMetadataColon=Forced metadata:
+ForcedMetadata.ForcedMetadata=Add metadata
+ForcedMetadata.FieldMappingTabName=Move metadata
+
+ForcedMetadata.ForcedMetadataNameMustNotBeNull=Added metadata name must not be null
+ForcedMetadata.ForcedMetadataColon=Added metadata:
 ForcedMetadata.ParameterName=Parameter name
 ForcedMetadata.ParameterValue=Parameter value
 ForcedMetadata.Delete=Delete
-ForcedMetadata.Deleteforcedmetadatanumber=Delete forced metadata #
+ForcedMetadata.Deleteforcedmetadatanumber=Delete added metadata #
+ForcedMetadata.Add=Add
+ForcedMetadata.Addforcedmetadata=Add metadata item
+ForcedMetadata.NoForcedMetadataSpecified=No added metadata specified
+ForcedMetadata.FieldMappings=Metadata mappings:
+ForcedMetadata.MetadataFieldName=Incoming metadata name
+ForcedMetadata.FinalFieldName=Final metadata name
+ForcedMetadata.NoFieldMappingSpecified=No metadata mapping specified
+ForcedMetadata.KeepAllMetadata=Keep all incoming metadata
 ForcedMetadata.Add=Add
-ForcedMetadata.Addforcedmetadata=Add forced metadata item
-ForcedMetadata.NoForcedMetadataSpecified=No forced metadata specified
+ForcedMetadata.AddFieldMapping=Add metadata mapping
+ForcedMetadata.Delete=Delete
+ForcedMetadata.DeleteFieldMapping=Delete metadata mapping #
+ForcedMetadata.NoFieldNameSpecified=Please specify a metadata name

Modified: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_ja_JP.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_ja_JP.properties?rev=1603759&r1=1603758&r2=1603759&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_ja_JP.properties (original)
+++ manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_ja_JP.properties Thu Jun 19 08:46:08 2014
@@ -13,13 +13,25 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-ForcedMetadata.ForcedMetadata=Forced metadata
-ForcedMetadata.ForcedMetadataNameMustNotBeNull=Forced metadata name must not be null
-ForcedMetadata.ForcedMetadataColon=Forced metadata:
+ForcedMetadata.ForcedMetadata=Add metadata
+ForcedMetadata.FieldMappingTabName=Move metadata
+
+ForcedMetadata.ForcedMetadataNameMustNotBeNull=Added metadata name must not be null
+ForcedMetadata.ForcedMetadataColon=Added metadata:
 ForcedMetadata.ParameterName=Parameter name
 ForcedMetadata.ParameterValue=Parameter value
 ForcedMetadata.Delete=Delete
-ForcedMetadata.Deleteforcedmetadatanumber=Delete forced metadata #
+ForcedMetadata.Deleteforcedmetadatanumber=Delete added metadata #
+ForcedMetadata.Add=Add
+ForcedMetadata.Addforcedmetadata=Add metadata item
+ForcedMetadata.NoForcedMetadataSpecified=No added metadata specified
+ForcedMetadata.FieldMappings=Metadata mappings:
+ForcedMetadata.MetadataFieldName=Incoming metadata name
+ForcedMetadata.FinalFieldName=Final metadata name
+ForcedMetadata.NoFieldMappingSpecified=No metadata mapping specified
+ForcedMetadata.KeepAllMetadata=Keep all incoming metadata
 ForcedMetadata.Add=Add
-ForcedMetadata.Addforcedmetadata=Add forced metadata item
-ForcedMetadata.NoForcedMetadataSpecified=No forced metadata specified
+ForcedMetadata.AddFieldMapping=Add metadata mapping
+ForcedMetadata.Delete=Delete
+ForcedMetadata.DeleteFieldMapping=Delete metadata mapping #
+ForcedMetadata.NoFieldNameSpecified=Please specify a metadata name

Added: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_zh_CN.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_zh_CN.properties?rev=1603759&view=auto
==============================================================================
--- manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_zh_CN.properties (added)
+++ manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_zh_CN.properties Thu Jun 19 08:46:08 2014
@@ -0,0 +1,37 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+ForcedMetadata.ForcedMetadata=Add metadata
+ForcedMetadata.FieldMappingTabName=Move metadata
+
+ForcedMetadata.ForcedMetadataNameMustNotBeNull=Added metadata name must not be null
+ForcedMetadata.ForcedMetadataColon=Added metadata:
+ForcedMetadata.ParameterName=Parameter name
+ForcedMetadata.ParameterValue=Parameter value
+ForcedMetadata.Delete=Delete
+ForcedMetadata.Deleteforcedmetadatanumber=Delete added metadata #
+ForcedMetadata.Add=Add
+ForcedMetadata.Addforcedmetadata=Add metadata item
+ForcedMetadata.NoForcedMetadataSpecified=No added metadata specified
+ForcedMetadata.FieldMappings=Metadata mappings:
+ForcedMetadata.MetadataFieldName=Incoming metadata name
+ForcedMetadata.FinalFieldName=Final metadata name
+ForcedMetadata.NoFieldMappingSpecified=No metadata mapping specified
+ForcedMetadata.KeepAllMetadata=Keep all incoming metadata
+ForcedMetadata.Add=Add
+ForcedMetadata.AddFieldMapping=Add metadata mapping
+ForcedMetadata.Delete=Delete
+ForcedMetadata.DeleteFieldMapping=Delete metadata mapping #
+ForcedMetadata.NoFieldNameSpecified=Please specify a metadata name

Propchange: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_zh_CN.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/native2ascii/org/apache/manifoldcf/agents/transformation/forcedmetadata/common_zh_CN.properties
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification.js
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification.js?rev=1603759&r1=1603758&r2=1603759&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification.js (original)
+++ manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification.js Thu Jun 19 08:46:08 2014
@@ -18,33 +18,58 @@
 <script type="text/javascript">
 <!--
 
-function s${SeqNum}_AddForcedMetadata()
+function s${SEQNUM}_AddForcedMetadata()
 {
-  if (editjob.s${SeqNum}_forcedmetadata_name.value == "")
+  if (editjob.s${SEQNUM}_forcedmetadata_name.value == "")
   {
     alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('ForcedMetadata.ForcedMetadataNameMustNotBeNull'))");
-    editjob.s${SeqNum}_forcedmetadata_name.focus();
+    editjob.s${SEQNUM}_forcedmetadata_name.focus();
     return;
   }
-  document.editjob.s${SeqNum}_forcedmetadata_op.value="Add";
-  postFormSetAnchor("s${SeqNum}_forcedmetadata_tag");
+  document.editjob.s${SEQNUM}_forcedmetadata_op.value="Add";
+  postFormSetAnchor("s${SEQNUM}_forcedmetadata_tag");
 }
 	
-function s${SeqNum}_DeleteForcedMetadata(n)
+function s${SEQNUM}_DeleteForcedMetadata(n)
 {
-  eval("document.editjob.s${SeqNum}_forcedmetadata_"+n+"_op.value = 'Delete'");
+  eval("document.editjob.s${SEQNUM}_forcedmetadata_"+n+"_op.value = 'Delete'");
   if (n == 0)
-    postFormSetAnchor("s${SeqNum}_forcedmetadata_tag");
+    postFormSetAnchor("s${SEQNUM}_forcedmetadata_tag");
   else
-    postFormSetAnchor("s${SeqNum}_forcedmetadata_"+(n-1)+"_tag");
+    postFormSetAnchor("s${SEQNUM}_forcedmetadata_"+(n-1)+"_tag");
 }
 
-function s${SeqNum}_checkSpecificationForSave()
+function s${SEQNUM}_addFieldMapping()
+{
+  if (editjob.s${SEQNUM}_fieldmapping_source.value == "")
+  {
+    alert("$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.NoFieldNameSpecified'))");
+    editjob.s${SEQNUM}_fieldmapping_source.focus();
+    return;
+  }
+  editjob.s${SEQNUM}_fieldmapping_op.value="Add";
+  postFormSetAnchor("s${SEQNUM}_fieldmapping");
+}
+
+function s${SEQNUM}_deleteFieldMapping(i)
+{
+  // Set the operation
+  eval("editjob.s${SEQNUM}_fieldmapping_op_"+i+".value=\"Delete\"");
+  // Submit
+  if (editjob.s${SEQNUM}_fieldmapping_count.value==i)
+    postFormSetAnchor("s${SEQNUM}_fieldmapping");
+  else
+    postFormSetAnchor("s${SEQNUM}_fieldmapping_"+i)
+  // Undo, so we won't get two deletes next time
+  eval("editjob.s${SEQNUM}_fieldmapping_op_"+i+".value=\"Continue\"");
+}
+
+function s${SEQNUM}_checkSpecificationForSave()
 {
   return true;
 }
 
-function s${SeqNum}_checkSpecification()
+function s${SEQNUM}_checkSpecification()
 {
   return true;
 }

Added: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_FieldMapping.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_FieldMapping.html?rev=1603759&view=auto
==============================================================================
--- manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_FieldMapping.html (added)
+++ manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_FieldMapping.html Thu Jun 19 08:46:08 2014
@@ -0,0 +1,107 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+#if($TABNAME == $ResourceBundle.getString('ForcedMetadata.FieldMappingTabName') && ${SEQNUM} == ${SELECTEDNUM})
+
+<table class="displaytable">
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
+  <tr>
+    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.FieldMappings'))</nobr></td>
+    <td class="boxcell">
+      <table class="formtable">
+        <tr class="formheaderrow">
+          <td class="formcolumnheader"></td>
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.MetadataFieldName'))</nobr></td>
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.FinalFieldName'))</nobr></td>
+        </tr>
+
+  #set($fieldcounter = 0)
+  #foreach($fieldmapping in $FIELDMAPPINGS)
+    #set($fieldcounterdisplay = $fieldcounter + 1)
+    #if(($fieldcounter % 2) == 0)
+        <tr class="evenformrow">
+    #else
+        <tr class="oddformrow">
+    #end
+          <td class="formcolumncell">
+            <a name="s${SEQNUM}_fieldmapping_$fieldcounter">
+              <input type="button" value="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.Delete'))" alt="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.DeleteFieldMapping'))$fieldcounterdisplay" onclick='javascript:s${SEQNUM}_deleteFieldMapping("$fieldcounter");'/>
+              <input type="hidden" name="s${SEQNUM}_fieldmapping_op_$fieldcounter" value="Continue"/>
+              <input type="hidden" name="s${SEQNUM}_fieldmapping_source_$fieldcounter" value="$Encoder.attributeEscape($fieldmapping.get('SOURCE'))"/>
+              <input type="hidden" name="s${SEQNUM}_fieldmapping_target_$fieldcounter" value="$Encoder.attributeEscape($fieldmapping.get('TARGET'))"/>
+            </a>
+          </td>
+          <td class="formcolumncell">
+            <nobr>$Encoder.bodyEscape($fieldmapping.get('SOURCE'))</nobr>
+          </td>
+          <td class="formcolumncell">
+            <nobr>$Encoder.bodyEscape($fieldmapping.get('TARGETDISPLAY'))</nobr>
+          </td>
+        </tr>
+    #set($fieldcounter = $fieldcounter + 1)
+  #end
+  
+  #if($fieldcounter == 0)
+        <tr class="formrow"><td class="formmessage" colspan="3">$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.NoFieldMappingSpecified'))</td></tr>
+  #end
+      
+        <tr class="formrow"><td class="formseparator" colspan="3"><hr/></td></tr>
+        <tr class="formrow">
+          <td class="formcolumncell">
+            <a name="fieldmapping">
+              <input type="button" value="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.Add'))" alt="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.AddFieldMapping'))" onclick="javascript:s${SEQNUM}_addFieldMapping();"/>
+            </a>
+            <input type="hidden" name="s${SEQNUM}_fieldmapping_count" value="$fieldcounter"/>
+            <input type="hidden" name="s${SEQNUM}_fieldmapping_op" value="Continue"/>
+          </td>
+          <td class="formcolumncell">
+            <nobr><input type="text" size="15" name="s${SEQNUM}_fieldmapping_source" value=""/></nobr>
+          </td>
+          <td class="formcolumncell">
+            <nobr><input type="text" size="15" name="s${SEQNUM}_fieldmapping_target" value=""/></nobr>
+          </td>
+        </tr>
+      </table>
+    </td>
+  </tr>
+  
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
+  
+  <tr>
+    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.KeepAllMetadata'))</nobr></td>
+    <td class="value">
+  #if($KEEPALLMETADATA == 'true')
+       <input type="checkbox" checked="true" name="s${SEQNUM}_keepallmetadata" value="true"/>
+  #else
+       <input type="checkbox" name="s${SEQNUM}_keepallmetadata" value="true"/>
+  #end
+    </td>
+  </tr>
+</table>
+      
+#else
+
+  #set($fieldcounter = 0)
+  #foreach($fieldmapping in $FIELDMAPPINGS)
+<input type="hidden" name="s${SEQNUM}_fieldmapping_source_$fieldcounter" value="$Encoder.attributeEscape($fieldmapping.get('SOURCE'))"/>
+<input type="hidden" name="s${SEQNUM}_fieldmapping_target_$fieldcounter" value="$Encoder.attributeEscape($fieldmapping.get('TARGET'))"/>
+    #set($fieldcounter = $fieldcounter + 1)
+  #end
+<input type="hidden" name="s${SEQNUM}_fieldmapping_count" value="$fieldcounter"/>
+<input type="hidden" name="s${SEQNUM}_keepallmetadata" value="$Encoder.bodyEscape($KEEPALLMETADATA)"/>
+
+#end
\ No newline at end of file

Propchange: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_FieldMapping.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_FieldMapping.html
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_ForcedMetadata.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_ForcedMetadata.html?rev=1603759&r1=1603758&r2=1603759&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_ForcedMetadata.html (original)
+++ manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/editSpecification_ForcedMetadata.html Thu Jun 19 08:46:08 2014
@@ -15,7 +15,7 @@
  limitations under the License.
 -->
 
-#if($TabName == $ResourceBundle.getString('ForcedMetadata.ForcedMetadata') && $SeqNum == $SelectedNum)
+#if($TABNAME == $ResourceBundle.getString('ForcedMetadata.ForcedMetadata') && $SEQNUM == $SELECTEDNUM)
 
 <table class="displaytable">
   <tr>
@@ -31,18 +31,18 @@
           <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.ParameterValue'))</nobr></td>
         </tr>
   #set($paramcounter = 0)
-  #foreach($paramrecord in $Parameters)
+  #foreach($paramrecord in $PARAMETERS)
     #if(($paramcounter % 2) == 0)
         <tr class="evenformrow">
     #else
         <tr class="oddformrow">
     #end
           <td class="formcolumncell">
-            <a name="s${SeqNum}_forcedmetadata_${paramcounter}_tag"/>
-            <input type="button" value="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.Delete'))" alt="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.Deleteforcedmetadatanumber'))${paramcounter}" onclick='javascript:s${SeqNum}_DeleteForcedMetadata(${paramcounter});'/>
-            <input type="hidden" name="s${SeqNum}_forcedmetadata_${paramcounter}_op" value="Continue"/>
-            <input type="hidden" name="s${SeqNum}_forcedmetadata_${paramcounter}_name" value="$Encoder.attributeEscape($paramrecord.get('parameter'))"/>
-            <input type="hidden" name="s${SeqNum}_forcedmetadata_${paramcounter}_value" value="$Encoder.attributeEscape($paramrecord.get('value'))"/>
+            <a name="s${SEQNUM}_forcedmetadata_${paramcounter}_tag"/>
+            <input type="button" value="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.Delete'))" alt="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.Deleteforcedmetadatanumber'))${paramcounter}" onclick='javascript:s${SEQNUM}_DeleteForcedMetadata(${paramcounter});'/>
+            <input type="hidden" name="s${SEQNUM}_forcedmetadata_${paramcounter}_op" value="Continue"/>
+            <input type="hidden" name="s${SEQNUM}_forcedmetadata_${paramcounter}_name" value="$Encoder.attributeEscape($paramrecord.get('parameter'))"/>
+            <input type="hidden" name="s${SEQNUM}_forcedmetadata_${paramcounter}_value" value="$Encoder.attributeEscape($paramrecord.get('value'))"/>
           </td>
           <td class="formcolumncell">
             <nobr>$Encoder.bodyEscape($paramrecord.get('parameter'))</nobr>
@@ -59,16 +59,16 @@
         <tr class="formrow"><td colspan="3" class="formseparator"><hr/></td></tr>
         <tr class="formrow">
           <td class="formcolumncell">
-            <a name="s${SeqNum}_forcedmetadata_tag"/>
-            <input type="hidden" name="s${SeqNum}_forcedmetadata_op" value="Continue"/>
-            <input type="button" value="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.Add'))" alt="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.Addforcedmetadata'))" onclick="javascript:s${SeqNum}_AddForcedMetadata();"/>
-            <input type="hidden" name="s${SeqNum}_forcedmetadata_count" value="${paramcounter}"/>
+            <a name="s${SEQNUM}_forcedmetadata_tag"/>
+            <input type="hidden" name="s${SEQNUM}_forcedmetadata_op" value="Continue"/>
+            <input type="button" value="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.Add'))" alt="$Encoder.attributeEscape($ResourceBundle.getString('ForcedMetadata.Addforcedmetadata'))" onclick="javascript:s${SEQNUM}_AddForcedMetadata();"/>
+            <input type="hidden" name="s${SEQNUM}_forcedmetadata_count" value="${paramcounter}"/>
           </td>
           <td class="formcolumncell">
-            <input type="text" name="s${SeqNum}_forcedmetadata_name" size="30" value=""/>
+            <input type="text" name="s${SEQNUM}_forcedmetadata_name" size="30" value=""/>
           </td>
           <td class="formcolumncell">
-            <input type="text" name="s${SeqNum}_forcedmetadata_value" size="30" value=""/>
+            <input type="text" name="s${SEQNUM}_forcedmetadata_value" size="30" value=""/>
           </td>
         </tr>
       </table>
@@ -79,11 +79,11 @@
 #else
 
   #set($paramcounter = 0)
-  #foreach($paramrecord in $Parameters)
-<input type="hidden" name="s${SeqNum}_forcedmetadata_${paramcounter}_name" value="$Encoder.attributeEscape($paramrecord.get('parameter'))" />
-<input type="hidden" name="s${SeqNum}_forcedmetadata_${paramcounter}_value" value="$Encoder.attributeEscape($paramrecord.get('value'))" />
+  #foreach($paramrecord in $PARAMETERS)
+<input type="hidden" name="s${SEQNUM}_forcedmetadata_${paramcounter}_name" value="$Encoder.attributeEscape($paramrecord.get('parameter'))" />
+<input type="hidden" name="s${SEQNUM}_forcedmetadata_${paramcounter}_value" value="$Encoder.attributeEscape($paramrecord.get('value'))" />
     #set($paramcounter = $paramcounter + 1)
   #end
-<input type="hidden" name="s${SeqNum}_forcedmetadata_count" value="${paramcounter}"/>
+<input type="hidden" name="s${SEQNUM}_forcedmetadata_count" value="${paramcounter}"/>
 
 #end

Modified: manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/viewSpecification.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/viewSpecification.html?rev=1603759&r1=1603758&r2=1603759&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/viewSpecification.html (original)
+++ manifoldcf/trunk/connectors/forcedmetadata/connector/src/main/resources/org/apache/manifoldcf/agents/transformation/forcedmetadata/viewSpecification.html Thu Jun 19 08:46:08 2014
@@ -19,6 +19,46 @@
   <tr>
     <td class="separator" colspan="4"><hr/></td>
   </tr>
+
+  <tr>
+    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.FieldMappings'))</nobr></td>
+    <td class="boxcell">
+      <table class="formtable">
+        <tr class="formheaderrow">
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.MetadataFieldName'))</nobr></td>
+          <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.FinalFieldName'))</nobr></td>
+        </tr>
+#set($fieldcounter = 0)
+#foreach($fieldmapping in $FIELDMAPPINGS)
+  #if(($fieldcounter % 2) == 0)
+        <tr class="evenformrow">
+  #else
+        <tr class="oddformrow">
+  #end
+          <td class="formcolumncell">
+            <nobr>$Encoder.bodyEscape($fieldmapping.get('SOURCE'))</nobr>
+          </td>
+          <td class="formcolumncell">
+            <nobr>$Encoder.bodyEscape($fieldmapping.get('TARGETDISPLAY'))</nobr>
+          </td>
+        </tr>
+  #set($fieldcounter = $fieldcounter + 1)
+#end
+#if($fieldcounter == 0)
+        <tr class="formrow"><td class="formmessage" colspan="2">$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.NoFieldMappingSpecified'))</td></tr>
+#end
+      </table>
+    </td>
+  </tr>
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
+  <tr>
+    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.KeepAllMetadata'))</nobr></td>
+    <td class="value"><nobr>$Encoder.bodyEscape($KEEPALLMETADATA)</nobr></td>
+  </tr>
+
+  <tr>
+    <td class="separator" colspan="4"><hr/></td>
+  </tr>
   <tr>
     <td class="description" colspan="1"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.ForcedMetadataColon'))</nobr></td>
     <td class="boxcell" colspan="3">
@@ -28,7 +68,7 @@
           <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ForcedMetadata.ParameterValue'))</nobr></td>
         </tr>
   #set($paramcounter = 0)
-  #foreach($paramrecord in $Parameters)
+  #foreach($paramrecord in $PARAMETERS)
     #if(($paramcounter % 2) == 0)
         <tr class="evenformrow">
     #else

Modified: manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/RepositoryDocument.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/RepositoryDocument.java?rev=1603759&r1=1603758&r2=1603759&view=diff
==============================================================================
--- manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/RepositoryDocument.java (original)
+++ manifoldcf/trunk/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/RepositoryDocument.java Thu Jun 19 08:46:08 2014
@@ -102,6 +102,16 @@ public class RepositoryDocument
     return rval;
   }
   
+  /** Clear all fields.
+  */
+  public void clearFields()
+  {
+    fields.clear();
+    stringFields.clear();
+    dateFields.clear();
+    readerFields.clear();
+  }
+  
   /** Set the document's created date.  Use null to indicate that the date is unknown.
   *@param date is the date.
   */



Mime
View raw message