manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1501633 - in /manifoldcf/trunk: ./ connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DC...
Date Wed, 10 Jul 2013 01:50:35 GMT
Author: kwright
Date: Wed Jul 10 01:50:34 2013
New Revision: 1501633

URL: http://svn.apache.org/r1501633
Log:
Pull up branch changes from CONNECTORS-731 branch.  Part of CONNECTORS-731.

Added:
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/
      - copied from r1501632, manifoldcf/branches/CONNECTORS-731/connectors/jira/connector/src/main/java/org/apache/manifoldcf/authorities/
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraUserQueryResults.java
      - copied unchanged from r1501632, manifoldcf/branches/CONNECTORS-731/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraUserQueryResults.java
    manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/authorities/
      - copied from r1501632, manifoldcf/branches/CONNECTORS-731/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/authorities/
    manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/authorities/
      - copied from r1501632, manifoldcf/branches/CONNECTORS-731/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/authorities/
Modified:
    manifoldcf/trunk/   (props changed)
    manifoldcf/trunk/build.xml
    manifoldcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
    manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
    manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java
    manifoldcf/trunk/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java
    manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
    manifoldcf/trunk/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java
    manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java
    manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jdbc/JDBCAuthority.java
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraIssue.java
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraJSONResponse.java
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraQueryResults.java
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java
    manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java
    manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jira/common_en_US.properties
    manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jira/common_ja_JP.properties
    manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/editSpecification_jiraSecurity.html
    manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/viewSpecification_jira.html
    manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java
    manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java
    manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
    manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
    manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java
    manifoldcf/trunk/connectors/sharepoint/   (props changed)
    manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IRepositoryConnector.java
    manifoldcf/trunk/site/src/documentation/content/xdocs/en_US/end-user-documentation.xml

Propchange: manifoldcf/trunk/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-731:r1499391-1501632

Modified: manifoldcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/build.xml?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/build.xml (original)
+++ manifoldcf/trunk/build.xml Wed Jul 10 01:50:34 2013
@@ -1681,6 +1681,11 @@
             <param name="connector-label" value="Jira"/>
             <param name="connector-class" value="org.apache.manifoldcf.crawler.connectors.jira.JiraRepositoryConnector"/>
         </antcall>
+        <antcall target="general-add-authority-connector">
+            <param name="connector-name" value="jira"/>
+            <param name="connector-label" value="Jira"/>
+            <param name="connector-class" value="org.apache.manifoldcf.authorities.authorities.jira.JiraAuthorityConnector"/>
+        </antcall>
     </target>
 
     <target name="deliver-jira-connector-doc" depends="calculate-jira-doc-condition" if="jira-doc.include">

Modified: manifoldcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java (original)
+++ manifoldcf/trunk/connectors/activedirectory/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/activedirectory/ActiveDirectoryAuthority.java Wed Jul 10 01:50:34 2013
@@ -63,14 +63,6 @@ public class ActiveDirectoryAuthority ex
   /** The length of time in milliseconds that the connection remains idle before expiring.  Currently 5 minutes. */
   private static final long expirationInterval = 300000L;
   
-  /** This is the active directory global deny token.  This should be ingested with all documents. */
-  private static final String globalDenyToken = "DEAD_AUTHORITY";
-  
-  private static final AuthorizationResponse unreachableResponse = new AuthorizationResponse(new String[]{globalDenyToken},
-    AuthorizationResponse.RESPONSE_UNREACHABLE);
-  private static final AuthorizationResponse userNotFoundResponse = new AuthorizationResponse(new String[]{globalDenyToken},
-    AuthorizationResponse.RESPONSE_USERNOTFOUND);
-  
   /** Constructor.
   */
   public ActiveDirectoryAuthority()
@@ -318,7 +310,7 @@ public class ActiveDirectoryAuthority ex
     if (domainController == null)
     {
       // No domain controller found for the user, so return "user not found".
-      return userNotFoundResponse;
+      return RESPONSE_USERNOTFOUND;
     }
     
     // Look up connection parameters
@@ -326,7 +318,7 @@ public class ActiveDirectoryAuthority ex
     if (dcParams == null)
     {
       // No domain controller, even though it's mentioned in a rule
-      return userNotFoundResponse;
+      return RESPONSE_USERNOTFOUND;
     }
     
     // Use the complete fqn if the field is the "userPrincipalName"
@@ -361,7 +353,7 @@ public class ActiveDirectoryAuthority ex
       //Get DistinguishedName (for this method we are using DomainPart as a searchBase ie: DC=qa-ad-76,DC=metacarta,DC=com")
       String searchBase = getDistinguishedName(ctx, userPart, domainsb.toString(), userACLsUsername);
       if (searchBase == null)
-        return userNotFoundResponse;
+        return RESPONSE_USERNOTFOUND;
 
       //specify the LDAP search filter
       String searchFilter = "(objectClass=user)";
@@ -412,7 +404,7 @@ public class ActiveDirectoryAuthority ex
       }
 
       if (theGroups.size() == 0)
-        return userNotFoundResponse;
+        return RESPONSE_USERNOTFOUND;
       
       // All users get certain well-known groups
       theGroups.add("S-1-1-0");
@@ -431,12 +423,12 @@ public class ActiveDirectoryAuthority ex
     catch (NameNotFoundException e)
     {
       // This means that the user doesn't exist
-      return userNotFoundResponse;
+      return RESPONSE_USERNOTFOUND;
     }
     catch (NamingException e)
     {
       // Unreachable
-      return unreachableResponse;
+      return RESPONSE_UNREACHABLE;
     }
   }
 
@@ -448,7 +440,7 @@ public class ActiveDirectoryAuthority ex
   public AuthorizationResponse getDefaultAuthorizationResponse(String userName)
   {
     // The default response if the getConnection method fails
-    return unreachableResponse;
+    return RESPONSE_UNREACHABLE;
   }
 
   // UI support methods.

Modified: manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java (original)
+++ manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/authorities/DCTM/AuthorityConnector.java Wed Jul 10 01:50:34 2013
@@ -51,13 +51,8 @@ public class AuthorityConnector extends 
   protected boolean useSystemAcls = true;
 
   // Documentum has no "deny" tokens, and its document acls cannot be empty, so no local authority deny token is required.
-  // However, it is felt that we need to be suspenders-and-belt, so here is the deny token.
+  // However, it is felt that we need to be suspenders-and-belt, so we use the deny token.
   // The documentum tokens are of the form xxx:yyy, so they cannot collide with the standard deny token.
-  protected static final String denyToken = "DEAD_AUTHORITY";
-
-  protected static final AuthorizationResponse unreachableResponse = new AuthorizationResponse(new String[]{denyToken},AuthorizationResponse.RESPONSE_UNREACHABLE);
-  protected static final AuthorizationResponse userNotFoundResponse = new AuthorizationResponse(new String[]{denyToken},AuthorizationResponse.RESPONSE_USERNOTFOUND);
-  protected static final AuthorizationResponse userUnauthorizedResponse = new AuthorizationResponse(new String[]{denyToken},AuthorizationResponse.RESPONSE_USERUNAUTHORIZED);
 
     /** Cache manager. */
   protected ICacheManager cacheManager = null;
@@ -528,7 +523,7 @@ public class AuthorityConnector extends 
           {
             if (Logging.authorityConnectors.isDebugEnabled())
               Logging.authorityConnectors.debug("DCTM: No user found for username '" + strUserName + "'");
-            response = userNotFoundResponse;
+            response = RESPONSE_USERNOTFOUND;
             return;
           }
 
@@ -536,7 +531,7 @@ public class AuthorityConnector extends 
           {
             if (Logging.authorityConnectors.isDebugEnabled())
               Logging.authorityConnectors.debug("DCTM: User found for username '" + strUserName + "' but the account is not active.");
-            response = userUnauthorizedResponse;
+            response = RESPONSE_USERUNAUTHORIZED;
             return;
           }
 
@@ -741,7 +736,7 @@ public class AuthorityConnector extends 
           if (noSession)
           {
             Logging.authorityConnectors.warn("DCTM: Transient error checking authorization: "+e.getMessage(),e);
-            return unreachableResponse;
+            return RESPONSE_UNREACHABLE;
           }
           session = null;
           lastSessionFetch = -1L;
@@ -820,7 +815,7 @@ public class AuthorityConnector extends 
           if (noSession)
           {
             Logging.authorityConnectors.warn("DCTM: Transient error checking authorization: "+e.getMessage(),e);
-            return unreachableResponse;
+            return RESPONSE_UNREACHABLE;
           }
           session = null;
           lastSessionFetch = -1L;
@@ -835,7 +830,7 @@ public class AuthorityConnector extends 
       {
         Logging.authorityConnectors.warn("DCTM: Transient error checking authorization: "+e.getMessage(),e);
         // Transient: Treat as if user does not exist, not like credentials invalid.
-        return unreachableResponse;
+        return RESPONSE_UNREACHABLE;
       }
       throw new ManifoldCFException(e.getMessage(),e);
     }
@@ -848,7 +843,7 @@ public class AuthorityConnector extends 
   @Override
   public AuthorizationResponse getDefaultAuthorizationResponse(String userName)
   {
-    return unreachableResponse;
+    return RESPONSE_UNREACHABLE;
   }
 
   protected static String insensitiveMatch(boolean insensitive, String field, String value)

Modified: manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java (original)
+++ manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java Wed Jul 10 01:50:34 2013
@@ -65,7 +65,7 @@ public class DCTM extends org.apache.man
   /** Documentum has no "deny" tokens, and its document acls cannot be empty, so no local authority deny token is required.
   * However, it is felt that we need to be suspenders-and-belt, so here is the deny token.
   * The documentum tokens are of the form xxx:yyy, so they cannot collide with the standard deny token. */
-  private static final String denyToken = "DEAD_AUTHORITY";
+  private static final String denyToken = GLOBAL_DENY_TOKEN;
 
   protected class GetSessionThread extends Thread
   {

Modified: manifoldcf/trunk/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java (original)
+++ manifoldcf/trunk/connectors/dropbox/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/dropbox/DropboxRepositoryConnector.java Wed Jul 10 01:50:34 2013
@@ -791,9 +791,10 @@ public class DropboxRepositoryConnector 
     public void run() {
       try {
         session.getSeeds(seedBuffer,path,25000); //upper limit on files to get supported by dropbox api in a single directory
-        seedBuffer.signalDone();
       } catch (Throwable e) {
         this.exception = e;
+      } finally {
+        seedBuffer.signalDone();
       }
     }
 

Modified: manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java (original)
+++ manifoldcf/trunk/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java Wed Jul 10 01:50:34 2013
@@ -104,7 +104,7 @@ public class FilenetConnector extends or
   protected String docURIPrefix = null;
 
   /** Deny access token for default authority */
-  private final static String defaultAuthorityDenyToken = "DEAD_AUTHORITY";
+  private final static String defaultAuthorityDenyToken = GLOBAL_DENY_TOKEN;
 
   protected class GetSessionThread extends Thread
   {

Modified: manifoldcf/trunk/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java (original)
+++ manifoldcf/trunk/connectors/googledrive/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/googledrive/GoogleDriveRepositoryConnector.java Wed Jul 10 01:50:34 2013
@@ -845,9 +845,10 @@ public class GoogleDriveRepositoryConnec
     public void run() {
       try {
         session.getSeeds(seedBuffer, googleDriveQuery);
-        seedBuffer.signalDone();
       } catch (Throwable e) {
         this.exception = e;
+      } finally {
+        seedBuffer.signalDone();
       }
     }
 
@@ -1241,9 +1242,10 @@ public class GoogleDriveRepositoryConnec
     public void run() {
       try {
         session.getChildren(childBuffer, nodeId);
-        childBuffer.signalDone();
       } catch (Throwable e) {
         this.exception = e;
+      } finally {
+        childBuffer.signalDone();
       }
     }
 

Modified: manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java (original)
+++ manifoldcf/trunk/connectors/jcifs/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharedrive/SharedDriveConnector.java Wed Jul 10 01:50:34 2013
@@ -121,7 +121,7 @@ public class SharedDriveConnector extend
   private NtlmPasswordAuthentication pa;
 
   /** Deny access token for default authority */
-  private final static String defaultAuthorityDenyToken = "DEAD_AUTHORITY";
+  private final static String defaultAuthorityDenyToken = GLOBAL_DENY_TOKEN;
 
   /** Constructor.
   */

Modified: manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jdbc/JDBCAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jdbc/JDBCAuthority.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jdbc/JDBCAuthority.java (original)
+++ manifoldcf/trunk/connectors/jdbc/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/jdbc/JDBCAuthority.java Wed Jul 10 01:50:34 2013
@@ -58,11 +58,6 @@ import org.apache.manifoldcf.crawler.sys
 public class JDBCAuthority extends BaseAuthorityConnector {
 
   public static final String _rcsid = "@(#)$Id: JDBCAuthority.java $";
-  private static final String globalDenyToken = "DEAD_AUTHORITY";
-  private static final AuthorizationResponse unreachableResponse = new AuthorizationResponse(new String[]{globalDenyToken},
-    AuthorizationResponse.RESPONSE_UNREACHABLE);
-  private static final AuthorizationResponse userNotFoundResponse = new AuthorizationResponse(new String[]{globalDenyToken},
-    AuthorizationResponse.RESPONSE_USERNOTFOUND);
   protected WrappedConnection connection = null;
   protected String jdbcProvider = null;
   protected String host = null;
@@ -224,16 +219,16 @@ public class JDBCAuthority extends BaseA
       loadPS(ps, paramList);
       ResultSet rs = ps.executeQuery();
       if (rs == null) {
-        return unreachableResponse;
+        return RESPONSE_UNREACHABLE;
       }
       String uid;
       if (rs.next()) {
         uid = rs.getString(1);
       } else {
-        return userNotFoundResponse;
+        return RESPONSE_USERNOTFOUND;
       }
       if (uid == null || uid.isEmpty()) {
-        return unreachableResponse;
+        return RESPONSE_UNREACHABLE;
       }
 
       // now check tokens
@@ -247,7 +242,7 @@ public class JDBCAuthority extends BaseA
       loadPS(ps, paramList);
       rs = ps.executeQuery();
       if (rs == null) {
-        return unreachableResponse;
+        return RESPONSE_UNREACHABLE;
       }
       ArrayList<String> tokenArray = new ArrayList<String>();
       while (rs.next()) {
@@ -268,7 +263,7 @@ public class JDBCAuthority extends BaseA
 
     } catch (Exception e) {
       // Unreachable
-      return unreachableResponse;
+      return RESPONSE_UNREACHABLE;
     }
   }
 

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraIssue.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraIssue.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraIssue.java (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraIssue.java Wed Jul 10 01:50:34 2013
@@ -49,54 +49,54 @@ public class JiraIssue extends JiraJSONR
   }
 
   public String getKey() {
-    Object key = object.get(KEY_KEY);
+    Object key = ((JSONObject)object).get(KEY_KEY);
     if (key == null)
       return null;
     return key.toString();
   }
   
   public String getSelf() {
-    Object key = object.get(KEY_SELF);
+    Object key = ((JSONObject)object).get(KEY_SELF);
     if (key == null)
       return null;
     return key.toString();
   }
   
   public Date getCreatedDate() {
-    JSONObject fields = (JSONObject)object.get(KEY_FIELDS);
+    JSONObject fields = (JSONObject)((JSONObject)object).get(KEY_FIELDS);
     if (fields == null)
       return null;
-    JSONObject createdDate = (JSONObject)fields.get(KEY_CREATED);
+    Object createdDate = fields.get(KEY_CREATED);
     if (createdDate == null)
       return null;
     return DateParser.parseISO8601Date(createdDate.toString());
   }
   
   public Date getUpdatedDate() {
-    JSONObject fields = (JSONObject)object.get(KEY_FIELDS);
+    JSONObject fields = (JSONObject)((JSONObject)object).get(KEY_FIELDS);
     if (fields == null)
       return null;
-    JSONObject updatedDate = (JSONObject)fields.get(KEY_UPDATED);
+    Object updatedDate = fields.get(KEY_UPDATED);
     if (updatedDate == null)
       return null;
     return DateParser.parseISO8601Date(updatedDate.toString());
   }
   
   public String getDescription() {
-    JSONObject fields = (JSONObject)object.get(KEY_FIELDS);
+    JSONObject fields = (JSONObject)((JSONObject)object).get(KEY_FIELDS);
     if (fields == null)
       return null;
-    JSONObject description = (JSONObject)fields.get(KEY_DESCRIPTION);
+    Object description = fields.get(KEY_DESCRIPTION);
     if (description == null)
       return null;
     return description.toString();
   }
   
   public String getSummary() {
-    JSONObject fields = (JSONObject)object.get(KEY_FIELDS);
+    JSONObject fields = (JSONObject)((JSONObject)object).get(KEY_FIELDS);
     if (fields == null)
       return null;
-    JSONObject summary = (JSONObject)fields.get(KEY_DESCRIPTION);
+    Object summary = fields.get(KEY_SUMMARY);
     if (summary == null)
       return null;
     return summary.toString();
@@ -104,7 +104,7 @@ public class JiraIssue extends JiraJSONR
   
   public Map<String,String[]> getMetadata() {
     Map<String,List<String>> map = new HashMap<String,List<String>>();
-    JSONObject fields = (JSONObject)object.get(KEY_FIELDS);
+    JSONObject fields = (JSONObject)((JSONObject)object).get(KEY_FIELDS);
     if (fields != null)
       addMetadataToMap("", fields, map);
     

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraJSONResponse.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraJSONResponse.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraJSONResponse.java (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraJSONResponse.java Wed Jul 10 01:50:34 2013
@@ -32,14 +32,14 @@ import org.json.simple.JSONObject;
 */
 public class JiraJSONResponse {
 
-  protected JSONObject object = null;
+  protected Object object = null;
 
   public JiraJSONResponse() {
   }
   
   /** Receive a parsed JSON object.
   */
-  public void acceptJSONObject(JSONObject object) {
+  public void acceptJSONObject(Object object) {
     this.object = object;
   }
   

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraQueryResults.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraQueryResults.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraQueryResults.java (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraQueryResults.java Wed Jul 10 01:50:34 2013
@@ -34,23 +34,23 @@ public class JiraQueryResults extends Ji
   // Specific keys we care about
   private final static String KEY_TOTAL = "total";
   private final static String KEY_ISSUES = "issues";
-  private final static String KEY_ID = "id";
+  private final static String KEY_KEY = "key";
 
   public JiraQueryResults() {
     super();
   }
 
   public Long getTotal() {
-    return (Long)object.get(KEY_TOTAL);
+    return (Long)((JSONObject)object).get(KEY_TOTAL);
   }
   
   public void pushIds(XThreadStringBuffer seedBuffer)
     throws IOException, InterruptedException {
-    JSONArray issues = (JSONArray)object.get(KEY_ISSUES);
+    JSONArray issues = (JSONArray)((JSONObject)object).get(KEY_ISSUES);
     for (Object issue : issues) {
       if (issue instanceof JSONObject) {
         JSONObject jo = (JSONObject)issue;
-        seedBuffer.add(jo.get(KEY_ID).toString());
+        seedBuffer.add(jo.get(KEY_KEY).toString());
       }
     }
   }

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraRepositoryConnector.java Wed Jul 10 01:50:34 2013
@@ -64,6 +64,8 @@ public class JiraRepositoryConnector ext
   // Nodes
   private static final String JOB_STARTPOINT_NODE_TYPE = "startpoint";
   private static final String JOB_QUERY_ATTRIBUTE = "query";
+  private static final String JOB_SECURITY_NODE_TYPE = "security";
+  private static final String JOB_VALUE_ATTRIBUTE = "value";
   private static final String JOB_ACCESS_NODE_TYPE = "access";
   private static final String JOB_TOKEN_ATTRIBUTE = "token";
 
@@ -480,6 +482,7 @@ public class JiraRepositoryConnector ext
    */
   private static void fillInJIRASecuritySpecificationMap(Map<String, Object> newMap, DocumentSpecification ds) {
     List<Map<String,String>> accessTokenList = new ArrayList<Map<String,String>>();
+    String securityValue = "on";
     for (int i = 0; i < ds.getChildCount(); i++) {
       SpecificationNode sn = ds.getChild(i);
       if (sn.getType().equals(JOB_ACCESS_NODE_TYPE)) {
@@ -487,9 +490,12 @@ public class JiraRepositoryConnector ext
         Map<String,String> accessMap = new HashMap<String,String>();
         accessMap.put("TOKEN",token);
         accessTokenList.add(accessMap);
+      } else if (sn.getType().equals(JOB_SECURITY_NODE_TYPE)) {
+        securityValue = sn.getAttributeValue(JOB_VALUE_ATTRIBUTE);
       }
     }
     newMap.put("ACCESSTOKENS", accessTokenList);
+    newMap.put("SECURITYON", securityValue);
   }
 
   /**
@@ -549,6 +555,22 @@ public class JiraRepositoryConnector ext
       ds.addChild(ds.getChildCount(), node);
     }
     
+    String securityOn = variableContext.getParameter("specsecurity");
+    if (securityOn != null) {
+      // Delete all security records first
+      int i = 0;
+      while (i < ds.getChildCount()) {
+        SpecificationNode sn = ds.getChild(i);
+        if (sn.getType().equals(JOB_SECURITY_NODE_TYPE))
+          ds.removeChild(i);
+        else
+          i++;
+      }
+      SpecificationNode node = new SpecificationNode(JOB_SECURITY_NODE_TYPE);
+      node.setAttribute(JOB_VALUE_ATTRIBUTE,securityOn);
+      ds.addChild(ds.getChildCount(),node);
+    }
+    
     String xc = variableContext.getParameter("tokencount");
     if (xc != null) {
       // Delete all tokens first
@@ -711,11 +733,11 @@ public class JiraRepositoryConnector ext
         // Pick up the paths, and add them to the activities, before we join with the child thread.
         while (true) {
           // The only kind of exceptions this can throw are going to shut the process down.
-          String issueID = seedBuffer.fetch();
-          if (issueID ==  null)
+          String issueKey = seedBuffer.fetch();
+          if (issueKey ==  null)
             break;
           // Add the pageID to the queue
-          activities.addSeedDocument("I"+issueID);
+          activities.addSeedDocument("I-"+issueKey);
         }
       } catch (InterruptedException e) {
         wasInterrupted = true;
@@ -773,14 +795,14 @@ public class JiraRepositoryConnector ext
     Logging.connectors.debug("JIRA: Inside processDocuments");
 
     for (int i = 0; i < documentIdentifiers.length; i++) {
-      // MHL for access tokens
+      String nodeId = documentIdentifiers[i];
+      String version = versions[i];
+      
       long startTime = System.currentTimeMillis();
       String errorCode = "FAILED";
       String errorDesc = StringUtils.EMPTY;
       Long fileSize = null;
       boolean doLog = false;
-      String nodeId = documentIdentifiers[i];
-      String version = versions[i];
       
       try {
         if (Logging.connectors.isDebugEnabled()) {
@@ -791,13 +813,17 @@ public class JiraRepositoryConnector ext
         if (!scanOnly[i]) {
           doLog = true;
 
-          if (nodeId.startsWith("I")) {
+          if (nodeId.startsWith("I-")) {
             // It's an issue
-            String issueID = nodeId.substring(1);
-            JiraIssue jiraFile = getIssue(issueID);
+            String issueKey = nodeId.substring(2);
+            JiraIssue jiraFile = getIssue(issueKey);
+            if (jiraFile == null) {
+              activities.deleteDocument(nodeId, version);
+              continue;
+            }
             
             if (Logging.connectors.isDebugEnabled()) {
-              Logging.connectors.debug("JIRA: have this file:\t" + jiraFile.getKey());
+              Logging.connectors.debug("JIRA: This issue exists: " + jiraFile.getKey());
             }
 
             // Unpack the version string
@@ -851,6 +877,7 @@ public class JiraRepositoryConnector ext
                 activities.ingestDocument(nodeId, version, documentURI, rd);
                 // No errors.  Record the fact that we made it.
                 errorCode = "OK";
+                fileSize = new Long(documentBytes.length);
               } finally {
                 is.close();
               }
@@ -878,7 +905,7 @@ public class JiraRepositoryConnector ext
         body.append(" : ");
       body.append(description);
     }
-    return description.toString();
+    return body.toString();
   }
 
   /**
@@ -905,23 +932,33 @@ public class JiraRepositoryConnector ext
 
     // Forced acls
     String[] acls = getAcls(spec);
-    // Sort it,
-    java.util.Arrays.sort(acls);
+    if (acls != null)
+      java.util.Arrays.sort(acls);
 
     String[] rval = new String[documentIdentifiers.length];
     for (int i = 0; i < rval.length; i++) {
       String nodeId = documentIdentifiers[i];
-      if (nodeId.startsWith("I")) {
+      if (nodeId.startsWith("I-")) {
         // It is an issue
-        String issueID = nodeId.substring(1);
+        String issueID = nodeId.substring(2);
         JiraIssue jiraFile = getIssue(issueID);
         Date rev = jiraFile.getUpdatedDate();
         if (rev != null) {
           StringBuilder sb = new StringBuilder();
 
+          String[] aclsToUse;
+          if (acls == null) {
+            // Get acls from issue
+            List<String> users = getUsers(issueID);
+            aclsToUse = (String[])users.toArray(new String[0]);
+            java.util.Arrays.sort(aclsToUse);
+          } else {
+            aclsToUse = acls;
+          }
+          
           // Acls
-          packList(sb,acls,'+');
-          if (acls.length > 0) {
+          packList(sb,aclsToUse,'+');
+          if (aclsToUse.length > 0) {
             sb.append('+');
             pack(sb,defaultAuthorityDenyToken,'+');
           } else
@@ -940,7 +977,7 @@ public class JiraRepositoryConnector ext
 
   /** Grab forced acl out of document specification.
   *@param spec is the document specification.
-  *@return the acls.
+  *@return the acls, or null if security is on (and the acls need to be fetched)
   */
   protected static String[] getAcls(DocumentSpecification spec) {
     Set<String> map = new HashSet<String>();
@@ -950,6 +987,11 @@ public class JiraRepositoryConnector ext
         String token = sn.getAttributeValue(JOB_TOKEN_ATTRIBUTE);
         map.add(token);
       }
+      else if (sn.getType().equals(JOB_SECURITY_NODE_TYPE)) {
+        String onOff = sn.getAttributeValue(JOB_VALUE_ATTRIBUTE);
+        if (onOff != null && onOff.equals("on"))
+          return null;
+      }
     }
 
     String[] rval = new String[map.size()];
@@ -975,6 +1017,70 @@ public class JiraRepositoryConnector ext
   
   // Background threads
 
+  protected static class GetUsersThread extends Thread {
+
+    protected final JiraSession session;
+    protected final String issueKey;
+    protected Throwable exception = null;
+    protected List<String> result = null;
+
+    public GetUsersThread(JiraSession session, String issueKey) {
+      super();
+      this.session = session;
+      this.issueKey = issueKey;
+      setDaemon(true);
+    }
+
+    public void run() {
+      try {
+        result = session.getUsers(issueKey);
+      } catch (Throwable e) {
+        this.exception = e;
+      }
+    }
+
+    public void finishUp()
+      throws InterruptedException, IOException {
+      join();
+      Throwable thr = exception;
+      if (thr != null) {
+        if (thr instanceof IOException) {
+          throw (IOException) thr;
+        } else if (thr instanceof RuntimeException) {
+          throw (RuntimeException) thr;
+        } else {
+          throw (Error) thr;
+        }
+      }
+    }
+    
+    public List<String> getResult() {
+      return result;
+    }
+
+  }
+
+  protected List<String> getUsers(String issueKey) throws ManifoldCFException, ServiceInterruption {
+    GetUsersThread t = new GetUsersThread(getSession(), issueKey);
+    try {
+      t.start();
+      t.finishUp();
+      return t.getResult();
+    } catch (InterruptedException e) {
+      t.interrupt();
+      throw new ManifoldCFException("Interrupted: " + e.getMessage(), e,
+        ManifoldCFException.INTERRUPTED);
+    } catch (java.net.SocketTimeoutException e) {
+      handleIOException(e);
+    } catch (InterruptedIOException e) {
+      t.interrupt();
+      handleIOException(e);
+    } catch (IOException e) {
+      handleIOException(e);
+    }
+    return null;
+  }
+
   protected static class CheckConnectionThread extends Thread {
 
     protected final JiraSession session;
@@ -1049,9 +1155,10 @@ public class JiraRepositoryConnector ext
     public void run() {
       try {
         session.getSeeds(seedBuffer, jiraDriveQuery);
-        seedBuffer.signalDone();
       } catch (Throwable e) {
         this.exception = e;
+      } finally {
+        seedBuffer.signalDone();
       }
     }
 

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/jira/JiraSession.java Wed Jul 10 01:50:34 2013
@@ -35,6 +35,8 @@ import java.net.URLEncoder;
 
 import java.util.Map;
 import java.util.HashMap;
+import java.util.List;
+import java.util.ArrayList;
 
 import org.apache.http.conn.ClientConnectionManager;
 import org.apache.http.client.HttpClient;
@@ -141,7 +143,7 @@ public class JiraSession {
     connectionManager = null;
   }
 
-  private static JSONObject convertToJSON(HttpResponse httpResponse)
+  private static Object convertToJSON(HttpResponse httpResponse)
     throws IOException {
     HttpEntity entity = httpResponse.getEntity();
     if (entity != null) {
@@ -151,7 +153,7 @@ public class JiraSession {
         if (charSet == null)
           charSet = "utf-8";
         Reader r = new InputStreamReader(is,charSet);
-        return (JSONObject)JSONValue.parse(r);
+        return JSONValue.parse(r);
       } finally {
         is.close();
       }
@@ -199,7 +201,7 @@ public class JiraSession {
       int resultCode = httpResponse.getStatusLine().getStatusCode();
       if (resultCode != 200)
         throw new IOException("Unexpected result code "+resultCode+": "+convertToString(httpResponse));
-      JSONObject jo = convertToJSON(httpResponse);
+      Object jo = convertToJSON(httpResponse);
       response.acceptJSONObject(jo);
     } finally {
       method.abort();
@@ -238,11 +240,30 @@ public class JiraSession {
   }
 
   /**
+  * Get the list of users that can see the specified issue.
+  */
+  public List<String> getUsers(String issueKey)
+    throws IOException {
+    List<String> rval = new ArrayList<String>();
+    long startAt = 0L;
+    long setSize = 100L;
+    while (true) {
+      JiraUserQueryResults qr = new JiraUserQueryResults();
+      getRest("user/viewissue/search?username=&issueKey="+URLEncoder.encode(issueKey,"utf-8")+"&maxResults=" + setSize + "&startAt=" + startAt, qr);
+      qr.getNames(rval);
+      startAt += setSize;
+      if (rval.size() < startAt)
+        break;
+    }
+    return rval;
+  }
+
+  /**
    * Get an individual issue.
    */
-  public JiraIssue getIssue(String id) throws IOException {
+  public JiraIssue getIssue(String issueKey) throws IOException {
     JiraIssue ji = new JiraIssue();
-    getRest("issue/" + id, ji);
+    getRest("issue/" + URLEncoder.encode(issueKey,"utf-8"), ji);
     return ji;
   }
 

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jira/common_en_US.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jira/common_en_US.properties?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jira/common_en_US.properties (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jira/common_en_US.properties Wed Jul 10 01:50:34 2013
@@ -32,6 +32,10 @@ JiraRepositoryConnector.JiraPathMustBegi
 JiraRepositoryConnector.JiraQueryColon=JIRA query:
 JiraRepositoryConnector.SeedQueryCannotBeNull=Seed query cannot be null
 
+JiraRepositoryConnector.SecurityColon=Security:
+JiraRepositoryConnector.Enabled=Enabled
+JiraRepositoryConnector.Disabled=Disabled
+
 JiraRepositoryConnector.NoAccessTokensPresent=No access tokens present
 JiraRepositoryConnector.Add=Add
 JiraRepositoryConnector.AddAccessToken=Add access token

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jira/common_ja_JP.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jira/common_ja_JP.properties?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jira/common_ja_JP.properties (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/jira/common_ja_JP.properties Wed Jul 10 01:50:34 2013
@@ -32,6 +32,10 @@ JiraRepositoryConnector.JiraPathMustBegi
 JiraRepositoryConnector.JiraQueryColon=JIRA query:
 JiraRepositoryConnector.SeedQueryCannotBeNull=Seed query cannot be null
 
+JiraRepositoryConnector.SecurityColon=Security:
+JiraRepositoryConnector.Enabled=Enabled
+JiraRepositoryConnector.Disabled=Disabled
+
 JiraRepositoryConnector.NoAccessTokensPresent=No access tokens present
 JiraRepositoryConnector.Add=Add
 JiraRepositoryConnector.AddAccessToken=Add access token

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/editSpecification_jiraSecurity.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/editSpecification_jiraSecurity.html?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/editSpecification_jiraSecurity.html (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/editSpecification_jiraSecurity.html Wed Jul 10 01:50:34 2013
@@ -20,6 +20,26 @@
 <table class="displaytable">
   <tr><td class="separator" colspan="2"><hr/></td></tr>
   
+  <tr>
+    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('JiraRepositoryConnector.SecurityColon'))</nobr></td>
+    <td class="value">
+  #if($SECURITYON == 'on')
+      <input type="radio" name="specsecurity" value="on" checked="true"/>
+  #else
+      <input type="radio" name="specsecurity" value="on"/>
+  #end
+      $Encoder.bodyEscape($ResourceBundle.getString('JiraRepositoryConnector.Enabled'))
+  #if($SECURITYON == 'off')
+      <input type="radio" name="specsecurity" value="off" checked="true"/>
+  #else
+      <input type="radio" name="specsecurity" value="off"/>
+  #end
+      $Encoder.bodyEscape($ResourceBundle.getString('JiraRepositoryConnector.Disabled'))
+    </td>
+  </tr>
+  
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
+
   #set($atcounter = 0)
   #foreach($atoken in $ACCESSTOKENS)
 
@@ -63,6 +83,8 @@
 
 #else
 
+<input type="hidden" name="specsecurity" value="$SECURITYON"/>
+
   #set($atcounter = 0)
   #foreach($atoken in $ACCESSTOKENS)
 <input type="hidden" name="spectoken_$atcounter" value="$Encoder.attributeEscape($atoken.get('TOKEN'))"/>

Modified: manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/viewSpecification_jira.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/viewSpecification_jira.html?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/viewSpecification_jira.html (original)
+++ manifoldcf/trunk/connectors/jira/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/jira/viewSpecification_jira.html Wed Jul 10 01:50:34 2013
@@ -26,6 +26,19 @@
   </tr>
   <tr><td class="separator" colspan="2"><hr/></td></tr>
   <tr>
+    <td class="description">
+      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('JiraRepositoryConnector.SecurityColon'))</nobr>
+    </td>
+    <td class="value">
+#if($SECURITYON == 'on')
+      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('JiraRepositoryConnector.Enabled'))</nobr>
+#else
+      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('JiraRepositoryConnector.Disabled'))</nobr>
+#end
+    </td>
+  </tr>
+  <tr><td class="separator" colspan="2"><hr/></td></tr>
+  <tr>
 #if($ACCESSTOKENS.size() == 0)
     <td class="message" colspan="2">
       $Encoder.bodyEscape($ResourceBundle.getString('JiraRepositoryConnector.NoAccessTokensPresent'))

Modified: manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java (original)
+++ manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java Wed Jul 10 01:50:34 2013
@@ -44,15 +44,6 @@ public class LDAPAuthority extends org.a
    */
   private LdapContext session = null;
   private long sessionExpirationTime = -1L;
-  /**
-   * This is the active directory global deny token. This should be ingested
-   * with all documents.
-   */
-  private static final String globalDenyToken = "DEAD_AUTHORITY";
-  private static final AuthorizationResponse unreachableResponse = new AuthorizationResponse(new String[]{globalDenyToken},
-    AuthorizationResponse.RESPONSE_UNREACHABLE);
-  private static final AuthorizationResponse userNotFoundResponse = new AuthorizationResponse(new String[]{globalDenyToken},
-    AuthorizationResponse.RESPONSE_USERNOTFOUND);
   private ConfigParams parameters;
   private String serverName;
   private String serverPort;
@@ -317,7 +308,7 @@ public class LDAPAuthority extends org.a
       //find user in LDAP tree
       SearchResult usrRecord = getUserEntry(session, userName);
       if (usrRecord == null) {
-        return userNotFoundResponse;
+        return RESPONSE_USERNOTFOUND;
       }
 
       ArrayList theGroups = new ArrayList();
@@ -371,10 +362,10 @@ public class LDAPAuthority extends org.a
 
     } catch (NameNotFoundException e) {
       // This means that the user doesn't exist
-      return userNotFoundResponse;
+      return RESPONSE_USERNOTFOUND;
     } catch (NamingException e) {
       // Unreachable
-      return unreachableResponse;
+      return RESPONSE_UNREACHABLE;
     }
   }
 
@@ -388,7 +379,7 @@ public class LDAPAuthority extends org.a
   @Override
   public AuthorizationResponse getDefaultAuthorizationResponse(String userName) {
     // The default response if the getConnection method fails
-    return unreachableResponse;
+    return RESPONSE_UNREACHABLE;
   }
 
   // UI support methods.

Modified: manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java (original)
+++ manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkAuthority.java Wed Jul 10 01:50:34 2013
@@ -89,11 +89,6 @@ public class LivelinkAuthority extends o
   // Livelink does not have "deny" permissions, and there is no such thing as a document with no tokens, so it is safe to not have a local "deny" token.
   // However, people feel that a suspenders-and-belt approach is called for, so this restriction has been added.
   // Livelink tokens are numbers, "SYSTEM", or "GUEST", so they can't collide with the standard form.
-  private static final String denyToken = "DEAD_AUTHORITY";
-  private static final AuthorizationResponse unreachableResponse = new AuthorizationResponse(new String[]{denyToken},
-    AuthorizationResponse.RESPONSE_UNREACHABLE);
-  private static final AuthorizationResponse userNotFoundResponse = new AuthorizationResponse(new String[]{denyToken},
-    AuthorizationResponse.RESPONSE_USERNOTFOUND);
 
   /** Constructor.
   */
@@ -446,14 +441,14 @@ public class LivelinkAuthority extends o
           {
             if (Logging.authorityConnectors.isDebugEnabled())
               Logging.authorityConnectors.debug("Livelink: Livelink user '"+domainAndUser+"' does not exist");
-            return userNotFoundResponse;
+            return RESPONSE_USERNOTFOUND;
           }
 
           if (status != 0)
           {
             Logging.authorityConnectors.warn("Livelink: User '"+domainAndUser+"' GetUserInfo error # "+Integer.toString(status)+" "+llServer.getErrors());
             // The server is probably down.
-            return unreachableResponse;
+            return RESPONSE_UNREACHABLE;
           }
 
           int deleted = userObject.toInteger("Deleted");
@@ -462,7 +457,7 @@ public class LivelinkAuthority extends o
             if (Logging.authorityConnectors.isDebugEnabled())
               Logging.authorityConnectors.debug("Livelink: Livelink user '"+domainAndUser+"' has been deleted");
             // Since the user cannot become undeleted, then this should be treated as 'user does not exist'.
-            return userNotFoundResponse;
+            return RESPONSE_USERNOTFOUND;
           }
           int privs = userObject.toInteger("UserPrivileges");
           if ((privs & LAPI_USERS.PRIV_PERM_WORLD) == LAPI_USERS.PRIV_PERM_WORLD)
@@ -476,7 +471,7 @@ public class LivelinkAuthority extends o
           {
             if (Logging.authorityConnectors.isDebugEnabled())
               Logging.authorityConnectors.debug("Livelink: Livelink error looking up user rights for '"+domainAndUser+"' - user does not exist");
-            return userNotFoundResponse;
+            return RESPONSE_USERNOTFOUND;
           }
 
           if (status != 0)
@@ -485,7 +480,7 @@ public class LivelinkAuthority extends o
             // right error code, so just stuff it in the log.
             Logging.authorityConnectors.warn("Livelink: For user '"+domainAndUser+"', ListRights error # "+Integer.toString(status)+" "+llServer.getErrors());
             // An error code at this level has to indicate a suddenly unreachable authority
-            return unreachableResponse;
+            return RESPONSE_UNREACHABLE;
           }
 
           // Go through the individual objects, and get their IDs.  These id's will be the access tokens
@@ -549,7 +544,7 @@ public class LivelinkAuthority extends o
     catch (ServiceInterruption e)
     {
       Logging.authorityConnectors.warn("Livelink: Server seems to be down: "+e.getMessage(),e);
-      return unreachableResponse;
+      return RESPONSE_UNREACHABLE;
     }
   }
 
@@ -561,7 +556,7 @@ public class LivelinkAuthority extends o
   public AuthorizationResponse getDefaultAuthorizationResponse(String userName)
   {
     // The default response if the getConnection method fails
-    return unreachableResponse;
+    return RESPONSE_UNREACHABLE;
   }
 
   // UI support methods.

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=1501633&r1=1501632&r2=1501633&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 Jul 10 01:50:34 2013
@@ -95,7 +95,7 @@ public class LivelinkConnector extends o
   private final static String ACTIVITY_FETCH = "fetch document";
 
   /** Deny access token for default authority */
-  private final static String defaultAuthorityDenyToken = "DEAD_AUTHORITY";
+  private final static String defaultAuthorityDenyToken = GLOBAL_DENY_TOKEN;
 
   // Livelink does not have "deny" permissions, and there is no such thing as a document with no tokens, so it is safe to not have a local "deny" token.
   // However, people feel that a suspenders-and-belt approach is called for, so this restriction has been added.

Modified: manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java (original)
+++ manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java Wed Jul 10 01:50:34 2013
@@ -73,15 +73,6 @@ public class MeridioAuthority extends or
   
   final private static int MANAGE_DOCUMENT_PRIVILEGE = 17;
 
-  /** Deny access token for Meridio.  All tokens begin with "U" or with "G", except the blanket "READ_ALL" that I create.
-  * However, we currently have code in the field, so I will continue ot use "DEAD_AUTHORITY" for that reason.
-  */
-  private final static String denyToken = "DEAD_AUTHORITY";
-
-  private final static AuthorizationResponse unreachableResponse = new AuthorizationResponse(new String[]{denyToken},AuthorizationResponse.RESPONSE_UNREACHABLE);
-  private final static AuthorizationResponse userNotFoundResponse = new AuthorizationResponse(new String[]{denyToken},AuthorizationResponse.RESPONSE_USERNOTFOUND);
-
-
   /** Constructor.
   */
   public MeridioAuthority() {}
@@ -551,7 +542,7 @@ public class MeridioAuthority extends or
         {
           if (Logging.authorityConnectors.isDebugEnabled())
             Logging.authorityConnectors.debug("Meridio: User '" + userName + "' does not exist");
-          return userNotFoundResponse;
+          return RESPONSE_USERNOTFOUND;
         }
         if (Logging.authorityConnectors.isDebugEnabled())
           Logging.authorityConnectors.debug("Meridio: Found user - the User Id for '" + userName +
@@ -677,7 +668,7 @@ public class MeridioAuthority extends or
   @Override
   public AuthorizationResponse getDefaultAuthorizationResponse(String userName)
   {
-    return unreachableResponse;
+    return RESPONSE_UNREACHABLE;
   }
   
   // UI support methods.

Modified: manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java (original)
+++ manifoldcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java Wed Jul 10 01:50:34 2013
@@ -71,7 +71,7 @@ public class MeridioConnector extends or
   protected String urlVersionBase = null;
 
   /** Deny access token for Meridio */
-  private final static String denyToken = "DEAD_AUTHORITY";
+  private final static String denyToken = GLOBAL_DENY_TOKEN;
 
   /** Deny access token for Active Directory, which is what we expect to be in place for forced acls */
   private final static String defaultAuthorityDenyToken = "DEAD_AUTHORITY";

Propchange: manifoldcf/trunk/connectors/sharepoint/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-731/connectors/sharepoint:r1499391-1501632

Modified: manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java (original)
+++ manifoldcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java Wed Jul 10 01:50:34 2013
@@ -126,7 +126,7 @@ public class SharePointRepository extend
   }
 
   /** Deny access token for default authority */
-  private final static String defaultAuthorityDenyToken = "DEAD_AUTHORITY";
+  private final static String defaultAuthorityDenyToken = GLOBAL_DENY_TOKEN;
 
   /** Constructor.
   */

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java Wed Jul 10 01:50:34 2013
@@ -34,6 +34,13 @@ public abstract class BaseAuthorityConne
 {
   public static final String _rcsid = "@(#)$Id: BaseAuthorityConnector.java 988245 2010-08-23 18:39:35Z kwright $";
 
+  protected static final AuthorizationResponse RESPONSE_UNREACHABLE = new AuthorizationResponse(new String[]{GLOBAL_DENY_TOKEN},
+    AuthorizationResponse.RESPONSE_UNREACHABLE);
+  protected static final AuthorizationResponse RESPONSE_USERNOTFOUND = new AuthorizationResponse(new String[]{GLOBAL_DENY_TOKEN},
+    AuthorizationResponse.RESPONSE_USERNOTFOUND);
+  protected static final AuthorizationResponse RESPONSE_USERUNAUTHORIZED = new AuthorizationResponse(new String[]{GLOBAL_DENY_TOKEN},
+    AuthorizationResponse.RESPONSE_USERUNAUTHORIZED);
+
   /** Obtain the access tokens for a given user name.
   *@param userName is the user name or identifier.
   *@return the response tokens (according to the current authority).

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java Wed Jul 10 01:50:34 2013
@@ -32,6 +32,9 @@ import java.io.*;
 public interface IAuthorityConnector extends IConnector
 {
 
+  /** This is the global deny token.  This should be ingested with all documents. */
+  public static final String GLOBAL_DENY_TOKEN = "DEAD_AUTHORITY";
+
   /** Obtain the access tokens for a given Active Directory user name.
   *@param userName is the user name or identifier.
   *@return the response tokens (according to the current authority).

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IRepositoryConnector.java?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IRepositoryConnector.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/interfaces/IRepositoryConnector.java Wed Jul 10 01:50:34 2013
@@ -104,6 +104,9 @@ public interface IRepositoryConnector ex
   public static final int JOBMODE_ONCEONLY = IJobDescription.TYPE_SPECIFIED;
   public static final int JOBMODE_CONTINUOUS = IJobDescription.TYPE_CONTINUOUS;
 
+  /** This is the global deny token.  This should be ingested with all documents. */
+  public static final String GLOBAL_DENY_TOKEN = "DEAD_AUTHORITY";
+
   /** Tell the world what model this connector uses for addSeedDocuments().
   * This must return a model value as specified above.  The connector does not have to be connected
   * for this method to be called.

Modified: manifoldcf/trunk/site/src/documentation/content/xdocs/en_US/end-user-documentation.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/site/src/documentation/content/xdocs/en_US/end-user-documentation.xml?rev=1501633&r1=1501632&r2=1501633&view=diff
==============================================================================
--- manifoldcf/trunk/site/src/documentation/content/xdocs/en_US/end-user-documentation.xml (original)
+++ manifoldcf/trunk/site/src/documentation/content/xdocs/en_US/end-user-documentation.xml Wed Jul 10 01:50:34 2013
@@ -1998,7 +1998,7 @@ curl -XGET http://localhost:9200/index/_
               <br/><br/>
               <p>This tab allows you to specify the query which will be used to find documents for the indexing process. The query language is
                 specified on the <a href="https://confluence.atlassian.com/display/JIRA/Advanced+Searching">Jira Advanced Searching</a> site. Directories
-                which meet the seed query are fully crawled as the query on applies to seeds.</p>
+                which meet the seed query are fully crawled as the query only applies to seeds.</p>
             </section>
 			
             <section id="livelinkrepository">



Mime
View raw message