manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1629264 - in /manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript: AlfrescoConnector.java ConfigurationHandler.java Messages.java
Date Fri, 03 Oct 2014 17:17:48 GMT
Author: kwright
Date: Fri Oct  3 17:17:47 2014
New Revision: 1629264

URL: http://svn.apache.org/r1629264
Log:
Second part of patch from Maurizio.

Modified:
    manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java
    manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/ConfigurationHandler.java
    manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/Messages.java

Modified: manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java?rev=1629264&r1=1629263&r2=1629264&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/AlfrescoConnector.java Fri Oct  3 17:17:47 2014
@@ -16,42 +16,41 @@
  */
 package org.apache.manifoldcf.crawler.connectors.alfrescowebscript;
 
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.StringTokenizer;
-
 import org.alfresco.consulting.indexer.client.AlfrescoClient;
 import org.alfresco.consulting.indexer.client.AlfrescoDownException;
 import org.alfresco.consulting.indexer.client.AlfrescoResponse;
 import org.alfresco.consulting.indexer.client.WebScriptsAlfrescoClient;
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
-import org.apache.manifoldcf.core.interfaces.ConfigParams;
-import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
-import org.apache.manifoldcf.core.interfaces.IPostParameters;
-import org.apache.manifoldcf.core.interfaces.IThreadContext;
-import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
-import org.apache.manifoldcf.core.interfaces.Specification;
+import org.apache.manifoldcf.core.interfaces.*;
 import org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector;
 import org.apache.manifoldcf.crawler.interfaces.IExistingVersions;
 import org.apache.manifoldcf.crawler.interfaces.IProcessActivity;
 import org.apache.manifoldcf.crawler.interfaces.ISeedingActivity;
 import org.apache.manifoldcf.crawler.system.Logging;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
 import java.text.MessageFormat;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
 
 public class AlfrescoConnector extends BaseRepositoryConnector {
   private static final String ACTIVITY_FETCH = "fetch document";
   private static final String[] activitiesList = new String[]{ACTIVITY_FETCH};
   private AlfrescoClient alfrescoClient;
   private Boolean enableDocumentProcessing = Boolean.TRUE;
-  
+
   private static final String CONTENT_URL_PROPERTY = "contentUrlPath";
   private static final String AUTHORITIES_PROPERTY = "readableAuthorities";
-  
+  private static final String MIMETYPE_PROPERTY = "mimetype";
+  private static final String SIZE_PROPERTY = "size";
+  private static final String MODIFIED_DATE_PROPERTY = "cm:modified";
+  private static final String CREATED_DATE_PROPERTY = "cm:created";
+
   // Static Fields
   private static final String FIELD_UUID = "uuid";
   private static final String FIELD_NODEREF = "nodeRef";
@@ -81,7 +80,7 @@ public class AlfrescoConnector extends B
     this.enableDocumentProcessing = new Boolean(getConfig(config, "enabledocumentprocessing", "false"));
 
     alfrescoClient = new WebScriptsAlfrescoClient(protocol, hostname, endpoint,
-            storeProtocol, storeId, username, password);
+        storeProtocol, storeId, username, password);
   }
 
   private static String getConfig(ConfigParams config,
@@ -116,12 +115,12 @@ public class AlfrescoConnector extends B
 
   @Override
   public String addSeedDocuments(ISeedingActivity activities, Specification spec,
-                                              String lastSeedVersion, long seedTime, int jobMode) throws ManifoldCFException, ServiceInterruption {
+                                 String lastSeedVersion, long seedTime, int jobMode) throws ManifoldCFException, ServiceInterruption {
     try {
       long lastTransactionId = 0;
       long lastAclChangesetId = 0;
       
-      if(lastSeedVersion != null && !lastSeedVersion.isEmpty()){
+      if(lastSeedVersion != null && !lastSeedVersion.isEmpty()) {
         StringTokenizer tokenizer = new StringTokenizer(lastSeedVersion,"|");
 
         if (tokenizer.countTokens() == 2) {
@@ -137,9 +136,9 @@ public class AlfrescoConnector extends B
       long aclChangesetsProcessed;
       do {
         final AlfrescoResponse response = alfrescoClient.
-        		fetchNodes(lastTransactionId, 
-        				lastAclChangesetId,
-        				ConfigurationHandler.getFilters(spec));
+            fetchNodes(lastTransactionId, 
+                       lastAclChangesetId,
+                       ConfigurationHandler.getFilters(spec));
         int count = 0;
         for (Map<String, Object> doc : response.getDocuments()) {
 //          String json = gson.toJson(doc);
@@ -171,10 +170,11 @@ public class AlfrescoConnector extends B
 
   @Override
   public void processDocuments(String[] documentIdentifiers, IExistingVersions statuses, Specification spec,
-                             IProcessActivity activities, int jobMode, boolean usesDefaultAuthority)
-        throws ManifoldCFException, ServiceInterruption {
+                               IProcessActivity activities, int jobMode, boolean usesDefaultAuthority)
+    throws ManifoldCFException, ServiceInterruption {
 
     for (String doc : documentIdentifiers) {
+
       String nextVersion = statuses.getIndexedVersionString(doc);	
     	
       // Calling again Alfresco API because Document's actions are lost from seeding method
@@ -182,10 +182,23 @@ public class AlfrescoConnector extends B
       if(response.getDocumentList().isEmpty()){ // Not found seeded document. Could reflect an error in Alfresco
         if (Logging.connectors != null)
           Logging.connectors.warn(MessageFormat.format("Invalid Seeded Document from Alfresco with ID {0}", new Object[]{doc}));
-        activities.noDocument(doc, nextVersion);
+        activities.deleteDocument(doc);
         continue;
       }
       Map<String, Object> map = response.getDocumentList().get(0); // Should be only one
+      if ((Boolean) map.get("deleted")) {
+        activities.deleteDocument(doc);
+        continue;
+      }
+
+      // This should at least be the modified date
+      // MHL
+      String documentVersion = "";
+
+      if(!activities.checkDocumentNeedsReindexing(doc, documentVersion))
+          continue;
+
+
       RepositoryDocument rd = new RepositoryDocument();
       String uuid = map.containsKey(FIELD_UUID) ? map.get(FIELD_UUID).toString() : doc;
       String nodeRef = map.containsKey(FIELD_NODEREF) ? map.get(FIELD_NODEREF).toString() : "";
@@ -195,58 +208,106 @@ public class AlfrescoConnector extends B
       String name =  map.containsKey(FIELD_NAME) ? map.get(FIELD_NAME).toString() : "";
       rd.setFileName(name);
 
-      if ((Boolean) map.get("deleted")) {
-        activities.deleteDocument(uuid);
-      } else {
-        if (this.enableDocumentProcessing) {
-          try{
-            processMetaData(rd,uuid);
-          }catch(AlfrescoDownException e){
-            if (Logging.connectors != null)
-              Logging.connectors.warn(MessageFormat.format("Invalid Document from Alfresco with ID {0}", new Object[]{uuid}), e);
-            activities.noDocument(doc, nextVersion);
-            continue; // No Metadata, No Content....skip document
-          }
+      InputStream stream = null;
+      if (this.enableDocumentProcessing) {
+        try{
+          stream = processMetaData(rd,uuid);
+        }catch(AlfrescoDownException e){
+          if (Logging.connectors != null)
+            Logging.connectors.warn(MessageFormat.format("Invalid Document from Alfresco with ID {0}", new Object[]{uuid}), e);
+          activities.noDocument(doc, documentVersion);
+          continue; // No Metadata, No Content....skip document
         }
-        try {
-          if(rd.getBinaryStream() == null){
-            byte[] empty = new byte[0];
-            rd.setBinary(new ByteArrayInputStream(empty), 0L);
-          }
-          if (Logging.connectors != null && Logging.connectors.isDebugEnabled())
-            Logging.connectors.debug(MessageFormat.format("Ingesting with id: {0}, URI {1} and rd {2}", new Object[]{uuid, nodeRef, rd.getFileName()}));
-          activities.ingestDocumentWithException(uuid, "", uuid, rd);
-        } catch (IOException e) {
-          throw new ManifoldCFException(
-					"Error Ingesting Document with ID " + String.valueOf(uuid), e);
+      }
+      try {
+        if(stream == null){
+          byte[] empty = new byte[0];
+          rd.setBinary(new ByteArrayInputStream(empty), 0L);
         }
+        if (Logging.connectors != null && Logging.connectors.isDebugEnabled())
+          Logging.connectors.debug(MessageFormat.format("Ingesting with id: {0}, URI {1} and rd {2}", new Object[]{uuid, nodeRef, rd.getFileName()}));
+        activities.ingestDocumentWithException(doc, documentVersion, uuid, rd);
+      } catch (IOException e) {
+        throw new ManifoldCFException(
+                                      "Error Ingesting Document with ID " + String.valueOf(uuid), e);
       }
     }
   }
   
-  private void processMetaData(RepositoryDocument rd,
-		  String uuid) throws ManifoldCFException, AlfrescoDownException {
+  private InputStream processMetaData(RepositoryDocument rd,
+                                      String uuid) throws ManifoldCFException, AlfrescoDownException {
+    InputStream stream = null;
+
     Map<String,Object> properties = alfrescoClient.fetchMetadata(uuid);
     for(String property : properties.keySet()) {
       Object propertyValue = properties.get(property);
       rd.addField(property,propertyValue.toString());
     }
-    
-    // Document Binary Content
-    String contentUrlPath = (String) properties.get(CONTENT_URL_PROPERTY);
-    if(contentUrlPath != null && !contentUrlPath.isEmpty()){
-      InputStream binaryContent = alfrescoClient.fetchContent(contentUrlPath);
-      if(binaryContent != null) // Content-based Alfresco Document
-        rd.setBinary(binaryContent, 0L);
+
+
+    Object mimetypeObject = properties.get(MIMETYPE_PROPERTY);
+    if (mimetypeObject != null) {
+      String mimetype = mimetypeObject.toString();
+      if (mimetype != null && !mimetype.isEmpty())
+        rd.setMimeType(mimetype);
+    }
+
+    long lSize = 0L;
+    Object sizeObject = properties.get(SIZE_PROPERTY);
+    if (sizeObject != null) {
+      String size = sizeObject.toString();
+      try {
+        lSize = Long.parseLong(size);
+      } catch (NumberFormatException e) {
+        // Nothing to do
+      }
+    }
+
+    // Modified Date
+    Object mdObject = properties.get(MODIFIED_DATE_PROPERTY);
+    if (mdObject != null) {
+      SimpleDateFormat f = new SimpleDateFormat("YYYY-MM-DDThh:mm:ss.sTZD");
+      Date d;
+      try {
+        d = f.parse(mdObject.toString());
+        rd.setModifiedDate(d);
+      } catch (ParseException e) {
+        // Nothing to do
+      }
+    }
+
+    // Created Date
+    mdObject = properties.get(CREATED_DATE_PROPERTY);
+    if (mdObject != null) {
+      SimpleDateFormat f = new SimpleDateFormat("YYYY-MM-DDThh:mm:ss.sTZD");
+      Date d;
+      try {
+        d = f.parse(mdObject.toString());
+        rd.setCreatedDate(d);
+      } catch (ParseException e) {
+        // Nothing to do
+      }
     }
-    
+
     // Indexing Permissions
     @SuppressWarnings("unchecked")
     List<String> permissions = (List<String>) properties.remove(AUTHORITIES_PROPERTY);
     if(permissions != null){
       rd.setSecurityACL(RepositoryDocument.SECURITY_TYPE_DOCUMENT,
-    		permissions.toArray(new String[permissions.size()]));
+                        permissions.toArray(new String[permissions.size()]));
+    }
+
+    // Document Binary Content
+    String contentUrlPath = (String) properties.get(CONTENT_URL_PROPERTY);
+    if (contentUrlPath != null && !contentUrlPath.isEmpty()) {
+      InputStream binaryContent = alfrescoClient.fetchContent(contentUrlPath);
+      if (binaryContent != null) { // Content-based Alfresco Document
+        rd.setBinary(binaryContent, lSize);
+        stream = binaryContent;
+      }
     }
+
+    return stream;
   }
 
   @Override
@@ -254,57 +315,57 @@ public class AlfrescoConnector extends B
                                         IHTTPOutput out, Locale locale, ConfigParams parameters,
                                         List<String> tabsArray) throws ManifoldCFException, IOException {
     ConfigurationHandler.outputConfigurationHeader(threadContext, out, locale,
-            parameters, tabsArray);
+        parameters, tabsArray);
   }
 
   @Override
   public void outputConfigurationBody(IThreadContext threadContext,
                                       IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName)
-          throws ManifoldCFException, IOException {
+      throws ManifoldCFException, IOException {
     ConfigurationHandler.outputConfigurationBody(threadContext, out, locale,
-            parameters, tabName);
+        parameters, tabName);
   }
 
   @Override
   public String processConfigurationPost(IThreadContext threadContext,
                                          IPostParameters variableContext, Locale locale, ConfigParams parameters)
-          throws ManifoldCFException {
+      throws ManifoldCFException {
     return ConfigurationHandler.processConfigurationPost(threadContext,
-            variableContext, locale, parameters);
+        variableContext, locale, parameters);
   }
 
   @Override
   public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out,
                                 Locale locale, ConfigParams parameters) throws ManifoldCFException,
-          IOException {
+      IOException {
     ConfigurationHandler.viewConfiguration(threadContext, out, locale,
-            parameters);
+        parameters);
   }
-  
-  
+
+
   @Override
   public void outputSpecificationHeader(IHTTPOutput out, Locale locale, Specification os,
-    int connectionSequenceNumber, List<String> tabsArray)
-    throws ManifoldCFException, IOException{
+                                        int connectionSequenceNumber, List<String> tabsArray)
+      throws ManifoldCFException, IOException {
     ConfigurationHandler.outputSpecificationHeader(out, locale, os, connectionSequenceNumber, tabsArray);
   }
-   
+
   @Override
   public void outputSpecificationBody(IHTTPOutput out, Locale locale, Specification os,
-    int connectionSequenceNumber, int actualSequenceNumber, String tabName) throws ManifoldCFException, IOException{
+                                      int connectionSequenceNumber, int actualSequenceNumber, String tabName) throws ManifoldCFException, IOException {
     ConfigurationHandler.outputSpecificationBody(out, locale, os, connectionSequenceNumber, actualSequenceNumber, tabName);
   }
-   
+
   @Override
   public String processSpecificationPost(IPostParameters variableContext, Locale locale, Specification os,
-			  int connectionSequenceNumber) throws ManifoldCFException{
+                                         int connectionSequenceNumber) throws ManifoldCFException {
     return ConfigurationHandler.processSpecificationPost(variableContext, locale, os, connectionSequenceNumber);
   }
-   
+
   @Override
   public void viewSpecification(IHTTPOutput out, Locale locale, Specification os,
-			  int connectionSequenceNumber) throws ManifoldCFException, IOException{
-  ConfigurationHandler.viewSpecification(out, locale, os, connectionSequenceNumber);
+                                int connectionSequenceNumber) throws ManifoldCFException, IOException {
+    ConfigurationHandler.viewSpecification(out, locale, os, connectionSequenceNumber);
   }
-  
+
 }

Modified: manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/ConfigurationHandler.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/ConfigurationHandler.java?rev=1629264&r1=1629263&r2=1629264&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/ConfigurationHandler.java (original)
+++ manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/ConfigurationHandler.java Fri Oct  3 17:17:47 2014
@@ -16,28 +16,17 @@
  */
 package org.apache.manifoldcf.crawler.connectors.alfrescowebscript;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-
+import com.google.common.collect.ImmutableMultimap;
 import org.alfresco.consulting.indexer.client.AlfrescoFilters;
 import org.apache.commons.io.IOUtils;
-import org.apache.manifoldcf.core.interfaces.ConfigParams;
-import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
-import org.apache.manifoldcf.core.interfaces.IPostParameters;
-import org.apache.manifoldcf.core.interfaces.IThreadContext;
-import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
-import org.apache.manifoldcf.core.interfaces.Specification;
-import org.apache.manifoldcf.core.interfaces.SpecificationNode;
+import org.apache.manifoldcf.core.interfaces.*;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.app.VelocityEngine;
 
-import com.google.common.collect.ImmutableMultimap;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.util.*;
 
 public class ConfigurationHandler {
   private static final String PARAM_PROTOCOL = "protocol";
@@ -48,49 +37,68 @@ public class ConfigurationHandler {
   private static final String PARAM_STORE_ID = "storeid";
   private static final String PARAM_USERNAME = "username";
   private static final String PARAM_PASSWORD = "password";
-  
+
   // Output Specification for Filtering
-  /** Node describing a Site */
+  /**
+   * Node describing a Site
+   */
   public static final String NODE_SITE = "site";
-  /** Attribute describing a site name */
+  /**
+   * Attribute describing a site name
+   */
   public static final String ATTRIBUTE_SITE = "site_name";
-  
-  /** Node describing a MimeType */
+
+  /**
+   * Node describing a MimeType
+   */
   public static final String NODE_MIMETYPE = "mimetype";
-  /** Attribute describing a MimeType name */
+  /**
+   * Attribute describing a MimeType name
+   */
   public static final String ATTRIBUTE_MIMETYPE = "mimetype_name";
-  
-  /** Node describing an Aspect */
+
+  /**
+   * Node describing an Aspect
+   */
   public static final String NODE_ASPECT = "aspect";
-  /** Attribute describing an aspect name */
+  /**
+   * Attribute describing an aspect name
+   */
   public static final String ATTRIBUTE_ASPECT = "aspect_name";
-  
-  /** Node describing a Metadata */
+
+  /**
+   * Node describing a Metadata
+   */
   public static final String NODE_METADATA = "metadata";
-  /** Attribute describing an aspect name */
+  /**
+   * Attribute describing an aspect name
+   */
   public static final String ATTRIBUTE_METADATA_SOURCE = "metadata_source";
-  /** Attribute describing an aspect value */
+  /**
+   * Attribute describing an aspect value
+   */
   public static final String ATTRIBUTE_METADATA_TARGET = "metadata_value";
-  
+
   public static final ImmutableMultimap<String, String> SPECIFICATION_MAP =
-	        ImmutableMultimap.<String, String>builder().
-	        put(NODE_SITE, ATTRIBUTE_SITE).
-	        put(NODE_MIMETYPE, ATTRIBUTE_MIMETYPE).
-	        put(NODE_ASPECT, ATTRIBUTE_ASPECT).
-	        put(NODE_METADATA, ATTRIBUTE_METADATA_SOURCE).
-	        put(NODE_METADATA, ATTRIBUTE_METADATA_TARGET).build();
+      ImmutableMultimap.<String, String>builder().
+          put(NODE_SITE, ATTRIBUTE_SITE).
+          put(NODE_MIMETYPE, ATTRIBUTE_MIMETYPE).
+          put(NODE_ASPECT, ATTRIBUTE_ASPECT).
+          put(NODE_METADATA, ATTRIBUTE_METADATA_SOURCE).
+          put(NODE_METADATA, ATTRIBUTE_METADATA_TARGET).build();
 
   private static final String EDIT_CONFIG_HEADER = "editConfiguration.js";
   private static final String EDIT_CONFIG_SERVER = "editConfiguration_Server.html";
   private static final String VIEW_CONFIG = "viewConfiguration.html";
 
   private static final Map<String, String> DEFAULT_CONFIGURATION_PARAMETERS = new HashMap<String, String>();
+
   static {
     DEFAULT_CONFIGURATION_PARAMETERS.put(PARAM_PROTOCOL, "http");
     DEFAULT_CONFIGURATION_PARAMETERS.put(PARAM_HOSTNAME, "localhost");
     DEFAULT_CONFIGURATION_PARAMETERS.put(PARAM_ENDPOINT, "/alfresco/service");
     DEFAULT_CONFIGURATION_PARAMETERS.put(PARAM_STORE_PROTOCOL, "workspace");
-    DEFAULT_CONFIGURATION_PARAMETERS.put(PARAM_ENABLE_DOCUMENT_PROCESSING,"true");
+    DEFAULT_CONFIGURATION_PARAMETERS.put(PARAM_ENABLE_DOCUMENT_PROCESSING, "true");
     DEFAULT_CONFIGURATION_PARAMETERS.put(PARAM_STORE_ID, "SpacesStore");
     DEFAULT_CONFIGURATION_PARAMETERS.put(PARAM_USERNAME, "");
     DEFAULT_CONFIGURATION_PARAMETERS.put(PARAM_PASSWORD, "");
@@ -100,8 +108,8 @@ public class ConfigurationHandler {
   }
 
   public static void outputConfigurationHeader(IThreadContext threadContext,
-      IHTTPOutput out, Locale locale, ConfigParams parameters,
-      List<String> tabsArray) throws ManifoldCFException, IOException {
+                                               IHTTPOutput out, Locale locale, ConfigParams parameters,
+                                               List<String> tabsArray) throws ManifoldCFException, IOException {
     tabsArray.add("Server");
     Map<String, Object> paramMap = new HashMap<String, Object>();
     fillInParameters(paramMap, parameters);
@@ -109,7 +117,7 @@ public class ConfigurationHandler {
   }
 
   private static void fillInParameters(Map<String, Object> paramMap,
-      ConfigParams parameters) {
+                                       ConfigParams parameters) {
     for (Map.Entry<String, String> parameter : DEFAULT_CONFIGURATION_PARAMETERS
         .entrySet()) {
       String paramValue = parameters.getParameter(parameter.getKey());
@@ -121,7 +129,7 @@ public class ConfigurationHandler {
   }
 
   public static void outputConfigurationBody(IThreadContext threadContext,
-      IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName)
+                                             IHTTPOutput out, Locale locale, ConfigParams parameters, String tabName)
       throws ManifoldCFException, IOException {
     Map<String, Object> paramMap = new HashMap<String, Object>();
     paramMap.put("tabName", tabName);
@@ -130,7 +138,7 @@ public class ConfigurationHandler {
   }
 
   public static String processConfigurationPost(IThreadContext threadContext,
-      IPostParameters variableContext, Locale locale, ConfigParams parameters)
+                                                IPostParameters variableContext, Locale locale, ConfigParams parameters)
       throws ManifoldCFException {
     for (String paramName : DEFAULT_CONFIGURATION_PARAMETERS.keySet()) {
       String paramValue = variableContext.getParameter(paramName);
@@ -142,7 +150,7 @@ public class ConfigurationHandler {
   }
 
   public static void viewConfiguration(IThreadContext threadContext,
-      IHTTPOutput out, Locale locale, ConfigParams parameters)
+                                       IHTTPOutput out, Locale locale, ConfigParams parameters)
       throws ManifoldCFException, IOException {
     Map<String, Object> paramMap = new HashMap<String, Object>();
     fillInParameters(paramMap, parameters);
@@ -150,61 +158,61 @@ public class ConfigurationHandler {
   }
   
   public static void outputSpecificationHeader(IHTTPOutput out, Locale locale, Specification os,
-    int connectionSequenceNumber, List<String> tabsArray)
-    throws ManifoldCFException, IOException
+                                               int connectionSequenceNumber, List<String> tabsArray)
+      throws ManifoldCFException, IOException
   {
     String seqPrefix = "s"+connectionSequenceNumber+"_";
     tabsArray.add(Messages.getString(locale, "Alfresco.FilteringConfiguration"));
     out.print(
-        "<script type=\"text/javascript\">\n"+
-        "<!--\n"+
-        "function "+seqPrefix+"checkSpecification()\n"+
-        "{\n"+
-        "  return true;\n"+
-        "}\n"+
-        "\n");
+              "<script type=\"text/javascript\">\n"+
+              "<!--\n"+
+              "function "+seqPrefix+"checkSpecification()\n"+
+              "{\n"+
+              "  return true;\n"+
+              "}\n"+
+              "\n");
     
     for(String node:SPECIFICATION_MAP.keySet()){
       out.print(
-          "function "+seqPrefix+"add"+node+"()\n"+
-          "{\n");
+                "function "+seqPrefix+"add"+node+"()\n"+
+                "{\n");
       Collection<String> vars = SPECIFICATION_MAP.get(node);
       for(String var:vars){
-            Object[] args = new String[]{node,var};
+        Object[] args = new String[]{node,var};
         out.print(
-            "if (editjob."+seqPrefix+var+".value == \"\")\n"+
-              "  {\n"+
-//              "    alert(\"Value of "+ node + "." + var + " can't be NULL" +"\");\n"+
-                    "    alert(\""+ Messages.getBodyJavascriptString(locale, "Alfresco.ParamNullError",args) + "\");\n"+
-              "    editjob."+seqPrefix+var+".focus();\n"+
-              "    return;\n"+
-              "  }\n"
-            );
+                  "if (editjob."+seqPrefix+var+".value == \"\")\n"+
+                  "  {\n"+
+//                "    alert(\"Value of "+ node + "." + var + " can't be NULL" +"\");\n"+
+                  "    alert(\""+ Messages.getBodyJavascriptString(locale, "Alfresco.ParamNullError",args) + "\");\n"+
+                  "    editjob."+seqPrefix+var+".focus();\n"+
+                  "    return;\n"+
+                  "  }\n"
+                  );
       }
           
       out.print("editjob."+seqPrefix+node+"_op.value=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Add") + "\";\n"+
-          "  postFormSetAnchor(\""+seqPrefix+"+"+node+"\");\n"+
-          "}\n"+
-          "\n"+
-      "function "+seqPrefix+"delete"+node+"(i)\n"+
-          "{\n"+
-          "  // Set the operation\n"+
-          "  eval(\"editjob."+seqPrefix+node+"_\"+i+\"_op.value=\\\"" + Messages.getBodyJavascriptString(locale, "Alfresco.Delete") + "\\\"\");\n"+
-          "  // Submit\n"+
-          "  if (editjob."+seqPrefix+node+"_count.value==i)\n"+
-          "    postFormSetAnchor(\""+seqPrefix+node+"\");\n"+
-          "  else\n"+
-          "    postFormSetAnchor(\""+seqPrefix+node+"_\"+i)\n"+
-          "  // Undo, so we won't get two deletes next time\n"+
-          "  eval(\"editjob."+seqPrefix+node+"_\"+i+\"_op.value=\\\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Continue") + "\\\"\");\n"+
-          "}\n"+
-          "\n");
+                "  postFormSetAnchor(\""+seqPrefix+"+"+node+"\");\n"+
+                "}\n"+
+                "\n"+
+                "function "+seqPrefix+"delete"+node+"(i)\n"+
+                "{\n"+
+                "  // Set the operation\n"+
+                "  eval(\"editjob."+seqPrefix+node+"_\"+i+\"_op.value=\\\"" + Messages.getBodyJavascriptString(locale, "Alfresco.Delete") + "\\\"\");\n"+
+                "  // Submit\n"+
+                "  if (editjob."+seqPrefix+node+"_count.value==i)\n"+
+                "    postFormSetAnchor(\""+seqPrefix+node+"\");\n"+
+                "  else\n"+
+                "    postFormSetAnchor(\""+seqPrefix+node+"_\"+i)\n"+
+                "  // Undo, so we won't get two deletes next time\n"+
+                "  eval(\"editjob."+seqPrefix+node+"_\"+i+\"_op.value=\\\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Continue") + "\\\"\");\n"+
+                "}\n"+
+                "\n");
     }
         
     out.print("\n"+
-        "\n"+
-        "//-->\n"+
-        "</script>\n");    
+              "\n"+
+              "//-->\n"+
+              "</script>\n");    
   }
 
   
@@ -219,14 +227,14 @@ public class ConfigurationHandler {
     {
       for(String node:SPECIFICATION_MAP.keySet()){
         out.print(
-            "<table class=\"displaytable\">\n"+
-                "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
-                "  <tr>\n"+
-                "    <td class=\"description\"><nobr>" + node + " filtering:</nobr></td>\n"+
-                "    <td class=\"boxcell\">\n"+
-                "      <table class=\"formtable\">\n"+
-                "        <tr class=\"formheaderrow\">\n"+
-                "          <td class=\"formcolumnheader\"></td>\n");
+                  "<table class=\"displaytable\">\n"+
+                  "  <tr><td class=\"separator\" colspan=\"2\"><hr/></td></tr>\n"+
+                  "  <tr>\n"+
+                  "    <td class=\"description\"><nobr>" + node + " filtering:</nobr></td>\n"+
+                  "    <td class=\"boxcell\">\n"+
+                  "      <table class=\"formtable\">\n"+
+                  "        <tr class=\"formheaderrow\">\n"+
+                  "          <td class=\"formcolumnheader\"></td>\n");
         Collection<String> vars = SPECIFICATION_MAP.get(node);
         for(String var:vars){
           out.print("<td class=\"formcolumnheader\"><nobr>" + var + "</nobr></td>\n");
@@ -240,22 +248,22 @@ public class ConfigurationHandler {
           if (sn.getType().equals(node)) {
             String prefix = seqPrefix+node+"_" + Integer.toString(fieldCounter);
             out.print(
-                "        <tr class=\""+(((fieldCounter % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
-                    "          <td class=\"formcolumncell\">\n"+
-                    "            <a name=\""+prefix+"\">\n"+
-                    "              <input type=\"button\" value=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Delete") + "\" alt=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Delete") + ""+Integer.toString(fieldCounter+1)+"\" onclick='javascript:"+seqPrefix+"delete"+node+"("+Integer.toString(fieldCounter)+");'/>\n"+
-                    "              <input type=\"hidden\" name=\""+prefix+"_op\" value=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Continue") + "\"/>\n");
+                      "        <tr class=\""+(((fieldCounter % 2)==0)?"evenformrow":"oddformrow")+"\">\n"+
+                      "          <td class=\"formcolumncell\">\n"+
+                      "            <a name=\""+prefix+"\">\n"+
+                      "              <input type=\"button\" value=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Delete") + "\" alt=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Delete") + ""+Integer.toString(fieldCounter+1)+"\" onclick='javascript:"+seqPrefix+"delete"+node+"("+Integer.toString(fieldCounter)+");'/>\n"+
+                      "              <input type=\"hidden\" name=\""+prefix+"_op\" value=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Continue") + "\"/>\n");
             for(String var:vars){
               out.print("<input type=\"hidden\" name=\""+prefix+"_"+var+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(sn.getAttributeValue(var))+"\"/>\n");
             }
 
             out.print("            </a>\n"+
-                "          </td>\n");
+                      "          </td>\n");
             for(String var:vars){
               out.print(
-                  "       <td class=\"formcolumncell\">\n"+
-                      "            <nobr>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(sn.getAttributeValue(var))+"</nobr>\n"+
-                  "          </td>\n");
+                        "       <td class=\"formcolumncell\">\n"+
+                        "            <nobr>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(sn.getAttributeValue(var))+"</nobr>\n"+
+                        "          </td>\n");
             }
             fieldCounter++;
 
@@ -264,29 +272,29 @@ public class ConfigurationHandler {
         if (fieldCounter == 0)
           {
             out.print(
-                "<tr class=\"formrow\"><td class=\"formmessage\" colspan=\"3\">"+ Messages.getBodyJavascriptString(locale, "Alfresco.NoFilteringConfiguration") + "</td></tr>\n");
+                      "<tr class=\"formrow\"><td class=\"formmessage\" colspan=\"3\">"+ Messages.getBodyJavascriptString(locale, "Alfresco.NoFilteringConfiguration") + "</td></tr>\n");
           }
         
         out.print(
-            "        <tr class=\"formrow\"><td class=\"formseparator\" colspan=\"3\"><hr/></td></tr>\n"+
-            "        <tr class=\"formrow\">\n"+
-            "          <td class=\"formcolumncell\">\n"+
-            "            <a name=\""+seqPrefix+node+"\">\n"+
-            "              <input type=\"button\" value=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Add") + "\" alt=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Add") + " " + node + "\" onclick=\"javascript:"+seqPrefix+"add"+node+"();\"/>\n"+
-            "            </a>\n"+
-            "            <input type=\"hidden\" name=\""+seqPrefix+node+"_count\" value=\""+fieldCounter+"\"/>\n"+
-            "            <input type=\"hidden\" name=\""+seqPrefix+node+"_op\" value=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Continue") +"\"/>\n"+
-            "          </td>\n");
+                  "        <tr class=\"formrow\"><td class=\"formseparator\" colspan=\"3\"><hr/></td></tr>\n"+
+                  "        <tr class=\"formrow\">\n"+
+                  "          <td class=\"formcolumncell\">\n"+
+                  "            <a name=\""+seqPrefix+node+"\">\n"+
+                  "              <input type=\"button\" value=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Add") + "\" alt=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Add") + " " + node + "\" onclick=\"javascript:"+seqPrefix+"add"+node+"();\"/>\n"+
+                  "            </a>\n"+
+                  "            <input type=\"hidden\" name=\""+seqPrefix+node+"_count\" value=\""+fieldCounter+"\"/>\n"+
+                  "            <input type=\"hidden\" name=\""+seqPrefix+node+"_op\" value=\""+ Messages.getBodyJavascriptString(locale, "Alfresco.Continue") +"\"/>\n"+
+                  "          </td>\n");
         for(String var:vars){
           out.print("          <td class=\"formcolumncell\">\n"+
-            "            <nobr><input type=\"text\" size=\"15\" name=\""+seqPrefix+var+"\" value=\"\"/></nobr>\n"+
-            "          </td>\n");
+                    "            <nobr><input type=\"text\" size=\"15\" name=\""+seqPrefix+var+"\" value=\"\"/></nobr>\n"+
+                    "          </td>\n");
         }
 
        out.print("</tr>\n"+
-            "      </table>\n"+
-            "    </td>\n"+
-            "  </tr>\n");
+                 "      </table>\n"+
+                 "    </td>\n"+
+                 "  </tr>\n");
             
 
       }
@@ -301,7 +309,7 @@ public class ConfigurationHandler {
             String prefix = seqPrefix+node+"_" + Integer.toString(fieldCounter);  
             for(String var:SPECIFICATION_MAP.get(node)){
               out.print(
-                  "<input type=\"hidden\" name=\""+prefix+"_"+var+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(sn.getAttributeValue(var))+"\"/>\n");
+                        "<input type=\"hidden\" name=\""+prefix+"_"+var+"\" value=\""+org.apache.manifoldcf.ui.util.Encoder.attributeEscape(sn.getAttributeValue(var))+"\"/>\n");
             }
             fieldCounter++;
             }
@@ -375,8 +383,8 @@ public class ConfigurationHandler {
   }
   
   public static void viewSpecification(IHTTPOutput out, Locale locale, Specification os,
-      int connectionSequenceNumber)
-          throws ManifoldCFException, IOException
+                                       int connectionSequenceNumber)
+      throws ManifoldCFException, IOException
   {
     int i = 0;
 
@@ -386,16 +394,16 @@ public class ConfigurationHandler {
     for(String node:SPECIFICATION_MAP.keySet()){
       Collection<String> vars = SPECIFICATION_MAP.get(node);
       out.print(
-          "\n"+
-              "<table class=\"displaytable\">\n"+
-              "  <tr>\n"+
-              "    <td class=\"description\"><nobr>"+ Messages.getBodyJavascriptString(locale, "Alfresco.SpecificFilteringConfiguration",new String[]{node}) +"</nobr></td>\n"+
-              "    <td class=\"boxcell\">\n"+
-              "      <table class=\"formtable\">\n"+
-              "        <tr class=\"formheaderrow\">\n");
+                "\n"+
+                "<table class=\"displaytable\">\n"+
+                "  <tr>\n"+
+                "    <td class=\"description\"><nobr>"+ Messages.getBodyJavascriptString(locale, "Alfresco.SpecificFilteringConfiguration",new String[]{node}) +"</nobr></td>\n"+
+                "    <td class=\"boxcell\">\n"+
+                "      <table class=\"formtable\">\n"+
+                "        <tr class=\"formheaderrow\">\n");
       for(String var:vars)
         out.print(
-            "          <td class=\"formcolumnheader\"><nobr>" + var + "</nobr></td>\n");
+                  "          <td class=\"formcolumnheader\"><nobr>" + var + "</nobr></td>\n");
               
      out.print("        </tr>\n");
      
@@ -406,14 +414,14 @@ public class ConfigurationHandler {
         SpecificationNode sn = os.getChild(i++);
         if (sn.getType().equals(node)) {
           out.print(
-              "        <tr class=\""+(((fieldCounter % 2)==0)?"evenformrow":"oddformrow")+"\">\n");
+                    "        <tr class=\""+(((fieldCounter % 2)==0)?"evenformrow":"oddformrow")+"\">\n");
           for(String var:vars)
             out.print(
-                  "          <td class=\"formcolumncell\">\n"+
-                  "            <nobr>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(sn.getAttributeValue(var))+"</nobr>\n"+
-                  "          </td>\n");
+                      "          <td class=\"formcolumncell\">\n"+
+                      "            <nobr>"+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(sn.getAttributeValue(var))+"</nobr>\n"+
+                      "          </td>\n");
           out.print(
-                  "        </tr>\n");
+                    "        </tr>\n");
           fieldCounter++;
         }
       }
@@ -421,15 +429,15 @@ public class ConfigurationHandler {
       if (fieldCounter == 0)
       {
         out.print(
-            "        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"3\">"+ Messages.getBodyJavascriptString(locale, "Alfresco.NoSpecificFilteringConfiguration",new String[]{node}) + "</td></tr>\n"
+                  "        <tr class=\"formrow\"><td class=\"formmessage\" colspan=\"3\">"+ Messages.getBodyJavascriptString(locale, "Alfresco.NoSpecificFilteringConfiguration",new String[]{node}) + "</td></tr>\n"
             );
       }
       out.print(
-          "      </table>\n"+
-              "    </td>\n"+
-              "  </tr>\n"+
-              "  </tr>\n"+
-              "</table>\n");
+                "      </table>\n"+
+                "    </td>\n"+
+                "  </tr>\n"+
+                "  </tr>\n"+
+                "</table>\n");
     }
   }
   

Modified: manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/Messages.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/Messages.java?rev=1629264&r1=1629263&r2=1629264&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/Messages.java (original)
+++ manifoldcf/branches/CONNECTORS-1037/connectors/alfresco-webscript/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfrescowebscript/Messages.java Fri Oct  3 17:17:47 2014
@@ -16,123 +16,105 @@
  */
 package org.apache.manifoldcf.crawler.connectors.alfrescowebscript;
 
+import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+
 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.alfrescowebscript.common";
-    public static final String DEFAULT_PATH_NAME="org.apache.manifoldcf.crawler.connectors.alfrescowebscript";
-
-    /** 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);
-    }
+public class Messages extends org.apache.manifoldcf.ui.i18n.Messages {
+  public static final String DEFAULT_BUNDLE_NAME = "org.apache.manifoldcf.crawler.connectors.alfresco.webscript.common";
+  public static final String DEFAULT_PATH_NAME = "org.apache.manifoldcf.crawler.connectors.alfresco.webscript";
+
+  /**
+   * 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);
+  }
 
 }



Mime
View raw message