2019 February Release

Creating your Cloud AppPermanent link for this heading

In this chapter, we present the sample Cloud App we’re going to use for the remainder of this book as well as the steps you need to carry out before you can actually start coding.

In the previous chapters, you’ve learned all about the preparation of your development environment.

But now it’s finally time to get started with your very first Cloud App!

Introducing your first Cloud AppPermanent link for this heading

The sample we’ve chosen for this book is a driver’s logbook that will allow users to record the trips they make with their vehicles.

Simply put, we’re going to build a Cloud App for recording and tracking vehicle mileage, which can be used to get a deduction on your income tax return or to get reimbursement from your company.

The full source code for this Cloud App is available in our public Subversion repository with the repository URL https://cloud.fabasoft.com/svn/public/Folio Cloud Apps/samples/fsclogbook. Use your Fabasoft Cloud credentials to login.

OK, so let’s focus on the object model of your first Cloud App. The following figure shows a simplified UML class diagram of this sample.

The following requirements must be met:

  • The object model of this Cloud App consists of two classes, logbook and trip log.
  • A logbook contains trip logs, which are collections of recorded trips.
  • For each trip, the information listed in the following table is recorded.
  • Users can create and manage as many logbooks as they wish.
  • Within a logbook, there may only be one open trip log at any given time.
  • Legislation requires that recorded trips must not be changed anymore, but users can cancel the last recorded trip in the trip log.

Figure 10: Class diagram of the logbook sample

Property Name

Data Type

Reference

Remarks

Departure on/at

datetime

trpdepartureat

  • Date and time when the trip is started

Arrival on/at

datetime

trparrivalat

Date and time of arrival

Place of Departure

string

trpdepartureplace

The name of the place where the trip is started

Destination

string

trpdestinationplace

The name of the destination

Starting Mileage

float

trpstartmileage

The vehicle’s odometer reading before starting the trip

Ending Mileage

float

trpendmileage

The vehicle’s odometer reading upon arrival

Purpose

string

trppurpose

A brief description of the purpose of the trip

Type of Trip

object

trptype

One of the following options describing the type of the trip: “Private”, “Business” or “Commute”

Driver

string

trpdrivername

The name of the driver

Canceled

boolean

trpcanceled

A flag indicating whether the trip was recorded in error and, therefore, canceled

Table 1: Data structure for recorded trips

Creating the Cloud App projectPermanent link for this heading

The first steps in a Cloud App development project are carried out from within your Fabasoft Cloud portal. Therefore, browse to https://cloud.fabasoft.com/folio and login to Fabasoft Cloud.

Then carry out the following steps:

  1. Create a new Teamroom by selecting “Create Teamroom” from the “Object” menu or by clicking the “Create Teamroom” button.
  2. Enter a name for your new Teamroom, e.g. “My Cloud Apps”, and select “App Development” in the Type property, then click “Next” to finish creating your new Teamroom.
  3. Open the “My Cloud Apps” Teamroom by double-clicking it and select “New” from the “Object” menu or click the “Create a new object” button.
  4. Select “Cloud App Project” from the list of createable objects and click “Next”. In the next dialog, enter a name for the new “Cloud App Project”, e.g. “Driver’s Logbook”, and click “Next”.
  5. Edit the properties of the new development project object and enter your unique developer ID in the Owner ID property (for our example, we’ll use “FSC”) and “LOGBOOK” in the App Reference property as well as a copyright text and a description.

Every Cloud App needs a unique reference, which is roughly similar to a namespace. This reference is comprised of your developer ID and the app reference.

The reference you provide must meet certain naming conventions (e.g. it should be composed of upper case characters only, must not contain special characters and must begin with an alpha-numeric character in the range from “A” to “Z”), and must be unique within Fabasoft Cloud.

For further information on reference naming conventions refer to [Faba19a].

Figure 11: Properties of a “Development Project”

In the next step, select “Next” to save your changes and then “Initialize” from the context menu of the development project to create a skeleton project for your Cloud App in the Subversion repository of Fabasoft Cloud.

Before the skeleton project is generated, the reference you’ve provided for your Cloud App is checked for compliance with the naming conventions described before. Also, if there is already an existing software component with the same reference you will be asked to choose a different reference. Of course, the reference (as well as the rest of your code) also must not violate copyright law or be offensive in another way.

After successfully publishing your Cloud App project, a URL to your project in the Subversion repository is displayed in the Location property of the Cloud App project.

This URL has the following format:

https://cloud.fabasoft.com/svn/apps/<unique ID>/trunk/<Cloud App reference>

In preparation for the next step, copy the URL that is displayed in the Location property of your Cloud App project into the clipboard.

For the remainder of this book, we will use the following example URL to access the Subversion repository:

https://cloud.fabasoft.com/svn/apps/FCB798DAF91D3911AB30860F534FADBA/trunk/FSCLOGBOOK

Creating a releasePermanent link for this heading

For each release of your Cloud App, you have to create a release object in the Releases list of your Cloud App project (i.e. when you start developing and before starting to work on subsequent updates).

To create a release, double-click your Cloud App project to open it, select the Releases list and click “Create Object”. In the dialog box that is opened, provide the version number for your release by entering the respective values in the properties Major, Minor and Build (e.g. “1.0.0”).

After creating the release, select “Start Release” from its context menu. This creates an internal marker in the Subversion repository.

Figure 12: Starting a release

Verify a releasePermanent link for this heading

For every release of your Cloud App, you have the possibility to verify the release without submitting it by selecting “Verify Release” from its context menu. When verifying the release, the continuous integration environment tests in the Plain CI environment will be executed. The reports are generated and published in the release object.

Note: Only users with full control in the Teamroom can verify releases.

Importing the Fabasoft app.ducx project in EclipsePermanent link for this heading

Now it’s time to open Eclipse and import the skeleton project that was created for you.

However, before you import the project you should define the default Fabasoft Cloud web service and the default range service you want to use when developing.

Defining the default web servicePermanent link for this heading

Select “Preferences” from the “Window” menu and select the “Fabasoft app.ducx” tree node. Click the “Edit” button next to “Default web service” and enter the URL of your Cloud Sandbox in the URL of the Fabasoft Folio Web Service field in the dialog box that pops up.

For the remainder of this book, we will use the example URL https://vde.fabasoft.com/dev2/vm23/folio, but you have to enter your own personal Cloud Sandbox URL that was assigned to you.

Select “Basic” as authentication method and enter “developer” in the User name field along with the password you assigned to the Cloud App VDE users (see chapter “Working with the Cloud App VDE”).

Then click “OK” to close the dialog boxes.

Defining the default range servicePermanent link for this heading

After defining the default web service for your Cloud Sandbox, you have to define the default range service, which will automatically assign address ranges to you.

Every single object you define in your code is assigned a unique address. These addresses are managed automatically by the Fabasoft app.ducx compiler, but in able to do so it needs to retrieve so-called address ranges from a range service that assigns ranges of free addresses to you.

Click the “Edit” button next to the Default range service field and enter the URL https://at.cloud.fabasoft.com/folio. Select “Basic” as authentication method and provide your Fabasoft Cloud credentials in the User name and Password fields. Then click “OK” to close the dialog box.

Note: Pay attention when providing the user credentials! When defining the default web service (as described in the previous step), you have to use the “developer” user of your Cloud App VDE, whereas for the default range service you need to provide your Fabasoft Cloud user credentials.

In the “Preferences” dialog box, select “Automatically request new range”. Finally, click “OK” to save your settings.

Figure 13: Fabasoft app.ducx preferences

Importing the Fabasoft app.ducx project from SubversionPermanent link for this heading

You can use any Subversion client (e.g. Tortoise SVN) to check out the app.ducx project to a folder on your local computer.

To check out the app.ducx project from the Subversion repository, use the URL provided in the Location property of your Cloud App project (see chapter “Creating the Cloud App project”) and your Fabasoft Cloud credentials.

Figure 14: Checking out the app.ducx project using TortoiseSVN

After checking out the app.ducx project, you have to import it to your Eclipse workspace by selecting “File” > “Import” > “Existing Projects into Workspace” in Eclipse. In the next dialog, select the app.ducx project and click “Finish”.

Figure 15: Importing the app.ducx project from the file system

Figure 16: Selecting the app.ducx project

Alternatively, you can import the app.ducx project directly from Eclipse if you have “Subversive” installed – the subversion plug-in for Eclipse (see http://www.eclipse.org/subversive). To do so, select “Import” from the “File” menu in Eclipse. In the “Import” dialog box that pops up, expand the “SVN” branch, select “Project from SVN” and click “Next”.

In the “Checkout from SVN” dialog box, paste the URL from the clipboard that is pointing to your Cloud App project in the Subversion repository. Then enter your Fabasoft Cloud credentials in the User and Password fields of the Authentication box and click “Browse” to log in to the Subversion repository.

Figure 17: Entering the Subversion repository location information

In the “Select Resource” dialog box, expand the “trunk” branch and the “FSCLOGBOOK” branch underneath it, and select the “dev” branch. Then click “OK” to return to the “Checkout from SVN” dialog box and click “Finish” to proceed with the import of your project from Subversion.

Figure 18: Selecting the “dev” branch

In the “Check Out As” dialog box that is opened next, confirm the suggested “Check out as project with the name specified” and click “Finish”.

Figure 19: Confirming the project name

Selecting the address rangePermanent link for this heading

Figure 20: Selecting the address range file

After you have successfully imported your Cloud App project, select “Properties” from the context menu of Project Explorer and select the “Fabasoft app.ducx” tree node in the “Preferences” dialog box. In the Address file field, select the address range file that has been generated for you.

The name of the address range file starts with the .ducxranges prefix, e.g. .ducxranges.Andreas. Hofmann.

Click “OK” to save your changes.

Note: If multiple developers need to work on the same project at the same time you have to create a separate address range file for each developer. To create a new address range file, click “New” and enter a filename. Before you start working on your project, make sure that your personal address range file is selected in the Address file field.

For further information on how to manage address ranges refer to [Faba19a].

Accessing and managing the source code in SubversionPermanent link for this heading

You can either use the Subversion command line tools to access your source code in the Subversion repository of Fabasoft Cloud or use a graphical Subversion client such as TortoiseSVN.

To connect to the Subversion repository, use the URL provided in the Location property of your Cloud App project (see chapter “Creating the Cloud App project”) and your Fabasoft Cloud credentials.

Refer to [ApSF18] for detailed information on how to use Subversion to access and manage your source code in the Subversion repository of Fabasoft Cloud.

Figure 21: Using the Repository Browser of TortoiseSVN to access your source code