Additional Blogs by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
kishorg
Advisor
Advisor
0 Kudos

Introduction


Nowadays , we can see that, many of the standard Smart Sync MI application(MI applications like MAM..) users have asked so many questions regarding the issues they have faced while modifying the code of standard applications using the latest versions of NetWeaver Developer Studio.Most of the standard MI applications were developed with SP 09 version or lower versions of developer studio and there are so many structural differences between the applications developed using SP 09 and later versions . There is no relevant help regarding the structure of applications created using the SP 09v of Developer Studio.Obviously the developers who are new to the MI applications will have doubts during the migration of SmartSync MI applications from SP 09 to higher versions of NWD Studio.I started developing Smart Sync MI applications using SP 09 version of studio and right now using the SP 16 version of Developer Studio. So i could notice so many differences in the structures of applications generated while creating SmartSync applications using SP 09 and higher versions of Developer Studio.In this blog, i am discussing the structure of Smart Sync Applications developed using the SP 09 version of NWD Studio.This would be really helpful to those who are new to MI application development.This is applicable to SmartSync MI JSP Runtime applications.

Prerequisites


If you want to verify this,

1. NetWeaver Developer Studio of version SP 09 must be installed.

2. Appropriate MI client must be installed on the local machine where the developer studio is installed . This is to avoid errors (some of the library files are required      while creating the MI project) during the creation of MI project.

3. MDK settings must be properly configured in the NetWeaver Developer Studio.

Versions


I used the SP 09v of NWD Studio and SP 11v of MI client as subject installations.

Sample Project


For creating sample SmartSync MI applications , we need the meta data descriptor file(meRepMeta.xml file). We are exporting the meta data with respect to MCD(Mobile Component Descriptor).
We should include at least one SyncBO in the created MCD.

ZSBCONTACT

is the sample SyncBo(S01) created for testing. I used the standard BAPI Wrappers provided by SAP.The details about the used BAPI Wrappers and the details of the fields mapped for each BAPI Wrapper is listed below.


BAPI Wrappers used,

__________________

MEREP_CONTACT_GETLIST          Contact address: Getlist

MEREP_CONTACT_GETDETAIL        Contact address: GetDetail

MEREP_CONTACT_CREATE           Contact address: Create     

MEREP_CONTACT_MODIFY           Contact address: Modify     

MEREP_CONTACT_DELETE           Contact address: Delete  

I have mapped only these fields in my sample SyncBo.

MEREP_CONTACT_GETLIST   

_____________________

TOP

-


PERSNUMBER

FIRST_NAME

LAST_NAME

PROFESSION

***

BIRTHDAY

MEREP_CONTACT_GETDETAIL

_______________________

Import Parameter

-


PERSNUMBER as Key

Tables

______

010(ADDRESS)

-


PERSNUMBER (key)

SEQNO_ADR

CITY1

CITY2

STREET

HOUSE_NUM

REGION

LAND

020(E_MAIL)

-


PERSNUMBER(key)

SEQNO_E_MAIL

E_ADDR

E_ADDR_TEXT

MEREP_CONTACT_CREATE

________________________

Import Parameters

-


PERSNUMBER

FIRST_NAME

LAST_NAME

PROFESSION

***

BIRTHDAY

Tables

_______

010(ADDRESS)

-


PERSNUMBER

SEQNO_ADR

CITY1

CITY2

STREET

HOUSE_NUM

REGION

LAND

020(E_MAIL)

-


PERSNUMBER

SEQNO_E_MAIL

E_ADDR

E_ADDR_TEXT

MEREP_CONTACT_MODIFY

_________________________

Import Parameters

-


PERSNUMBER

FIRST_NAME

LAST_NAME

PROFESSION

***

BIRTHDAY

Tables

_______

010(ADDRESS)

-


PERSNUMBER

SEQNO_ADR

CITY1

CITY2

STREET

HOUSE_NUM

REGION

LAND

020(E_MAIL)

-


PERSNUMBER

SEQNO_E_MAIL

E_ADDR

E_ADDR_TEXT

MEREP_CONTACT_DELETE

________________________

PERSNUMBER

Creating SmartSync MI Project.


Now we are going to create a Smart Sync MI application using the

Smart Sync Application Wizard

.
In the SP 09v of developer studio,the creation of a smart sync MI application contain two steps.First we have to give the project folder name in the first interface.Then in the next interface, we have to specify the location of the meta data xml file.The fields of the interface package name , implementation package name and the web application package name will be filled with the default values displayed in the figure given below.Using the contents of the meRepMeta.xml file , the wizard will create the Business Object Wrapper classes corresponding to each SyncBO included in our MCD.







The generated project will have the structure like this in the NetWeaver Developer Studio.(figure given below).








In this figure , we can see 3 folders named

java , app-root , cfg

and the library files refered in the generated project.




Table 1.1: Generated Smart Sync MI Application Directory Contents(JSP Runtime)

























Directory Name



Directory Contents



app-root





Base directory for applications. This contain the files which are needed to execute the Smart Sync Application in the client JSP runtime.The folder contents has been described later.


cfg





This folder contains the build.xml file. This build.xml file contain the build tasks and used to hold project-wide build items such as compiled source, assembled modules, or files generated by the wizard itself.


java





For storing the generated interfaces corresponding to the Smart Sync Application and the SyncBOs used in the MCD.For storing the implementations of corresponding generated interfaces and for storing the files generated for our Web Application(This files contain the controller classes correspnding to the JSP files generated . The folder contents has been described later.)

Folder Contents in Detail

Contents of app-root folder

As i mentioned above, this folder is the base directory of the generated application.Contents of this folder is used for executing the application in the client device.





Contents of WEB-INF folder

Contains the web.xml deployment descriptor and static configuration files.Generally, this directory contains files that are copied rather than changed during a build.










Table 1.3: Contents of WEB-INF Folder
















































Directory Name



Directory Contents



classes




This folder contains the compiled classes of the generated java files.The main generated java files are BO Wrapper classes and the controller classes for each generated JSP file.
Corresponding to each JSP file , we have one controller class also . Generally we have to write methods for controlling the events which are generated from our JSP pages.
This compiled classes are used to run the application in the client device with the help of Tomcat Server.


lib




This folder contains the additional library files which are required to run the application in the client device.


res




This folder is for storing the resource files which are used in our application.


web.xml




This is the deployment descriptor file of our MI application.


core.configure




This is also one of the configuration file used in our application.In this file , we can see the mapping between various interfaces generated and the appropriate implementation classes.
Using this file , our application is fetching the details of the implementations of our generated interfaces.This generated interfaces acts like proxy classes for our application.


zmcdcontactapp





This folder contains the

view

file, which is mapping the relationship between the particular event in the corresponding JSP file to its event controller file and the target screen to which the
control is to be forwarded.The target screen contents are diplayed as a result of the event.The contents which are to be displayed must be populated within the event controller method which is implemented
within the proper controller.(We can see as may view files equivalent to the number of JSP files generated whose names are exactly same as that of the generated JSP files.In our case within this folder , we have only the Menu.view file , as we have only the Menu.jsp file within the

zmcdcontactapp

which is also in the

app-root

folder.)


zsbcontact



I have already mentioned the importance of

*.view

files.This folder contains the view files of the JSP files which are in the zsbcontact folder located within the app-root folder.







Contents in java folder

Contents in this folder are the generated interfaces for handling the SyncBo instances.





Manager.java     -  This Interface is SyncBo specific. This contain the declarations of all basic methods corresponding to one SyncBo object.

This  manages a business object and all its composing child business objects.  This factory object is responsible for the following tasks for all the business objects it manages:

  • -Looking-up: looks up a single business object by its key from persistence.

  • -Retrieving: retrieves a collection of all the business objects from persistence.

  • -Constructing: constructs a business object instance.

  • -Inserting: inserts a business object to persistence.

  • -Copying: clones a business object for editing.  The cloned business object has exactly the same keys and contents with   the original one, but not on persistence.

  • -Updating: updates a business object in persistence.

  • -Deleting: deletes a business object from persistence.

  • -Other business logics, e.g., searching, etc.



















bioimplementation




This directory name ought to be specified at the time of BO wrapper class generation during the project creation.This directory contains the corresponding implemetation classes for the generated interfaces within the

biointerface

directory.In addition to this , we can also see one

syncbonamelist.properties

file ,which is used for storing the names of SyncBos used in our Smart Sync Application.
This property file is referred in our application.In this file, we can see the mapping between the exact syncbo name we used and the name generated by the studio for finding the actual syncbo.



web




This contains the controller files corresponding to each JSP file generated during project creation.
As a result of one event in the JSP file , we are calling the event handling method in the controller class of
the particular JSP page.The page will be forwarded to another page as a result of this event.We have to populate the data
which are to be displayed on the target page within this event controller.










Summary

Hope you have got a general idea regarding the structure of Smart Sync MI JSP Runtime applications generated using the SP 09 version of NetWeaver Developer Studio.





Author's Note

1. SP 09 version of Developer Studio is using the 2.5.1.1 version of Mobile Development Kit Tools.

2. Smart Sync MI Applications (JSP Runtime) generated using SP 09v of Developer Studio is MCD specific.It is generating
MCD specific files.This architecture makes the applications too complex during migration.

3. Smart Sync Applications using SP 11v or higher versions are generic applications.

4. In SP 09v applications, the developers don't have to code in Smart Sync API level as most of the codes are generated by default.

5. Applications in SP 09v of Developer Studio is following the exact MVC Architecture(We can see the seperation of models, views and controllers here).

6. When comparing with higher versions , it is additionally using two more APIs.(

mbcore.jar

and

mbsmake.jar

)

7. Corresponding to the mapped fields (in SyncBo level), in the BO Wrapper classes we can see implementations of corresponding
getter() and setter(..) methods.The names of this methods are totally dependent upon the names of fields mapped.So if there is
change in the names of fields , in the case of already generated projects , we have to explicitly rename the getter() and setter(..)
methods appropriately inorder to make the changes to take effect.

8. For adding new JSP pages, we have to add references in many files(*.view). (we have to explicitly create the corresponding
controller class file , map the relationship between the controller and the corresponding JSP file).