Flag Mandatory Fields Automatically

If you would like to use script in your forms in order to automatically flag mandatory fields, using a red asterisk (*) in their captions, check-out this article I just posted on my blog.

The script supports mandatory fields with the following characteristics:

  • have plain or rich text captions
  • have no captions (no asterisk is displayed in this case)
  • use text objects (plain or rich text) as captions instead of normal field captions
  • have the same name (multiple instances that aren’t dynamically generated)
  • are inside repeating subform instances

Typically called when the root subform is initialized, the script will search recursively (depth-first search) for all fields within a specified container (i.e. the root subform) and will place the asterisk on any mandatory field it finds. There is also a function by which the asterisk can be toggled on/off by explicitly telling the function whether to treat the field as mandatory or optional.

The script is located in a script object. The idea is that you would make a script object fragment out of it and re-use it in any form that needs this functionality. The script is also heavily commented so it should be relatively easy to extend for your own needs.

“Dynamic Document Generator” is now “On-Demand Assembly”

The Dynamic Document Generator is now called the On-Demand Assembly Building Block.

The latest version of On-Demand Assembly and more information about this building block is available on:
http://www.adobe.com/devnet/livecycle/solutions/ondemand_buildingblock.html

Review Commenting and Approval Building Block

This series of articles provides you with tips, tricks and all you wanted to know about the Review Commenting and Approval Building Block.

Following new entries have been added:
Create custom process to initiate a RCA process

Electronic Submissions Solution Accelerator

Read on to find out more on Electronic Submissions Solution Accelerator.

eSubmissions Solution Accelerator is built on the Review Commenting and Approval and On Demand Assembly building blocks.

To learn how to design and initiate a Review Commenting and Approval workflow using eSubmissions, you can read the following article series:
Part-1
Part -2

Announcing the release of the eSubmissions Solution Accelerator v1.0

The extended eSubmissions solution accelerator team is pleased to announce the immediate availability of eSubmissions 1.0. Building on the foundation of LiveCycle ES, the eSubmissions Solution Accelerator enables the rapid delivery of managed and auditable review, commenting and approval solutions for life sciences. The eSubmissions Solution Accelerator will help Adobe’s life sciences customers bring new drugs and devices to market faster and with better oversight, and will help them reduce the burdens of their regulatory compliance efforts. Beyond life sciences, the eSubmissions Solution Accelerator can help Adobe systems integrators, partners, professional services, and customers rapidly deliver managed review, commenting, and approval solutions built on LiveCycle ES, for applications such as legal/contract review, manufacturing design reviews, and any other procedure-based review and approval process.

Along with life sciences-specific samples and documentation, the eSubmissions Solution Accelerator is built on the new Review, Commenting, and Approval and the updated On-Demand Assembly building-blocks. The Review, Commenting, and Approval building block combines the PDF collaboration tools of Acrobat and Reader with the structure and process management of LiveCycle in an auditable environment. The eSubmissions Solution Accelerator also includes the latest version of the On-Demand Assembly building block. The On-Demand Assembly building block enables forms and documents to be assembled into PDF Portfolios and documents based on business rules. These new technology building blocks add value to LiveCycle ES by enabling the rapid development of enterprise applications targeting the needs of Adobe’s enterprise customers.

eSubmissions Solution Accelerator:

http://www.adobe.com/devnet/livecycle/solutions/ls_esubmissions.html

More information about the Solution Accelerator program and other Solution Accelerators:
http://www.adobe.com/devnet/livecycle/solution_accelerators.html

Your feedback, suggestions, and questions are greatly appreciated, and can be made via the user forums.

With the formal announcement of eSubmissions v1.0, we’d like to add a note of thanks and acknowledgement to the many people who downloaded the pre-release version and provided feedback.

Ed Chase
Solutions Architect, Life Sciences & Manufacturing

Ashish Agrawal
Group Product Manager

Saving a Generic Form Resource to the LiveCycle Repository

I found myself suggesting this as a possible solution on another thread today and thought it could be generally useful.

Here’s how you would use the CM API to create a new generic form resource, stuff your form template content into it and save it to the LiveCycle Repository using the currently-posted release:

import cm.model.CmObject;
import cm.model.CmSession;
import cm.model.repository.CmResourceType;
import cm.model.repository.CmRepositoryEvent;
import cm.model.repository.CmRepositoryFactory;
import cm.model.repository.CmResourceCollection;
import cm.model.repository.ICmRepository;

private function onBtnClick(event:Event):void
{
// create a new generic form template resource object
var xdp:CmObject = new CmObject();
xdp.resourceType = CmResourceType.FORM_TEMPLATE;
xdp.path = "/cm/content/myForm.xdp";
xdp.contentType = "application/vnd.adobe.xdp+xml";
xdp.contentData = '<xdp><template><subform name="root"><subform name="page"><field/></subform></subform></template></xdp>';

// make sure there's an active, authenticated session
// (note that username, password, server and port are variables you would supply)
if (CmSession.getInstance() == null || !CmSession.getInstance().authenticated)
CmSession.createInstance(username, password, server, port);

// get an instance of the LC Repository
var rep:ICmRepository = CmRepositoryFactory.getInstance();

// save it in the LC Repository
rep.save(xdp, true, onSave, onSaveFault);
}

private function onSave(event:CmRepositoryEvent):void
{
Alert.show("Saved XDP to LC Repository");
}

private function onSaveFault(event:FaultEvent):void
{
Alert.show("Error occurred while attempting to save: " + event.fault.toString());
}

Correspondence Management

To find out more on the Correspondence Management Solution Accelerator, you may read the following existing articles. Please note that future CM-related articles will be posted on this blog rather than the LiveCycle Product Blog.

About the CM Solution Accelerator

Letter Building Tutorial

How do I make sure this paragraph is included in my letter only if the user selects this other paragraph?

Unveiling the Dynamic Document Generator …

In this post, I’ll brief you on what you can actually do with our technology – Dynamic Document Generator (DDG), delivered as part of the Enrollment Solution Accelerator kit. This component comprises of a taglib which provides JSTL implementation along with a rich collection of custom tags that facilitate various XFA manipulation operations like dynamic stitching of templates, merging data into templates, generating interactive/non-interactive PDFs and assembling documents dynamically.

It is true that XFA language itself supports the notion of form stitching using data nominated subform or subformset. However, the XFA approach requires the form designer to be aware of the data XML structure and design the forms such that the data nomination could be used by the XMLFM engine. DDG eliminates this requirement and thus the form designers can focus on content creation, whereas the application developer can concentrate on writing the decision making logic and more importantly, both can work in parallel.

DDG supports two artifacts:
   • DXFA (Dynamic XFA)
   • CSC (Content Selection and Composition)
These are JSP based files which integrate seamlessly with client web applications. The decision support as well as other programming language constructs like looping can be encoded in these files using the well established JSTL tag based expression evaluation capabilities. The DDG taglib provided custom tags can be used to model complex document generation logic in a simplified manner.

With that said and assuming that you have LiveCycle installed and setup, with at least Forms, Output and Assembler services deployed, I’ll step you through creation of DXFA and CSC files.

Authoring DXFA files

In a nutshell, include our custom taglib and the standard jstl taglib, write a series of lc:include and lc:alter tags within the lc:render tag along with standard jslt looping and conditional constructs like c:if and c:foreach to specify business rules and template selection logic. Package the dxfa file into the web application, deploy and run. The required templates or fragments should ideally be placed in the LiveCycle Repository. Alternately, they could be included within the Web Application or on a local directory.

To create a DXFA file for generating a CreditCardEnrollment form, some of the requirements would be:
   • There can be two types of credit cards that one can apply for – Silver or Gold.
   • Based on the Card Type, the enrollment form’s header and footer would vary.
   • If the applicant is a minor, an additional section eliciting Parent/Guardian
      information to be included in the enrollment form.
   • There are some mandatory sections like a product features section which must
      always be included.
   • Certain inputs like card type, name, age – taken as input (using an HTML or Flex
      based client) from the applicant should appear pre-populated in the form.

In a JSP editor or a text editor, create a “.dxfa” file and

  1. Include the lc and jstl taglibs.

      <%@ taglib uri=”http://www.adobe.com/taglib/ddg” prefix=”lc” %>
      <%@ taglib uri=”http://java.sun.com/jsp/jstl/core” prefix=”c” %>

  2. Set the render format to either XDP, PDF, PDFForm or PDFA.

     <lc:render format=”PDFForm”> … </lc:render>

  3. Include the container template using include tag. All contents of the template
      need to be included so specify the select attribute as ‘/xdp’.

    <lc:include type=”repository” ref=”/content/Container.xdp” select=”/xdp”> …
       </lc:include>

  4. Stitch the required templates using include tag. Like, product information:

     <lc:include ref=”/Templates/ProductInfo.xdp” type=”repository”> …         </lc:include>

  5. Pre-populate data into relevant template using the setvalue tag.

     < lc:include ref=”/Templates/PersonalInfo.xdp” type=”repository”>
        < lc:setvalue name=”firstName” value=”${param.firstName}”/>
        < lc:setvalue name=”middleName”
        value=”${param.middleName}”/>
        < lc:setvalue name=”lastName” value=”${param.lastName}”/>
        < lc:setvalue name=”Age” value=”${param.Age}”/>
        < lc:setvalue name=”SSN” value=”${.param.SSN}”/>
     </lc:include>

  6. If the age of the applicant is less than 18 years, include an additional template for
      parent/guardian information

     <c:if test=”${requestScope.paramsmap.Age<18}" >
       <lc:include type="repository" ref="/Templates/ParentInfo.xdp">
       </lc:include>
     </c:if>

  7. Package the dxfa file into your web application and deploy it. You could also
      include your templates and dxfa files into the sample web application
      (DDGSample.war) provided as part of the kit and get going.

     Click here to download the complete DXFA file.

CSC in 10 Seconds

Let me now give you a quick rundown of CSC (Content Selection and Composition) concept. Basically, this component brings dynamism into LC Assembler. CSC file contains following sections:
  1. DDX section
  2. File section, which contains list of documents that could be used within DDX.
Since CSC file itself is a JSP, the same JSTL and DXFA tags can be used to decide at the runtime which documents to be used for assembly.
E.g. If I require to create a PDFPackage which is say, an Information Kit for buying a product, then I would create the CSC file as follows:

  <%@ taglib uri=”http://www.adobe.com/taglib/ddg” prefix=”lc” %>
  <lc:csc>
    <lc:doc key=”productbrochure” type=”url” ref=”content/productbrochure.pdf” />
    <lc:doc key=”termsofuse” type=”url” ref=”content/termsofuse.pdf” />
    <lc:doc key=”privacypolicy” type=”url” ref=”content/privacypolicy.pdf” />
    <lc:doc key=”faq” type=”url” ref=”content/faq.pdf”/>
    <lc:doc key=”ProductOrderForm” type=”dxfa” ref=”orderPackage.dxfa”/>
    <lc:ddx>
      <DDX xmlns=”http://ns.adobe.com/DDX/1.0/”>
      <PDF result=”resultDoc”>
        <PackageFiles>
          <PDF source=”productbrochure”/>
          <PDF source=”termsofuse”/>
          <PDF source=”privacypolicy”/>
          <PDF source=”faq”/>
          <PDF source=” ProductOrderForm “/>
        </PackageFiles>
      </PDF>
      </DDX>
    </lc:ddx>
  </lc:csc>

The PDFPackage would include product information documents like, “productbrochure.pdf”, “termsofuse.pdf”, “privacypolicy.pdf”, “faq.pdf” and a purchase order form which gets generated by the DXFA named “orderPackage.dxfa”.
Package this CSC into your web application and hit the URL.

Bookmark this page for more DDG examples and features !!!

————————————————————————————————