Modified: manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/Messages.java URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/Messages.java?rev=1542304&r1=1542303&r2=1542304&view=diff ============================================================================== --- manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/Messages.java (original) +++ manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/email/Messages.java Fri Nov 15 16:03:20 2013 @@ -1,147 +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. - */ +* 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.connectors.email; -import org.apache.manifoldcf.core.interfaces.IHTTPOutput; -import org.apache.manifoldcf.core.interfaces.ManifoldCFException; -import org.apache.manifoldcf.ui.util.Encoder; - -import java.util.HashMap; -import java.util.Iterator; 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.connectors.email.common"; - public static final String DEFAULT_PATH_NAME = "org.apache.manifoldcf.crawler.connectors.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<String, String> 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<String, String> 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<String, Object> contextObjects) - throws ManifoldCFException { - Map<String, Object> tmpContextObjects = null; - if (contextObjects != null) { - tmpContextObjects = new HashMap<String, Object>(); - Iterator<String> i = contextObjects.keySet().iterator(); - while (i.hasNext()) { - String key = i.next(); - Object value = contextObjects.get(key); - - key = key.toUpperCase(); - - if (value instanceof String) { - tmpContextObjects.put(key, value); - tmpContextObjects.put(key + "_A", Encoder.attributeEscape((String) value)); - tmpContextObjects.put(key + "_B", Encoder.bodyEscape((String) value)); - tmpContextObjects.put(key + "_AJ", Encoder.attributeJavascriptEscape((String) value)); - tmpContextObjects.put(key + "_BJ", Encoder.bodyJavascriptEscape((String) value)); - } else { - tmpContextObjects.put(key, value); - } - } - } - outputResourceWithVelocity(output, Messages.class, DEFAULT_BUNDLE_NAME, DEFAULT_PATH_NAME, locale, resourceKey, - tmpContextObjects); - } - +public class Messages extends org.apache.manifoldcf.ui.i18n.Messages +{ + public static final String DEFAULT_BUNDLE_NAME="org.apache.manifoldcf.crawler.connectors.email.common"; + public static final String DEFAULT_PATH_NAME="org.apache.manifoldcf.crawler.connectors.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<String,String> 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<String,String> 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<String,Object> contextObjects) + throws ManifoldCFException + { + outputResourceWithVelocity(output,Messages.class,DEFAULT_BUNDLE_NAME,DEFAULT_PATH_NAME,locale,resourceKey, + contextObjects); + } + }
Modified: manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/SpecificationHeader.js URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/SpecificationHeader.js?rev=1542304&r1=1542303&r2=1542304&view=diff ============================================================================== --- manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/SpecificationHeader.js (original) +++ manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/SpecificationHeader.js Fri Nov 15 16:03:20 2013 @@ -1,10 +1,10 @@ <!-- Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with + 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 + the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @@ -17,13 +17,14 @@ <script type="text/javascript"> <!-- + function checkSpecification() { if (checkDocumentsTab() == false) - return false; - if (checkMetadataTab() == false) - return false; - return true; + return false; + if (checkMetadataTab() == false) + return false; + return true; } function SpecOp(n, opValue, anchorvalue) @@ -51,17 +52,18 @@ function FindAdd(n) { if (editjob.findname.value == "") { - alert("Please select a metadata name first."); + alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('EmailConnector.PleaseSelectAMetadataName'))"); editjob.findname.focus(); return; } if (editjob.findvalue.value == "") { - alert("Metadata value cannot be blank."); + alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('EmailConnector.ValueCannotBeBlank'))"); editjob.findvalue.focus(); return; } SpecOp("findop", "Add", "find_"+n); } + //--> -</script> \ No newline at end of file +</script> Modified: manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/SpecificationView.html URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/SpecificationView.html?rev=1542304&r1=1542303&r2=1542304&view=diff ============================================================================== --- manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/SpecificationView.html (original) +++ manifoldcf/branches/CONNECTORS-553/connectors/email/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/email/SpecificationView.html Fri Nov 15 16:03:20 2013 @@ -1,28 +1,28 @@ <!-- - 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. +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. --> <table class="displaytable"> <tr> - <td class="description"><nobr>Matches:</nobr></td> + <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('EmailConnector.RecordFilterColon'))</nobr></td> <td class="boxcell"> <table class="formtable"> <tr class="formheaderrow"> - <td class="formcolumnheader"><nobr>Attribute name</nobr></td> - <td class="formcolumnheader"><nobr>Value</nobr></td> + <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('EmailConnector.MetadataName'))</nobr></td> + <td class="formcolumnheader"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('EmailConnector.Value'))</nobr></td> </tr> #set($k = 0) @@ -33,14 +33,10 @@ <tr class="oddformrow"> #end <td class="formcolumncell"> - <nobr> - $Encoder.bodyEscape($match.get('name')) - </nobr> + <nobr>$Encoder.bodyEscape($match.get('name'))</nobr> </td> <td class="formcolumncell"> - <nobr> - $Encoder.bodyEscape($match.get('value')) - </nobr> + <nobr>$Encoder.bodyEscape($match.get('value'))</nobr> </td> </tr> #set($k = $k + 1) @@ -51,19 +47,18 @@ </tr> <tr> - <td class="description"><nobr>Included:</nobr></td> + <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('EmailConnector.IncludedMetadataColon'))</nobr></td> <td class="value"> #set($seendata = false) #foreach($metadataselection in $METADATASELECTIONS) #if($seendata) - , + <br/> #end #set($seendata = true) - $Encoder.bodyEscape($metadataselection) + <nobr>$Encoder.bodyEscape($metadataselection)</nobr> #end </td> </tr> </table> -
