﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Noah-文章分类-CQ5</title><link>http://www.blogjava.net/Noah/category/53686.html</link><description>&lt;span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri" lang="ZH-CN"&gt;不是经典我不发&lt;/span&gt;</description><language>zh-cn</language><lastBuildDate>Thu, 27 Jun 2013 07:23:16 GMT</lastBuildDate><pubDate>Thu, 27 Jun 2013 07:23:16 GMT</pubDate><ttl>60</ttl><item><title>用CQ5创建在对话框的组件</title><link>http://www.blogjava.net/Noah/articles/401006.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Thu, 27 Jun 2013 06:44:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/401006.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/401006.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/401006.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/401006.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/401006.html</trackback:ping><description><![CDATA[<p style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">1.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">创建组件</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpLast"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">a.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">在</span><font face="Calibri">CRXDE Lite</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">里，右键点击相应的组件文件夹如</span><font face="Calibri">/apps/demoNoah/components</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">，并且选择&#8220;</span><font face="Calibri">Create</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;</span><font face="Calibri">&#8212;</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8220;</span><font face="Calibri">Create component&#8230;</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;</span><font face="Calibri">,</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">在弹出的窗口中输入相应信息，如下图：</span><o:p></o:p></p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img border="0" alt="" src="http://www.blogjava.net/images/blogjava_net/noah/cq5_13.png" width="419" height="359" />&nbsp; 
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">b.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">一路点击&#8220;</span><font face="Calibri">Next</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;直到&#8220;</span><font face="Calibri">OK</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;。</p>
<p style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">2.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">创建对话框</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpLast"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">a.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">右键点击刚才建立的组件，选择&#8220;</span><font face="Calibri">Create</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;</span><font face="Calibri">&#8212;</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8220;</span><font face="Calibri">Create Dialog&#8230;</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;在弹出的窗口中输入相应信息，如下图：</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph"></span><o:p></o:p></p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img border="0" alt="" src="http://www.blogjava.net/images/blogjava_net/noah/cq5_14.png" width="420" height="279" />&nbsp;<br /><span style="line-height: 115%; font-family: 宋体; font-size: 11pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-theme-font: minor-fareast; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA" lang="ZH-CN"></span>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">b.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">点击保存，此时目录结构如下：</span><o:p></o:p></p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img border="0" alt="" src="http://www.blogjava.net/images/blogjava_net/noah/cq5_15.png" width="576" height="130" />&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c.&nbsp;&nbsp;&nbsp;<span style="line-height: 115%; font-family: 宋体; font-size: 11pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-theme-font: minor-fareast; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA" lang="ZH-CN">右键点击</span><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">dialog/items/items/tab1</span><span style="line-height: 115%; font-family: 宋体; font-size: 11pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-theme-font: minor-fareast; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA" lang="ZH-CN">节点，选择&#8220;</span><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">Create</span><span style="line-height: 115%; font-family: 宋体; font-size: 11pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-theme-font: minor-fareast; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA" lang="ZH-CN">&#8221;</span><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">&#8212;</span><span style="line-height: 115%; font-family: 宋体; font-size: 11pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-theme-font: minor-fareast; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA" lang="ZH-CN">&#8220;</span><span style="line-height: 115%; font-family: 'Calibri','sans-serif'; font-size: 11pt; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">Create Node&#8230;</span><span style="line-height: 115%; font-family: 宋体; font-size: 11pt; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-theme-font: minor-fareast; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA" lang="ZH-CN">&#8221;输入如图<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img border="0" alt="" src="http://www.blogjava.net/images/blogjava_net/noah/cq5_16.png" width="420" height="260" /><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN"> 
<p style="text-indent: -0.25in; margin: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpFirst"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">d.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">用同样的方法在&#8220;</span><font face="Calibri">items</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;下建立&#8220;</span><font face="Calibri">title</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;节点，但此时</span><font face="Calibri">Type</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">选择&#8220;</span><font face="Calibri">cq:Widget</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpLast"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">e.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">然后，添加如下属性：</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph">&nbsp;&nbsp;&nbsp;<img border="0" alt="" src="http://www.blogjava.net/images/blogjava_net/noah/cq5_17.png" width="572" height="164" />&nbsp;<br /></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">f.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">然后，再在&#8220;</span><font face="Calibri">title</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;下建立&#8220;</span><font face="Calibri">fieldConfig</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;节点，属性如下：</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph">&nbsp;&nbsp;&nbsp;<img border="0" alt="" src="http://www.blogjava.net/images/blogjava_net/noah/cq5_18.png" width="513" height="168" />&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">g.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">用同样方法建立&#8220;</span><font face="Calibri">des</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;节点，注意目录结构，如图</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph">&nbsp;&nbsp;&nbsp;<img border="0" alt="" src="http://www.blogjava.net/images/blogjava_net/noah/cq5_19.png" />&nbsp;</p>
<p style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">3.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">获取变量值</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpLast"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">a.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">打开&#8220;</span><font face="Calibri">Buick_Tech_Info.jsp</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;</span><font face="Calibri">,</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">输入如下内容：</span></p>
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /><span style="color: #000000">&lt;%</span><span style="color: #000000">@include&nbsp;file</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">/libs/foundation/global.jsp</span><span style="color: #000000">"</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: #000000">&lt;%</span><span style="color: #000000">@&nbsp;page&nbsp;</span><span style="color: #0000ff">import</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">java.util.Iterator,</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;com.day.cq.wcm.foundation.List,<br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" />com.day.cq.wcm.api.Page,<br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;com.day.cq.wcm.api.PageFilter</span><span style="color: #000000">"</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: #000000">&lt;</span><span style="color: #000000">cq:defineObjects&nbsp;</span><span style="color: #000000">/&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">List&nbsp;list&nbsp;=&nbsp;(List)request.getAttribute("titles");</span><span style="color: #008000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span><span style="color: #000000">String[]&nbsp;titles&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;(String[])properties.get(</span><span style="color: #000000">"</span><span style="color: #000000">titles</span><span style="color: #000000">"</span><span style="color: #000000">,&nbsp;String[].</span><span style="color: #0000ff">class</span><span style="color: #000000">);<br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" />String[]&nbsp;des&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;(String[])properties.get(</span><span style="color: #000000">"</span><span style="color: #000000">description</span><span style="color: #000000">"</span><span style="color: #000000">,&nbsp;String[].</span><span style="color: #0000ff">class</span><span style="color: #000000">);<br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span></div>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph">&nbsp;&nbsp;</p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">b.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">这里只主要说明的是怎么获取用户输入的数据，具体想怎么显示可自行实现，比如：</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph"></p>
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /><span style="color: #000000">&lt;%</span><span style="color: #000000"><br /><img id="Codehighlighter1_25_316_Open_Image" onclick="this.style.display='none'; Codehighlighter1_25_316_Open_Text.style.display='none'; Codehighlighter1_25_316_Closed_Image.style.display='inline'; Codehighlighter1_25_316_Closed_Text.style.display='inline';" align="top" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_25_316_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_25_316_Closed_Text.style.display='none'; Codehighlighter1_25_316_Open_Image.style.display='inline'; Codehighlighter1_25_316_Open_Text.style.display='inline';" align="top" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">(titles&nbsp;</span><span style="color: #000000">!=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_25_316_Closed_Text"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_25_316_Open_Text"><span style="color: #000000">{<br /><img id="Codehighlighter1_65_314_Open_Image" onclick="this.style.display='none'; Codehighlighter1_65_314_Open_Text.style.display='none'; Codehighlighter1_65_314_Closed_Image.style.display='inline'; Codehighlighter1_65_314_Closed_Text.style.display='inline';" align="top" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_65_314_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_65_314_Closed_Text.style.display='none'; Codehighlighter1_65_314_Open_Image.style.display='inline'; Codehighlighter1_65_314_Open_Text.style.display='inline';" align="top" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;&nbsp;i</span><span style="color: #000000">&lt;</span><span style="color: #000000">titles.length;&nbsp;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_65_314_Closed_Text"><img alt="" src="http://www.blogjava.net/Images/dot.gif" /></span><span id="Codehighlighter1_65_314_Open_Text"><span style="color: #000000">{<br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">a&nbsp;</span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">accordion_headings</span><span style="color: #000000">"</span><span style="color: #000000">&gt;&lt;%=</span><span style="color: #000000">titles[i]</span><span style="color: #000000">%&gt;&lt;/</span><span style="color: #000000">a</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">div&nbsp;id</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">test-content</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">div&nbsp;</span><span style="color: #0000ff">class</span><span style="color: #000000">=</span><span style="color: #000000">"</span><span style="color: #000000">accordion_child</span><span style="color: #000000">"</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;%=</span><span style="color: #000000">&nbsp;(i</span><span style="color: #000000">&lt;</span><span style="color: #000000">des.length</span><span style="color: #000000">?</span><span style="color: #000000">des[i]:</span><span style="color: #000000">""</span><span style="color: #000000">)</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">div</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">&lt;/</span><span style="color: #000000">div</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" /></span><span style="color: #000000">&lt;%</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000">%&gt;</span><span style="color: #000000"><br /><img alt="" align="top" src="http://www.blogjava.net/images/OutliningIndicators/None.gif" /></span></div>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph"></p>
<p style="text-indent: -0.25in; margin: 0in 0in 0pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpFirst"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">4.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">在页面中添加上相应的组件</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpMiddle"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">a.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">到页面中找到这个组件，并拖一个到页面中。</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpLast"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">b.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">在这个区域中点右键，选择&#8220;</span><font face="Calibri">Edit</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;。会出现类似如下界面</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph">&nbsp;&nbsp;&nbsp;<img border="0" alt="" src="http://www.blogjava.net/images/blogjava_net/noah/cq5_20.png" width="533" height="395" />&nbsp;<br /><br /></p>
<p style="text-indent: -0.25in; margin: 0in 0in 0pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraphCxSpFirst"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">b.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">填写完成后，点&#8220;</span><font face="Calibri">OK</font><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">&#8221;，用户所填写的信息会显示在页面上。</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 0.5in; mso-list: l0 level1 lfo1" class="MsoListParagraphCxSpLast"><span style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"><span style="mso-list: Ignore"><font face="Calibri">5.</font><span style="font: 7pt 'Times New Roman'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><span style="font-family: 宋体; mso-ascii-font-family: Calibri; mso-hansi-font-family: Calibri; mso-fareast-font-family: 宋体; mso-fareast-theme-font: minor-fareast; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin" lang="ZH-CN">到此整个过程完成。</span><o:p></o:p></p>
<p style="text-indent: -0.25in; margin: 0in 0in 10pt 1in; mso-list: l0 level2 lfo1; mso-add-space: auto" class="MsoListParagraph"></span></p></span><img src ="http://www.blogjava.net/Noah/aggbug/401006.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2013-06-27 14:44 <a href="http://www.blogjava.net/Noah/articles/401006.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>怎么使用CQ5来开发网站</title><link>http://www.blogjava.net/Noah/articles/400958.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Wed, 26 Jun 2013 01:46:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/400958.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/400958.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/400958.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/400958.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/400958.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: CQ5用的人非常少，在中国更是少之更少。并且，中文方面的资料可以说为0.在这里我就先为大家抛块砖，简单的介绍一下CQ5的使用，比如怎么站一个网站，怎么建一个template,怎么为网站加CSS样式，图片等，怎么开发组件等等吧1.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 建立项目结构在&#8220;CRXDE Lite&#8221;里a.&nbsp;&nbsp...&nbsp;&nbsp;<a href='http://www.blogjava.net/Noah/articles/400958.html'>阅读全文</a><img src ="http://www.blogjava.net/Noah/aggbug/400958.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2013-06-26 09:46 <a href="http://www.blogjava.net/Noah/articles/400958.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>How to Create a Fully Featured Internet Website in CQ5</title><link>http://www.blogjava.net/Noah/articles/400946.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Tue, 25 Jun 2013 09:42:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/400946.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/400946.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/400946.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/400946.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/400946.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: This tutorial enables you to create a fully featured website with Adobe Experience Manager (AEM). The website will be based on a generic website and is targeted primarily at web developers. All develo...&nbsp;&nbsp;<a href='http://www.blogjava.net/Noah/articles/400946.html'>阅读全文</a><img src ="http://www.blogjava.net/Noah/aggbug/400946.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2013-06-25 17:42 <a href="http://www.blogjava.net/Noah/articles/400946.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>How to Develop Components</title><link>http://www.blogjava.net/Noah/articles/400941.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Tue, 25 Jun 2013 08:12:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/400941.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/400941.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/400941.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/400941.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/400941.html</trackback:ping><description><![CDATA[<p>This section describes how to create your own components and add them to the paragraph system. </p>
<p>A quick way to get started is to copy an existing component and then make the changes you want. You can also use this method to edit existing components (although Day recommends that you back up the original component).</p>
<p>An example of how to develop a component is described in detail in <a class="olink" href="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/cq5_howto_components_develop.html#sect_extending">Extending the Text and Image Component - An Example.</a></p>
<div lang="en" class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d3791e12"></a>Developing a new component by adapting an existing component</h3></div></div></div>
<p>To develop new components for CQ WCM based on existing component, you copy the component and create a javascript file for the new component and store it in a location accessible to CQ5:</p>
<div class="procedure">
<ol type="1"><li>
<p>Create a new component folder in <code class="uri">/apps/</code><code class="uri"><em class="replaceable"><code>&lt;website-name&gt;</code></em></code><code class="uri">/components/<em class="replaceable"><code>&lt;MyComponent&gt;</code></em></code> by copying an existing component, such as the Text component, and renaming it.</p>
<div class="screenshot">
<div class="mediaobject"><img src="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/graphics/DevelopComponents_001.png"  alt="" /></div></div></li><li>
<p>In the CRX Explorer, modify the <code class="uri">jcr:description</code> and <code class="uri">jcr:title</code> to reflect its new name.</p></li><li>
<p>Open the new component folder and make the changes you require; also, delete any extraneous information in the folder.</p>
<p>You can make changes such as:</p>
<div class="itemizedlist">
<ul type="disc"><li>
<p>adding a new field in the dialog box</p></li><li>
<p>replacing the <code class="filename">.jsp</code> file (name it after your new component)</p></li><li>
<p>or completely reworking the entire component if you want</p></li></ul></div>
<p>For example, if you take a copy of the standard Text component, you can add an additional field to the dialog box, then update the <code class="filename">.jsp</code> to process the input made there.</p></li><li>
<p>In the Content Explorer, navigate to the component and change the <code class="sgmltag-element">allowedParents</code> property to <code class="sgmltag-element">*/parsys</code>, which makes it available to the paragraph system.</p>
<div style="margin-left: 0.5in; margin-right: 0.5in" class="note">
<table border="0" summary="Note">
<tbody>
<tr>
<td valign="top" rowspan="2" width="25" align="center"><img alt="[Note]" src="http://dev.day.com/docs/v5_2/html-resources/resources/note.png" /></td>
<th align="left">Note</th></tr>
<tr>
<td valign="top" align="left">
<p>Either cq:editConfig node, dialog, or design_dialog node should be present and properly initialized for the new component to appear.</p></td></tr></tbody></table></div></li><li>
<p>Activate the new component in your paragraph system either by adding <code class="uri">/apps/<em class="replaceable"><code>&lt;website-name&gt;</code></em>/components/<em class="replaceable"><code>&lt;MyComponent&gt;</code></em></code> to the <code class="uri">/etc/designs/default/&lt;website-name&gt;/jcr:content/contentpage/parsys/components</code> property in CRX or by following the instructions in <a class="link" title="Adding a new component to the paragraph system (design mode)" href="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/cq5_howto_components_develop.html#section_addingcomponents">Adding new components to paragraph systems</a>.</p></li><li>
<p>In CQ WCM, open a page in your web site and insert a new paragraph of the type you just created to make sure the component is working properly.</p></li></ol></div>
<div style="margin-left: 0.5in; margin-right: 0.5in" class="note">
<table border="0" summary="Note">
<tbody>
<tr>
<td valign="top" rowspan="2" width="25" align="center"><img alt="[Note]" src="http://dev.day.com/docs/v5_2/html-resources/resources/note.png" /></td>
<th align="left">Note</th></tr>
<tr>
<td valign="top" align="left">
<p>To see timing statistics for page loading, you can use <strong class="accel"><code>Ctrl-Shift-U</code></strong> - with <code class="uri">?debugClientLibs=true</code> set in the URL.</p></td></tr></tbody></table></div></div>
<div lang="en" class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="section_addingcomponents"></a>Adding a new component to the paragraph system (design mode)</h3></div></div></div>
<p>After the component has been developed, you add it to the paragraph system, which enables authors to select and use the component when editing a page.</p>
<div class="procedure">
<ol type="1"><li>
<p>Access a page within your authoring environment that uses the paragraph system; for example <code class="uri">&lt;<em class="replaceable"><code>contentPath</code></em>&gt;/Test.html</code>.</p></li><li>
<p>Switch to Design mode by either:</p>
<div class="itemizedlist">
<ul type="disc"><li>
<p>adding <code class="uri">?cmsmode=design</code> to the end of the URL and accessing again; for example <code class="uri">&lt;contextPath&gt;/ Test.html?cmsmode=design</code>.</p></li><li>
<p>clicking <strong class="guibutton"><code>Design</code></strong> in Sidekick</p></li></ul></div>
<p>You are now in designmode and can edit the paragraph system:</p>
<div class="screenshot">
<div class="mediaobject"><img src="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/graphics/Component_DesignMode.png"  alt="" /></div></div></li><li>
<p>Click <strong class="guibutton"><code>Edit</code></strong>.</p>
<p>A list of components belonging to the paragraph system are shown (all those defined with the property <em class="parameter"><code>allowedParents=*/parsys</code></em>). Your new component is also listed.</p>
<p>The components can be activated (or deactivated) to determine which are offered to the author when editing a page.</p></li><li>
<p>Activate your component, then return to normal edit mode to confirm that it is available for use.</p></li></ol></div></div>
<div lang="en" class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="sect_extending"></a>Extending the Text and Image Component - An Example</h3></div></div></div>
<p>This section provides an example on how to extend the widely used text and image standard component with a configurable image placement feature.</p>
<p>The extension to the text and image component allows editors to use all the existing functionality of the component plus have an extra option to specify the placement of the image either:</p>
<div class="itemizedlist">
<ul type="disc"><li>
<p>on the left-hand side of the text (current behavior and the new default)</p></li><li>
<p>as well as on the right-hand side</p></li></ul></div>
<p>After extending this component, you can configure the image placement through the component's dialog box.</p>
<p>The following techniques are described in this exercise:</p>
<div class="itemizedlist">
<ul type="disc"><li>
<p>Copying existing component node and modifying its metadata</p></li><li>
<p>Modifying the component's dialog, including inheritance of widgets from parent dialog boxes</p></li><li>
<p>Modifying the component's script to implement the new functionality</p></li></ul></div>
<div lang="en" class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="d3791e197"></a>Extending the existing <code class="uri">textimage</code> component</h4></div></div></div>
<p>To create the new component, we use the standard <code class="uri">textimage</code> component as a basis and modify it. We store the new component in the Geometrixx CQ WCM example application. To extend the textimage component, go to the CRX Explorer (<code class="filename"><em class="replaceable"><code>server name:port number</code></em>/crx)</code> and log in as <strong class="guibutton"><code>admin</code></strong> and then navigate to the Content Explorer.</p>
<div class="procedure">
<ol type="1"><li>
<p>Copy the standard textimage component from <code class="uri">/libs/foundation/components/textimage</code> into the Geometrixx component folder, <code class="uri">/apps/geometrixx/components</code>, using <code class="uri">textimage</code> as the target node name. (Copy the component by navigating to the component, right-clicking and selecting <strong class="guibutton"><code>Copy</code></strong> and browsing to the target directory.)</p>
<div class="screenshot">
<div class="mediaobject"><img src="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/graphics/DevelopComponentsCopyingTextImage.png"  alt="" /></div></div></li><li>
<p>To keep this example simple, navigate to the component you copied and delete all the subnodes of the new textimage node <strong class="guibutton"><code>except</code></strong> for the following ones:</p>
<div class="itemizedlist">
<ul type="disc"><li>
<p>dialog definition: <code class="uri">textimage/dialog</code></p></li><li>
<p>component script: <code class="uri">textimage/textimage.jsp</code></p></li></ul></div></li><li>
<p>Edit the component metadata:</p>
<div class="itemizedlist">
<ul type="disc"><li>
<p>Component name</p>
<div class="itemizedlist">
<ul type="circle"><li>
<p>Set <code class="uri">jcr:description</code> to <em class="parameter"><code>Text Image Component (Extended)</code></em></p></li><li>
<p>Set <code class="uri">jcr:title</code> to <em class="parameter"><code>Text Image (Extended)</code></em></p></li></ul></div></li><li>
<p>Component listing in the paragraph (parsys component) system (leave as is)</p>
<div class="itemizedlist">
<ul type="circle"><li>
<p>Leave <em class="parameter"><code>allowedParents</code></em> defined as <em class="parameter"><code>*/parsys</code></em></p></li></ul></div></li><li>
<p>Group, where the component is listed in the sidekick (leave as is)</p>
<div class="itemizedlist">
<ul type="circle"><li>
<p>Leave <em class="parameter"><code>componentGroup</code></em> set to <em class="parameter"><code>General</code></em></p></li></ul></div></li><li>
<p>Parent component for the new component (the standard <em class="parameter"><code>textimage</code></em> component)</p>
<div class="itemizedlist">
<ul type="circle"><li>
<p>Set <em class="parameter"><code>sling:resourceSuperType</code></em> to <em class="parameter"><code>foundation/components/textimage</code></em></p></li></ul></div></li></ul></div>
<p>After these steps the component node looks like the following:</p>
<div class="screenshot">
<div class="mediaobject"><img src="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/graphics/DevelopComponents-TextimageInitial.png"  alt="" /></div></div>
<p>&nbsp;</p></li><li>
<p>Modify the component's dialog box to include the new option. The new component inherits the parts of the dialog box that are the same as in the original. The only addition we make is to extend the <strong class="guibutton"><code>Advanced</code></strong> tab, adding an <strong class="guibutton"><code>Image Position</code></strong> dropdown list, with options <strong class="guibutton"><code>Left</code></strong> and <strong class="guibutton"><code>Right</code></strong>:</p>
<div class="itemizedlist">
<ul type="disc"><li>
<p>Leave the <em class="parameter"><code>textimage/dialog</code></em> properties unchanged.</p></li><li>
<p>Note how <code class="uri">textimage/dialog/items</code> has three subnodes, <code class="uri">tab1</code> to <code class="uri">tab3</code>, representing the three tabs of the <em class="parameter"><code>textimage</code></em> dialog box.</p></li><li>
<p>For the first two tabs (<code class="uri">tab1</code> and <code class="uri">tab2</code>):</p>
<div class="itemizedlist">
<ul type="circle"><li>
<p>Change <em class="parameter"><code>xtype</code></em> to <em class="parameter"><code>cqinclude</code></em> (to inherit from the standard component).</p></li><li>
<p>Add a <em class="parameter"><code>pathParameter</code></em> property with values <code class="uri">/libs/foundation/components/textimage/dialog/items/tab1.infinity.json</code> and <code class="uri">/libs/foundation/components/textimage/dialog/items/tab2.infinity.json</code>, respectively.</p></li><li>
<p>Remove all other properties or subnodes.</p></li></ul></div></li><li>
<p>For <code class="uri">tab3</code>:</p>
<div class="itemizedlist">
<ul type="circle"><li>
<p>Leave the properties and subnodes without changes</p></li><li>
<p>Add a new field definition to <code class="uri">tab3/items</code>, node <em class="parameter"><code>position</code></em> of type <em class="parameter"><code>cq:Widget</code></em></p></li><li>
<p>Set the following properties (of type <em class="parameter"><code>String</code></em>) for the new <code class="uri">tab3/items/position</code> node</p>
<div class="itemizedlist">
<ul type="square"><li>
<p><em class="parameter"><code>name</code></em>: <em class="parameter"><code>./imagePosition</code></em></p></li><li>
<p><em class="parameter"><code>xtype</code></em>: <em class="parameter"><code>selection</code></em></p></li><li>
<p><em class="parameter"><code>fieldLabel</code></em>: <em class="parameter"><code>Image Position</code></em></p></li><li>
<p><em class="parameter"><code>type</code></em>: <em class="parameter"><code>select</code></em></p></li></ul></div></li><li>
<p>Add subnode <code class="uri">position/options</code> of type <em class="parameter"><code>cq:WidgetCollection</code></em> to represent the two choices for image placement, and under it create two nodes, <code class="uri">o1</code> and <code class="uri">o2</code> of type <em class="parameter"><code>nt:unstructured</code></em></p></li><li>
<p>For node <code class="uri">position/options/o1</code> set the properties: <em class="parameter"><code>text</code></em> to <em class="parameter"><code>Left</code></em> and <em class="parameter"><code>value</code></em> to <em class="parameter"><code>left</code></em></p></li><li>
<p>For node <code class="uri">position/options/o2</code> set the properties: <em class="parameter"><code>text</code></em> to <em class="parameter"><code>Right</code></em> and <em class="parameter"><code>value</code></em> to <em class="parameter"><code>right</code></em></p></li></ul></div></li></ul></div>
<p>Image position is persisted in content as the <em class="parameter"><code>imagePosition</code></em> property of the node representing <em class="parameter"><code>textimage</code></em> paragraph.</p>
<p>After these steps, the component dialog box looks like this:</p>
<div class="screenshot">
<div class="mediaobject"><img src="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/graphics/DevelopComponents-ComponentDialog.png"  alt="" /></div></div></li><li>
<p>Extend the component script, <code class="filename">textimage.jsp</code>, with extra handling of the new parameter.</p>
<div class="itemizedlist">
<ul type="disc"><li>
<p>Open the <code class="filename">/apps/geometrixx/components/textimage/textimage.jsp</code> script for editing.</p></li><li>
<p>We are going to manipulate the style of the <code class="code">&lt;div class="image"&gt;</code> tag, generated by the component, to float the image to the right. It is located in the following area of the code:</p><pre class="programlisting">    Image img = new Image(resource, "image");
    if (img.hasContent() || WCMMode.fromRequest(request) == WCMMode.EDIT) {
<span class="emphasis"><em>%&gt;&lt;div class="image"&gt;&lt;%</em></span>
        img.loadStyleData(currentStyle);</pre>
<p>We are going to replace the emphasized code fragment <span class="emphasis"><em><code class="code">%&gt;&lt;div class="image"&gt;&lt;%</code></em></span> with new code generating a custom style for this tag.</p></li><li>
<p>Copy the following code fragment, and replace the <span class="emphasis"><em><code class="code">%&gt;&lt;div class="image"&gt;&lt;%</code></em></span> line with it:</p><pre class="programlisting">        // todo: add new CSS class for the 'right image' instead of using
        //       the style attribute
        String style="";
        if (properties.get("imagePosition", "left").equals("right")) {
            style = "style=\"float:right\"";
        }
        %&gt;&lt;div &lt;%= style %&gt; class="image"&gt;&lt;%</pre>
<p>Note that for simplicity we are hard-coding the style to the HTML tag. The proper way to do it would be to add a new CSS class to the application styles and just add the class to the tag in the code in the case of a right-aligned image.</p></li><li>
<p>The code fragment, after the change, should look like this (new code emphasized):</p><pre class="programlisting">    Image img = new Image(resource, "image");
    if (img.hasContent() || WCMMode.fromRequest(request) == WCMMode.EDIT) {
<span class="emphasis"><em>        // todo: add new CSS class for the 'right image' instead of using
        //       the style attribute
        String style="";
        if (properties.get("imagePosition", "left").equals("right")) {
            style = "style=\"float:right\"";
        }
        %&gt;&lt;div &lt;%= style %&gt; class="image"&gt;&lt;%
</em></span>        img.loadStyleData(currentStyle);
</pre></li><li>
<p>Save the script to the repository.</p></li></ul></div></li><li>
<p>The component is ready to test.</p></li></ol></div></div>
<div lang="en" class="section">
<div class="titlepage">
<div>
<div>
<h4 class="title"><a name="section_checkingcomponents"></a>Checking the new component</h4></div></div></div>
<p>After the component has been developed, you can add it to the paragraph system, which enables authors to select and use the component when editing a page. These steps allow you to test the component.</p>
<div class="procedure">
<ol type="1"><li>
<p>Open a page in Geometrixx; for example, <strong class="guibutton"><code>English</code></strong>/<strong class="guibutton"><code>Company</code></strong></p></li><li>
<p>Switch to design mode by clicking <strong class="guibutton"><code>Design</code></strong> in Sidekick</p></li><li>
<p>Edit the paragraph system design by clicking <strong class="guiicon"><code>Edit</code></strong> on the paragraph system in the middle of the page. A list of components, which can be placed in the paragraph system are shown, and it should include your newly developed component, <strong class="guibutton"><code>Text Image (Extended)</code></strong>. Activate it for the paragraph system by selecting it and clicking <strong class="guibutton"><code>OK</code></strong>.</p></li><li>
<p>Switch back to the editing mode.</p></li><li>
<p>Add the Text Image (Extended) paragraph to the paragraph system, initialize text and image with sample content. Save and you should see the default rendering of Text and Image component:</p>
<div class="screenshot">
<div class="mediaobject"><img src="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/graphics/DevelopComponents-DefaultRendering.png"  alt="" /></div></div></li><li>
<p>Open the dialog of the text and image paragraph, and change the <strong class="guibutton"><code>Image Position</code></strong> on the <strong class="guibutton"><code>Advanced</code></strong> tab to <strong class="guibutton"><code>Right</code></strong>, and click <strong class="guibutton"><code>OK</code></strong> to save the changes.</p>
<div class="screenshot">
<div class="mediaobject"><img src="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/graphics/DevelopComponents-DialogRight.png"  alt="" /></div></div></li><li>
<p>You see the paragraph rendered with the image on the right:</p>
<div class="screenshot">
<div class="mediaobject"><img src="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/graphics/DevelopComponents-RightRendering.png"  alt="" /></div></div></li><li>
<p>The component is now ready to use.</p></li></ol></div>
<p>The component stores its content in a paragraph on the Company page. The following screenshot shows how our new configuration parameter is persisted in the repository, with the node representing the paragraph we have just created.</p>
<div class="screenshot">
<div class="mediaobject"><img src="http://dev.day.com/docs/v5_2/html-resources/cq5_howto_components_develop/graphics/DevelopComponents-ContentStorage.png"  alt="" /></div></div>
<p>The <code class="filename">textimage/imagePosition</code> parameter represents the position of the image for this paragraph on <code class="uri">/content/geometrixx/en/company</code> page.</p></div></div><img src ="http://www.blogjava.net/Noah/aggbug/400941.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2013-06-25 16:12 <a href="http://www.blogjava.net/Noah/articles/400941.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>How to Create Templates</title><link>http://www.blogjava.net/Noah/articles/400940.html</link><dc:creator>眼镜蛇</dc:creator><author>眼镜蛇</author><pubDate>Tue, 25 Jun 2013 07:50:00 GMT</pubDate><guid>http://www.blogjava.net/Noah/articles/400940.html</guid><wfw:comment>http://www.blogjava.net/Noah/comments/400940.html</wfw:comment><comments>http://www.blogjava.net/Noah/articles/400940.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/Noah/comments/commentRss/400940.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/Noah/services/trackbacks/400940.html</trackback:ping><description><![CDATA[<p>CQ5 page templates are simply models used to create new pages. They can contain as little, or as much, initial content as needed, their role being to create the correct initial node structures, with the required properties (primarily <span class="property">sling:resourceType</span>) set to allow editing and rendering.</p>
<div lang="en" class="section">
<div class="titlepage">
<div>
<div>
<h3 class="title"><a name="d1091e9"></a>Creating a new Template (based on an existing template)</h3></div></div></div>
<p>Needless to say a new template can be created completely from scratch, but often an existing template will be copied and updated to save you time and effort. For example, the templates within Geometrixx can be used to get you started.</p>
<div class="procedure">
<ol type="1"><li>
<p>Copy an existing template (preferably with a definition as close as possible to what you want to achieve) to a new node.</p>
<div style="margin-left: 0.5in; margin-right: 0.5in" class="note">
<table border="0" summary="Note">
<tbody>
<tr>
<td valign="top" rowspan="2" width="25" align="center"><img alt="[Note]" src="http://dev.day.com/docs/v5_2/html-resources/resources/note.png" /></td>
<th align="left">Note</th></tr>
<tr>
<td valign="top" align="left">
<p>Templates are usually stored in <code class="filename">/apps/&lt;<em class="replaceable"><code>website-name</code></em>&gt;/templates/&lt;<em class="replaceable"><code>template-name</code></em>&gt;</code>.</p></td></tr></tbody></table></div></li><li>
<p>Change the <span class="property">jcr:title</span> of the new template node to reflect its new role. You can also update the <span class="property">jcr:description</span> if appropriate.</p></li><li>
<p>Copy the component on which the template is based (this is indicated by the <span class="property">sling:resourceType</span> property of the <span class="property">jcr:content</span> node within the template) to create a new instance.</p>
<div style="margin-left: 0.5in; margin-right: 0.5in" class="note">
<table border="0" summary="Note">
<tbody>
<tr>
<td valign="top" rowspan="2" width="25" align="center"><img alt="[Note]" src="http://dev.day.com/docs/v5_2/html-resources/resources/note.png" /></td>
<th align="left">Note</th></tr>
<tr>
<td valign="top" align="left">
<p>Components are usually stored in <code class="filename">/apps/&lt;<em class="replaceable"><code>website-name</code></em>&gt;/components/&lt;<em class="replaceable"><code>component-name</code></em>&gt;</code>.</p></td></tr></tbody></table></div></li><li>
<p>Update the <span class="property">jcr:title</span> and <span class="property">jcr:description</span> of the new component.</p></li><li>
<p>Replace the <code class="filename">thumbnail.png</code> if you want a new thumbnail picture to be shown in the template selection list.</p></li><li>
<p>Update the <span class="property">sling:resourceType</span> of the template's <span class="property">jcr:content</span> node to reference the new component.</p></li><li>
<p>Make any further changes to the functionality or design of the template and/or its underlying component.</p>
<p>Changes made to the <code class="filename">/apps/<em class="replaceable"><code>&lt;website&gt;</code></em>/templates/&lt;<em class="replaceable"><code>template-name</code></em>&gt;</code> node will affect the template instance (as in the selection list).</p>
<p>Changes made to the <code class="filename">/apps/&lt;<em class="replaceable"><code>website</code></em>&gt;/components/&lt;<em class="replaceable"><code>component-name</code></em>&gt;</code> node will affect the content page created when the template is used.</p></li></ol></div>
<p>You can now create a page within your website using the new template.</p></div><img src ="http://www.blogjava.net/Noah/aggbug/400940.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/Noah/" target="_blank">眼镜蛇</a> 2013-06-25 15:50 <a href="http://www.blogjava.net/Noah/articles/400940.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>