manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1671980 - in /manifoldcf/trunk: ./ connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/ connectors/livelink/connector/src/main/java/org/apache/manifoldcf/livelink/ connectors/livelink/connector/src...
Date Wed, 08 Apr 2015 00:09:45 GMT
Author: kwright
Date: Wed Apr  8 00:09:45 2015
New Revision: 1671980

URL: http://svn.apache.org/r1671980
Log:
Fix for CONNECTORS-1173.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
    manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/livelink/LiveLinkParameters.java
    manifoldcf/trunk/connectors/livelink/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/livelink/common_en_US.properties
    manifoldcf/trunk/connectors/livelink/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/livelink/editConfiguration_View.html

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1671980&r1=1671979&r2=1671980&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Wed Apr  8 00:09:45 2015
@@ -3,6 +3,9 @@ $Id$
 
 ======================= 2.1-dev =====================
 
+CONNECTORS-1173: Option to change View URL for Livelink Connector
+(Kishore Kumar)
+
 CONNECTORS-1179: Include the collection name as part of the Solr
 version string.
 (Kamil Żyta, Karl Wright)

Modified: manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java?rev=1671980&r1=1671979&r2=1671980&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
(original)
+++ manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
Wed Apr  8 00:09:45 2015
@@ -179,6 +179,7 @@ public class LivelinkConnector extends o
   private String viewServerName = null;
   private String viewPort = null;
   private String viewCgiPath = null;
+  private String viewAction = null;
 
   private String ingestNtlmDomain = null;
   private String ingestNtlmUsername = null;
@@ -366,6 +367,7 @@ public class LivelinkConnector extends o
       viewServerName = params.getParameter(LiveLinkParameters.viewServerName);
       viewPort = params.getParameter(LiveLinkParameters.viewPort);
       viewCgiPath = params.getParameter(LiveLinkParameters.viewCgiPath);
+      viewAction = params.getParameter(LiveLinkParameters.viewAction);
 
       ingestNtlmDomain = params.getParameter(LiveLinkParameters.ingestNtlmDomain);
       ingestNtlmUsername = params.getParameter(LiveLinkParameters.ingestNtlmUsername);
@@ -841,11 +843,28 @@ public class LivelinkConnector extends o
     // The document identifier is the string form of the object ID for this connector.
     if (!documentIdentifier.startsWith("D"))
       return null;
+    String objectID = null;
     int colonPosition = documentIdentifier.indexOf(":",1);
     if (colonPosition == -1)
-      return viewBasePath+"?func=ll&objID="+documentIdentifier.substring(1)+"&objAction=download";
+      objectID = documentIdentifier.substring(1);
     else
-      return viewBasePath+"?func=ll&objID="+documentIdentifier.substring(colonPosition+1)+"&objAction=download";
+      objectID = documentIdentifier.substring(colonPosition+1);
+    String viewURL = null;
+    switch(viewAction)
+    {
+      case "download":
+        viewURL =  viewBasePath+"?func=ll&objAction=download&objID=" + objectID;
+      break;
+      case "open":
+        viewURL = viewBasePath+"/open/" + objectID;
+      break;
+      case "overview":
+        viewURL = viewBasePath+"?func=ll&objAction=overview&objID=" + objectID;
+      break;
+      default:
+        viewURL = viewBasePath+"?func=ll&objAction=download&objID=" + objectID;
+    }
+    return viewURL;
   }
 
   /** Request arbitrary connector information.
@@ -1751,11 +1770,15 @@ public class LivelinkConnector extends o
     String viewCgiPath = parameters.getParameter(LiveLinkParameters.viewCgiPath);
     if (viewCgiPath == null)
       viewCgiPath = "/livelink/livelink.exe";
+    String viewAction = parameters.getParameter(LiveLinkParameters.viewAction);
+    if (viewAction == null)
+      viewAction = "download";
 
     velocityContext.put("VIEWPROTOCOL",viewProtocol);
     velocityContext.put("VIEWSERVERNAME",viewServerName);
     velocityContext.put("VIEWPORT",viewPort);
     velocityContext.put("VIEWCGIPATH",viewCgiPath);
+    velocityContext.put("VIEWACTION",viewAction);
   }  
   
   /** Process a configuration post.
@@ -1785,6 +1808,9 @@ public class LivelinkConnector extends o
     String viewCgiPath = variableContext.getParameter("viewcgipath");
     if (viewCgiPath != null)
       parameters.setParameter(LiveLinkParameters.viewCgiPath,viewCgiPath);
+    String viewAction = variableContext.getParameter("viewaction");
+    if (viewAction != null)
+      parameters.setParameter(LiveLinkParameters.viewAction,viewAction);
     
     // Server parameters
     String serverProtocol = variableContext.getParameter("serverprotocol");

Modified: manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/livelink/LiveLinkParameters.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/livelink/LiveLinkParameters.java?rev=1671980&r1=1671979&r2=1671980&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/livelink/LiveLinkParameters.java
(original)
+++ manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/livelink/LiveLinkParameters.java
Wed Apr  8 00:09:45 2015
@@ -49,6 +49,8 @@ public class LiveLinkParameters
   public final static String viewPort = "View port";
   /** View CGI path (path to use for viewing) */
   public final static String viewCgiPath = "View CGI path";
+  /** Document View Action**/
+  public final static String viewAction = "View Action";
   
   // These parameters are for LAPI
   /** Connection options; choices are "internal", "http", "https" */

Modified: manifoldcf/trunk/connectors/livelink/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/livelink/common_en_US.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/livelink/common_en_US.properties?rev=1671980&r1=1671979&r2=1671980&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/livelink/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/livelink/common_en_US.properties
(original)
+++ manifoldcf/trunk/connectors/livelink/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/livelink/common_en_US.properties
Wed Apr  8 00:09:45 2015
@@ -67,6 +67,10 @@ LivelinkConnector.DocumentViewServerName
 LivelinkConnector.BlankSameAsFetchServer=(blank = same as fetch server)
 LivelinkConnector.DocumentViewPort=Document view port:
 LivelinkConnector.DocumentViewCGIPath=Document view CGI path
+LivelinkConnector.DocumentViewAction=Document view action
+LivelinkConnector.DocumentViewActionDownload=Download
+LivelinkConnector.DocumentViewActionOpen=Open
+LivelinkConnector.DocumentViewActionOverview=Overview
 LivelinkConnector.Parameters=Parameters:
 LivelinkConnector.certificates= certificate(s)
 LivelinkConnector.SelectAFolderFirst=Select a folder first

Modified: manifoldcf/trunk/connectors/livelink/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/livelink/editConfiguration_View.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/livelink/editConfiguration_View.html?rev=1671980&r1=1671979&r2=1671980&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/livelink/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/livelink/editConfiguration_View.html
(original)
+++ manifoldcf/trunk/connectors/livelink/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/livelink/editConfiguration_View.html
Wed Apr  8 00:09:45 2015
@@ -20,7 +20,7 @@ limitations under the License.
   <tr>
     <td class="description">$Encoder.bodyEscape($ResourceBundle.getString('LivelinkConnector.DocumentViewProtocol'))</td>
     <td class="value">
-      <select name="viewprotocol" size="3">
+      <select name="viewprotocol">
         <option value=""      #if($VIEWPROTOCOL == '')      selected="selected" #{else}
"" #end >$Encoder.bodyEscape($ResourceBundle.getString('LivelinkConnector.SameAsFetchProtocol'))</option>
         <option value="http"  #if($VIEWPROTOCOL == 'http')  selected="selected" #{else}
"" #end >http</option>
         <option value="https" #if($VIEWPROTOCOL == 'https') selected="selected" #{else}
"" #end >https</option>
@@ -58,10 +58,23 @@ limitations under the License.
       <input type="text" size="32" name="viewcgipath" value="$Encoder.attributeEscape($VIEWCGIPATH)"/>
     </td>
   </tr>
+  <tr>
+    <td class="description">
+      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('LivelinkConnector.DocumentViewAction'))</nobr>
+    </td>
+    <td class="value">
+      <select name="viewaction">
+        <option value="download"  #if($VIEWACTION == 'download')  selected="selected"
#{else} "" #end >$Encoder.bodyEscape($ResourceBundle.getString('LivelinkConnector.DocumentViewActionDownload'))</option>
+        <option value="open"      #if($VIEWACTION == 'open')      selected="selected"
#{else} "" #end >$Encoder.bodyEscape($ResourceBundle.getString('LivelinkConnector.DocumentViewActionOpen'))</option>
+        <option value="overview"  #if($VIEWACTION == 'overview')  selected="selected"
#{else} "" #end >$Encoder.bodyEscape($ResourceBundle.getString('LivelinkConnector.DocumentViewActionOverview'))</option>
+      </select>
+    </td>
+  </tr>
 </table>
 #else
 <input type="hidden" name="viewprotocol"    value="$!VIEWPROTOCOL"/>
 <input type="hidden" name="viewservername"  value="$!VIEWSERVERNAME"/>
 <input type="hidden" name="viewport"        value="$!VIEWPORT"/>
 <input type="hidden" name="viewcgipath"     value="$Encoder.attributeEscape($VIEWCGIPATH)"/>
+<input type="hidden" name="viewaction"        value="$!VIEWACTION"/>
 #end
\ No newline at end of file



Mime
View raw message