manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1225520 - in /incubator/lcf/branches/release-0.4-incubating-branch/connectors: alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connector...
Date Thu, 29 Dec 2011 13:04:18 GMT
Author: kwright
Date: Thu Dec 29 13:04:17 2011
New Revision: 1225520

URL: http://svn.apache.org/viewvc?rev=1225520&view=rev
Log:
Fix problem with tab management.  Part of CONNECTORS-343.

Modified:
    incubator/lcf/branches/release-0.4-incubating-branch/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
    incubator/lcf/branches/release-0.4-incubating-branch/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/editConfiguration.html
    incubator/lcf/branches/release-0.4-incubating-branch/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
    incubator/lcf/branches/release-0.4-incubating-branch/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html

Modified: incubator/lcf/branches/release-0.4-incubating-branch/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.4-incubating-branch/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java?rev=1225520&r1=1225519&r2=1225520&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.4-incubating-branch/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
(original)
+++ incubator/lcf/branches/release-0.4-incubating-branch/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
Thu Dec 29 13:04:17 2011
@@ -548,37 +548,38 @@ public class AlfrescoRepositoryConnector
       IHTTPOutput out, ConfigParams parameters, String tabName)
       throws ManifoldCFException, IOException {
     
-    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);
+    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;
+    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";
   
-      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);  
+    ConfigParams newMap = new ConfigParams();
+    newMap.setParameter(AlfrescoConfig.USERNAME_PARAM, username);
+    newMap.setParameter(AlfrescoConfig.PASSWORD_PARAM, password);
+    newMap.setParameter(AlfrescoConfig.PROTOCOL_PARAM, protocol);
+    newMap.setParameter(AlfrescoConfig.SERVER_PARAM, server);
+    newMap.setParameter(AlfrescoConfig.PORT_PARAM, port);
+    newMap.setParameter(AlfrescoConfig.PATH_PARAM, path);
+    
+    if(ALFRESCO_SERVER_TAB_NAME.equals(tabName)){
+      outputResource(EDIT_CONFIG_FORWARD, out, newMap);  
     } else {
-      outputResource(HIDDEN_CONFIG_FORWARD, out, parameters);
+      outputResource(HIDDEN_CONFIG_FORWARD, out, newMap);
     }
   }
 

Modified: incubator/lcf/branches/release-0.4-incubating-branch/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/editConfiguration.html
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.4-incubating-branch/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/editConfiguration.html?rev=1225520&r1=1225519&r2=1225520&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.4-incubating-branch/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/editConfiguration.html
(original)
+++ incubator/lcf/branches/release-0.4-incubating-branch/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/editConfiguration.html
Thu Dec 29 13:04:17 2011
@@ -87,23 +87,7 @@
 </table>
 
 <script type="text/javascript">
-
-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 = "admin";
-}
-
-if(password==null || password==""){
-  var passwordInput = document.getElementById("password");
-  passwordInput.value = "admin";
-}
-
+<!--
 var protocol = "${PROTOCOL}";
 var protocolSelect = document.getElementById("protocol");
 if(protocol=="https"){
@@ -111,20 +95,5 @@ if(protocol=="https"){
 } 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 = "8080";
-}
-
-if(path==null || path==""){
-  var pathInput = document.getElementById("path");
-  pathInput.value = "/alfresco/api";
-}
-
+//-->
 </script>
\ No newline at end of file

Modified: incubator/lcf/branches/release-0.4-incubating-branch/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.4-incubating-branch/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java?rev=1225520&r1=1225519&r2=1225520&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.4-incubating-branch/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
(original)
+++ incubator/lcf/branches/release-0.4-incubating-branch/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
Thu Dec 29 13:04:17 2011
@@ -788,45 +788,45 @@ public class CmisRepositoryConnector ext
       IHTTPOutput out, ConfigParams parameters, String tabName)
       throws ManifoldCFException, IOException {
     
-    if(CMIS_SERVER_TAB_NAME.equals(tabName)){
-      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(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;
+    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(repositoryId))
-        repositoryId = StringUtils.EMPTY;
-      if(StringUtils.isEmpty(binding))
-        binding = CmisConfig.BINDING_ATOM_VALUE;
+    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;
       
-      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);
+    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(CMIS_SERVER_TAB_NAME.equals(tabName)){
+      outputResource(EDIT_CONFIG_FORWARD, out, newMap);
     } else {
-      outputResource(HIDDEN_CONFIG_FORWARD, out, parameters);
+      outputResource(HIDDEN_CONFIG_FORWARD, out, newMap);
     }
   }
 

Modified: incubator/lcf/branches/release-0.4-incubating-branch/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/release-0.4-incubating-branch/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html?rev=1225520&r1=1225519&r2=1225520&view=diff
==============================================================================
--- incubator/lcf/branches/release-0.4-incubating-branch/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html
(original)
+++ incubator/lcf/branches/release-0.4-incubating-branch/connectors/cmis/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/cmis/editConfiguration.html
Thu Dec 29 13:04:17 2011
@@ -108,7 +108,7 @@
 			</nobr>
 		</td>
 		<td class="value">
-			<input type="text" id="repositoryId" name="repositoryId" value="" />
+			<input type="text" id="repositoryId" name="repositoryId" value="${REPOSITORYID}" />
 			<nobr>
 				(optional)
 			</nobr>
@@ -117,36 +117,13 @@
 </table>
 
 <script type="text/javascript">
+<!--
 var binding = "${BINDING}";
 if(binding=="ws"){
   var bindingSelect = document.getElementById("binding");
   bindingSelect.options[1].selected = true;
 }
 
-var repositoryId = "${REPOSITORYID}";
-var repositoryIdField = document.getElementById("repositoryId");
-if(repositoryId!=null && repositoryId!="" && repositoryId!=undefined){
-  repositoryIdField.value = 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"){
@@ -154,19 +131,5 @@ if(protocol=="https"){
 } 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



Mime
View raw message