Index: /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/schema/reportArtifactTypes.exsd =================================================================== --- /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/schema/reportArtifactTypes.exsd (revision 0) +++ /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/schema/reportArtifactTypes.exsd (revision 0) @@ -0,0 +1,111 @@ + + + + + + + + + The report artifact type extension point allows clients to denote artifact types that should be output to the log file. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WTP 2.0 + + + + + + + + + The following is an example of a report artifact type contribution: +<pre> +<extension + id="bpReportArtifacts" + name="%_UI_WSI_BP_REPORT_ARTIFACTS" + point="org.eclipse.wst.wsi.reportArtifacts"> + <reportArtifactType + artifactType="message"/> +</extension> +</pre> + + + + + + + + + No API is associated with this extension point. + + + + + + + + + No implementation is associated with this extension point. + + + + + + + + + + + + + Index: /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/WSITestToolsPlugin.java =================================================================== --- /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/WSITestToolsPlugin.java (revision 203) +++ /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/WSITestToolsPlugin.java (working copy) @@ -34,9 +34,12 @@ protected static final String VALIDATOR_EXT_ID = PLUGIN_ID + ".validator"; protected static final String TAD_VERSION_EXT_ID = PLUGIN_ID + ".tad_versions"; + protected static final String REPORT_ARTIFACT_TYPES_EXT_ID = PLUGIN_ID + + ".reportArtifactTypes"; protected static final String ATT_CLASS = "class"; protected static final String ATT_TAD_NAME = "tad_name"; protected static final String ATT_TAD_VERSION = "version"; + protected static final String ATT_ARTIFACT_TYPE = "artifactType"; //protected ResourceBundle resourcebundle = null; /* Holds validators read from the platform registry. Lazy initialized in @@ -50,6 +53,10 @@ * Lazy initialized in computeTADVersions(). */ private String tadVersions[][]; + /* Holds artifact type names for reporting read from the platform registry. + * Lazy initialized in getAllReportArtifactTypes(). */ + private String reportArtifactTypes[]; + /** * Constructor for wsiTestToolsPlugin. * @param descriptor an IPluginDescriptor object. @@ -168,4 +175,34 @@ tadVersions = computeTADVersions(); return tadVersions; } + + /* Computes the list of artifact types by scanning the platform registry. */ + private String[] computeReportArtifactTypes() { + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint extensionPoint = registry.getExtensionPoint( + REPORT_ARTIFACT_TYPES_EXT_ID); + IExtension[] extensions = extensionPoint.getExtensions(); + ArrayList results = new ArrayList(); + for (int i = 0; i < extensions.length; i++) { + IConfigurationElement reportArtifactElements[] = extensions[i]. + getConfigurationElements(); + for (int j = 0; j < reportArtifactElements.length; j++) { + String reportArtifact = reportArtifactElements[j].getAttribute( + ATT_ARTIFACT_TYPE); + results.add(reportArtifact); + } + } + return (String[]) results.toArray(new String[0]); + } + + /** + * Find all report artifact types tags found in the platform registry + * extension points org.eclipse.wst.wsi.reportArtifactTypes. + * @return an array containing these Strings + */ + public String[] getAllReportArtifactTypes() { + if (reportArtifactTypes == null) + reportArtifactTypes = computeReportArtifactTypes(); + return reportArtifactTypes; + } } Index: /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/report/impl/EntryImpl.java =================================================================== --- /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/report/impl/EntryImpl.java (revision 203) +++ /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/report/impl/EntryImpl.java (working copy) @@ -14,6 +14,7 @@ import java.io.StringWriter; import org.eclipse.wst.wsi.internal.core.WSIConstants; +import org.eclipse.wst.wsi.internal.core.document.DocumentElement; import org.eclipse.wst.wsi.internal.core.log.MessageEntry; import org.eclipse.wst.wsi.internal.core.profile.validator.EnvelopeValidator; import org.eclipse.wst.wsi.internal.core.profile.validator.MessageValidator; @@ -206,27 +207,27 @@ if (this.referenceID != null) pw.print( - WSIConstants.ATTR_REFERENCE_ID + "=\"" + XMLUtils.xmlEscapedString(this.referenceID) + "\""); + WSIConstants.ATTR_REFERENCE_ID + "=\"" + XMLUtils.xmlEscapedString(this.referenceID) + "\" "); // If service name was set then add it //if (parentElementName != null) { // pw.print(" " + WSIConstants.ATTR_PARENT_ELEMENT_NAME + "=\"" + this.parentElementName + "\""); //} - // End element - pw.println(">"); - // ADD: Need to check for config option that specifies // that log entries should be added // If target is a log entry, then add reference to it if ((entryType != null) - && (entryType.getArtifactType().equals(MessageValidator.TYPE_MESSAGE)) - && (showLogEntry)) - { - MessageEntry logEntry = (MessageEntry) entryDetail; - pw.println(logEntry.toXMLString(WSIConstants.NS_NAME_WSI_LOG)); + && (entryType.getArtifactType().isLoggable()) + && (showLogEntry)) { + DocumentElement logEntry = (DocumentElement) entryDetail; + pw.println("value=\"" + logEntry.toXMLString( + WSIConstants.NS_NAME_WSI_LOG) + "\" "); } + + // End element + pw.println(">"); return sw.toString(); } Index: /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/util/ArtifactType.java =================================================================== --- /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/util/ArtifactType.java (revision 203) +++ /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/util/ArtifactType.java (working copy) @@ -10,7 +10,9 @@ *******************************************************************************/ package org.eclipse.wst.wsi.internal.core.util; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.eclipse.wst.wsi.internal.WSITestToolsPlugin; @@ -30,6 +32,8 @@ private static Map typeMap; + private static List loggableArtifactTypes; + /** * Create artifact type. */ @@ -46,6 +50,18 @@ { return type; } + + /** Returns true if this artifact can be output to the report. */ + public boolean isLoggable() { + if (loggableArtifactTypes == null) { + String artifactArray[] = WSITestToolsPlugin.getPlugin(). + getAllReportArtifactTypes(); + loggableArtifactTypes = new ArrayList(artifactArray.length); + for (int i = 0; i < artifactArray.length; i++) + loggableArtifactTypes.add(artifactArray[i]); + } + return loggableArtifactTypes.contains(type); + } /** * Instantiates a new artifact type and adds it to the registry map Index: /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/plugin.properties =================================================================== --- /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/plugin.properties (revision 203) +++ /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/plugin.properties (working copy) @@ -17,3 +17,4 @@ _UI_WSI_FRAMEWORK_MESSAGE_VALIDATOR = WS-I Framework Message Validator _UI_WSI_FRAMEWORK_ENVELOPE_VALIDATOR = WS-I Framework Envelope Validator _UI_WSI_BP_TAD_VERSIONS = WS-I Basic Profile TAD Versions +_UI_WSI_BP_REPORT_ARTIFACTS = WS-I Basic Profile Report Artifacts Index: /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/plugin.xml =================================================================== --- /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/plugin.xml (revision 203) +++ /home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/plugin.xml (working copy) @@ -15,6 +15,7 @@ + + + +