View | Details | Raw Unified | Return to bug 149062 | Differences between
and this patch

Collapse All | Expand All

(-)/home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/schema/reportArtifactTypes.exsd (+111 lines)
Line 0 Link Here
1
<?xml version='1.0' encoding='UTF-8'?>
2
<!-- Schema file written by PDE -->
3
<schema targetNamespace="org.eclipse.wst.wsi">
4
<annotation>
5
      <appInfo>
6
         <meta.schema plugin="org.eclipse.wst.wsi" id="reportArtifactType" name="report artifact type"/>
7
      </appInfo>
8
      <documentation>
9
         The report artifact type extension point allows clients to denote artifact types that should be output to the log file.
10
      </documentation>
11
   </annotation>
12
13
   <element name="extension">
14
      <complexType>
15
         <sequence>
16
            <element ref="reportArtifactType"/>
17
         </sequence>
18
         <attribute name="point" type="string" use="required">
19
            <annotation>
20
               <documentation>
21
                  
22
               </documentation>
23
            </annotation>
24
         </attribute>
25
         <attribute name="id" type="string">
26
            <annotation>
27
               <documentation>
28
                  
29
               </documentation>
30
            </annotation>
31
         </attribute>
32
         <attribute name="name" type="string">
33
            <annotation>
34
               <documentation>
35
                  
36
               </documentation>
37
               <appInfo>
38
                  <meta.attribute translatable="true"/>
39
               </appInfo>
40
            </annotation>
41
         </attribute>
42
      </complexType>
43
   </element>
44
45
   <element name="reportArtifactType">
46
      <complexType>
47
         <attribute name="artifactType" type="string" use="required">
48
            <annotation>
49
               <documentation>
50
                  
51
               </documentation>
52
            </annotation>
53
         </attribute>
54
      </complexType>
55
   </element>
56
57
   <annotation>
58
      <appInfo>
59
         <meta.section type="since"/>
60
      </appInfo>
61
      <documentation>
62
         WTP 2.0
63
      </documentation>
64
   </annotation>
65
66
   <annotation>
67
      <appInfo>
68
         <meta.section type="examples"/>
69
      </appInfo>
70
      <documentation>
71
         The following is an example of a report artifact type contribution:
72
&lt;pre&gt;
73
&lt;extension
74
        id=&quot;bpReportArtifacts&quot;
75
        name=&quot;%_UI_WSI_BP_REPORT_ARTIFACTS&quot;
76
        point=&quot;org.eclipse.wst.wsi.reportArtifacts&quot;&gt;
77
     &lt;reportArtifactType
78
        artifactType=&quot;message&quot;/&gt;
79
&lt;/extension&gt;
80
&lt;/pre&gt;
81
      </documentation>
82
   </annotation>
83
84
   <annotation>
85
      <appInfo>
86
         <meta.section type="apiInfo"/>
87
      </appInfo>
88
      <documentation>
89
         No API is associated with this extension point.
90
      </documentation>
91
   </annotation>
92
93
   <annotation>
94
      <appInfo>
95
         <meta.section type="implementation"/>
96
      </appInfo>
97
      <documentation>
98
         No implementation is associated with this extension point.
99
      </documentation>
100
   </annotation>
101
102
   <annotation>
103
      <appInfo>
104
         <meta.section type="copyright"/>
105
      </appInfo>
106
      <documentation>
107
         
108
      </documentation>
109
   </annotation>
110
111
</schema>
(-)/home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/WSITestToolsPlugin.java (+37 lines)
Lines 34-42 Link Here
34
  protected static final String VALIDATOR_EXT_ID = PLUGIN_ID + ".validator";
34
  protected static final String VALIDATOR_EXT_ID = PLUGIN_ID + ".validator";
35
  protected static final String TAD_VERSION_EXT_ID = PLUGIN_ID +
35
  protected static final String TAD_VERSION_EXT_ID = PLUGIN_ID +
36
          ".tad_versions";
36
          ".tad_versions";
37
  protected static final String REPORT_ARTIFACT_TYPES_EXT_ID = PLUGIN_ID +
38
          ".reportArtifactTypes";
37
  protected static final String ATT_CLASS = "class";
39
  protected static final String ATT_CLASS = "class";
38
  protected static final String ATT_TAD_NAME = "tad_name";
40
  protected static final String ATT_TAD_NAME = "tad_name";
39
  protected static final String ATT_TAD_VERSION = "version";
41
  protected static final String ATT_TAD_VERSION = "version";
42
  protected static final String ATT_ARTIFACT_TYPE = "artifactType";
40
  //protected ResourceBundle resourcebundle = null;
43
  //protected ResourceBundle resourcebundle = null;
41
44
42
  /* Holds validators read from the platform registry.  Lazy initialized in
45
  /* Holds validators read from the platform registry.  Lazy initialized in
Lines 50-55 Link Here
50
   * Lazy initialized in computeTADVersions().  */
53
   * Lazy initialized in computeTADVersions().  */
51
  private String tadVersions[][];
54
  private String tadVersions[][];
52
55
56
  /* Holds artifact type names for reporting read from the platform registry.
57
   * Lazy initialized in getAllReportArtifactTypes().  */
58
  private String reportArtifactTypes[];
59
53
  /**
60
  /**
54
   * Constructor for wsiTestToolsPlugin.
61
   * Constructor for wsiTestToolsPlugin.
55
   * @param descriptor an IPluginDescriptor object.
62
   * @param descriptor an IPluginDescriptor object.
Lines 168-171 Link Here
168
          tadVersions = computeTADVersions();
175
          tadVersions = computeTADVersions();
169
      return tadVersions;
176
      return tadVersions;
170
  }
177
  }
178
  
179
  /* Computes the list of artifact types by scanning the platform registry. */
180
  private String[] computeReportArtifactTypes() {
181
      IExtensionRegistry registry = Platform.getExtensionRegistry();
182
      IExtensionPoint extensionPoint = registry.getExtensionPoint(
183
              REPORT_ARTIFACT_TYPES_EXT_ID);
184
      IExtension[] extensions = extensionPoint.getExtensions();
185
      ArrayList results = new ArrayList();
186
      for (int i = 0; i < extensions.length; i++) {
187
          IConfigurationElement reportArtifactElements[] = extensions[i].
188
                  getConfigurationElements();
189
          for (int j = 0; j < reportArtifactElements.length; j++) {
190
              String reportArtifact = reportArtifactElements[j].getAttribute(
191
                      ATT_ARTIFACT_TYPE);
192
              results.add(reportArtifact);
193
          }
194
      }
195
      return (String[]) results.toArray(new String[0]);
196
  }
197
  
198
  /**
199
   * Find all report artifact types tags found in the platform registry
200
   * extension points org.eclipse.wst.wsi.reportArtifactTypes.
201
   * @return an array containing these Strings
202
   */
203
  public String[] getAllReportArtifactTypes() {
204
      if (reportArtifactTypes == null)
205
          reportArtifactTypes = computeReportArtifactTypes();
206
      return reportArtifactTypes;
207
  }
171
}
208
}
(-)/home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/report/impl/EntryImpl.java (-9 / +10 lines)
Lines 14-19 Link Here
14
import java.io.StringWriter;
14
import java.io.StringWriter;
15
15
16
import org.eclipse.wst.wsi.internal.core.WSIConstants;
16
import org.eclipse.wst.wsi.internal.core.WSIConstants;
17
import org.eclipse.wst.wsi.internal.core.document.DocumentElement;
17
import org.eclipse.wst.wsi.internal.core.log.MessageEntry;
18
import org.eclipse.wst.wsi.internal.core.log.MessageEntry;
18
import org.eclipse.wst.wsi.internal.core.profile.validator.EnvelopeValidator;
19
import org.eclipse.wst.wsi.internal.core.profile.validator.EnvelopeValidator;
19
import org.eclipse.wst.wsi.internal.core.profile.validator.MessageValidator;
20
import org.eclipse.wst.wsi.internal.core.profile.validator.MessageValidator;
Lines 206-232 Link Here
206
207
207
    if (this.referenceID != null)
208
    if (this.referenceID != null)
208
      pw.print(
209
      pw.print(
209
        WSIConstants.ATTR_REFERENCE_ID + "=\"" + XMLUtils.xmlEscapedString(this.referenceID) + "\"");
210
        WSIConstants.ATTR_REFERENCE_ID + "=\"" + XMLUtils.xmlEscapedString(this.referenceID) + "\" ");
210
211
211
    // If service name was set then add it
212
    // If service name was set then add it
212
    //if (parentElementName != null) {
213
    //if (parentElementName != null) {
213
    //  pw.print(" " + WSIConstants.ATTR_PARENT_ELEMENT_NAME + "=\"" + this.parentElementName + "\"");
214
    //  pw.print(" " + WSIConstants.ATTR_PARENT_ELEMENT_NAME + "=\"" + this.parentElementName + "\"");
214
    //}
215
    //}
215
216
216
    // End element
217
    pw.println(">");
218
219
    // ADD: Need to check for config option that specifies 
217
    // ADD: Need to check for config option that specifies 
220
    //      that log entries should be added
218
    //      that log entries should be added
221
219
222
    // If target is a log entry, then add reference to it
220
    // If target is a log entry, then add reference to it
223
    if ((entryType != null)
221
    if ((entryType != null)
224
      && (entryType.getArtifactType().equals(MessageValidator.TYPE_MESSAGE))
222
      && (entryType.getArtifactType().isLoggable())
225
      && (showLogEntry))
223
      && (showLogEntry)) {
226
    {
224
        DocumentElement logEntry = (DocumentElement) entryDetail;
227
      MessageEntry logEntry = (MessageEntry) entryDetail;
225
        pw.println("value=\"" + logEntry.toXMLString(
228
      pw.println(logEntry.toXMLString(WSIConstants.NS_NAME_WSI_LOG));
226
                WSIConstants.NS_NAME_WSI_LOG) + "\" ");
229
    }
227
    }
228
    
229
    // End element
230
    pw.println(">");
230
231
231
    return sw.toString();
232
    return sw.toString();
232
  }
233
  }
(-)/home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/src/org/eclipse/wst/wsi/internal/core/util/ArtifactType.java (+16 lines)
Lines 10-16 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.wst.wsi.internal.core.util;
11
package org.eclipse.wst.wsi.internal.core.util;
12
12
13
import java.util.ArrayList;
13
import java.util.HashMap;
14
import java.util.HashMap;
15
import java.util.List;
14
import java.util.Map;
16
import java.util.Map;
15
17
16
import org.eclipse.wst.wsi.internal.WSITestToolsPlugin;
18
import org.eclipse.wst.wsi.internal.WSITestToolsPlugin;
Lines 30-35 Link Here
30
32
31
  private static Map typeMap;
33
  private static Map typeMap;
32
  
34
  
35
  private static List loggableArtifactTypes; 
36
  
33
  /**
37
  /**
34
   * Create artifact type.
38
   * Create artifact type.
35
   */
39
   */
Lines 46-51 Link Here
46
  {
50
  {
47
    return type;
51
    return type;
48
  }
52
  }
53
  
54
  /** Returns true if this artifact can be output to the report. */
55
  public boolean isLoggable() {
56
      if (loggableArtifactTypes == null) {
57
          String artifactArray[] = WSITestToolsPlugin.getPlugin().
58
                  getAllReportArtifactTypes();
59
          loggableArtifactTypes = new ArrayList(artifactArray.length);
60
          for (int i = 0; i < artifactArray.length; i++)
61
              loggableArtifactTypes.add(artifactArray[i]);
62
      }
63
      return loggableArtifactTypes.contains(type);
64
  }
49
65
50
  /**
66
  /**
51
   * Instantiates a new artifact type and adds it to the registry map
67
   * Instantiates a new artifact type and adds it to the registry map
(-)/home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/plugin.properties (+1 lines)
Lines 17-19 Link Here
17
_UI_WSI_FRAMEWORK_MESSAGE_VALIDATOR = WS-I Framework Message Validator
17
_UI_WSI_FRAMEWORK_MESSAGE_VALIDATOR = WS-I Framework Message Validator
18
_UI_WSI_FRAMEWORK_ENVELOPE_VALIDATOR = WS-I Framework Envelope Validator
18
_UI_WSI_FRAMEWORK_ENVELOPE_VALIDATOR = WS-I Framework Envelope Validator
19
_UI_WSI_BP_TAD_VERSIONS = WS-I Basic Profile TAD Versions
19
_UI_WSI_BP_TAD_VERSIONS = WS-I Basic Profile TAD Versions
20
_UI_WSI_BP_REPORT_ARTIFACTS = WS-I Basic Profile Report Artifacts
(-)/home/craigcw/eclipse/workspace-3.2/org.eclipse.wst.wsi/plugin.xml (+8 lines)
Lines 15-20 Link Here
15
<plugin>
15
<plugin>
16
   <extension-point id="validator" name="WS-I validator" schema="schema/validator.exsd"/>
16
   <extension-point id="validator" name="WS-I validator" schema="schema/validator.exsd"/>
17
   <extension-point id="tad_versions" name="TAD version" schema="schema/tad_versions.exsd"/>
17
   <extension-point id="tad_versions" name="TAD version" schema="schema/tad_versions.exsd"/>
18
   <extension-point id="reportArtifactTypes" name="report artifact type" schema="schema/reportArtifactTypes.exsd"/>
18
19
19
     <extension
20
     <extension
20
         id="wsdlWSIValidator"
21
         id="wsdlWSIValidator"
Lines 70-73 Link Here
70
        			tad_name="Attachments Profile [1.0] (with Basic Profile [1.1] and Simple Soap Binding Profile [1.0]) Test Assertions"
71
        			tad_name="Attachments Profile [1.0] (with Basic Profile [1.1] and Simple Soap Binding Profile [1.0]) Test Assertions"
71
        			version="1.0.0"/>
72
        			version="1.0.0"/>
72
   </extension>
73
   </extension>
74
   <extension
75
           id="bpReportArtifacts"
76
           name="%_UI_WSI_BP_REPORT_ARTIFACTS"
77
           point="org.eclipse.wst.wsi.reportArtifactTypes">
78
        <reportArtifactType
79
        			artifactType="message"/>
80
   </extension>
73
</plugin>
81
</plugin>

Return to bug 149062