incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r959015 [1/16] - in /incubator/lcf/trunk/modules: ./ connectors/activedirectory/ connectors/activedirectory/connector/org/apache/lcf/authorities/authorities/activedirectory/ connectors/activedirectory/crawler-ui/authorities/ connectors/docu...
Date Tue, 29 Jun 2010 16:00:59 GMT
Author: kwright
Date: Tue Jun 29 16:00:57 2010
New Revision: 959015

URL: http://svn.apache.org/viewvc?rev=959015&view=rev
Log:
Merge CONNECTORS-40 UI-delivery changes into trunk.  These changes have been tested to the
extent that I can, given the availability of various repositories.  In particular, Documentum
and FileNet job tabs have not been tested.  This checkin represents no additional work other
than the UI port out of JSP into connector methods.

Added:
    incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/IHTTPOutput.java
      - copied unchanged from r958945, incubator/lcf/branches/CONNECTORS-40/modules/framework/core/org/apache/lcf/core/interfaces/IHTTPOutput.java
    incubator/lcf/trunk/modules/framework/core/org/apache/lcf/core/interfaces/IPostParameters.java
      - copied unchanged from r958945, incubator/lcf/branches/CONNECTORS-40/modules/framework/core/org/apache/lcf/core/interfaces/IPostParameters.java
    incubator/lcf/trunk/modules/framework/ui-core/org/apache/lcf/ui/jsp/
      - copied from r958945, incubator/lcf/branches/CONNECTORS-40/modules/framework/ui-core/org/apache/lcf/ui/jsp/
    incubator/lcf/trunk/modules/framework/ui-core/org/apache/lcf/ui/jsp/JspWrapper.java
      - copied unchanged from r958945, incubator/lcf/branches/CONNECTORS-40/modules/framework/ui-core/org/apache/lcf/ui/jsp/JspWrapper.java
Removed:
    incubator/lcf/trunk/modules/connectors/activedirectory/crawler-ui/authorities/
    incubator/lcf/trunk/modules/connectors/documentum/crawler-ui/authorities/
    incubator/lcf/trunk/modules/connectors/documentum/crawler-ui/connectors/
    incubator/lcf/trunk/modules/connectors/filenet/crawler-ui/connectors/
    incubator/lcf/trunk/modules/connectors/filesystem/crawler-ui/connectors/
    incubator/lcf/trunk/modules/connectors/gts/crawler-ui/output/
    incubator/lcf/trunk/modules/connectors/jcifs/crawler-ui/connectors/
    incubator/lcf/trunk/modules/connectors/jdbc/crawler-ui/connectors/
    incubator/lcf/trunk/modules/connectors/livelink/crawler-ui/authorities/
    incubator/lcf/trunk/modules/connectors/livelink/crawler-ui/connectors/
    incubator/lcf/trunk/modules/connectors/memex/crawler-ui/authorities/
    incubator/lcf/trunk/modules/connectors/memex/crawler-ui/connectors/
    incubator/lcf/trunk/modules/connectors/meridio/crawler-ui/authorities/
    incubator/lcf/trunk/modules/connectors/meridio/crawler-ui/connectors/
    incubator/lcf/trunk/modules/connectors/nulloutput/crawler-ui/output/
    incubator/lcf/trunk/modules/connectors/rss/crawler-ui/connectors/
    incubator/lcf/trunk/modules/connectors/sharepoint/crawler-ui/connectors/
    incubator/lcf/trunk/modules/connectors/solr/crawler-ui/output/
    incubator/lcf/trunk/modules/connectors/webcrawler/crawler-ui/connectors/
Modified:
    incubator/lcf/trunk/modules/   (props changed)
    incubator/lcf/trunk/modules/build.xml
    incubator/lcf/trunk/modules/connectors/activedirectory/build.xml
    incubator/lcf/trunk/modules/connectors/activedirectory/connector/org/apache/lcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
    incubator/lcf/trunk/modules/connectors/documentum/build.xml
    incubator/lcf/trunk/modules/connectors/documentum/connector/org/apache/lcf/crawler/authorities/DCTM/AuthorityConnector.java
    incubator/lcf/trunk/modules/connectors/documentum/connector/org/apache/lcf/crawler/connectors/DCTM/DCTM.java
    incubator/lcf/trunk/modules/connectors/filenet/build.xml
    incubator/lcf/trunk/modules/connectors/filenet/connector/org/apache/lcf/crawler/connectors/filenet/FilenetConnector.java
    incubator/lcf/trunk/modules/connectors/filesystem/build.xml
    incubator/lcf/trunk/modules/connectors/filesystem/connector/org/apache/lcf/crawler/connectors/filesystem/FileConnector.java
    incubator/lcf/trunk/modules/connectors/gts/build.xml
    incubator/lcf/trunk/modules/connectors/gts/connector/org/apache/lcf/agents/output/gts/GTSConnector.java
    incubator/lcf/trunk/modules/connectors/jcifs/build.xml
    incubator/lcf/trunk/modules/connectors/jcifs/connector/org/apache/lcf/crawler/connectors/sharedrive/SharedDriveConnector.java
    incubator/lcf/trunk/modules/connectors/jdbc/build.xml
    incubator/lcf/trunk/modules/connectors/jdbc/connector/org/apache/lcf/crawler/connectors/jdbc/JDBCConnector.java
    incubator/lcf/trunk/modules/connectors/livelink/build.xml
    incubator/lcf/trunk/modules/connectors/livelink/connector/org/apache/lcf/crawler/connectors/livelink/LivelinkAuthority.java
    incubator/lcf/trunk/modules/connectors/livelink/connector/org/apache/lcf/crawler/connectors/livelink/LivelinkConnector.java
    incubator/lcf/trunk/modules/connectors/memex/build.xml
    incubator/lcf/trunk/modules/connectors/memex/connector/org/apache/lcf/crawler/connectors/memex/MemexAuthority.java
    incubator/lcf/trunk/modules/connectors/memex/connector/org/apache/lcf/crawler/connectors/memex/MemexConnector.java
    incubator/lcf/trunk/modules/connectors/meridio/build.xml
    incubator/lcf/trunk/modules/connectors/meridio/connector/org/apache/lcf/crawler/connectors/meridio/MeridioAuthority.java
    incubator/lcf/trunk/modules/connectors/meridio/connector/org/apache/lcf/crawler/connectors/meridio/MeridioConnector.java
    incubator/lcf/trunk/modules/connectors/nulloutput/build.xml
    incubator/lcf/trunk/modules/connectors/rss/build.xml
    incubator/lcf/trunk/modules/connectors/rss/connector/org/apache/lcf/crawler/connectors/rss/RSSConnector.java
    incubator/lcf/trunk/modules/connectors/sharepoint/build.xml
    incubator/lcf/trunk/modules/connectors/sharepoint/connector/org/apache/lcf/crawler/connectors/sharepoint/SharePointRepository.java
    incubator/lcf/trunk/modules/connectors/solr/build.xml
    incubator/lcf/trunk/modules/connectors/solr/connector/org/apache/lcf/agents/output/solr/SolrConnector.java
    incubator/lcf/trunk/modules/connectors/webcrawler/build.xml
    incubator/lcf/trunk/modules/connectors/webcrawler/connector/org/apache/lcf/crawler/connectors/webcrawler/RobotsManager.java
    incubator/lcf/trunk/modules/connectors/webcrawler/connector/org/apache/lcf/crawler/connectors/webcrawler/WebcrawlerConnector.java
    incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/interfaces/IOutputConnector.java
    incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/interfaces/OutputConnectorFactory.java
    incubator/lcf/trunk/modules/framework/agents/org/apache/lcf/agents/output/BaseOutputConnector.java
    incubator/lcf/trunk/modules/framework/crawler-ui/editauthority.jsp
    incubator/lcf/trunk/modules/framework/crawler-ui/editconnection.jsp
    incubator/lcf/trunk/modules/framework/crawler-ui/editjob.jsp
    incubator/lcf/trunk/modules/framework/crawler-ui/editoutput.jsp
    incubator/lcf/trunk/modules/framework/crawler-ui/execute.jsp
    incubator/lcf/trunk/modules/framework/crawler-ui/viewauthority.jsp
    incubator/lcf/trunk/modules/framework/crawler-ui/viewconnection.jsp
    incubator/lcf/trunk/modules/framework/crawler-ui/viewjob.jsp
    incubator/lcf/trunk/modules/framework/crawler-ui/viewoutput.jsp
    incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/authorities/authorities/BaseAuthorityConnector.java
    incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/authorities/interfaces/AuthorityConnectorFactory.java
    incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/authorities/interfaces/IAuthorityConnector.java
    incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/connectors/BaseRepositoryConnector.java
    incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/interfaces/IRepositoryConnector.java
    incubator/lcf/trunk/modules/framework/pull-agent/org/apache/lcf/crawler/interfaces/RepositoryConnectorFactory.java
    incubator/lcf/trunk/modules/framework/ui-core/org/apache/lcf/ui/multipart/MultipartWrapper.java

Propchange: incubator/lcf/trunk/modules/
------------------------------------------------------------------------------
    svn:mergeinfo = /incubator/lcf/branches/CONNECTORS-40/modules:954393-958945

Modified: incubator/lcf/trunk/modules/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/build.xml?rev=959015&r1=959014&r2=959015&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/build.xml (original)
+++ incubator/lcf/trunk/modules/build.xml Tue Jun 29 16:00:57 2010
@@ -149,9 +149,9 @@
         <mkdir dir="connectors/gts/war"/>
         <copy todir="connectors/gts/lib">
             <fileset dir="framework/lib"/>
-	    <fileset dir="lib">
+            <fileset dir="lib">
 	      <include name="poi*.jar"/>
-	    </fileset>
+            </fileset>
         </copy>
         <copy todir="connectors/gts/lib">
             <fileset dir="framework/build/jar"/>

Modified: incubator/lcf/trunk/modules/connectors/activedirectory/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/activedirectory/build.xml?rev=959015&r1=959014&r2=959015&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/activedirectory/build.xml (original)
+++ incubator/lcf/trunk/modules/connectors/activedirectory/build.xml Tue Jun 29 16:00:57 2010
@@ -25,71 +25,12 @@
         </javac>
     </target>
 
-    <target name="compile-crawler-ui" depends="compile-connector">
-        <!-- Unpack the crawler war -->
-        <mkdir dir="build/crawler-ui-war"/>
-        <unwar src="war/lcf-crawler-ui.war" dest="build/crawler-ui-war"/>
-        <!-- Create a copy of everything in the proper environment -->
-        <mkdir dir="build/jsp-environment/WEB-INF/lib"/>
-        <mkdir dir="build/jsp-environment/WEB-INF/jsp"/>
-        <copy todir="build/jsp-environment/WEB-INF" file="build/crawler-ui-war/WEB-INF/web.xml"/>
-        <copy todir="build/jsp-environment" file="build/crawler-ui-war/adminHeaders.jsp"/>
-        <copy todir="build/jsp-environment" file="build/crawler-ui-war/adminDefaults.jsp"/>
-        <copy todir="build/jsp-environment" file="build/crawler-ui-war/error.jsp"/>
-        <copy todir="build/jsp-environment" file="build/crawler-ui-war/checkAdminLogin.jsp"/>
-
-        <copy todir="build/jsp-environment">
-            <fileset dir="crawler-ui" includes="**/*.jsp,**/*.css,**/*.png,**/*.html"/>
-        </copy>
-        <copy todir="build/jsp-environment/WEB-INF/lib">
-            <fileset dir="build/crawler-ui-war/WEB-INF/lib">
-                <include name="*.jar"/>
-            </fileset>
-        </copy>
-        <copy todir="build/jsp-environment/WEB-INF/jsp">
-            <fileset dir="build/crawler-ui-war/WEB-INF/jsp">
-                <include name="*.tld"/>
-            </fileset>
-        </copy>
-        <copy todir="build/jsp-environment/WEB-INF/classes">
-            <fileset dir="build/connector/classes"/>
-        </copy>
-        <!-- Compile to java, as a check -->
-        <mkdir dir="build/crawler-ui/java"/>
-        <!-- Define the jsp compilation task using web libraries -->
-        <taskdef classname="org.apache.jasper.JspC" name="jasper2" > 
-            <classpath id="jspc.classpath"> 
-                <pathelement location="${java.home}/../lib/tools.jar"/>
-                <fileset dir="lib"> 
-                    <include name="*.jar"/> 
-                </fileset> 
-                <pathelement location="build/crawler-ui-war/WEB-INF/lib/jstl.jar"/>
-                <pathelement location="build/crawler-ui-war/WEB-INF/lib/standard.jar"/>
-                <pathelement location="build/connector/classes"/>
-            </classpath> 
-        </taskdef> 
-        <jasper2 validateXml="false" uriroot="build/jsp-environment" webXmlFragment="build/jsp-environment/WEB-INF/web-generated.xml"
outputDir="build/crawler-ui/java" /> 
-        <!-- Compile java classes -->
-        <mkdir dir="build/crawler-ui/classes"/>
-        <javac srcdir="build/crawler-ui/java" destdir="build/crawler-ui/classes" target="1.5"
source="1.4" debug="true" debuglevel="lines,vars,source">
-            <classpath id="classpath">
-                <pathelement location="${java.home}/../lib/tools.jar"/>
-                <fileset dir="lib"> 
-                    <include name="*.jar"/> 
-                </fileset>
-                <pathelement location="build/crawler-ui-war/WEB-INF/lib/jstl.jar"/>
-                <pathelement location="build/crawler-ui-war/WEB-INF/lib/standard.jar"/>
-                <pathelement location="build/connector/classes"/>
-            </classpath>
-        </javac>
-    </target>
-    
     <target name="jar-connector" depends="compile-connector">
         <mkdir dir="build/jar"/>
         <jar destfile="build/jar/lcf-activedirectory-connector.jar" basedir="build/connector/classes"/>
     </target>
 
-    <target name="webapp-crawler-ui" depends="compile-crawler-ui,jar-connector">
+    <target name="webapp-crawler-ui" depends="jar-connector">
         <mkdir dir="build/webapp/crawler-ui/WEB-INF/lib"/>
         <copy todir="build/webapp/crawler-ui/WEB-INF/lib" file="build/jar/lcf-activedirectory-connector.jar"/>
         <mkdir dir="build/webapp/crawler-ui"/>

Modified: incubator/lcf/trunk/modules/connectors/activedirectory/connector/org/apache/lcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/activedirectory/connector/org/apache/lcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java?rev=959015&r1=959014&r2=959015&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/activedirectory/connector/org/apache/lcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
(original)
+++ incubator/lcf/trunk/modules/connectors/activedirectory/connector/org/apache/lcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
Tue Jun 29 16:00:57 2010
@@ -242,6 +242,181 @@ public class ActiveDirectoryAuthority ex
     return unreachableResponse;
   }
 
+  // UI support methods.
+  //
+  // These support methods are involved in setting up authority connection configuration
information. The configuration methods cannot assume that the
+  // current authority object is connected.  That is why they receive a thread context argument.
+    
+  /** Output the configuration header section.
+  * This method is called in the head section of the connector's configuration page.  Its
purpose is to add the required tabs to the list, and to output any
+  * javascript methods that might be needed by the configuration editing HTML.
+  *@param threadContext is the local thread context.
+  *@param out is the output to which any HTML should be sent.
+  *@param parameters are the configuration parameters, as they currently exist, for this
connection being configured.
+  *@param tabsArray is an array of tab names.  Add to this array any tab names that are specific
to the connector.
+  */
+  public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, ConfigParams
parameters, ArrayList tabsArray)
+    throws LCFException, IOException
+  {
+    tabsArray.add("Domain Controller");
+    out.print(
+"<script type=\"text/javascript\">\n"+
+"<!--\n"+
+"function checkConfig()\n"+
+"{\n"+
+"  return true;\n"+
+"}\n"+
+"\n"+
+"function checkConfigForSave()\n"+
+"{\n"+
+"  if (editconnection.domaincontrollername.value == \"\")\n"+
+"  {\n"+
+"    alert(\"Enter a domain controller server name\");\n"+
+"    SelectTab(\"Domain Controller\");\n"+
+"    editconnection.domaincontrollername.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.username.value == \"\")\n"+
+"  {\n"+
+"    alert(\"Administrative user name cannot be null\");\n"+
+"    SelectTab(\"Domain Controller\");\n"+
+"    editconnection.username.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  return true;\n"+
+"}\n"+
+"\n"+
+"//-->\n"+
+"</script>\n"
+    );
+  }
+  
+  /** Output the configuration body section.
+  * This method is called in the body section of the authority connector's configuration
page.  Its purpose is to present the required form elements for editing.
+  * The coder can presume that the HTML that is output from this configuration will be within
appropriate <html>, <body>, and <form> tags.  The name of the
+  * form is "editconnection".
+  *@param threadContext is the local thread context.
+  *@param out is the output to which any HTML should be sent.
+  *@param parameters are the configuration parameters, as they currently exist, for this
connection being configured.
+  *@param tabName is the current tab name.
+  */
+  public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, ConfigParams
parameters, String tabName)
+    throws LCFException, IOException
+  {
+    String domainControllerName = parameters.getParameter(org.apache.lcf.authorities.authorities.activedirectory.ActiveDirectoryConfig.PARAM_DOMAINCONTROLLER);
+    if (domainControllerName == null)
+      domainControllerName = "";
+    String userName = parameters.getParameter(org.apache.lcf.authorities.authorities.activedirectory.ActiveDirectoryConfig.PARAM_USERNAME);
+    if (userName == null)
+      userName = "";
+    String password = parameters.getObfuscatedParameter(org.apache.lcf.authorities.authorities.activedirectory.ActiveDirectoryConfig.PARAM_PASSWORD);
+    if (password == null)
+      password = "";
+
+    // The "Domain Controller" tab
+    if (tabName.equals("Domain Controller"))
+    {
+      out.print(
+"<table class=\"displaytable\">\n"+
+"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>Domain controller name:</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"64\" name=\"domaincontrollername\"
value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(domainControllerName)+"\"/></td>\n"+
+"  </tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>Administrative user name:</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"32\" name=\"username\" value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(userName)+"\"/></td>\n"+
+"  </tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>Administrative password:</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"password\" size=\"32\" name=\"password\"
value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(password)+"\"/></td>\n"+
+"  </tr>\n"+
+"</table>\n"
+      );
+    }
+    else
+    {
+      // Hiddens for Domain Controller tab
+      out.print(
+"<input type=\"hidden\" name=\"domaincontrollername\" value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(domainControllerName)+"\"/>\n"+
+"<input type=\"hidden\" name=\"username\" value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(userName)+"\"/>\n"+
+"<input type=\"hidden\" name=\"password\" value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(password)+"\"/>\n"
+      );
+    }
+  }
+  
+  /** Process a configuration post.
+  * This method is called at the start of the authority connector's configuration page, whenever
there is a possibility that form data for a connection has been
+  * posted.  Its purpose is to gather form information and modify the configuration parameters
accordingly.
+  * The name of the posted form is "editconnection".
+  *@param threadContext is the local thread context.
+  *@param variableContext is the set of variables available from the post, including binary
file post information.
+  *@param parameters are the configuration parameters, as they currently exist, for this
connection being configured.
+  *@return null if all is well, or a string error message if there is an error that should
prevent saving of the connection (and cause a redirection to an error page).
+  */
+  public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext,
ConfigParams parameters)
+    throws LCFException
+  {
+    String domainControllerName = variableContext.getParameter("domaincontrollername");
+    if (domainControllerName != null)
+      parameters.setParameter(org.apache.lcf.authorities.authorities.activedirectory.ActiveDirectoryConfig.PARAM_DOMAINCONTROLLER,domainControllerName);
+    String userName = variableContext.getParameter("username");
+    if (userName != null)
+      parameters.setParameter(org.apache.lcf.authorities.authorities.activedirectory.ActiveDirectoryConfig.PARAM_USERNAME,userName);
+    String password = variableContext.getParameter("password");
+    if (password != null)
+      parameters.setObfuscatedParameter(org.apache.lcf.authorities.authorities.activedirectory.ActiveDirectoryConfig.PARAM_PASSWORD,password);
+    return null;
+  }
+  
+  /** View configuration.
+  * This method is called in the body section of the authority connector's view configuration
page.  Its purpose is to present the connection information to the user.
+  * The coder can presume that the HTML that is output from this configuration will be within
appropriate <html> and <body> tags.
+  *@param threadContext is the local thread context.
+  *@param out is the output to which any HTML should be sent.
+  *@param parameters are the configuration parameters, as they currently exist, for this
connection being configured.
+  */
+  public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, ConfigParams
parameters)
+    throws LCFException, IOException
+  {
+    out.print(
+"<table class=\"displaytable\">\n"+
+"  <tr>\n"+
+"    <td class=\"description\" colspan=\"1\"><nobr>Parameters:</nobr></td>\n"+
+"    <td class=\"value\" colspan=\"3\">\n"
+    );
+    Iterator iter = parameters.listParameters();
+    while (iter.hasNext())
+    {
+      String param = (String)iter.next();
+      String value = parameters.getParameter(param);
+      if (param.length() >= "password".length() && param.substring(param.length()-"password".length()).equalsIgnoreCase("password"))
+      {
+        out.print(
+"      <nobr>"+org.apache.lcf.ui.util.Encoder.bodyEscape(param)+"=********</nobr><br/>\n"
+        );
+      }
+      else if (param.length() >="keystore".length() && param.substring(param.length()-"keystore".length()).equalsIgnoreCase("keystore"))
+      {
+        IKeystoreManager kmanager = KeystoreManagerFactory.make("",value);
+        out.print(
+"      <nobr>"+org.apache.lcf.ui.util.Encoder.bodyEscape(param)+"=<"+Integer.toString(kmanager.getContents().length)+"
certificate(s)></nobr><br/>\n"
+        );
+      }
+      else
+      {
+        out.print(
+"      <nobr>"+org.apache.lcf.ui.util.Encoder.bodyEscape(param)+"="+org.apache.lcf.ui.util.Encoder.bodyEscape(value)+"</nobr><br/>\n"
+        );
+      }
+    }
+    out.print(
+"    </td>\n"+
+"  </tr>\n"+
+"</table>\n"
+    );
+  }
+
   // Protected methods
   
   protected void getSession()

Modified: incubator/lcf/trunk/modules/connectors/documentum/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/documentum/build.xml?rev=959015&r1=959014&r2=959015&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/documentum/build.xml (original)
+++ incubator/lcf/trunk/modules/connectors/documentum/build.xml Tue Jun 29 16:00:57 2010
@@ -116,70 +116,6 @@
         </javac>
     </target>
 
-    <target name="compile-crawler-ui" depends="compile-interface,compile-rmic,compile-connector,precompile-check"
if="canBuild">
-        <!-- Unpack the crawler war -->
-        <mkdir dir="build/crawler-ui-war"/>
-        <unwar src="war/lcf-crawler-ui.war" dest="build/crawler-ui-war"/>
-        <!-- Create a copy of everything in the proper environment -->
-        <mkdir dir="build/jsp-environment/WEB-INF/lib"/>
-        <mkdir dir="build/jsp-environment/WEB-INF/jsp"/>
-        <copy todir="build/jsp-environment/WEB-INF" file="build/crawler-ui-war/WEB-INF/web.xml"/>
-        <copy todir="build/jsp-environment" file="build/crawler-ui-war/adminHeaders.jsp"/>
-        <copy todir="build/jsp-environment" file="build/crawler-ui-war/adminDefaults.jsp"/>
-        <copy todir="build/jsp-environment" file="build/crawler-ui-war/error.jsp"/>
-        <copy todir="build/jsp-environment" file="build/crawler-ui-war/checkAdminLogin.jsp"/>
-
-        <copy todir="build/jsp-environment">
-            <fileset dir="crawler-ui" includes="**/*.jsp,**/*.css,**/*.png,**/*.html"/>
-        </copy>
-        <copy todir="build/jsp-environment/WEB-INF/lib">
-            <fileset dir="build/crawler-ui-war/WEB-INF/lib">
-                <include name="*.jar"/>
-            </fileset>
-        </copy>
-        <copy todir="build/jsp-environment/WEB-INF/jsp">
-            <fileset dir="build/crawler-ui-war/WEB-INF/jsp">
-                <include name="*.tld"/>
-            </fileset>
-        </copy>
-        <copy todir="build/jsp-environment/WEB-INF/classes">
-            <fileset dir="build/rmistub/classes"/>
-            <fileset dir="build/connector/classes"/>
-        </copy>
-        <!-- Compile to java, as a check -->
-        <mkdir dir="build/crawler-ui/java"/>
-        <!-- Define the jsp compilation task using web libraries -->
-        <taskdef classname="org.apache.jasper.JspC" name="jasper2" > 
-            <classpath id="jspc.classpath"> 
-                <pathelement location="${java.home}/../lib/tools.jar"/>
-                <fileset dir="lib"> 
-                    <include name="*.jar"/> 
-                </fileset> 
-                <pathelement location="build/crawler-ui-war/WEB-INF/lib/jstl.jar"/>
-                <pathelement location="build/crawler-ui-war/WEB-INF/lib/standard.jar"/>
-                <pathelement location="build/interface/classes"/>
-                <pathelement location="build/rmistub/classes"/>
-                <pathelement location="build/connector/classes"/>
-            </classpath> 
-        </taskdef> 
-        <jasper2 validateXml="false" uriroot="build/jsp-environment" webXmlFragment="build/jsp-environment/WEB-INF/web-generated.xml"
outputDir="build/crawler-ui/java" /> 
-        <!-- Compile java classes -->
-        <mkdir dir="build/crawler-ui/classes"/>
-        <javac srcdir="build/crawler-ui/java" destdir="build/crawler-ui/classes" target="1.5"
source="1.4" debug="true" debuglevel="lines,vars,source">
-            <classpath id="classpath">
-                <pathelement location="${java.home}/../lib/tools.jar"/>
-                <fileset dir="lib"> 
-                    <include name="*.jar"/> 
-                </fileset>
-                <pathelement location="build/crawler-ui-war/WEB-INF/lib/jstl.jar"/>
-                <pathelement location="build/crawler-ui-war/WEB-INF/lib/standard.jar"/>
-                <pathelement location="build/interface/classes"/>
-                <pathelement location="build/rmistub/classes"/>
-                <pathelement location="build/connector/classes"/>
-            </classpath>
-        </javac>
-    </target>
-
     <target name="jar-interface" depends="compile-interface,precompile-check" if="canBuild">
         <mkdir dir="build/jar"/>
         <jar destfile="build/jar/lcf-documentum-interface.jar" basedir="build/interface/classes"/>
@@ -215,7 +151,7 @@
         <jar destfile="build/jar/lcf-documentum-connector.jar" basedir="build/connector/classes"/>
     </target>
 
-    <target name="webapp-crawler-ui" depends="compile-crawler-ui,jar-rmistub,jar-interface,jar-connector,precompile-check"
if="canBuild">
+    <target name="webapp-crawler-ui" depends="jar-rmistub,jar-interface,jar-connector,precompile-check"
if="canBuild">
         <mkdir dir="build/webapp/crawler-ui/WEB-INF/lib"/>
         <copy todir="build/webapp/crawler-ui/WEB-INF/lib">
             <fileset dir="build/jar">

Modified: incubator/lcf/trunk/modules/connectors/documentum/connector/org/apache/lcf/crawler/authorities/DCTM/AuthorityConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/modules/connectors/documentum/connector/org/apache/lcf/crawler/authorities/DCTM/AuthorityConnector.java?rev=959015&r1=959014&r2=959015&view=diff
==============================================================================
--- incubator/lcf/trunk/modules/connectors/documentum/connector/org/apache/lcf/crawler/authorities/DCTM/AuthorityConnector.java
(original)
+++ incubator/lcf/trunk/modules/connectors/documentum/connector/org/apache/lcf/crawler/authorities/DCTM/AuthorityConnector.java
Tue Jun 29 16:00:57 2010
@@ -909,5 +909,281 @@ public class AuthorityConnector extends 
     releaseCheck();
   }
 
+  // UI support methods.
+  //
+  // These support methods are involved in setting up authority connection configuration
information. The configuration methods cannot assume that the
+  // current authority object is connected.  That is why they receive a thread context argument.
+    
+  /** Output the configuration header section.
+  * This method is called in the head section of the connector's configuration page.  Its
purpose is to add the required tabs to the list, and to output any
+  * javascript methods that might be needed by the configuration editing HTML.
+  *@param threadContext is the local thread context.
+  *@param out is the output to which any HTML should be sent.
+  *@param parameters are the configuration parameters, as they currently exist, for this
connection being configured.
+  *@param tabsArray is an array of tab names.  Add to this array any tab names that are specific
to the connector.
+  */
+  public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out, ConfigParams
parameters, ArrayList tabsArray)
+    throws LCFException, IOException
+  {
+    tabsArray.add("Docbase");
+    tabsArray.add("User Mapping");
+    tabsArray.add("System ACLs");
+    out.print(
+"<script type=\"text/javascript\">\n"+
+"<!--\n"+
+"function checkConfigForSave()\n"+
+"{\n"+
+"  if (editconnection.docbasename.value == \"\")\n"+
+"  {\n"+
+"    alert(\"Please supply the name of a Docbase\");\n"+
+"    SelectTab(\"Docbase\");\n"+
+"    editconnection.docbasename.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.docbaseusername.value == \"\")\n"+
+"  {\n"+
+"    alert(\"The connection requires a valid Documentum user name\");\n"+
+"    SelectTab(\"Docbase\");\n"+
+"    editconnection.docbaseusername.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  if (editconnection.docbasepassword.value == \"\")\n"+
+"  {\n"+
+"    alert(\"The connection requires the Documentum user's password\");\n"+
+"    SelectTab(\"Docbase\");\n"+
+"    editconnection.docbasepassword.focus();\n"+
+"    return false;\n"+
+"  }\n"+
+"  return true;\n"+
+"}\n"+
+"\n"+
+"//-->\n"+
+"</script>\n"
+    );
+  }
+  
+  /** Output the configuration body section.
+  * This method is called in the body section of the authority connector's configuration
page.  Its purpose is to present the required form elements for editing.
+  * The coder can presume that the HTML that is output from this configuration will be within
appropriate <html>, <body>, and <form> tags.  The name of the
+  * form is "editconnection".
+  *@param threadContext is the local thread context.
+  *@param out is the output to which any HTML should be sent.
+  *@param parameters are the configuration parameters, as they currently exist, for this
connection being configured.
+  *@param tabName is the current tab name.
+  */
+  public void outputConfigurationBody(IThreadContext threadContext, IHTTPOutput out, ConfigParams
parameters, String tabName)
+    throws LCFException, IOException
+  {
+    String docbaseName = parameters.getParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_DOCBASE);
+    if (docbaseName == null)
+      docbaseName = "";
+
+    String docbaseUserName = parameters.getParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_USERNAME);
+    if (docbaseUserName == null)
+      docbaseUserName = "";
+
+    String docbasePassword = parameters.getObfuscatedParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_PASSWORD);
+    if (docbasePassword == null)
+      docbasePassword = "";
+
+    String docbaseDomain = parameters.getParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_DOMAIN);
+    if (docbaseDomain == null)
+      docbaseDomain = "";
+
+    String caseInsensitiveUser = parameters.getParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_CASEINSENSITIVE);
+    if (caseInsensitiveUser == null)
+      caseInsensitiveUser = "false";
+
+    String useSystemAcls = parameters.getParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_USESYSTEMACLS);
+    if (useSystemAcls == null)
+      useSystemAcls = "true";
+
+    // "Docbase" tab
+    if (tabName.equals("Docbase"))
+    {
+      out.print(
+"<table class=\"displaytable\">\n"+
+"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>Docbase name:</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"32\" name=\"docbasename\" value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(docbaseName)+"\"/></td>\n"+
+"  </tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>Docbase user name:</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"32\" name=\"docbaseusername\"
value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(docbaseUserName)+"\"/></td>\n"+
+"  </tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>Docbase password:</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"password\" size=\"32\" name=\"docbasepassword\"
value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(docbasePassword)+"\"/></td>\n"+
+"  </tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>Docbase domain:</nobr></td>\n"+
+"    <td class=\"value\"><input type=\"text\" size=\"32\" name=\"docbasedomain\"
value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(docbaseDomain)+"\"/></td>\n"+
+"  </tr>\n"+
+"</table>\n"
+      );
+    }
+    else
+    {
+      // Hiddens for "Docbase" tab
+      out.print(
+"<input type=\"hidden\" name=\"docbasename\" value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(docbaseName)+"\"/>\n"+
+"<input type=\"hidden\" name=\"docbaseusername\" value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(docbaseUserName)+"\"/>\n"+
+"<input type=\"hidden\" name=\"docbasepassword\" value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(docbasePassword)+"\"/>\n"+
+"<input type=\"hidden\" name=\"docbasedomain\" value=\""+org.apache.lcf.ui.util.Encoder.attributeEscape(docbaseDomain)+"\"/>\n"
+      );
+    }
+
+    // "User Mapping" tab
+    if (tabName.equals("User Mapping"))
+    {
+      out.print(
+"<table class=\"displaytable\">\n"+
+"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>Authentication username matching:</nobr></td>\n"+
+"    <td class=\"value\">\n"+
+"      <table class=\"displaytable\">\n"+
+"        <tr>\n"+
+"          <td class=\"description\"><input name=\"usernamecaseinsensitive\" type=\"radio\"
value=\"true\" "+((caseInsensitiveUser.equals("true"))?"checked=\"true\"":"")+" /></td>\n"+
+"          <td class=\"value\"><nobr>Case insensitive</nobr></td>\n"+
+"        </tr>\n"+
+"        <tr>\n"+
+"          <td class=\"description\"><input name=\"usernamecaseinsensitive\" type=\"radio\"
value=\"false\" "+((!caseInsensitiveUser.equals("true"))?"checked=\"true\"":"")+" /></td>\n"+
+"          <td class=\"value\"><nobr>Case sensitive</nobr></td>\n"+
+"        </tr>\n"+
+"      </table>\n"+
+"    </td>\n"+
+"  </tr>\n"+
+"</table>\n"
+      );
+    }
+    else
+    {
+      // Hiddens for "User Mapping" tab
+      out.print(
+"<input type=\"hidden\" name=\"usernamecaseinsensitive\" value=\""+caseInsensitiveUser+"\"/>\n"
+      );
+    }
+
+    // "System ACLs" tab
+    if (tabName.equals("System ACLs"))
+    {
+      out.print(
+"<table class=\"displaytable\">\n"+
+"  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
+"  <tr>\n"+
+"    <td class=\"description\"><nobr>Use system acls:</nobr></td>\n"+
+"    <td class=\"value\">\n"+
+"      <table class=\"displaytable\">\n"+
+"        <tr>\n"+
+"          <td class=\"description\"><input name=\"usesystemacls\" type=\"radio\"
value=\"true\" "+((useSystemAcls.equals("true"))?"checked=\"true\"":"")+" /></td>\n"+
+"          <td class=\"value\"><nobr>Use system acls</nobr></td>\n"+
+"        </tr>\n"+
+"        <tr>\n"+
+"          <td class=\"description\"><input name=\"usesystemacls\" type=\"radio\"
value=\"false\" "+((!useSystemAcls.equals("true"))?"checked=\"true\"":"")+" /></td>\n"+
+"          <td class=\"value\"><nobr>Don't use system acls</nobr></td>\n"+
+"        </tr>\n"+
+"      </table>\n"+
+"    </td>\n"+
+"  </tr>\n"+
+"</table>\n"
+      );
+    }
+    else
+    {
+      // Hiddens for "System ACLs" tab
+      out.print(
+"<input type=\"hidden\" name=\"usesystemacls\" value=\""+useSystemAcls+"\"/>\n"
+      );
+    }
+  }
+  
+  /** Process a configuration post.
+  * This method is called at the start of the authority connector's configuration page, whenever
there is a possibility that form data for a connection has been
+  * posted.  Its purpose is to gather form information and modify the configuration parameters
accordingly.
+  * The name of the posted form is "editconnection".
+  *@param threadContext is the local thread context.
+  *@param variableContext is the set of variables available from the post, including binary
file post information.
+  *@param parameters are the configuration parameters, as they currently exist, for this
connection being configured.
+  *@return null if all is well, or a string error message if there is an error that should
prevent saving of the connection (and cause a redirection to an error page).
+  */
+  public String processConfigurationPost(IThreadContext threadContext, IPostParameters variableContext,
ConfigParams parameters)
+    throws LCFException
+  {
+    String docbaseName = variableContext.getParameter("docbasename");
+    if (docbaseName != null)
+      parameters.setParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_DOCBASE,docbaseName);
+	
+    String docbaseUserName = variableContext.getParameter("docbaseusername");
+    if (docbaseUserName != null)
+      parameters.setParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_USERNAME,docbaseUserName);
+	
+    String docbasePassword = variableContext.getParameter("docbasepassword");
+    if (docbasePassword != null)
+      parameters.setObfuscatedParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_PASSWORD,docbasePassword);
+	
+    String docbaseDomain = variableContext.getParameter("docbasedomain");
+    if (docbaseDomain != null)
+      parameters.setParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_DOMAIN,docbaseDomain);
+
+    String caseInsensitiveUser = variableContext.getParameter("usernamecaseinsensitive");
+    if (caseInsensitiveUser != null)
+      parameters.setParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_CASEINSENSITIVE,caseInsensitiveUser);
+
+    String useSystemAcls = variableContext.getParameter("usesystemacls");
+    if (useSystemAcls != null)
+      parameters.setParameter(org.apache.lcf.crawler.authorities.DCTM.AuthorityConnector.CONFIG_PARAM_USESYSTEMACLS,useSystemAcls);
+    
+    return null;
+  }
+  
+  /** View configuration.
+  * This method is called in the body section of the authority connector's view configuration
page.  Its purpose is to present the connection information to the user.
+  * The coder can presume that the HTML that is output from this configuration will be within
appropriate <html> and <body> tags.
+  *@param threadContext is the local thread context.
+  *@param out is the output to which any HTML should be sent.
+  *@param parameters are the configuration parameters, as they currently exist, for this
connection being configured.
+  */
+  public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out, ConfigParams
parameters)
+    throws LCFException, IOException
+  {
+    out.print(
+"<table class=\"displaytable\">\n"+
+"  <tr>\n"+
+"    <td class=\"description\" colspan=\"1\"><nobr>Parameters:</nobr></td>\n"+
+"    <td class=\"value\" colspan=\"3\">\n"
+    );
+    Iterator iter = parameters.listParameters();
+    while (iter.hasNext())
+    {
+      String param = (String)iter.next();
+      String value = parameters.getParameter(param);
+      if (param.length() >= "password".length() && param.substring(param.length()-"password".length()).equalsIgnoreCase("password"))
+      {
+        out.print(
+"      <nobr>"+org.apache.lcf.ui.util.Encoder.bodyEscape(param)+"=********</nobr><br/>\n"
+        );
+      }
+      else if (param.length() >="keystore".length() && param.substring(param.length()-"keystore".length()).equalsIgnoreCase("keystore"))
+      {
+        IKeystoreManager kmanager = KeystoreManagerFactory.make("",value);
+        out.print(
+"      <nobr>"+org.apache.lcf.ui.util.Encoder.bodyEscape(param)+"=<"+Integer.toString(kmanager.getContents().length)+"
certificate(s)></nobr><br/>\n"
+        );
+      }
+      else
+      {
+        out.print(
+"      <nobr>"+org.apache.lcf.ui.util.Encoder.bodyEscape(param)+"="+org.apache.lcf.ui.util.Encoder.bodyEscape(value)+"</nobr><br/>\n"
+        );
+      }
+    }
+    out.print(
+"    </td>\n"+
+"  </tr>\n"+
+"</table>\n"
+    );
+  }
 
 }



Mime
View raw message