Mobile Form profile

Mobile Form enables LiveCycle XFA forms on mobile devices. It does it by rendering XFA Form to Html5 document.

As per Sling website, Apache Sling is a web framework that uses a Java Content Repository, such as Apache Jackrabbit, to store and manage content. Sling applications use either scripts or Java servlets, selected based on simple name conventions, to process HTTP requests in a RESTful way.

Mobile Form has a service that generates HTML snippet from XFA form. That html snippet, along with the xfaform css and js, can be embedded into any web page using the sling constructs like the following:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<%@ page session="false" %>
<%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0"%>
<%@taglib prefix="cq" uri="http://www.day.com/taglibs/cq/1.0" %>
 
<%
    String locale = "en_US";
    request.setAttribute("xfaLocale",locale.replace("_",""));
%>
<!DOCTYPE html>
<html>
       <head>
               <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
               <meta charset="UTF-8">
               <cq:includeClientLib categories="xfaforms.I18N.${xfaLocale}" />
               <cq:includeClientLib categories="xfaforms.runtime" />
       </head>
       <body id="formBody">
            <sling:include resourceType="xfaforms/render"/>
       </body>
</html>

Pause and take a look at the highlighted lines 14,15 and 18. Rest of the stuff is pretty standard sling jsp script. We use the recommended practice for including client side libraries. The first includeClientLib is for including the locale specific messages you can modify the xfaLocale parameter to control it where as the other includeClientLib is for including the XFA Runtime.

Sling include @ line 18 is responsible for the html snippet, I mentioned earlier. You can create you page and just add these lines to include client side libs and html snippet to get the form running.

We call the content node and the sling script, responsible for rendering form embedded in web page, Html profile. We call it so because, profile dictates how a form should look like and how it behaves. That means one needs to play with the profile for all the customization required in the form. Mobile Form leaves a lot of hooks in the generated html snippet in order to help the customization.

One Response to Mobile Form profile

  1. Pingback: Create custom Mobile Form profile

Leave a Reply

Your email address will not be published. Required fields are marked *


9 − = two

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>