XML schema for Eclipse target definition files - eclipse

Where can I find the XML schema and/or documentation for Eclipse target definition files (*.target)?

May be this schema might fit the target files created for an RCP platform.
Part of that schema file is visible in the Eclipse help page.

There is no schema or documentation defining the structure of a target definition file (.target). This is because the file structure is not intended to be API (it may change between release).
The structure has changed several times already. The code used to serialize/deserialize the file can be found in the following classes:
org.eclipse.pde.internal.core.target.TargetDefinitionPersistenceHelper
org.eclipse.pde.internal.core.target.TargetPersistence38Helper
org.eclipse.pde.internal.core.target.TargetPersistence36Helper
org.eclipse.pde.internal.core.target.TargetPersistence35Helper
org.eclipse.pde.internal.core.target.TargetPersistence34Helper

Related

Mapping of URIs to files

I'm trying to understand mapping of URIs to files. Let's take this URI:
modelica://foo.bar/file.png
Is it correct that there are two possible locations for file.png?
It could be either
$MODELICAPATH/foo/file.png if file $MODELICAPATH/foo/bar.mo exists.
Or
$MODELICAPATH/foo/bar/file.png if file $MODELICAPATH/foo/bar/package.mo exists.
Likely Section "13.2.3 External resources" of the Modelica Language Specification helps.
A little modification of your example should help to understand how it works. Using modelica://foo/bar/file.png refers to foo as top-level package/library. The library the path is resolved when it is loaded in the simulation environment. In case you store the library hierarchically (i.e. every package is represented as folder, each model is a file) bar would be a subfolder within the libraries root directory. file.png would be the file name within bar.
This is different if the package is stored as a single file, but as this has several disadvantages I would recommend to go with the hierarchical option.
No need to edit $ModelicaPath$ if the library is loaded.
Usually pictures etc. are put into a Resources folder within the library. This folder can contain additional folders like data, Images, Scripts...

Custom XML formatter for Eclipse

Is it possible to define a new XML formatter in an Eclipse plugin? I have some XML files that must follow specific formatting rules, but see how way of plugging in to the formatter engine.
I can tie this formatter to files that are part of a project with a specific facet.
For context, I am maintaining the Sling IDE Tooling for Eclipse, and part of that application is concerned with synchronising local state with a remote JCR repository.
The synchronisation is based on XML files and folders stored on disk, following a well defined format - FileVault DocView. These XML files can contain metadata attached to files and folders, but also arbitrary hierarchical data.
The CLI tool that is used as an alternative to the IDE tooling and almost always in production follows strict set of rules regarding indentation, XML attribute ordering, etc and also rewrites files when pushing them to the repository.
I would like to follow this model and allow the users of the IDE to format the XML files following the exact same preset. The formatting model is actually quite simple, shown below:
format = new OutputFormat("xml", "UTF-8", true);
format.setIndent(4);
format.setLineWidth(0);
format.setBreakEachAttribute(true);
format.setSortAttributeNamesBy(AttributeNameComparator.INSTANCE);
The name comparator is also quite simple, sorting xmlns instructions first, then the namespaced properties, and then the other properties.
This was requested in https://bugs.eclipse.org/460055 , but not implemented.

Import ecore package / referenced resources in Xtext/MWE2

I'm not quite sure how to reference a model I want to use in my Xtext grammar by import in the GeneratyMydsl.mwe2 file in the workflow section.
I the example they reference the model by adding referencedResource =
"platform:/resource/org.example.domainmodel/model/Domainmodel.genmodel"
What does platform mean and how exactly do I reference my own model? The file location of my grammar has no real correlation to the file location of the model.
platform:/resource/project/folder/file is a uri within eclipse. So platform:/resource/org.example.domainmodel/model/Domainmodel.genmodel points to the org.example.domainmodel project, model folder, Domainmodel.genmodel file.
EMF and MWE have facilities to "mimic" that behavour in standalone mode by looking at the folder structure and classpath.

Sun Eclipse capabilities with Schema creation

I have two questions that pertian to each other. I have to switch from XML Spy over to Sun Eclipse and there are some things that XML Spy does magically for me that I want to know if Eclipse can handle the same way:
Given a sample XML document, generate a minimum XML Schema that it will comply with. It need not have type, occurrence or size restrictions, but it will have the structure. It will also take care of the element variations if present in the data, coming up with the greatest common structure.
Given an XML Schema with all its included type declarations, generate a sample XML document, with options to have or not have the optional elements, to include one or many occurrences of repeated elements.
Any Help....
You can create a sample XML from an XSD file in Eclipse. Here are the instructions for the Juno version of Eclipse (with Web Tools Platform):
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.wst.xmleditor.doc.user%2Ftopics%2Ftcrexxsd.html
I'm not aware of a tool to go from an XML to an XSD file... you could search the Eclipse plugin market place for one...

IBM Eclipse WSDL Editor: How do I include an external wsdl/schema?

I am trying to create Web Services from the Top-Down approach. I downloaded Eclipse and am using the WSDL gui editor in it to build my WSDL files.
I am splitting up my Services based on "modules". The Types I am adding to the WSDLs all need to reference common stuff, such as PersonEntity, AddressEntity, States enumeration (simple type), Countries enumeration (simple type), and AbstractEntity. Since those items are all common I created a seperate WSDL file (named Commons.wsdl) that contains the type information for those types.
I want to "import" that WSDL into my other WSDL files to use:
For example, I have an entity named RegistrationEntity which inherits from AbstractEntity and contains a PersonEntity as well as an AddressEntity. I'm not sure how to do this... I saw that the WSDL spec has "import" and "include" and am not sure which one to use. Also, how do I actually import (or include) the Commons.wsdl file so that I can use the Types defined within it?
Thanks!
Oh, and I'm not sure if I'm supposed to stick this stuff in a seperate WSDL but another type of file such as an xsd or something. I really wanna follow best practices so if that's the proper way to do it then I'd rather do that.
I found out that the problem I had was I was creating a WSDL file for my commons and using an inline scheme for that, rather than creating an XSD file to be imported by my other WSDLs.
So instead I just created an Commons.XSD as my "Common Schema".