manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1477398 - in /manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main: java/org/apache/manifoldcf/crawler/connectors/dropbox/ native2ascii/org/apache/manifoldcf/crawler/connectors/dropbox/ resources/org/apache/manifoldcf/c...
Date Mon, 29 Apr 2013 22:52:47 GMT
Author: kwright
Date: Mon Apr 29 22:52:46 2013
New Revision: 1477398

URL: http://svn.apache.org/r1477398
Log:
Commit second patch.

Added:
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification_DropboxPath.html
Removed:
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification_DROPBOXQuery.html
Modified:
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxConfig.java
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxSession.java
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/dropbox/common_en_US.properties
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editConfiguration.js
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editConfiguration_Server.html
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification.js
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/viewConfiguration.html
    manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/viewSpecification.html

Modified: manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxConfig.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxConfig.java?rev=1477398&r1=1477397&r2=1477398&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxConfig.java
(original)
+++ manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxConfig.java
Mon Apr 29 22:52:46 2013
@@ -49,9 +49,10 @@ public class DropboxConfig {
   public static final String REPOSITORY_ID_PARAM = "repositoryId";
   
   //default values
-  public static final String PATH_DEFAULT_VALUE = "NOT USED YET";
+  public static final String PATH_DEFAULT_VALUE = "/";
   public static final String REPOSITORY_ID_DEFAULT_VALUE = "dropbox";
   
-  public static final String DROPBOX_QUERY_PARAM = "dropboxQuery";
+  public static final String DROPBOX_PATH_PARAM = "dropboxpath";
+  public static final String DROPBOX_PATH_PARAM_DEFAULT_VALUE = "/";
   
 }

Modified: manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java?rev=1477398&r1=1477397&r2=1477398&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java
Mon Apr 29 22:52:46 2013
@@ -61,7 +61,7 @@ public class DropboxRepositoryConnector 
   protected static final String RELATIONSHIP_CHILD = "child";
   private static final String JOB_STARTPOINT_NODE_TYPE = "startpoint";
   private static final String DROPBOX_SERVER_TAB_PROPERTY = "DropboxRepositoryConnector.Server";
-  private static final String DROPBOX_QUERY_TAB_PROPERTY = "DropboxRepositoryConnector.DROPBOXConfig";
+  private static final String DROPBOX_PATH_TAB_PROPERTY = "DropboxRepositoryConnector.DropboxPath";
   // Template names
   /**
    * Forward to the javascript to check the configuration parameters
@@ -79,7 +79,7 @@ public class DropboxRepositoryConnector 
   /**
    * Forward to the template to edit the configuration parameters for the job
    */
-  private static final String EDIT_SPEC_FORWARD_DROPBOXQUERY = "editSpecification_DROPBOXQuery.html";
+  private static final String EDIT_SPEC_FORWARD_DROPBOXPATH = "editSpecification_DropboxPath.html";
   /**
    * Forward to the HTML template to view the configuration parameters
    */
@@ -100,7 +100,6 @@ public class DropboxRepositoryConnector 
   protected String app_secret = null;
   protected String key = null;
   protected String secret = null;
-  protected String path = null;
 
   public DropboxRepositoryConnector() {
     super();
@@ -152,7 +151,7 @@ public class DropboxRepositoryConnector 
     app_secret= null;
     key = null;
     secret = null;
-    path = null;
+    
   }
 
   /**
@@ -173,7 +172,7 @@ public class DropboxRepositoryConnector 
     app_secret=params.getParameter(DropboxConfig.APP_SECRET_PARAM);
     key = params.getParameter(DropboxConfig.KEY_PARAM);
     secret = params.getParameter(DropboxConfig.SECRET_PARAM);
-    path = params.getParameter(DropboxConfig.PATH_PARAM);
+    
   }
 
   /**
@@ -278,11 +277,7 @@ public class DropboxRepositoryConnector 
 
       Logging.connectors.debug("DROPBOX: Password exists");
 
-      if (StringUtils.isEmpty(path)) {
-        throw new ManifoldCFException("Parameter " + DropboxConfig.PATH_PARAM
-            + " required but not set");
-      }
-
+      
       // Create a session
       Map<String, String> parameters = new HashMap<String, String>();
 
@@ -348,7 +343,6 @@ public class DropboxRepositoryConnector 
     
     String username = parameters.getParameter(DropboxConfig.KEY_PARAM);
     String password = parameters.getParameter(DropboxConfig.SECRET_PARAM);
-    String path = parameters.getParameter(DropboxConfig.PATH_PARAM);
     
     if (app_key == null) {
       app_key = StringUtils.EMPTY;
@@ -364,15 +358,12 @@ public class DropboxRepositoryConnector 
     if (password == null) {
       password = StringUtils.EMPTY;
     }
-    if (path == null) {
-      path = DropboxConfig.PATH_DEFAULT_VALUE;
-    }
     
     newMap.put(DropboxConfig.APP_KEY_PARAM, app_key);
     newMap.put(DropboxConfig.APP_SECRET_PARAM, app_secret);
     newMap.put(DropboxConfig.KEY_PARAM, username);
     newMap.put(DropboxConfig.SECRET_PARAM, password);
-    newMap.put(DropboxConfig.PATH_PARAM, path);
+    
   }
 
   /**
@@ -501,28 +492,23 @@ public class DropboxRepositoryConnector 
       parameters.setParameter(DropboxConfig.SECRET_PARAM, secret);
     }
 
-    String path = variableContext.getParameter(DropboxConfig.PATH_PARAM);
-    if (path != null) {
-      parameters.setParameter(DropboxConfig.PATH_PARAM, path);
-    }
-
     return null;
   }
 
   /**
-   * Fill in specification Velocity parameter map for DROPBOXQuery tab.
+   * Fill in specification Velocity parameter map for DROPBOXPath tab.
    */
-  private static void fillInDROPBOXQuerySpecificationMap(Map<String, String> newMap,
DocumentSpecification ds) {
+  private static void fillInDropboxPathSpecificationMap(Map<String, String> newMap,
DocumentSpecification ds) {
     int i = 0;
-    String DropboxQuery = "";
+    String DropboxPath = DropboxConfig.DROPBOX_PATH_PARAM_DEFAULT_VALUE;
     while (i < ds.getChildCount()) {
       SpecificationNode sn = ds.getChild(i);
       if (sn.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
-        DropboxQuery = sn.getAttributeValue(DropboxConfig.DROPBOX_QUERY_PARAM);
+        DropboxPath = sn.getAttributeValue(DropboxConfig.DROPBOX_PATH_PARAM);
       }
       i++;
     }
-    newMap.put(DropboxConfig.DROPBOX_QUERY_PARAM, DropboxQuery);
+    newMap.put(DropboxConfig.DROPBOX_PATH_PARAM, DropboxPath);
   }
 
   /**
@@ -542,7 +528,7 @@ public class DropboxRepositoryConnector 
     Map<String, String> paramMap = new HashMap<String, String>();
 
     // Fill in the map with data from all tabs
-    fillInDROPBOXQuerySpecificationMap(paramMap, ds);
+    fillInDropboxPathSpecificationMap(paramMap, ds);
 
     outputResource(VIEW_SPEC_FORWARD, out, locale, paramMap);
   }
@@ -564,8 +550,8 @@ public class DropboxRepositoryConnector 
   @Override
   public String processSpecificationPost(IPostParameters variableContext,
     DocumentSpecification ds) throws ManifoldCFException {
-    String cmisQuery = variableContext.getParameter(DropboxConfig.DROPBOX_QUERY_PARAM);
-    if (cmisQuery != null) {
+    String dropboxPath = variableContext.getParameter(DropboxConfig.DROPBOX_PATH_PARAM);
+    if (dropboxPath != null) {
       int i = 0;
       while (i < ds.getChildCount()) {
         SpecificationNode oldNode = ds.getChild(i);
@@ -576,8 +562,8 @@ public class DropboxRepositoryConnector 
         i++;
       }
       SpecificationNode node = new SpecificationNode(JOB_STARTPOINT_NODE_TYPE);
-      node.setAttribute(DropboxConfig.DROPBOX_QUERY_PARAM, cmisQuery);
-      variableContext.setParameter(DropboxConfig.DROPBOX_QUERY_PARAM, cmisQuery);
+      node.setAttribute(DropboxConfig.DROPBOX_PATH_PARAM, dropboxPath);
+      variableContext.setParameter(DropboxConfig.DROPBOX_PATH_PARAM, dropboxPath);
       ds.addChild(ds.getChildCount(), node);
     }
     return null;
@@ -600,11 +586,11 @@ public class DropboxRepositoryConnector 
     Locale locale, DocumentSpecification ds, String tabName) throws ManifoldCFException,
     IOException {
 
-    // Output DROPBOXQuery tab
+    // Output DROPBOXPath tab
     Map<String, String> paramMap = new HashMap<String, String>();
     paramMap.put("TabName", tabName);
-    fillInDROPBOXQuerySpecificationMap(paramMap, ds);
-    outputResource(EDIT_SPEC_FORWARD_DROPBOXQUERY, out, locale, paramMap);
+    fillInDropboxPathSpecificationMap(paramMap, ds);
+    outputResource(EDIT_SPEC_FORWARD_DROPBOXPATH, out, locale, paramMap);
   }
 
   /**
@@ -623,12 +609,12 @@ public class DropboxRepositoryConnector 
   public void outputSpecificationHeader(IHTTPOutput out,
     Locale locale, DocumentSpecification ds, List<String> tabsArray)
     throws ManifoldCFException, IOException {
-    tabsArray.add(Messages.getString(locale, DROPBOX_QUERY_TAB_PROPERTY));
+    tabsArray.add(Messages.getString(locale, DROPBOX_PATH_TAB_PROPERTY));
 
     Map<String, String> paramMap = new HashMap<String, String>();
 
     // Fill in the specification header map, using data from all tabs.
-    fillInDROPBOXQuerySpecificationMap(paramMap, ds);
+    fillInDropboxPathSpecificationMap(paramMap, ds);
 
     outputResource(EDIT_SPEC_HEADER_FORWARD, out, locale, paramMap);
   }
@@ -676,17 +662,29 @@ public class DropboxRepositoryConnector 
     DocumentSpecification spec, long startTime, long endTime, int jobMode)
     throws ManifoldCFException, ServiceInterruption {
     
-    HashSet<String> seeds = getSeeds();
+      
+    String dropboxPath = StringUtils.EMPTY;
+    int i = 0;
+    while (i < spec.getChildCount()) {
+      SpecificationNode sn = spec.getChild(i);
+      if (sn.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
+        dropboxPath = sn.getAttributeValue(DropboxConfig.DROPBOX_PATH_PARAM);
+        break;
+      }
+      i++;
+    }
+    
+    HashSet<String> seeds = getSeeds(dropboxPath);
     for (String seed : seeds) {
       activities.addSeedDocument(seed);
     }
 
   }
 
-  protected HashSet<String> getSeeds()
+  protected HashSet<String> getSeeds(String path)
     throws ManifoldCFException, ServiceInterruption {
     getSession();
-    GetSeedsThread t = new GetSeedsThread();
+    GetSeedsThread t = new GetSeedsThread(path);
     try {
       t.start();
       t.join();
@@ -715,15 +713,18 @@ public class DropboxRepositoryConnector 
 
     protected Throwable exception = null;
     protected HashSet<String> response = null;
-
-    public GetSeedsThread() {
+    protected String path = null;
+    
+    public GetSeedsThread(String path) {
       super();
+      this.path=path;
       setDaemon(true);
     }
 
+    @Override
     public void run() {
       try {
-        response = session.getSeeds();
+        response = session.getSeeds(path,25000); //upper limit on files to get supported
by dropbox api in a single directory
       } catch (Throwable e) {
         this.exception = e;
       }
@@ -785,7 +786,7 @@ public class DropboxRepositoryConnector 
 
       if (dropboxObject.isDir) {
 
-        // adding all the children for a folder
+        // adding all the children + subdirs for a folder
 
         List<DropboxAPI.Entry> children = dropboxObject.contents;
         for (DropboxAPI.Entry child : children) {

Modified: manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxSession.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxSession.java?rev=1477398&r1=1477397&r2=1477398&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxSession.java
(original)
+++ manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxSession.java
Mon Apr 29 22:52:46 2013
@@ -51,9 +51,7 @@ import org.json.simple.parser.ParseExcep
 public class DropboxSession {
 
   private DropboxAPI<?> client;
-  private String cursor = null;
   
-
   public DropboxSession(Map<String, String> parameters) {
     AppKeyPair appKeyPair = new AppKeyPair(parameters.get(DropboxConfig.APP_KEY_PARAM), parameters.get(DropboxConfig.APP_SECRET_PARAM));
     WebAuthSession session = new WebAuthSession(appKeyPair, WebAuthSession.AccessType.DROPBOX);
@@ -75,29 +73,24 @@ public class DropboxSession {
     return info;
   }
 
-  public HashSet<String> getSeeds() throws DropboxException {
-    HashSet<String> ids = new HashSet<String>();
-    Boolean changed = false;
-    while (true) {
-      // Get /delta results from Dropbox
-      DropboxAPI.DeltaPage<DropboxAPI.Entry> page = client.delta(cursor);
-
-      if (page.reset) {
-        changed = true;
-      }
-      // Apply the entries one by one.
-      for (DeltaEntry<DropboxAPI.Entry> e : page.entries) {
-        ids.add(e.lcPath);
-        changed = true;
-      }
-      cursor = page.cursor;
-      if (!page.hasMore) {
-        break;
-      }
-    }
-    return ids;
-  }
+    public HashSet<String> getSeeds(String path, int max_dirs) throws DropboxException
{
+        HashSet<String> ids = new HashSet<String>();
 
+        ids.add(path); //need to add root dir so that single files such as /file1 will still
get read
+        
+        
+        DropboxAPI.Entry root_entry = client.metadata(path, max_dirs, null, true, null);
+        List<DropboxAPI.Entry> entries = root_entry.contents; //gets a list of the
contents of the entire folder: subfolders + files
+
+        // Apply the entries one by one.
+        for (DropboxAPI.Entry e : entries) {
+            if (e.isDir) { //only add the directories as seeds, we'll add the files later
+                ids.add(e.path);
+            }
+        }
+        return ids;
+    }
+  
   public DropboxAPI.Entry getObject(String id) throws DropboxException {
     return client.metadata(id, 25000, null, true, null);
   }

Modified: manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/dropbox/common_en_US.properties
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/dropbox/common_en_US.properties?rev=1477398&r1=1477397&r2=1477398&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/dropbox/common_en_US.properties
(original)
+++ manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/dropbox/common_en_US.properties
Mon Apr 29 22:52:46 2013
@@ -21,7 +21,6 @@ DropboxRepositoryConnector.AppSecretColo
 
 DropboxRepositoryConnector.KeyColon=Key:
 DropboxRepositoryConnector.SecretColon=Secret:
-DropboxRepositoryConnector.PathColon=Path:
 DropboxRepositoryConnector.RepositoryIDColon=Repository ID:
 DropboxRepositoryConnector.Optional=(optional)
 
@@ -34,9 +33,9 @@ DropboxRepositoryConnector.TheKeyMustNot
 DropboxRepositoryConnector.TheSecretMustNotBeNull=The Secret must not be null
 DropboxRepositoryConnector.PathMustNotBeNull=Path must be not null
 
-DropboxRepositoryConnector.DROPBOXQuery=DROPBOX Query
+DropboxRepositoryConnector.DropboxPath=Dropbox Folder to Index
 
-DropboxRepositoryConnector.DROPBOXQueryColon=DROPBOX Query:
+DropboxRepositoryConnector.DropboxPathColon=Dropbox Folder to Index:
 
 DropboxRepositoryConnector.ParametersColon=Parameters:
 DropboxRepositoryConnector.KeyEquals=key=
@@ -47,7 +46,6 @@ DropboxRepositoryConnector.BindingEquals
 DropboxRepositoryConnector.ProtocolEquals=protocol=
 DropboxRepositoryConnector.ServerEquals=server=
 DropboxRepositoryConnector.PortEquals=port=
-DropboxRepositoryConnector.PathEquals=path=
 DropboxRepositoryConnector.RepositoryIdEquals=repositoryId=
 
 DropboxRepositoryConnector.Repository=Repository

Modified: manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editConfiguration.js
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editConfiguration.js?rev=1477398&r1=1477397&r2=1477398&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editConfiguration.js
(original)
+++ manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editConfiguration.js
Mon Apr 29 22:52:46 2013
@@ -55,12 +55,6 @@ function checkConfigForSave()
     editconnection.secret.focus();
     return false;
   }
-  if(editconnection.path.value == ""){
-    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('DropboxRepositoryConnector.PathMustNotBeNull'))");
-    SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('DropboxRepositoryConnector.Server'))");
-    editconnection.path.focus();
-    return false;
-  }
   return true;
 }
 //-->

Modified: manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editConfiguration_Server.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editConfiguration_Server.html?rev=1477398&r1=1477397&r2=1477398&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editConfiguration_Server.html
(original)
+++ manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editConfiguration_Server.html
Mon Apr 29 22:52:46 2013
@@ -68,16 +68,6 @@
       <input type="text" id="secret" name="secret" value="$Encoder.attributeEscape($SECRET)"
/>
     </td>
   </tr>
-  <tr>
-    <td class="description">
-      <nobr>
-        $Encoder.bodyEscape($ResourceBundle.getString('DropboxRepositoryConnector.PathColon'))
-      </nobr>
-    </td>
-    <td class="value">
-        <input id="path" name="path" type="text" size="32" value="$Encoder.attributeEscape($PATH)"
/>
-    </td>
-  </tr>
 </table>
 
 #else
@@ -87,6 +77,5 @@
 <input type="hidden" name="app_secret" value="$Encoder.attributeEscape($APP_SECRET)" />
 <input type="hidden" name="key" value="$Encoder.attributeEscape($KEY)" />
 <input type="hidden" name="secret" value="$Encoder.attributeEscape($SECRET)" />
-<input type="hidden" name="path" value="$Encoder.attributeEscape($PATH)" />
 
 #end

Modified: manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification.js
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification.js?rev=1477398&r1=1477397&r2=1477398&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification.js
(original)
+++ manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification.js
Mon Apr 29 22:52:46 2013
@@ -19,10 +19,21 @@
 <!--
 function checkSpecification()
 {
-  // Does nothing right now.
-  return true;
+    return true;
 }
  
+ 
+ function checkSpecificationForSave
+ {
+ if(editconnection.path.value == ""){
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('DropboxRepositoryConnector.PathMustNotBeNull'))");
+    SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('DropboxRepositoryConnector.Server'))");
+    editconnection.path.focus();
+    return false;
+  }
+  return true;
+ }
+ 
 function SpecOp(n, opValue, anchorvalue)
 {
   eval("editjob."+n+".value = \""+opValue+"\"");

Added: manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification_DropboxPath.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification_DropboxPath.html?rev=1477398&view=auto
==============================================================================
--- manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification_DropboxPath.html
(added)
+++ manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/editSpecification_DropboxPath.html
Mon Apr 29 22:52:46 2013
@@ -0,0 +1,44 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+#if($TABNAME == $ResourceBundle.getString('DropboxRepositoryConnector.DropboxPath'))
+
+<table class="displaytable">
+  <tr>
+    <td class="separator" colspan="3">
+      <hr />
+    </td>
+  </tr>
+  <tr>
+    <td class="description">
+      <nobr>
+        $Encoder.bodyEscape($ResourceBundle.getString('DropboxRepositoryConnector.DropboxPathColon'))
+      </nobr>
+    </td>
+    <td class="value">
+      <nobr>
+        <input type="text" size="120" name="dropboxpath" value="$Encoder.attributeEscape($DROPBOXPATH)"
/>
+      </nobr>
+    </td>
+  </tr>
+</table>
+
+#else
+
+<input type="hidden" name="dropboxpath" value="$Encoder.attributeEscape($DROPBOXPATH)"
/>
+
+#end
+

Modified: manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/viewConfiguration.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/viewConfiguration.html?rev=1477398&r1=1477397&r2=1477398&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/viewConfiguration.html
(original)
+++ manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/viewConfiguration.html
Mon Apr 29 22:52:46 2013
@@ -38,10 +38,6 @@
       <nobr>
         $Encoder.bodyEscape($ResourceBundle.getString('DropboxRepositoryConnector.SecretEquals'))$Encoder.bodyEscape($SECRET)
       </nobr>
-      <br />
-      <nobr>
-        $Encoder.bodyEscape($ResourceBundle.getString('DropboxRepositoryConnector.PathEquals'))$Encoder.bodyEscape($PATH)
-      </nobr>
     </td>
   </tr>
 </table>

Modified: manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/viewSpecification.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/viewSpecification.html?rev=1477398&r1=1477397&r2=1477398&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/viewSpecification.html
(original)
+++ manifoldcf/branches/CONNECTORS-676/connectors/dropbox/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/dropbox/viewSpecification.html
Mon Apr 29 22:52:46 2013
@@ -14,15 +14,14 @@
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
-<!--
+
 <table class="displaytable">
   <tr>
     <td class="description">
-      $Encoder.bodyEscape($ResourceBundle.getString('DropboxRepositoryConnector.DROPBOXQueryColon'))
+      $Encoder.bodyEscape($ResourceBundle.getString('DropboxRepositoryConnector.DropboxPathColon'))
     </td>
     <td class="value">
-      $Encoder.bodyEscape($DROPBOXQUERY)
+      $Encoder.bodyEscape($DROPBOXPATH)
     </td>
   </tr>
 </table>
--->
\ No newline at end of file



Mime
View raw message