manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1503255 [1/3] - in /manifoldcf/trunk: ./ connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors...
Date Mon, 15 Jul 2013 14:02:30 GMT
Author: kwright
Date: Mon Jul 15 14:02:29 2013
New Revision: 1503255

URL: http://svn.apache.org/r1503255
Log:
Fix for CONNECTORS-737.  Require login to ManifoldCF UI, and also prevent passwords from being included in any HTML forms.  NOTE WELL: The default login for the UI is userid 'admin' password 'admin'.

Added:
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IHTTPOutputActivity.java
      - copied unchanged from r1503249, manifoldcf/branches/CONNECTORS-737/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IHTTPOutputActivity.java
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IParameterActivity.java
      - copied unchanged from r1503249, manifoldcf/branches/CONNECTORS-737/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IParameterActivity.java
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPasswordMapperActivity.java
      - copied unchanged from r1503249, manifoldcf/branches/CONNECTORS-737/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPasswordMapperActivity.java
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/login.jsp
      - copied unchanged from r1503249, manifoldcf/branches/CONNECTORS-737/framework/crawler-ui/src/main/webapp/login.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/logout.jsp
      - copied unchanged from r1503249, manifoldcf/branches/CONNECTORS-737/framework/crawler-ui/src/main/webapp/logout.jsp
    manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/passwords/
      - copied from r1503249, manifoldcf/branches/CONNECTORS-737/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/passwords/
    manifoldcf/trunk/site/src/documentation/resources/images/en_US/login.PNG
      - copied unchanged from r1503249, manifoldcf/branches/CONNECTORS-737/site/src/documentation/resources/images/en_US/login.PNG
Removed:
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/checkAdminLogin.jsp
Modified:
    manifoldcf/trunk/   (props changed)
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
    manifoldcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
    manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
    manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
    manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java
    manifoldcf/trunk/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java
    manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
    manifoldcf/trunk/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java
    manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java
    manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jdbc/JDBCAuthority.java
    manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jdbc/JDBCConnector.java
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jira/JiraAuthorityConnector.java
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java
    manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java
    manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java
    manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
    manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
    manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java
    manifoldcf/trunk/connectors/rss/   (props changed)
    manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/RSSConnector.java
    manifoldcf/trunk/connectors/sharepoint/   (props changed)
    manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
    manifoldcf/trunk/connectors/solr/connector/src/main/java/org/apache/manifoldcf/agents/output/solr/SolrConnector.java
    manifoldcf/trunk/connectors/webcrawler/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
    manifoldcf/trunk/connectors/wiki/   (props changed)
    manifoldcf/trunk/connectors/wiki/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/wiki/WikiConnector.java
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IHTTPOutput.java
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/interfaces/IPostParameters.java
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/system/ManifoldCF.java
    manifoldcf/trunk/framework/core/src/test/resources/org/apache/manifoldcf/core/tests/VirtualBrowser.py   (contents, props changed)
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/adminDefaults.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/adminHeaders.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editauthority.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editconnection.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editmapper.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editoutput.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/index.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/setupAdminProfile.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewconnection.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewmapper.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewoutput.jsp
    manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/beans/AdminProfile.java
    manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/jsp/JspWrapper.java
    manifoldcf/trunk/framework/ui-core/src/main/java/org/apache/manifoldcf/ui/multipart/MultipartWrapper.java
    manifoldcf/trunk/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
    manifoldcf/trunk/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_ja_JP.properties
    manifoldcf/trunk/site/src/documentation/content/xdocs/en_US/end-user-documentation.xml
    manifoldcf/trunk/site/src/documentation/content/xdocs/en_US/how-to-build-and-deploy.xml
    manifoldcf/trunk/tests/activedirectory/src/test/java/org/apache/manifoldcf/activedirectory_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/alfresco/src/test/java/org/apache/manifoldcf/alfresco_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/cmis/src/test/java/org/apache/manifoldcf/cmis_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/elasticsearch/src/test/java/org/apache/manifoldcf/elasticsearch_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/filesystem/src/test/java/org/apache/manifoldcf/filesystem_tests/NavigationUITester.java
    manifoldcf/trunk/tests/gts/src/test/java/org/apache/manifoldcf/gts_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/hdfs/src/test/java/org/apache/manifoldcf/hdfs_tests/NavigationUITester.java
    manifoldcf/trunk/tests/jcifs/src/test/java/org/apache/manifoldcf/jcifs_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/jdbc/src/test/java/org/apache/manifoldcf/jdbc_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/ldap/src/test/java/org/apache/manifoldcf/ldap_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/nullauthority/src/test/java/org/apache/manifoldcf/nullauthority_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/opensearchserver/src/test/java/org/apache/manifoldcf/opensearchserver_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/rss/src/test/java/org/apache/manifoldcf/rss_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/solr/src/test/java/org/apache/manifoldcf/solr_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/webcrawler/src/test/java/org/apache/manifoldcf/webcrawler_tests/NavigationDerbyUI.java
    manifoldcf/trunk/tests/wiki/src/test/java/org/apache/manifoldcf/wiki_tests/NavigationDerbyUI.java

Propchange: manifoldcf/trunk/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-737:r1501867-1503249

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Mon Jul 15 14:02:29 2013
@@ -3,6 +3,11 @@ $Id$
 
 ======================= 1.3-dev =====================
 
+CONNECTORS-737: Make crawler-UI more secure.  This ticket requires
+that all users log in to the MCF UI, and also prevents passwords from
+appearing in HTML pages.
+(Maciej Lizewski, Karl Wright)
+
 CONNECTORS-751: RequestMinimum field not handled properly in API.
 (Maciej Lizewski, Karl Wright)
 

Modified: manifoldcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java (original)
+++ manifoldcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java Mon Jul 15 14:02:29 2013
@@ -480,13 +480,13 @@ public class ActiveDirectoryAuthority ex
   {
     Map<String,Object> velocityContext = new HashMap<String,Object>();
     velocityContext.put("TabName",tabName);
-    fillInDomainControllerTab(velocityContext,parameters);
-    fillInCacheTab(velocityContext,parameters);
+    fillInDomainControllerTab(velocityContext,out,parameters);
+    fillInCacheTab(velocityContext,out,parameters);
     Messages.outputResourceWithVelocity(out,locale,"editConfiguration_DomainController.html",velocityContext);
     Messages.outputResourceWithVelocity(out,locale,"editConfiguration_Cache.html",velocityContext);
   }
   
-  protected static void fillInDomainControllerTab(Map<String,Object> velocityContext, ConfigParams parameters)
+  protected static void fillInDomainControllerTab(Map<String,Object> velocityContext, IPasswordMapperActivity mapper, ConfigParams parameters)
   {
     String domainControllerName = parameters.getParameter(ActiveDirectoryConfig.PARAM_DOMAINCONTROLLER);
     String userName = parameters.getParameter(ActiveDirectoryConfig.PARAM_USERNAME);
@@ -498,7 +498,7 @@ public class ActiveDirectoryAuthority ex
     // Backwards compatibility: if domain controller parameter is set, create an entry in the map.
     if (domainControllerName != null)
     {
-      domainControllers.add(createDomainControllerMap("",domainControllerName,userName,password,authentication,userACLsUsername));
+      domainControllers.add(createDomainControllerMap(mapper,"",domainControllerName,userName,password,authentication,userACLsUsername));
     }
     else
     {
@@ -516,14 +516,14 @@ public class ActiveDirectoryAuthority ex
           String dcPassword = deobfuscate(cn.getAttributeValue(ActiveDirectoryConfig.ATTR_PASSWORD));
           String dcAuthentication = cn.getAttributeValue(ActiveDirectoryConfig.ATTR_AUTHENTICATION);
           String dcUserACLsUsername = cn.getAttributeValue(ActiveDirectoryConfig.ATTR_USERACLsUSERNAME);
-          domainControllers.add(createDomainControllerMap(dcSuffix,dcDomainController,dcUserName,dcPassword,dcAuthentication,dcUserACLsUsername));
+          domainControllers.add(createDomainControllerMap(mapper,dcSuffix,dcDomainController,dcUserName,dcPassword,dcAuthentication,dcUserACLsUsername));
         }
       }
     }
     velocityContext.put("DOMAINCONTROLLERS",domainControllers);
   }
 
-  protected static Map<String,String> createDomainControllerMap(String suffix, String domainControllerName,
+  protected static Map<String,String> createDomainControllerMap(IPasswordMapperActivity mapper, String suffix, String domainControllerName,
     String userName, String password, String authentication, String userACLsUsername)
   {
     Map<String,String> defaultMap = new HashMap<String,String>();
@@ -534,7 +534,7 @@ public class ActiveDirectoryAuthority ex
     if (userName != null)
       defaultMap.put("USERNAME",userName);
     if (password != null)
-      defaultMap.put("PASSWORD",password);
+      defaultMap.put("PASSWORD",mapper.mapPasswordToKey(password));
     if (authentication != null)
       defaultMap.put("AUTHENTICATION",authentication);
     if (userACLsUsername != null)
@@ -542,7 +542,7 @@ public class ActiveDirectoryAuthority ex
     return defaultMap;
   }
   
-  protected static void fillInCacheTab(Map<String,Object> velocityContext, ConfigParams parameters)
+  protected static void fillInCacheTab(Map<String,Object> velocityContext, IPasswordMapperActivity mapper, ConfigParams parameters)
   {
     String cacheLifetime = parameters.getParameter(ActiveDirectoryConfig.PARAM_CACHELIFETIME);
     if (cacheLifetime == null)
@@ -603,7 +603,7 @@ public class ActiveDirectoryAuthority ex
             variableContext.getParameter("dcrecord_suffix"),
             variableContext.getParameter("dcrecord_domaincontrollername"),
             variableContext.getParameter("dcrecord_username"),
-            variableContext.getParameter("dcrecord_password"),
+            variableContext.mapKeyToPassword(variableContext.getParameter("dcrecord_password")),
             variableContext.getParameter("dcrecord_authentication"),
             variableContext.getParameter("dcrecord_userACLsUsername"));
         }
@@ -614,7 +614,7 @@ public class ActiveDirectoryAuthority ex
             variableContext.getParameter("dcrecord_suffix_"+i),
             variableContext.getParameter("dcrecord_domaincontrollername_"+i),
             variableContext.getParameter("dcrecord_username_"+i),
-            variableContext.getParameter("dcrecord_password_"+i),
+            variableContext.mapKeyToPassword(variableContext.getParameter("dcrecord_password_"+i)),
             variableContext.getParameter("dcrecord_authentication_"+i),
             variableContext.getParameter("dcrecord_userACLsUsername_"+i));
         }
@@ -675,8 +675,8 @@ public class ActiveDirectoryAuthority ex
     throws ManifoldCFException, IOException
   {
     Map<String,Object> velocityContext = new HashMap<String,Object>();
-    fillInDomainControllerTab(velocityContext,parameters);
-    fillInCacheTab(velocityContext,parameters);
+    fillInDomainControllerTab(velocityContext,out,parameters);
+    fillInCacheTab(velocityContext,out,parameters);
     Messages.outputResourceWithVelocity(out,locale,"viewConfiguration.html",velocityContext);
   }
 

Modified: manifoldcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java (original)
+++ manifoldcf/trunk/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java Mon Jul 15 14:02:29 2013
@@ -46,6 +46,7 @@ import org.apache.manifoldcf.agents.inte
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
 import org.apache.manifoldcf.core.interfaces.ConfigParams;
 import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.IPasswordMapperActivity;
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
 import org.apache.manifoldcf.core.interfaces.IThreadContext;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
@@ -476,7 +477,7 @@ public class AlfrescoRepositoryConnector
 
   /** Fill in Velocity parameters for the Server tab.
   */
-  private static void fillInServerParameters(Map<String,String> paramMap, ConfigParams parameters)
+  private static void fillInServerParameters(Map<String,String> paramMap, IPasswordMapperActivity mapper, ConfigParams parameters)
   {
     String username = parameters.getParameter(AlfrescoConfig.USERNAME_PARAM);
     if (username == null)
@@ -486,6 +487,8 @@ public class AlfrescoRepositoryConnector
     String password = parameters.getParameter(AlfrescoConfig.PASSWORD_PARAM);
     if (password == null) 
       password = AlfrescoConfig.PASSWORD_DEFAULT_VALUE;
+    else
+      password = mapper.mapPasswordToKey(password);
     paramMap.put(AlfrescoConfig.PASSWORD_PARAM, password);
     
     String protocol = parameters.getParameter(AlfrescoConfig.PROTOCOL_PARAM);
@@ -544,7 +547,7 @@ public class AlfrescoRepositoryConnector
     // Fill in parameters for all tabs
 
     // Server tab
-    fillInServerParameters(paramMap, parameters);
+    fillInServerParameters(paramMap, out, parameters);
   
     outputResource(VIEW_CONFIG_FORWARD, out, locale, paramMap);
   }
@@ -576,7 +579,7 @@ public class AlfrescoRepositoryConnector
     Map<String,String> paramMap = new HashMap<String,String>();
         
     // Fill in parameters for all tabs
-    fillInServerParameters(paramMap, parameters);
+    fillInServerParameters(paramMap, out, parameters);
 
     outputResource(EDIT_CONFIG_HEADER_FORWARD, out, locale, paramMap);
   }
@@ -598,7 +601,7 @@ public class AlfrescoRepositoryConnector
     // Do the Server tab
     Map<String,String> paramMap = new HashMap<String,String>();
     paramMap.put(TAB_NAME_PARAM, tabName);
-    fillInServerParameters(paramMap, parameters);
+    fillInServerParameters(paramMap, out, parameters);
     outputResource(EDIT_CONFIG_FORWARD_SERVER, out, locale, paramMap);  
   }
 
@@ -633,7 +636,7 @@ public class AlfrescoRepositoryConnector
 
     String password = variableContext.getParameter(AlfrescoConfig.PASSWORD_PARAM);
     if (password != null) {
-      parameters.setParameter(AlfrescoConfig.PASSWORD_PARAM, password);
+      parameters.setParameter(AlfrescoConfig.PASSWORD_PARAM, variableContext.mapKeyToPassword(password));
     }
     
     String protocol = variableContext.getParameter(AlfrescoConfig.PROTOCOL_PARAM);

Modified: manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java (original)
+++ manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java Mon Jul 15 14:02:29 2013
@@ -55,6 +55,7 @@ import org.apache.manifoldcf.agents.inte
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
 import org.apache.manifoldcf.core.interfaces.ConfigParams;
 import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.IPasswordMapperActivity;
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
 import org.apache.manifoldcf.core.interfaces.IThreadContext;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
@@ -699,7 +700,7 @@ public class CmisRepositoryConnector ext
   *@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)
+  private static void fillInServerConfigurationMap(Map<String,String> newMap, IPasswordMapperActivity mapper, ConfigParams parameters)
   {
     String username = parameters.getParameter(CmisConfig.USERNAME_PARAM);
     String password = parameters.getParameter(CmisConfig.PASSWORD_PARAM);
@@ -714,6 +715,8 @@ public class CmisRepositoryConnector ext
       username = StringUtils.EMPTY;
     if(password == null)
       password = StringUtils.EMPTY;
+    else
+      password = mapper.mapPasswordToKey(password);
     if(protocol == null)
       protocol = CmisConfig.PROTOCOL_DEFAULT_VALUE;
     if(server == null)
@@ -758,7 +761,7 @@ public class CmisRepositoryConnector ext
     Map<String,String> paramMap = new HashMap<String,String>();
   
     // Fill in map from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     outputResource(VIEW_CONFIG_FORWARD, out, locale, paramMap);
   }
@@ -791,7 +794,7 @@ public class CmisRepositoryConnector ext
     Map<String,String> paramMap = new HashMap<String,String>();
 
     // Fill in the parameters from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     // Output the Javascript - only one Velocity template for all tabs
     outputResource(EDIT_CONFIG_HEADER_FORWARD, out, locale, paramMap);
@@ -809,7 +812,7 @@ public class CmisRepositoryConnector ext
     // Set the tab name
     paramMap.put("TabName", tabName);
     // Fill in the parameters
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
     outputResource(EDIT_CONFIG_FORWARD_SERVER, out, locale, paramMap);
   
   }
@@ -848,7 +851,7 @@ public class CmisRepositoryConnector ext
 
     String password = variableContext.getParameter(CmisConfig.PASSWORD_PARAM);
     if (password != null)
-      parameters.setParameter(CmisConfig.PASSWORD_PARAM, password);
+      parameters.setParameter(CmisConfig.PASSWORD_PARAM, variableContext.mapKeyToPassword(password));
 
     String protocol = variableContext.getParameter(CmisConfig.PROTOCOL_PARAM);
     if (protocol != null) {

Modified: manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java (original)
+++ manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java Mon Jul 15 14:02:29 2013
@@ -1123,27 +1123,29 @@ public class AuthorityConnector extends 
     Locale locale, ConfigParams parameters, String tabName)
     throws ManifoldCFException, IOException
   {
-    String docbaseName = parameters.getParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_DOCBASE);
+    String docbaseName = parameters.getParameter(CONFIG_PARAM_DOCBASE);
     if (docbaseName == null)
       docbaseName = "";
 
-    String docbaseUserName = parameters.getParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_USERNAME);
+    String docbaseUserName = parameters.getParameter(CONFIG_PARAM_USERNAME);
     if (docbaseUserName == null)
       docbaseUserName = "";
 
-    String docbasePassword = parameters.getObfuscatedParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_PASSWORD);
+    String docbasePassword = parameters.getObfuscatedParameter(CONFIG_PARAM_PASSWORD);
     if (docbasePassword == null)
       docbasePassword = "";
+    else
+      docbasePassword = out.mapPasswordToKey(docbasePassword);
 
-    String docbaseDomain = parameters.getParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_DOMAIN);
+    String docbaseDomain = parameters.getParameter(CONFIG_PARAM_DOMAIN);
     if (docbaseDomain == null)
       docbaseDomain = "";
 
-    String caseInsensitiveUser = parameters.getParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_CASEINSENSITIVE);
+    String caseInsensitiveUser = parameters.getParameter(CONFIG_PARAM_CASEINSENSITIVE);
     if (caseInsensitiveUser == null)
       caseInsensitiveUser = "false";
 
-    String useSystemAcls = parameters.getParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_USESYSTEMACLS);
+    String useSystemAcls = parameters.getParameter(CONFIG_PARAM_USESYSTEMACLS);
     if (useSystemAcls == null)
       useSystemAcls = "true";
 
@@ -1298,27 +1300,27 @@ public class AuthorityConnector extends 
   {
     String docbaseName = variableContext.getParameter("docbasename");
     if (docbaseName != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_DOCBASE,docbaseName);
+      parameters.setParameter(CONFIG_PARAM_DOCBASE,docbaseName);
 	
     String docbaseUserName = variableContext.getParameter("docbaseusername");
     if (docbaseUserName != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_USERNAME,docbaseUserName);
+      parameters.setParameter(CONFIG_PARAM_USERNAME,docbaseUserName);
 	
     String docbasePassword = variableContext.getParameter("docbasepassword");
     if (docbasePassword != null)
-      parameters.setObfuscatedParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_PASSWORD,docbasePassword);
+      parameters.setObfuscatedParameter(CONFIG_PARAM_PASSWORD,variableContext.mapKeyToPassword(docbasePassword));
 	
     String docbaseDomain = variableContext.getParameter("docbasedomain");
     if (docbaseDomain != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_DOMAIN,docbaseDomain);
+      parameters.setParameter(CONFIG_PARAM_DOMAIN,docbaseDomain);
 
     String caseInsensitiveUser = variableContext.getParameter("usernamecaseinsensitive");
     if (caseInsensitiveUser != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_CASEINSENSITIVE,caseInsensitiveUser);
+      parameters.setParameter(CONFIG_PARAM_CASEINSENSITIVE,caseInsensitiveUser);
 
     String useSystemAcls = variableContext.getParameter("usesystemacls");
     if (useSystemAcls != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_USESYSTEMACLS,useSystemAcls);
+      parameters.setParameter(CONFIG_PARAM_USESYSTEMACLS,useSystemAcls);
     
     String cacheLifetime = variableContext.getParameter("cachelifetime");
     if (cacheLifetime != null)

Modified: manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java (original)
+++ manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java Mon Jul 15 14:02:29 2013
@@ -2014,19 +2014,21 @@ public class DCTM extends org.apache.man
     Locale locale, ConfigParams parameters, String tabName)
     throws ManifoldCFException, IOException
   {
-    String docbaseName = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_DOCBASE);
+    String docbaseName = parameters.getParameter(CONFIG_PARAM_DOCBASE);
     if (docbaseName == null)
       docbaseName = "";
-    String docbaseUserName = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_USERNAME);
+    String docbaseUserName = parameters.getParameter(CONFIG_PARAM_USERNAME);
     if (docbaseUserName == null)
       docbaseUserName = "";
-    String docbasePassword = parameters.getObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PASSWORD);
+    String docbasePassword = parameters.getObfuscatedParameter(CONFIG_PARAM_PASSWORD);
     if (docbasePassword == null)
       docbasePassword = "";
-    String docbaseDomain = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_DOMAIN);
+    else
+      docbasePassword = out.mapPasswordToKey(docbasePassword);
+    String docbaseDomain = parameters.getParameter(CONFIG_PARAM_DOMAIN);
     if (docbaseDomain == null)
       docbaseDomain = "";
-    String webtopBaseUrl = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_WEBTOPBASEURL);
+    String webtopBaseUrl = parameters.getParameter(CONFIG_PARAM_WEBTOPBASEURL);
     if (webtopBaseUrl == null)
       webtopBaseUrl = "http://localhost/webtop/";
 
@@ -2099,23 +2101,23 @@ public class DCTM extends org.apache.man
   {
     String docbaseName = variableContext.getParameter("docbasename");
     if (docbaseName != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_DOCBASE,docbaseName);
+      parameters.setParameter(CONFIG_PARAM_DOCBASE,docbaseName);
 
     String docbaseUserName = variableContext.getParameter("docbaseusername");
     if (docbaseUserName != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_USERNAME,docbaseUserName);
+      parameters.setParameter(CONFIG_PARAM_USERNAME,docbaseUserName);
 
     String docbasePassword = variableContext.getParameter("docbasepassword");
     if (docbasePassword != null)
-      parameters.setObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PASSWORD,docbasePassword);
+      parameters.setObfuscatedParameter(CONFIG_PARAM_PASSWORD,variableContext.mapKeyToPassword(docbasePassword));
 
     String docbaseDomain = variableContext.getParameter("docbasedomain");
     if (docbaseDomain != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_DOMAIN,docbaseDomain);
+      parameters.setParameter(CONFIG_PARAM_DOMAIN,docbaseDomain);
 
     String webtopBaseUrl = variableContext.getParameter("webtopbaseurl");
     if (webtopBaseUrl != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_WEBTOPBASEURL,webtopBaseUrl);
+      parameters.setParameter(CONFIG_PARAM_WEBTOPBASEURL,webtopBaseUrl);
 
     return null;
   }
@@ -2282,7 +2284,7 @@ public class DCTM extends org.apache.man
       while (i < ds.getChildCount())
       {
         SpecificationNode sn = ds.getChild(i++);
-        if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_LOCATION))
+        if (sn.getType().equals(CONFIG_PARAM_LOCATION))
         {
           String pathDescription = "_" + Integer.toString(k);
           String pathOpName = "pathop" + pathDescription;
@@ -2397,7 +2399,7 @@ public class DCTM extends org.apache.man
       while (i < ds.getChildCount())
       {
         SpecificationNode sn = ds.getChild(i++);
-        if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_LOCATION))
+        if (sn.getType().equals(CONFIG_PARAM_LOCATION))
         {
           String pathDescription = "_" + Integer.toString(k);
           out.print(
@@ -2530,7 +2532,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_OBJECTTYPE))
+      if (sn.getType().equals(CONFIG_PARAM_OBJECTTYPE))
       {
         String token = sn.getAttributeValue("token");
         if (token != null && token.length() > 0)
@@ -2546,7 +2548,7 @@ public class DCTM extends org.apache.man
             while (kk < sn.getChildCount())
             {
               SpecificationNode dsn = sn.getChild(kk++);
-              if (dsn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_ATTRIBUTENAME))
+              if (dsn.getType().equals(CONFIG_PARAM_ATTRIBUTENAME))
               {
                 String attr = dsn.getAttributeValue("attrname");
                 attrMap.put(attr,attr);
@@ -2706,7 +2708,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_FORMAT))
+      if (sn.getType().equals(CONFIG_PARAM_FORMAT))
       {
         String token = sn.getAttributeValue("value");
         if (token != null && token.length() > 0)
@@ -2808,7 +2810,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_MAXLENGTH))
+      if (sn.getType().equals(CONFIG_PARAM_MAXLENGTH))
       {
         maxDocLength = sn.getAttributeValue("value");
       }
@@ -2846,7 +2848,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PATHNAMEATTRIBUTE))
+      if (sn.getType().equals(CONFIG_PARAM_PATHNAMEATTRIBUTE))
       {
         pathNameAttribute = sn.getAttributeValue("value");
       }
@@ -2858,7 +2860,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PATHMAP))
+      if (sn.getType().equals(CONFIG_PARAM_PATHMAP))
       {
         String pathMatch = sn.getAttributeValue("match");
         String pathReplace = sn.getAttributeValue("replace");
@@ -2963,7 +2965,7 @@ public class DCTM extends org.apache.man
       while (i < ds.getChildCount())
       {
       	SpecificationNode sn = ds.getChild(i);
-      	if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_LOCATION))
+      	if (sn.getType().equals(CONFIG_PARAM_LOCATION))
           ds.removeChild(i);
       	else
           i++;
@@ -2986,7 +2988,7 @@ public class DCTM extends org.apache.man
       	}
       	// Path inserts won't happen until the very end
       	String path = variableContext.getParameter("specpath"+pathDescription);
-      	SpecificationNode node = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_LOCATION);
+      	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_LOCATION);
       	node.setAttribute("path",path);
       	ds.addChild(ds.getChildCount(),node);
       	i++;
@@ -2997,7 +2999,7 @@ public class DCTM extends org.apache.man
       if (op != null && op.equals("Add"))
       {
       	String path = variableContext.getParameter("specpath");
-      	SpecificationNode node = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_LOCATION);
+      	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_LOCATION);
       	node.setAttribute("path",path);
       	ds.addChild(ds.getChildCount(),node);
       }
@@ -3100,7 +3102,7 @@ public class DCTM extends org.apache.man
       while (i < ds.getChildCount())
       {
       	SpecificationNode sn = ds.getChild(i);
-      	if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_OBJECTTYPE))
+      	if (sn.getType().equals(CONFIG_PARAM_OBJECTTYPE))
           ds.removeChild(i);
       	else
           i++;
@@ -3111,7 +3113,7 @@ public class DCTM extends org.apache.man
       while (i < y.length)
       {
       	String fileType = y[i++];
-      	SpecificationNode node = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_OBJECTTYPE);
+      	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_OBJECTTYPE);
       	node.setAttribute("token",fileType);
       	String isAll = variableContext.getParameter("specfileallattrs_"+fileType);
       	if (isAll != null)
@@ -3122,7 +3124,7 @@ public class DCTM extends org.apache.man
           int k = 0;
           while (k < z.length)
           {
-            SpecificationNode attrNode = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_ATTRIBUTENAME);
+            SpecificationNode attrNode = new SpecificationNode(CONFIG_PARAM_ATTRIBUTENAME);
             attrNode.setAttribute("attrname",z[k++]);
             node.addChild(node.getChildCount(),attrNode);
           }
@@ -3139,7 +3141,7 @@ public class DCTM extends org.apache.man
       while (i < ds.getChildCount())
       {
       	SpecificationNode sn = ds.getChild(i);
-      	if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_FORMAT))
+      	if (sn.getType().equals(CONFIG_PARAM_FORMAT))
           ds.removeChild(i);
       	else
           i++;
@@ -3150,7 +3152,7 @@ public class DCTM extends org.apache.man
       while (i < y.length)
       {
       	String fileType = y[i++];
-      	SpecificationNode node = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_FORMAT);
+      	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_FORMAT);
       	node.setAttribute("value",fileType);
       	ds.addChild(ds.getChildCount(),node);
       }
@@ -3164,7 +3166,7 @@ public class DCTM extends org.apache.man
       while (i < ds.getChildCount())
       {
       	SpecificationNode sn = ds.getChild(i);
-      	if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_MAXLENGTH))
+      	if (sn.getType().equals(CONFIG_PARAM_MAXLENGTH))
           ds.removeChild(i);
       	else
           i++;
@@ -3172,7 +3174,7 @@ public class DCTM extends org.apache.man
 
       if (x.length() > 0)
       {
-      	SpecificationNode node = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_MAXLENGTH);
+      	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_MAXLENGTH);
       	node.setAttribute("value",x);
       	ds.addChild(ds.getChildCount(),node);
       }
@@ -3186,14 +3188,14 @@ public class DCTM extends org.apache.man
       while (i < ds.getChildCount())
       {
       	SpecificationNode sn = ds.getChild(i);
-      	if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PATHNAMEATTRIBUTE))
+      	if (sn.getType().equals(CONFIG_PARAM_PATHNAMEATTRIBUTE))
           ds.removeChild(i);
       	else
           i++;
       }
       if (xc.length() > 0)
       {
-      	SpecificationNode node = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PATHNAMEATTRIBUTE);
+      	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_PATHNAMEATTRIBUTE);
       	node.setAttribute("value",xc);
       	ds.addChild(ds.getChildCount(),node);
       }
@@ -3207,7 +3209,7 @@ public class DCTM extends org.apache.man
       while (i < ds.getChildCount())
       {
       	SpecificationNode sn = ds.getChild(i);
-      	if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PATHMAP))
+      	if (sn.getType().equals(CONFIG_PARAM_PATHMAP))
           ds.removeChild(i);
       	else
           i++;
@@ -3232,7 +3234,7 @@ public class DCTM extends org.apache.man
       	// Inserts won't happen until the very end
       	String match = variableContext.getParameter("specmatch"+pathDescription);
       	String replace = variableContext.getParameter("specreplace"+pathDescription);
-      	SpecificationNode node = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PATHMAP);
+      	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_PATHMAP);
       	node.setAttribute("match",match);
       	node.setAttribute("replace",replace);
       	ds.addChild(ds.getChildCount(),node);
@@ -3245,7 +3247,7 @@ public class DCTM extends org.apache.man
       {
       	String match = variableContext.getParameter("specmatch");
       	String replace = variableContext.getParameter("specreplace");
-      	SpecificationNode node = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PATHMAP);
+      	SpecificationNode node = new SpecificationNode(CONFIG_PARAM_PATHMAP);
       	node.setAttribute("match",match);
       	node.setAttribute("replace",replace);
       	ds.addChild(ds.getChildCount(),node);
@@ -3273,7 +3275,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_LOCATION))
+      if (sn.getType().equals(CONFIG_PARAM_LOCATION))
       {
         if (seenAny == false)
         {
@@ -3312,7 +3314,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_OBJECTTYPE))
+      if (sn.getType().equals(CONFIG_PARAM_OBJECTTYPE))
       {
         if (seenAny == false)
         {
@@ -3342,7 +3344,7 @@ public class DCTM extends org.apache.man
           while (k < sn.getChildCount())
           {
             SpecificationNode dsn = sn.getChild(k++);
-            if (dsn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_ATTRIBUTENAME))
+            if (dsn.getType().equals(CONFIG_PARAM_ATTRIBUTENAME))
             {
               String attrName = dsn.getAttributeValue("attrname");
               out.print(
@@ -3382,7 +3384,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_FORMAT))
+      if (sn.getType().equals(CONFIG_PARAM_FORMAT))
       {
         if (seenAny == false)
         {
@@ -3421,7 +3423,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_MAXLENGTH))
+      if (sn.getType().equals(CONFIG_PARAM_MAXLENGTH))
       {
         maxDocumentLength = sn.getAttributeValue("value");
       }
@@ -3511,7 +3513,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PATHNAMEATTRIBUTE))
+      if (sn.getType().equals(CONFIG_PARAM_PATHNAMEATTRIBUTE))
       {
         pathNameAttribute = sn.getAttributeValue("value");
       }
@@ -3548,7 +3550,7 @@ public class DCTM extends org.apache.man
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.DCTM.DCTM.CONFIG_PARAM_PATHMAP))
+      if (sn.getType().equals(CONFIG_PARAM_PATHMAP))
       {
         String pathMatch = sn.getAttributeValue("match");
         String pathReplace = sn.getAttributeValue("replace");

Modified: manifoldcf/trunk/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java (original)
+++ manifoldcf/trunk/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java Mon Jul 15 14:02:29 2013
@@ -43,6 +43,7 @@ import org.apache.manifoldcf.core.common
 import org.apache.commons.lang.StringUtils;
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.IPasswordMapperActivity;
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
 import org.apache.manifoldcf.core.interfaces.IThreadContext;
 import org.apache.manifoldcf.core.interfaces.SpecificationNode;
@@ -347,7 +348,7 @@ public class DropboxRepositoryConnector 
    * @param newMap is the map to fill in
    * @param parameters is the current set of configuration parameters
    */
-  private static void fillInServerConfigurationMap(Map<String, Object> newMap, ConfigParams parameters) {
+  private static void fillInServerConfigurationMap(Map<String, Object> newMap, IPasswordMapperActivity mapper, ConfigParams parameters) {
     
     String app_key = parameters.getParameter(DropboxConfig.APP_KEY_PARAM);
     String app_secret = parameters.getObfuscatedParameter(DropboxConfig.APP_SECRET_PARAM);
@@ -361,6 +362,8 @@ public class DropboxRepositoryConnector 
     
     if (app_secret == null) {
       app_secret = StringUtils.EMPTY;
+    } else {
+      app_secret = mapper.mapPasswordToKey(app_secret);
     }
     
     if (username == null) {
@@ -368,6 +371,8 @@ public class DropboxRepositoryConnector 
     }
     if (password == null) {
       password = StringUtils.EMPTY;
+    } else {
+      password = mapper.mapPasswordToKey(password);
     }
     
     newMap.put("APP_KEY", app_key);
@@ -395,7 +400,7 @@ public class DropboxRepositoryConnector 
     Map<String, Object> paramMap = new HashMap<String, Object>();
 
     // Fill in map from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     Messages.outputResourceWithVelocity(out,locale,VIEW_CONFIG_FORWARD,paramMap);
   }
@@ -425,7 +430,7 @@ public class DropboxRepositoryConnector 
     Map<String, Object> paramMap = new HashMap<String, Object>();
 
     // Fill in the parameters from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     // Output the Javascript - only one Velocity template for all tabs
     Messages.outputResourceWithVelocity(out,locale,EDIT_CONFIG_HEADER_FORWARD,paramMap);
@@ -443,7 +448,7 @@ public class DropboxRepositoryConnector 
     // Set the tab name
     paramMap.put("TabName", tabName);
     // Fill in the parameters
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
     Messages.outputResourceWithVelocity(out,locale,EDIT_CONFIG_FORWARD_SERVER,paramMap);
 
   }
@@ -478,7 +483,7 @@ public class DropboxRepositoryConnector 
     
     String app_secret = variableContext.getParameter("app_secret");
     if (app_secret != null) {
-      parameters.setObfuscatedParameter(DropboxConfig.APP_SECRET_PARAM, app_secret);
+      parameters.setObfuscatedParameter(DropboxConfig.APP_SECRET_PARAM, variableContext.mapKeyToPassword(app_secret));
     }
     
     String key = variableContext.getParameter("key");
@@ -488,7 +493,7 @@ public class DropboxRepositoryConnector 
 
     String secret = variableContext.getParameter("secret");
     if (secret != null) {
-      parameters.setObfuscatedParameter(DropboxConfig.SECRET_PARAM, secret);
+      parameters.setObfuscatedParameter(DropboxConfig.SECRET_PARAM, variableContext.mapKeyToPassword(secret));
     }
 
     return null;

Modified: manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java (original)
+++ manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java Mon Jul 15 14:02:29 2013
@@ -1567,44 +1567,46 @@ public class FilenetConnector extends or
     Locale locale, ConfigParams parameters, String tabName)
     throws ManifoldCFException, IOException
   {
-    String userID = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_USERID);
+    String userID = parameters.getParameter(CONFIG_PARAM_USERID);
     if (userID == null)
       userID = "";
-    String password = parameters.getObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_PASSWORD);
+    String password = parameters.getObfuscatedParameter(CONFIG_PARAM_PASSWORD);
     if (password == null)
       password = "";
-    String filenetdomain = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_FILENETDOMAIN);
+    else
+      password = out.mapPasswordToKey(password);
+    String filenetdomain = parameters.getParameter(CONFIG_PARAM_FILENETDOMAIN);
     if (filenetdomain == null)
     {
-      filenetdomain = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_FILENETDOMAIN_OLD);
+      filenetdomain = parameters.getParameter(CONFIG_PARAM_FILENETDOMAIN_OLD);
       if (filenetdomain == null)
         filenetdomain = "";
     }
-    String objectstore = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_OBJECTSTORE);
+    String objectstore = parameters.getParameter(CONFIG_PARAM_OBJECTSTORE);
     if (objectstore == null)
       objectstore = "";
-    String serverprotocol = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_SERVERPROTOCOL);
+    String serverprotocol = parameters.getParameter(CONFIG_PARAM_SERVERPROTOCOL);
     if (serverprotocol == null)
       serverprotocol = "http";
-    String serverhostname = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_SERVERHOSTNAME);
+    String serverhostname = parameters.getParameter(CONFIG_PARAM_SERVERHOSTNAME);
     if (serverhostname == null)
       serverhostname = "";
-    String serverport = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_SERVERPORT);
+    String serverport = parameters.getParameter(CONFIG_PARAM_SERVERPORT);
     if (serverport == null)
       serverport = "";
-    String serverwsilocation = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_SERVERWSILOCATION);
+    String serverwsilocation = parameters.getParameter(CONFIG_PARAM_SERVERWSILOCATION);
     if (serverwsilocation == null)
       serverwsilocation = "wsi/FNCEWS40DIME";
-    String urlprotocol = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_URLPROTOCOL);
+    String urlprotocol = parameters.getParameter(CONFIG_PARAM_URLPROTOCOL);
     if (urlprotocol == null)
       urlprotocol = "http";
-    String urlhostname = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_URLHOSTNAME);
+    String urlhostname = parameters.getParameter(CONFIG_PARAM_URLHOSTNAME);
     if (urlhostname == null)
       urlhostname = "";
-    String urlport = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_URLPORT);
+    String urlport = parameters.getParameter(CONFIG_PARAM_URLPORT);
     if (urlport == null)
       urlport = "";
-    String urllocation = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_URLLOCATION);
+    String urllocation = parameters.getParameter(CONFIG_PARAM_URLLOCATION);
     if (urllocation == null)
       urllocation = "Workplace/Browse.jsp";
 
@@ -1751,51 +1753,51 @@ public class FilenetConnector extends or
   {
     String serverprotocol = variableContext.getParameter("serverprotocol");
     if (serverprotocol != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_SERVERPROTOCOL,serverprotocol);
+      parameters.setParameter(CONFIG_PARAM_SERVERPROTOCOL,serverprotocol);
 
     String serverhostname = variableContext.getParameter("serverhostname");
     if (serverhostname != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_SERVERHOSTNAME,serverhostname);
+      parameters.setParameter(CONFIG_PARAM_SERVERHOSTNAME,serverhostname);
     
     String serverport = variableContext.getParameter("serverport");
     if (serverport != null && serverport.length() > 0)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_SERVERPORT,serverport);
+      parameters.setParameter(CONFIG_PARAM_SERVERPORT,serverport);
 
     String serverwsilocation = variableContext.getParameter("serverwsilocation");
     if (serverwsilocation != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_SERVERWSILOCATION,serverwsilocation);
+      parameters.setParameter(CONFIG_PARAM_SERVERWSILOCATION,serverwsilocation);
 
     String urlprotocol = variableContext.getParameter("urlprotocol");
     if (urlprotocol != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_URLPROTOCOL,urlprotocol);
+      parameters.setParameter(CONFIG_PARAM_URLPROTOCOL,urlprotocol);
 
     String urlhostname = variableContext.getParameter("urlhostname");
     if (urlhostname != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_URLHOSTNAME,urlhostname);
+      parameters.setParameter(CONFIG_PARAM_URLHOSTNAME,urlhostname);
 
     String urlport = variableContext.getParameter("urlport");
     if (urlport != null && urlport.length() > 0)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_URLPORT,urlport);
+      parameters.setParameter(CONFIG_PARAM_URLPORT,urlport);
 
     String urllocation = variableContext.getParameter("urllocation");
     if (urllocation != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_URLLOCATION,urllocation);
+      parameters.setParameter(CONFIG_PARAM_URLLOCATION,urllocation);
 
     String userID = variableContext.getParameter("userid");
     if (userID != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_USERID,userID);
+      parameters.setParameter(CONFIG_PARAM_USERID,userID);
 
     String password = variableContext.getParameter("password");
     if (password != null)
-      parameters.setObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_PASSWORD,password);
+      parameters.setObfuscatedParameter(CONFIG_PARAM_PASSWORD,variableContext.mapKeyToPassword(password));
 
     String filenetdomain = variableContext.getParameter("filenetdomain");
     if (filenetdomain != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_FILENETDOMAIN,filenetdomain);
+      parameters.setParameter(CONFIG_PARAM_FILENETDOMAIN,filenetdomain);
 
     String objectstore = variableContext.getParameter("objectstore");
     if (objectstore != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.CONFIG_PARAM_OBJECTSTORE,objectstore);
+      parameters.setParameter(CONFIG_PARAM_OBJECTSTORE,objectstore);
     return null;
   }
   
@@ -1949,9 +1951,9 @@ public class FilenetConnector extends or
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_DOCUMENTCLASS))
+      if (sn.getType().equals(SPEC_NODE_DOCUMENTCLASS))
       {
-        String value = sn.getAttributeValue(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_VALUE);
+        String value = sn.getAttributeValue(SPEC_ATTRIBUTE_VALUE);
         // Now, scan for metadata etc.
         org.apache.manifoldcf.crawler.connectors.filenet.DocClassSpec spec = new org.apache.manifoldcf.crawler.connectors.filenet.DocClassSpec(sn);
         documentClasses.put(value,spec);
@@ -2366,9 +2368,9 @@ public class FilenetConnector extends or
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_MIMETYPE))
+      if (sn.getType().equals(SPEC_NODE_MIMETYPE))
       {
-        String value = sn.getAttributeValue(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_VALUE);
+        String value = sn.getAttributeValue(SPEC_ATTRIBUTE_VALUE);
         if (mimeTypes == null)
           mimeTypes = new HashMap();
         mimeTypes.put(value,value);
@@ -2594,7 +2596,7 @@ public class FilenetConnector extends or
       i = 0;
       while (i < ds.getChildCount())
       {
-        if (ds.getChild(i).getType().equals(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_DOCUMENTCLASS))
+        if (ds.getChild(i).getType().equals(SPEC_NODE_DOCUMENTCLASS))
           ds.removeChild(i);
         else
           i++;
@@ -2606,14 +2608,14 @@ public class FilenetConnector extends or
         while (i < x.length)
         {
           String value = x[i++];
-          SpecificationNode node = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_DOCUMENTCLASS);
-          node.setAttribute(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_VALUE,value);
+          SpecificationNode node = new SpecificationNode(SPEC_NODE_DOCUMENTCLASS);
+          node.setAttribute(SPEC_ATTRIBUTE_VALUE,value);
           // Get the allmetadata value for this document class
           String allmetadata = variableContext.getParameter("allmetadata_"+value);
           if (allmetadata == null)
             allmetadata = "false";
           if (allmetadata.equals("true"))
-            node.setAttribute(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_ALLMETADATA,allmetadata);
+            node.setAttribute(SPEC_ATTRIBUTE_ALLMETADATA,allmetadata);
           else
           {
             String[] fields = variableContext.getParameterValues("metadatafield_"+value);
@@ -2623,8 +2625,8 @@ public class FilenetConnector extends or
               while (j < fields.length)
               {
                 String field = fields[j++];
-                SpecificationNode sp2 = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_METADATAFIELD);
-                sp2.setAttribute(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_VALUE,field);
+                SpecificationNode sp2 = new SpecificationNode(SPEC_NODE_METADATAFIELD);
+                sp2.setAttribute(SPEC_ATTRIBUTE_VALUE,field);
                 node.addChild(node.getChildCount(),sp2);
               }
             }
@@ -2642,12 +2644,12 @@ public class FilenetConnector extends or
             String matchValue = variableContext.getParameter("matchvalue_"+value+"_"+Integer.toString(q));
             if (matchOp == null || !matchOp.equals("Delete"))
             {
-              SpecificationNode matchNode = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_MATCH);
-              matchNode.setAttribute(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_MATCHTYPE,matchType);
-              matchNode.setAttribute(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_FIELDNAME,matchField);
+              SpecificationNode matchNode = new SpecificationNode(SPEC_NODE_MATCH);
+              matchNode.setAttribute(SPEC_ATTRIBUTE_MATCHTYPE,matchType);
+              matchNode.setAttribute(SPEC_ATTRIBUTE_FIELDNAME,matchField);
               if (matchValue == null)
                 matchValue = "";
-              matchNode.setAttribute(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_VALUE,matchValue);
+              matchNode.setAttribute(SPEC_ATTRIBUTE_VALUE,matchValue);
               node.addChild(node.getChildCount(),matchNode);
             }
             q++;
@@ -2661,12 +2663,12 @@ public class FilenetConnector extends or
             String matchType = variableContext.getParameter("matchtype_"+value);
             String matchField = variableContext.getParameter("matchfield_"+value);
             String matchValue = variableContext.getParameter("matchvalue_"+value);
-            SpecificationNode matchNode = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_MATCH);
-            matchNode.setAttribute(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_MATCHTYPE,matchType);
-            matchNode.setAttribute(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_FIELDNAME,matchField);
+            SpecificationNode matchNode = new SpecificationNode(SPEC_NODE_MATCH);
+            matchNode.setAttribute(SPEC_ATTRIBUTE_MATCHTYPE,matchType);
+            matchNode.setAttribute(SPEC_ATTRIBUTE_FIELDNAME,matchField);
             if (matchValue == null)
               matchValue = "";
-            matchNode.setAttribute(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_VALUE,matchValue);
+            matchNode.setAttribute(SPEC_ATTRIBUTE_VALUE,matchValue);
             node.addChild(node.getChildCount(),matchNode);
           }
 			
@@ -2679,7 +2681,7 @@ public class FilenetConnector extends or
       i = 0;
       while (i < ds.getChildCount())
       {
-        if (ds.getChild(i).getType().equals(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_MIMETYPE))
+        if (ds.getChild(i).getType().equals(SPEC_NODE_MIMETYPE))
           ds.removeChild(i);
         else
           i++;
@@ -2691,8 +2693,8 @@ public class FilenetConnector extends or
         while (i < x.length)
         {
           String value = x[i++];
-          SpecificationNode node = new SpecificationNode(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_MIMETYPE);
-          node.setAttribute(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_VALUE,value);
+          SpecificationNode node = new SpecificationNode(SPEC_NODE_MIMETYPE);
+          node.setAttribute(SPEC_ATTRIBUTE_VALUE,value);
           ds.addChild(ds.getChildCount(),node);
         }
       }
@@ -2861,9 +2863,9 @@ public class FilenetConnector extends or
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_DOCUMENTCLASS))
+      if (sn.getType().equals(SPEC_NODE_DOCUMENTCLASS))
       {
-        String value = sn.getAttributeValue(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_VALUE);
+        String value = sn.getAttributeValue(SPEC_ATTRIBUTE_VALUE);
         org.apache.manifoldcf.crawler.connectors.filenet.DocClassSpec spec = new org.apache.manifoldcf.crawler.connectors.filenet.DocClassSpec(sn);
         documentClasses.put(value,spec);
       }
@@ -2973,9 +2975,9 @@ public class FilenetConnector extends or
     while (i < ds.getChildCount())
     {
       SpecificationNode sn = ds.getChild(i++);
-      if (sn.getType().equals(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_NODE_MIMETYPE))
+      if (sn.getType().equals(SPEC_NODE_MIMETYPE))
       {
-        String value = sn.getAttributeValue(org.apache.manifoldcf.crawler.connectors.filenet.FilenetConnector.SPEC_ATTRIBUTE_VALUE);
+        String value = sn.getAttributeValue(SPEC_ATTRIBUTE_VALUE);
         if (mimeTypes == null)
           mimeTypes = new HashMap();
         mimeTypes.put(value,value);

Modified: manifoldcf/trunk/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java (original)
+++ manifoldcf/trunk/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java Mon Jul 15 14:02:29 2013
@@ -41,6 +41,7 @@ import org.apache.manifoldcf.core.interf
 import org.apache.commons.lang.StringUtils;
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.IPasswordMapperActivity;
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
 import org.apache.manifoldcf.core.interfaces.IThreadContext;
 import org.apache.manifoldcf.core.interfaces.SpecificationNode;
@@ -411,7 +412,7 @@ public class GoogleDriveRepositoryConnec
    * @param newMap is the map to fill in
    * @param parameters is the current set of configuration parameters
    */
-  private static void fillInServerConfigurationMap(Map<String, Object> newMap, ConfigParams parameters) {
+  private static void fillInServerConfigurationMap(Map<String, Object> newMap, IPasswordMapperActivity mapper, ConfigParams parameters) {
     String clientid = parameters.getParameter(GoogleDriveConfig.CLIENT_ID_PARAM);
     String clientsecret = parameters.getObfuscatedParameter(GoogleDriveConfig.CLIENT_SECRET_PARAM);
     String refreshtoken = parameters.getParameter(GoogleDriveConfig.REFRESH_TOKEN_PARAM);
@@ -422,6 +423,8 @@ public class GoogleDriveRepositoryConnec
     
     if (clientsecret == null) {
       clientsecret = StringUtils.EMPTY;
+    } else {
+      clientsecret = mapper.mapPasswordToKey(clientsecret);
     }
 
     if (refreshtoken == null) {
@@ -451,7 +454,7 @@ public class GoogleDriveRepositoryConnec
     Map<String, Object> paramMap = new HashMap<String, Object>();
 
     // Fill in map from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     Messages.outputResourceWithVelocity(out,locale,VIEW_CONFIG_FORWARD,paramMap);
   }
@@ -480,7 +483,7 @@ public class GoogleDriveRepositoryConnec
     Map<String, Object> paramMap = new HashMap<String, Object>();
 
     // Fill in the parameters from each tab
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
 
     // Output the Javascript - only one Velocity template for all tabs
     Messages.outputResourceWithVelocity(out,locale,EDIT_CONFIG_HEADER_FORWARD,paramMap);
@@ -499,7 +502,7 @@ public class GoogleDriveRepositoryConnec
 
     // Server tab
     // Fill in the parameters
-    fillInServerConfigurationMap(paramMap, parameters);
+    fillInServerConfigurationMap(paramMap, out, parameters);
     Messages.outputResourceWithVelocity(out,locale,EDIT_CONFIG_FORWARD_SERVER,paramMap);
   }
 
@@ -532,7 +535,7 @@ public class GoogleDriveRepositoryConnec
 
     String clientsecret = variableContext.getParameter(GoogleDriveConfig.CLIENT_SECRET_PARAM);
     if (clientsecret != null) {
-      parameters.setObfuscatedParameter(GoogleDriveConfig.CLIENT_SECRET_PARAM, clientsecret);
+      parameters.setObfuscatedParameter(GoogleDriveConfig.CLIENT_SECRET_PARAM, variableContext.mapKeyToPassword(clientsecret));
     }
 
     String refreshtoken = variableContext.getParameter(GoogleDriveConfig.REFRESH_TOKEN_PARAM);

Modified: manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java (original)
+++ manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java Mon Jul 15 14:02:29 2013
@@ -46,6 +46,7 @@ import org.apache.manifoldcf.agents.inte
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
 import org.apache.manifoldcf.core.interfaces.IThreadContext;
 import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.IPasswordMapperActivity;
 import org.apache.manifoldcf.core.interfaces.IPostParameters;
 import org.apache.manifoldcf.core.interfaces.ConfigParams;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
@@ -2634,15 +2635,18 @@ public class SharedDriveConnector extend
     Locale locale, ConfigParams parameters, String tabName)
     throws ManifoldCFException, IOException
   {
-    String server   = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.server);
+    String server   = parameters.getParameter(SharedDriveParameters.server);
     if (server==null) server = "";
-    String domain = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.domain);
+    String domain = parameters.getParameter(SharedDriveParameters.domain);
     if (domain==null) domain = "";
-    String username = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.username);
+    String username = parameters.getParameter(SharedDriveParameters.username);
     if (username==null) username = "";
-    String password = parameters.getObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.password);
-    if (password==null) password = "";
-    String resolvesids = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.useSIDs);
+    String password = parameters.getObfuscatedParameter(SharedDriveParameters.password);
+    if (password==null)
+      password = "";
+    else
+      password = out.mapPasswordToKey(password);
+    String resolvesids = parameters.getParameter(SharedDriveParameters.useSIDs);
     if (resolvesids==null) resolvesids = "true";
 
     // "Server" tab
@@ -2704,19 +2708,19 @@ public class SharedDriveConnector extend
   {
     String server = variableContext.getParameter("server");
     if (server != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.server,server);
+      parameters.setParameter(SharedDriveParameters.server,server);
 	
     String domain = variableContext.getParameter("domain");
     if (domain != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.domain,domain);
+      parameters.setParameter(SharedDriveParameters.domain,domain);
 	
     String username = variableContext.getParameter("username");
     if (username != null)
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.username,username);
+      parameters.setParameter(SharedDriveParameters.username,username);
 		
     String password = variableContext.getParameter("password");
     if (password != null)
-      parameters.setObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.sharedrive.SharedDriveParameters.password,password);
+      parameters.setObfuscatedParameter(SharedDriveParameters.password,variableContext.mapKeyToPassword(password));
     
     String resolvesidspresent = variableContext.getParameter("resolvesidspresent");
     if (resolvesidspresent != null)

Modified: manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jdbc/JDBCAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jdbc/JDBCAuthority.java?rev=1503255&r1=1503254&r2=1503255&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jdbc/JDBCAuthority.java (original)
+++ manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jdbc/JDBCAuthority.java Mon Jul 15 14:02:29 2013
@@ -346,31 +346,33 @@ public class JDBCAuthority extends BaseA
   public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out,
     Locale locale, ConfigParams parameters, String tabName)
     throws ManifoldCFException, IOException {
-    String lJdbcProvider = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.providerParameter);
+    String lJdbcProvider = parameters.getParameter(JDBCConstants.providerParameter);
     if (lJdbcProvider == null) {
       lJdbcProvider = "oracle:thin:@";
     }
-    String lHost = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.hostParameter);
+    String lHost = parameters.getParameter(JDBCConstants.hostParameter);
     if (lHost == null) {
       lHost = "localhost";
     }
-    String lDatabaseName = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseNameParameter);
+    String lDatabaseName = parameters.getParameter(JDBCConstants.databaseNameParameter);
     if (lDatabaseName == null) {
       lDatabaseName = "database";
     }
-    String databaseUser = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseUserName);
+    String databaseUser = parameters.getParameter(JDBCConstants.databaseUserName);
     if (databaseUser == null) {
       databaseUser = "";
     }
-    String databasePassword = parameters.getObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databasePassword);
+    String databasePassword = parameters.getObfuscatedParameter(JDBCConstants.databasePassword);
     if (databasePassword == null) {
       databasePassword = "";
+    } else {
+      databasePassword = out.mapPasswordToKey(password);
     }
-    String lIdQuery = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseUserIdQuery);
+    String lIdQuery = parameters.getParameter(JDBCConstants.databaseUserIdQuery);
     if (lIdQuery == null) {
       lIdQuery = "SELECT idfield FROM usertable WHERE login = $(USERNAME)";
     }
-    String lTokenQuery = parameters.getParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseTokensQuery);
+    String lTokenQuery = parameters.getParameter(JDBCConstants.databaseTokensQuery);
     if (lTokenQuery == null) {
       lTokenQuery = "SELECT groupnamefield FROM grouptable WHERE user_id = $(UID) or login = $(USERNAME)";
     }
@@ -476,37 +478,37 @@ public class JDBCAuthority extends BaseA
     throws ManifoldCFException {
     String type = variableContext.getParameter("databasetype");
     if (type != null) {
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.providerParameter, type);
+      parameters.setParameter(JDBCConstants.providerParameter, type);
     }
 
     String lHost = variableContext.getParameter("databasehost");
     if (lHost != null) {
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.hostParameter, lHost);
+      parameters.setParameter(JDBCConstants.hostParameter, lHost);
     }
 
     String lDatabaseName = variableContext.getParameter("databasename");
     if (lDatabaseName != null) {
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseNameParameter, lDatabaseName);
+      parameters.setParameter(JDBCConstants.databaseNameParameter, lDatabaseName);
     }
 
     String lUserName = variableContext.getParameter("username");
     if (lUserName != null) {
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseUserName, lUserName);
+      parameters.setParameter(JDBCConstants.databaseUserName, lUserName);
     }
 
     String lPassword = variableContext.getParameter("password");
     if (lPassword != null) {
-      parameters.setObfuscatedParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databasePassword, lPassword);
+      parameters.setObfuscatedParameter(JDBCConstants.databasePassword, variableContext.mapKeyToPassword(lPassword));
     }
 
     String lIdQuery = variableContext.getParameter("idquery");
     if (lIdQuery != null) {
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseUserIdQuery, lIdQuery);
+      parameters.setParameter(JDBCConstants.databaseUserIdQuery, lIdQuery);
     }
 
     String lTokenQuery = variableContext.getParameter("tokenquery");
     if (lTokenQuery != null) {
-      parameters.setParameter(org.apache.manifoldcf.crawler.connectors.jdbc.JDBCConstants.databaseTokensQuery, lTokenQuery);
+      parameters.setParameter(JDBCConstants.databaseTokensQuery, lTokenQuery);
     }
 
     return null;



Mime
View raw message