manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From piergior...@apache.org
Subject svn commit: r1210879 - in /incubator/lcf/trunk: connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/ connectors...
Date Tue, 06 Dec 2011 12:02:02 GMT
Author: piergiorgio
Date: Tue Dec  6 12:02:01 2011
New Revision: 1210879

URL: http://svn.apache.org/viewvc?rev=1210879&view=rev
Log:
- added the detailed JavaDoc for the CMIS connector and integration tests (CONNECTORS-301)
- added the defaul values for the CMIS connector configuration (CONNECTORS-300)
- extended the endpoint parameter of the CMIS Connector with protocol, server, port and path (CONNECTORS-304)
- CMIS and Alfresco connector configuration UI loses configuration when you switch tabs (CONNECTORS-307)

Added:
    incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenConfiguration.html   (with props)
    incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenSpecification.html   (with props)
    incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisConfig.java   (with props)
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenConfiguration.html   (with props)
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenSpecification.html   (with props)
Modified:
    incubator/lcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoConfig.java
    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/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.js
    incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/viewConfiguration.html
    incubator/lcf/trunk/site/src/documentation/resources/images/alfresco-repository-connection-configuration-save.png
    incubator/lcf/trunk/site/src/documentation/resources/images/alfresco-repository-connection-configuration.png
    incubator/lcf/trunk/site/src/documentation/resources/images/cmis-repository-connection-configuration-save.png
    incubator/lcf/trunk/site/src/documentation/resources/images/cmis-repository-connection-configuration.png
    incubator/lcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/APISanityIT.java
    incubator/lcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/Base.java

Modified: incubator/lcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoConfig.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoConfig.java?rev=1210879&r1=1210878&r2=1210879&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoConfig.java (original)
+++ incubator/lcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoConfig.java Tue Dec  6 12:02:01 2011
@@ -23,6 +23,9 @@ public class AlfrescoConfig {
   /** Path of the context of the Alfresco Web Services API */
   public static final String PATH_PARAM = "path";
   
+  /** The Lucene Query parameter */
+  public static final String LUCENE_QUERY_PARAM = "luceneQuery";
+  
   //default values
   public static final String USERNAME_DEFAULT_VALUE = "admin";
   public static final String PASSWORD_DEFAULT_VALUE = "admin";

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=1210879&r1=1210878&r2=1210879&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 Tue Dec  6 12:02:01 2011
@@ -84,14 +84,17 @@ public class AlfrescoRepositoryConnector
   /** Forward to the template to edit the configuration parameters for the job */
   private static final String EDIT_SPEC_FORWARD = "editSpecification.html";
   
-  /** Forward to the jaavscript to check the specification parameters for the job */
+  /** 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 HTML template for rendering hidden fields when the Lucene Query tab is not selected */
+  private static final String HIDDEN_SPEC_FORWARD = "hiddenSpecification.html";
 
   /** The root node for the Alfresco connector configuration in ManifoldCF */
   private static final String JOB_STARTPOINT_NODE_TYPE = "startpoint";
-  
-  /** The Lucene Query parameter */
-  private static final String CONFIG_PARAM_LUCENE_QUERY = "luceneQuery";
 
   /** The Lucene Query label for the configuration tab of the job settings */
   private static final String TAB_LABEL_LUCENE_QUERY = "Lucene Query";
@@ -99,6 +102,7 @@ public class AlfrescoRepositoryConnector
   /** Read activity */
   protected final static String ACTIVITY_READ = "read document";
   
+  /** Alfresco Server configuration tab name */
   private static final String ALFRESCO_SERVER_TAB_NAME = "Server";
 
   /**
@@ -334,7 +338,7 @@ public class AlfrescoRepositoryConnector
     while (i < spec.getChildCount()) {
       SpecificationNode sn = spec.getChild(i);
       if (sn.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
-        luceneQuery = sn.getAttributeValue(CONFIG_PARAM_LUCENE_QUERY);
+        luceneQuery = sn.getAttributeValue(AlfrescoConfig.LUCENE_QUERY_PARAM);
         break;
       }
       i++;
@@ -523,36 +527,38 @@ public class AlfrescoRepositoryConnector
   public void outputConfigurationBody(IThreadContext threadContext,
       IHTTPOutput out, 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);
-    
-    if (StringUtils.isEmpty(username))
-      username = StringUtils.EMPTY;
-    if (StringUtils.isEmpty(password))
-      password = StringUtils.EMPTY;
-    if (StringUtils.isEmpty(protocol))
-      protocol = StringUtils.EMPTY;
-    if (StringUtils.isEmpty(server))
-      server = StringUtils.EMPTY;
-    if (StringUtils.isEmpty(port))
-      port = StringUtils.EMPTY;
-    if (StringUtils.isEmpty(path))
-      path = StringUtils.EMPTY;
-
-    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);
     
     if(ALFRESCO_SERVER_TAB_NAME.equals(tabName)){
+      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);
+      
+      if (StringUtils.isEmpty(username))
+        username = StringUtils.EMPTY;
+      if (StringUtils.isEmpty(password))
+        password = StringUtils.EMPTY;
+      if (StringUtils.isEmpty(protocol))
+        protocol = StringUtils.EMPTY;
+      if (StringUtils.isEmpty(server))
+        server = StringUtils.EMPTY;
+      if (StringUtils.isEmpty(port))
+        port = StringUtils.EMPTY;
+      if (StringUtils.isEmpty(path))
+        path = StringUtils.EMPTY;
+  
+      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);
+      
       outputResource(EDIT_CONFIG_FORWARD, out, parameters);  
+    } else {
+      outputResource(HIDDEN_CONFIG_FORWARD, out, parameters);
     }
   }
 
@@ -641,8 +647,8 @@ public class AlfrescoRepositoryConnector
           seenAny = true;
         }
         specificationParams.setParameter(
-            CONFIG_PARAM_LUCENE_QUERY.toUpperCase(),
-            sn.getAttributeValue(CONFIG_PARAM_LUCENE_QUERY));
+            AlfrescoConfig.LUCENE_QUERY_PARAM.toUpperCase(),
+            sn.getAttributeValue(AlfrescoConfig.LUCENE_QUERY_PARAM));
       }
       i++;
     }
@@ -668,7 +674,7 @@ public class AlfrescoRepositoryConnector
   public String processSpecificationPost(IPostParameters variableContext,
       DocumentSpecification ds) throws ManifoldCFException {
     String luceneQuery = variableContext
-        .getParameter(CONFIG_PARAM_LUCENE_QUERY);
+        .getParameter(AlfrescoConfig.LUCENE_QUERY_PARAM);
     if (StringUtils.isNotEmpty(luceneQuery)) {
       int i = 0;
       while (i < ds.getChildCount()) {
@@ -680,16 +686,16 @@ public class AlfrescoRepositoryConnector
         i++;
       }
       SpecificationNode node = new SpecificationNode(JOB_STARTPOINT_NODE_TYPE);
-      node.setAttribute(CONFIG_PARAM_LUCENE_QUERY, luceneQuery);
-      variableContext.setParameter(CONFIG_PARAM_LUCENE_QUERY, luceneQuery);
+      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(CONFIG_PARAM_LUCENE_QUERY,
-              oldNode.getAttributeValue(CONFIG_PARAM_LUCENE_QUERY));
+          variableContext.setParameter(AlfrescoConfig.LUCENE_QUERY_PARAM,
+              oldNode.getAttributeValue(AlfrescoConfig.LUCENE_QUERY_PARAM));
         }
         i++;
       }
@@ -717,21 +723,23 @@ public class AlfrescoRepositoryConnector
   public void outputSpecificationBody(IHTTPOutput out,
       DocumentSpecification ds, String tabName) throws ManifoldCFException,
       IOException {
-    if (tabName.equals(TAB_LABEL_LUCENE_QUERY)) {
-      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(CONFIG_PARAM_LUCENE_QUERY);
-          break;
-        }
-        i++;
+    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;
       }
-
-      ConfigParams params = new ConfigParams();
-      params.setParameter(CONFIG_PARAM_LUCENE_QUERY, luceneQuery);
+      i++;
+    }
+    
+    ConfigParams params = new ConfigParams();
+    params.setParameter(AlfrescoConfig.LUCENE_QUERY_PARAM, luceneQuery);
+    if (tabName.equals(TAB_LABEL_LUCENE_QUERY)) {
       outputResource(EDIT_SPEC_FORWARD, out, params);
+    } else {
+      outputResource(HIDDEN_SPEC_FORWARD, out, params);
     }
   }
 

Added: incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenConfiguration.html
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenConfiguration.html?rev=1210879&view=auto
==============================================================================
--- incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenConfiguration.html (added)
+++ incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenConfiguration.html Tue Dec  6 12:02:01 2011
@@ -0,0 +1,6 @@
+<input type="hidden" name="username" value="${USERNAME}" />
+<input type="hidden" name="password" value="${PASSWORD}" />
+<input type="hidden" name="protocol" value="${PROTOCOL}" />
+<input type="hidden" name="server" value="${SERVER}" />
+<input type="hidden" name="port" value="${PORT}" />
+<input type="hidden" name="path" value="${PATH}" />
\ No newline at end of file

Propchange: incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenConfiguration.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenConfiguration.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenConfiguration.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenSpecification.html
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenSpecification.html?rev=1210879&view=auto
==============================================================================
--- incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenSpecification.html (added)
+++ incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenSpecification.html Tue Dec  6 12:02:01 2011
@@ -0,0 +1 @@
+<input type="hidden" name="luceneQuery" value="${LUCENEQUERY}" />
\ No newline at end of file

Propchange: incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenSpecification.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenSpecification.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/lcf/trunk/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/hiddenSpecification.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisConfig.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisConfig.java?rev=1210879&view=auto
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisConfig.java (added)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisConfig.java Tue Dec  6 12:02:01 2011
@@ -0,0 +1,49 @@
+package org.apache.manifoldcf.crawler.connectors.cmis;
+
+import org.apache.commons.lang.StringUtils;
+
+/** 
+ * Parameters data for the CMIS repository connector.
+*/
+public class CmisConfig {
+  
+  /** Username */
+  public static final String USERNAME_PARAM = "username";
+ 
+  /** Password */
+  public static final String PASSWORD_PARAM = "password";
+  
+  /** Protocol */
+  public static final String PROTOCOL_PARAM = "protocol";
+  
+  /** Server name */
+  public static final String SERVER_PARAM = "server";
+  
+  /** Port */
+  public static final String PORT_PARAM = "port";
+  
+  /** Path of the context of the CMIS AtomPub api */
+  public static final String PATH_PARAM = "path";
+  
+  /** CMIS Repository Id */
+  public static final String REPOSITORY_ID_PARAM = "repositoryId";
+  
+  /** CMIS protocol binding */
+  public static final String BINDING_PARAM = "binding";
+  
+  /** CMIS Query */
+  public static final String CMIS_QUERY_PARAM = "cmisQuery";
+  
+  //default values
+  public static final String USERNAME_DEFAULT_VALUE = "dummyuser";
+  public static final String PASSWORD_DEFAULT_VALUE = "dummysecrect";
+  public static final String PROTOCOL_DEFAULT_VALUE = "http";
+  public static final String SERVER_DEFAULT_VALUE = "localhost";
+  public static final String PORT_DEFAULT_VALUE = "9090";
+  public static final String BINDING_DEFAULT_VALUE = "atom";
+  public static final String PATH_DEFAULT_VALUE = "/chemistry-opencmis-server-inmemory-war/atom";
+  public static final String REPOSITORY_ID_DEFAULT_VALUE = StringUtils.EMPTY;
+  public static final String BINDING_ATOM_VALUE = "atom";
+  public static final String BINDING_WS_VALUE = "ws";
+  
+}

Propchange: incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisConfig.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/lcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisConfig.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=1210879&r1=1210878&r2=1210879&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 Tue Dec  6 12:02:01 2011
@@ -72,16 +72,6 @@ import org.apache.manifoldcf.crawler.sys
  */
 public class CmisRepositoryConnector extends BaseRepositoryConnector {
 
-  public static final String CONFIG_PARAM_USERNAME = "username";
-  public static final String CONFIG_PARAM_PASSWORD = "password";
-  public static final String CONFIG_PARAM_ENDPOINT = "endpoint";
-  public static final String CONFIG_PARAM_REPOSITORY_ID = "repositoryId";
-  public static final String CONFIG_PARAM_CMIS_QUERY = "cmisQuery";
-  public static final String CONFIG_PARAM_BINDING = "binding";
-  
-  private static final String BINDING_ATOM_VALUE = "atom";
-  private static final String BINDING_WS_VALUE = "ws";
-
   private static final String JOB_STARTPOINT_NODE_TYPE = "startpoint";
   private static final String TAB_LABEL_CMIS_QUERY = "CMIS Query";
 
@@ -93,14 +83,30 @@ public class CmisRepositoryConnector ext
   private static final SimpleDateFormat ISO8601_DATE_FORMATTER = new SimpleDateFormat(
       "yyyy-MM-dd'T'HH:mm:ssZ");
   
+  /** 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";
+  
+  /** 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 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 HTML template for rendering hidden fields when the CMIS Query tab is not selected */
+  private static final String HIDDEN_SPEC_FORWARD = "hiddenSpecification.html";
+  
   private static final String CMIS_SERVER_TAB_NAME = "Server";
 
   /**
@@ -110,7 +116,19 @@ public class CmisRepositoryConnector ext
 
   protected String username = null;
   protected String password = null;
-  protected String endpoint = null;
+  
+  /** Endpoint protocol */
+  protected String protocol = null;
+  
+  /** Endpoint server name */
+  protected String server = null;
+  
+  /** Endpoint port */
+  protected String port = null;
+  
+  /** Endpoint context path of the Alfresco webapp */
+  protected String path = null;
+  
   protected String repositoryId = null;
   protected String binding = null;
 
@@ -122,18 +140,35 @@ public class CmisRepositoryConnector ext
   protected static final long timeToRelease = 300000L;
   protected long lastSessionFetch = -1L;
 
+  /**
+   * Constructor
+   */
   public CmisRepositoryConnector() {
     super();
   }
 
+  /** 
+   * Return the list of activities that this connector supports (i.e. writes into the log).
+   * @return the list.
+   */
   @Override
   public String[] getActivitiesList() {
     return new String[] { ACTIVITY_FETCH };
   }
 
+  /** Get the bin name strings for a document identifier.  The bin name describes the queue to which the
+   * document will be assigned for throttling purposes.  Throttling controls the rate at which items in a
+   * given queue are fetched; it does not say anything about the overall fetch rate, which may operate on
+   * multiple queues or bins.
+   * For example, if you implement a web crawler, a good choice of bin name would be the server name, since
+   * that is likely to correspond to a real resource that will need real throttle protection.
+   *@param documentIdentifier is the document identifier.
+   *@return the set of bin names.  If an empty array is returned, it is equivalent to there being no request
+   * rate throttling available for this identifier.
+   */
   @Override
   public String[] getBinNames(String documentIdentifier) {
-    return new String[] { endpoint };
+    return new String[] { protocol+"://"+server+":"+port+path };
   }
 
   protected class GetSessionThread extends Thread {
@@ -153,12 +188,14 @@ public class CmisRepositoryConnector ext
         parameters.put(SessionParameter.USER, username);
         parameters.put(SessionParameter.PASSWORD, password);
 
+        String endpoint = protocol+"://"+server+":"+port+path;
+        
         // connection settings
-        if(BINDING_ATOM_VALUE.equals(binding)){
+        if(CmisConfig.BINDING_ATOM_VALUE.equals(binding)){
           //AtomPub protocol
           parameters.put(SessionParameter.ATOMPUB_URL, endpoint);
           parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
-        } else if(BINDING_WS_VALUE.equals(binding)){
+        } else if(CmisConfig.BINDING_WS_VALUE.equals(binding)){
           //Web Services - SOAP - protocol
           parameters.put(SessionParameter.BINDING_TYPE, BindingType.WEBSERVICES.value());
           parameters.put(SessionParameter.WEBSERVICES_ACL_SERVICE, endpoint+"/ACLService?wsdl");
@@ -255,6 +292,9 @@ public class CmisRepositoryConnector ext
 
   }
 
+  /** 
+   * Close the connection.  Call this before discarding the connection.
+   */
   @Override
   public void disconnect() throws ManifoldCFException {
     if (session != null) {
@@ -293,7 +333,11 @@ public class CmisRepositoryConnector ext
 
     username = null;
     password = null;
-    endpoint = null;
+    protocol = null;
+    server = null;
+    port = null;
+    path = null;
+    binding = null;
     repositoryId = null;
 
   }
@@ -303,18 +347,28 @@ public class CmisRepositoryConnector ext
    * repositoryId is not provided in the configuration, the connector will
    * retrieve all the repositories exposed for this endpoint the it will start
    * to use the first one.
+   * @param configParameters is the set of configuration parameters, which
+   * in this case describe the target appliance, basic auth configuration, etc.  (This formerly came
+   * out of the ini file.)
    */
   @Override
   public void connect(ConfigParams configParams) {
     super.connect(configParams);
-    username = params.getParameter(CONFIG_PARAM_USERNAME);
-    password = params.getParameter(CONFIG_PARAM_PASSWORD);
-    endpoint = params.getParameter(CONFIG_PARAM_ENDPOINT);
-    binding = params.getParameter(CONFIG_PARAM_BINDING);
-    if (StringUtils.isNotEmpty(params.getParameter(CONFIG_PARAM_REPOSITORY_ID)))
-      repositoryId = params.getParameter(CONFIG_PARAM_REPOSITORY_ID);
+    username = params.getParameter(CmisConfig.USERNAME_PARAM);
+    password = params.getParameter(CmisConfig.PASSWORD_PARAM);
+    protocol = params.getParameter(CmisConfig.PROTOCOL_PARAM);
+    server = params.getParameter(CmisConfig.SERVER_PARAM);
+    port = params.getParameter(CmisConfig.PORT_PARAM);
+    path = params.getParameter(CmisConfig.PATH_PARAM);
+    
+    binding = params.getParameter(CmisConfig.BINDING_PARAM);
+    if (StringUtils.isNotEmpty(params.getParameter(CmisConfig.REPOSITORY_ID_PARAM)))
+      repositoryId = params.getParameter(CmisConfig.REPOSITORY_ID_PARAM);
   }
 
+  /** Test the connection.  Returns a string describing the connection integrity.
+   *@return the connection's status as a displayable string.
+   */
   @Override
   public String check() throws ManifoldCFException {
     try {
@@ -327,29 +381,42 @@ public class CmisRepositoryConnector ext
     }
   }
 
+  /** Set up a session */
   protected void getSession() throws ManifoldCFException, ServiceInterruption {
     if (session == null) {
       // Check for parameter validity
       
       if (StringUtils.isEmpty(binding))
-        throw new ManifoldCFException("Parameter " + CONFIG_PARAM_BINDING
+        throw new ManifoldCFException("Parameter " + CmisConfig.BINDING_PARAM
             + " required but not set");
       
       if (StringUtils.isEmpty(username))
-        throw new ManifoldCFException("Parameter " + CONFIG_PARAM_USERNAME
+        throw new ManifoldCFException("Parameter " + CmisConfig.USERNAME_PARAM
             + " required but not set");
 
       if (Logging.connectors.isDebugEnabled())
         Logging.connectors.debug("CMIS: Username = '" + username + "'");
 
       if (StringUtils.isEmpty(password))
-        throw new ManifoldCFException("Parameter " + CONFIG_PARAM_PASSWORD
+        throw new ManifoldCFException("Parameter " + CmisConfig.PASSWORD_PARAM
             + " required but not set");
 
       Logging.connectors.debug("CMIS: Password exists");
 
-      if (StringUtils.isEmpty(endpoint))
-        throw new ManifoldCFException("Parameter " + CONFIG_PARAM_ENDPOINT
+      if (StringUtils.isEmpty(protocol))
+        throw new ManifoldCFException("Parameter " + CmisConfig.PROTOCOL_PARAM
+            + " required but not set");
+      
+      if (StringUtils.isEmpty(server))
+        throw new ManifoldCFException("Parameter " + CmisConfig.SERVER_PARAM
+            + " required but not set");
+      
+      if (StringUtils.isEmpty(port))
+        throw new ManifoldCFException("Parameter " + CmisConfig.PORT_PARAM
+            + " required but not set");
+      
+      if (StringUtils.isEmpty(path))
+        throw new ManifoldCFException("Parameter " + CmisConfig.PATH_PARAM
             + " required but not set");
 
       long currentTime;
@@ -487,6 +554,10 @@ public class CmisRepositoryConnector ext
     }
   }
 
+  /** 
+   * This method is periodically called for all connectors that are connected but not
+   * in active use.
+   */
   @Override
   public void poll() throws ManifoldCFException {
     if (lastSessionFetch == -1L)
@@ -528,6 +599,32 @@ public class CmisRepositoryConnector ext
     }
   }
 
+  /** Queue "seed" documents.  Seed documents are the starting places for crawling activity.  Documents
+   * are seeded when this method calls appropriate methods in the passed in ISeedingActivity object.
+   *
+   * This method can choose to find repository changes that happen only during the specified time interval.
+   * The seeds recorded by this method will be viewed by the framework based on what the
+   * getConnectorModel() method returns.
+   *
+   * It is not a big problem if the connector chooses to create more seeds than are
+   * strictly necessary; it is merely a question of overall work required.
+   *
+   * The times passed to this method may be interpreted for greatest efficiency.  The time ranges
+   * any given job uses with this connector will not overlap, but will proceed starting at 0 and going
+   * to the "current time", each time the job is run.  For continuous crawling jobs, this method will
+   * be called once, when the job starts, and at various periodic intervals as the job executes.
+   *
+   * When a job's specification is changed, the framework automatically resets the seeding start time to 0.  The
+   * seeding start time may also be set to 0 on each job run, depending on the connector model returned by
+   * getConnectorModel().
+   *
+   * Note that it is always ok to send MORE documents rather than less to this method.
+   *@param activities is the interface this method should use to perform whatever framework actions are desired.
+   *@param spec is a document specification (that comes from the job).
+   *@param startTime is the beginning of the time range to consider, inclusive.
+   *@param endTime is the end of the time range to consider, exclusive.
+   *@param jobMode is an integer describing how the job is being run, whether continuous or once-only.
+   */
   @Override
   public void addSeedDocuments(ISeedingActivity activities,
       DocumentSpecification spec, long startTime, long endTime, int jobMode)
@@ -540,7 +637,7 @@ public class CmisRepositoryConnector ext
     while (i < spec.getChildCount()) {
       SpecificationNode sn = spec.getChild(i);
       if (sn.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
-        cmisQuery = sn.getAttributeValue(CONFIG_PARAM_CMIS_QUERY);
+        cmisQuery = sn.getAttributeValue(CmisConfig.CMIS_QUERY_PARAM);
         break;
       }
       i++;
@@ -563,6 +660,10 @@ public class CmisRepositoryConnector ext
 
   }
 
+  /** 
+   * Get the maximum number of documents to amalgamate together into one batch, for this connector.
+   * @return the maximum number. 0 indicates "unlimited".
+   */
   @Override
   public int getMaxDocumentRequest() {
     return 1;
@@ -650,10 +751,10 @@ public class CmisRepositoryConnector ext
   @Override
   public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out,
       ConfigParams parameters) throws ManifoldCFException, IOException {
-    String repositoryId = parameters.getParameter(CONFIG_PARAM_REPOSITORY_ID);
+    String repositoryId = parameters.getParameter(CmisConfig.REPOSITORY_ID_PARAM);
     if(StringUtils.isEmpty(repositoryId))
       repositoryId = StringUtils.EMPTY;
-    parameters.setParameter(CONFIG_PARAM_REPOSITORY_ID, repositoryId);
+    parameters.setParameter(CmisConfig.REPOSITORY_ID_PARAM, repositoryId);
     outputResource(VIEW_CONFIG_FORWARD, out, parameters);
   }
 
@@ -688,29 +789,44 @@ public class CmisRepositoryConnector ext
       throws ManifoldCFException, IOException {
     
     if(CMIS_SERVER_TAB_NAME.equals(tabName)){
-      String username = parameters.getParameter(CONFIG_PARAM_USERNAME);
-      String password = parameters.getParameter(CONFIG_PARAM_PASSWORD);
-      String endpoint = parameters.getParameter(CONFIG_PARAM_ENDPOINT);
-      String repositoryId = parameters.getParameter(CONFIG_PARAM_REPOSITORY_ID);
-      String binding = parameters.getParameter(CONFIG_PARAM_BINDING);
+      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(StringUtils.isEmpty(username))
         username = StringUtils.EMPTY;
       if(StringUtils.isEmpty(password))
         password = StringUtils.EMPTY;
-      if(StringUtils.isEmpty(endpoint))
-        endpoint = StringUtils.EMPTY;
+      if(StringUtils.isEmpty(protocol))
+        protocol = CmisConfig.PROTOCOL_DEFAULT_VALUE;
+      if(StringUtils.isEmpty(server))
+        server = CmisConfig.SERVER_DEFAULT_VALUE;
+      if(StringUtils.isEmpty(port))
+        port = CmisConfig.PORT_DEFAULT_VALUE;
+      if(StringUtils.isEmpty(path))
+        path = CmisConfig.PATH_DEFAULT_VALUE;
+      
       if(StringUtils.isEmpty(repositoryId))
         repositoryId = StringUtils.EMPTY;
       if(StringUtils.isEmpty(binding))
-        binding = BINDING_ATOM_VALUE;
+        binding = CmisConfig.BINDING_ATOM_VALUE;
       
-      parameters.setParameter(CONFIG_PARAM_USERNAME, username);
-      parameters.setParameter(CONFIG_PARAM_PASSWORD, password);
-      parameters.setParameter(CONFIG_PARAM_ENDPOINT, endpoint);
-      parameters.setParameter(CONFIG_PARAM_REPOSITORY_ID, repositoryId);
-      parameters.setParameter(CONFIG_PARAM_BINDING, binding);
+      parameters.setParameter(CmisConfig.USERNAME_PARAM, username);
+      parameters.setParameter(CmisConfig.PASSWORD_PARAM, password);
+      parameters.setParameter(CmisConfig.PROTOCOL_PARAM, protocol);
+      parameters.setParameter(CmisConfig.SERVER_PARAM, server);
+      parameters.setParameter(CmisConfig.PORT_PARAM, port);
+      parameters.setParameter(CmisConfig.PATH_PARAM, path);
+      parameters.setParameter(CmisConfig.REPOSITORY_ID_PARAM, repositoryId);
+      parameters.setParameter(CmisConfig.BINDING_PARAM, binding);
       outputResource(EDIT_CONFIG_FORWARD, out, parameters);
+    } else {
+      outputResource(HIDDEN_CONFIG_FORWARD, out, parameters);
     }
   }
 
@@ -738,24 +854,45 @@ public class CmisRepositoryConnector ext
       IPostParameters variableContext, ConfigParams parameters)
       throws ManifoldCFException {
     
-    String binding = variableContext.getParameter(CONFIG_PARAM_BINDING);
+    String binding = variableContext.getParameter(CmisConfig.BINDING_PARAM);
     if (StringUtils.isNotEmpty(binding))
-      parameters.setParameter(CONFIG_PARAM_BINDING, binding);
+      parameters.setParameter(CmisConfig.BINDING_PARAM, binding);
     
-    String username = variableContext.getParameter(CONFIG_PARAM_USERNAME);
+    String username = variableContext.getParameter(CmisConfig.USERNAME_PARAM);
     if (StringUtils.isNotEmpty(username))
-      parameters.setParameter(CONFIG_PARAM_USERNAME, username);
+      parameters.setParameter(CmisConfig.USERNAME_PARAM, username);
 
-    String password = variableContext.getParameter(CONFIG_PARAM_PASSWORD);
+    String password = variableContext.getParameter(CmisConfig.PASSWORD_PARAM);
     if (StringUtils.isNotEmpty(password))
-      parameters.setParameter(CONFIG_PARAM_PASSWORD, password);
+      parameters.setParameter(CmisConfig.PASSWORD_PARAM, password);
 
-    String endpoint = variableContext.getParameter(CONFIG_PARAM_ENDPOINT);
-    if (StringUtils.isNotEmpty(endpoint) && endpoint.length() > 0)
-      parameters.setParameter(CONFIG_PARAM_ENDPOINT, endpoint);
+    String protocol = variableContext.getParameter(CmisConfig.PROTOCOL_PARAM);
+    if (StringUtils.isNotEmpty(protocol)) {
+      parameters.setParameter(CmisConfig.PROTOCOL_PARAM, protocol);
+    }
+    
+    String server = variableContext.getParameter(CmisConfig.SERVER_PARAM);
+    if (StringUtils.isNotEmpty(server) && !StringUtils.contains(server, '/')) {
+      parameters.setParameter(CmisConfig.SERVER_PARAM, server);
+    }
+    
+    String port = variableContext.getParameter(CmisConfig.PORT_PARAM);
+    if (StringUtils.isNotEmpty(port)){
+      try {
+        Integer.parseInt(port);
+        parameters.setParameter(CmisConfig.PORT_PARAM, port);
+      } catch (NumberFormatException e) {
+        
+      }
+    }
+    
+    String path = variableContext.getParameter(CmisConfig.PATH_PARAM);
+    if (StringUtils.isNotEmpty(path)) {
+      parameters.setParameter(CmisConfig.PATH_PARAM, path);
+    }
 
-    String repositoryId = variableContext.getParameter(CONFIG_PARAM_REPOSITORY_ID);
-    parameters.setParameter(CONFIG_PARAM_REPOSITORY_ID, repositoryId);
+    String repositoryId = variableContext.getParameter(CmisConfig.REPOSITORY_ID_PARAM);
+    parameters.setParameter(CmisConfig.REPOSITORY_ID_PARAM, repositoryId);
 
     return null;
   }
@@ -783,7 +920,8 @@ public class CmisRepositoryConnector ext
         if (seenAny == false) {
           seenAny = true;
         }
-        specificationParams.setParameter(CONFIG_PARAM_CMIS_QUERY.toUpperCase(), sn.getAttributeValue(CONFIG_PARAM_CMIS_QUERY));
+        specificationParams.setParameter(
+            CmisConfig.CMIS_QUERY_PARAM.toUpperCase(), sn.getAttributeValue(CmisConfig.CMIS_QUERY_PARAM));
       }
       i++;
     }
@@ -808,7 +946,7 @@ public class CmisRepositoryConnector ext
   @Override
   public String processSpecificationPost(IPostParameters variableContext,
       DocumentSpecification ds) throws ManifoldCFException {
-    String cmisQuery = variableContext.getParameter(CONFIG_PARAM_CMIS_QUERY);
+    String cmisQuery = variableContext.getParameter(CmisConfig.CMIS_QUERY_PARAM);
     if (StringUtils.isNotEmpty(cmisQuery)) {
       int i = 0;
       while (i < ds.getChildCount()) {
@@ -820,16 +958,16 @@ public class CmisRepositoryConnector ext
         i++;
       }
       SpecificationNode node = new SpecificationNode(JOB_STARTPOINT_NODE_TYPE);
-      node.setAttribute(CONFIG_PARAM_CMIS_QUERY, cmisQuery);
-      variableContext.setParameter(CONFIG_PARAM_CMIS_QUERY, cmisQuery);
+      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(CONFIG_PARAM_CMIS_QUERY,
-              oldNode.getAttributeValue(CONFIG_PARAM_CMIS_QUERY));
+          variableContext.setParameter(CmisConfig.CMIS_QUERY_PARAM,
+              oldNode.getAttributeValue(CmisConfig.CMIS_QUERY_PARAM));
         }
         i++;
       }
@@ -857,21 +995,23 @@ public class CmisRepositoryConnector ext
   public void outputSpecificationBody(IHTTPOutput out,
       DocumentSpecification ds, String tabName) throws ManifoldCFException,
       IOException {
-    if (tabName.equals(TAB_LABEL_CMIS_QUERY)) {
-      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(CONFIG_PARAM_CMIS_QUERY);
-          break;
-        }
-        i++;
+    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;
       }
-      
-      ConfigParams params = new ConfigParams();
-      params.setParameter(CONFIG_PARAM_CMIS_QUERY, cmisQuery);
+      i++;
+    }
+    
+    ConfigParams params = new ConfigParams();
+    params.setParameter(CmisConfig.CMIS_QUERY_PARAM, cmisQuery);
+    if (tabName.equals(TAB_LABEL_CMIS_QUERY)) {
       outputResource(EDIT_SPEC_FORWARD, out, params);
+    } else {
+      outputResource(HIDDEN_SPEC_FORWARD, out, params);
     }
   }
 
@@ -897,6 +1037,20 @@ public class CmisRepositoryConnector ext
     outputResource(EDIT_SPEC_HEADER_FORWARD, out, params);
   }
 
+  /** Process a set of documents.
+   * This is the method that should cause each document to be fetched, processed, and the results either added
+   * to the queue of documents for the current job, and/or entered into the incremental ingestion manager.
+   * The document specification allows this class to filter what is done based on the job.
+   *@param documentIdentifiers is the set of document identifiers to process.
+   *@param versions is the corresponding document versions to process, as returned by getDocumentVersions() above.
+   *       The implementation may choose to ignore this parameter and always process the current version.
+   *@param activities is the interface this method should use to queue up new document references
+   * and ingest documents.
+   *@param spec is the document specification.
+   *@param scanOnly is an array corresponding to the document identifiers.  It is set to true to indicate when the processing
+   * should only find other references, and should not actually call the ingestion methods.
+   *@param jobMode is an integer describing how the job is being run, whether continuous or once-only.
+   */
   @SuppressWarnings("unchecked")
   @Override
   public void processDocuments(String[] documentIdentifiers, String[] versions,
@@ -1035,6 +1189,7 @@ public class CmisRepositoryConnector ext
           
           //ingestion
           String version = document.getVersionLabel();
+          String endpoint = protocol+"://"+server+":"+port+path;
           String documentURI = endpoint+"/"+id+"/"+version;
           activities.ingestDocument(id, version, documentURI, rd);
 

Modified: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html?rev=1210879&r1=1210878&r2=1210879&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html (original)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html Tue Dec  6 12:02:01 2011
@@ -45,7 +45,7 @@
 			</nobr>
 		</td>
 		<td class="value">
-			<input type="text" name="username" value="${USERNAME}" />
+			<input type="text" id="username" name="username" value="${USERNAME}" />
 		</td>
 	</tr>
 	<tr>
@@ -55,19 +55,52 @@
 			</nobr>
 		</td>
 		<td class="value">
-			<input type="password" name="password" value="${PASSWORD}" />
+			<input type="password" id="password" name="password" value="${PASSWORD}" />
 		</td>
 	</tr>
 	<tr>
-		<td class="description">
-			<nobr>
-				Endpoint:
-			</nobr>
-		</td>
-		<td class="value">
-			<input type="text" name="endpoint" value="${ENDPOINT}" size="50" />
-		</td>
-	</tr>
+    <td class="description">
+      <nobr>
+        Protocol:
+      </nobr>
+    </td>
+    <td class="value">
+      <select id="protocol" name="protocol">
+        <option value="http">http</option>
+        <option value="https">https</option>
+      </select>
+    </td>
+  </tr>
+  <tr>
+    <td class="description">
+      <nobr>
+        Server:
+      </nobr>
+    </td>
+    <td class="value">
+        <input id="server" name="server" type="text" size="32" value="${SERVER}"/>
+    </td>
+  </tr>
+  <tr>
+    <td class="description">
+      <nobr>
+        Port:
+      </nobr>
+    </td>
+    <td class="value">
+        <input id="port" name="port" type="text" size="5" value="${PORT}" />
+    </td>
+  </tr>
+  <tr>
+    <td class="description">
+      <nobr>
+        Path:
+      </nobr>
+    </td>
+    <td class="value">
+        <input id="path" name="path" type="text" size="32" value="${PATH}" />
+    </td>
+  </tr>
 	<tr>
 		<td class="description">
 			<nobr>
@@ -97,4 +130,43 @@ if(repositoryId!=null && repositoryId!="
 } else {
   repositoryIdField.value = "";
 }
+
+var username = "${USERNAME}";
+var password = "${PASSWORD}";
+var server = "${SERVER}";
+var port = "${PORT}";
+var path = "${PATH}";
+
+if(username==null || username==""){
+  var usernameInput = document.getElementById("username");
+  usernameInput.value = "dummyuser";
+}
+
+if(password==null || password==""){
+  var passwordInput = document.getElementById("password");
+  passwordInput.value = "dummysecret";
+}
+
+var protocol = "${PROTOCOL}";
+var protocolSelect = document.getElementById("protocol");
+if(protocol=="https"){
+  protocolSelect.options[1].selected = true;
+} else {
+  protocolSelect.options[0].selected = true;
+}
+
+if(server==null || server==""){
+  var serverInput = document.getElementById("server");
+  serverInput.value = "localhost";
+}
+
+if(port==null || port==""){
+  var portInput = document.getElementById("port");
+  portInput.value = "9090";
+}
+
+if(path==null || path==""){
+  var pathInput = document.getElementById("path");
+  pathInput.value = "/chemistry-opencmis-server-inmemory-war/atom";
+}
 </script>
\ No newline at end of file

Modified: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.js
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.js?rev=1210879&r1=1210878&r2=1210879&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.js (original)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.js Tue Dec  6 12:02:01 2011
@@ -42,11 +42,31 @@ function checkConfigForSave()
     editconnection.binding.focus();
     return false;
   }
-  if (editconnection.endpoint.value == "")
+  if (editconnection.server.value ==""){
+	  alert("Server name must be not null");
+	  editconnection.server.focus();
+	  return false;
+  } else if(!editconnection.server.value.indexOf('/')==-1) {
+	  alert("Server name can't contain the character '/'");
+	  editconnection.server.focus();
+	  return false;
+  }
+  
+  if (editconnection.port.value == "")
   {
-    alert("The endpoint must be not null");
-    editconnection.endpoint.focus();
-    return false;
+	alert("The port must be not null");
+	editconnection.port.focus();
+	return false;
+  } else if (!isInteger(editconnection.port.value)){
+	alert("The server port must be a valid integer");
+	editconnection.port.focus();
+	return false;
+  }
+  
+  if(editconnection.path.value == ""){
+	  alert("Path must be not null");
+	  editconnection.path.focus();
+	  return false;
   }
   return true;
 }

Added: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenConfiguration.html
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenConfiguration.html?rev=1210879&view=auto
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenConfiguration.html (added)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenConfiguration.html Tue Dec  6 12:02:01 2011
@@ -0,0 +1,8 @@
+<input type="hidden" name="username" value="${USERNAME}" />
+<input type="hidden" name="password" value="${PASSWORD}" />
+<input type="hidden" name="protocol" value="${PROTOCOL}" />
+<input type="hidden" name="server" value="${SERVER}" />
+<input type="hidden" name="port" value="${PORT}" />
+<input type="hidden" name="path" value="${PATH}" />
+<input type="hidden" name="binding" value="${BINDING}" />
+<input type="hidden" name="repositoryId" value="${REPOSITORYID}" />
\ No newline at end of file

Propchange: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenConfiguration.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenConfiguration.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenConfiguration.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenSpecification.html
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenSpecification.html?rev=1210879&view=auto
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenSpecification.html (added)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenSpecification.html Tue Dec  6 12:02:01 2011
@@ -0,0 +1 @@
+<input type="hidden" name="cmisQuery" value="${CMISQUERY}" />
\ No newline at end of file

Propchange: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenSpecification.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenSpecification.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/hiddenSpecification.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Modified: incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/viewConfiguration.html
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/viewConfiguration.html?rev=1210879&r1=1210878&r2=1210879&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/viewConfiguration.html (original)
+++ incubator/lcf/trunk/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/viewConfiguration.html Tue Dec  6 12:02:01 2011
@@ -36,9 +36,21 @@
 			</nobr>
 			<br />
 			<nobr>
-				endpoint=${ENDPOINT}
-			</nobr>
-			<br />
+        protocol=${PROTOCOL}
+      </nobr>
+      <br />
+      <nobr>
+        server=${SERVER}
+      </nobr>
+      <br />
+      <nobr>
+        port=${PORT}
+      </nobr>
+      <br />
+      <nobr>
+        path=${PATH}
+      </nobr>
+      <br />
 			<nobr>
         <div id="repositoryIdDiv"></div>
       </nobr>

Modified: incubator/lcf/trunk/site/src/documentation/resources/images/alfresco-repository-connection-configuration-save.png
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/site/src/documentation/resources/images/alfresco-repository-connection-configuration-save.png?rev=1210879&r1=1210878&r2=1210879&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/lcf/trunk/site/src/documentation/resources/images/alfresco-repository-connection-configuration.png
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/site/src/documentation/resources/images/alfresco-repository-connection-configuration.png?rev=1210879&r1=1210878&r2=1210879&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/lcf/trunk/site/src/documentation/resources/images/cmis-repository-connection-configuration-save.png
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/site/src/documentation/resources/images/cmis-repository-connection-configuration-save.png?rev=1210879&r1=1210878&r2=1210879&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/lcf/trunk/site/src/documentation/resources/images/cmis-repository-connection-configuration.png
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/site/src/documentation/resources/images/cmis-repository-connection-configuration.png?rev=1210879&r1=1210878&r2=1210879&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/lcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/APISanityIT.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/APISanityIT.java?rev=1210879&r1=1210878&r2=1210879&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/APISanityIT.java (original)
+++ incubator/lcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/APISanityIT.java Tue Dec  6 12:02:01 2011
@@ -43,7 +43,7 @@ import org.apache.commons.lang.StringUti
 import org.apache.manifoldcf.core.interfaces.Configuration;
 import org.apache.manifoldcf.core.interfaces.ConfigurationNode;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
-import org.apache.manifoldcf.crawler.connectors.cmis.CmisRepositoryConnector;
+import org.apache.manifoldcf.crawler.connectors.cmis.CmisConfig;
 import org.apache.manifoldcf.crawler.system.ManifoldCF;
 import org.junit.After;
 import org.junit.Before;
@@ -57,12 +57,7 @@ public class APISanityIT extends Base
   private static final String REPLACER = "?";
   private static final String CMIS_TEST_QUERY_CHANGE_DOC = "SELECT * FROM cmis:document WHERE cmis:name='"+REPLACER+"'";
   private static final String CMIS_TEST_QUERY = "SELECT * FROM cmis:folder WHERE cmis:name='testdata'";
-  
-  private static final String CMIS_ENDPOINT_TEST_SERVER = "http://localhost:9090/chemistry-opencmis-server-inmemory/atom";
-  private static final String CMIS_USERNAME = "dummyuser"; 
-  private static final String CMIS_PASSWORD = "dummysecret";
-  private static final String CMIS_BINDING = "atom";
-  
+    
   private Session cmisClientSession = null;
   
   private Session getCmisClientSession(){
@@ -71,11 +66,17 @@ public class APISanityIT extends Base
     Map<String, String> parameters = new HashMap<String, String>();
 
     // user credentials
-    parameters.put(SessionParameter.USER, CMIS_USERNAME);
-    parameters.put(SessionParameter.PASSWORD, CMIS_PASSWORD);
+    parameters.put(SessionParameter.USER, CmisConfig.USERNAME_DEFAULT_VALUE);
+    parameters.put(SessionParameter.PASSWORD, CmisConfig.PASSWORD_DEFAULT_VALUE);
 
     // connection settings
-    parameters.put(SessionParameter.ATOMPUB_URL, CMIS_ENDPOINT_TEST_SERVER);
+    String endpoint =
+        CmisConfig.PROTOCOL_DEFAULT_VALUE + "://" + 
+        CmisConfig.SERVER_DEFAULT_VALUE + ":" +
+        CmisConfig.PORT_DEFAULT_VALUE + 
+        CmisConfig.PATH_DEFAULT_VALUE;
+    
+    parameters.put(SessionParameter.ATOMPUB_URL, endpoint);
     parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
 
     // create session
@@ -229,27 +230,45 @@ public class APISanityIT extends Base
       
       //binding
       ConfigurationNode cmisBindingNode = new ConfigurationNode("_PARAMETER_");
-      cmisBindingNode.setAttribute("name", CmisRepositoryConnector.CONFIG_PARAM_BINDING);
-      cmisBindingNode.setValue(CMIS_BINDING);
+      cmisBindingNode.setAttribute("name", CmisConfig.BINDING_PARAM);
+      cmisBindingNode.setValue(CmisConfig.BINDING_DEFAULT_VALUE);
       child.addChild(child.getChildCount(), cmisBindingNode);
       
       //username
       ConfigurationNode cmisUsernameNode = new ConfigurationNode("_PARAMETER_");
-      cmisUsernameNode.setAttribute("name", CmisRepositoryConnector.CONFIG_PARAM_USERNAME);
-      cmisUsernameNode.setValue(CMIS_USERNAME);
+      cmisUsernameNode.setAttribute("name", CmisConfig.USERNAME_PARAM);
+      cmisUsernameNode.setValue(CmisConfig.USERNAME_DEFAULT_VALUE);
       child.addChild(child.getChildCount(), cmisUsernameNode);
       
       //password
       ConfigurationNode cmisPasswordNode = new ConfigurationNode("_PARAMETER_");
-      cmisPasswordNode.setAttribute("name", CmisRepositoryConnector.CONFIG_PARAM_PASSWORD);
-      cmisPasswordNode.setValue(CMIS_PASSWORD);
+      cmisPasswordNode.setAttribute("name", CmisConfig.PASSWORD_PARAM);
+      cmisPasswordNode.setValue(CmisConfig.PASSWORD_DEFAULT_VALUE);
       child.addChild(child.getChildCount(), cmisPasswordNode);
       
-      //endpoint
-      ConfigurationNode cmisEndpointNode = new ConfigurationNode("_PARAMETER_");
-      cmisEndpointNode.setAttribute("name", CmisRepositoryConnector.CONFIG_PARAM_ENDPOINT);
-      cmisEndpointNode.setValue(CMIS_ENDPOINT_TEST_SERVER);
-      child.addChild(child.getChildCount(), cmisEndpointNode);
+      //protocol
+      ConfigurationNode cmisProtocolNode = new ConfigurationNode("_PARAMETER_");
+      cmisProtocolNode.setAttribute("name", CmisConfig.PROTOCOL_PARAM);
+      cmisProtocolNode.setValue(CmisConfig.PROTOCOL_DEFAULT_VALUE);
+      child.addChild(child.getChildCount(), cmisProtocolNode);
+      
+      //server
+      ConfigurationNode cmisServerNode = new ConfigurationNode("_PARAMETER_");
+      cmisServerNode.setAttribute("name", CmisConfig.SERVER_PARAM);
+      cmisServerNode.setValue(CmisConfig.SERVER_DEFAULT_VALUE);
+      child.addChild(child.getChildCount(), cmisServerNode);
+      
+      //port
+      ConfigurationNode cmisPortNode = new ConfigurationNode("_PARAMETER_");
+      cmisPortNode.setAttribute("name", CmisConfig.PORT_PARAM);
+      cmisPortNode.setValue(CmisConfig.PORT_DEFAULT_VALUE);
+      child.addChild(child.getChildCount(), cmisPortNode);
+      
+      //path
+      ConfigurationNode cmisPathNode = new ConfigurationNode("_PARAMETER_");
+      cmisPathNode.setAttribute("name", CmisConfig.PATH_PARAM);
+      cmisPathNode.setValue(CmisConfig.PATH_DEFAULT_VALUE);
+      child.addChild(child.getChildCount(), cmisPathNode);
       
       connectionObject.addChild(connectionObject.getChildCount(),child);
 

Modified: incubator/lcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/Base.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/Base.java?rev=1210879&r1=1210878&r2=1210879&view=diff
==============================================================================
--- incubator/lcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/Base.java (original)
+++ incubator/lcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/Base.java Tue Dec  6 12:02:01 2011
@@ -272,7 +272,7 @@ public class Base extends org.apache.man
       openCmisServerWarPath = System.getProperty("openCmisServerWarPath");
     
     //Initialize OpenCMIS Server bindings
-    WebAppContext openCmisServerApi = new WebAppContext(openCmisServerWarPath,"/chemistry-opencmis-server-inmemory");
+    WebAppContext openCmisServerApi = new WebAppContext(openCmisServerWarPath,"/chemistry-opencmis-server-inmemory-war");
     openCmisServerApi.setParentLoaderPriority(false);
     cmisServer.addHandler(openCmisServerApi);
     



Mime
View raw message