Introduction and References
If you want to do XI JAVA development such as user modules, but you want to do it in a secure, controlled fashion; then NWDI is the way to go; however, it’s a little trickier to begin with…
This is a quick example of creating a User Module within NWDI based on XI 3.0, which I would love to get feedback on whether there is a better way. For example, is there a software component dependency we can add to NWDI for XI libraries which we can upload for an SCA file (does SAP-XIAFC exist in 3.0)???
Okay – Firstly, let me point out some references:
Original How-to for user module creation (still relevent for the most part):
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02706f11-0d01-0010-e5ae-ac25e74c4c81</p><p>Help documentation for Development Component external libraries:</p><p>[http://help.sap.com/saphelp_nw04s/helpdata/en/5a/2e2f4234135433e10000000a155106/frameset.htm | http://help.sap.com/saphelp_nw04s/helpdata/en/5a/2e2f4234135433e10000000a155106/frameset.htm]</p><p>Link to my original request in forums which had some good replies:</p><p>[ | ]</p>h2. XI NWDI Set-up
<p>XI may or may not be set-up in NWDI already for CMS but this won’t help us develop user modules (and any other JAVA projects), so we need a new DTR track set-up to do XI JAVA development.</p>Note – By setting up NWDI, we no longer have to give developers SDM passwords in development!
<p>Just ask your NWDI administrator to set-up a new PI/XI track with the basic appropriate dependencies set-up. I also recommend having a Web Dynpro developer or similar sit with you to understand the basics of NWDI such as DC creation and activities check-out/in/release, etc; which I will not explain in this blog.</p>h2. XI LibrariesNote – I’m hoping this section is redundant, but currently I don’t believe there is an SCA file you can deploy to NWDI as a referenced software component to give you access to standard XI libraries (Not in XI 3.0 at least). If there is; then skip this section and don’t worry about XI DC library references going forward!
<p>Referring to the how-to guide, you’ll need some SAP XI library jars within your project to get you going. Get these library files handy then proceed with creating an external library development component (DC).</p><p>To create the external library dc, switch to the development configurations perspective and create a new external library dc project (a good hint is that names are quite limited within your namespace, but you can extend the name by using ‘/’. For example, I’ve used the namespace xi/library.)</p><p>Import the XI libraries into the libraries space and add all libraries to a public part (which I named XI_Libraries). </p>Note – One key difference to the sap help for external library dc’s here is that I did not select public part of type assembly as I do not want to deploy this through my landscape (the libraries are already installed on XI of course). Whether this works or not, I haven’t checked yet.
<p>Build your DC, check-in and release your activities and that’s the libraries done.</p>h2. Other external libraries
<p>If you have other libraries (like bouncy castle pgp libraries or similar); create a different external library DC that is also deployable (unlike the XI libraries which are not for assembly). The idea is when support packs are done, you can simply update the XI libraries and not impact any other developments.</p>h2. Creating the User Module
<p>Now we have the libraries available, this pretty much follows the same steps as the how-to guide with a few minor differences:</p><p>Create your EJB Module DC (you’ll need a new activity for this unless you still have your old activity open which means you haven’t been following my instructions).</p><p>Once created, select the DC MetaData->DC Definition->Used DC’s and add a reference to the XI_Libraries public part (build time dependency). If you have other external library DC’s, reference them now also.</p><p>Create your user module (but unlike the documentation, use a normal package name such as com.<company name>.xi.um.<name of user module functionality>.</p>Note – I had to close and reopen my project a couple of times to get it working at various stages.
<p>Also, remember the JNDI name is the important bit to name well for when you configure the integration directory.</p><p>Build your development component.</p>h2. Making Your User Module Deployable (aka. Creating an Enterprise Application Archive – EAR)
<p>Create an Enterprise application Project DC and during creation, make sure you select the dependency of the above EJB Module.</p><p>Follow how-to guide again to create the hard references.</p><p>Build the EAR DC and then deploy the EAR directly to your personal XI system to test before releasing the activity to deploy to the central development XI system. i.e. You do not want to create multiple activites just to test the user module code out as your NWDI administrator will get upset with you.</p>h2. Summary
<p>All in all – the process is pretty much the same as the how-to guide, but you need the XI libraries to get it working. Potentially this is possible for other SAP JAVA development such as Portal development (if you can include the right JAR files). Effectively the XI libraries is a work around, which I think SAP will address in later releases but in older releases is an issue (within my understanding at least).</p><p>What I hope this blog does is ratify the approach via feedback and maybe get some input on future SAP direction. As per my forum post, SAP have already advised that a 7.1 version of this blog is coming out imminently and hopefully the majority of that will be applicable in earlier releases. </p><p>Anyway, I’m off on holidays so happy new year everyone!</p>