Two things that drive us, software development addicts: enthusiasm and laziness… ANONYMOUS
Impex is a Sap-hybris specific language in top of SQL to import/export data .
The lack of tools make things difficult when working with Impex, in fact some available options are :
And guess what, Eclipse is The most used option ! developers choose it over other options , beacause it allow them to stay more focus.
To boost my productivity and to be more focus while working withe impex on Eclipse, I decided to develop an Impex Editor.The plugin should bring the hybris web console features to eclipse. Still that all what I know about eclipse plugin development is some basic notions.
I believe the best way to learn new things is to start with some theory, then jump to a practical example where the real wisdom is gained.
I took as example the sample plugin project given by eclipse to create a xml editor .
The Syntax highlighting feature uses the rule based scanner class, given a set of rules, the scanner consumes the impex file and evaluates each token. If the token matches a rule, the scanner exits with the corresponding properties.
The ruleset are based on the Hybris Impex syntax documentation
Before :
After :
To give the more friendly user experience,i used the Preferences API to allow customisation.
I also possible to configure the connection parameters with hybris, this connection will be used to execute and validate the impex .
The first time eclipse run, the plugin connect to the already configured running hybris instance, calls the Rest Webservice allItems
, and allAttributes
(exposed by hybris) and store the information to avoid calling the web service again.
I Implemented an action to refresh the already stored data definition, the action will allo detecting newly added Items or attributes.
The web services exposed by hybris requires a registered hybris account and it’s secured against Cross-site request forgery.
To make a successful call the request should pass a crsf token, it’s associated with the connected account. and it’s stored on the HTML code of a response,so i had to use the jsoup library to retrieve its value.
The auto-completion is the most liked feature, since i have stored the data deffinition, this feature was easy to implement as well .
To install the plugin , just open your eclipse , click Help > Install New Software… and enter the URL http://eljoujat.github.io/updates/.
Or :
just copy the latest release from here impex editor relases to the dropins folder under eclipse directory , restart eclipse , and enjoy :)
Other features i’m working on are :
The code source repo is available here
“I believe that there is always an other way to do it, and i hope that you let me know .”