Return-Path: X-Original-To: apmail-manifoldcf-commits-archive@www.apache.org Delivered-To: apmail-manifoldcf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B68B4100EE for ; Sat, 20 Dec 2014 21:09:06 +0000 (UTC) Received: (qmail 78571 invoked by uid 500); 20 Dec 2014 21:09:06 -0000 Delivered-To: apmail-manifoldcf-commits-archive@manifoldcf.apache.org Received: (qmail 78522 invoked by uid 500); 20 Dec 2014 21:09:06 -0000 Mailing-List: contact commits-help@manifoldcf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@manifoldcf.apache.org Delivered-To: mailing list commits@manifoldcf.apache.org Received: (qmail 78512 invoked by uid 99); 20 Dec 2014 21:09:06 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Dec 2014 21:09:06 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id B9C3EAC08A8; Sat, 20 Dec 2014 21:09:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1647052 - in /manifoldcf/branches/CONNECTORS-1119: connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/ connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/ framework/... Date: Sat, 20 Dec 2014 21:09:03 -0000 To: commits@manifoldcf.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20141220210905.B9C3EAC08A8@hades.apache.org> Author: kwright Date: Sat Dec 20 21:09:03 2014 New Revision: 1647052 URL: http://svn.apache.org/r1647052 Log: Start adding email notification connector Added: manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/ manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/ manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/EmailConfig.java (with props) manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/Messages.java (with props) Modified: manifoldcf/branches/CONNECTORS-1119/framework/buildfiles/connector-build.xml manifoldcf/branches/CONNECTORS-1119/framework/example-common/connectors.xml Added: manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/EmailConfig.java URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/EmailConfig.java?rev=1647052&view=auto ============================================================================== --- manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/EmailConfig.java (added) +++ manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/EmailConfig.java Sat Dec 20 21:09:03 2014 @@ -0,0 +1,110 @@ +/** +* 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. +*/ + +package org.apache.manifoldcf.crawler.notifications.email; + + +/** +* Parameters data for the Email notification connector. +*/ +public class EmailConfig { + + /** + * Username + */ + public static final String USERNAME_PARAM = "username"; + + /** + * Password + */ + public static final String PASSWORD_PARAM = "password"; + + /** + * Protocol + */ + public static final String PROTOCOL_PARAM = "protocol"; + + /** + * Server name + */ + public static final String SERVER_PARAM = "server"; + + /** + * Port + */ + public static final String PORT_PARAM = "port"; + + /** + * URL template + */ + public static final String URL_PARAM = "url"; + + // Protocol options + + public static final String PROTOCOL_IMAP = "IMAP"; + public static final String PROTOCOL_IMAPS = "IMAP-SSL"; + public static final String PROTOCOL_POP3 = "POP3"; + public static final String PROTOCOL_POP3S = "POP3-SSL"; + + // Protocol providers + + public static final String PROTOCOL_IMAP_PROVIDER = "imap"; + public static final String PROTOCOL_IMAPS_PROVIDER = "imaps"; + public static final String PROTOCOL_POP3_PROVIDER = "pop3"; + public static final String PROTOCOL_POP3S_PROVIDER = "pop3s"; + + // Default values and various other constants + + public static final String PROTOCOL_DEFAULT_VALUE = "IMAP"; + public static final String PORT_DEFAULT_VALUE = ""; + public static final String[] BASIC_METADATA = {"To","From","Subject","Body","Date","Encoding of Attachment","MIME type of attachment"}; + public static final String[] BASIC_SEARCHABLE_ATTRIBUTES = {"To","From","Subject","Body","Date"}; + + // Specification nodes + + public static final String NODE_PROPERTIES = "properties"; + public static final String NODE_METADATA = "metadata"; + public static final String NODE_FILTER = "filter"; + public static final String NODE_FOLDER = "folder"; + + public static final String ATTRIBUTE_NAME = "name"; + public static final String ATTRIBUTE_VALUE = "value"; + + // Metadata field names + + public static final String EMAIL_SUBJECT = "subject"; + public static final String EMAIL_FROM = "from"; + public static final String EMAIL_TO = "to"; + public static final String EMAIL_BODY = "body"; + public static final String EMAIL_DATE = "date"; + public static final String EMAIL_ATTACHMENT_ENCODING = "encoding of attachment"; + public static final String EMAIL_ATTACHMENT_MIMETYPE = "mime type of attachment"; + public static final String EMAIL_VERSION = "1.0"; + + // Mime types + + public static final String MIMETYPE_TEXT_PLAIN = "text/plain"; + public static final String MIMETYPE_HTML = "text/html"; + + // Fields + + public static final String ENCODING_FIELD = "encoding"; + public static final String MIMETYPE_FIELD = "mimetype"; + //public static final String TO = "To"; + + +} \ No newline at end of file Propchange: manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/EmailConfig.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/EmailConfig.java ------------------------------------------------------------------------------ svn:keywords = Id Added: manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/Messages.java URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/Messages.java?rev=1647052&view=auto ============================================================================== --- manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/Messages.java (added) +++ manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/Messages.java Sat Dec 20 21:09:03 2014 @@ -0,0 +1,141 @@ +/* $Id$ */ + +/** +* 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. +*/ +package org.apache.manifoldcf.crawler.notifications.email; + +import java.util.Locale; +import java.util.Map; +import org.apache.manifoldcf.core.interfaces.ManifoldCFException; +import org.apache.manifoldcf.core.interfaces.IHTTPOutput; + +public class Messages extends org.apache.manifoldcf.ui.i18n.Messages +{ + public static final String DEFAULT_BUNDLE_NAME="org.apache.manifoldcf.crawler.notifications.email.common"; + public static final String DEFAULT_PATH_NAME="org.apache.manifoldcf.crawler.notifications.email"; + + /** Constructor - do no instantiate + */ + protected Messages() + { + } + + public static String getString(Locale locale, String messageKey) + { + return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, null); + } + + public static String getAttributeString(Locale locale, String messageKey) + { + return getAttributeString(DEFAULT_BUNDLE_NAME, locale, messageKey, null); + } + + public static String getBodyString(Locale locale, String messageKey) + { + return getBodyString(DEFAULT_BUNDLE_NAME, locale, messageKey, null); + } + + public static String getAttributeJavascriptString(Locale locale, String messageKey) + { + return getAttributeJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, null); + } + + public static String getBodyJavascriptString(Locale locale, String messageKey) + { + return getBodyJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, null); + } + + public static String getString(Locale locale, String messageKey, Object[] args) + { + return getString(DEFAULT_BUNDLE_NAME, locale, messageKey, args); + } + + public static String getAttributeString(Locale locale, String messageKey, Object[] args) + { + return getAttributeString(DEFAULT_BUNDLE_NAME, locale, messageKey, args); + } + + public static String getBodyString(Locale locale, String messageKey, Object[] args) + { + return getBodyString(DEFAULT_BUNDLE_NAME, locale, messageKey, args); + } + + public static String getAttributeJavascriptString(Locale locale, String messageKey, Object[] args) + { + return getAttributeJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, args); + } + + public static String getBodyJavascriptString(Locale locale, String messageKey, Object[] args) + { + return getBodyJavascriptString(DEFAULT_BUNDLE_NAME, locale, messageKey, args); + } + + // More general methods which allow bundlenames and class loaders to be specified. + + public static String getString(String bundleName, Locale locale, String messageKey, Object[] args) + { + return getString(Messages.class, bundleName, locale, messageKey, args); + } + + public static String getAttributeString(String bundleName, Locale locale, String messageKey, Object[] args) + { + return getAttributeString(Messages.class, bundleName, locale, messageKey, args); + } + + public static String getBodyString(String bundleName, Locale locale, String messageKey, Object[] args) + { + return getBodyString(Messages.class, bundleName, locale, messageKey, args); + } + + public static String getAttributeJavascriptString(String bundleName, Locale locale, String messageKey, Object[] args) + { + return getAttributeJavascriptString(Messages.class, bundleName, locale, messageKey, args); + } + + public static String getBodyJavascriptString(String bundleName, Locale locale, String messageKey, Object[] args) + { + return getBodyJavascriptString(Messages.class, bundleName, locale, messageKey, args); + } + + // Resource output + + public static void outputResource(IHTTPOutput output, Locale locale, String resourceKey, + Map substitutionParameters, boolean mapToUpperCase) + throws ManifoldCFException + { + outputResource(output,Messages.class,DEFAULT_PATH_NAME,locale,resourceKey, + substitutionParameters,mapToUpperCase); + } + + public static void outputResourceWithVelocity(IHTTPOutput output, Locale locale, String resourceKey, + Map substitutionParameters, boolean mapToUpperCase) + throws ManifoldCFException + { + outputResourceWithVelocity(output,Messages.class,DEFAULT_BUNDLE_NAME,DEFAULT_PATH_NAME,locale,resourceKey, + substitutionParameters,mapToUpperCase); + } + + public static void outputResourceWithVelocity(IHTTPOutput output, Locale locale, String resourceKey, + Map contextObjects) + throws ManifoldCFException + { + outputResourceWithVelocity(output,Messages.class,DEFAULT_BUNDLE_NAME,DEFAULT_PATH_NAME,locale,resourceKey, + contextObjects); + } + +} + Propchange: manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/Messages.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: manifoldcf/branches/CONNECTORS-1119/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/notifications/email/Messages.java ------------------------------------------------------------------------------ svn:keywords = Id Modified: manifoldcf/branches/CONNECTORS-1119/framework/buildfiles/connector-build.xml URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1119/framework/buildfiles/connector-build.xml?rev=1647052&r1=1647051&r2=1647052&view=diff ============================================================================== --- manifoldcf/branches/CONNECTORS-1119/framework/buildfiles/connector-build.xml (original) +++ manifoldcf/branches/CONNECTORS-1119/framework/buildfiles/connector-build.xml Sat Dec 20 21:09:03 2014 @@ -885,6 +885,25 @@ + + + + + + + + + + + + + + + + + + + Modified: manifoldcf/branches/CONNECTORS-1119/framework/example-common/connectors.xml URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1119/framework/example-common/connectors.xml?rev=1647052&r1=1647051&r2=1647052&view=diff ============================================================================== --- manifoldcf/branches/CONNECTORS-1119/framework/example-common/connectors.xml (original) +++ manifoldcf/branches/CONNECTORS-1119/framework/example-common/connectors.xml Sat Dec 20 21:09:03 2014 @@ -36,5 +36,7 @@ - + + +