Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 126529 | Differences between
and this patch

Collapse All | Expand All

(-)plugin.properties (+2 lines)
Lines 17-22 Link Here
17
17
18
# Extension point names
18
# Extension point names
19
XP_WEB_SERVICE_LOCATOR=Web Service Locator
19
XP_WEB_SERVICE_LOCATOR=Web Service Locator
20
X_WEB_SERVICE_LOCATOR_WORKSPACE=Workspace Web Service Locator
21
X_WEB_SERVICE_LOCATOR_CATEGORY_WORKSPACE=Workspace WSDL documents
20
22
21
MSG_ERROR_UNABLE_TO_START_MONITOR=IWAB0001E Unable to monitor port {0} of {1}.
23
MSG_ERROR_UNABLE_TO_START_MONITOR=IWAB0001E Unable to monitor port {0} of {1}.
22
24
(-)plugin.xml (-2 / +10 lines)
Lines 5-19 Link Here
5
5
6
   <!-- The following extension point is internal, though likely to be promoted for public use, possibly with changes, in a future release. -->
6
   <!-- The following extension point is internal, though likely to be promoted for public use, possibly with changes, in a future release. -->
7
   <extension-point id="locator" name="%XP_WEB_SERVICE_LOCATOR" schema="schema/webServiceLocator.exsd"/>
7
   <extension-point id="locator" name="%XP_WEB_SERVICE_LOCATOR" schema="schema/webServiceLocator.exsd"/>
8
9
   <!-- Extension providing workspace WSDL discovery -->   
8
   <extension
10
   <extension
9
         point="org.eclipse.wst.ws.locator">
11
         point="org.eclipse.wst.ws.locator">
12
13
      <webServiceLocatorCategory
14
            id="org.eclipse.wst.ws.internal.wsfinder.category.workspace"
15
            label="%X_WEB_SERVICE_LOCATOR_CATEGORY_WORKSPACE"/>
16
10
      <webServiceLocator
17
      <webServiceLocator
11
            class="org.eclipse.wst.ws.internal.wsfinder.WorkspaceWSDLLocator"
18
            class="org.eclipse.wst.ws.internal.wsfinder.WorkspaceWSDLLocator"
12
            id="org.eclipse.wst.ws.internal.wsfinder.WorkspaceWSDLLocator"
19
            id="org.eclipse.wst.ws.internal.wsfinder.WorkspaceWSDLLocator"
13
            label="workspacewsdllocator">
20
            category="org.eclipse.wst.ws.internal.wsfinder.category.workspace"
21
            label="%X_WEB_SERVICE_LOCATOR_WORKSPACE">
14
         org.eclipse.wst.ws.internal.wsfinder
22
         org.eclipse.wst.ws.internal.wsfinder
15
      </webServiceLocator>
23
      </webServiceLocator>
16
   </extension>
17
24
25
   </extension>
18
    
26
    
19
</plugin>
27
</plugin>
(-)schema/webServiceLocator.exsd (-17 / +89 lines)
Lines 6-38 Link Here
6
         <meta.schema plugin="org.eclipse.wst.ws" id="webServiceLocator" name="Web Service Locator"/>
6
         <meta.schema plugin="org.eclipse.wst.ws" id="webServiceLocator" name="Web Service Locator"/>
7
      </appInfo>
7
      </appInfo>
8
      <documentation>
8
      <documentation>
9
         Extension point is provided to register locators that extend AbstractWebServiceLocator.  These locators are used by WebServiceFinder to locate web services for the purpose of web service discovery.
9
         This extension point is provided to register locators that extend AbstractWebServiceLocator.
10
         These locators are used by WebServiceFinder to locate Web services for the purpose of Web service discovery.
10
      </documentation>
11
      </documentation>
11
   </annotation>
12
   </annotation>
12
13
13
   <element name="extension">
14
   <element name="extension">
14
      <complexType>
15
      <complexType>
15
         <sequence>
16
         <all>
16
            <element ref="webServiceLocator" minOccurs="1" maxOccurs="unbounded"/>
17
            <element ref="webServiceLocator" minOccurs="1" maxOccurs="unbounded"/>
17
         </sequence>
18
            <element ref="webServiceLocatorCategory" minOccurs="1" maxOccurs="unbounded"/>
19
         </all>
18
         <attribute name="point" type="string" use="required">
20
         <attribute name="point" type="string" use="required">
19
            <annotation>
21
            <annotation>
20
               <documentation>
22
               <documentation>
21
                  a fully qualified identifier of the target extension point
23
                  A fully qualified identifier of the target extension point.
22
               </documentation>
24
               </documentation>
23
            </annotation>
25
            </annotation>
24
         </attribute>
26
         </attribute>
25
         <attribute name="id" type="string">
27
         <attribute name="id" type="string">
26
            <annotation>
28
            <annotation>
27
               <documentation>
29
               <documentation>
28
                  an optional identifier of the extension instance
30
                  An optional identifier of the extension instance.
29
               </documentation>
31
               </documentation>
30
            </annotation>
32
            </annotation>
31
         </attribute>
33
         </attribute>
32
         <attribute name="name" type="string">
34
         <attribute name="name" type="string">
33
            <annotation>
35
            <annotation>
34
               <documentation>
36
               <documentation>
35
                  an optional name of the extension instance
37
                  An optional name of the extension instance.
36
               </documentation>
38
               </documentation>
37
               <appInfo>
39
               <appInfo>
38
                  <meta.attribute translatable="true"/>
40
                  <meta.attribute translatable="true"/>
Lines 44-72 Link Here
44
46
45
   <element name="webServiceLocator">
47
   <element name="webServiceLocator">
46
      <complexType>
48
      <complexType>
47
         <attribute name="id" type="string">
49
         <attribute name="id" type="string" use="required">
50
            <annotation>
51
               <documentation>
52
                  A unique identifier for the Web Service Locator.
53
               </documentation>
54
            </annotation>
55
         </attribute>
56
         <attribute name="class" type="string" use="required">
48
            <annotation>
57
            <annotation>
49
               <documentation>
58
               <documentation>
50
                  &lt;p&gt;
59
                  The fully qualified class name for the locator class which extends AbstractWebServiceLocator.
51
&lt;code&gt;id&lt;/code&gt;Unique identifier for the extension.
52
&lt;p&gt;
53
&lt;code&gt;class&lt;/code&gt;The fully qualified class name for the locator class which extends AbstractWebServiceLocator.
54
&lt;p&gt;
55
&lt;code&gt;label&lt;/code&gt;A label for this locator.
56
               </documentation>
60
               </documentation>
57
            </annotation>
61
            </annotation>
58
         </attribute>
62
         </attribute>
59
         <attribute name="class" type="string">
63
         <attribute name="label" type="string" use="required">
64
            <annotation>
65
               <documentation>
66
                  A short label to identify the Web Service Locator.
67
               </documentation>
68
               <appInfo>
69
                  <meta.attribute translatable="true"/>
70
               </appInfo>
71
            </annotation>
72
         </attribute>
73
         <attribute name="description" type="string">
74
            <annotation>
75
               <documentation>
76
                  Optionally, a description of the purpose of the Web Service Locator.
77
               </documentation>
78
               <appInfo>
79
                  <meta.attribute translatable="true"/>
80
               </appInfo>
81
            </annotation>
82
         </attribute>
83
         <attribute name="icon" type="string">
84
            <annotation>
85
               <documentation>
86
                  Optionally, an icon that represents the Web Service Locator.
87
               </documentation>
88
            </annotation>
89
         </attribute>
90
         <attribute name="category" type="string">
91
            <annotation>
92
               <documentation>
93
                  Optionally, a category to which the Web Service Locator should belong.
94
               </documentation>
95
            </annotation>
96
         </attribute>
97
      </complexType>
98
   </element>
99
100
   <element name="webServiceLocatorCategory">
101
      <complexType>
102
         <attribute name="id" type="string" use="required">
103
            <annotation>
104
               <documentation>
105
                  A unique identifier for the category of Web Service Locators.
106
               </documentation>
107
            </annotation>
108
         </attribute>
109
         <attribute name="label" type="string" use="required">
110
            <annotation>
111
               <documentation>
112
                  A short label for the category of Web Service Locators.
113
               </documentation>
114
               <appInfo>
115
                  <meta.attribute translatable="true"/>
116
               </appInfo>
117
            </annotation>
118
         </attribute>
119
         <attribute name="description" type="string">
120
            <annotation>
121
               <documentation>
122
                  Optionally, a description of the category of Web Service Locators.
123
               </documentation>
124
               <appInfo>
125
                  <meta.attribute translatable="true"/>
126
               </appInfo>
127
            </annotation>
128
         </attribute>
129
         <attribute name="icon" type="string">
60
            <annotation>
130
            <annotation>
61
               <documentation>
131
               <documentation>
62
                  
132
                  Optionally, an icon that represents the category of Web Service Locators.
63
               </documentation>
133
               </documentation>
64
            </annotation>
134
            </annotation>
65
         </attribute>
135
         </attribute>
66
         <attribute name="label" type="string">
136
         <attribute name="category" type="string">
67
            <annotation>
137
            <annotation>
68
               <documentation>
138
               <documentation>
69
                  
139
                  Optionally, a parent category under which the Web Service Locator
140
                  category should be grouped. If absent, the category is considered
141
                  to be a root category.
70
               </documentation>
142
               </documentation>
71
            </annotation>
143
            </annotation>
72
         </attribute>
144
         </attribute>
(-)src/org/eclipse/wst/ws/internal/wsfinder/WebServiceFinder.java (-12 / +34 lines)
Lines 30-37 Link Here
30
	private static WebServiceFinder instance = null;
30
	private static WebServiceFinder instance = null;
31
	
31
	
32
	private static final String CLASS_ATTRIBUTE= "class"; //$NON-NLS-1$
32
	private static final String CLASS_ATTRIBUTE= "class"; //$NON-NLS-1$
33
	private static final String CATEGORY_ATTRIBUTE= "category"; //$NON-NLS-1$
33
		
34
		
34
	public WebServiceFinder()	
35
	private WebServiceFinder()	
35
	{
36
	{
36
		super();
37
		super();
37
	}
38
	}
Lines 58-84 Link Here
58
	 */
59
	 */
59
	public Iterator getWebServices()
60
	public Iterator getWebServices()
60
	{
61
	{
62
		return getWebServices(null);
63
	}
64
65
	/**
66
	 * Returns an iterator of WebServiceInfo objects which represent web services found by locators that
67
	 * have registered using the org.eclipse.wst.ws.locator extension point under the given category.
68
	 * Locators must extend {@link AbstractWebServiceLocator}.
69
	 * 
70
	 * Callers can use the getter methods on the WebServiceInfo object to retrieve information on the 
71
	 * web services found.  The WebServiceFinder cannot guarantee the level of detail contained in WebServiceInfo
72
	 * objects returned.  This is left to the locator implementations.
73
	 *  
74
	 * @return iterator of WebServiceInfo objects
75
	 * @param category The category of locators to use
76
	 */
77
	public Iterator getWebServices(String category)
78
	{
61
		Vector webServices = new Vector();
79
		Vector webServices = new Vector();
62
80
63
		WebServiceLocatorRegistry wslr = WebServiceLocatorRegistry.getInstance();
81
		WebServiceLocatorRegistry wslr = WebServiceLocatorRegistry.getInstance();
64
82
65
		IConfigurationElement[] regElements = wslr.getConfigElements();
83
		IConfigurationElement[] regElements = wslr.getConfigElements();
66
		for (int i = 0; i < regElements.length; i++) {
84
		for (int i = 0; i < regElements.length; i++)
67
			try{
85
		{
68
			    Object obj = regElements[i].createExecutableExtension(CLASS_ATTRIBUTE);
86
			try
69
			    
87
			{
70
			    if (obj instanceof IWebServiceLocator)
88
			    String cat = regElements[i].getAttributeAsIs(CATEGORY_ATTRIBUTE);
89
			    if (cat == null || cat.equals(category))
71
			    {
90
			    {
72
			    	IWebServiceLocator wsl = (IWebServiceLocator)obj;
91
			    	Object obj = regElements[i].createExecutableExtension(CLASS_ATTRIBUTE);
73
			    	List wsList = wsl.getWebServices();
92
			    	if (obj instanceof IWebServiceLocator)
74
			    	webServices.addAll(wsList);
93
			    	{
75
			     }				
94
			    		IWebServiceLocator wsl = (IWebServiceLocator)obj;
95
			    		List wsList = wsl.getWebServices();
96
			    		webServices.addAll(wsList);
97
			    	}
98
			    }
76
			} 
99
			} 
77
			catch (CoreException ex){
100
			catch (CoreException ex){
78
				
101
				// Quietly bypass any IWebServiceLocators that failed to be loaded.
79
			}		
102
			}		
80
		} 
103
		} 
81
		return webServices.iterator();	
104
		return webServices.iterator();	
82
	} 
105
	} 
83
	
84
}
106
}

Return to bug 126529