In one of my previous blogs, I’ve described how I enhanced my development experience for Groovy scripting.
I needed it for implementing Custom Scripts for Integration Gateway, which in turn is required for creating OData services based on Integration Gateway in SAP Mobile Platform 3.0.
Today, I’d like to extend that description with 2 tips that are useful for scripting, but independent of the chosen language.
The background is that when implementing custom script for Integration Gateway, you’re dealing with objects that are provided by Olingo library, e.g. UriInfo
The following example shows the generated sample Implementation in Eclipse (SAP Mobile Platform Tools).
Even after following all steps described in the mentioned blog, I’m still not satisfied.
It’s nice to get the code completion, but the names of the parameters are missing:
This is just a little example about how tedious it is when the Javadoc is missing.
Now have a look below, how wonderful the working environment is looking in the following screenshot:
Boy, THAT’S a pleasure!
And it’s easy to achieve, I’ll tell you:
You only need to attach the Javadoc to your SMP project.
In this blog you’ll get the details.
The first of 2 tipps is to make the Javadoc available in your project.
You want to have the Javadocs for the APIs that you're using.
If the Javadoc isn't provided within the libs, then you still have the possibility to attach it to the jar files in Eclipse.
In this blog, I focus on Onlingo, as it is useful to have for Integration Gateway scripting.
After converting your project to a plug-in project by following above steps, you can see the Plug-in Dependencies node after expanding your project:
Right click on the olingo-odata2-api.jar file.
Choose “Properties”, then select “Javadoc Location".
Select the checkbox “Javadoc in archive”, then enter the path to the downloaded Javadoc zip file
Leave the “Path within archive” empty.
You can press “Validate” in order to check if the path is correct.
In order to verify the result, you can proceed as follows:
Open the Javadoc View in Eclipse via Window -> show View -> other -> Java -> Javadoc
Within the Project Explorer View, expand the tree of your project.
Expand the olingo-odata2-api.jar
Select a .class file, e.g. UriInfo.class
Select a method.
Result: the Javadoc for this method is displayed in the Javadoc view.
A second enhancement of development experience that some of you may desire, is the ability of pressing F3 (or use hyperlink) to navigate to the source code of a used class.
Since Olingo is open source, we can download the sources and attach them to our project in Eclipse.
The Olingo sources can be downloaded from here
Note:
From the homepage http://olingo.apache.org/ you can navigate to other downloads, like V4 in future.
Expand your project to the Plug-In Dependencies node.
Right click on the olingo-odata2-api.jar file
Choose “Properties”, then select “Java Source Attachment” in the left panel.
Select the checkbox “External Location”, then enter the path to the downloaded source-zip file
In order to verify the result, you can proceed as follows:
Expand the tree of your project,
Expand the olingo-odata2-api.jar
Double-click a .class file, e.g. HttpHeaders.class
Result: the source file is opened and you can enjoy, e.g. forward navigating with F3
Note:
You may wish to repeat the steps for the olingo.odata2-core.jar file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
10 | |
10 | |
9 | |
8 | |
8 | |
7 | |
7 | |
6 |