Introduction
There is sometimes a need to update the changes(
User Interface Changes and Business Logic Changes
) in mobile
application which is already installed in many client devices. This article describes how to modify the already installed
application in client without creating the new version of application. The assignment of new version of application results
into the deletion of old application and hence the deletion of data associated with the old application. If there is no
change in the structures(metadata information in meRepMeta.xml file) which are used in BAPI Wrappers (These are used in
Synchronization Business Object – SyncBo – creation , and these SyncBos are used in particular Mobile Application ),
assigning new version of application to the client device is a time spending process in production environments. In this
article , i am discussing a simple way to update the mobile application which is installed on the client device by applying
the patch of that application. This is applicable to JSP Client Runtime and JSP MI applications.
Prerequisites
1. Atleast SAP MI Client
Component 2.5 SP11 (JSP Runtime)is installed on the mobile device.
2. Old Application must be
installed on the Client Device.
3. There will not be any changes in the structures
which are used in BAPI Wrapper creation.
MI Versions:
I used JSP Runtime of MI 2.5 SP11 ,SP13 and SP15 as the subject installations.
Export the MI Project as MI Archive
After changing the MI application in NetWeaver Developer studio , export the MI Project as MI Archive into the local
machine.In the MI Client there is no need to keep the source code of the project.MI client is using the compiled classes of
JSP pages and Java code(Java Class) we have included in the MI Project. So during export there is no need to select the
“
Include source code of the project
” check box in the “
Create MI Archive
” pop up window. As it is a JSP
Runtime client application , the exported MI Archive file is in the WAR(Web Archive) format.
Here we have created one application named “
MIAPPLICATION
”. So the exported MI Archive file is
MIAPPLICATION.WAR
.
Extracting the contents of MI Archive
Basically this WAR file is zip compatible, so we can extract the contents of the WAR file using WinZip or WinRar.
Here what I did is without using the WinZip or WinRar , just renamed the
MIAPPLICATION.WAR file to MIAPPLICATION.ZIP
.
Then used the default support for ZIP files in WinXP Operating System and extract the contents of this ZIP.
!https://weblogs.sdn.sap.com/weblogs/images/64204/2.JPG|height=77|width=321|src=https://weblogs.sdn.s...!
Contents of the MI Archive
These are the default folders that we got by extracting the contents of the MI Archive .
Here ,
css folder – for storing the Cascade Style Sheets
mimes folder -- for storing mime repository objects like picture
WEB-INF folder -- for storing the compiled java classes of JSP pages and Java Code we have included in our MI
application , and the web.xml deployment descriptor for defining the Application.
meRepMeta.xml -- Metadata information regarding the the MI Application.
!https://weblogs.sdn.sap.com/weblogs/images/64204/3.JPG|height=59|width=241|src=https://weblogs.sdn.s...!
Subfolders in WEB-INF
The
lib
directory is for storing the compiled classes of our MI Application. This compiled classes include the class
files of individual JSP files and the compiled classes of java files we have included in our application .These compiled
classes are in the form of a jar file. In our case the lib contains the
MIAPPLICATION.jar
file.The
srclib
contains the source code of the project.
We have not included the source of the project ,so in our case there will not be a directory named srclib inside the WEB-INF
folder.
On further extracting the contents of MIAPPLICATION.jar file , we can see
!https://weblogs.sdn.sap.com/weblogs/images/64204/4.JPG|height=55|width=151|src=https://weblogs.sdn.s...!
Contents of MIAPPLICATION.jar
The
jsp
folder contain the compiled classes of jsp pages in our application.
The
package
(here i created a package named
package
and put my Java Files within this package. That’s why a
folder named package is inside this MIAPPLICATION.jar file. Otherwise there will not be.), contain the compiled classes of
all Java Files in our application.
So if the change is only to our JSP files and Java code , we only have to replace the MIAPPLICATION.jar file in the client
device which is residing inside the WEB-INF folder of our application installation folder , provided we have not changed the
number of JSP files in our application. If we are changing the number of JSP files(means adding new JSP files or deleting the
existing JSP files ),then we have to replace the
web.xml
file also.
In this article i am discussing a scenario where the changes are only to the contents of the JSP files and Java Files. So in
this example our aim is only to replace the MIAPPLICATION.jar file from the application installation directory in the client
device.
Creating the Application Patch
Contents of ZAPPLIPATCH.zip
| Content of MIAPPATCH
|
Content of appatch
|
We have created the patch application for our MI Client application. Now we have to upload the archive to the SAP MI Web
Console as an add-on and then assign the uploaded archive to roles or users.
Refer these links for help..
Uploading add-on files
Assignment of Mobile Components to Users
Adjusting Installation Instructions
</b>
Summary
In this article I had described how to modify the already installed application in client device without creating the new
version of application.The assignment of new version of application results into the deletion of old application and hence
the deletion of data associated with the old application. Here these are to be noted that there must not be any changes in
the meRepMeta.xml(Meta Data) , and the application must be installed on the client device.
Author's Note