...
...
Section | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
There are various different types of resources frevvo resources that can be viewed and manipulated by the Data API. Most of these resources are things that a designer sees when creating new forms and navigating the project using the UIfrevvo UI, for instance users, projects, forms, styles, schemas, etc. So before delving into the API specifics it is a good idea to understand these different types of resources and how they relate to each other.
...
- UserFeed - There is not much that can be done with this collection at this point except for being an optional entry point for projects, tasks and themes.
- FormTypeTemplateFeed - The collection used to list and manage published forms or workflows.
- SubmissionFeed - The collection used to query form or workflow submissions and get associated XML documents, PDF snapshots, attachments, etc.
- StyleFeed - The collection used to list and manage styles in frevvo.
- ProjectFeed - The collection used to list and manage projects in frevvo.
- TaskFeed - The collection used to manage the tasks for the current logged-in user.
- SchemaFeed - The collection used to manage the XSDs uploaded to an project.
- DocumentType - The collection used to manage top-level XSD elements in frevvo, called DocumentTypes. An XSD has a feed containing all the DocumentTypes (top level elements) that can be added to forms and workflows and a form or workflow has a feed containing all the DocumentTypes added (in the designer's Data Sources pane).
- FormTypeFeed - The collection used to manage forms AND workflows. This is the core collection in the API that is used to use, design, manage, instantiate, etc. forms and workflows.
- ControlTypeFeed - The collection used to list the controls, and their metadata, contained in a form or workflow.
...
Although our APIs are based on the Atom Publishing Protocol and the Atom Syndication Protocol and can be accessed on any language/platform that can interact with HTTP end points and can process XML documents, we provide a Java Client and a .Net Client that can be used to easily connect to from to frevvo from Java and Windows or Mono, respectively.
You will need to install a client library in order to use the API. See Installing the Client Library and Dependencies below.
...
Info |
---|
The Design-time Integration tutorial is a very good place to get a quick overview of how to use the Java API. |
Javadocs
If you installed locallyfrevvo locally, the installation includes the Javadocs .jar file. The com.frevvo.forms javafiles are located in the <installdrive>:\frevvo\ext\client directory. Many IDE's let you view Javadocs.
...
For a list of Frequently Asked Questions about common tasks using the API with a servera frevvo server, please see FAQ - Java Client API.
Installing the Client Library and Dependencies
The Java frevvo Java Client Library has the following dependencies:
...
For your convenience all these required jars can be found in the Tomcat frevvo Tomcat bundle in the /frevvo/ext/client folder. Make sure you include all of them in your classpath when adding them to your application's classpath.
...
Note |
---|
The actual jar versions may be different depending on the version of being of frevvo being used. |
Authentication & Session Management
When interacting with with frevvo, an application first needs to establish a session using the Data API. This is done by using the com.frevvo.forms.client.FormsService class and by providing proper credentials to authenticate.
...
Since there is some overhead associated with logging in and out, you need to keep the FormsService instance around for as long as you need to interact with before frevvo before logging out. Logging out ensures that will frevvo will release any unneeded resources and the user count will be decremented, as the number of users is affected by your licensefrevvo license.
LoginAs
supports frevvo supports an additional way of logging into using frevvo using the Data API: the loginAs() method. This new method allows you to login to as frevvo as any of the existing tenant users provided you can pass in the tenant's admin user and password. This is quite convenient when you want login to using frevvo using the same user that is logged into your application without having to know their password.
...
When your tenant was configured with the DelegatingSecurityManager, you can use the overloaded loginAs() method to automatically create virtual users in frevvo. For instance:
Code Block |
---|
... String tenantAdmin = getUsername() + '@' + getTenant(); String tenantAdminPwd = getPassword(); String username = getAsUsername(); FormsService s = new FormsService(getProtocol(), getHost(), getPort(), null); s.loginAs(username, tenantAdmin, tenantAdminPwd, true, null, null, null, null,null); ... |
This will automatically create a new, non-designer user (i.e. will be able to participate in workflows but not create forms/workflows), if it doesn't yet exist. If you want to want frevvo to auto create a new virtual user that is also a designer you need to pass in the frevvo.Designer role when calling loginAs(). For instance:
...
Visit the Data API Client Libraries Releases compatibility matrix to download the proper library version for your installed serverinstalled frevvo server.
The download is a zipfile containing the following files:
...
For a list of Frequently Asked question about common tasks using the API with serverfrevvo server, please see the API .Net Client FAQ topic.
...
The client libraries are built on top of the browser API. However since these URLs can be used directly from your browser, it is a great way to experiment with the API frevvo API before you start writing code.
This section describes the basic protocol used to interact with Data frevvo Data APIs including examples of what Atom requests may look like, what kind of responses to expect, and so on. It is intended for anyone wanting an understanding the general idea of the format and protocol used by the Data frevvo Data API and it assumes that you understand the basics of XML, namespaces, Atom feeds, and the main HTTP requests GET, POST, PUT and DELETE, as well as the RESTful concept of a resource. Using the API at this level your client application can interact with the Server frevvo Server using any programming language that lets you issue HTTP requests and consume XML-based responses.
You can use the Resource URIs listed Browser API Reference Guide in the browser address bar when you're logged into frevvo. The URIs return data from the server frevvo server as either web pages or XML files. To use the URIs, you edit the URL in the address bar when you're logged into a tenant frevvo tenant to include the URI of the resource feed you want to use. For example:
...
This example shows how to use the formtypes feed to have the server frevvo server return a list of all the forms belonging to the user who's currently logged in.
- After logging in, edit the URL frevvo URL in the browser address bar to insert api/formtypes immediately after the tenant name - which in this example is monahan.com.
- So in this example, we change the URL from: http://localhost:8082/frevvo/web/tn/monahan.com user/david/app
- To: http://localhost:8082/frevvo/web/tn/monahan.com/api/formtypes, and press Enter.
...
- After logging in, edit the URL frevvo URL in the browser address bar to insert api/controltypes immediately after the tenant name - which in this example is monahan.com.
- In this example, we change the URL from: http://localhost:8082/frevvo/web/tn/monahan.com/user/david/app
- to: http://localhost:8082/frevvo/web/tn/monahan.com/api/controltypes, and press Enter.
...
- After logging in, edit the URL frevvo URL in the browser address bar to insert api/controltypes?ownerId={formTypeId} immediately after the tenant name - which in this example is monahan.com.
- So in this example, we change the URL from: http://localhost:8082/frevvo/web/tn/monahan.com/user/david/app
- to: http://localhost:8082/frevvo/web/tn/monahan.com/api/controltypes?ownerId=_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david, and press Enter.
...
Logging In and Out of the Forms Server
When interacting with with frevvo, an application first needs to establish a session using the Data API. See the C# code snipped below for an example.
...
Since there is some overhead associated with logging in and out, you need to keep the FormsService instance around for as long as you need to interact with before with frevvo before logging out. Logging out ensures that will that frevvo will release any unneeded resources and the user count will be decremented, as the number of users is affected by your licenseyour frevvo license.
Calling the API from a JSP Page
...