extension-point schema

本文介绍了一个Eclipse UI插件扩展点的具体示例。通过解析com.bolour.sample.eclipse.service.ui_1.0.0的扩展点模式文件,展示了如何定义扩展点及其属性,以及如何在plug-in.xml中实现这些定义来提供具体的服务功能。

先看个例子,com.bolour.sample.eclipse.service.ui_1.0.0的extension-point schema,省略了部分不重要的内容.

<?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE -->
<schema targetNamespace="com.bolour.sample.eclipse.services.ui">
<annotation>
      <appInfo>
         <meta.schema plugin="com.bolour.sample.eclipse.services.ui" id="functions" name="Functions"/>
      </appInfo>
      <documentation>
         Each extension provides one or more service callbacks functions.
         For each function, the service UI plug-in will add
         a button for invoking the  function, and a label that identifies
         the function, to its user interface. The UI plug-in also provides an input
         field and a result field that are shared between all function.
         The function takes a &lt;i&gt;long&lt;/i&gt; as its input, and returns
         a &lt;i&gt;long&lt;/i&gt; as its output.
      </documentation>
   </annotation>

   <element name="extension">
      <complexType>
         <sequence>
            <element ref="function" minOccurs="1" maxOccurs="unbounded"/>
         </sequence>

         <attribute name="point" type="string" use="required">
            <annotation>
               <documentation>
                  The extension-point of this extension.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="id" type="string">
            <annotation>
               <documentation>
                  Extension identifier.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  Name of this extension.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   <element name="function">
      <complexType>
         <attribute name="name" type="string">
            <annotation>
               <documentation>
                  The name of the function.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="class" type="string">
            <annotation>
               <documentation>
                  The specific class implementing the function.
               </documentation>
            </annotation>
         </attribute>
         <attribute name="constant" type="string">
            <annotation>
               <documentation>
               A constant parameter used in the computation of the function.
               This constant may be interpreted differently by different extension members.
               For example, in a member that provides an exponentiation function,
               the constant is interpreted as the exponent.
               </documentation>
            </annotation>
         </attribute>
      </complexType>
   </element>

   </schema>
 

再看multplication的plug-in.xml, 可以看出,这个plug-in.xml就是依据上面schema的格式定义的。首先,extension element包括point, name, id三个域,以及若干个function域。每个function也是依照schema的定义,分别包括name,  class, constant三个域。

<?xml version="1.0" encoding="UTF-8"?>
<plugin
   id="com.bolour.sample.eclipse.service.multiplication"
   name="Multiplication Service"
   provider-name="Bolour Computing"
   version="1.0.0">

   <runtime>
      <library name="multiplication.jar">
         <export name="*"/>
      </library>
   </runtime>
   <requires>
      <import plugin="org.eclipse.ui"/>
      <import plugin="com.bolour.sample.eclipse.service.ui"/>
   </requires>


<!-- Multiplication operations for specific multiplication factors.  -->
<!-- The multiplication service interprets the attribute "constant" of a service
        as a multiplication factor to be used in the service's multiplication operation. -->
   <extension
         id="functions.multiplication"
         name="MultiplicationFunctions"
         point="com.bolour.sample.eclipse.service.ui.functions">

      <function
            name="DOUBLE"
            constant="2"
            class="com.bolour.sample.eclipse.service.multiplication.Multiplication">
      </function>
      <function
            name="TRIPLE"
            constant="3"
            class="com.bolour.sample.eclipse.service.multiplication.Multiplication">
      </function>
      <function
            name="QUADRUPLE"
            constant="4"
            class="com.bolour.sample.eclipse.service.multiplication.Multiplication">
      </function>
   </extension>

</plugin>

GetCapabilities Description: This method has been replaced by the more generic GetServices method. For capabilities of individual services refer to the GetServiceCapabilities methods. SOAP action: http://www.onvif.org/ver10/device/wsdl/GetCapabilities Input: [GetCapabilities] Category - optional, unbounded; [CapabilityCategory] List of categories to retrieve capability information on. - enum { 'All', 'Analytics', 'Device', 'Events', 'Imaging', 'Media', 'PTZ' } Output: [GetCapabilitiesResponse] Capabilities [Capabilities] Capability information. Analytics - optional; [AnalyticsCapabilities] Analytics capabilities XAddr [anyURI] Analytics service URI. RuleSupport [boolean] Indicates whether or not rules are supported. AnalyticsModuleSupport [boolean] Indicates whether or not modules are supported. Device - optional; [DeviceCapabilities] Device capabilities XAddr [anyURI] Device service URI. Network - optional; [NetworkCapabilities] Network capabilities. IPFilter - optional; [boolean] Indicates whether or not IP filtering is supported. ZeroConfiguration - optional; [boolean] Indicates whether or not zeroconf is supported. IPVersion6 - optional; [boolean] Indicates whether or not IPv6 is supported. DynDNS - optional; [boolean] Indicates whether or not is supported. Extension - optional; [NetworkCapabilitiesExtension] Dot11Configuration - optional; [boolean] Extension - optional; [NetworkCapabilitiesExtension2] System - optional; [SystemCapabilities] System capabilities. DiscoveryResolve [boolean] Indicates whether or not WS Discovery resolve requests are supported. DiscoveryBye [boolean] Indicates whether or not WS-Discovery Bye is supported. RemoteDiscovery [boolean] Indicates whether or not remote discovery is supported. SystemBackup [boolean] Indicates whether or not system backup is supported. SystemLogging [boolean] Indicates whether or not system logging is supported. FirmwareUpgrade [boolean] Indicates whether or not firmware upgrade is supported. SupportedVersions - unbounded; [OnvifVersion] Indicates supported ONVIF version(s). Major [int] Major version number. Minor [int] Two digit minor version number. If major version number is less than "16", X.0.1 maps to "01" and X.2.1 maps to "21" where X stands for Major version number. Otherwise, minor number is month of release, such as "06" for June. Extension - optional; [SystemCapabilitiesExtension] HttpFirmwareUpgrade - optional; [boolean] HttpSystemBackup - optional; [boolean] HttpSystemLogging - optional; [boolean] HttpSupportInformation - optional; [boolean] Extension - optional; [SystemCapabilitiesExtension2] IO - optional; [IOCapabilities] I/O capabilities. InputConnectors - optional; [int] Number of input connectors. RelayOutputs - optional; [int] Number of relay outputs. Extension - optional; [IOCapabilitiesExtension] Auxiliary - optional; [boolean] AuxiliaryCommands - optional, unbounded; [AuxiliaryData] Extension [IOCapabilitiesExtension2] Security - optional; [SecurityCapabilities] Security capabilities. TLS1.1 [boolean] Indicates whether or not TLS 1.1 is supported. TLS1.2 [boolean] Indicates whether or not TLS 1.2 is supported. OnboardKeyGeneration [boolean] Indicates whether or not onboard key generation is supported. AccessPolicyConfig [boolean] Indicates whether or not access policy configuration is supported. X.509Token [boolean] Indicates whether or not WS-Security X.509 token is supported. SAMLToken [boolean] Indicates whether or not WS-Security SAML token is supported. KerberosToken [boolean] Indicates whether or not WS-Security Kerberos token is supported. RELToken [boolean] Indicates whether or not WS-Security REL token is supported. Extension - optional; [SecurityCapabilitiesExtension] TLS1.0 [boolean] Extension - optional; [SecurityCapabilitiesExtension2] Dot1X [boolean] SupportedEAPMethod - optional, unbounded; [int] EAP Methods supported by the device. The int values refer to the IANA EAP Registry. RemoteUserHandling [boolean] Extension - optional; [DeviceCapabilitiesExtension] Events - optional; [EventCapabilities] Event capabilities XAddr [anyURI] Event service URI. WSSubscriptionPolicySupport [boolean] Indicates whether or not WS Subscription policy is supported. WSPullPointSupport [boolean] Indicates whether or not WS Pull Point is supported. WSPausableSubscriptionManagerInterfaceSupport [boolean] Indicates whether or not WS Pausable Subscription Manager Interface is supported. Imaging - optional; [ImagingCapabilities] Imaging capabilities XAddr [anyURI] Imaging service URI. Media - optional; [MediaCapabilities] Media capabilities XAddr [anyURI] Media service URI. StreamingCapabilities [RealTimeStreamingCapabilities] Streaming capabilities. RTPMulticast - optional; [boolean] Indicates whether or not RTP multicast is supported. RTP_TCP - optional; [boolean] Indicates whether or not RTP over TCP is supported. RTP_RTSP_TCP - optional; [boolean] Indicates whether or not RTP/RTSP/TCP is supported. Extension - optional; [RealTimeStreamingCapabilitiesExtension] Extension - optional; [MediaCapabilitiesExtension] ProfileCapabilities [ProfileCapabilities] MaximumNumberOfProfiles [int] Maximum number of profiles. PTZ - optional; [PTZCapabilities] PTZ capabilities XAddr [anyURI] PTZ service URI. Extension - optional; [CapabilitiesExtension] DeviceIO - optional; [DeviceIOCapabilities] XAddr [anyURI] VideoSources [int] VideoOutputs [int] AudioSources [int] AudioOutputs [int] RelayOutputs [int] Display - optional; [DisplayCapabilities] XAddr [anyURI] FixedLayout [boolean] Indication that the SetLayout command supports only predefined layouts. Recording - optional; [RecordingCapabilities] XAddr [anyURI] ReceiverSource [boolean] MediaProfileSource [boolean] DynamicRecordings [boolean] DynamicTracks [boolean] MaxStringLength [int] Search - optional; [SearchCapabilities] XAddr [anyURI] MetadataSearch [boolean] Replay - optional; [ReplayCapabilities] XAddr [anyURI] The address of the replay service. Receiver - optional; [ReceiverCapabilities] XAddr [anyURI] The address of the receiver service. RTP_Multicast [boolean] Indicates whether the device can receive RTP multicast streams. RTP_TCP [boolean] Indicates whether the device can receive RTP/TCP streams RTP_RTSP_TCP [boolean] Indicates whether the device can receive RTP/RTSP/TCP streams. SupportedReceivers [int] The maximum number of receivers supported by the device. MaximumRTSPURILength [int] The maximum allowed length for RTSP URIs. AnalyticsDevice - optional; [AnalyticsDeviceCapabilities] XAddr [anyURI] RuleSupport - optional; [boolean] Obsolete property. Extension - optional; [AnalyticsDeviceExtension] Extensions - optional; [CapabilitiesExtension2]这个接口该怎么回复一个支持media2的报文
最新发布
10-12
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值