Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

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

< SCA
(Basic Features)
(Attribute Values Proposals)
Line 23: Line 23:
 
=== 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 basic auto-completion provided by the WTP editor.<br /><br />
 
<br />Here is an example of the basic auto-completion provided by the WTP editor.<br /><br />
Line 40: Line 40:
  
 
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 in the next section.
  
 
<br />
 
<br />
 +
 
=== Composite Inclusions ===
 
=== Composite Inclusions ===
  

Revision as of 12:11, 25 April 2008


Basic Features

Editor overview

The SCA Composite XML editor extends and specialized 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
  • ...

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.



Advanced Features

This editor provides three additional features the default XML editor does not offer.


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 basic 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 in the next section.


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).


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 top element.
ScaCompositeXmlEditorACIncludeSample3.gif


It then leads to the following proposal.
ScaCompositeXmlEditorACIncludeSample4.gif


Auto-completion will use 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 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.


ScaCompositeXmlEditorOutline.gif

Back to the top