Jump to: navigation, search

Difference between revisions of "SCA/Components/SCA XML Editor"

< SCA
 
(23 intermediate revisions by 3 users not shown)
Line 1: Line 1:
TODO: add screenshots.
+
<br />
 +
<center>[[Image:ScaCompositeXmlEditorOverview.gif]]</center>
 +
<center><u>Overview of the SCA XML Editor</u></center>
  
  
 
== Basic Features ==
 
== Basic Features ==
  
 
+
The SCA Composite XML editor extends and specializes for SCA composites the XML editor provided by the WTP Eclipse project.
[[Image:ScaCompositeXmlEditorOverview.gif|thumb|Editor overview]]
+
 
+
The SCA Composite XML editor extends and specialized the XML editor provided by the WTP Eclipse project.
+
 
<br />Thus, this editor inherits from the following features :
 
<br />Thus, this editor inherits from the following features :
* syntax highlighting
+
* Syntax highlighting
* text formatting  
+
* Text formatting  
 
* XSD-based validation
 
* XSD-based validation
 +
* Contextual Information
 
* ...
 
* ...
  
As a basic feature, the editor is automatically associated with ''*.composite'' files. It also uses the SCA XSD files to validate your file and provide auto-completion for mark-ups and attribute names.
+
As a basic feature, the editor is automatically associated with ''*.composite'' files.  
 +
It also uses the XSD files defining SCA elements, to validate your file and provide auto-completion for mark-ups and attribute names.
  
 +
<br />
  
== Advanced Features ==
+
== Extended Features ==
  
This editor provides three additional features the default XML editor does not offer.
+
This editor has been extended to provide additional features specific to SCA composites.
  
  
 
=== Attribute Values Proposals ===
 
=== Attribute Values Proposals ===
  
The first one consists in making auto-completion proposals for attribute values. Once you have entered an attribute name and that you are about to define its value, you can ask for auto-completion proposals by typing in '''ctrl + space'''. If the attribute is one of the supported ones, then you should get some proposals based on context information.
+
It consists in making auto-completion proposals for attribute values. Once you have entered an attribute name and are about to define its value, you can ask for auto-completion proposals by typing '''ctrl + space'''. If the attribute is one of the supported ones, then you should get proposals based on context information.
  
 +
<br />Here is an example of the mark-up auto-completion provided by the WTP editor.<br /><br />
 +
[[Image:ScaCompositeXmlEditorACsample1.gif|Default auto-completion (mark-up and attribute names)]]
 +
 +
<br /><br />Here is an example of auto-completion for attribute values ('''promote''' attribute).<br /><br />
 +
[[Image:ScaCompositeXmlEditorACsample2.gif|Auto-completion for attribute values]]
 +
 +
<br /><br />
 
Currently, the editor proposes values for the following attributes:
 
Currently, the editor proposes values for the following attributes:
 
# attribute '''promote''' from composite '''service''' mark-up
 
# attribute '''promote''' from composite '''service''' mark-up
Line 34: Line 43:
  
 
The five first quoted attributes will get SCA relative URIs ( '''componentName/serviceName''' or '''componentName/referenceName''' ) as proposals.
 
The five first quoted attributes will get SCA relative URIs ( '''componentName/serviceName''' or '''componentName/referenceName''' ) as proposals.
The proposals which are made take in account included composites, which means that proposals will include components from included composites.
+
The proposals which are made take in account included composites, which means that proposals will include elements from included composites.
Composite inclusion is discussed in the next section.
+
Composite inclusion is discussed farther.
  
 +
<br />
 +
 +
=== Extended Mark-ups Proposals & Preference Page ===
 +
 +
Regarding user assistance, the WTP XML editor uses a catalog of XSD files to make proposals for mark-ups and attributes.
 +
However, it often appears that XSD files can't be all embedded into Eclipse plug-ins, most of the time because of license or copyright issues.
 +
Which lets two solutions: let the user download and register these XSD files in the XSD catalog, or provide another mechanism to simulate these XSD files.
 +
 +
The second option was chosen and this is why a preference page was defined for the SCA XML-based editors.
 +
It allows to define platforms, namespaces, bindings, implementations and interfaces. This mechanism replace XSD files.
 +
 +
This preference page permits to complete the user-assistance proposals when the user asks for it, by providing elements which are not described in the registered XSDs. The proposals are sensitive to the presence of the platform namespaces. As an example, if you want to get proposals for Tuscany specific elements, you have to declare the Tuscany prefix (the best choice being to define it in the composite element, at the root of the document).
 +
 +
The information registered in this preference page was retrieved from the platforms documentation, but can be updated by any user.
 +
 +
<br /><center>[[Image:ScaCompositeXmlEditorPF1.gif]]</center><br />
 +
<center>[[Image:ScaCompositeXmlEditorPF2.gif]]</center><br />
 +
<center>[[Image:ScaCompositeXmlEditorPF3.gif]]</center><br />
  
 
=== Composite Inclusions ===
 
=== Composite Inclusions ===
  
SCA assembly model provides an inclusion mechanism which allows a composite file to include several other composite files. A good example of this mechanism is available in the '''assembly model''' document of the SCA specification.
+
SCA assembly model provides an inclusion mechanism which allows a composite file to include other composite files. A good example of this mechanism is available in the '''assembly model''' document of the SCA specification.
  
 
The SCA Composite XML editor can help you when using composite inclusion.
 
The SCA Composite XML editor can help you when using composite inclusion.
When typing <code>&lt;include name"</code>, you can ask for auto-completion proposals by typing in '''ctrl + space'''. This will display the composites available in your project (and not already included in your file). The proposals only include composites which are valid XML files. Besides, they must have defined the '''targetNamespace''' attribute.
+
When typing <code>&lt;include name"</code>, you can ask for auto-completion proposals by typing in '''ctrl + space'''. This will display the composites available in your project (and not already included in your file).  
  
 +
<br />Example: include the composite ''Restaurant'' whose target namespace is ''http://tuscany/sample/restaurant''.
 +
<br />[[Image:ScaCompositeXmlEditorACIncludeSample1.gif]]
 +
 +
<br />
 +
The proposals only include composites which are valid XML files. Besides, they must have defined the '''targetNamespace''' attribute.
 
Since include names are QNames, the editor makes sure to add the namespace prefix to get a correct result. If the namespace URI was already defined in your document, the proposal will reuse its prefix. Otherwise, it will generate one and add it in the mark-up.
 
Since include names are QNames, the editor makes sure to add the namespace prefix to get a correct result. If the namespace URI was already defined in your document, the proposal will reuse its prefix. Otherwise, it will generate one and add it in the mark-up.
  
Auto-completion will use included files to make proposals.
+
<br />Let's take the previous example and let's define the namespace ''http://tuscany/sample/restaurant'' in the <code>composite</code> top element.
 +
<br />[[Image:ScaCompositeXmlEditorACIncludeSample3.gif]]
 +
 
 +
<br />It then leads to the following proposal.
 +
<br />[[Image:ScaCompositeXmlEditorACIncludeSample4.gif]]
 +
 
 +
<br />Auto-completion uses included files to make proposals.
 
However, notice that recursive inclusions are not managed by this editor, since it is still not clear about how runtime platforms will handle it.
 
However, notice that recursive inclusions are not managed by this editor, since it is still not clear about how runtime platforms will handle it.
 +
 +
<br />
  
 
=== SCA Outline View ===
 
=== SCA Outline View ===
  
Eventually, the editor provides a SCA specific outline view. This view displays composite elements with their icon (the same one than those used by the SCA Composite Designer). As the previous features, this outline integrates included files. For the moment, the view provides very basic actions, but they will be extended in a future version.
+
Eventually, the editor provides a SCA specific outline view. This view displays composite elements with their icon (the same than those used by the SCA Composite Designer). Like the previous features, this outline handles file inclusions. For the moment, the view only provides basic actions. They will be extended in a future version.
 +
 
 +
<br />
 +
<center>[[Image:ScaCompositeXmlEditorOutline.gif]]</center>
 +
<br />
 +
 
 +
=== Edition of SCA Component Types ===
 +
 
 +
This editor has been extended to edit *.componentType files.
 +
As a result, the features provided when editing composite files are also available when editing componentType files. This editor also proposes a wizard to create such kind of file.
 +
 
 +
 
 +
[[Category:SOA_Tools]]
 +
[[Category:SOA]]
 +
[[Category:STP]]
 +
[[Category:SCA]]

Latest revision as of 09:55, 8 July 2010


ScaCompositeXmlEditorOverview.gif
Overview of the SCA XML Editor


Basic Features

The SCA Composite XML editor extends and specializes for SCA composites the XML editor provided by the WTP Eclipse project.
Thus, this editor inherits from the following features :

  • Syntax highlighting
  • Text formatting
  • XSD-based validation
  • Contextual Information
  • ...

As a basic feature, the editor is automatically associated with *.composite files. It also uses the XSD files defining SCA elements, to validate your file and provide auto-completion for mark-ups and attribute names.


Extended Features

This editor has been extended to provide additional features specific to SCA composites.


Attribute Values Proposals

It consists in making auto-completion proposals for attribute values. Once you have entered an attribute name and are about to define its value, you can ask for auto-completion proposals by typing ctrl + space. If the attribute is one of the supported ones, then you should get proposals based on context information.


Here is an example of the mark-up auto-completion provided by the WTP editor.

Default auto-completion (mark-up and attribute names)



Here is an example of auto-completion for attribute values (promote attribute).

Auto-completion for attribute values



Currently, the editor proposes values for the following attributes:

  1. attribute promote from composite service mark-up
  2. attribute promote from composite reference mark-up
  3. attributes source and target from composite wire mark-up
  4. attribute target from component reference mark-up
  5. attribute name from composite include mark-up

The five first quoted attributes will get SCA relative URIs ( componentName/serviceName or componentName/referenceName ) as proposals. The proposals which are made take in account included composites, which means that proposals will include elements from included composites. Composite inclusion is discussed farther.


Extended Mark-ups Proposals & Preference Page

Regarding user assistance, the WTP XML editor uses a catalog of XSD files to make proposals for mark-ups and attributes. However, it often appears that XSD files can't be all embedded into Eclipse plug-ins, most of the time because of license or copyright issues. Which lets two solutions: let the user download and register these XSD files in the XSD catalog, or provide another mechanism to simulate these XSD files.

The second option was chosen and this is why a preference page was defined for the SCA XML-based editors. It allows to define platforms, namespaces, bindings, implementations and interfaces. This mechanism replace XSD files.

This preference page permits to complete the user-assistance proposals when the user asks for it, by providing elements which are not described in the registered XSDs. The proposals are sensitive to the presence of the platform namespaces. As an example, if you want to get proposals for Tuscany specific elements, you have to declare the Tuscany prefix (the best choice being to define it in the composite element, at the root of the document).

The information registered in this preference page was retrieved from the platforms documentation, but can be updated by any user.


ScaCompositeXmlEditorPF1.gif

ScaCompositeXmlEditorPF2.gif

ScaCompositeXmlEditorPF3.gif

Composite Inclusions

SCA assembly model provides an inclusion mechanism which allows a composite file to include other composite files. A good example of this mechanism is available in the assembly model document of the SCA specification.

The SCA Composite XML editor can help you when using composite inclusion. When typing <include name", you can ask for auto-completion proposals by typing in ctrl + space. This will display the composites available in your project (and not already included in your file).


Example: include the composite Restaurant whose target namespace is http://tuscany/sample/restaurant.
ScaCompositeXmlEditorACIncludeSample1.gif


The proposals only include composites which are valid XML files. Besides, they must have defined the targetNamespace attribute. Since include names are QNames, the editor makes sure to add the namespace prefix to get a correct result. If the namespace URI was already defined in your document, the proposal will reuse its prefix. Otherwise, it will generate one and add it in the mark-up.


Let's take the previous example and let's define the namespace http://tuscany/sample/restaurant in the composite top element.
ScaCompositeXmlEditorACIncludeSample3.gif


It then leads to the following proposal.
ScaCompositeXmlEditorACIncludeSample4.gif


Auto-completion uses included files to make proposals. However, notice that recursive inclusions are not managed by this editor, since it is still not clear about how runtime platforms will handle it.


SCA Outline View

Eventually, the editor provides a SCA specific outline view. This view displays composite elements with their icon (the same than those used by the SCA Composite Designer). Like the previous features, this outline handles file inclusions. For the moment, the view only provides basic actions. They will be extended in a future version.


ScaCompositeXmlEditorOutline.gif


Edition of SCA Component Types

This editor has been extended to edit *.componentType files. As a result, the features provided when editing composite files are also available when editing componentType files. This editor also proposes a wizard to create such kind of file.