Building Mobile Enterprise Applications : webMethods Mobile Development Help : Creating and Building a Mobile Application : Generating Sources for a Mobile Project : Java Sources that Mobile Development Generates
Java Sources that Mobile Development Generates
When you generate sources for your mobile project by using Generate Source Code > Application Model in the Outline Editor, Mobile Development generates Java classes in the following folders:
*gen/src folder contains Java classes that are specific to your mobile project and are based on the model you develop in the Outline Editor.
All the Java in the gen/src folder is generated. Mobile Development regenerates the Java classes in this folder each time you generate sources for your mobile project. As a result, the Java classes reflect the changes you make to your model, for example, if you add or remove user interface objects.
*src folder, also known as the user space, contains Java classes that you update to provide the business logic for your application.
Mobile Development generates each Java class in the src folder only one time. If the class already exists when you generate sources, Mobile Development does not overwrite it. Additionally, to preserve logic you might have added to generated logic, Mobile Development also does not delete the Java classes, for example, if you rename or delete a corresponding item in the model. You must delete unneeded Java classes manually for the project to compile.
Note:  
If you use Generate Source Code > Application Model and API, Mobile Development also creates Java classes in the gen/api-src folder. The names of the Java packages in this folder start with com.software.mobile.runtime.toolkit. These packages contain Java classes for the Mobile Development API.
Caution:  
Do not make changes to the Java classes in the gen/src or gen/api-src folders. These folders contain classes that Mobile Development automatically generates and changes you make will be lost.
Model-Specific Java Code in the gen/src Folder
When you generate sources for your mobile project, Mobile Development generates the following packages based on the model that you defined in the Outline Editor. In the names of the following packages, package_name is the package name that you specified for your mobile project.
Package name in the gen/src folder
Description
package_name
This package contains general model-based Java classes.
package_name.i18n
This package contains Java classes for language support to load languages that you indicated your mobile application supports. You specify languages your application supports by adding the languages to the model. For more information, see Managing Languages the Application Supports.
package_name.services.rest
This package contains Java classes that correspond to the services that you add to your mobile project in the Outline Editor. For more information, see Adding Services to a Mobile Project.
package_name.ui
This package contains Java classes that correspond to the user interface that you designed in the Outline Editor. This includes Java classes for each view in your user interface along with its associated abstract controller.
package_name.ui.dialog
This package contains Java classes that correspond to the dialogs that you designed in the Outline Editor.
package_name.ui.templates
This package contains Java classes that correspond to the templates you defined in the Outline Editor, if any. For more information about using templates, see Using Templates to Define Custom Objects for a Mobile Project.
package_name.utils
This package contains a helper class that provides services, such as, determining whether the application is running on a tablet or the orientation of the device, whether portrait or landscape.
Model-Specific Java Code in the src Folder
When you generate sources for your project, Mobile Development generates the following packages based on the model that you defined in the Outline Editor. In the names of the following packages, package_name is the package name that you specified for your mobile project.
Package name in the src folder
Description
package_name.ui.controller.impl
This package contains Java classes that correspond to the user interface that you designed in the Outline Editor. Mobile Development generates the classes a single time. You add your application logic to these Java classes. The Java classes in this package are:
*application_nameAppControllerImpl.java
In the name of the Java class, application_name is the name you assigned to the application. Mobile Development generates one application_nameAppControllerImpl.java class for your mobile project.
Add the logic to this Java class that you want the application to execute when the application starts and when the user rotates the device, changing its orientation. This is also a good location for code that is not related to a specific view.
*view_nameControllerImpl.java
In the name of the Java class, view_name is the name of a view you defined in the Outline Editor. Mobile Development generates one view_nameControllerImpl.java class for each view in your model.
Add logic specific to a view to this Java class. You can add custom code here that extends the generated abstract view controller methods that Mobile Development generates in the Abstractview_nameController.java files, which reside in the gen/src folder in the package_name.ui package.
For more information about the types of logic to add these Java classes, see About Adding Application Logic
package_name.ui.dialog
This package contains Java classes that correspond to the dialogs that you added to the user interface in the Outline Editor. Mobile Development generates the classes a single time.
For each dialog you define in the Outline Editor, Mobile Development generates a dialog_name.java class, where dialog_name is the name you assigned the dialog in the Outline Editor.
Mobile Development generates the Java classes for dialogs a single time. You add logic to customize the user interface object to the generated Java classes.
package_name.ui.templates
This package contains Java classes that correspond to the templates you defined in the Outline Editor. You use templates to customize user interface objects that Mobile Development provides. For more information, see Using Templates to Define Custom Objects for a Mobile Project.
For each template you define in the Outline Editor, Mobile Development generates a template_name.java class, where template_name is the name you assigned the template in the Outline Editor.
Mobile Development generates the Java classes for templates a single time. You can add your logic for the dialogs to these Java classes. For more information, see Creating a Template for a Custom Object.
Copyright © 2007-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback