manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1672306 - in /manifoldcf/branches/dev_1x: ./ connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/ connectors/gridfs/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/gridfs/
Date Thu, 09 Apr 2015 12:13:09 GMT
Author: kwright
Date: Thu Apr  9 12:13:09 2015
New Revision: 1672306

URL: http://svn.apache.org/r1672306
Log:
Pull up fix for CONNECTORS-1184 from trunk

Removed:
    manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/gridfs/editSpecification_Credentials.html
Modified:
    manifoldcf/branches/dev_1x/   (props changed)
    manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java
    manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/gridfs/editConfiguration.js

Propchange: manifoldcf/branches/dev_1x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Apr  9 12:13:09 2015
@@ -123,4 +123,4 @@
 /manifoldcf/branches/CONNECTORS-981:1605049-1605773
 /manifoldcf/branches/CONNECTORS-989:1611600-1612101
 /manifoldcf/branches/CONNECTORS-990:1610284-1610707
-/manifoldcf/trunk:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1631750,1631953,1632013,1632225,1632289,1632562,1632844,1632847,1632854,1633062-1633063,1633108,1633193,1633202,1633282,1633284,1633295,1633336,1633339,1633345,1633348,1633364,1633378,1633383,1633432,1633546,1633590,1633634,1633668,1633727,1633760,1633764,1633786,1633910,1633923,1634021,1634028,1634067,1634132,1634145,1634148,163
 4155,1634188,1634202,1634264,1634373,1634530,1634688,1634850,1634857,1635103,1635116,1635421,1635438,1635478,1635481,1635484,1635490,1635809,1635939,1636146,1636167,1636180,1636207,1636215,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1637310,1637350,1637364,1637373,1637378,1639259,1639593,1639600,1640018,1640101,1640199,1640204,1640208,1640314,1640319,1640749,1640772,1640805,1640888,1640925,1640941-1640942,1641222,1641328,1641557,1641559,1641629,1641633,1641724,1641754,1641911,1642163,1642255,1642318,1642531,1642650,1642658,1642673,1642716,1644197,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646408,1646640,1646947,1647574,1647585,1647608,1648686,1648976,1649201,1649203,1649529,1649605,1649628,1649794,1650351,1650722,1650741-1650742,1650745,1650747,1650911,1650954,1651332,1651539,1651907,1651921,1652071,1652974,1653175,1653899,1654651,1655205,1655261,1655264,1655377,1655411,1655618,1655914,1657346,1657443,1658004,1658036,1658121,1658155,1658188,1658463,1658476,
 1660258,1660276,1661454,1665848,1666160,1666781,1666820,1668312,1669100,1669238,1669487,1669523,1669586,1669660,1670614,1670625,1670715,1671496,1672169
+/manifoldcf/trunk:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1624982,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628046,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1631750,1631953,1632013,1632225,1632289,1632562,1632844,1632847,1632854,1633062-1633063,1633108,1633193,1633202,1633282,1633284,1633295,1633336,1633339,1633345,1633348,1633364,1633378,1633383,1633432,1633546,1633590,1633634,1633668,1633727,1633760,1633764,1633786,1633910,1633923,1634021,1634028,1634067,1634132,1634145,1634148,163
 4155,1634188,1634202,1634264,1634373,1634530,1634688,1634850,1634857,1635103,1635116,1635421,1635438,1635478,1635481,1635484,1635490,1635809,1635939,1636146,1636167,1636180,1636207,1636215,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1637310,1637350,1637364,1637373,1637378,1639259,1639593,1639600,1640018,1640101,1640199,1640204,1640208,1640314,1640319,1640749,1640772,1640805,1640888,1640925,1640941-1640942,1641222,1641328,1641557,1641559,1641629,1641633,1641724,1641754,1641911,1642163,1642255,1642318,1642531,1642650,1642658,1642673,1642716,1644197,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646408,1646640,1646947,1647574,1647585,1647608,1648686,1648976,1649201,1649203,1649529,1649605,1649628,1649794,1650351,1650722,1650741-1650742,1650745,1650747,1650911,1650954,1651332,1651539,1651907,1651921,1652071,1652974,1653175,1653899,1654651,1655205,1655261,1655264,1655377,1655411,1655618,1655914,1657346,1657443,1658004,1658036,1658121,1658155,1658188,1658463,1658476,
 1660258,1660276,1661454,1665848,1666160,1666781,1666820,1668312,1669100,1669238,1669487,1669523,1669586,1669660,1670614,1670625,1670715,1671496,1672169,1672301

Modified: manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java?rev=1672306&r1=1672305&r2=1672306&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java
(original)
+++ manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/gridfs/GridFSRepositoryConnector.java
Thu Apr  9 12:13:09 2015
@@ -34,7 +34,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
@@ -136,10 +135,6 @@ public class GridFSRepositoryConnector e
      * GridFS server tab name.
      */
     private static final String GRIDFS_SERVER_TAB_RESOURCE = "GridFSConnector.Server";
-    /**
-     * GridFS credentials tab name.
-     */
-    private static final String GRIDFS_CREDENTIALS_TAB_RESOURCE = "GridFSConnector.Credentials";
 
     /**
      * Tab name parameter for managing the view of the Web UI.
@@ -222,19 +217,19 @@ public class GridFSRepositoryConnector e
             getSession();
             if (session != null) {
                 Mongo currentMongoSession = session.getMongo();
-                DBTCPConnector currentTCPConnection = currentMongoSession.getConnector();
-                boolean status = currentTCPConnection.isOpen();
-                if (status) {
-                    session.getMongo().close();
-                    session = null;
-                    return super.check();
-                } else {
-                    session = null;
-                }
+                currentMongoSession.getConnector()
+                        .getDBPortPool(currentMongoSession.getAddress())
+                        .get()
+                        .ensureOpen();
+                session.getMongo().close();
+                session = null;
+                return super.check();
             }
             return "Not connected.";
         } catch (ManifoldCFException e) {
             return e.getMessage();
+        } catch (IOException ex) {
+            return ex.getMessage();
         }
     }
 
@@ -248,7 +243,7 @@ public class GridFSRepositoryConnector e
     public void disconnect() throws ManifoldCFException {
         if (session != null) {
             try {
-                session.getMongo().getConnector().close();
+                session.getMongo().close();
             } catch (Exception e) {
                 Logging.connectors.error("GridFS: Error when trying to disconnect: " + e.getMessage());
                 throw new ManifoldCFException("GridFS: Error when trying to disconnect: "
+ e.getMessage(), e);
@@ -282,7 +277,7 @@ public class GridFSRepositoryConnector e
         long currentTime = System.currentTimeMillis();
         if (currentTime >= lastSessionFetch + SESSION_EXPIRATION_MILLISECONDS) {
             if (session != null) {
-                session.getMongo().getConnector().close();
+                session.getMongo().close();
                 session = null;
             }
             lastSessionFetch = -1L;
@@ -328,22 +323,22 @@ public class GridFSRepositoryConnector e
 
     /** Queue "seed" documents.  Seed documents are the starting places for crawling activity.
 Documents
     * are seeded when this method calls appropriate methods in the passed in ISeedingActivity
object.
-    *
+     *
     * This method can choose to find repository changes that happen only during the specified
time interval.
     * The seeds recorded by this method will be viewed by the framework based on what the
     * getConnectorModel() method returns.
-    *
+     *
     * It is not a big problem if the connector chooses to create more seeds than are
     * strictly necessary; it is merely a question of overall work required.
-    *
+     *
     * The end time and seeding version string passed to this method may be interpreted for
greatest efficiency.
     * For continuous crawling jobs, this method will
     * be called once, when the job starts, and at various periodic intervals as the job executes.
-    *
+     *
     * When a job's specification is changed, the framework automatically resets the seeding
version string to null.  The
     * seeding version string may also be set to null on each job run, depending on the connector
model returned by
     * getConnectorModel().
-    *
+     *
     * Note that it is always ok to send MORE documents rather than less to this method.
     * The connector will be connected before this method can be called.
     *@param activities is the interface this method should use to perform whatever framework
actions are desired.
@@ -352,11 +347,11 @@ public class GridFSRepositoryConnector e
     *@param lastSeedVersionString is the last seeding version string for this job, or null
if the job has no previous seeding version string.
     *@param jobMode is an integer describing how the job is being run, whether continuous
or once-only.
     *@return an updated seeding version string, to be stored with the job.
-    */
+     */
     @Override
     public String addSeedDocuments(ISeedingActivity activities, Specification spec,
-        String lastSeedVersion, long seedTime, int jobMode)
-        throws ManifoldCFException, ServiceInterruption {
+            String lastSeedVersion, long seedTime, int jobMode)
+            throws ManifoldCFException, ServiceInterruption {
         getSession();
         DBCollection fsFiles = session.getCollection(
                 bucket + GridFSConstants.COLLECTION_SEPERATOR + GridFSConstants.FILES_COLLECTION_NAME
@@ -385,11 +380,11 @@ public class GridFSRepositoryConnector e
     * and ingest documents.
     *@param jobMode is an integer describing how the job is being run, whether continuous
or once-only.
     *@param usesDefaultAuthority will be true only if the authority in use for these documents
is the default one.
-    */
+     */
     @Override
     public void processDocuments(String[] documentIdentifiers, IExistingVersions statuses,
Specification spec,
-      IProcessActivity activities, int jobMode, boolean usesDefaultAuthority)
-      throws ManifoldCFException, ServiceInterruption {
+            IProcessActivity activities, int jobMode, boolean usesDefaultAuthority)
+            throws ManifoldCFException, ServiceInterruption {
 
         for (String documentIdentifier : documentIdentifiers) {
 
@@ -411,7 +406,7 @@ public class GridFSRepositoryConnector e
                         : StringUtils.EMPTY;
             }
 
-            if (versionString.length() == 0 || activities.checkDocumentNeedsReindexing(documentIdentifier,versionString))
{
+            if (versionString.length() == 0 || activities.checkDocumentNeedsReindexing(documentIdentifier,
versionString)) {
                 long startTime = System.currentTimeMillis();
                 String errorCode = null;
                 String errorDesc = null;
@@ -535,7 +530,7 @@ public class GridFSRepositoryConnector e
                                     handleIOException(e);
                                 }
                             }
-                            gfs.getDB().getMongo().getConnector().close();
+                            gfs.getDB().getMongo().close();
                             session = null;
                             errorCode = "OK";
                         } else {
@@ -566,7 +561,7 @@ public class GridFSRepositoryConnector e
             throw new ManifoldCFException(e.getMessage(), e);
         }
     }
-    
+
     /**
      * Output the configuration header section. This method is called in the
      * head section of the connector's configuration page. Its purpose is to add
@@ -586,7 +581,6 @@ public class GridFSRepositoryConnector e
     @Override
     public void outputConfigurationHeader(IThreadContext threadContext, IHTTPOutput out,
Locale locale, ConfigParams parameters, List<String> tabsArray) throws ManifoldCFException,
IOException {
         tabsArray.add(Messages.getString(locale, GRIDFS_SERVER_TAB_RESOURCE));
-        tabsArray.add(Messages.getString(locale, GRIDFS_CREDENTIALS_TAB_RESOURCE));
         Map<String, String> paramMap = new HashMap<String, String>();
 
         fillInServerParameters(paramMap, out, parameters);

Modified: manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/gridfs/editConfiguration.js
URL: http://svn.apache.org/viewvc/manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/gridfs/editConfiguration.js?rev=1672306&r1=1672305&r2=1672306&view=diff
==============================================================================
--- manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/gridfs/editConfiguration.js
(original)
+++ manifoldcf/branches/dev_1x/connectors/gridfs/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/gridfs/editConfiguration.js
Thu Apr  9 12:13:09 2015
@@ -33,13 +33,18 @@ function checkConfigForSave()
     return false;
   } 
   
-  if (!isInteger(editconnection.port.value))
+  if(editconnection.port.value !== "") 
   {
-      alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('GridFSConnector.PortValueMustBeAValidNumber'))");
-      SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('GridFSConnector.Server'))");
-      editconnection.socketTimeout.focus();
-      return false;
+    if (!isInteger(editconnection.port.value))
+    {
+        alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('GridFSConnector.PortValueMustBeAValidNumber'))");
+        SelectTab("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('GridFSConnector.Server'))");
+        editconnection.socketTimeout.focus();
+        return false;
+    }
   }
+  
+  
   return true;
 }
 // -->



Mime
View raw message