Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
    ...
    String tenantAdmin = getUsername() + '@' + getTenant();
    String tenantAdminPwd = getPassword();
    String username = getAsUsername();
    List<String> roles = new ArrayList<String>();
    roles.add("frevvo.Designer");
    FormsService s = new FormsService(getProtocol(), getHost(), getPort(), null);
    s.loginAs(username, tenantAdmin, tenantAdminPwd, true, roles, null, null,null,null);
    ...

Net Client API

...

TBD

.Net Client API FAQ

For a list of Frequently Asked question about common tasks using the API with frevvo server, please see the [[frevvo API .Net Client FAQ]] topic.

...

If you click on the RequiredFieldPrompt link and either open or save the XML file, you see the XML for the control, which is shown below.<pre>

Code Block
<entry xmlns="http://www.w3.org/2005/Atom"

...


        xmlns:fd="http://schemas.frevvo.com/fdata/2008"

...


        xml:base="http://localhost:8082">

...


    <id>_bjLLYbIIEeClr-dcvjFaZg!_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david</id>

...


    <title type="text">RequiredFieldPrompt_</title>

...


    <summary type="text">Message 39</summary>

...


    <category scheme="http://schemas.frevvo.com/fdata/2008#controltype"

...


            term="OutputControlType"/>

...


    <category scheme="http://schemas.frevvo.com/fdata/2008#displaytype" term="Message"/>

...


    <updated>2011-07-25T13:52:22.017-04:00</updated>

...


    <fd:required value="true"/>

...


    <fd:readonly value="false"/>

...


    <link rel="parent" type="application/atom+xml"

...


            href="/frevvo/web/tn/monahan.com/api/controltype/_fQoD8a4rEeCMGZK99v93jw!_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david"

...


            title="This entry's parent control type"/>

...


    <link type="application/atom+xml"

...


            href="/frevvo/web/tn/monahan.com/api/controltype/_bjLLYbIIEeClr-dcvjFaZg!_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david"

...


            title="This entry"/>

...


    <link rel="self" type="application/atom+xml"

...


            href="/frevvo/web/tn/monahan.com/api/controltype/_bjLLYbIIEeClr-dcvjFaZg!_fNScEK4rEeCMGZK99v93jw!_W0jPga4rEeCMGZK99v93jw!david"

...


            title="This entry"/>
</entry>

Calling the API from a JSP Page

...

An important thing to note about JSP pages is that the FormsService instance is state-full and the same instance needs to be used throughout the session - this is especially the case when rendering form URLs in the browser since an API key is automatically appended and bound to the FormsService session; as soon as you logout(), the API key becomes invalid. Typically, in a web application context, the FormsService instance is stored in the HTTP session that the user has with your web application.<pre>

Code Block
<%@ page import="java.util.*,com.frevvo.forms.client.*,com.frevvo.forms.client.util.*" %>

...


FormsService service = (FormsService) session.getAttribute ( "frevvo.forms.service" );

...


if (service == null)

...

 {
        service = new FormsService("http", "localhost", 8082, null);

...


        service.loginAs (request.getParameter( "username" ),

...


            tenantAdminUserId, tenantAdminPassword, true, null,

...


            request.getParameter( "firstname" ),

...


            request.getParameter( "lastname" ),

...


            request.getParameter( "email" ), null);

...


        }
session.setAttribute ("frevvo.forms.service", service);

...