<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Deke Smith</title>
	<atom:link href="http://blogs.adobe.com/dekesmith/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.adobe.com/dekesmith</link>
	<description>Adobe for Enterprise, Not-Quite-Yet Enterprise and Not-At-All Enterprise</description>
	<lastBuildDate>Mon, 01 Apr 2013 15:30:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>CQ and AEM Helpful Links &#8211; Knowledge Base Articles by Subject</title>
		<link>http://blogs.adobe.com/dekesmith/2013/04/01/cq-and-aem-helpful-links-knowledge-base-articles-by-subject/</link>
		<comments>http://blogs.adobe.com/dekesmith/2013/04/01/cq-and-aem-helpful-links-knowledge-base-articles-by-subject/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 15:30:40 +0000</pubDate>
		<dc:creator>Deke Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AEM]]></category>
		<category><![CDATA[authoring]]></category>
		<category><![CDATA[CQ]]></category>
		<category><![CDATA[DAM]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[hot fixes]]></category>
		<category><![CDATA[Knowledge Base]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/dekesmith/?p=411</guid>
		<description><![CDATA[The Knowledge Base for CQ does have pages that list articles by subject: System Administration Hot Fixes Development Authoring General Troubleshooting DAM Sometimes I have problem finding the right keywords to search by. An old-school list works great.]]></description>
				<content:encoded><![CDATA[<p>The Knowledge Base for CQ does have pages that list articles by subject:</p>
<p><a href="http://helpx.adobe.com/cq/kb/index/system-administration.html" target="_blank">System Administration</a><br />
<a href="http://helpx.adobe.com/cq/kb/index/hotfixes.html" target="_blank">Hot Fixes</a><br />
<a href="http://helpx.adobe.com/cq/kb/index/development.html" target="_blank">Development</a><br />
<a href="http://helpx.adobe.com/cq/kb/index/authoring.html" target="_blank">Authoring</a><br />
<a href="http://helpx.adobe.com/cq/kb/index/general-troubleshooting.html" target="_blank">General Troubleshooting</a><br />
<a href="http://helpx.adobe.com/cq/kb/index/dam.html" target="_blank">DAM</a></p>
<p>Sometimes I have problem finding the right keywords to search by. An old-school list works great.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/dekesmith/2013/04/01/cq-and-aem-helpful-links-knowledge-base-articles-by-subject/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CQ 5.5 DAM Video Encoding &#8211; Changes are Needed to Work with FFMPEG version 20121230</title>
		<link>http://blogs.adobe.com/dekesmith/2013/01/17/cq-5-5-dam-video-encoding-changes-are-needed-to-work-with-ffmpeg-version-20121230/</link>
		<comments>http://blogs.adobe.com/dekesmith/2013/01/17/cq-5-5-dam-video-encoding-changes-are-needed-to-work-with-ffmpeg-version-20121230/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 17:41:25 +0000</pubDate>
		<dc:creator>Deke Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/dekesmith/?p=401</guid>
		<description><![CDATA[The FFMPEG version 20121230 has some changes that keep the out-of-the-box profiles for CQ&#8217;s DAM video encoding from working on all browsers. For one thing, this version of FFMPEG does not support the libfaac audio codec and one of the &#8230; <a href="http://blogs.adobe.com/dekesmith/2013/01/17/cq-5-5-dam-video-encoding-changes-are-needed-to-work-with-ffmpeg-version-20121230/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The FFMPEG version 20121230 has some changes that keep the out-of-the-box profiles for CQ&#8217;s DAM video encoding from working on all browsers. For one thing, this version of FFMPEG does not support the libfaac audio codec and one of the profiles uses that.</p>
<p>Make changes to the High Quality H.264 profile (<a href="http://localhost:4502/etc/dam/video/hq.html" target="_blank">http://localhost:4502/etc/dam/video/hq.html</a>). Change the audio code to libvo_aacenc. Change the custom flags to:</p>
<p style="padding-left: 30px;">-flags +loop -me_method umh -g 250 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -bf 16 -b_strategy 1 -i_qfactor 0.71 -cmp chroma -subq 8 -me_range 16 -coder 1 -sc_threshold 40 -b-pyramid normal -wpredp 2 -mixed-refs 1 -8x8dct 1 -fast-pskip 1 -keyint_min 25 -refs 4 -trellis 1 -direct-pred 3 -partitions i8x8,i4x4,p8x8,b8x8</p>
<p>When the CQ video component is used in a Web page switch to Design Mode. Many of the settings for the video component are editable in that mode.</p>
<p>I use the following order for profiles:</p>
<ol>
<li><span style="line-height: 13px;">Firefox HQ ogg</span></li>
<li>High Quality H.264</li>
<li>Flash 7+ low quality</li>
</ol>
<p>Make sure Strobe Flash player is selected as well under the Flash tab.</p>
<p>Thanks to Marc Pfaff for working out the changes to the HQ video profile.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/dekesmith/2013/01/17/cq-5-5-dam-video-encoding-changes-are-needed-to-work-with-ffmpeg-version-20121230/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic versioning of CQ DAM assets</title>
		<link>http://blogs.adobe.com/dekesmith/2012/10/23/automatic-versioning-of-cq-dam-assets/</link>
		<comments>http://blogs.adobe.com/dekesmith/2012/10/23/automatic-versioning-of-cq-dam-assets/#comments</comments>
		<pubDate>Tue, 23 Oct 2012 17:49:11 +0000</pubDate>
		<dc:creator>Deke Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CQ]]></category>
		<category><![CDATA[DAM]]></category>
		<category><![CDATA[Package Manager]]></category>
		<category><![CDATA[versioning]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/dekesmith/?p=388</guid>
		<description><![CDATA[How do you enable automatic versioning for DAM assets? The basic answer is, you can&#8217;t in CQ, as is. Pages can have automatic versioning when they are activated. DAM assets, on the other hand, don’t have the same capability without &#8230; <a href="http://blogs.adobe.com/dekesmith/2012/10/23/automatic-versioning-of-cq-dam-assets/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>How do you enable automatic versioning for DAM assets? The basic answer is, you can&#8217;t in CQ, as is. Pages can have automatic versioning when they are activated. DAM assets, on the other hand, don’t have the same capability without customization to CQ.</p>
<p>In CQ a DAM asset version must be explicitly created by a user in the DAM asset editor. The instructions on how to do this can be found in <a href="http://dev.day.com/docs/en/cq/current/dam/cq5_dam_version_management.html" target="_blank">Versioning in CQ5 DAM</a>.</p>
<p>Automating versioning of CQ DAM assets is more problematic.</p>
<p>One strategy would be to use packages to contain versions. Whole groups of DAM assets could be versioned at the same time using this method. To create a snapshot, make a new package containing the assets, give it a version, and build it. To make a snapshot of a new version of the assets, create a new version of the package and build it. This can be automated by creating scripts that periodically <a href="http://dev.day.com/docs/en/crx/current/how_to/package_manager.html" target="_blank">use curl or wget to build the packages with Package Manager</a>.</p>
<p>Another option is to either a listener for change events within the DAM folder or by adding a versioning step to an existing workflow.</p>
<p>This is sample code that shows how to create a version within a workflow step (from <a href="http://www.linkedin.com/in/henrysaginor" target="_blank">Henry Saginor</a> and <a href="https://twitter.com/eyelock" target="_blank">David Collie</a>):</p>
<pre>....</pre>
<pre>@Reference
private ResourceResolverFactory resolverFactory;
private ResourceResolver getResourceResolver(Session session)
                         throws LoginException
{
     Map authInfo = new HashMap();
     authInfo.put(JcrResourceConstants.AUTHENTICATION_INFO_SESSION, session);
     return resolverFactory.getResourceResolver(authInfo);
}</pre>
<pre>.....</pre>
<pre>Resource res = getResourceResolver(session).getResource(assetPath);
Asset asset = res.adaptTo(Asset.class);
Revision rev = asset.createRevision(revisionLabel, null);</pre>
<pre>.....</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/dekesmith/2012/10/23/automatic-versioning-of-cq-dam-assets/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Internationalization within Sling (and CQ)</title>
		<link>http://blogs.adobe.com/dekesmith/2012/10/21/internationalization-within-sling-and-cq/</link>
		<comments>http://blogs.adobe.com/dekesmith/2012/10/21/internationalization-within-sling-and-cq/#comments</comments>
		<pubDate>Mon, 22 Oct 2012 03:37:12 +0000</pubDate>
		<dc:creator>Deke Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[CQ]]></category>
		<category><![CDATA[internationalization]]></category>
		<category><![CDATA[locale]]></category>
		<category><![CDATA[Sling]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/dekesmith/?p=369</guid>
		<description><![CDATA[Sling, and as an extension, CQ, both use a model for internationalization that is very similar to the one used by Java and Flex. Java and Flex store translations as key/value pairs within properties files. Within Sling, translations are stored &#8230; <a href="http://blogs.adobe.com/dekesmith/2012/10/21/internationalization-within-sling-and-cq/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Sling, and as an extension, CQ, both use a model for internationalization that is very similar to the one used by Java and Flex. Java and Flex store translations as key/value pairs within properties files. Within Sling, translations are stored within the repository as key/value pairs. Once defined, the developer is able to use the key/value pairs stored in the repository to populate strings used in a graphic interface such as a Web page.</p>
<p>CQ has additional tools for internationalization than those provided by Sling. <em>The CQ additions are not part of the scope of this article.</em></p>
<h2>Locales</h2>
<p>Before using internationalization within Sling the developer must be knowledgeable about the concept of <a href="http://en.wikipedia.org/wiki/Locale" target="_blank">locale</a>. Locales within Java can be defined by three different properties: the language, the region and the variant. The primary defining property of a locale is a human language. Regions are used because each language can have several dialects and usage of the language varies greatly based on the region it is spoken and written. For that reason, a region code can be associated with a language. In that way, Canadian French may have its own definitions and translations and European French a different set. Additional information about the locale can be defined in the variant property. This property can contain information about a specific locale that is not covered by the other two properties. Examples of variant information for a locale is type of the language used, the target operating system or the text encoding.</p>
<p>Sling uses a <a href="http://tools.ietf.org/html/bcp47" target="_blank">standard representation of locale</a>. The language is represented as the <a href="http://www.sil.org/iso639-3/codes.asp" target="_blank">ISO 639‑1</a> code for the language in lower case. This is usually a two letter code. English, for example, would be represented as <em>en</em>. If needed, a region code can be specified. This is done by adding an underscore plus the <a href="http://en.wikipedia.org/wiki/ISO_3166-1" target="_blank">ISO 3166-1</a> region code in upper case to the language code. So for English as spoken and written in the USA, the full locale code would be <em>en_US</em>. Very rarely would there be a variant defined in a locale for Sling.</p>
<p>Sling uses this standard because browsers use this standard for locale. Within Sling, the typical usage of internationalization would be to return the content of a Web page using the default locale of the Web browser. The default locale or locales are passed to Sling as part of the request. The site developer has the choice of respecting the locale of the Web browser and sending back content appropriate for that locale.</p>
<h2>Key/value pairs</h2>
<p>What do key/value pairs define? I call them translations but technical they are translation segments. Translation implies taking a word or phrase and finding the best match in another language. Translation segment is what you get after someone has done the translation for a specific use and the results are saved in a look-up table. The value of translation segment has a very specific meaning. When the phrase, OK, is used on a button the translation segment in another locale for that phrase is not necessarily a direct translation of the word, OK, but what the OK button is called in the target locale. Translation segment is very context driven. Because of that it can contain style information or substitutions indicated for data set at run time. It can even be a pattern for how information, such as a date or number, is rendered in a locale.</p>
<p>Within Sling, key/value pairs are organized by locale. If a site supports two languages, matching key/value pairs should exist for both. The locales CQ defines key/value pairs for can be seen at <em>/libs/wcm/core/i18n</em>.</p>
<p>Those keen of eye may notice that the locale code, <em>en</em>, is not there. In Java, if the value of a key is requested for a locale and that key does not exist, an exception is thrown. Not so in Sling. If a key is not defined in a locale Sling does not throw an exception. Instead, the key itself is returned. The keys for the key/value pairs in <em>/libs/wcm/core/i18n</em> are the translations in English. Since the locale for English does not exist the key is returned when the value of a key for the locale, <em>en</em>, is requested.</p>
<p>In CQ, the default for a key is the English phrase. The key and the English phrase are the same. Using the English phrase as the key for the key/value pair is an architectural decision and is not the only way to build translation memory in CQ.</p>
<p>I prefer to not use defaults for the phrases as keys. One thing that is constant in development is change. And it is likely that the text for the user interface will change. If it does, the key must be changed in all instances in the code and for each locale. Where multiple teams edit each of these items this can get to be a logistical challenge. I would use, <em>hello_world</em>, as a key versus the default, English, value for the phrase, <em>Hello World! </em>Doing things in that way allows the translators and the developers to work relatively independently of one another once the key/value pairs are defined.</p>
<p>Using the English phrase as the key does have its advantages and this is the reason this is the convention CQ uses. The advantage to using a default phrase as key is that the keys themselves will show up in the interface when the translation does not yet exist in a locale. Having non-phrase keys within a user interface does look like a mistake. When the phrase in English is the key and the translation does not exist in the target locale then the English phrase is shown.</p>
<p>Which convention to use is a matter of preference and the specific use case.</p>
<h2>Translations in the repository</h2>
<p>As can be seen for the CQ translations at <em>/libs/wcm/core/i18n</em>, the key/value pairs are stored by locale. The locale node must use the mixin, <em>mix:language</em>, and have the property, <em>jcr:language</em>, defined with a locale. In addition, the locale node may have the property, <em>sling:basename</em>. The <em>sling:basename</em> property is either a <em>String</em> or <em>String array</em> of names that can be used a labels or tags to filter translations with. The name of the locale node is not significant and can be anything. Be nice to others who have to edit what you have done, though. Name the locale node to match the locale within <em>jcr:language </em>or name of the language. For example, name a locale node for English either <em>English</em> or <em>en</em>. The primaryType of the locale node is not significant for translations.</p>
<p>Within the locale node are key/value child nodes, each one containing the information for a single key/value pair. These child nodes must either have the primaryType of <em>sling:MessageEntry</em> or they must have <em>sling:Message</em> as a mixin. The key/value node must contain a property, <em>sling:message</em>, that is the value for the key. If the property, <em>sling:key</em>, exists then that value is used as the key. If the <em>sling:key</em> property does not exist then the name of the node is used as the key. Following the Be Nice Rule, name the key/value node the name of the key. If you do that, the <em>sling:key</em> property is redundant.</p>
<p>Here is an example of key/value pairs for both English and French:</p>
<pre>/apps/myapp/i18n
             +-- en (nt:folder, mix:language)
             |    +-- jcr:language = "en"
             |    +-- hello_world (sling:MessageEntry)
             |    |    +-- sling:key = "hello_world"
             |    |    +-- sling:message = "Hello world!"
             |    +-- goodbye (sling:MessageEntry)
             |         +-- sling:key - "goodbye"
             |         +-- sling:message = "Goodbye!"
             +-- fr (nt:folder, mix:language)
                  +-- jcr:language = "fr"
                  +-- hello_world (nt:unstructured,sling:Message)
                  |    +-- sling:key = "hello_world"
                  |    +-- sling:message = "Bonjour tout le monde!"
                  +-- goodbye (nt:unstructured,sling:Message)
                       +-- sling:key - "goodbye"
                       +-- sling:message = "Au revoir!"
-</pre>
<h2>Using internationalization within JSP</h2>
<p>Within this blog post I will only give an example of using key/value pairs for locales within JSP. They can be used elsewhere in Sling, as well.</p>
<p>When the <em>&lt;sling:defineObjects /&gt;</em> tag is used within a JSP page, the <em>slingRequest</em> value is created. The <em>slingRequest</em> implements the <a href="http://dev.day.com/docs/en/cq/current/javadoc/org/apache/sling/api/SlingHttpServletRequest.html" target="_blank"><strong>SlingHttpServletRequest</strong> </a>interface and has a couple of very useful methods for internationalization: <em>getLocale(), getLocales(), getResourceBundle(Locale),</em> and <em>getResourceBundle(String, Locale)</em>.</p>
<p>The <em>getLocale()</em> method gets the default <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html" target="_blank"><strong>Locale</strong></a> of the request. The <em>getLocales()</em> method gets all of the methods for a request. Typically the value for these come from the browser.</p>
<p>The method, <em>getResourceBundle(Locale)</em>, gets a <strong>ResourceBundle</strong> instance that has all of the found key/value pairs for the locale. The method, <em>getResourceBundle(String, Locale)</em>, gets a <a href="http://docs.oracle.com/javase/6/docs/api/java/util/ResourceBundle.html" target="_blank"><strong>ResourceBundle</strong> </a>with all of the key/value pairs for a base name and a locale. The <strong>ResourceBundle</strong> interface has a method, <em>getString(String)</em>, in which the argument is the key and the value of the key is returned. If the <strong>ResourceBundle</strong> does not have that key, the value returned is the key itself. One thing to keep in mind is that a <strong>ResourceBundle</strong> is not the same thing as an OSGi bundle. They are two different concepts using the same name.</p>
<p>An example:</p>
<p>&lt;%@ page contentType=&#8221;text/html; charset=UTF-8&#8243; language=&#8221;java&#8221; errorPage=&#8221;" %&gt;&lt;%<br />
%&gt;&lt;%@ page session=&#8221;false&#8221; %&gt;&lt;%<br />
%&gt;&lt;%@ page import=&#8221;javax.jcr.*,<br />
                   org.apache.sling.api.resource.Resource&#8221;<br />
%&gt;&lt;%<br />
%&gt;&lt;%@ taglib prefix=&#8221;sling&#8221; uri=&#8221;http://sling.apache.org/taglibs/sling/1.0&#8243; %&gt;&lt;%<br />
%&gt;&lt;sling:defineObjects /&gt;&lt;%<br />
%&gt;&lt;!DOCTYPE HTML&gt;<br />
&lt;html&gt;<br />
   &lt;head&gt;<br />
      &lt;meta charset=&#8221;UTF-8&#8243;&gt;<br />
      &lt;title&gt;Test&lt;/title&gt;<br />
   &lt;/head&gt;<br />
   &lt;body&gt;<br />
&lt;%= slingRequest<br />
       .getResourceBundle(slingRequest.getLocale())<br />
       .getString(&#8220;hello_world&#8221;) %&gt;<br />
   &lt;/body&gt;<br />
&lt;/html&gt;<br />
/xml]</p>
<h3>See also:</h3>
<p><a href="http://sling.apache.org/site/internationalization-support-i18n.html" target="_blank">Apache Sling &#8211; Internationalization Support</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/dekesmith/2012/10/21/internationalization-within-sling-and-cq/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Purging long-lived processes in LiveCycle</title>
		<link>http://blogs.adobe.com/dekesmith/2012/10/15/purging-long-lived-processes-in-livecycle/</link>
		<comments>http://blogs.adobe.com/dekesmith/2012/10/15/purging-long-lived-processes-in-livecycle/#comments</comments>
		<pubDate>Mon, 15 Oct 2012 18:32:46 +0000</pubDate>
		<dc:creator>Deke Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[LiveCycle]]></category>
		<category><![CDATA[long-lived processes]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/dekesmith/?p=365</guid>
		<description><![CDATA[The amount of data, both disk space and database rows, that is saved by LiveCycle can build over time. Sooner or later the LiveCycle administrator will probably find himself having to clean up and get rid of old, unused, completed, &#8230; <a href="http://blogs.adobe.com/dekesmith/2012/10/15/purging-long-lived-processes-in-livecycle/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The amount of data, both disk space and database rows, that is saved by LiveCycle can build over time. Sooner or later the LiveCycle administrator will probably find himself having to <a href="http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/livecycle/pdfs/purging_processes_jobs.pdf" target="_blank">clean up and get rid of old, unused, completed, long-lived processes</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/dekesmith/2012/10/15/purging-long-lived-processes-in-livecycle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The revolution will be self-fabricated</title>
		<link>http://blogs.adobe.com/dekesmith/2012/10/13/the-revolution-will-be-self-fabricated/</link>
		<comments>http://blogs.adobe.com/dekesmith/2012/10/13/the-revolution-will-be-self-fabricated/#comments</comments>
		<pubDate>Sat, 13 Oct 2012 21:04:44 +0000</pubDate>
		<dc:creator>Deke Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D Printers]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/dekesmith/?p=357</guid>
		<description><![CDATA[The Internet has already fostered changes that completely and irreversibly alters cultures around the world. It will be interesting to see if the same happens when manufacturing moves from the factory to the desktop: How to Make Almost Anything.]]></description>
				<content:encoded><![CDATA[<p>The Internet has already fostered changes that completely and irreversibly alters cultures around the world. It will be interesting to see if the same happens when manufacturing moves from the factory to the desktop: <a href="http://www.foreignaffairs.com/articles/138154/neil-gershenfeld/how-to-make-almost-anything?page=show" target="_blank">How to Make Almost Anything</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/dekesmith/2012/10/13/the-revolution-will-be-self-fabricated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GlobalOptimizer NullPointerException when packaging AIR applications for iOS</title>
		<link>http://blogs.adobe.com/dekesmith/2012/10/12/globaloptimizer-nullpointerexception-when-packaging-air-applications-for-ios/</link>
		<comments>http://blogs.adobe.com/dekesmith/2012/10/12/globaloptimizer-nullpointerexception-when-packaging-air-applications-for-ios/#comments</comments>
		<pubDate>Fri, 12 Oct 2012 21:15:22 +0000</pubDate>
		<dc:creator>Deke Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ADT]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash Builder]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[NullPointerException]]></category>
		<category><![CDATA[packaging]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/dekesmith/?p=361</guid>
		<description><![CDATA[In some circumstances, attempting to package an AIR application for Apple iOS platform using  ipa-ad-hoc and ipa-app-store targets can result in a NullPointerException. A workaround for this problem may be to use a debug version of your SWF in the package. &#8230; <a href="http://blogs.adobe.com/dekesmith/2012/10/12/globaloptimizer-nullpointerexception-when-packaging-air-applications-for-ios/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In some circumstances, attempting to package an AIR application for Apple iOS platform using  ipa-ad-hoc and ipa-app-store targets can result in a NullPointerException. A workaround for this problem may be to use a debug version of your SWF in the package.</p>
<p>When using the Project-&gt;Export Release Build… menu item to create a package, click Next on the first screen. You will notice that it will build the release SWF as it switches from this screen to the Package Settings screen.</p>
<p>Before you click Finish on the Package Settings screen of the Export Release Build dialog, go to your project within Finder (or File Explorer on Windows). With the Export Release Build dialog open you will not be able to do the next step within Flash Builder and you will have to do it within Finder. Copy the ePresenter.swf file found in the bin-debug directory and replace the same file in the bin-release-temp directory with the one from the bin-debug.</p>
<p>Once you copied the debug version into the bin-release-temp folder, you can click Finish. When I tested this, it was able to create the IPA.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/dekesmith/2012/10/12/globaloptimizer-nullpointerexception-when-packaging-air-applications-for-ios/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Example: customizing the SpinnerList in mobile AIR</title>
		<link>http://blogs.adobe.com/dekesmith/2012/10/10/example-customizing-the-spinnerlist-in-mobile-air/</link>
		<comments>http://blogs.adobe.com/dekesmith/2012/10/10/example-customizing-the-spinnerlist-in-mobile-air/#comments</comments>
		<pubDate>Wed, 10 Oct 2012 17:54:09 +0000</pubDate>
		<dc:creator>Deke Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/dekesmith/?p=350</guid>
		<description><![CDATA[Question: Can a SpinnerList on Android or iOS AIR be changed so that certain items in the list have a different background? For example, in a list of states, make Alaska have a black background even when it is not &#8230; <a href="http://blogs.adobe.com/dekesmith/2012/10/10/example-customizing-the-spinnerlist-in-mobile-air/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h3>Question:</h3>
<p>Can a <em>SpinnerList</em> on Android or iOS AIR be changed so that certain items in the list have a different background? For example, in a list of states, make Alaska have a black background even when it is not selected.</p>
<h3>Answer:</h3>
<p>That can be done with a custom item renderer for the <em>SpinnerList</em>. It would extend the existing item renderer and would switch how it is rendered based on data in the data source.</p>
<p>As with so many things in Flex, there is more than one way to do this. This example is just a suggestion. Each project is different and this example may not be the best way for each one.</p>
<h3>Item Renderer’s Data</h3>
<p>Item renderers should rely solely on the data property for information on how to draw themselves. Item renderers can be reused, so when the data property changes the items renderer needs to change along with it or old information may be displayed. I suggest whatever data source is used for the <em>SpinnerList</em> should include a flag to indicate whether the state name needs to be pre-hilited. Giving the item renderer the logic to figure out if it needs to have a different background color based on the state name makes it so you will have to change your program whenever the list of states that need to be pre-hilited changes.</p>
<p>A very simple data source for the SpinnerList that does this would look like this:</p>
<pre>var rawData : Array = [
{"value":"al","hilite":false,"name":"Alabama"},
{"value":"ak","hilite":true,"name":"Alaska"},
{"value":"az","hilite":false,"name":"Arizona"},
{"value":"ar","hilite":false,"name":"Arkansas"}
];
var myDataSource : ArrayCollection = new ArrayCollection(rawData);</pre>
<pre>&nbsp;</pre>
<h3>How to Change the Color of the Item Renderer Background</h3>
<p>The code for the default item renderer should be opened up and examined to see how it is rendered. The default item renderer for the <em>SpinnerList</em> can be found at:</p>
<p style="padding-left: 30px;"><em>[Flex sdk]\frameworks\projects\mobilecomponents\src\spark\components\SpinnerListItemRenderer.as</em></p>
<p>Item renderers tend not to use skins in order to keep them relatively lightweight. Instead of relying on skins, they usually contain the drawing logic. This particular skin, <em>SpinnerListItemRenderer</em>, draws a transparent box behind itself so it can capture click events. We can override this and draw a colored box instead.</p>
<p>Create a new item renderer that extends the <em>SpinnerListItemRenderer</em>. I created a class named <em>BackgroundColorItemRenderer</em> within my package <em>com.adobe.example.spinner</em>. In this new class override the method, <em>drawBackground</em>, that draws this transparent box and change it so it makes the background a color. Here is my logic: if the data property does not contain a value of <em>hilite</em> that is equal to true then pass the method to the ancestor class for rendering. Otherwise, give the background a color.</p>
<pre>override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
{
    if (! data.hilite)
    {
        // if no hilite, use the existing logic to draw the background
        super.drawBackground(unscaledWidth, unscaledHeight);
    }
    else
    {
        // if data.hilite == true, draw a black background
        graphics.beginFill(0x000000, 1.0);
        graphics.lineStyle();
        graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
        graphics.endFill();
    }
 }</pre>
<pre>&nbsp;</pre>
<p>In this method the color for the background is hard-coded. Create a style that sets a value for this for the component to move this value from the component to the style sheet. The name for the style property can be relatively arbitrary as long as it is not the same name as any other style for the component. I added styles, <em>spinnerBackgroundColor</em> and <em>spinnerBackgroundAlpha</em>, for the item renderer. Since, when using a black background, the text color is no longer visible, I changed it to white.</p>
<pre>@namespace spinner "com.adobe.example.spinner.*";</pre>
<pre>spinner|BackgroundColorItemRenderer {
 spinnerBackgroundColor : #000000;
 spinnerBackgroundAlpha : 1.0;
 color : #FFFFFF;
}</pre>
<pre>&nbsp;</pre>
<p>I change the <em>drawBackground</em> method use the value from the style sheet:</p>
<pre>override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
{
    if (! data.hilite)
    {
        // if no hilite, use the existing logic to draw the background
        super.drawBackground(unscaledWidth, unscaledHeight);
    }
    else
    {
        // if data.hilite == true, draw a black background
        graphics.beginFill(
                getStyle(“spinnerBackgroundColo”), 
                getStyle(“spinnerBackgroundAlpha”));
        graphics.lineStyle();
        graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
        graphics.endFill();
    }
 }</pre>
<pre>&nbsp;</pre>
<p>Now, all that is left to do is to assign my data source and my item renderer to the SpinnerList:</p>
<pre>&lt;fx:Script&gt;
&lt;![CDATA[
    import mx.collections.ArrayCollection;
    import mx.events.FlexEvent;

    private static const SPINNER_DATA : Array = 
        [
            {"value":"al","hilite":false,"name":"Alabama"},
            {"value":"ak","hilite":true,"name":"Alaska"},
            {"value":"az","hilite":false,"name":"Arizona"},
            {"value":"ar","hilite":false,"name":"Arkansas"}
        ];

    [Bindable]
    public var spinnerData : ArrayCollection = new ArrayCollection(SPINNER_DATA);

 ]]&gt;
 &lt;/fx:Script&gt;</pre>
<pre>&lt;s:SpinnerList 
            dataProvider="{spinnerData}" 
            labelField="name" 
            width="400" 
            itemRenderer="com.adobe.example.spinner.BackgroundColorItemRenderer" /&gt;</pre>
<pre>&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/dekesmith/2012/10/10/example-customizing-the-spinnerlist-in-mobile-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Friction and the software architect</title>
		<link>http://blogs.adobe.com/dekesmith/2012/10/08/friction-and-apis/</link>
		<comments>http://blogs.adobe.com/dekesmith/2012/10/08/friction-and-apis/#comments</comments>
		<pubDate>Mon, 08 Oct 2012 21:23:35 +0000</pubDate>
		<dc:creator>Deke Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[software architecture]]></category>
		<category><![CDATA[user experience design]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/dekesmith/?p=343</guid>
		<description><![CDATA[Scientific American&#8217;s article, Make Technology&#8211;and the World&#8211;Frictionless, describes user experience design wonderfully but never calls it that. Actually, they describe the evil opposite of user interface design. They call it friction. Friction is making things harder than they have to be &#8230; <a href="http://blogs.adobe.com/dekesmith/2012/10/08/friction-and-apis/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Scientific American&#8217;s article, <a href="http://www.scientificamerican.com/article.cfm?id=technologys-friction-problem" target="_blank">Make Technology&#8211;and the World&#8211;Frictionless</a>, describes user experience design wonderfully but never calls it that. Actually, they describe the evil opposite of user interface design. They call it friction. Friction is making things harder than they have to be for others: be they your customer, viewers, or constituents. The writer describes examples of friction in both the retail market and politics.</p>
<p>This idea of friction can be expanded much more and I thought of examples in the design of frameworks, coding languages and APIs. There are several ways to add or remove friction for the software developer. One way to lower friction is to make sure that everything makes sense. There are common models for organizing code that attempt to bring an understandable structure to code. Some examples are object oriented, model/view/controller, and service oriented programming. Another way to lessen friction is to reduce the number of magic strings that have to be memorized. This can be done by using constants instead of numbers, strings, or flags that need to be memorized. These constants need to be extremely simple (LogEventLevel.DEBUG) or available via code hinting within the IDE. Another way to reduce friction in programming is to use conventions. If there were twenty Java classes, each with a String property called, <em>title</em>, most of the classes will probably have a getter method, <em>String getTitle()</em>. And most the classes that allow this property to be set will have a setter method, <em>void setTitle(String value)</em>.</p>
<p>I consider the language, Perl, to be an example of how friction can be removed from coding. But, perversely enough, the stripping of friction can increase friction. A great way to decrease friction for a person coding in a language is to provide several different ways to accomplish the same task. Perl does that. Another way to help the programmer is to reduce the amount of typing that needs to be done. Perl does that as well by using several implicit variables that don&#8217;t need to be referenced directly to use. The increase of friction in Perl is when one person has to edit the code someone else has written. The very things that have reduced friction have made it hard to read someone else&#8217;s code.</p>
<p>I tend to believe that the software architect&#8217;s role is to Keep It Simple Stupid for the other developers. Many times that means adding complexity to the architecture.</p>
<p>For example, when I write code I try to never trust that someone else&#8217;s code will do what they are supposed to. For me, that means always verifying the arguments that come into a method. If someone provides null for an argument that really never should be null I throw an illegal argument exception and say which argument is the offender. Not doing that can be a big problem. If a value is not verified, it is easy to pass that same null value into another method, which does the same, which does the same. Finally, an exception is thrown and the programmer ends up with a <em>NullValueException</em> and a long stack trace with no idea what value was the culprit.</p>
<p>There is an art to writing a good framework or API. And a large part of this art is to consider the <a href="http://en.wikipedia.org/wiki/User_experience_design" target="_blank">user experience design</a>. It is not enough to be clever. It has to be usable.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/dekesmith/2012/10/08/friction-and-apis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting default values on CQ components</title>
		<link>http://blogs.adobe.com/dekesmith/2012/10/05/setting-default-values-on-cq-components/</link>
		<comments>http://blogs.adobe.com/dekesmith/2012/10/05/setting-default-values-on-cq-components/#comments</comments>
		<pubDate>Fri, 05 Oct 2012 21:06:24 +0000</pubDate>
		<dc:creator>Deke Smith</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[CQ]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/dekesmith/?p=334</guid>
		<description><![CDATA[Components are self-contained portions of code within CQ. While not necessarily visual or part of the user interface, oftentimes they are. Within the CQ framework components can be dragged from the SideKick and placed within a page layout. Within the &#8230; <a href="http://blogs.adobe.com/dekesmith/2012/10/05/setting-default-values-on-cq-components/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://dev.day.com/docs/en/cq/current/developing/components.html" target="_blank">Components</a> are self-contained portions of code within CQ. While not necessarily visual or part of the user interface, oftentimes they are. Within the CQ framework components can be dragged from the SideKick and placed within a page layout.</p>
<p>Within the CQ page editor, a component can have a dialog to configure values for the component instance that is on the page. <a href="http://dev.day.com/docs/en/cq/current/howto/components_develop.html" target="_blank">Documentation</a> exists that describes how to create a component for use within CQ. It is not necessary for the page author to open the component editor and edit all of the values each time a component is used. Properties can be defined with a default value which is applied automatically.</p>
<h4>Prerequisites</h4>
<p>To create a default value on a component, knowledge of how to create and edit components within CRXDE or CRXDE Lite is necessary.</p>
<h4>Setting a default value on a CQ component</h4>
<p>Go to the widget within the component&#8217;s dialog that is used to set the property on the component and add a property to the widget itself: <em>defaultValue</em>. If it is possible to select multiple values the <em>defaultValue</em> property should be an array.</p>
<h4>Example</h4>
<p>In this example I will have a simple viewer component that has a single configurable property: <em>alignProp</em>. Alignment may either be a <em>Left</em> or <em>Right</em>. By default, the value should be <em>Left</em>.</p>
<p>Within the <em>/apps/dekesmith/examples/components/</em> directory I created a new component node called <em>simple-viewer</em>:</p>
<pre>{
    " jcr:title":"Simple Viewer",
     "allowedParents":["*/*parsys"],
     "sling:resourceSuperType":"foundation/components/parbase",
     "componentGroup":"Media",
     "jcr:primaryType":"cq:Component",
     "dialog":{
          "jcr:primaryType":"cq:Dialog",
          "items":{
               "jcr:primaryType":"cq:WidgetCollection"
               "items":{
                    "jcr:primaryType":"cq:WidgetCollection",
                    "tab1":{
                        "jcr:primaryType":"cq:Panel",
                        "title":"tab1",
                        "items":{
                            "jcr:primaryType":"cq:WidgetCollection",
                            "alignment":{
                                  "jcr:primaryType":"cq:Widget",
                                  "fieldLabel":"Alignment",
                                  "type":"select",
                                  "xtype":"selection",
                                  "defaultValue:","Left",
                                  "name":"alignProp",
                                  "options":{
                                       "jcr:primaryType":"cq:WidgetCollection",
                                       "Left":{
                                            "jcr:primaryType":"nt:unstructured",
                                            "value":"Left",
                                            "text":"Align Left"    
                                       },
                                       "Right":{
                                            "jcr:primaryType":"nt:unstructured",
                                            "value":"Right",
                                            "text":"Align Right"
                                       }
                                  }
                            }
                        }               
                    } 
                }
          }
     }
}</pre>
<pre>&nbsp;</pre>
<p>This component has an edit dialog for setting properties of the component within the CQ site editor. The edit dialog has a single tab with a single selection menu, <em>alignment</em>, that sets a property for the component, <em>alignProp</em>. The <em>alignment</em> menu has two choices, <em>Right</em> and Left. <em>The</em> default value should for the property should be added on the widget that sets that property. To give the <em>alignProp</em> property a default of <em>Left</em> I added a <em>defaultValue</em> to the selection widget, <em>alignment</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/dekesmith/2012/10/05/setting-default-values-on-cq-components/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
