<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Experiences with CQ/CRX</title>
	<atom:link href="http://daygrep.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://daygrep.wordpress.com</link>
	<description></description>
	<lastBuildDate>Wed, 01 Apr 2009 16:52:54 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='daygrep.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/1a7df35c91187b0447fecc60b25c306e?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Experiences with CQ/CRX</title>
		<link>http://daygrep.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://daygrep.wordpress.com/osd.xml" title="Experiences with CQ/CRX" />
		<item>
		<title>Custom Validation Function In Dialogs</title>
		<link>http://daygrep.wordpress.com/2009/04/01/custom-validation-function-in-dialogs/</link>
		<comments>http://daygrep.wordpress.com/2009/04/01/custom-validation-function-in-dialogs/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 14:48:17 +0000</pubDate>
		<dc:creator>daygrep</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://daygrep.wordpress.com/?p=11</guid>
		<description><![CDATA[Sometimes it is desirable to have a particular input widget in a CQ5 WCM dialog to be fitted with a custom validation. Imagine you have two password fields and you would like to validate that the passwords match prior to saving the dialog.
The Dialog
The following is a simple dialog that features two input widgets for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daygrep.wordpress.com&blog=7092608&post=11&subd=daygrep&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sometimes it is desirable to have a particular input widget in a CQ5 WCM dialog to be fitted with a custom validation. Imagine you have two password fields and you would like to validate that the passwords match prior to saving the dialog.</p>
<p><strong>The Dialog</strong><br />
The following is a simple dialog that features two input widgets for passwords:</p>
<pre>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;jcr:root xmlns:cq=&quot;http://www.day.com/jcr/cq/1.0&quot; xmlns:jcr=&quot;http://www.jcp.org/jcr/1.0&quot;
    jcr:primaryType=&quot;cq:Dialog&quot;
    xtype=&quot;panel&quot;&gt;
    &lt;items jcr:primaryType=&quot;cq:WidgetCollection&quot;&gt;
                &lt;password
                    jcr:primaryType=&quot;cq:Widget&quot;
                    fieldLabel=&quot;Password&quot;
                    name=&quot;./password&quot;
                    allowBlank=&quot;false&quot;
                    xtype=&quot;password&quot;/&gt;
                &lt;passwordConfirm
                    jcr:primaryType=&quot;cq:Widget&quot;
                    fieldLabel=&quot;Confirm Password&quot;
                    name=&quot;./password&quot;
                    allowBlank=&quot;false&quot;
                    validator=&quot;function(value) { verifyPasswords(value) }&quot;
                    xtype=&quot;password&quot;/&gt;
    &lt;/items&gt;
&lt;/jcr:root&gt;
</pre>
<p>Notice the validator property on the <em>passwordConfirm</em> input. It specifies a function that is evaluated and itself references a function, that you can easily define in a custom JavaScript file included in the head of your page in authoring mode.<br />
<span id="more-11"></span><br />
Not all widgets support a validator property. You can verify support for a validator property by consulting the <a href="http://extjs.com/deploy/dev/docs/">Ext JS API documentation</a>. Check the <em>Ext &#8211; form</em> branch, e.g. <em>TextField</em>, of which the Password widget is an extension.</p>
<p><strong>The Validator Function</strong><br />
The validation function itself is quite easy in this case and also runs within the scope of the widget, as such you have access to the widget&#8217;s object tree and variables. The Ext JS API documentation for the <em>TextField</em> states the following for the <em>validator</em> configuration property:</p>
<p><em>&#8220;A custom validation function to be called during field validation (defaults to null). If specified, this function will be called only after the built-in validations (allowBlank, minLength, maxLength) and any configured vtype all return true. This function will be passed the current field value and expected to return boolean true if the value is valid or a string error message if invalid.&#8221;</em></p>
<p>As such the function might look as follows in your custom JS file:</p>
<pre>
function verifyPasswords(value) {
	var pwd = this.ownerCt.items.get(2).getRawValue();
	if (pwd == value) {
		return true;
	}
	return CQ.I18n.getMessage("The passwords do not match.");
}
</pre>
<p><strong>Some Important XTypes Supporting a Validator</strong></p>
<ul>
<li>datefield</li>
<li>numberfield</li>
<li>password</li>
<li>textarea</li>
<li>textfield</li>
</ul>
<p>You can check the widget sources under <em>/libs/cq/widgets/source/**</em> to determine the widget hierarchy for an xtype, and whether any of the involved types support the validator property based on the Ext JS API documentation.</p>
<p><strong>Validation With Regular Expression</strong><br />
Dialogs fields also support validation using regular expressions. See the following example:</p>
<pre>
&lt;contentOwner
    jcr:primaryType=&quot;cq:Widget&quot;
    fieldLabel=&quot;Content Owner Email&quot;
    name=&quot;./contentOwner&quot;
    regex=&quot;/^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/&quot;
    regexText=&quot;Please enter a valid email address.&quot;
    xtype=&quot;textfield&quot;/&gt;
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/daygrep.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/daygrep.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/daygrep.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/daygrep.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/daygrep.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/daygrep.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/daygrep.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/daygrep.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/daygrep.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/daygrep.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daygrep.wordpress.com&blog=7092608&post=11&subd=daygrep&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://daygrep.wordpress.com/2009/04/01/custom-validation-function-in-dialogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e5bb7cfb8d407bfbac5e4852e2accdc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daygrep</media:title>
		</media:content>
	</item>
		<item>
		<title>Opening a Page in CQ5 WCM without Content Finder</title>
		<link>http://daygrep.wordpress.com/2009/04/01/opening-a-page-in-cq5-wcm-without-content-finder/</link>
		<comments>http://daygrep.wordpress.com/2009/04/01/opening-a-page-in-cq5-wcm-without-content-finder/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 09:07:19 +0000</pubDate>
		<dc:creator>daygrep</dc:creator>
				<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://daygrep.wordpress.com/?p=8</guid>
		<description><![CDATA[In a CQ5 WCM authoring environment, when you open a page via double-click, by default the Content Finder is loaded and the actual content page displayed in a frame. While this is desirable in most cases, the are pages whose functionality does not require the presence of the Content Finder, e.g. tool templates that don&#8217;t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daygrep.wordpress.com&blog=7092608&post=8&subd=daygrep&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In a CQ5 WCM authoring environment, when you open a page via double-click, by default the Content Finder is loaded and the actual content page displayed in a frame. While this is desirable in most cases, the are pages whose functionality does not require the presence of the Content Finder, e.g. tool templates that don&#8217;t allow content creation, like adding new paragraphs.</p>
<p>In order to prevent a page opening in the Content Finder view, choose from the following two options:</p>
<ul>
<li>On the page component&#8217;s definition, set the following property:<br />
        <code>cq:defaultView="html"</code><br />
        This is probably the preferable way, as renouncing the content finder in most cases pertains to all pages based on a template and thus page component.
</li>
<li>On any content page, e.g. on <em>/content/geometrixx/jcr:content</em>, set the following property:<br />
        <code>cq:defaultView="html"</code><br />
        This is the way to specifically set an exception where otherwise the page component would allow the content finder view (implicitly: cq:defaultView=&#8221;contentfinder&#8221;).
</li>
</ul>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/daygrep.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/daygrep.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/daygrep.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/daygrep.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/daygrep.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/daygrep.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/daygrep.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/daygrep.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/daygrep.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/daygrep.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daygrep.wordpress.com&blog=7092608&post=8&subd=daygrep&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://daygrep.wordpress.com/2009/04/01/opening-a-page-in-cq5-wcm-without-content-finder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e5bb7cfb8d407bfbac5e4852e2accdc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daygrep</media:title>
		</media:content>
	</item>
		<item>
		<title>Hello world</title>
		<link>http://daygrep.wordpress.com/2009/03/24/hello-world/</link>
		<comments>http://daygrep.wordpress.com/2009/03/24/hello-world/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 22:47:10 +0000</pubDate>
		<dc:creator>daygrep</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This blog shall be about experiences and musings resulting from my daily work with the products of Day Software, such as CQ and CRX.
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daygrep.wordpress.com&blog=7092608&post=1&subd=daygrep&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This blog shall be about experiences and musings resulting from my daily work with the products of <a href="http://day.com">Day Software</a>, such as <a href="http://www.day.com/content/day/en/products/web_content_management.html">CQ</a> and <a href="http://www.day.com/content/day/en/products/crx.html">CRX</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/daygrep.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/daygrep.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/daygrep.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/daygrep.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/daygrep.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/daygrep.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/daygrep.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/daygrep.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/daygrep.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/daygrep.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daygrep.wordpress.com&blog=7092608&post=1&subd=daygrep&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://daygrep.wordpress.com/2009/03/24/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1e5bb7cfb8d407bfbac5e4852e2accdc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">daygrep</media:title>
		</media:content>
	</item>
	</channel>
</rss>