Accelerating hybrid application development by reusing resources
- Configuring application components and project template preferences
- Application components
- MobileFirst project templates
Configuring application components and project template preferences
To add application components or MobileFirst project templates, you must identify a download folder.
The download folder must contain only the application components or the MobileFirst project template archives.
Set the download folder in Preferences > MobileFirst > Templates and Components > Download Folder.
An application component is a reusable library that developers can add to their applications. It can be a client-side library or a server runtime block.
Application components must be downloaded in the Download folder that is specified in the Window > Preferences > MobileFirst menu.
Application components support only MobileFirst hybrid projects.
Creating application components
To create application components, you make sure that a MobileFirst hybrid project exists and you select the resources that you want to include.
Note: Only hybrid projects can be used to create application components.
The created application component is in archive format.
- Right-click the MobileFirst hybrid project and select Create Application Component.
- In the first page of the wizard, enter metadata information for the application component.
- In the next page of the wizard, select the files that you want to include in the application component archive.
A wizard guides you through the process of creating the application component. For more information about this wizard, see the user documentation.
After the application component archive is created, if you want to add more optional hooks to enable automation when the application component is used, refer to the topic about adding hooks to an application component, in the user documentation.
Adding application components
You can add application components only to MobileFirst hybrid applications.
- Before adding any application component, open an existing hybrid project or create one.
Basic information about the application components is displayed.
The application components are loaded from the configured Download folder.
- Right-click the MobileFirst hybrid project and select Add/Remove Application Components.
The application components are scanned in the Download folder.
Only valid application components are displayed in the Add and Remove Application Components wizard.
Each component is displayed along with the Thumbnail, Name, Author and Version, next to a checkbox.
The application components that you select are installed in the target MobileFirst project.
The addition status of the application component is displayed after the activity is completed.
The component resources are marked with the unique ID of the application component.
- Ensure that the required MobileFirst environments are created before you add the application component, otherwise error messages are displayed.
If the required Android SDK is not installed on the hosting MobileFirst Studio, the appropriate message is displayed.
If the contents of the application components or the MobileFirst applications are renamed, the linkage with the application component is broken.
The application component files are read-only and you cannot modify them.
Removing application components
- Right-click a MobileFirst hybrid project and select Add/Remove Application Component.
- Select the application that you want to remove.
Marks in the In Use column indicate the installed application components for this particular MobileFirst hybrid project.
- Clear the marks next to the application components that you want to remove.
When you remove application components, you are prompted to confirm whether to roll back the resource to its original content. For example, if you remove a
UserPermission element, you are prompted to confirm the removal.
The removal status of the application component is displayed after the removal activity is done.
On successful removal of the application components, the original contents of the MobileFirst hybrid project resources are restored.
MobileFirst project templates
By using MobileFirst project templates, you can develop applications faster by not having to start from scratch.
You can use MobileFirst project templates to provide value-added services; you can add elements that are consistent with the look-and-feel of your brand.
MobileFirst project templates are of hybrid type only.
MobileFirst project templates that are created from a more recent version of IBM MobileFirst Platform Foundation are not supported in previous versions.
Creating MobileFirst project templates
You can export MobileFirst hybrid projects as templates for reusability.
- Right-click a MobileFirst project and click Export > IBM MobileFirst > MobileFirst Project Template.
- On the Export page, enter basic information for the MobileFirst project template, such as Template name, Author, Description, Thumbnail, and Template archive.
Valid extensions for Template archives are
All the fields are mandatory in this wizard.
The Template archive is created at the selected location.
The structure of the Template archive is described in the documentation.
Adding MobileFirst project templates
Use the Shared Templates option to create a MobileFirst project from a template.
- Click the Create a MobileFirst Artifact icon on the toolbar. For more information, see the user documentation.
- In the Name field, provide a name for the MobileFirst project.
- From the Project Templates list, click Shared Templates.
- Click Next.
The MobileFirst project templates are loaded from the configured Download folder (as explained in Configuring application components and project template preferences).
- Provide an application name.
- Select a MobileFirst project template.
A MobileFirst hybrid project is created with the contents of the MobileFirst project template archive.
- To view the FIXME tags, if any, click Project > Properties > General > Editors > Structured Text Editors > Task Tags.
- Click Enable searching for Task Tags.
- Click Apply > OK.
- A Task tab is visible with the Tasks to be done.