manifoldcf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cihad Guzel (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CONNECTORS-1368) Date filtering doesn't work for email connector
Date Mon, 16 Jan 2017 11:07:26 GMT
Cihad Guzel created CONNECTORS-1368:
---------------------------------------

             Summary: Date filtering doesn't work for email connector
                 Key: CONNECTORS-1368
                 URL: https://issues.apache.org/jira/browse/CONNECTORS-1368
             Project: ManifoldCF
          Issue Type: Bug
          Components: Email connector
    Affects Versions: ManifoldCF 2.6
            Reporter: Cihad Guzel


The email connector uses the standard email java class to search. There are some filter fields
as "from, to, subject, body, date" but the date filter isn't working. The code line:

{code}
SearchTerm searchTerm = null;
    
    Iterator<Map.Entry<String,String>> it = findMap.entrySet().iterator();
    while (it.hasNext()) {
      Map.Entry<String,String> pair = it.next();
      findParameterName = pair.getKey().toLowerCase(Locale.ROOT);
      findParameterValue = pair.getValue();
      if (Logging.connectors.isDebugEnabled())
        Logging.connectors.debug("Email: Finding emails where '" + findParameterName +
            "' = '" + findParameterValue + "'");
      SearchTerm searchClause = null;
      if (findParameterName.equals(EmailConfig.EMAIL_SUBJECT)) {
        searchClause = new SubjectTerm(findParameterValue);
      } else if (findParameterName.equals(EmailConfig.EMAIL_FROM)) {
        searchClause = new FromStringTerm(findParameterValue);
      } else if (findParameterName.equals(EmailConfig.EMAIL_TO)) {
        searchClause = new RecipientStringTerm(Message.RecipientType.TO, findParameterValue);
      } else if (findParameterName.equals(EmailConfig.EMAIL_BODY)) {
        searchClause = new BodyTerm(findParameterValue);
      }
      
      if (searchClause != null)
      {
        if (searchTerm == null)
          searchTerm = searchClause;
        else
          searchTerm = new AndTerm(searchTerm, searchClause);
      }
      else
      {
        Logging.connectors.warn("Email: Unknown filter parameter name: '"+findParameterName+"'");
      }
    }
{code}

I think it should be filtered by date range.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message