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

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

Related

How to create a custom annotation processor for Eclipse

I'm trying to create a custom annotation processor that generates code at compilation time (as hibernate-jpamodelgen does). I've looked in the web, and I find custom annotation processors that works with maven, but do nothing when added to the Annotation Processing > Factory Path option. How could I create a processor compatible in this way? I have not found a tutorial that works.
My idea is to, for example, annotate an entity to generate automatically a base DTO, a base mapper, etc that can be extended to use in the final code.
Thank you all
OK, Already found out the problem. The tutorial I hda found out dint't specified that, in order to the compiler to be able to apply the annotation processor, there must be a META-INF/services/javax.annotation.processing.Processor file that contains the qualified class name of the processor (or processors).
I created the file pointing to my processor class, generated the jar and added it to Annotation Processing > Factory Path and all worked correctly.
Just be careful to keep the order of the processors correctly (for example, hibernate model generator claims the classes, so no more generation will be made after it), and change the jar file name each time you want to replace the library (it seems eclipse keeps a cache). These two things have given me a good headache.
Thanks all

Use ResourceSet within another Plugin

I use a xtext generated DSL in my project. I now want to generate some files with a wizard. I can currently create these files just by adding some strings to the file. But initially i wanted to create a Model Object of the DSL and add the new generated file to the resource set. I can't find a way accessing this without the StandaloneSetup of the DSL.
I'm now unsure if the use of the StandaloneSetup inside the Editor is the correct way, since it seems there should be a better way to access the already build up resource set used by the xtext framework to manage the already known files/sources. If i use the StandaloneSetup shouldn't there be 2 Injectors which could get really bad?
you can use the resource service provider registry to obtain the injector
http://koehnlein.blogspot.de/2012/11/xtext-tip-how-do-i-get-guice-injector.html
URI fakeOrRealUri = ...;
IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(fakeOrRealUri).get()

ELKI: Implementing a custom ResultHandler

I need to implement a custom ResultHandler but I am confused about how to actually integrate my custom class into the software package.
I have read this: http://elki.dbs.ifi.lmu.de/wiki/HowTo/InvokingELKIFromJava but my question is how are you meant to implement a custom result handler such that it shows up in the GUI?
The only way I can think of doing it is by extracting the elki.jar package and manually inserting my custom class into the source code, and then re-jarring the package. However I am fairly sure this is not the way it is meant to be done.
Also, in my resulthandler I need to output all the rows to a single text file with the cluster that each row belongs to displayed. How tips on how I can achieve this?
There are two questions in here.
in order to make your class instantiable by the UIs (both MiniGUI and command line), the classes must implement our Parameterization API. There are essentially two choices to make your class instantiable:
Add a public constructor without parameters (the UI won't know how to set your parameters!)
Add an inner static class Parameterizer that handles parameterization
in order to add your class to autocompletion (dropdown menu), the classes must be discovered by the MiniGUI/CLI/other UIs. ELKI uses two methods of discovery:
for .jar files, it reads the META-INF/elki/interfacename service files. This is a classic service-loader approach; except that we also allow ordering instances.
for directories only, ELKI will also scan for all .class files, and inspect them. This is mostly meant for development time, to avoid having to update the service files all the time. For performance reasons, we do not inspect the contents of .jar files; these are expected to use service files.
You do not need your class to be in the dropdown menu - you can always type the full class name. If this does not work, adding the name to the service file will not help either, but ELKI can either not find the class at all, or cannot instantiate it.
There is also a tutorial on implementing a custom result handler, but it does not discuss how to add it to the menu. In "development mode" - when having a folder with .class files - it will show up automatically.

Ignoring some elements/classes in JAXB binding

I use Hyperjaxb to generate some classes with JPA annotations from XML schemas. I'd like to specify which elements from given schema xjc should generate. I can't change xsd file. I can modify only bindings.xjb. I tried to use hj:ignored, but without success.
Well, hj:ignored is the answer. It allows you to make Hyperjaxb ignore certain classes.
Here's an example:
<jaxb:bindings
node="xsd:complexType[#name='issue121Type']//xsd:element[#name='simpleCollection']">
<hj:ignored/>
</jaxb:bindings>
Customizations work in schema as well as via xjb files.
See this project for instance.
How does "without success" reveal itself?

Where to add i18n files in a project (for my case GWT)?

I can't find a good answer to this simple question:
Where can I add my i18n files in a GWT project ?
I see two solutions:
- create a module and add all i18n files for this module in this module
- create a complete different structure to put all i18n files (no matter what module) in the same directory (and so, easy to create a new language)
My feeling is that the second approach is better but in gwt samples, it's the first approach which is generally used.
And you, what do you do with yours i18n files ?
Thanks
1) Create a separate package in your module. Dump all message files there along with the property files.
2) As a best practice create a base message class and EXTEND other message interfaces from the base one. You can reference base message class in code and depending on which instance of message class you point too, your actual value will change.
Another approach, create a new i18n module and inherit that in your actual model.
1) Allows all messages to be in one place.
2) Easy to hand over to localization people for translation.
I usually put the i18n files (*.properties) in the same package as the Constants (or any other i18n related class) derived interface that's using them (less hassle with setup) - usually the package is named i18n.