<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Adobe Consulting Public Sector</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/acdc/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.adobe.com/acdc/atom.xml" />
   <id>tag:blogs.adobe.com,2008:/acdc/213</id>
    <link rel="service.post" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt-atom.cgi/weblog/blog_id=213" title="Adobe Consulting Public Sector" />
    <updated>2008-08-19T13:00:10Z</updated>
    <subtitle>Adobe Consulting - Public Sector group will blog about their experiences using Adobe Enterprise products. The main goal of the blog is to provide information on new trends, techniques, and pitfalls. Based entirely on working on real-world projects.</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.2</generator>
 
<entry>
    <title>Using JSON to Exchange Data with Web Services in XFA Forms</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/acdc/2008/08/using_json_to_exchange_data_wi.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt-atom.cgi/weblog/blog_id=213/entry_id=6899" title="Using JSON to Exchange Data with Web Services in XFA Forms" />
    <id>tag:blogs.adobe.com,2008:/acdc//213.6899</id>
    
    <published>2008-08-19T13:00:00Z</published>
    <updated>2008-08-19T13:00:10Z</updated>
    
    <summary>Continuing from my previous post on extending the JavaScript prototype property, another most under-utilized technique is the use of JavaScript Object Notation (JSON) as a data exchange format between a form and web services. Did you ever think of using JSON in form development? No? Me neither. I never thought of it until one of my customers suggested the possibility. It was an elegant solution, as our web services were getting more complex, we were wrestling on reading the data versus implementing solutions. JSON gave us a way to reduce hassle of working with complex objects. </summary>
    <author>
        <name>Mick Lerlop</name>
        <uri>http://lerlop.com</uri>
    </author>
            <category term="Designer" />
            <category term="JavaScript" />
            <category term="LiveCycle" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/acdc/">
        <![CDATA[<p>Continuing from my <a href="http://blogs.adobe.com/acdc/2008/08/extending_javascript_with_prot.html" target="_blank">previous post on extending the JavaScript prototype property</a>, another most under-utilized technique is the use of JavaScript Object Notation (JSON) as a data exchange format between a form and web services. Did you ever think of using JSON in form development? No? Me neither. I never thought of it until one of my customers suggested the possibility. It was an elegant solution, as our web services were getting more complex, we were wrestling on reading the data versus implementing solutions. JSON gave us a way to reduce hassle of working with complex objects. </p>]]>
        <![CDATA[<p>If you are reading, you probably know what JSON is. But if you don't, you can learn more about it at <a href="http://www.json.org/" target="_blank">http://www.json.org/</a>.</p>
<p>In this Service Oriented Architecture (SOA) era, I believe that most forms retrieve data from (or submit to) external sources via web services. Web services are great as they allow to a wide variety of clients to consume the services. Web service responses could range from a few pieces of data or a large set of data (e.g. array). Working with latter type of XML response is a lot harder if you need to conditionally hide/show certain item in the list or use the data in another form or fashion. In this situation, JSON is ideal. </p>
<p>So before you do anything to the form, you need to modify your web service to return a JSON formatted string. Instead of returning an ArrayList or Array of objects from the web service operation (Java), you have to convert your array into a JSON string. I use <a href="http://json-lib.sourceforge.net/" target="_blank">JSON-lib</a> (net.sf.json.JSONArray) but you can any JSON library you prefer. Here is sample code:</p>
<pre><code>
public String getSimpleArray() 
{
	Person[] people = { 
                new Person("John", "Doe", "235-235-5466", "john@doe.com"),
                new Person("Tom", "Green", "444-235-2343", "tom@green.com")
  		};
	JSONArray jsonArray = JSONArray.fromObject(people);
	return jsonArray.toString();
}
</code></pre>
<p>The web service response should look similar to the following snippet:</p>
<pre><code>
&lt;soap:Envelope xmlns:soap=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;&gt;<br />   &lt;soap:Body&gt;<br />      &lt;ns1:getSimpleArrayResponse xmlns:ns1=&quot;http://consulting.adobe.com/&quot;&gt;<br />         &lt;return xmlns=&quot;http://consulting.adobe.com/&quot;&gt;[{&quot;email&quot;:&quot;john@doe.com&quot;,&quot;firstname&quot;:&quot;John&quot;,&quot;lastname&quot;:&quot;Doe&quot;,&quot;phone&quot;:&quot;235-235-5466&quot;},{&quot;email&quot;:&quot;tom@green.com&quot;,&quot;firstname&quot;:&quot;Tom&quot;,&quot;lastname&quot;:&quot;Green&quot;,&quot;phone&quot;:&quot;444-235-2343&quot;}]&lt;/return&gt;<br />      &lt;/ns1:getSimpleArrayResponse&gt;<br />   &lt;/soap:Body&gt;<br />&lt;/soap:Envelope&gt;
</code>
</pre>
<p>As you can see, the soap body only contains one element, which is a JSON structured string. To utilize this in your form, simple create a data connection to this web service operation and bind the return element to a text field. Then convert the raw value of the text field to a JSON object by using the eval() function.</p>
<pre>
<code>
// wsResponse is a text field and is bound to the web service return element.
var people = eval('(' + wsResponse.rawValue + ')'); // or wsResponse.rawValue.evalJSON(); if you use the String prototype extension from my previous post.
</code>
</pre>
<p>This gives you an array of JavaScript objects called &quot;people&quot;. You can now access  this array just like any other native JavaScript arrays. Below are some examples:</p>
<pre>
<code>
// loop through the array
for(var i = 0; i < people.length; i++)
{
	var person = people[i];
	textField.rawValue += person.firstname + " " + person.lastname + "\n";
}

<p>// get the email of the last person in the array<br />
var email = people[people.length - 1].email;<br />
</code></pre><br />
<p>Yeah, it's that simple. Now you can forget about how to access your data and focus on how and where to use the. As a side note, there are some security concerns with JSON regarding code insertions attacks etc. There are some open-source libraries that handle these issues.</p><br />
<p>I don't have any samples handy. However, you need one, leave a comment and I will post one. Thanks.</p><br />
<p>Resources</p><br />
<ul><br />
  <li>JSON <a href="http://www.json.org/" target="_blank">http://www.json.org/</a></li><br />
  <li>JSON <a href="http://www.google.com/search?q=json%20security" target="_blank">Security concerns</a></li><br />
</ul></p>]]>
    </content>
</entry>
<entry>
    <title>Extending JavaScript with Prototypes in XFA Forms</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/acdc/2008/08/extending_javascript_with_prot.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt-atom.cgi/weblog/blog_id=213/entry_id=6900" title="Extending JavaScript with Prototypes in XFA Forms" />
    <id>tag:blogs.adobe.com,2008:/acdc//213.6900</id>
    
    <published>2008-08-13T13:34:52Z</published>
    <updated>2008-08-13T14:20:18Z</updated>
    
    <summary>Do you sometimes wish you had functions that standard JavaScript does not provide? For instance, a trim or strip function that removes leading and trailing white spaces from a string object. In LiveCycle Designer, the traditional way is to create a script object and a function. Then to use it, you would have a function call similar to the following statement:
var newString = ScriptObject.trim(oldString);
These function calls can become lengthy in situations where the script object is located on a different page than your method call. For example:
var newString = form1.page1.subform1.ScriptObject.trim(oldString);</summary>
    <author>
        <name>Mick Lerlop</name>
        <uri>http://lerlop.com</uri>
    </author>
            <category term="JavaScript" />
            <category term="LiveCycle" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/acdc/">
        <![CDATA[<p>Do you sometimes wish you had functions that standard JavaScript does not provide? For instance, a trim or strip function that removes leading and trailing white spaces from a string object. In LiveCycle Designer, the traditional way is to create a script object and a function. Then to use it, you would have a function call similar to the following statement:</p>
<pre><code>var newString = ScriptObject.trim(oldString);</code></pre>
<p>These function calls can become lengthy in situations where the script object is located on a different page than your method call. For example:</p>
<pre><code>var newString = form1.page1.subform1.ScriptObject.trim(oldString);</code></pre>]]>
        <![CDATA[<p>Having said that, the problem with this approach is that, to reuse this component, the  script object name and location  must stay the same for each form. If you move the location of the script object, since there is no easy way to refactor it, your references will certainly break. A more elegant solution is to use of the prototype property, you can extend the functionality of the classes in the same fashion you can do with HTML JavaScript in a web browsers.</p>
<p>The prototype property is probably one of the most under-utilized scripting features when it comes to LiveCycle form development. However, it is so powerful as it allows you to easily extend and reuse JavaScript intrinsic classes and your own. For instance, the trim function can be rewritten as follows:</p>
<pre><code>String.prototype.trim = function() { return this.replace(/^\s+/, '').replace(/\s+$/, ''); }</code></pre>
<p>And to use it:</p>
<pre><code>
var oldString = "    Hello   ";
var newString = oldString.trim();
// newString -> "Hello";
</code></pre>
<p>You may also want to have another method called &quot;strip&quot; that performs the same task.</p>
<pre><code>String.prototype.strip = String.prototype.trim;</code></pre>
<p>As you can see, your function is simpler and easy to use. Using the prototype property for custom functions also prevents your code from breaking in case you change the name or location of the script object and provides a natural way to extend objects even if you did not author  them.</p>
<p>Based on my past projects where the requirement was to create resuable Designer library components for multiple teams, I usually wrap my script objects in a subform, make it into a library component (xfo) or a form fragment and share it with other form developers. </p>
<p>Also to make the JavaScript interpreter in Acrobat/Reader aware of your prototype extensions, you must load all your prototype definitions when the form loads. You can achieve this by wrapping the prototype function and property definitions inside a function and call that function in the subform initialize event. For instance:</p>
<pre><code>
function initialize()
{
	String.prototype.trim...
	String.prototype.strip...
	...
}
</code></pre>
<p>In my sample form, once the extensions have been initialized, it will print out the below messages in the debugger console.</p>
<pre><code>Initializing Array extensions...
Array extensions initialized.
Initializing String extensions...
String extensions initialized.</code></pre>
<p>One last note - as you develop these prototype functions, don't forget to include documentation comments to increase readability and ease of use. Feel free to share your experiences or ask any question you may have.</p>
<p>Resources</p>
<ul>
  <li><a href="/acdc/files/lc_designer_prototypes.pdf" target="_blank">Sample</a></li>
  <li>For more information about the prototype property, <a href="http://www.google.com/search?q=javascript prototype" target="_blank">click here</a>.</li>
  <li><a href="http://www.adobe.com/go/learn_lc_scriptingBasics" target="_blank">LiveCycle Designer ES Scripting Basics</a></li>
  <li><a href="http://www.adobe.com/go/learn_lc_scriptingReference" target="_blank">LiveCycle Designer ES Scripting Reference</a></li>
  <li>For more information about Form Fragments, <a href="http://www.adobe.com/devnet/livecycle/articles/fragment_tutorial.html" target="_blank">click here</a>.</li>
</ul>]]>
    </content>
</entry>
<entry>
    <title>Conway&apos;s Law and Code Ownership</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/acdc/2008/07/conways_law_and_code_ownership.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt-atom.cgi/weblog/blog_id=213/entry_id=6672" title="Conway's Law and Code Ownership" />
    <id>tag:blogs.adobe.com,2008:/acdc//213.6672</id>
    
    <published>2008-07-23T22:27:14Z</published>
    <updated>2008-07-23T22:29:36Z</updated>
    
    <summary>Conway&apos;s Law is one observation we can use as a guide on the initial stages of a Software project, it basically states that development modules organize themselves around the communication structure of an organization. So simply put, if you get...</summary>
    <author>
        <name>Venkata Adidam</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/acdc/">
        <![CDATA[Conway's Law is one observation we can use as a guide on the initial stages of a Software project, it basically states that development modules organize themselves around the communication structure of an organization. So simply put, if you get three guys in a room that want to quickly roll-out a compiler and not interfere with each other's work, you will have a three part compiler. Why? because each person does not want to know what the other is doing as long as each has stuck to an agreed interface, everyone is happy.
    <p> </p>
    <p>So, an architectural decision has been made, not by a best practice but by social communication. If the same three developers collaborated on a high-level architecture, a good design, and worked closely on its implementation, my guess is that they would have better results. Not only in the quality of work produced but also other intangibles.</p>
    <p> </p>
    <p>Ever have one developer that is over-worked while the other ten developers wished they could help? Well, not paying attention to Conway's law is probably the culprit. It is easy to fall into the the argument that: by giving each module an owner we have one throat to choke.</p>
    <p> </p>
    <p>This type of thinking forgets some important items:</p>
    <ol>
      <li>People work on projects, someone will take unforeseen time-off.<br />
      </li>
      <li>Dividing up modules does not necessarily divide work equally. Ever have a developer that had a super-easy module and wanders around like the floor like he's the only one that has his act together?<br />
      </li>
      <li>Unforeseen work presents a challenge on which module it belongs as each module owner will attempt to push the new work onto another. For example, where should certain validations be placed: front-end, middle tier, or at the persistence layer? I bet you the group that with the least political leverage will get this extra work.<br />
      </li>
    </ol>
    <p>So what can we do to break down the social communication barrier? One technique is to implement review practices. Requirements Reviews, Design Reviews, or even Pair Programming, just as long as people are talking.</p>
    <p> </p>
    <p>Remember, a majority of Software Engineering problems can be boiled down to a lack of communication, so don't avoid communication. The days of the unsociable introvert coder hiding in a dark basement as to avoid human contact is over.</p>
    <br/>
]]>
        
    </content>
</entry>
<entry>
    <title>Jar Jar to the rescue</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/acdc/2008/06/jar_jar_to_the_rescue.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt-atom.cgi/weblog/blog_id=213/entry_id=6484" title="Jar Jar to the rescue" />
    <id>tag:blogs.adobe.com,2008:/acdc//213.6484</id>
    
    <published>2008-06-30T16:06:06Z</published>
    <updated>2008-06-30T16:07:11Z</updated>
    
    <summary>I think we have all seen a JAR conflict on an application server, I still use JDOM and usually run into a conflict with an older version of the JAR installed somewhere on the system that I usually can&apos;t touch....</summary>
    <author>
        <name>Venkata Adidam</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/acdc/">
        <![CDATA[<p>I think we have all seen a JAR conflict on an application server, I still use JDOM and usually run into a conflict with an older version of the JAR installed somewhere on the system that I usually can't touch.</p>
  <p>So, what I did was to use an Ant task called Jar Jar that is available at: http://code.google.com/p/jarjar/</p>
  <p>Jar Jar will take a Jar file or (a group of Jar files), change the package names, and repackage the result in a new Jar File. The idea is that you can create your own Jar file with your dependencies packaged in.</p>
  <p>I use the BeanShell scripting language (www.beanshell.org) which is what the LiveCycle ES Workbench Script Object is based on. There is no JAR file that I deploy but a script, therefore no compiled code to deploy. So, I use Jar Jar a little differently then what is documented on Jar Jar's Wiki. I create my own package for JDOM and one of its dependencies Jaxen and I place the new Jar file in the classpath.</p>
  <p>My, Ant file looks like the following:</p>
    <blockquote>
      <p>&lt;project name=&quot;CustomJDOM&quot; default=&quot;jar&quot; basedir=&quot;.&quot;&gt;</p>
      <p>&#160;&#160;&#160;&#160;	&lt;taskdef name=&quot;jarjar&quot; classname=&quot;com.tonicsystems.jarjar.JarJarTask&quot; classpath=&quot;./jarjar-1.0rc7.jar&quot;/&gt;</p>
      <p>&#160;&#160;&#160;&#160;	&lt;target name=&quot;jar&quot;&gt;</p>
      <p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;	&lt;jarjar jarfile=&quot;jdom_custom.jar&quot;&gt;</p>
      <p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;	&lt;zipfileset src=&quot;lib/jaxen-core.jar&quot;/&gt;</p>
      <p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;	&lt;zipfileset src=&quot;lib/jaxen-jdom.jar&quot;/&gt;</p>
      <p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;	&#160;	&lt;zipfileset src=&quot;lib/jdom.jar&quot;/&gt;</p>
      <p> &#160;&#160;&#160;&#160;	&#160;&#160;&#160;&#160;&#160;&#160;&#160;	&lt;rule pattern=&quot;org.jaxen.**&quot; result=&quot;org.jdom_1_1.jaxen.@1&quot;/&gt;</p>
      <p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;	&lt;rule pattern=&quot;org.jdom.**&quot; result=&quot;org.jdom_1_1.@1&quot;/&gt;</p>
      <p> &#160;&#160;&#160;&#160;&#160;&#160;&#160;	&lt;/jarjar&gt;</p>
      <p>&#160;&#160;&#160;&#160;	&lt;/target&gt;</p>
      <p>&lt;/project&gt;</p>
      <p>&#160; </p>
    </blockquote>
    <p> </p>
    <p>Taking it a line by line:</p>
    <p> </p>
    <blockquote>
      <p><em>&lt;project name=&quot;CustomJDOM&quot; default=&quot;jar&quot; basedir=&quot;.&quot;&gt;</em></p>
    </blockquote>
    <p> </p>
    <p>Standard Ant project tag, the default target is &quot;jar&quot; which kicks of the Jar Jar task.</p>
    <blockquote>
      <p> <em>&lt;taskdef name=&quot;jarjar&quot; classname=&quot;com.tonicsystems.jarjar.JarJarTask&quot; classpath=&quot;./jarjar-1.0rc7.jar&quot;/&gt;</em></p>
    </blockquote>
    <p> </p>
    <p>This is how you declare a new Ant task (or one of the ways), make sure you update the &quot;classpath&quot; variable to where ever you installed the &quot;Jar Jar&quot; Jar file.</p>
    <p> </p>
    <blockquote>
      <p><em>&lt;target name=&quot;jar&quot;&gt;</em></p>
    </blockquote>
    <p> </p>
    <p>I'm declaring a task to be run.</p>
    <p> </p>
    <blockquote>
      <p> <em>&lt;jarjar jarfile=&quot;jdom_custom.jar&quot;&gt;</em></p>
    </blockquote>
    <p> </p>
    <p>This line kicks-off the Jar Jar task and writes the result to a file called: jdom_custom.jar</p>
    <p> </p>
    <blockquote>
      <p> <em>&lt;zipfileset src=&quot;lib/jaxen-core.jar&quot;/&gt;</em></p>
      <p> <em>&lt;zipfileset src=&quot;lib/jaxen-jdom.jar&quot;/&gt;</em></p>
      <p><em>&lt;zipfileset src=&quot;lib/jdom.jar&quot;/&gt;</em></p>
    </blockquote>
    <p> </p>
    <p>The list of Jar files that will be repackaged in the new Jar file with a new package name.</p>
    <p> </p>
    <blockquote>
      <p> <em>&lt;rule pattern=&quot;org.jaxen.**&quot; result=&quot;org.jdom_1_1.jaxen.@1&quot;/&gt;</em></p>
      <p> <em>&lt;rule pattern=&quot;org.jdom.**&quot; result=&quot;org.jdom_1_1.@1&quot;/&gt;</em></p>
    </blockquote>
    <p> </p>
    <p>I'm changing the package name from org.jaxen to org.jdom_1_1.jaxen and org.jdom to org.jdom_1_1.</p>
    <p> </p>
    <p>To use the new Jar File. Include &quot;jdom_custom.jar&quot; in your classpath and use the new package names. So instead of using the package name: org.jdom in your code use: org.jdom_1_1. You never have to worry about a Jar file conflict again.</p>
    <br/>
]]>
        
    </content>
</entry>
<entry>
    <title>Acrobat 9 is shipping and Here is how to communicate between PDF and Flash/Flex</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/acdc/2008/06/acrobat_9_is_shipping_and_here.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt-atom.cgi/weblog/blog_id=213/entry_id=6454" title="Acrobat 9 is shipping and Here is how to communicate between PDF and Flash/Flex" />
    <id>tag:blogs.adobe.com,2008:/acdc//213.6454</id>
    
    <published>2008-06-26T16:17:00Z</published>
    <updated>2008-06-26T17:00:15Z</updated>
    
    <summary>Prior Acrobat 9, we were able to communicate between a PDF and a Flash/Flex application residing in the same browser window (e.g. the iframe approach). Acrobat 9 introduces a new feature called Rich Media Annotation that allows you to amazing...</summary>
    <author>
        <name>Mick Lerlop</name>
        <uri>http://lerlop.com</uri>
    </author>
            <category term="Acrobat" />
            <category term="Flex" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/acdc/">
        <![CDATA[<p>Prior <a href="http://www.adobe.com/products/acrobat/" target="_blank">Acrobat 9</a>, we were able to communicate between a PDF and a Flash/Flex application residing in the same browser window (e.g. <a href="http://blogs.adobe.com/mtg/2006/09/flex_meets_livecycle_forms.html" target="_blank">the iframe approach</a>). Acrobat 9 introduces a new feature called <a href="http://blogs.adobe.com/thesamepage/2008/06/commenting_on_video_still_adds.html" target="_blank">Rich Media Annotation</a> that allows you to amazing stuff with Flash ... one of them being the ability to embed Flash into a PDF and communicate with it via JavaScript. The example here is simple PDF document with an embedded Flex application that takes a product ID from the PDF and queries Amazon Web Services for product information (features, price, release date etc.).<br />
</p>]]>
        <![CDATA[<p>In addition to the Flash playback support, Acrobat/Reader 9 can communicate with embedded SWF by utilizing the <a href="http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html" target="_blank">ExternalInterface API</a>. This means that you must register your ActionScript function to indicate that it should be made available to the PDF by using the addCallBack() method as follows:</p>

<pre>
<code>
/* ActionScript */
// Register an ActionScript method as callable from the container
ExternalInterface.addCallback("find", find);

// Find a product
public function find(itemId:String):void
{
	...
}
</code>
</pre>

<p>On the PDF side, all you need to do is to get hold of the Flash object and call into the ActionScript method by using the callAS( methodName:String, &lt;argument1, argument2, and so on...&gt;) as follows:</p>
<pre>
<code>
/* JavaScript */

// Get hold of the first Flash object on the first page
var annot = getAnnotsRichMedia(0)[0];

if ( annot ) 
{
	// if exists, call the function called "find"
	// and pass an item ID as an argument	
	annot.callAS( "find", "B000NDIB6Y");
}
</code>
</pre>
<p>Again, what the callAS method does is calling into ActionScript via ExternalInterface calling convention to an exposed method. The example I mentioned in this post can be <a href="/acdc/files/AcrobatFlashCommunication.pdf">downloaded here</a>. Acrobat/Reader 9 is required. If you want to reuse the Flex application, you will need to register for an <a href="http://www.amazon.com/gp/browse.html?node=3435361" target="_blank">Amazon Web Services</a> and their <a href="http://affiliate-program.amazon.com/gp/associates/join" target="_blank">Associates</a> accounts.</p>
<p>Downloads</p>
<ul>
    <li><a href="http://www.adobe.com/products/acrobat/" target="_blank">Acrobat 9</a></li>
    <li><a href="/acdc/files/AcrobatFlashCommunication.pdf">Sample PDF</a></li>
    <li><a href="/acdc/files/AWSeCommerce.mxml">Sample Flex</a></li>
</ul>
<p>How-to Steps:</p>
<ol>
    <li>Create a blank PDF or open an existing one in Acrobat 9.</li>
    <li>Add a button by going into the form editing mode.<br />
        <br />
    <img src="/acdc/images/a9formediting.png" alt="Form Editing" width="206" height="149" /><br />
        <br />
    </li>
    <li>Add a Run Javascript action to the button.<br />
            <br />
        <img src="/acdc/images/a9buttonaction.png" alt="Run JavaScript Action" width="529" height="665" /><br />
        <br />
    </li>
    <li>Add the Flex SWF to the PDf by using the Flash tool.<br />
            <br />
            <img src="/acdc/images/a9flashtool.png" alt="Flash tool" width="148" height="129" /><br />
                <br />
    </li>
    <li>Editing the Flash properties to make it start as soon as the PDF is opened.<br />
            <br />
            <img src="/acdc/images/a9flashprops.png" alt="Flash properties" width="500" height="392" /><br />
            <br />
    </li>
    <li>Save the PDF and the end result should look similar to this.<br />
            <br />
            <img src="/acdc/images/a9pdfcomscreenshot.png" alt="Screenshot" width="500" height="479" /><br />
    </li>
</ol>]]>
    </content>
</entry>
<entry>
    <title>Zen and the Art of Offline Data Capture</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/acdc/2008/06/zen_and_the_art_of_offline_dat_1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt-atom.cgi/weblog/blog_id=213/entry_id=6337" title="Zen and the Art of Offline Data Capture" />
    <id>tag:blogs.adobe.com,2008:/acdc//213.6337</id>
    
    <published>2008-06-10T20:32:16Z</published>
    <updated>2008-06-10T20:37:01Z</updated>
    
    <summary>Whenever, I meet with developers on how to use LiveCycle technologies (or PDF in general), I usually run into: the user fills out the data here ... and the PDF is generated here. Generating a PDF for printer friendly output...</summary>
    <author>
        <name>Venkata Adidam</name>
        
    </author>
            <category term="LiveCycle" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/acdc/">
        <![CDATA[<p>Whenever, I meet with developers on how to use LiveCycle technologies (or PDF in general), I usually run into: the user fills out the data here ... and the PDF is generated here. Generating a PDF for printer friendly output is good, but that’s not all a PDF can do. A PDF can capture data and save you a lot of time and overhead. <br />
 <br />
So take a traditional web-based application where a user needs to fill-out a form. Look at the over-head that is behind the web form: User Management for the user to save/retrieve a form, Load Balancing during peak-usage, complexity if the user wants to forward the form to another user, and Availability if you want to add a second form to your web-application without down-time.<br />
 <br />
Enter the world of off-line submission, provide the end user a fillable PDF; this will allow an anonymous user to fill, save, and forward the PDF to another individual (via e-mail or USB drive). When the user is done, have the user e-mail the filled PDF back to your server. The e-mail might take a few hours before reaching your server, but who cares? The end-user isn't waiting on a spinning hourglass to stop. If you need another form, then create a new PDF and publish it. A new PDF doesn’t necessarily have to be created by the developer of your Web Application team. Another group can create the PDF as long as both of you agree to an XML Schema. See, a nice decoupled system, when was the last time you can leverage a User Interface from another team?<br />
 <br />
Not all clients implement this solution in exactly the same way as above, some have the need to submit a 200 Megabyte PDF. In this case e-mail would not work and would have to revert back to an HTTP submission, they will loose some benefits but also gain some as well. Hopefully, the reader gets some new ideas in solving some old problems.<br />
 <br />
So, if you want to prototype the solution, then the LiveCycle products you would need: LiveCycle Forms to pre-populate and extract data, LiveCycle Reader Extensions, this will allow (amongst other things) a PDF to be saved locally with Adobe Reader. And finally LiveCycle Designer that helps you create your PDF.</p>]]>
        
    </content>
</entry>
<entry>
    <title>Using Image in Acrobat JavaScript Dialog</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/acdc/2008/05/using_image_in_acrobat_javascr.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt-atom.cgi/weblog/blog_id=213/entry_id=5885" title="Using Image in Acrobat JavaScript Dialog" />
    <id>tag:blogs.adobe.com,2008:/acdc//213.5885</id>
    
    <published>2008-05-15T09:33:28Z</published>
    <updated>2008-05-15T16:29:32Z</updated>
    
    <summary><![CDATA[I have had customers asking about how to brand Acrobat JavaScript dialog boxes with images in Adobe LiveCycle Designer. I did some research and found that it was not as simple as defining an &lt;img href=”image.png”/&gt; tag (I wish it was that easy though). As an overview, images used in a Acrobat JavaScript dialog has to be in a icon stream format represented by a hex-encoded string. The data string also needs to be 32 bits per pixel with 4 channels (ARGB) or 8 bits per channel with the channels interleaved. The hex-encoded string looks something like this, &quot;fffffffffff...efdf8fff0e3beffd3b&quot;. Beautiful. Anyway, moving on.]]></summary>
    <author>
        <name>Mick Lerlop</name>
        <uri>http://lerlop.com</uri>
    </author>
            <category term="Acrobat" />
            <category term="LiveCycle" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/acdc/">
        <![CDATA[<p>I have had customers asking about how to brand Acrobat JavaScript dialog boxes with images in Adobe LiveCycle Designer. I did some research and found that it was not as simple as defining an &lt;img href=”image.png”/&gt; tag (I wish it was that easy though). As an overview, images used in a Acrobat JavaScript dialog has to be in a icon stream format represented by a hex-encoded string. The data string also needs to be 32 bits per pixel with 4 channels (ARGB) or 8 bits per channel with the channels interleaved. The hex-encoded string looks something like this, &quot;fffffffffff...efdf8fff0e3beffd3b&quot;. Beautiful. Anyway, moving on.</p>
                               <p>There are a number of free and commercial third party tools you could use to convert images to hex-encoded strings. However, none of the tools fits my workflow in terms of flexibility and extensibility. So I have created a Java utility library, called Acrobat Dialog Image Generator (ADIG), which allows you to generate a hex-encoded string or a skeleton Acrobat dialog box with an embedded image.</p>
                               <p>You can invoke ADIG via a command-line interface, ANT or an API call. Here are some sample invocations:</p>
                               <p><b>Command-line</b><br />
                                <pre><code>java -jar adig.jar /Users/lerlop/Pictures/test.jpg /Users/lerlop/Desktop/</code></pre></p>
                               <p>This will reads in test.jpg and generates a JavaScript dialog file called test.jpg.txt on my desktop. Here is a <a href="http://blogs.adobe.com/acdc/files/banner.jpg.txt" target="_blank">sample</a>.</p>
                               <p><b>ANT</b><br />
                                <pre><code>ant -buildfile adig.xml</code></pre></p>
                               <p>This will also produce the same result as the command-line option but everything is defined in the following build file.</p>
<pre>
    <code>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;project name=&quot;MyProject&quot; default=&quot;GeneratorAcrobatDialogImage&quot; basedir=&quot;.&quot;&gt;
	&lt;taskdef
		name=&quot;adig&quot;
		classname=&quot;com.adobe.consulting.ant.tasks.GenerateAcrobatDialogImage&quot;
		classpath=&quot;../../build/adig.jar&quot;/&gt;

	&lt;target name=&quot;GeneratorAcrobatDialogImage&quot;&gt;
		&lt;adig imagePath=&quot;/Users/lerlop/Pictures/test.jpg&quot; outputPath=&quot;/Users/lerlop/Desktop&quot;/&gt;
	&lt;/target&gt;
&lt;/project&gt;
    </code>
</pre>
                               <p><b>API Call</b><br/>
<pre><code>String hexString = AcrobatDialogImageGenerator. generateHexEncodedString(imagePath);</code></pre></p>
                               <p>By calling this static method in your Java code, you can generate a hex-encoded string from an image and assign it to a String object. This particular option is very useful when you try to perform any kind of batch operations. For instance, I can call this method to dynamically insert an image to a JavaScript dialog defined in an XDP before calling LiveCycle Forms to render it as a PDF.</p>
                               <p>To use the generated dialog JavaScript code in your form design, you can follow these simple steps:</p>
                               <ol>
                                 <li>Run ADIG via command-line or ANT to get a generated file. The generate code should like <a href="http://blogs.adobe.com/acdc/files/banner.jpg.txt" target="_blank">this</a>.</li>
                                 <li>Open your form in LiveCycle Designer (note: XFA form not AcroForm).</li>
                                 <li>Create and name a new script object. It does not matter where the script object is located as long as you can reference it later. For simplicity, create it on page 1 and let’s call it DialogSO.<br/><img src="http://blogs.adobe.com/acdc/DialogSO.png" width="261" height="110" /></li>
                                 <li>Copy all the code from the generated file and paste it into the script object.<br/><img src="http://blogs.adobe.com/acdc/copynpastegeneratedcode.png" width="429" height="161" /></li>
                                 <li>Now create a button object so you can use it to launch the dialog box. Note that you could launch the dialog box in any event such as form::docReady or form::initialize.<br/><img src="http://blogs.adobe.com/acdc/buttonlaunchdialog.png" width="457" height="157" /></li>
                                 <li>The last thing is to make the button launch the dialog box. In the click event of the button, type in the following function call: DialogSO.launchDialog();<br/><img src="http://blogs.adobe.com/acdc/sampledialog.png" width="400" height="183" /></li>
                               </ol>
                               <p>There you have it. You can extend the dialog box in any way you like by adding dialog elements to the dialog body. Please refer to the <a href="http://ww.adobe.com/devnet/acrobat/pdfs/js_api_reference.pdf">JavaScript for Acrobat API Reference</a>.</p>
                               <p>I want to note that there are commercial tools out there that will let you design and extend Acrobat dialog boxes far more than just adding an image and generating dialog JavaScript template. If you are looking for a WYSIWYG tool to design dialog boxes, <a href="http://www.windjack.com/products/acrodialogs.html">WindJack’s AcroDialogs</a> may be more suitable for your needs.</p>

<p>
<b>Downloads:</b>
<ul>
  <li><a href="http://blogs.adobe.com/acdc/files/adig.jar">adig.jar</a></li>
  <li><a href="http://blogs.adobe.com/acdc/files/adig-sample.pdf" target="_blank">Sample form</a></li>
  <li><a href="http://blogs.adobe.com/acdc/files/banner.jpg.txt" target="_blank">Sample generated output</a></li>
</ul>
</p>
                           ]]>
        
    </content>
</entry>
<entry>
    <title>Adobe Consulting, Public Sector - Genesis</title>
    <link rel="alternate" type="text/html" href="http://blogs.adobe.com/acdc/2008/05/adobe_consulting_public_sector.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.adobe.com/cgi-bin/mt-atom.cgi/weblog/blog_id=213/entry_id=5816" title="Adobe Consulting, Public Sector - Genesis" />
    <id>tag:blogs.adobe.com,2008:/acdc//213.5816</id>
    
    <published>2008-05-06T19:26:15Z</published>
    <updated>2008-05-06T19:29:49Z</updated>
    
    <summary>Hello everyone, the Adobe Consulting Public Sector group has been around for a number of years mainly working on LiveCycle and Flex projects. We decided that it was time to start communicating to the world the experiences we are gaining...</summary>
    <author>
        <name>Venkata Adidam</name>
        
    </author>
    
    <content type="html" xml:lang="en" xml:base="http://blogs.adobe.com/acdc/">
        <![CDATA[<p>Hello everyone, the Adobe Consulting Public Sector group has been around for a number of years mainly working on LiveCycle and Flex projects. We decided that it was time to start communicating to the world the experiences we are gaining from working out at the field.</p>

<p>A little bit about our selves, we are not an Engineering, Marketing, or a Sales team, we are simply humble souls that need to get projects working at our customer's site.  So what will we blog about? Anything that we run into(or have) in our current or past projects that the world might gain from. We are Computer Scientists by nature and education, so anything within the field should be expected.</p>

<p>So let the blogging begin....</p>]]>
        
    </content>
</entry>

</feed> 

