MDK Development Cycle   |  MDK Wizard Configuration  |  Import a .war file into a new project  |  Export a project into a .war file

 

New Mobile Infrastructure Project

When you create a new Mobile Infrastructure (MI) project, you should use this function to start the project. It makes sure, that the class path, source path and output path is set correctly. When the project is created you can create classes or import existing once and use the MDK plug-in to export your application to a .war/.jar file.

In case you already have created a MI project by yourself, you should refer to the "Tips and Tricks" document, to adjust the source path and output path so the the MDK plug-in works properly when exporting the project to a .war/.jar file.

Start

The "Create MI Project" action can be started with the icon in the toolbar or with the Eclipse command: File > New > Other ... > MDK Development Tools > MI Project. A dialog window is displayed:

The dialog windows has two input fields:

  1. Project Name: The name of your new project.
  2. Project Root Folder: The folder (root) that will contain the project folder. According to the settings in the dialog window shown above a folder C:\SAPme\NewMEProject will be created. In case C:\SAPme\NewMEProject does already exist you will be notified that a project with the same "Project name" and in the same "Project root folder" already exists. In this case you must use another "Project root folder" or "Project name".

With the Project Type you define what kind of MI project you want to create. Simply select the project type you need by clicking on to one of the radio buttons. The selection influences which folders and files are generated. See the "Tips and Tricks" document to see the details about the difference of a JSP and a AWT Project.

When the "Generate main classes of application" option is enabled, the "New MI Project" wizard generates basic coding for the new MI project . You can specify the names for the major parts of the new project.

JSP and AWT Project:

  1. Package name: The name of the package that contains your MI classes. You can create sub packages later on with the standard Eclipse commands. Remember: The package name together with the class name must be unique to avoid problems with the MI classloader.
  2. Main class name: The name of the main class of the application. It implements the AbstractMEHttpServlet or AwtApplication (depending of the application type).
  3. MI application name: The name of the application that is provides by the getapplication method of the main class. This name has to match the name of the .war / .jar file in order to be deployed correctly by the MI Webconsole.
  4. Constants file name: Name of the interface that contains all string literals. This file also defines the MI_APPLICATION_NAME variable that defines the MI application name. The MI_APPLICATION_NAME is used by the export function of the plug-in to get the correct .war / .jar file name.

JSP Project only:

  1. Name of bean: The name of the bean that is used to transfer data from the servlet to the JSP. The bean is stored in the sub package bean (that is Package name.bean).
  2. JSP name: Name of the JSP for the application.

When all entries are correct the 'Finish' button is enabled. To continue press the 'Finish' button.

The project is generated with a classpath that contains all necessary MI .jar files and the source and output folders are set suitable for the MDK plug-in. The correct setting of the source and output folder is necessary for the export function of the MDK plug-in (for more information on the source and output path settings please refer to the "Tips and Tricks" document). Now you can start to implement the MI classes or import existing classes from the file system.

 

Code Generation

The code generation for the main classes (AWT and JSP) as well as the JSP, web.xml and MANIFEST.MF files is controlled by templates that are stored in the projecttemplates folder of the MDK plug-in (<Eclipse_home>/plugins/ com.sap.ip.me.mdk.developmentTools/projecttemplates). The templates are separated by the MI runtime in JSP and AWT. The files have the extension .template and are regular text files which contains "place holders" for the names specified by the user. The "place holders" start with ${ followed by the key name of the "place holder" and end with a }.

You can change the templates so that the generated code suited better to your kind of applications.

The templates are overwritten with any update of the MDK plug-in. So make a backup of the templates you changed before installing a MDK plug-in update.