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!
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:
Date and time of arrival
Place of Departure
The name of the place where the trip is started
The name of the destination
The vehicle’s odometer reading before starting the trip
The vehicle’s odometer reading upon arrival
A brief description of the purpose of the trip
Type of Trip
One of the following options describing the type of the trip: “Private”, “Business” or “Commute”
The name of the driver
A flag indicating whether the trip was recorded in error and, therefore, canceled
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:
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].
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:
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.
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.
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.
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.
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.
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.
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”.
Alternatively, you can import the app.ducx project directly from Eclipse if you have “Subversive” installed – the subversion plug-in for Eclipse (see https://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.
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.
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”.
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].
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.