incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1299512 - in /incubator/lcf/trunk: ./ connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/ connec...
Date Mon, 12 Mar 2012 00:58:39 GMT
Author: kwright
Date: Mon Mar 12 00:58:38 2012
New Revision: 1299512

URL: http://svn.apache.org/viewvc?rev=1299512&view=rev
Log:
Fix for CONNECTORS-422.  Split out tabs so there's one velocity template per tab.

Added:
    incubator/lcf/trunk/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editConfiguration_Server.html
      - copied unchanged from r1299486, incubator/lcf/branches/CONNECTORS-422/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editConfiguration_Server.html
    incubator/lcf/trunk/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification_LuceneQuery.html
      - copied unchanged from r1299486, incubator/lcf/branches/CONNECTORS-422/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification_LuceneQuery.html
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration_Server.html
      - copied unchanged from r1299486, incubator/lcf/branches/CONNECTORS-422/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration_Server.html
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification_CMISQuery.html
      - copied unchanged from r1299486, incubator/lcf/branches/CONNECTORS-422/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification_CMISQuery.html
Removed:
    incubator/lcf/trunk/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editConfiguration.html
    incubator/lcf/trunk/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification.html
    incubator/lcf/trunk/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenConfiguration.html
    incubator/lcf/trunk/connectors/alfresco/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenSpecification.html
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/editSpecification.html
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/hiddenConfiguration.html
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/cmis/hiddenSpecification.html
    incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/hiddenConfiguration.html
    incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/hiddenSpecification.html
Modified:
    incubator/lcf/trunk/   (props changed)
    incubator/lcf/trunk/CHANGES.txt
    incubator/lcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
    incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
    incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
    incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/editConfiguration.html
    incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/editSpecification.html

Propchange: incubator/lcf/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Mar 12 00:58:38 2012
@@ -21,3 +21,4 @@
 /incubator/lcf/branches/CONNECTORS-388:1233014-1234466
 /incubator/lcf/branches/CONNECTORS-402:1242059-1242965
 /incubator/lcf/branches/CONNECTORS-420:1295533-1295923
+/incubator/lcf/branches/CONNECTORS-422:1298811-1299486

Modified: incubator/lcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/CHANGES.txt?rev=1299512&r1=1299511&r2=1299512&view=diff
==============================================================================
--- incubator/lcf/trunk/CHANGES.txt (original)
+++ incubator/lcf/trunk/CHANGES.txt Mon Mar 12 00:58:38 2012
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 0.5-dev =====================
 
+CONNECTORS-422: Rearrange Velocity templates so that there's one
+template per tab.
+(Karl Wright)
+
 CONNECTORS-381: Add an OpenSearchServer UI test.  While we were
 at it fixed a broken CMIS UI.
 (Karl Wright)

Modified: incubator/lcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java?rev=1299512&r1=1299511&r2=1299512&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
(original)
+++ incubator/lcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
Mon Mar 12 00:58:38 2012
@@ -89,42 +89,41 @@ public class AlfrescoRepositoryConnector
 
   protected static final String RELATIONSHIP_CHILD = "child";
 
-  /** Forward to the HTML template to view the configuration parameters */
-  private static final String VIEW_CONFIG_FORWARD = "viewConfiguration.html";
-  
-  /** Forward to the HTML template to edit the configuration parameters */
-  private static final String EDIT_CONFIG_FORWARD = "editConfiguration.html";
+  // Tabs
   
+  /** The Lucene Query label for the configuration tab of the job settings */
+  private static final String TAB_LABEL_LUCENE_QUERY_RESOURCE = "AlfrescoConnector.LuceneQuery";
+  /** Alfresco Server configuration tab name */
+  private static final String ALFRESCO_SERVER_TAB_RESOURCE = "AlfrescoConnector.Server";
+
+  // Velocity template names
+
   /** Forward to the javascript to check the configuration parameters */
   private static final String EDIT_CONFIG_HEADER_FORWARD = "editConfiguration.js";
 
-  /** Forward to the template to view the specification parameters for the job */
-  private static final String VIEW_SPEC_FORWARD = "viewSpecification.html";
-  
-  /** Forward to the template to edit the configuration parameters for the job */
-  private static final String EDIT_SPEC_FORWARD = "editSpecification.html";
+  /** Forward to the HTML template to edit the configuration parameters */
+  private static final String EDIT_CONFIG_FORWARD_SERVER = "editConfiguration_Server.html";
   
   /** Forward to the javascript to check the specification parameters for the job */
   private static final String EDIT_SPEC_HEADER_FORWARD = "editSpecification.js";
+
+  /** Forward to the template to edit the configuration parameters for the job */
+  private static final String EDIT_SPEC_FORWARD_LUCENEQUERY = "editSpecification_LuceneQuery.html";
   
-  /** Forward to the HTML template for rendering hidden fields when the Server tab is not
selected */
-  private static final String HIDDEN_CONFIG_FORWARD = "hiddenConfiguration.html";
+  /** Forward to the HTML template to view the configuration parameters */
+  private static final String VIEW_CONFIG_FORWARD = "viewConfiguration.html";
   
-  /** Forward to the HTML template for rendering hidden fields when the Lucene Query tab
is not selected */
-  private static final String HIDDEN_SPEC_FORWARD = "hiddenSpecification.html";
+  /** Forward to the template to view the specification parameters for the job */
+  private static final String VIEW_SPEC_FORWARD = "viewSpecification.html";
 
+  // Other miscellaneous constants
+  
   /** The root node for the Alfresco connector configuration in ManifoldCF */
   private static final String JOB_STARTPOINT_NODE_TYPE = "startpoint";
 
-  /** The Lucene Query label for the configuration tab of the job settings */
-  private static final String TAB_LABEL_LUCENE_QUERY_RESOURCE = "AlfrescoConnector.LuceneQuery";
-
   /** Read activity */
   protected final static String ACTIVITY_READ = "read document";
   
-  /** Alfresco Server configuration tab name */
-  private static final String ALFRESCO_SERVER_TAB_RESOURCE = "AlfrescoConnector.Server";
-  
   /** Separator used when a node has more than one content stream. More than one d:content
property */
   private static final String INGESTION_SEPARATOR_FOR_MULTI_BINARY = ";";
 
@@ -156,7 +155,7 @@ public class AlfrescoRepositoryConnector
    */
   @Override
   public String[] getBinNames(String documentIdentifier) {
-    return new String[] { protocol+"://"+server+":"+port+"/"+path };
+    return new String[] { server };
   }
 
   /** 
@@ -421,17 +420,50 @@ public class AlfrescoRepositoryConnector
    * @throws ManifoldCFException
    */
   private static void outputResource(String resName, IHTTPOutput out,
-      Locale locale, ConfigParams params) throws ManifoldCFException {
-    Map<String,String> paramMap = new HashMap<String,String>();
-    Iterator<String> i = params.listParameters();
-    while(i.hasNext()){
-      String key = i.next();
-      String value = params.getParameter(key);
-      paramMap.put(key,value);
-    }
+      Locale locale, Map<String,String> paramMap) throws ManifoldCFException {
     Messages.outputResourceWithVelocity(out,locale,resName,paramMap,true);
   }
 
+  /** Fill in Velocity parameters for the Server tab.
+  */
+  private static void fillInServerParameters(Map<String,String> paramMap, ConfigParams
parameters)
+  {
+    String username = parameters.getParameter(AlfrescoConfig.USERNAME_PARAM);
+    if (username == null)
+      username = AlfrescoConfig.USERNAME_DEFAULT_VALUE;
+    paramMap.put(AlfrescoConfig.USERNAME_PARAM, username);
+
+    String password = parameters.getParameter(AlfrescoConfig.PASSWORD_PARAM);
+    if (password == null) 
+      password = AlfrescoConfig.PASSWORD_DEFAULT_VALUE;
+    paramMap.put(AlfrescoConfig.PASSWORD_PARAM, password);
+    
+    String protocol = parameters.getParameter(AlfrescoConfig.PROTOCOL_PARAM);
+    if (protocol == null)
+      protocol = AlfrescoConfig.PROTOCOL_DEFAULT_VALUE;
+    paramMap.put(AlfrescoConfig.PROTOCOL_PARAM, protocol);
+    
+    String server = parameters.getParameter(AlfrescoConfig.SERVER_PARAM);
+    if (server == null)
+      server = AlfrescoConfig.SERVER_DEFAULT_VALUE;
+    paramMap.put(AlfrescoConfig.SERVER_PARAM, server);
+    
+    String port = parameters.getParameter(AlfrescoConfig.PORT_PARAM);
+    if (port == null)
+      port = AlfrescoConfig.PORT_DEFAULT_VALUE;
+    paramMap.put(AlfrescoConfig.PORT_PARAM, port);
+    
+    String path = parameters.getParameter(AlfrescoConfig.PATH_PARAM);
+    if (path == null)
+      path = AlfrescoConfig.PATH_DEFAULT_VALUE;
+    paramMap.put(AlfrescoConfig.PATH_PARAM, path);
+    
+    String tenantDomain = parameters.getParameter(AlfrescoConfig.TENANT_DOMAIN_PARAM);
+    if (tenantDomain == null)
+      tenantDomain = "";
+    paramMap.put(AlfrescoConfig.TENANT_DOMAIN_PARAM, tenantDomain);
+  }
+
   /**
    * View configuration. This method is called in the body section of the
    * connector's view configuration page. Its purpose is to present the
@@ -449,45 +481,16 @@ public class AlfrescoRepositoryConnector
    */
   @Override
   public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out,
-      Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException {
-    
-    String username = parameters.getParameter(AlfrescoConfig.USERNAME_PARAM);
-    if (StringUtils.isEmpty(username)) {
-      parameters.setParameter(AlfrescoConfig.USERNAME_PARAM, AlfrescoConfig.USERNAME_DEFAULT_VALUE);
-    }
-
-    String password = parameters.getParameter(AlfrescoConfig.PASSWORD_PARAM);
-    if (StringUtils.isEmpty(password)) {
-      parameters.setParameter(AlfrescoConfig.PASSWORD_PARAM, AlfrescoConfig.PASSWORD_DEFAULT_VALUE);
-    }
-    
-    String protocol = parameters.getParameter(AlfrescoConfig.PROTOCOL_PARAM);
-    if (StringUtils.isEmpty(protocol)) {
-      parameters.setParameter(AlfrescoConfig.PROTOCOL_PARAM, AlfrescoConfig.PROTOCOL_DEFAULT_VALUE);
-    }
-    
-    String server = parameters.getParameter(AlfrescoConfig.SERVER_PARAM);
-    if (StringUtils.isEmpty(server)) {
-      parameters.setParameter(AlfrescoConfig.SERVER_PARAM, AlfrescoConfig.SERVER_DEFAULT_VALUE);
-    }
-    
-    String port = parameters.getParameter(AlfrescoConfig.PORT_PARAM);
-    if (StringUtils.isEmpty(port)) {
-      parameters.setParameter(AlfrescoConfig.PORT_PARAM, AlfrescoConfig.PORT_DEFAULT_VALUE);
-    }
-    
-    String path = parameters.getParameter(AlfrescoConfig.PATH_PARAM);
-    if (StringUtils.isEmpty(path)) {
-      parameters.setParameter(AlfrescoConfig.PATH_PARAM, AlfrescoConfig.PATH_DEFAULT_VALUE);
-    }
-    
-    String tenantDomain = parameters.getParameter(AlfrescoConfig.TENANT_DOMAIN_PARAM);
-    if (StringUtils.isEmpty(tenantDomain)){
-      parameters.setParameter(AlfrescoConfig.TENANT_DOMAIN_PARAM, StringUtils.EMPTY);
-    }
-
-    outputResource(VIEW_CONFIG_FORWARD, out, locale, parameters);
+    Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException {
+        
+    Map<String,String> paramMap = new HashMap<String,String>();
+        
+    // Fill in parameters for all tabs
 
+    // Server tab
+    fillInServerParameters(paramMap, parameters);
+  
+    outputResource(VIEW_CONFIG_FORWARD, out, locale, paramMap);
   }
 
   /**
@@ -511,8 +514,15 @@ public class AlfrescoRepositoryConnector
   public void outputConfigurationHeader(IThreadContext threadContext,
       IHTTPOutput out, Locale locale, ConfigParams parameters, List<String> tabsArray)
       throws ManifoldCFException, IOException {
+    // Add Server tab
     tabsArray.add(Messages.getString(locale,ALFRESCO_SERVER_TAB_RESOURCE));
-    outputResource(EDIT_CONFIG_HEADER_FORWARD, out, locale, parameters);
+
+    Map<String,String> paramMap = new HashMap<String,String>();
+        
+    // Fill in parameters for all tabs
+    fillInServerParameters(paramMap, parameters);
+
+    outputResource(EDIT_CONFIG_HEADER_FORWARD, out, locale, paramMap);
   }
 
   /** Output the configuration body section.
@@ -529,45 +539,11 @@ public class AlfrescoRepositoryConnector
       IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName)
       throws ManifoldCFException, IOException {
     
-    String username = parameters.getParameter(AlfrescoConfig.USERNAME_PARAM);
-    String password = parameters.getParameter(AlfrescoConfig.PASSWORD_PARAM);
-    String protocol = parameters.getParameter(AlfrescoConfig.PROTOCOL_PARAM);
-    String server = parameters.getParameter(AlfrescoConfig.SERVER_PARAM);
-    String port = parameters.getParameter(AlfrescoConfig.PORT_PARAM);
-    String path = parameters.getParameter(AlfrescoConfig.PATH_PARAM);
-      String tenantDomain = parameters.getParameter(AlfrescoConfig.TENANT_DOMAIN_PARAM);
-      
-    if (username == null)
-      username = "admin";
-    if (password == null)
-      password = "admin";
-    if (protocol == null)
-      protocol = "http";
-    if (server == null)
-      server = "localhost";
-    if (port == null)
-      port = "8080";
-    if (path == null)
-      path = "/alfresco/api";
-    
-    if(StringUtils.isEmpty(tenantDomain))
-      tenantDomain = StringUtils.EMPTY;
-  
-    parameters.setParameter(AlfrescoConfig.TENANT_DOMAIN_PARAM, tenantDomain);
-    parameters.setParameter(AlfrescoConfig.USERNAME_PARAM, username);
-    parameters.setParameter(AlfrescoConfig.PASSWORD_PARAM, password);
-    parameters.setParameter(AlfrescoConfig.PROTOCOL_PARAM, protocol);
-    parameters.setParameter(AlfrescoConfig.SERVER_PARAM, server);
-    parameters.setParameter(AlfrescoConfig.PORT_PARAM, port);
-    parameters.setParameter(AlfrescoConfig.PATH_PARAM, path);
-    parameters.setParameter(AlfrescoConfig.TENANT_DOMAIN_PARAM, tenantDomain);
-      
-    if(Messages.getString(locale,ALFRESCO_SERVER_TAB_RESOURCE).equals(tabName)){
-      outputResource(EDIT_CONFIG_FORWARD, out, locale, parameters);  
-
-    } else {
-      outputResource(HIDDEN_CONFIG_FORWARD, out, locale, parameters);
-    }
+    // Do the Server tab
+    Map<String,String> paramMap = new HashMap<String,String>();
+    paramMap.put("TabName", tabName);
+    fillInServerParameters(paramMap, parameters);
+    outputResource(EDIT_CONFIG_FORWARD_SERVER, out, locale, paramMap);  
   }
 
   /**
@@ -595,50 +571,59 @@ public class AlfrescoRepositoryConnector
       throws ManifoldCFException {
 
     String username = variableContext.getParameter(AlfrescoConfig.USERNAME_PARAM);
-    if (StringUtils.isNotEmpty(username)) {
+    if (username != null) {
       parameters.setParameter(AlfrescoConfig.USERNAME_PARAM, username);
     }
 
     String password = variableContext.getParameter(AlfrescoConfig.PASSWORD_PARAM);
-    if (StringUtils.isNotEmpty(password)) {
+    if (password != null) {
       parameters.setParameter(AlfrescoConfig.PASSWORD_PARAM, password);
     }
     
     String protocol = variableContext.getParameter(AlfrescoConfig.PROTOCOL_PARAM);
-    if (StringUtils.isNotEmpty(protocol)) {
+    if (protocol != null) {
       parameters.setParameter(AlfrescoConfig.PROTOCOL_PARAM, protocol);
     }
     
     String server = variableContext.getParameter(AlfrescoConfig.SERVER_PARAM);
-    if (StringUtils.isNotEmpty(server) && !StringUtils.contains(server, '/')) {
+    if (server != null) {
       parameters.setParameter(AlfrescoConfig.SERVER_PARAM, server);
     }
     
     String port = variableContext.getParameter(AlfrescoConfig.PORT_PARAM);
-    if (StringUtils.isNotEmpty(port)){
-      try {
-        Integer.parseInt(port);
-        parameters.setParameter(AlfrescoConfig.PORT_PARAM, port);
-      } catch (NumberFormatException e) {
-        
-      }
+    if (port != null){
+      parameters.setParameter(AlfrescoConfig.PORT_PARAM, port);
     }
     
     String path = variableContext.getParameter(AlfrescoConfig.PATH_PARAM);
-    if (StringUtils.isNotEmpty(path)) {
+    if (path != null) {
       parameters.setParameter(AlfrescoConfig.PATH_PARAM, path);
     }
     
     String tenantDomain = variableContext.getParameter(AlfrescoConfig.TENANT_DOMAIN_PARAM);
-    if(StringUtils.isNotEmpty(tenantDomain)){
+    if (tenantDomain != null){
       parameters.setParameter(AlfrescoConfig.TENANT_DOMAIN_PARAM, tenantDomain);
-    } else {
-      parameters.setParameter(AlfrescoConfig.TENANT_DOMAIN_PARAM, StringUtils.EMPTY);
     }
     
     return null;
   }
 
+  /** Fill in Velocity parameters for the LuceneQuery tab.
+  */
+  private static void fillInLuceneQueryParameters(Map<String,String> paramMap, DocumentSpecification
ds)
+  {
+    int i = 0;
+    String luceneQuery = "";
+    while (i < ds.getChildCount()) {
+      SpecificationNode sn = ds.getChild(i);
+      if (sn.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
+        luceneQuery = sn.getAttributeValue(AlfrescoConfig.LUCENE_QUERY_PARAM);
+      }
+      i++;
+    }
+    paramMap.put(AlfrescoConfig.LUCENE_QUERY_PARAM, luceneQuery);
+  }
+
   /**
    * View specification. This method is called in the body section of a job's
    * view page. Its purpose is to present the document specification information
@@ -653,18 +638,12 @@ public class AlfrescoRepositoryConnector
   @Override
   public void viewSpecification(IHTTPOutput out, Locale locale, DocumentSpecification ds)
       throws ManifoldCFException, IOException {
-    int i = 0;
-    ConfigParams specificationParams = new ConfigParams();
-    String luceneQuery = "";
-    while (i < ds.getChildCount()) {
-      SpecificationNode sn = ds.getChild(i);
-      if (sn.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
-        luceneQuery = sn.getAttributeValue(AlfrescoConfig.LUCENE_QUERY_PARAM);
-      }
-      i++;
-    }
-    specificationParams.setParameter(AlfrescoConfig.LUCENE_QUERY_PARAM.toUpperCase(), luceneQuery);
-    outputResource(VIEW_SPEC_FORWARD, out, locale, specificationParams);
+    Map<String,String> paramMap = new HashMap<String,String>();
+        
+    // Fill in parameters from all tabs
+    fillInLuceneQueryParameters(paramMap, ds);
+
+    outputResource(VIEW_SPEC_FORWARD, out, locale, paramMap);
   }
 
   /**
@@ -685,32 +664,20 @@ public class AlfrescoRepositoryConnector
   @Override
   public String processSpecificationPost(IPostParameters variableContext,
       Locale locale, DocumentSpecification ds) throws ManifoldCFException {
-    String luceneQuery = variableContext
-        .getParameter(AlfrescoConfig.LUCENE_QUERY_PARAM);
-    if (StringUtils.isNotEmpty(luceneQuery)) {
+    String luceneQuery = variableContext.getParameter(AlfrescoConfig.LUCENE_QUERY_PARAM);
+    if (luceneQuery != null) {
       int i = 0;
       while (i < ds.getChildCount()) {
         SpecificationNode oldNode = ds.getChild(i);
         if (oldNode.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
           ds.removeChild(i);
-          break;
         }
-        i++;
+        else
+          i++;
       }
       SpecificationNode node = new SpecificationNode(JOB_STARTPOINT_NODE_TYPE);
       node.setAttribute(AlfrescoConfig.LUCENE_QUERY_PARAM, luceneQuery);
-      variableContext.setParameter(AlfrescoConfig.LUCENE_QUERY_PARAM, luceneQuery);
       ds.addChild(ds.getChildCount(), node);
-    } else {
-      int i = 0;
-      while (i < ds.getChildCount()) {
-        SpecificationNode oldNode = ds.getChild(i);
-        if (oldNode.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
-          variableContext.setParameter(AlfrescoConfig.LUCENE_QUERY_PARAM,
-              oldNode.getAttributeValue(AlfrescoConfig.LUCENE_QUERY_PARAM));
-        }
-        i++;
-      }
     }
 
     return null;
@@ -735,24 +702,14 @@ public class AlfrescoRepositoryConnector
   public void outputSpecificationBody(IHTTPOutput out, Locale locale,
       DocumentSpecification ds, String tabName) throws ManifoldCFException,
       IOException {
-    String luceneQuery = StringUtils.EMPTY;
-    int i = 0;
-    while (i < ds.getChildCount()) {
-      SpecificationNode n = ds.getChild(i);
-      if (n.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
-        luceneQuery = n.getAttributeValue(AlfrescoConfig.LUCENE_QUERY_PARAM);
-        break;
-      }
-      i++;
-    }
     
-    ConfigParams params = new ConfigParams();
-    params.setParameter(AlfrescoConfig.LUCENE_QUERY_PARAM, luceneQuery);
-    if (tabName.equals(Messages.getString(locale,TAB_LABEL_LUCENE_QUERY_RESOURCE))) {
-      outputResource(EDIT_SPEC_FORWARD, out, locale, params);
-    } else {
-      outputResource(HIDDEN_SPEC_FORWARD, out, locale, params);
-    }
+    // Do all tabs in turn.
+        
+    // LuceneQuery tab
+    Map<String,String> paramMap = new HashMap<String,String>();
+    paramMap.put("TabName", tabName);
+    fillInLuceneQueryParameters(paramMap, ds);
+    outputResource(EDIT_SPEC_FORWARD_LUCENEQUERY, out, locale, paramMap);
   }
 
   /**
@@ -773,8 +730,16 @@ public class AlfrescoRepositoryConnector
   public void outputSpecificationHeader(IHTTPOutput out,
       Locale locale, DocumentSpecification ds, List<String> tabsArray)
       throws ManifoldCFException, IOException {
+    // Add LuceneQuery tab
     tabsArray.add(Messages.getString(locale,TAB_LABEL_LUCENE_QUERY_RESOURCE));
-    outputResource(EDIT_SPEC_HEADER_FORWARD, out, locale, params);
+        
+    // Fill in parameters from all tabs
+    Map<String,String> paramMap = new HashMap<String,String>();
+        
+    // LuceneQuery tab
+    fillInLuceneQueryParameters(paramMap, ds);
+
+    outputResource(EDIT_SPEC_HEADER_FORWARD, out, locale, paramMap);
   }
 
   /** Process a set of documents.

Modified: incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java?rev=1299512&r1=1299511&r2=1299512&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
(original)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
Mon Mar 12 00:58:38 2012
@@ -80,33 +80,33 @@ public class CmisRepositoryConnector ext
   private static final String CMIS_DOCUMENT_BASE_TYPE = "cmis:document";
   private static final SimpleDateFormat ISO8601_DATE_FORMATTER = new SimpleDateFormat(
       "yyyy-MM-dd'T'HH:mm:ssZ");
+
+  // Tab name properties
   
-  /** Forward to the HTML template to view the configuration parameters */
-  private static final String VIEW_CONFIG_FORWARD = "viewConfiguration.html";
-  
-  /** Forward to the HTML template to edit the configuration parameters */
-  private static final String EDIT_CONFIG_FORWARD = "editConfiguration.html";
+  private static final String CMIS_SERVER_TAB_PROPERTY = "CmisRepositoryConnector.Server";
+  private static final String CMIS_QUERY_TAB_PROPERTY = "CmisRepositoryConnector.CMISQuery";
+
   
-  /** Forward to the javascript to check the configuration parameters */
+  // Template names
+
+    /** Forward to the javascript to check the configuration parameters */
   private static final String EDIT_CONFIG_HEADER_FORWARD = "editConfiguration.js";
-  
-  /** Forward to the template to view the specification parameters for the job */
-  private static final String VIEW_SPEC_FORWARD = "viewSpecification.html";
-  
-  /** Forward to the template to edit the configuration parameters for the job */
-  private static final String EDIT_SPEC_FORWARD = "editSpecification.html";
-  
+
+  /** Server tab template */
+  private static final String EDIT_CONFIG_FORWARD_SERVER = "editConfiguration_Server.html";
+
   /** Forward to the javascript to check the specification parameters for the job */
   private static final String EDIT_SPEC_HEADER_FORWARD = "editSpecification.js";
   
-  /** Forward to the HTML template for rendering hidden fields when the Server tab is not
selected */
-  private static final String HIDDEN_CONFIG_FORWARD = "hiddenConfiguration.html";
+  /** Forward to the template to edit the configuration parameters for the job */
+  private static final String EDIT_SPEC_FORWARD_CMISQUERY = "editSpecification_CMISQuery.html";
   
-  /** Forward to the HTML template for rendering hidden fields when the CMIS Query tab is
not selected */
-  private static final String HIDDEN_SPEC_FORWARD = "hiddenSpecification.html";
+  /** Forward to the HTML template to view the configuration parameters */
+  private static final String VIEW_CONFIG_FORWARD = "viewConfiguration.html";
+  
+  /** Forward to the template to view the specification parameters for the job */
+  private static final String VIEW_SPEC_FORWARD = "viewSpecification.html";
   
-  private static final String CMIS_SERVER_TAB_PROPERTY = "CmisRepositoryConnector.Server";
-  private static final String CMIS_QUERY_TAB_PROPERTY = "CmisRepositoryConnector.CMISQuery";
   
   /**
    * CMIS Session handle
@@ -167,7 +167,7 @@ public class CmisRepositoryConnector ext
    */
   @Override
   public String[] getBinNames(String documentIdentifier) {
-    return new String[] { protocol+"://"+server+":"+port+path };
+    return new String[] { server };
   }
 
   protected class GetSessionThread extends Thread {
@@ -688,16 +688,51 @@ public class CmisRepositoryConnector ext
    * @throws ManifoldCFException
    */
   private static void outputResource(String resName, IHTTPOutput out,
-      Locale locale, ConfigParams params) throws ManifoldCFException {
-    Map<String,String> paramMap = new HashMap<String,String>();
-    Iterator<String> i = params.listParameters();
-    while(i.hasNext()){
-      String key = i.next();
-      String value = params.getParameter(key);
-      paramMap.put(key,value);
-    }
+      Locale locale, Map<String,String> paramMap) throws ManifoldCFException {
     Messages.outputResourceWithVelocity(out,locale,resName,paramMap,true);
   }
+
+  /** Fill in a Server tab configuration parameter map for calling a Velocity template.
+  *@param newMap is the map to fill in
+  *@param parameters is the current set of configuration parameters
+  */
+  private static void fillInServerConfigurationMap(Map<String,String> newMap, ConfigParams
parameters)
+  {
+    String username = parameters.getParameter(CmisConfig.USERNAME_PARAM);
+    String password = parameters.getParameter(CmisConfig.PASSWORD_PARAM);
+    String protocol = parameters.getParameter(CmisConfig.PROTOCOL_PARAM);
+    String server = parameters.getParameter(CmisConfig.SERVER_PARAM);
+    String port = parameters.getParameter(CmisConfig.PORT_PARAM);
+    String path = parameters.getParameter(CmisConfig.PATH_PARAM);
+    String repositoryId = parameters.getParameter(CmisConfig.REPOSITORY_ID_PARAM);
+    String binding = parameters.getParameter(CmisConfig.BINDING_PARAM);
+      
+    if(username == null)
+      username = StringUtils.EMPTY;
+    if(password == null)
+      password = StringUtils.EMPTY;
+    if(protocol == null)
+      protocol = CmisConfig.PROTOCOL_DEFAULT_VALUE;
+    if(server == null)
+      server = CmisConfig.SERVER_DEFAULT_VALUE;
+    if(port == null)
+      port = CmisConfig.PORT_DEFAULT_VALUE;
+    if(path == null)
+      path = CmisConfig.PATH_DEFAULT_VALUE;
+    if(repositoryId == null)
+      repositoryId = StringUtils.EMPTY;
+    if(binding == null)
+      binding = CmisConfig.BINDING_ATOM_VALUE;
+      
+    newMap.put(CmisConfig.USERNAME_PARAM, username);
+    newMap.put(CmisConfig.PASSWORD_PARAM, password);
+    newMap.put(CmisConfig.PROTOCOL_PARAM, protocol);
+    newMap.put(CmisConfig.SERVER_PARAM, server);
+    newMap.put(CmisConfig.PORT_PARAM, port);
+    newMap.put(CmisConfig.PATH_PARAM, path);
+    newMap.put(CmisConfig.REPOSITORY_ID_PARAM, repositoryId);
+    newMap.put(CmisConfig.BINDING_PARAM, binding);
+  }
   
   /**
    * View configuration. This method is called in the body section of the
@@ -717,11 +752,12 @@ public class CmisRepositoryConnector ext
   @Override
   public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out,
       Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException {
-    String repositoryId = parameters.getParameter(CmisConfig.REPOSITORY_ID_PARAM);
-    if(StringUtils.isEmpty(repositoryId))
-      repositoryId = StringUtils.EMPTY;
-    parameters.setParameter(CmisConfig.REPOSITORY_ID_PARAM, repositoryId);
-    outputResource(VIEW_CONFIG_FORWARD, out, locale, parameters);
+    Map<String,String> paramMap = new HashMap<String,String>();
+	
+    // Fill in map from each tab
+    fillInServerConfigurationMap(paramMap, parameters);
+
+    outputResource(VIEW_CONFIG_FORWARD, out, locale, paramMap);
   }
 
   /**
@@ -746,55 +782,33 @@ public class CmisRepositoryConnector ext
   public void outputConfigurationHeader(IThreadContext threadContext,
       IHTTPOutput out, Locale locale, ConfigParams parameters, List<String> tabsArray)
       throws ManifoldCFException, IOException {
+    // Add the Server tab
     tabsArray.add(Messages.getString(locale,CMIS_SERVER_TAB_PROPERTY));
-    outputResource(EDIT_CONFIG_HEADER_FORWARD, out, locale, parameters);
+    // Map the parameters
+    Map<String,String> paramMap = new HashMap<String,String>();
+
+    // Fill in the parameters from each tab
+    fillInServerConfigurationMap(paramMap, parameters);
+
+    // Output the Javascript - only one Velocity template for all tabs
+    outputResource(EDIT_CONFIG_HEADER_FORWARD, out, locale, paramMap);
   }
 
   @Override
   public void outputConfigurationBody(IThreadContext threadContext,
       IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName)
       throws ManifoldCFException, IOException {
-    
-    String username = parameters.getParameter(CmisConfig.USERNAME_PARAM);
-    String password = parameters.getParameter(CmisConfig.PASSWORD_PARAM);
-    String protocol = parameters.getParameter(CmisConfig.PROTOCOL_PARAM);
-    String server = parameters.getParameter(CmisConfig.SERVER_PARAM);
-    String port = parameters.getParameter(CmisConfig.PORT_PARAM);
-    String path = parameters.getParameter(CmisConfig.PATH_PARAM);
-    String repositoryId = parameters.getParameter(CmisConfig.REPOSITORY_ID_PARAM);
-    String binding = parameters.getParameter(CmisConfig.BINDING_PARAM);
-      
-    if(username == null)
-      username = StringUtils.EMPTY;
-    if(password == null)
-      password = StringUtils.EMPTY;
-    if(protocol == null)
-      protocol = CmisConfig.PROTOCOL_DEFAULT_VALUE;
-    if(server == null)
-      server = CmisConfig.SERVER_DEFAULT_VALUE;
-    if(port == null)
-      port = CmisConfig.PORT_DEFAULT_VALUE;
-    if(path == null)
-      path = CmisConfig.PATH_DEFAULT_VALUE;
-    if(repositoryId == null)
-      repositoryId = StringUtils.EMPTY;
-    if(binding == null)
-      binding = CmisConfig.BINDING_ATOM_VALUE;
-      
-    ConfigParams newMap = new ConfigParams();
-    newMap.setParameter(CmisConfig.USERNAME_PARAM, username);
-    newMap.setParameter(CmisConfig.PASSWORD_PARAM, password);
-    newMap.setParameter(CmisConfig.PROTOCOL_PARAM, protocol);
-    newMap.setParameter(CmisConfig.SERVER_PARAM, server);
-    newMap.setParameter(CmisConfig.PORT_PARAM, port);
-    newMap.setParameter(CmisConfig.PATH_PARAM, path);
-    newMap.setParameter(CmisConfig.REPOSITORY_ID_PARAM, repositoryId);
-    newMap.setParameter(CmisConfig.BINDING_PARAM, binding);
-    if(Messages.getString(locale,CMIS_SERVER_TAB_PROPERTY).equals(tabName)){
-      outputResource(EDIT_CONFIG_FORWARD, out, locale, newMap);
-    } else {
-      outputResource(HIDDEN_CONFIG_FORWARD, out, locale, newMap);
-    }
+
+    // Call the Velocity templates for each tab
+
+    // Server tab
+    Map<String,String> paramMap = new HashMap<String,String>();
+    // Set the tab name
+    paramMap.put("TabName", tabName);
+    // Fill in the parameters
+    fillInServerConfigurationMap(paramMap, parameters);
+    outputResource(EDIT_CONFIG_FORWARD_SERVER, out, locale, paramMap);
+	
   }
 
   /**
@@ -866,6 +880,22 @@ public class CmisRepositoryConnector ext
     return null;
   }
 
+  /** Fill in specification Velocity parameter map for CMISQuery tab.
+  */
+  private static void fillInCMISQuerySpecificationMap(Map<String,String> newMap, DocumentSpecification
ds)
+  {
+    int i = 0;
+    String cmisQuery = "";
+    while (i < ds.getChildCount()) {
+      SpecificationNode sn = ds.getChild(i);
+      if (sn.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
+        cmisQuery = sn.getAttributeValue(CmisConfig.CMIS_QUERY_PARAM);
+      }
+      i++;
+    }
+    newMap.put(CmisConfig.CMIS_QUERY_PARAM, cmisQuery);
+  }
+
   /**
    * View specification. This method is called in the body section of a job's
    * view page. Its purpose is to present the document specification information
@@ -880,18 +910,13 @@ public class CmisRepositoryConnector ext
   @Override
   public void viewSpecification(IHTTPOutput out, Locale locale, DocumentSpecification ds)
       throws ManifoldCFException, IOException {
-    int i = 0;
-    ConfigParams specificationParams = new ConfigParams();
-    String cmisQuery = "";
-    while (i < ds.getChildCount()) {
-      SpecificationNode sn = ds.getChild(i);
-      if (sn.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
-        cmisQuery = sn.getAttributeValue(CmisConfig.CMIS_QUERY_PARAM);
-      }
-      i++;
-    }
-    specificationParams.setParameter(CmisConfig.CMIS_QUERY_PARAM.toUpperCase(), cmisQuery);
-    outputResource(VIEW_SPEC_FORWARD, out, locale, specificationParams);
+	
+    Map<String,String> paramMap = new HashMap<String,String>();
+
+    // Fill in the map with data from all tabs
+    fillInCMISQuerySpecificationMap(paramMap, ds);
+  
+    outputResource(VIEW_SPEC_FORWARD, out, locale, paramMap);
   }
 
   /**
@@ -913,7 +938,7 @@ public class CmisRepositoryConnector ext
   public String processSpecificationPost(IPostParameters variableContext,
       DocumentSpecification ds) throws ManifoldCFException {
     String cmisQuery = variableContext.getParameter(CmisConfig.CMIS_QUERY_PARAM);
-    if (StringUtils.isNotEmpty(cmisQuery)) {
+    if (cmisQuery != null) {
       int i = 0;
       while (i < ds.getChildCount()) {
         SpecificationNode oldNode = ds.getChild(i);
@@ -927,18 +952,7 @@ public class CmisRepositoryConnector ext
       node.setAttribute(CmisConfig.CMIS_QUERY_PARAM, cmisQuery);
       variableContext.setParameter(CmisConfig.CMIS_QUERY_PARAM, cmisQuery);
       ds.addChild(ds.getChildCount(), node);
-    } else {
-      int i = 0;
-      while (i < ds.getChildCount()) {
-        SpecificationNode oldNode = ds.getChild(i);
-        if (oldNode.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
-          variableContext.setParameter(CmisConfig.CMIS_QUERY_PARAM,
-              oldNode.getAttributeValue(CmisConfig.CMIS_QUERY_PARAM));
-        }
-        i++;
-      }
     }
-
     return null;
   }
 
@@ -961,24 +975,12 @@ public class CmisRepositoryConnector ext
   public void outputSpecificationBody(IHTTPOutput out,
       Locale locale, DocumentSpecification ds, String tabName) throws ManifoldCFException,
       IOException {
-    String cmisQuery = StringUtils.EMPTY;
-    int i = 0;
-    while (i < ds.getChildCount()) {
-      SpecificationNode n = ds.getChild(i);
-      if (n.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
-        cmisQuery = n.getAttributeValue(CmisConfig.CMIS_QUERY_PARAM);
-        break;
-      }
-      i++;
-    }
 
-    ConfigParams params = new ConfigParams();
-    params.setParameter(CmisConfig.CMIS_QUERY_PARAM, cmisQuery);
-    if (tabName.equals(Messages.getString(locale,CMIS_QUERY_TAB_PROPERTY))) {
-      outputResource(EDIT_SPEC_FORWARD, out, locale, params);
-    } else {
-      outputResource(HIDDEN_SPEC_FORWARD, out, locale, params);
-    }
+    // Output CMISQuery tab
+    Map<String,String> paramMap = new HashMap<String,String>();
+    paramMap.put("TabName", tabName);
+    fillInCMISQuerySpecificationMap(paramMap, ds);
+    outputResource(EDIT_SPEC_FORWARD_CMISQUERY, out, locale, paramMap);
   }
 
   /**
@@ -1000,7 +1002,13 @@ public class CmisRepositoryConnector ext
       Locale locale, DocumentSpecification ds, List<String> tabsArray)
       throws ManifoldCFException, IOException {
     tabsArray.add(Messages.getString(locale,CMIS_QUERY_TAB_PROPERTY));
-    outputResource(EDIT_SPEC_HEADER_FORWARD, out, locale, params);
+	
+    Map<String,String> paramMap = new HashMap<String,String>();
+	
+    // Fill in the specification header map, using data from all tabs.
+    fillInCMISQuerySpecificationMap(paramMap, ds);
+
+    outputResource(EDIT_SPEC_HEADER_FORWARD, out, locale, paramMap);
   }
 
   /** Process a set of documents.

Modified: incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java?rev=1299512&r1=1299511&r2=1299512&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
(original)
+++ incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/java/org/apache/manifoldcf/agents/output/opensearchserver/OpenSearchServerConnector.java
Mon Mar 12 00:58:38 2012
@@ -60,15 +60,14 @@ public class OpenSearchServerConnector e
       OPENSEARCHSERVER_INDEXATION_ACTIVITY, OPENSEARCHSERVER_DELETION_ACTIVITY,
       OPENSEARCHSERVER_OPTIMIZE_ACTIVITY };
 
+  // Tab resources
+
   private final static String OPENSEARCHSERVER_TAB_MESSAGE = "OpenSearchServerConnector.OpenSearchServer";
   private final static String PARAMETERS_TAB_MESSAGE = "OpenSearchServerConnector.Parameters";
       
-  /** Forward to the HTML template for rendering hidden fields when the Server tab is not
selected */
-  private static final String HIDDEN_CONFIG_FORWARD = "hiddenConfiguration.html";
-  
-  /** Forward to the HTML template for rendering hidden fields when the CMIS Query tab is
not selected */
-  private static final String HIDDEN_SPEC_FORWARD = "hiddenSpecification.html";
-  
+  // Velocity templates
+  // These are not broken down by tabs because the design of this connector makes it difficult
to do it that way.
+
   /** Forward to the HTML template to edit the configuration parameters */
   private static final String EDIT_CONFIG_FORWARD = "editConfiguration.html";
   
@@ -87,6 +86,8 @@ public class OpenSearchServerConnector e
   /** Forward to the javascript to check the specification parameters for the job */
   private static final String EDIT_SPEC_HEADER_FORWARD = "editSpecification.js";
 
+  // Private data
+
   private String specsCacheOutpuDescription;
   private OpenSearchServerSpecs specsCache;
 
@@ -109,8 +110,15 @@ public class OpenSearchServerConnector e
    * @throws ManifoldCFException
    */
   private static void outputResource(String resName, IHTTPOutput out,
-      Locale locale, OpenSearchServerParam params) throws ManifoldCFException {
-    Messages.outputResourceWithVelocity(out,locale,resName,(params==null)?null:params.buildMap(),false);
+    Locale locale, OpenSearchServerParam params, String tabName) throws ManifoldCFException
{
+    Map<String,String> paramMap = null;
+    if (params != null) {
+      paramMap = params.buildMap();
+      if (tabName != null) {
+        paramMap.put("TabName", tabName);
+      }
+    }
+    Messages.outputResourceWithVelocity(out,locale,resName,paramMap,false);
   }
 
   @Override
@@ -119,7 +127,7 @@ public class OpenSearchServerConnector e
       throws ManifoldCFException, IOException {
     super.outputConfigurationHeader(threadContext, out, locale, parameters, tabsArray);
     tabsArray.add(Messages.getString(locale,PARAMETERS_TAB_MESSAGE));
-    outputResource(EDIT_CONFIG_HEADER_FORWARD, out, locale, null);
+    outputResource(EDIT_CONFIG_HEADER_FORWARD, out, locale, null, null);
   }
 
   @Override
@@ -128,11 +136,7 @@ public class OpenSearchServerConnector e
       throws ManifoldCFException, IOException {
     super.outputConfigurationBody(threadContext, out, locale, parameters, tabName);
     OpenSearchServerConfig config = this.getConfigParameters(parameters);
-    if (Messages.getString(locale,PARAMETERS_TAB_MESSAGE).equals(tabName)) {
-      outputResource(EDIT_CONFIG_FORWARD, out, locale, config);
-    } else {
-      outputResource(HIDDEN_CONFIG_FORWARD, out, locale, config);
-    }
+    outputResource(EDIT_CONFIG_FORWARD, out, locale, config, tabName);
   }
 
   @Override
@@ -141,7 +145,7 @@ public class OpenSearchServerConnector e
       throws ManifoldCFException, IOException {
     super.outputSpecificationHeader(out, locale, os, tabsArray);
     tabsArray.add(Messages.getString(locale,OPENSEARCHSERVER_TAB_MESSAGE));
-    outputResource(EDIT_SPEC_HEADER_FORWARD, out, locale, null);
+    outputResource(EDIT_SPEC_HEADER_FORWARD, out, locale, null, null);
   }
 
   final private SpecificationNode getSpecNode(OutputSpecification os) {
@@ -161,11 +165,7 @@ public class OpenSearchServerConnector e
       String tabName) throws ManifoldCFException, IOException {
     super.outputSpecificationBody(out, locale, os, tabName);
     OpenSearchServerSpecs specs = getSpecParameters(os);
-    if (Messages.getString(locale,OPENSEARCHSERVER_TAB_MESSAGE).equals(tabName)) {
-      outputResource(EDIT_SPEC_FORWARD, out, locale, specs);
-    } else {
-      outputResource(HIDDEN_SPEC_FORWARD, out, locale, specs);
-    }
+    outputResource(EDIT_SPEC_FORWARD, out, locale, specs, tabName);
   }
 
   @Override
@@ -193,9 +193,7 @@ public class OpenSearchServerConnector e
       ConfigParams configParams) {
     if (configParams == null)
       configParams = getConfiguration();
-    synchronized (this) {
-      return new OpenSearchServerConfig(configParams);
-    }
+    return new OpenSearchServerConfig(configParams);
   }
 
   final private OpenSearchServerSpecs getSpecParameters(OutputSpecification os)
@@ -254,13 +252,13 @@ public class OpenSearchServerConnector e
   @Override
   public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out,
       Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException {
-    outputResource(VIEW_CONFIG_FORWARD, out, locale, getConfigParameters(parameters));
+    outputResource(VIEW_CONFIG_FORWARD, out, locale, getConfigParameters(parameters), null);
   }
 
   @Override
   public void viewSpecification(IHTTPOutput out, Locale locale, OutputSpecification os)
       throws ManifoldCFException, IOException {
-    outputResource(VIEW_SPEC_FORWARD, out, locale, getSpecParameters(os));
+    outputResource(VIEW_SPEC_FORWARD, out, locale, getSpecParameters(os), null);
   }
 
   @Override

Modified: incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/editConfiguration.html
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/editConfiguration.html?rev=1299512&r1=1299511&r2=1299512&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/editConfiguration.html
(original)
+++ incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/editConfiguration.html
Mon Mar 12 00:58:38 2012
@@ -15,6 +15,8 @@
  limitations under the License.
 -->
 
+#if($TabName == $ResourceBundle.getString('OpenSearchServerConnector.Parameters'))
+
 <table class="displaytable">
   <tr>
     <td class="description">
@@ -41,3 +43,12 @@
       size="40" /></td>
   </tr>
 </table>
+
+#else
+
+<input type="hidden" name="serverlocation" value="$Encoder.attributeEscape($SERVERLOCATION)"
/>
+<input type="hidden" name="indexname" value="$Encoder.attributeEscape($INDEXNAME)" />
+<input type="hidden" name="username" value="$Encoder.attributeEscape($USERNAME)" />
+<input type="hidden" name="apikey" value="$Encoder.attributeEscape($APIKEY)" />
+
+#end

Modified: incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/editSpecification.html
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/editSpecification.html?rev=1299512&r1=1299511&r2=1299512&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/editSpecification.html
(original)
+++ incubator/lcf/trunk/connectors/opensearchserver/connector/src/main/resources/org/apache/manifoldcf/agents/output/opensearchserver/editSpecification.html
Mon Mar 12 00:58:38 2012
@@ -15,6 +15,8 @@
  limitations under the License.
 -->
 
+#if($TabName == $ResourceBundle.getString('OpenSearchServerConnector.OpenSearchServer'))
+
 <table class="displaytable">
   <tr>
     <td class="description">
@@ -38,3 +40,11 @@
     </td>
   </tr>
 </table>
+
+#else
+
+<input type="hidden" name="maxfilesize" value="$Encoder.attributeEscape($MAXFILESIZE)"
/>
+<input type="hidden" name="mimetypes" value="$Encoder.attributeEscape($MIMETYPES)" />
+<input type="hidden" name="extensions" value="$Encoder.attributeEscape($EXTENSIONS)" />
+
+#end



Mime
View raw message