Overview
-
This set of two files can be used as a starter set for developing new External applications that run within the Apps section of the FirstClass web client introduced with FirstClass 12.
For the purpose of this document, External Apps are any web applications running on a separate web server, but presented to the FirstClass client within the external application as a sandboxed iFrame.
NOTE:
For security reasons, the latest web browsers such as Chrome and FireFox require that if your instance of FirstClass Web Services (FCWS) is running as HTTP Secure (https) then the hosting web site must also be running under https.The templates provided here provide you with all of the javascript functions required to access information about the user running the application (such as group membership, user and client IDs and name) and be able to store and retrieve application data that is specific to the user running the application and use this information in your own external applications.
About External Applications
-
This document covers the basics of creating and installing external web applications.
Developing External Applications
-
There are many different ways to build and host web applications on your own servers. The skills required to develop these applications are varied, but in general, a good knowledge of html, CSS and javascript is required.
-
Before you start to add your own code, you must first modify the App.js file to set up the variables and functions to handle the stored data and session information.
-
Once you have set up your global variables and made sure the processData() and receiveCrossPostMsg() functions have been adjusted as described above, your application is ready for coding and adding content to the AppReady() function. It is important to understand how the program flows before you start adding your own content.
-
The sample code within the template application demonstrates the retrieval of a configuration key, two storage fields and session data and presents it in the DOM of the index.html file.
Notes and Tips
-
The groups that are stored in the User.Groups array is not an array of all of the groups that a user belongs to. It is only a list of groups that has been exposed by the Administrator.
-
You may wish to consider using JSON strings to store data in your storage fields. By doing so, you can store complex content including arrays of data for your user and those arrays can be simple or complex to meet your needs.
This section will provide you with a simple example for using a single storage field for storing an array of user data that the user may wish to manage. -
Both the template set and the MovieArray samples are full web applications that can be loaded int your web server and run as external apps in FirstClass. You can follow the instructions for installing external applications to see how they work.
As a reference, here is how I have set up these applications on my server.
-
The best way to get started with developing your own external applications is to jump right in. Take a look at whatever source code you can get your hands on and see if you can understand what is being done.
It took me a while to develop this framework for storing and retrieving data, and for me, it works great. I only wish that I had thought through this more clearly when I was developing some of my earlier projects and examples. You will find that the source code for some of my earlier projects are much more convoluted and more difficult to follow.
From now on however, to be consistent with all of my future projects, I will be starting with the template set and woking from there.
One year ago I knew next to nothing about javascript, jQuery and CSS. The fortunate thing is that there are lots of resources available to help you get started. Below are just some of the sites and tutorials that I have used to teach myself the required skills.