tag:blogger.com,1999:blog-30026619681760354952024-03-13T11:01:12.477-07:00Code.Run.Debug.RepeatThis blog is a pit stop for developers looking for something technically challenging thing while developing.Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-3002661968176035495.post-74129246389526081762015-10-24T02:44:00.000-07:002015-10-24T02:44:19.644-07:00Integrating Apache Wookie with AEM<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;"><b><br /></b></span>
<span style="font-family: Courier New, Courier, monospace;"><b>Interactive websites</b> - term making a lot of buzz over world wide web. </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div style="text-align: center;">
<span style="font-family: Courier New, Courier, monospace;">But what are <b>Interactive websites </b>?</span></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Interactive websites are the ones which provides a number of different features to make interactive experience for users. One of the most important qualities of a website is interactivity. It allows users to interact with the website. With change of time web visitors expect to interact meaningfully with websites. </span><br />
<span style="font-family: Courier New, Courier, monospace;">There interactive aspects of a website often include : </span><br />
<div style="text-align: left;">
</div>
<ul style="text-align: left;">
<li><span style="font-family: Courier New, Courier, monospace;">responsive forms</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">chat applications</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">games</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">or some sort of mini applications</span></li>
</ul>
<br />
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Though creating any such feature is not a rocket science but it does comes with some development time associated with each feature. And creating such site in AEM would also cost time as there are no such features provided in AEM 'out of the box'. </span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><i>What if we have a central server where we can have such mini applications and use them directly in AEM ?</i> </span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Where users can select from a wide variety of interactive mini applications like chat-applications, geolocation sharing apps, a to-do list or a game and many such ready to use mini applications. </span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Integrating Apache wookie with AEM allows users to drag & drop such interactive application. We have developed a connector tool for connecting AEM with apache wookie : <a href="https://github.com/ankit-gubrani/AEM-WookieConnector" target="_blank"><b>AEM-WookieConnector</b></a> </span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Apache wookie is Java server application with allows you to upload & deploy widgets (mini web applications) for your applications. Using <b>AEM-Wookie Connector</b> tool AEM users can use simply drag n drop wookie widgets on their AEM pages and use from any where. </span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Here are the steps to install AEM-WookieConnector Tool : </span></div>
<br />
<br />
<li><span style="font-family: Courier New, Courier, monospace;">Install Wookie as a standalone jar or as a WAR version from instructions given <a href="http://wookie.apache.org/docs/download.html" target="_blank">here</a></span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Next, Clone the <a href="https://github.com/ankit-gubrani/AEM-WookieConnector" target="_blank">AEM Wookie connector</a> </span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Build and Deploy :<br /> mvn clean install -PautoInstallPackage</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Configure and provide the Wookie server URL and API Key<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQOIUvJTImvfUEIjWhO1X-_EXROy4sz20H7bkSDODzn_9mS1B1RMGtuPYY5rkAY3e3-7g_U4l9otbpH0jOXfc2GT5Xj_nWaDv6O1KqtrxQZ0bB6gT_IHw0PUnlYFelvJLPmAcsXyRDvZqH/s1600/AEM-Wookie-Configuration_Cropped_2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQOIUvJTImvfUEIjWhO1X-_EXROy4sz20H7bkSDODzn_9mS1B1RMGtuPYY5rkAY3e3-7g_U4l9otbpH0jOXfc2GT5Xj_nWaDv6O1KqtrxQZ0bB6gT_IHw0PUnlYFelvJLPmAcsXyRDvZqH/s640/AEM-Wookie-Configuration_Cropped_2.png" width="560" /></a></span></li>
<br />
<ol style="text-align: left;">
</ol>
</div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<li><span style="font-family: 'Courier New', Courier, monospace;">And Start Using !</span></li>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia1pfekuccR1i3nmw8SrcDyRMD11w4C2MrQimJJoNYeny1UwsitZz8_OeVl1BPfYBZXPO8x8hO2xxQomcbL0tW4BMTg4vVP4haWLnsO_7vKIOMZxwmYT4-4EvDREzIQAeCgL7xexlonJ02/s1600/step2_F.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="338" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia1pfekuccR1i3nmw8SrcDyRMD11w4C2MrQimJJoNYeny1UwsitZz8_OeVl1BPfYBZXPO8x8hO2xxQomcbL0tW4BMTg4vVP4haWLnsO_7vKIOMZxwmYT4-4EvDREzIQAeCgL7xexlonJ02/s640/step2_F.png" width="560" /></a></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">AEM Wookie connector tool was presented as a solution to wider audience at a annually organized event <a href="http://aemhub.cognifide.com/speakers-2015.html#ankit_gubrani" target="_blank">AEMHub</a> </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Other useful links :</span><br />
<ul style="text-align: left;">
<li><span style="font-family: Courier New, Courier, monospace;">Presentation : <a href="http://ankit-gubrani.github.io/AEM-WookieConnector/#/" target="_blank">HTML</a> & <a href="http://www.slideshare.net/ankitgubrani/integrating-apache-wookie-with-aem-aemwookie-connector-tool" target="_blank">Slideshare</a> </span></li>
<li><span style="font-family: Courier New, Courier, monospace;">GitHub repository : <a href="https://github.com/ankit-gubrani/AEM-WookieConnector" target="_blank">https://github.com/ankit-gubrani/AEM-WookieConnector</a></span></li>
</ul>
<br />
<br />
<br /></div>
</div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0London, UK51.5073509 -0.1277582999999822351.1912379 -0.77320529999998222 51.8234639 0.51768870000001777tag:blogger.com,1999:blog-3002661968176035495.post-89199302909474281352015-08-19T13:08:00.000-07:002015-08-19T13:08:28.044-07:00Creating custom Content Finder tab in AEM <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;">AEM provides a quick and easy way to find & use content while editing a page via Content Finder. Content Finder is a way to search different types of assets stored in AEM and make them available for drag N drop on the pages. </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;"><br /></span>
<span style="line-height: 15.6000003814697px;">Creating a custom tab in Content finder makes it easier for user locate content or drag N dropable data. While creating a connector tool for AEM I came across this use case where I had to provide custom tab in the content finder to make data available for user while editing the page. </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;"><br /></span>
<span style="line-height: 15.6000003814697px;">Creating custom tab is a 2 step process : </span></span><br />
<ul style="text-align: left;"><span style="font-family: 'Courier New', Courier, monospace; line-height: 15.6000003814697px;">
<li><span style="line-height: 15.6000003814697px;">Creating a back-end service for providing data.</span></li>
<li><span style="line-height: 15.6000003814697px;">Creating custom content finder step.</span></li>
</span></ul>
<span style="font-family: 'Courier New', Courier, monospace; line-height: 15.6000003814697px;">
</span>
<br />
<div>
<span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;">1. <b>Back-end service</b> <b>:</b> It provides the data to the custom content finder tab to display. For this post I have created a text file with JSON data, in real world scenario it would be a service providing dynamic data.</span></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;"><br /></span></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;">2. <b>Creating custom content finder step</b> <b>:</b> </span></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;"><br /></span></span></div>
<div>
<ul style="text-align: left;">
<li><span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;">Create a folder with <b>jcr:primaryType</b> as <b>sling:folder</b> under <b>/apps/wcm/extensions</b> hierarchy with name <b>contentfinder.</b></span></span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;">Set property <b>extensionGroup</b> as tabs on "<b>contentfinder</b>" <span style="line-height: 15.6000003814697px;">folder</span>.</span></span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;">Set property <b>extensionType</b> as "<b>contentfinder_extension</b>" on contentfinder folder.</span></span></li>
</ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwEJMrAe8j64vRMyLdduexM4vO3L5jtnkvBfDSqsyr_z1drsTtIzuh73cBqV3GSjOmkxGjTlURPm3djCkQgNWwvw8x81ecA0W7lMTc25PFpQwXqn26H_EgusdSMYAj1kTgVsT76yahNgkj/s1600/customCFBLog.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Courier New, Courier, monospace;"><img border="0" height="124" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwEJMrAe8j64vRMyLdduexM4vO3L5jtnkvBfDSqsyr_z1drsTtIzuh73cBqV3GSjOmkxGjTlURPm3djCkQgNWwvw8x81ecA0W7lMTc25PFpQwXqn26H_EgusdSMYAj1kTgVsT76yahNgkj/s320/customCFBLog.jpg" width="560px;" /></span></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<ul>
<li><span style="font-family: Courier New, Courier, monospace; text-align: left;">Now create a JS file under contentfinder folder. </span></li>
</ul>
<div class="gist-code-snippet">
<script src="https://gist.github.com/ankit-gubrani/e6531b2ebe91904ddda5.js"></script>
</div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Above code creates a new content finder tab with name mentioned as <b>tabTip</b> property, setting the <b>ranking</b> as 1 makes this tab to appear on #1 position in the content finder,<b> iconCls</b> property sets the class on the tab and displays the icon on the tab. The most important part is creating a result box using <b>CQ.wcm.ContentFinderTab.getResultsBoxConfig</b> to display the result fetched from <b>URL</b> mentioned. </span><br />
<span style="font-family: Courier New, Courier, monospace;">After creating a similar JS file there will be new tab added in the content finder as shown here : </span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUuTL2xmgVK6bsDxQqOuE7M1gEEjXUIKkpsyzTiUTPJhJOHd7DycizZn7uBGfZySFFpclpicLEJn3mNvYNzSl6j1WBprJF_KT-8x-avHemtf8H5d3uZijskEW18cEqLeoqU3yIHycK2S6v/s1600/CustomCFBlog2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUuTL2xmgVK6bsDxQqOuE7M1gEEjXUIKkpsyzTiUTPJhJOHd7DycizZn7uBGfZySFFpclpicLEJn3mNvYNzSl6j1WBprJF_KT-8x-avHemtf8H5d3uZijskEW18cEqLeoqU3yIHycK2S6v/s320/CustomCFBlog2.jpg" width="560px;" /></a></div>
<br /></div>
<span style="font-family: 'Courier New', Courier, monospace; font-style: italic; font-weight: bold; line-height: 19.2000007629395px; white-space: pre-wrap;">Here is the link to github repository : </span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 19.2000007629395px; white-space: pre-wrap;"><b><i><a href="https://github.com/ankit-gubrani/Codebrains/commit/c4ad0d515961b9a274749672399270f22dc8b49a" target="_blank">https://github.com/ankit-gubrani/Codebrains</a></i></b></span></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;"><br /></span></span></div>
</div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 15.6000003814697px;"><br /></span></span></div>
</div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-9047160190239316382015-07-07T03:00:00.000-07:002015-07-07T03:08:36.406-07:00Configuring AEM 6.0 with mongoMK<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;">One of the most important feature of AEM 6.0 is introduction of "Apache Jackrabbit Oak" with this new version of AEM. Jackrabbit oak is an effort to enhance the scalability and performance of the backend of the AEM content reporsitory. Oak introduces the micro-kernel for persistence of repository data, there are two micro-kernel implementation supported with oak :</span><br />
<ul style="text-align: left;">
<li><span style="font-family: Courier New, Courier, monospace;">Mongo MK</span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Tar MK</span></li>
</ul>
<b><span style="font-family: Courier New, Courier, monospace;"><u><br /></u></span></b>
<b><span style="font-family: Courier New, Courier, monospace;"><u>Tar MK:</u></span></b><br />
<span style="font-family: Courier New, Courier, monospace;">Tar storage uses tar files for storing the repository content. The content is stored in segments that can be upto 256 MB in size. Segments are immutable which makes it easy to cache frequently accessed segments.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<b><span style="font-family: Courier New, Courier, monospace;"><u>Mongo MK:</u> </span></b><br />
<span style="font-family: Courier New, Courier, monospace;">Mongo storage uses Mongo DB to storing the content of the repository. Mongo MK makes oak repository scalable as mongo DB supports sharding and clustering.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">In this post I will be discussing how to configure Mongo storage or MongoMK with AEM. Here are the set of steps for setting up mongo MK with AEM :</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><u>Setting Up Mongo DB (Ubuntu specific) :</u></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Download the mongo binaries from </span><a href="https://www.mongodb.org/downloads" style="text-decoration: none;"><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">https://www.mongodb.org/downloads</span></a></span></div>
</li>
<li dir="ltr" style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Extract the files from the downloaded archive.</span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> tar -zxvf mongodb-linux-i686-3.0.4-rc0.tgz</span></div>
<ol start="3" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Copy the extracted folder to the location from which MongoDB will run.</span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> mkdir -p /opt/mongodb</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> cp -R -n mongodb-linux-x86_64-ubuntu1404-3.0.3/* /opt/mongodb</span></div>
<ol start="4" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Ensure the location of the binaries is in the PATH variable.</span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span> </span><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">export PATH=/opt/mongodb/bin:$PATH</span></span></div>
<ol start="5" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-style: normal; font-variant: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Run MongoDB :</span><span style="line-height: 1.38; white-space: pre-wrap;">
<b>mongod</b> (run <b>mongod</b> command from termilnal)</span></span></div>
</li>
<li dir="ltr" style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Create the data directory.</span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span> </span><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">mkdir -p /data/db</span></span></div>
<ol start="7" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Set permissions for the data directory.</span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Before running mongod for the first time, ensure that the user </span><br />
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">account running</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">mongod has read and write permissions for the directory.</span></div>
<ol start="8" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Run MongoDB.</span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">mongod</span><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> or </span><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">/opt/mongodb/bin/mongod </span></span></div>
<span style="font-family: Courier New, Courier, monospace;"><b style="font-weight: normal;"><br /></b>
</span><br />
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">I used </span><span style="background-color: transparent; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">Robomongo</span><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> which is a client to access Mongo DB server and </span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> perform the </span></span><span style="font-family: 'Courier New', Courier, monospace; font-weight: bold; line-height: 1.38; white-space: pre-wrap;">manipulations on the mongo DB.</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Courier New, Courier, monospace; font-weight: bold; white-space: pre-wrap;"><br /></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Courier New, Courier, monospace; font-weight: bold; white-space: pre-wrap;"><u>AEM Setup</u></span></div>
<ol style="text-align: left;">
<li style="line-height: 1.38; white-space: pre-wrap;"><span style="font-family: Courier New, Courier, monospace; line-height: 1.38;">Unpack AEM by running the following command:
<div style="text-indent: 0px;">
<span style="font-weight: bold; line-height: 1.38; text-indent: 36pt;">java –jar cq-quickstart-6.0.0.jar -unpack</span></div>
</span></li>
<li style="line-height: 1.38; white-space: pre-wrap;"><span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 1.38; vertical-align: baseline;">Create a folder named </span><span style="font-weight: bold; line-height: 1.38; vertical-align: baseline;">crx-quickstart\install</span><span style="line-height: 1.38; vertical-align: baseline;"> in the installation directory.</span></span></li>
<li style="line-height: 1.38; white-space: pre-wrap;"><span style="font-family: Courier New, Courier, monospace;"><span style="line-height: 1.38;">Configure the node store by creating a configuration file with the name of the configuration you want to use in the crx-quickstart\install directory.
</span><span style="line-height: 1.38; vertical-align: baseline;">The Document Node Store (which is the basis for AEM's MongoDB storage </span><span style="line-height: 1.38; text-indent: 36pt;">implementation) uses a file </span><span style="line-height: 1.38; text-indent: 36pt;">called org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.cfg.
</span><span style="text-indent: 36pt; vertical-align: baseline;">Here is the sample </span><span style="font-style: italic; font-weight: bold; text-indent: 36pt; vertical-align: baseline;">DocumentNodeStoreService.cfg</span><span style="text-indent: 36pt; vertical-align: baseline;"> file :</span></span></li>
<script src="https://gist.github.com/ankit-gubrani/ae9053b4ce69a5849b23.js"></script>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span class="Apple-tab-span" style="line-height: 1.38; white-space: pre;"> </span></span></div>
<ol start="12" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Courier New, Courier, monospace; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Start the AEM 6 jar with a MongoDB storage backend by running:</span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
</div>
<div dir="ltr" style="margin-left: 0pt;">
<table style="border-collapse: collapse; border: none;"><colgroup><col width="618"></col></colgroup><tbody>
<tr style="height: 0px;"><td style="border-bottom: solid #000000 0px; border-left: solid #000000 0px; border-right: solid #000000 0px; border-top: solid #000000 0px; padding: 0px 7px 0px 7px; vertical-align: top;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">java -jar cq-quickstart-6.0.0.jar -r crx3,crx3mongo</span></span><br />
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></span>
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></span>
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></span>
<span style="font-family: Courier New, Courier, monospace;"><span style="background-color: transparent; font-style: italic; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Here is the link to github repository : <a href="https://github.com/ankit-gubrani/Codebrains" target="_blank">https://github.com/ankit-gubrani/Codebrains</a></span></span></div>
</td></tr>
<tr style="height: 0px;"><td style="border-bottom: solid #000000 0px; border-left: solid #000000 0px; border-right: solid #000000 0px; border-top: solid #000000 0px; padding: 0px 7px 0px 7px; vertical-align: top;"><span style="font-family: Courier New, Courier, monospace;"><br /></span></td></tr>
</tbody></table>
</div>
</div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-69724186809443105412015-07-01T10:41:00.000-07:002015-07-01T21:10:51.477-07:00Configuring AEM 6.0 with remote SOLR server<div dir="ltr" style="text-align: left;" trbidi="on">
Apache Jackrabbit Oak is the next generation repository implementation which powers in AEM 6.0. Oak does not index content by default to offer improved performance. Every JCR query will traverse whole repository, impacting the performance of the repository. Custom indexes need to be created to reduce node traversal with for every query in the repository.<br />
<h3 style="text-align: left;">
<u>The SOLR index</u></h3>
<div>
<u><br /></u></div>
<div style="text-align: left;">
There are multiple options to index data in AEM, in this post we will be covering "The SOLR index".The Solr index in oak can be used for any type of JCR query. The integration in AEM 6.0 happens at repository level so Solr is one of the possible indexes that can be used in oak. </div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
Here are the steps for configuring AEM 6.0 with remote SOLR server : </div>
<div style="text-align: left;">
<br /></div>
<ol style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">First extract the Solr zip prior to version 5.0 (I used solr 4.9.1) in folder named Solr .</span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<ol start="2" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">This solr folder should be parallel to crxfolder folder AEM installation directory, i.e inside Author directory.</span></div>
</li>
</ol>
<div style="text-align: left;">
<b id="docs-internal-guid-fbc0b05e-4aa0-1920-211f-eeb5b818e256" style="font-weight: normal;"><br /></b></div>
<ol start="3" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Copy the example folder and paste in the same directory (Solr), rename the folder as node1 (any name). </span></div>
</li>
</ol>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<ol start="4" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Repeat step 3, just rename the folder as node2.</span></div>
</li>
</ol>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<ol start="5" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Create a folder in node1 and node2 with name cfg. Inside this folder paste solr.xml, zoo.cfg and oak core config folder. (I used default core collection1 in my case)</span></div>
</li>
</ol>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<ol start="6" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Now start the first solr shard with zookeeper configured. Run the following command from node1 directory : </span></div>
</li>
</ol>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">java -Xmx256m -Dbootstrap_confdir=./cfg/oak/conf </span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">-Dcollection.configName=myconf -DzkRun -DnumShards=2 -jar start.jar</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<ol start="7" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Now start the second shard by running the following command from node2 directory : </span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<b><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">java -Xmx256m -Djetty.port=7574 -DzkHost=</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: italic; font-variant: normal; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;">temphost.ig.com</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: italic; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">:9983 -jar </span></b><b style="line-height: 1.2; text-indent: 36pt;"><span style="font-family: Arial; font-size: 14.6666666666667px; font-style: italic; vertical-align: baseline; white-space: pre-wrap;">start.jar</span></b></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Catch here is Solrcloudserver does not use the URL for initialization, rather it uses the connection string. Connnection string is same we pass with the zkHost parameter. In my case it was not working if I passed value as </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">localhost:9983</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">. I had to create a custom host name and the pass the same connection string while configuring with AEM.</span></div>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<ol start="8" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Once second shard is up and running, check if it both the shards are working or not by accessing the url : </span></div>
</li>
</ol>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-left: 36pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: italic; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">http://localhost:8983/solr/#/~cloud</span></div>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<ol start="9" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Now open the </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Configuration Manager console </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">(localhost:3502/system/console/configMgr), and set the value of </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Oak Solr server provider</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> as </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Remote Solr </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">from drop down.</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
</li>
</ol>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<ol start="10" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Now edit</span><span style="font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Oak Solr remote server configuration </span><span style="font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">and set the values as :</span></div>
</li>
</ol>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="font-family: 'Times New Roman'; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Solr HTTP URL </span><span style="font-family: 'Times New Roman'; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: 'Times New Roman'; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: http://localhost:8983/solr/ </span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">ZooKeeper host</span><span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: http://temphost.ig.com:9983</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Solr collection</span><span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: collection1</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">No. of collection shards</span><span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: 2</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Replication factor</span><span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Verdana; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: 1</span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="font-family: 'Times New Roman'; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Solr configuration directory : /home/codebrains/CQ_Instance/Author/solr/node1/cfg/oak</span></div>
<div style="text-align: left;">
<b style="font-weight: normal;"><br /></b></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: #f5fcfe; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><img alt="solrremoteconfig.png" height="351px;" src="https://lh5.googleusercontent.com/bgQJhJAHSUdXBtLczFAUBqBCJAlN3jLlCFHLSt2hKMCkADaX_SBsno5OeODoC8oRTCC0SAYzmwd_ClHAmdSw6KkstEkM9Vbu0W1qMZPwV0M4fAaDypWguc1ba7l9uTuDfzuKOCo" style="-webkit-transform: rotate(0rad); border: none; transform: rotate(0rad);" width="560px;" /></span><br />
<span style="background-color: #f5fcfe; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><br /></span></div>
<ol start="11" style="margin-bottom: 0pt; margin-top: 0pt;">
<li dir="ltr" style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; list-style-type: decimal; text-decoration: none; vertical-align: baseline;"><div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Now open the CRXDE Lite and create a node under </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">oak:index </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: bold; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">with </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">following properties : </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
</li>
</ol>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: italic; font-variant: normal; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">Name</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: solrindex (String)</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div dir="ltr" style="line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">jcr:primaryType</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: oak:QueryIndexDefinition</span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: italic; font-variant: normal; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">reindex</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: true (Boolean)</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-indent: 36pt;">
<span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: italic; font-variant: normal; font-weight: normal; vertical-align: baseline; white-space: pre-wrap;">async</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">: async</span><span style="background-color: transparent; font-family: Arial; font-size: 14.6666666666667px; font-style: normal; font-variant: normal; font-weight: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span></div>
<div style="text-align: left;">
<span style="font-family: Arial; font-size: 14.6666666666667px; font-style: italic; vertical-align: baseline; white-space: pre-wrap;"> type</span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"> </span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;"><span class="Apple-tab-span" style="white-space: pre;"> </span></span><span style="font-family: Arial; font-size: 14.6666666666667px; vertical-align: baseline; white-space: pre-wrap;">: solr</span></div>
</div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-42098075789831155602015-04-16T00:30:00.000-07:002015-04-16T00:32:45.349-07:00Polling Importer configuration in AEM 6.0<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;">AEM houses a powerful feature which allows user to poll after specified interval, as we discussed in our earlier blog <a href="http://codebrains.blogspot.in/2014/11/feed-importer-in-adobe-cqaem.html" target="_blank">Feed importer in Adobe CQ/AEM</a>. </span><br />
<span style="font-family: Courier New, Courier, monospace;">Its pretty straight forward to create a custom polling importer in AEM all one needs to do is create a <i>polling configuration</i> node with following properties on a <i><u>nt:unstructured</u></i> node : </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgosuj7A5Uc-NTOApRtSK3Uo_fyksWH7QAe09PXOk2NhkZ2nXbp_5clUU8SclfPYBRO2R_hLpfdORqiqSczigbjWYR3Fyg2Eku0qFAO4YHxmtBQ9BfeulT7G0dJ1HIuZtQh5Sgl0-XiR-Mr/s1600/pollingNodeAemBlog.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Courier New, Courier, monospace;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgosuj7A5Uc-NTOApRtSK3Uo_fyksWH7QAe09PXOk2NhkZ2nXbp_5clUU8SclfPYBRO2R_hLpfdORqiqSczigbjWYR3Fyg2Eku0qFAO4YHxmtBQ9BfeulT7G0dJ1HIuZtQh5Sgl0-XiR-Mr/s1600/pollingNodeAemBlog.png" height="96" width="580" /></span></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span><span style="font-family: 'Courier New', Courier, monospace;">While with AEM 5.6 it is fine to create such polling node any where in CRX, polling importer will work fine but with AEM 6.0 polling works only if polling configuration node is created either </span><span style="font-family: 'Courier New', Courier, monospace;">under</span><span style="font-family: 'Courier New', Courier, monospace;"> <i>/etc</i> or <i>/content</i> hierarchy.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">I was stuck in similar problem when my project that was imported from AEM 5.6 to AEM 6.0. As we were creating the polling config nodes under </span><i style="font-family: 'Courier New', Courier, monospace;">/var</i><span style="font-family: 'Courier New', Courier, monospace;"> hierarchy and it was not initiating the polling our service.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span><span style="font-family: Courier New, Courier, monospace;">AEM 6.0 allows users to configure path under which if polling configuration nodes can be created, polling importer work fine i.e. after configuring the Day CQ Polling importer service one can create polling node in the specified path and polling still works fine.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir5P5fi5XonRKtquNZMZQegy56OkrHfUj3RhG4BcE3uufs4dc2WQdswMKDZ71QIs4N5x2xy_16N7BwY_sfVd7g6pkrsJYqDnc2eQAGD1RCdv4IYAsQ7la5WJwKn6FTDvuSWgKm25_ltItB/s1600/customconfig.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir5P5fi5XonRKtquNZMZQegy56OkrHfUj3RhG4BcE3uufs4dc2WQdswMKDZ71QIs4N5x2xy_16N7BwY_sfVd7g6pkrsJYqDnc2eQAGD1RCdv4IYAsQ7la5WJwKn6FTDvuSWgKm25_ltItB/s1600/customconfig.png" height="180" width="580" /></a><span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Or one create a sling:OsgiConfig with name as PID of the Polling importer service and add the allowed path property. As follows :</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="gist">
<script src="https://gist.github.com/ankit-gubrani/c366eee700ac56c5c607.js"></script>
</div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
</div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-50635022438198280442015-03-12T11:44:00.002-07:002015-03-12T11:45:57.875-07:00Requesting AEM Component via AJAX<div dir="ltr" style="text-align: left;" trbidi="on">
<b><span style="font-family: Courier New, Courier, monospace; font-size: x-large;">Why?</span></b><br />
<span style="font-family: Courier New, Courier, monospace;">In AEM pages are created in modular fashion and this modularity is achieved using components. But we often come across a situation where we want a specific component to be reloaded and not the complete page but mostly <b><span style="color: #9fc5e8;">dispatcher</span></b> is the main reason for loading a component via AJAX.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">As dispatcher caches component's output html due to which dynamicity of a component becomes questionable. For instance if we want a component to show unique results with each request. Loading component via AJAX is one way out for handling such scenarios.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzGW3GI8PKPjjMMbJi4-6rEZx-DsLNY7OX7FBYJGMZqko-Sy88xJRTFq7L-_XenZXJUR25chNuvOzPW5oojftb2A0lPuvQEd1lCWv4jghN13xFBrrSbbQopc-gdT5Gmawlyyi3-BK-vppO/s1600/AjaxBlog_1.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzGW3GI8PKPjjMMbJi4-6rEZx-DsLNY7OX7FBYJGMZqko-Sy88xJRTFq7L-_XenZXJUR25chNuvOzPW5oojftb2A0lPuvQEd1lCWv4jghN13xFBrrSbbQopc-gdT5Gmawlyyi3-BK-vppO/s1600/AjaxBlog_1.jpg" height="204" width="580" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Sample AJAXified component</td></tr>
</tbody></table>
<br />
<b><span style="font-family: Courier New, Courier, monospace; font-size: x-large;">How?</span></b><br />
<span style="font-family: Courier New, Courier, monospace;">To request a component via AJAX we will be using a Sling trick. In this trick we will request the URL to the component node then Sling resolution comes into the picture and it look for <b><span style="color: #9fc5e8;">sling:resourceType</span></b> property ,executes the script at given path & sends final HTML response.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">It is quite straight forward to implement this approach. We need to create a <b><span style="color: #9fc5e8;">cq:component</span></b> and the <b><span style="color: #9fc5e8;">Javascript code</span></b> for making a AJAX request. As we would want our component to give unique response each time, we can either use a <b><i><span style="color: #9fc5e8;">selector</span></i></b> or <i style="font-weight: bold;"><span style="color: #9fc5e8;">query parameters</span> </i>and then give response accordingly.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Code snippet below gives an example of how to request the desired component via ajax and show the latest result.</span><br />
<br />
<div class="gist-code-snippet">
<script src="https://gist.github.com/ankit-gubrani/dda272e0287291a9e797.js"></script>
</div>
<span style="font-family: Courier New, Courier, monospace;">But for requesting a component's node we need to store the path on which we would be requesting, we will have to store that on our page itself in the page's DOM. Like shown below:</span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="gist-code-snippet">
<script src="https://gist.github.com/ankit-gubrani/e2ddf428033dcbacef21.js"></script>
</div>
<span style="font-family: Courier New, Courier, monospace;">
Now we just need to read the path of the component node and request for component to reloaded via AJAX. Here is the sample jQuery method for how to achive this.</span><br />
<div class="gist-code-snippet">
<script src="https://gist.github.com/ankit-gubrani/a425a34321234afca1d0.js"></script>
</div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span><span style="font-family: Courier New, Courier, monospace;">I have created a demo component which is loaded on the page via AJAX. To use it one need to drop <b><span style="color: #9fc5e8;">AJAX Demo Component</span> </b>inside parsys of <b><span style="color: #9fc5e8;">AJAX Demo Warpper component</span></b> and on press of reload button it reloads the component via AJAX.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Here is the link for code repository for a sample component that is reloaded via AJAX : <a href="https://github.com/ankit-gubrani/Codebrains/tree/ajax-components" target="_blank">Requesting cq:components via AJAX</a></span><br />
<br /></div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-18840630793188593412015-01-20T20:33:00.001-08:002015-01-20T21:08:02.522-08:00OSGI : Creating Factory configuration in CQ <div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;">AEM houses a powerful open source framework in its technology </span><span style="font-family: 'Courier New', Courier, monospace;">stack</span><span style="font-family: 'Courier New', Courier, monospace;">, </span><b style="font-family: 'Courier New', Courier, monospace;"><i>Apache Felix</i></b><span style="font-family: 'Courier New', Courier, monospace;">. Felix is a open source implementation of OSGi. OSGi provides a way to manage bundles and their configurations.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">OSGi provides a way to configure services and modify those configurations on the run-time. But apart from this there is a another powerful feature that OSGi provides that is : ability to create <i style="font-weight: bold;">Factory Configurations. Factory Configurations </i>is a way to create a single service, and bind multiple configurations to it & then consume those configurations from different classes/Services. You all might have used Logger service provided by CQ out of the box, logger is an example of factory configuration service. </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdp0KiAHMYlKyFb5Y6uBU2HFUcGXufjJcTSq6_zt6c5BZT9UqN1dHddOvPVG7dYSM96TjL6fUxDFGhgam926YGp1vKlPihpyBIVKmO6YoS6aHMn_7dN6h-G3w2VQ21WpwpSmCzNzJeW0Ni/s1600/FactoryConfig.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdp0KiAHMYlKyFb5Y6uBU2HFUcGXufjJcTSq6_zt6c5BZT9UqN1dHddOvPVG7dYSM96TjL6fUxDFGhgam926YGp1vKlPihpyBIVKmO6YoS6aHMn_7dN6h-G3w2VQ21WpwpSmCzNzJeW0Ni/s1600/FactoryConfig.jpg" height="220" width="580" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Factory Configuration</td></tr>
</tbody></table>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">Here are the steps for how to create factory configuration in CQ.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><i>Step 1:</i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Create a Component/Service class to hold configurations values. This component will act a interface for adding properties of multiple configurations. Key for creating this Component/Service class is that declare this class as a <b><i>configurationFactory</i></b> and pass configuration policy as <i><b>required</b>.</i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="gist-code">
<script src="https://gist.github.com/ankit-gubrani/0780284097e09392256c.js"></script>
</div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><i>Step 2:</i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Create a service to that actually uses the FactoryConfig Component/Service as a interface to allow user to add configuration and accept values of properties. For creating this service we will use <b style="font-style: italic;">dynamic binding </b>of OSGi. We will have to create a collection of FactoryConfig class and <b><i>binding & unbinding</i></b> methods are also required that will add or remove each FactoryConfig object in/from the collections. </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<div style="clear: both;">
</div>
<div class="gist-code">
<script src="https://gist.github.com/ankit-gubrani/6396585b9549c561d39b.js"></script>
</div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Here is the link to code repository for this service : <a href="https://github.com/ankit-gubrani/Codebrains/tree/osgifactoryconfig" target="_blank">OSGi Factory Config</a></span><br />
</div>Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-38748784960666751722014-12-10T22:20:00.000-08:002014-12-10T22:20:59.543-08:00Default vaules with CQ5/AEM component<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;">Attimes we come across a situation while creating Components in CQ/AEM, where we want a default value of some property to be set the moment component is dropped. This can be done via JCR API but there is an easy way that I will cover in this post.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br />
<b>Using cq:template node :</b></span><br />
<span style="font-family: Courier New, Courier, monospace;">
<br />
</span><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbTtyXBSj3FWKhyphenhyphenILyies21KclkfNN-wLTRguR7fTqyJlI1BkCs35fE10NpbGrDK01j85w4_3SgT62DJxDol3Dy6p8njhQkW01KbspZ0WR7q4voY_3xkKCUBc6eFSzJfuKSReZM6fWGNTI/s1600/fileStr.jpg" height="378" style="margin-left: auto; margin-right: auto;" width="400" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">cq:template node</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbTtyXBSj3FWKhyphenhyphenILyies21KclkfNN-wLTRguR7fTqyJlI1BkCs35fE10NpbGrDK01j85w4_3SgT62DJxDol3Dy6p8njhQkW01KbspZ0WR7q4voY_3xkKCUBc6eFSzJfuKSReZM6fWGNTI/s1600/fileStr.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: Courier New, Courier, monospace;"></span></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br />
Simply create a node under component node with <i>name</i> "<b>cq:template</b>" of <i>type</i> "<b>nt:unstructured</b>". </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br />
Now add any property on this node you want to set as default value on the component. <i>Not only properties you can even add node under this node if you want to create a default node under the component node.</i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><i><br /></i></span>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiC6vDBBXhSHigkrok_93a24cYdKRg79smnLeGwTphSxI61m0WUq0SafuLtpQzx8an0468y8DrSbo0OK5GZZgYNAgBgHYlHRM6P2Oag4AlPsgYcnuylPfgNhsNe-mgk3Svdjc7ei_iyKA1j/s1600/defaultCOmponent.jpg" height="106" style="margin-left: auto; margin-right: auto;" width="580" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Component node hierarchy under /apps </td></tr>
</tbody></table>
<span style="font-family: 'Courier New', Courier, monospace;"><b><br /></b></span>
<span style="font-family: 'Courier New', Courier, monospace;"><b>And Its done</b>. Now every time you drop this component on any page, default values will be created under the component node as shown below :</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLHF4xJDSxJNM_hoFwpciQ_M1QyuUIxOpoD7a4dcRol3IUgzZe6lE7S57NXRbfGFOb8C75LErVhubwgib3GYk1jK0GBsXqzdsmdbozJYWb3TD7tN_tebKTTvIUcZcELb9Zb2SJz6tP04qH/s1600/contentView1.jpg" height="114" style="margin-left: auto; margin-right: auto;" width="580" /></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Final node hierarchy under /content</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLHF4xJDSxJNM_hoFwpciQ_M1QyuUIxOpoD7a4dcRol3IUgzZe6lE7S57NXRbfGFOb8C75LErVhubwgib3GYk1jK0GBsXqzdsmdbozJYWb3TD7tN_tebKTTvIUcZcELb9Zb2SJz6tP04qH/s1600/contentView1.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Courier New, Courier, monospace;"></span></a></div>
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">Here is link to code repository for this component : </span><a href="https://github.com/ankit-gubrani/Codebrains/commit/eea7cc35ae9c736e7ac4d39b398a37f9e5939b88" style="font-family: 'Courier New', Courier, monospace;" target="_blank">https://github.com/ankit-gubrani/Codebrains/commit/eea7cc35ae9c736e7ac4d39b398a37f9e5939b88</a><br />
<br /></div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0New Delhi, Delhi, India28.6322444 77.22072379999997328.186321900000003 76.575276799999969 29.0781669 77.866170799999978tag:blogger.com,1999:blog-3002661968176035495.post-17859257432475492672014-11-15T05:47:00.001-08:002014-11-15T06:04:56.239-08:00Feed importer in Adobe CQ/AEM<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;">AEM comes with a pre-installed feature to import feeds into CQ. Feed importer comes with capability to import RSS and Atom feeds.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b>Hey!! Wait before that you must be thinking, <i>what is a feed?</i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><i>Web feed is a way to provide users with updated content. Web feeds are commonly used for news updates as news are the most frequently updating data.</i></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Feed importer is a service to fetch data from feeds or any external source of data on a periodic basis and save data fetched, in the form of CQ page.It polls the specified external data source in given interval.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<h4 style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Here are the steps how to create feed importer in CQ :</span></h4>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Firstly, create a page under which all the imported data will be saved in the form of CQ:Page. All the new pages that will be created under root page will have sling:resourceType property's value same as the root page.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Now once root page is created, create Feed importer :</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Open <i>http://<host>:<port>/etc/miscadmin</i> and go to importers</span><br />
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2bSfN0fhwYDuvilbbtvN318OPaPvhzKAIaBF-lUFLHvPH5QGq-8vD116nLJZxH9SMlcTN9nOiJxdrnOlW_V_XIYKaO8Ahb8s3GElL2xrGpn1eZmWPhvVvIUGiAcK01GvM3VOioRe9KjSs/s1600/ImporterWindow.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Courier New, Courier, monospace;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2bSfN0fhwYDuvilbbtvN318OPaPvhzKAIaBF-lUFLHvPH5QGq-8vD116nLJZxH9SMlcTN9nOiJxdrnOlW_V_XIYKaO8Ahb8s3GElL2xrGpn1eZmWPhvVvIUGiAcK01GvM3VOioRe9KjSs/s1600/ImporterWindow.png" height="348" width="580" /></span></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">And Open the Feed Importer page, it will open a page as shown </span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">below :</span></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNF-wXLLGdFhyphenhyphenmrO1oC9lOUQV8fpN9csPu-j5rOmK7vgDwcwTMB74zyk_zGhGpelOyAKpkBHdsy9BTPG6a8IqetVtgil5cZC1wINGSVkodJ2BBASvHfNxe2EVwFBRKjKutEEc8xqZ30DFT/s1600/FeedImporterWindow.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><span style="font-family: Courier New, Courier, monospace;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNF-wXLLGdFhyphenhyphenmrO1oC9lOUQV8fpN9csPu-j5rOmK7vgDwcwTMB74zyk_zGhGpelOyAKpkBHdsy9BTPG6a8IqetVtgil5cZC1wINGSVkodJ2BBASvHfNxe2EVwFBRKjKutEEc8xqZ30DFT/s1600/FeedImporterWindow.png" height="350" width="580" /></span></a><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-family: Courier New, Courier, monospace;"> Now click on the Add button and complete the dialog as shown below:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga9Wl-U4J2l45Bz_NAQEPqwRHYNdznihEHmY-rA3PUhu_13UvKgq2HUxRmAv-fpzcXiNuJUcsD7TkXUnlcrqYmvd2wNGyIytQKBD3uM80ZDlKWtmzXr8vBolXdN3vj4898AUuURdQQZIxq/s1600/NewImporterConfig.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><span style="font-family: Courier New, Courier, monospace;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEga9Wl-U4J2l45Bz_NAQEPqwRHYNdznihEHmY-rA3PUhu_13UvKgq2HUxRmAv-fpzcXiNuJUcsD7TkXUnlcrqYmvd2wNGyIytQKBD3uM80ZDlKWtmzXr8vBolXdN3vj4898AUuURdQQZIxq/s1600/NewImporterConfig.png" height="444" width="580" /></span></a><br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Here is link for Atom feeds of Codebrians blog :</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><b><i><a href="http://codebrains.blogspot.com/feeds/posts/default" target="_blank">http://codebrains.blogspot.com/feeds/posts/default</a></i></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">The moment </span><span style="font-family: 'Courier New', Courier, monospace;">OK is</span><span style="font-family: 'Courier New', Courier, monospace;"> clicked a Polling configuration node is created, that will poll given feed URL and fetches new data back to CQ then creates pages under given hierarchy.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Here is the one of the auto-create page:</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx7FadXlDZqPEawL9AeVy8d9ZyZkX9TiQ-GWZMLU7uzM27kPdorFaCoXugykzbqQMpWwAxfmcDqFC6gwyDKDDDWW6CsYlksk8NW91ztVjxYsil9HbPz6WZmaJxQPOM9Kq-1qoFiPupXJCq/s1600/FinalPage1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Courier New, Courier, monospace;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx7FadXlDZqPEawL9AeVy8d9ZyZkX9TiQ-GWZMLU7uzM27kPdorFaCoXugykzbqQMpWwAxfmcDqFC6gwyDKDDDWW6CsYlksk8NW91ztVjxYsil9HbPz6WZmaJxQPOM9Kq-1qoFiPupXJCq/s1600/FinalPage1.png" height="348" width="580" /></span></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>Here is the Link to Github repository of Codebrains to refer the code : </b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b><a href="https://github.com/ankit-gubrani/Codebrains" target="_blank">https://github.com/ankit-gubrani/Codebrains</a></b></span><br />
<br /></div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-71462098815466754462014-11-12T04:28:00.001-08:002014-11-12T10:54:28.390-08:00Populate dropdown in CQ5 dialog using Servlet<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;">Dropdowns in CQ5 are easy to create and use, all that needs to be done is create a node with name options and primaryType as cq:widgetcollections and sub-nodes with options.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">But problems comes in when the dropdowns with dynamic data or options is to be created. So, in this blog you will see how to address the problem of populating dropdown dynamically.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><i>Firstly</i>, create a source from which data is to be fetched in our case we have registered a <i>Servlet in OSGI at path</i> "<i>/bin/codebrains.json</i>" which returns a <i>JSON object as</i> :</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace; white-space: pre-wrap;"><b>{"<i>root</i>":[{"text":"CodeBrains_Text_0","value":"CodeBrains_Value_0"},{"text":"CodeBrains_Text_1","value":"CodeBrains_Value_1"},{"text":"CodeBrains_Text_2","value":"CodeBrains_Value_2"},{"text":"CodeBrains_Text_3","value":"CodeBrains_Value_3"},{"text":"CodeBrains_Text_4","value":"CodeBrains_Value_4"}]}</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<i><span style="font-family: Courier New, Courier, monospace;">Once your servlet is ready and it gives response in the desired format, now browse to Dropdown widget node and add properties that are shown below :</span></i><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqeRkMDopMarM9Nx7afWTHz0QLvvu5xLlvs8MsTodVkmPR01fEbvWvy3_Epy4KHaSU0uZbqE7gg5_Y69HqAiuOYipB_jICGzs0mvlUyGbmuySpj5EQJS1UU8YBxZn40tEv2-usqr5Kq8oj/s1600/Dropdown4.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Courier New, Courier, monospace;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqeRkMDopMarM9Nx7afWTHz0QLvvu5xLlvs8MsTodVkmPR01fEbvWvy3_Epy4KHaSU0uZbqE7gg5_Y69HqAiuOYipB_jICGzs0mvlUyGbmuySpj5EQJS1UU8YBxZn40tEv2-usqr5Kq8oj/s1600/Dropdown4.jpg" width="580" /></span></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span><span style="font-family: Courier New, Courier, monospace;">Add following properties on the node :</span><br />
<ul style="text-align: left;">
<li><span style="font-family: Courier New, Courier, monospace;"><b>xtype (Required)</b> : <i>selection</i></span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><b>type</b> : <i>select</i></span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><b>options </b>(Optional but required if data is to be fetched from servlet) : <path-of-the-servlet> [<i>Value of this property should be path of servlet which will serve the JSON data to be populated in the combo-box</i>]. In our case its value should be "<i>/bin/codebrains.json</i>" as it the path at which servlet is registered in OSGI. </span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><b>optionsRoot</b> (Optional): [<i>Name of the property that contains options array. Use "." or dot-annotation to get till the property that contains options array.</i> ] In our case its value should be "root" as root property of JSON object contains the Array.</span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><b>optionsTextField </b>(Optional): [<i>Name of the field for the options text. This property is used if options object does not contains Text property which is read by default.</i> ] </span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><b>optionsValueField</b> (Optional) : [<i>Name of the field for the options value. This property is used if options object does not contains Value property which is read by default. </i>] (Optional)</span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><b>allowBlank</b> (Optional) : [<i>This property should have boolean value and is used to make any field mandatory. If set false that widget becomes mandatory cannot be set blank.</i> ]</span></li>
</ul>
<div>
<br /></div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjTeyh2ja3J8GtjS48P-ZRJlLzdKslfzRR2OuGYYwIlsidPry16bB0KzoOdiwTzVkeEecBb2ULq2CY1oUkMdfGq08PwKR4-Ylig2Ie111r0RkO-2o0euH1iDsaO1UlpA-SgAZ320D-v9UB/s1600/DialogF.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" height="444" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjTeyh2ja3J8GtjS48P-ZRJlLzdKslfzRR2OuGYYwIlsidPry16bB0KzoOdiwTzVkeEecBb2ULq2CY1oUkMdfGq08PwKR4-Ylig2Ie111r0RkO-2o0euH1iDsaO1UlpA-SgAZ320D-v9UB/s640/DialogF.jpg" width="580" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<span style="font-family: Courier New, Courier, monospace;"><b>Here is the Link to Github repository of Codebrains to refer the code : </b></span><br />
<a href="https://github.com/ankit-gubrani/Codebrains" target="_blank"><span style="font-family: Courier New, Courier, monospace;"><b>https://github.com/ankit-gubrani/Codebrains</b></span></a></div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-3230011975506193262014-11-09T04:50:00.002-08:002014-11-09T04:52:52.673-08:00How to reduce file file size of a image using GIMP ?<div dir="ltr" style="text-align: left;" trbidi="on">
<h4 style="text-align: justify;">
<span style="font-family: Courier New, Courier, monospace;">
Does bulky sized images eats up significant amount of space of your disk ? Or such big file size images becomes a barrier to share these images ? </span></h4>
<div>
<span style="font-family: Courier New, Courier, monospace;">Here is the solution for you to reduce the file size of a image using GIMP. </span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">There are two ways by which size of a image can be controlled : </span></div>
<div>
<ol style="text-align: left;">
<li><span style="font-family: Courier New, Courier, monospace;">First by <i><b>Scaling the image i.e </b>resizing the image.</i></span></li>
<li><span style="font-family: Courier New, Courier, monospace;">Second <b><i>Compressing an image i.e</i></b> <i>image compression means reducing the size of graphics file.</i></span></li>
</ol>
<div>
<h3 style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><u><i>Resizing the Image(Solution 1)</i></u> :</span></h3>
</div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">Open up the image you want to reduce size of. Then form Scale menu select Scale Image option to open Scale Image Dialog. Same dialog can be opened up by right clicking on the image → image → Scale Image.</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMYXFkBe6NrvZx4LYc6BlcrWNmm1XOFI267fjsJJ4MnsZnqcHHdZVAR2ky18rvv4Ev6rCPOPcwSqyzGg8GSHGUtdJck1JIy7azRE6m7s8KV0ePG1vlZSh5sAnDw0E1M0p4DDuDwkZPDeIK/s1600/2014-11-09-35_1366x768.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Courier New, Courier, monospace;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiMYXFkBe6NrvZx4LYc6BlcrWNmm1XOFI267fjsJJ4MnsZnqcHHdZVAR2ky18rvv4Ev6rCPOPcwSqyzGg8GSHGUtdJck1JIy7azRE6m7s8KV0ePG1vlZSh5sAnDw0E1M0p4DDuDwkZPDeIK/s1600/2014-11-09-35_1366x768.jpg" height="353" width="580" /></span></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">This will open the Scale Image dialog. In the width field of Scale Image dialog and hit tab height will be calculated automatically. Now this image is scaled and size of the image will be reduced on saving. </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0X_a2wczr-0dBwY8ZiBcU67TK3PLNwasSS0v42m4bhQC9nwBCWj2ENW_SVSZv_2qa8HhodOMU0JAF4kTTeup-6ZwzX6HbNwcLtzbzkz-wcmtIu7SKmjDJm0PlqPSCwL6dV8XgxMDGEyuK/s1600/scrnShot2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><span style="font-family: Courier New, Courier, monospace;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0X_a2wczr-0dBwY8ZiBcU67TK3PLNwasSS0v42m4bhQC9nwBCWj2ENW_SVSZv_2qa8HhodOMU0JAF4kTTeup-6ZwzX6HbNwcLtzbzkz-wcmtIu7SKmjDJm0PlqPSCwL6dV8XgxMDGEyuK/s1600/scrnShot2.png" height="354" width="580" /></span></a></div>
<div>
</div>
<div>
<h3 style="text-align: left;">
<i><span style="font-family: Courier New, Courier, monospace;"><u>Compressing The Image(Solution 2)</u> :</span></i></h3>
</div>
</div>
<div>
<i><span style="font-family: Courier New, Courier, monospace;"><br /></span></i></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">This is a easier way to reduce the image. All you need to do is, open any image in GIMP. Then go to file → Save As. This will open the Save image dialog</span></div>
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0b5GRTTYzqG0j7eiHLD2z6_C9-FZNBBieCkBT3ErT-zHkiIWjUtNfpQH7AMlY0c6eE345uURY6NOikruqlSdsmx0ad0k0h730Kx2kHfXZbZoPD_6DgmlJm2jDn42w_Gp5USPTK_Xue0NK/s1600/SaveImgDialog.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><span style="font-family: Courier New, Courier, monospace;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0b5GRTTYzqG0j7eiHLD2z6_C9-FZNBBieCkBT3ErT-zHkiIWjUtNfpQH7AMlY0c6eE345uURY6NOikruqlSdsmx0ad0k0h730Kx2kHfXZbZoPD_6DgmlJm2jDn42w_Gp5USPTK_Xue0NK/s1600/SaveImgDialog.png" height="353" width="580" /></span></a></div>
<div>
</div>
<span style="font-family: Courier New, Courier, monospace;">On clicking Save another dialog will pop up that gives user an option to provide quality of the image. Higher the quality, bigger will be the size of the image.</span><br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQrIA3D_oHr2X5X8uGEyW6IhpS4WZykHagJYkOmFAaUgsPSEk4carl_iYg3dfxkA4Y5jviyVzP1NEqeawd65wXHigHcFJzUeHPWXMF2eKNrd8ZLIB3gT9ePmqJ6W6xfMvUdB4_xATb5MS7/s1600/quality.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQrIA3D_oHr2X5X8uGEyW6IhpS4WZykHagJYkOmFAaUgsPSEk4carl_iYg3dfxkA4Y5jviyVzP1NEqeawd65wXHigHcFJzUeHPWXMF2eKNrd8ZLIB3gT9ePmqJ6W6xfMvUdB4_xATb5MS7/s1600/quality.png" height="354" width="580" /></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<b style="font-family: 'Courier New', Courier, monospace;"><span style="color: #eeeeee;">Your comments and suggestions are welcome.</span></b></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-53727749941868467622014-10-22T09:23:00.000-07:002014-10-22T09:24:57.537-07:00AEM Multifield with different widgets<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;">Multifield widget in AEM was introduced to allow authors to enter any number of values they want and multifield serves its purpose pretty well. But multifield widget out of the box provides only textbox to take input from author. And at times we are in a situation where we want multifield with different widget for eg pathfield or a textarea or datefield. </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">In this article we will see <b>how to create or use multifield with different widgets or Xtypes</b>.</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWmiy0ApmKHN8ANnkN1OJkPqetdebkCPhv79z4uegUIlomgi423OTT92Pp1NamkL-jA8uELVxTEqVZJVG3Doj3lmHjHVdtpQ8_ZWF6XN_gISd8R0C9Ui2pFQzyf4XNdDPuoE27N-orfmm1/s1600/defaultMultifield.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgWmiy0ApmKHN8ANnkN1OJkPqetdebkCPhv79z4uegUIlomgi423OTT92Pp1NamkL-jA8uELVxTEqVZJVG3Doj3lmHjHVdtpQ8_ZWF6XN_gISd8R0C9Ui2pFQzyf4XNdDPuoE27N-orfmm1/s1600/defaultMultifield.jpg" height="233" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>Default Multifield widget</b></td></tr>
</tbody></table>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Solution : </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Creating a multifield with custom xtype or widget is a two step process. </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Step 1 : Create a multifield widget i.e create a new widget with xtype multifield. But this will create multi-type with only text field for input as shown above. </span><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ3D090QJb6VgsekYlvULVlq6sSYipJXIfJ3VPgMztBLXWy8P6-oxXNvT2awnZr3UAsXywbtqcS4q8fVTZaXhvyDACi0MRoQ65fdSglzigL_q_hWYp0Lbt6d_8eBySt0fqRk3C4a_0Mijb/s1600/customdialog.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ3D090QJb6VgsekYlvULVlq6sSYipJXIfJ3VPgMztBLXWy8P6-oxXNvT2awnZr3UAsXywbtqcS4q8fVTZaXhvyDACi0MRoQ65fdSglzigL_q_hWYp0Lbt6d_8eBySt0fqRk3C4a_0Mijb/s1600/customdialog.jpg" height="186" width="590" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>FieldConfig node</b></td></tr>
</tbody></table>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><br /></span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Step 2 : create another widget with name fieldConfig and add value of xtype property as whatever widget you want in multifield, in this example we have used pathField. </span><br />
<br />
<div style="text-align: left;">
</div>
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwweBBDdzRcLs8-OKxm-4_H3vz_e62Xhv4OWBCnp1s75fdeYAp9p8Rnh_-QpPcKpxHtkouWMR-0_Z78k6MOmduHkcsxRjQ-ZmB38RtyBZdvoVzGR84zp3bbTgSlwEdfC14Ctd-N_cYfuYU/s1600/multipath.jpg" imageanchor="1" style="clear: left; display: inline !important; margin-bottom: 1em; margin-left: auto; margin-right: auto; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwweBBDdzRcLs8-OKxm-4_H3vz_e62Xhv4OWBCnp1s75fdeYAp9p8Rnh_-QpPcKpxHtkouWMR-0_Z78k6MOmduHkcsxRjQ-ZmB38RtyBZdvoVzGR84zp3bbTgSlwEdfC14Ctd-N_cYfuYU/s1600/multipath.jpg" height="170" width="250" /></a></td>
<td style="width: 25px;"></td>
<td style="width: 25px;"></td>
<td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid6r2S4fUHxNH-8qvF7fwrkZTg4AwlAeHDf6hLGJqBZxaDC56JlUyo38Cqh9zpAmBv-_cED1LhzT1Zr2QJyGnRO4CPXqLnquM6wBoeJAPA9jMgQFn0-0bdS65FBmK0RpPE3qUHsBKu4Aq3/s1600/datemulti.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid6r2S4fUHxNH-8qvF7fwrkZTg4AwlAeHDf6hLGJqBZxaDC56JlUyo38Cqh9zpAmBv-_cED1LhzT1Zr2QJyGnRO4CPXqLnquM6wBoeJAPA9jMgQFn0-0bdS65FBmK0RpPE3qUHsBKu4Aq3/s1600/datemulti.jpg" height="170" width="250" /></a> </td></tr>
<tr><td class="tr-caption" style="text-align: center;"><b>Multifield with pathfield as xtype</b></td>
<td style="width: 25px;"></td>
<td style="width: 25px;"></td>
<td class="tr-caption" style="text-align: center;"><b>Multifield with Datefield as xtype</b></td></tr>
</tbody></table>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-family: Courier New, Courier, monospace;">The values that are stored can be accessed the same ways we access in a values of default mutifield widget. </span><br />
<div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<span style="font-family: Courier New, Courier, monospace;">For reference, here is the <a href="https://github.com/ankit-gubrani/Codebrains/tree/master/content/src/main/content/jcr_root/apps/codebrains/components/content">Link</a> for the demo Multi-field component : </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><a href="https://github.com/ankit-gubrani/Codebrains/tree/master/content/src/main/content/jcr_root/apps/codebrains/components/content/multifieldDemo">https://github.com/ankit-gubrani/Codebrains/tree/master/content/src/main/content/jcr_root/apps/codebrains/components/content/multifieldDemo</a> </span><br />
<br /></div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-53454965160019755712014-08-04T06:14:00.000-07:002014-08-04T06:27:07.879-07:00AEM Project Setup using Maven<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">This article focuses on how to setup a AEM/CQ project using Maven and explaining the basic structure of AEM projects. </span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Lets start with a brief about <b>APACHE MAVEN</b> :</span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><b>Maven</b> is a build automation tool that helps managing the builds of the projects and their dependencies (jar files required). It is based on the concept of POM (Project Object Model). There are numerous number of maven plugins available over the internet, each of which fulfills a different purpose.As we are here for AEM Project setup we won't cover anything more about maven here.</span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace;">Now let us see the folder structure of a AEM Project which you get to see in CRXDE Lite :</span></div>
<div style="text-align: left;">
</div>
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif; line-height: 22.399999618530273px;">/apps</span><span style="font-family: Courier New, Courier, monospace; line-height: 22.399999618530273px;"> : Top level folder whatever you code will be stored in this folder.</span></span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif; line-height: 22.399999618530273px;">/apps/[YOUR-APP-FOLDER]</span><span style="font-family: Courier New, Courier, monospace; line-height: 22.399999618530273px;"> : Root folder of one out of many projects that you will be creating under apps folder.</span></span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif; line-height: 22.399999618530273px;">/apps/[YOUR-APP-FOLDER]/components</span><span style="font-family: Courier New, Courier, monospace; line-height: 22.399999618530273px;"> : Folder that contains all the components and their respective JSPs.</span></span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif; line-height: 22.399999618530273px;">/apps/[YOUR-APP-FOLDER]/templates</span><span style="font-family: Courier New, Courier, monospace; line-height: 22.399999618530273px;"> : Folder that contains all the templates that you will be creating, which points to respective page component.</span></span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif; line-height: 22.399999618530273px;">/apps/[YOUR-APP-FOLDER]/install</span><span style="font-family: Courier New, Courier, monospace; line-height: 22.399999618530273px;"> : Folder that contains bundle of your project.</span></span></li>
<li><span style="font-family: Verdana, sans-serif; font-size: x-small; line-height: 22.399999618530273px;">/apps/[YOUR-APP-FOLDER]/config</span><span style="font-family: Courier New, Courier, monospace; font-size: x-small; line-height: 22.399999618530273px;"> : Folder that stored configuration specific to this project.</span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif; line-height: 22.399999618530273px;">/etc/design//[APP-DESIGN-PAGE]</span><span style="font-family: Courier New, Courier, monospace; line-height: 22.399999618530273px;"> : Design page of your application that stores all clientlibs (JS and CSS) and other static resources as well.</span></span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif; line-height: 22.399999618530273px;">/content/dam/[YOUR-APP-DAM-FOLDER]</span><span style="font-family: Courier New, Courier, monospace; line-height: 22.399999618530273px;"> : Folder that contains all the assets of your site.</span></span></li>
</ul>
<ul style="text-align: left;">
<li><span style="font-size: x-small;"><span style="font-family: Verdana, sans-serif; line-height: 22.399999618530273px;">/content/[YOUR-SITE]</span><span style="font-family: Courier New, Courier, monospace; line-height: 22.399999618530273px;"> : Location where site is stored .</span></span></li>
</ul>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><span></span>Before we move forward here are some pre-requisites that should be available on your machine (installed) </span><span style="font-family: 'Courier New', Courier, monospace;">for building AEM</span><span style="font-family: 'Courier New', Courier, monospace;"> project using maven : </span><br />
<br />
<ol style="font-family: 'Courier New', Courier, monospace; text-align: left;"><span>
<li><span style="font-size: 14px; line-height: 22.399999618530273px;">First and foremost would be Apache MAVEN .</span></li>
<li><span style="font-size: 14px; line-height: 22.399999618530273px;">Adobe AEM/CQ running instance.</span></li>
<li><span style="font-size: 14px; line-height: 22.399999618530273px;">Any IDE eg Eclipse , Idea, Netbeans etc(Here we are using Intellij Idea for this example)</span></li>
</span></ol>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;">Link of source code for the demo project created <a href="https://github.com/ankit-gubrani/Codebrains">https://github.com/ankit-gubrani/Codebrains</a></span><br />
<br />
Here are the steps to create AEM Project using maven :</div>
<br />
<div style="font-family: 'Courier New', Courier, monospace;">
<span><span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></span></div>
<span>
</span>
<div style="font-family: 'Courier New', Courier, monospace;">
<span ><span style="font-size: 14px; line-height: 22.399999618530273px;"><b><u>Step 1</u></b> : Create maven project using Adobe's multimodule-content-package-archetype. Using Command prompt go to the directory where you want to create project and run following command :</span></span></div>
<span >
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif; font-size: 14px; line-height: 22.399999618530273px;">mvn archetype:generate -DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/ -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVersion=1.0.2</span></div>
<div>
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;">after this maven will prompt and ask for some information(like groupid, arifactid,version etc), provide that infomation and your project will be created.This will create a multimodule maven project with 2 modules (Bundle and Content)</span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><u><b>Step 2</b></u> : Verify the code if it works fine or not. You can check it by running command :</span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif; font-size: 14px; line-height: 22.399999618530273px;">mvn clean install </span></div>
<div>
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;">if it completes without any error that means project was made successfully.</span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><b><u>Step 3</u></b> : Import the project in any IDE . Here in the example I am using IntelliJ Idea : </span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUoZXOmkhoKSwW8J5dF9uJSrbqc8dB4ay5JoPH7av8Ltnzj09tTOtbde9XCTZgLbdfEmPSpOSiHiw0Fql3aSLbOt2uYiQYkGO9QdCMXroNw7uJVgU_oe7YZ_Snn9ZzkE7sQlpkAovAWl1t/s1600/IDEProjectStr.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUoZXOmkhoKSwW8J5dF9uJSrbqc8dB4ay5JoPH7av8Ltnzj09tTOtbde9XCTZgLbdfEmPSpOSiHiw0Fql3aSLbOt2uYiQYkGO9QdCMXroNw7uJVgU_oe7YZ_Snn9ZzkE7sQlpkAovAWl1t/s1600/IDEProjectStr.jpg" height="356" width="580" /></a></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><b><u>Step 4</u></b> : Now that everything is set in place , import the project in CQ running instance by running command : </span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">mvn clean install -PautoInstallPackage</span><span style="font-family: Courier New, Courier, monospace;"> </span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
but if you are running CQ on different port or if username and passowrd is changed used following cmmand :</div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div>
<span style="font-family: Verdana, sans-serif;">mvn clean install -PautoInstallPackage -Dcrx.port=3502 -Dcrx.username=newuser -Dcrx.password=newpassword</span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<br /></div>
<div style="font-family: 'Courier New', Courier, monospace;">
This will install the project in CQ instance and you can see following folder structure iunder your project : </div>
<div style="font-family: 'Courier New', Courier, monospace;">
<br /></div>
<div class="separator" style="clear: both; font-family: 'Courier New', Courier, monospace; text-align: center;">
<br /></div>
<br />
<div class="separator" style="clear: both; font-family: 'Courier New', Courier, monospace; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5og43N7H1c1ggrRw4D76tU8FFQh8UmfFFpqGvtEwQgVJHEfFQUgMrVBNHCd9egK5yX6wZvdTuc6eTio7MMRQS3bLoSD_HtLw2oyG1iXvuj-Bo-Q0_3wBlZdo3ZiWJa2485ePGVnGOFsyo/s1600/ProjectStrCQ.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5og43N7H1c1ggrRw4D76tU8FFQh8UmfFFpqGvtEwQgVJHEfFQUgMrVBNHCd9egK5yX6wZvdTuc6eTio7MMRQS3bLoSD_HtLw2oyG1iXvuj-Bo-Q0_3wBlZdo3ZiWJa2485ePGVnGOFsyo/s1600/ProjectStrCQ.jpg" height="358" width="580" /></a></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<br /></div>
<div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"> </span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;">And this is it we are done with creating a AEM project using maven build tool. </span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;">Using this you will create a two module maven project. Those modules are :</span></div>
<br />
<ol style="text-align: left;">
<li><span style="font-family: Courier New, Courier, monospace;"><span style="font-size: 14px; line-height: 22.399999618530273px;"><b><u>Content Module</u></b> : This module contains all the code that will pe under apps/[YOUR-APP-PROJECT] or /etc/[DESIGN-PAGE] or /content/[ANY-PAGE] folder.</span></span></li>
<li><span style="font-family: Courier New, Courier, monospace;"><span style="font-size: 14px; line-height: 22.399999618530273px;"><b><u>Bundle Module</u></b> : This module contains all the java files that will be wrapped up into a bundle and will be installed into Feilx.</span></span></li>
</ol>
<br />
<div style="font-family: 'Courier New', Courier, monospace;">
<br /></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<br /></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;">Here is the source code for the demo project created <a href="https://github.com/ankit-gubrani/Codebrains">https://github.com/ankit-gubrani/Codebrains</a></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><b style="font-size: medium; line-height: normal;"><span style="color: blue;">Your comments and suggestions are welcome.</span></b></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
<div style="font-family: 'Courier New', Courier, monospace;">
<span style="font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
</div>
</span><br />
<span color: #252525; font-family: sans-serif; font-size: 14px; line-height: 22.399999618530273px;"><br /></span></div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-26937692673443633012014-07-22T11:04:00.000-07:002014-07-22T11:04:44.825-07:00How to check whether a page is Published / Activated ? <div dir="ltr" style="text-align: left;" trbidi="on">
<div style="margin-bottom: 10px; margin-top: 10px;">
<span style="color: #cccccc; font-family: Courier New, Courier, monospace;">Hi guys, at-times we come across a requirement in CQ5/AEM where we have<i> <b>to check if a page is published or not in Author mode programmatically</b></i> . I encountered a similar situation where I had to show only those page which are published or activated. </span></div>
<div style="margin-bottom: 10px; margin-top: 10px;">
<span style="font-family: Courier New, Courier, monospace;"><span style="color: #cccccc;"><br /></span>
<span style="color: #cccccc;">So, after searching the web I came across a Service that CQ/AEM provides out of the box "<b>Replication Status (<i>com.day.cq.replication.ReplicationStatus</i>)</b><span style="background-color: transparent;">". This service provides us a way to see if, <i>resource with which it is associated is : activated or deactivated or delivered or status-queue or we can even find out last published time of the page or by whom was the particular page last published.</i></span>The service can be adapted from the resource object : </span></span></div>
<div style="margin-bottom: 10px; margin-top: 10px;">
<span style="font-family: Courier New, Courier, monospace;"><span style="color: #cccccc;"><br /></span>
<span style="color: #cccccc;"><b>ReplicationStatus replicationStatus = resource.adaptTo(ReplicationStatus.class);</b></span></span></div>
<div style="margin-bottom: 10px; margin-top: 10px;">
<span style="color: #cccccc; font-family: Courier New, Courier, monospace;"><br /></span></div>
<div style="margin-bottom: 10px; margin-top: 10px;">
<span style="color: #cccccc; font-family: Courier New, Courier, monospace;">Here is the link for documentation of the ReplicationStatus Interface :</span></div>
<div style="margin-bottom: 10px; margin-top: 10px;">
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"><a href="http://docs.adobe.com/docs/en/cq/5-6/javadoc/com/day/cq/replication/ReplicationStatus.html">http://docs.adobe.com/docs/en/cq/5-6/javadoc/com/day/cq/replication/ReplicationStatus.html</a></span></div>
<div>
<br /></div>
</div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-71792422228403808142014-07-16T10:51:00.001-07:002014-07-16T11:44:17.039-07:00NullPointerException while using currentDesign.getDoctype(currentStyle).toRequest(request)<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;">All of us must have used currentDesign object (the current design object of the current page) to access the properties of design associated with the page. But once i came across a strange error while using <b>currentDesign object </b>. When I tried to get currentDesign.getDoctype(currentStyle).toRequest(request); I encountered an <b>Null Pointer exception</b>.</span><br />
<span style="font-family: Courier New, Courier, monospace;">Here is the full error stack </span>:<br />
<br />
com.day.cq.wcm.core.impl.WCMDebugFilter Exception: org.apache.sling.api.scripting.ScriptEvaluationException:<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:385)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:170)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:456)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:500)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:183)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:150)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:219)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:257)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:297)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:216)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:103)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:381)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.jsp.libs.foundation.components.primary.cq.Page.Page_jsp._jspService(Page_jsp.java:106)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:420)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.JspServletWrapperAdapter.service(JspServletWrapperAdapter.java:59)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:233)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:85)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:453)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:358)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:170)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:456)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:500)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:147)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.core.impl.WCMComponentFilter.filterRootInclude(WCMComponentFilter.java:308)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:141)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:257)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.RequestSlingFilterChain.render(RequestSlingFilterChain.java:49)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.core.impl.warp.TimeWarpFilter.doFilter(TimeWarpFilter.java:106)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.mobile.core.impl.redirect.RedirectFilter.doFilter(RedirectFilter.java:296)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.ankit.utils.XSSFilter.doFilter(com.ankit.utils.XSSFilter.java:40)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.ankit.servlet.SSOFilter.doFilter(com.ankit.servlet.SSOFilter.java:80)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.ankit.servlet.PermissionFilter.doFilter(com.ankit.servlet.PermissionFilter.java:120)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.debug.RequestProgressTrackerLogFilter.doFilter(RequestProgressTrackerLogFilter.java:59)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.foundation.forms.impl.FormsHandlingServlet.doFilter(FormsHandlingServlet.java:220)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.theme.impl.ThemeResolverFilter.doFilter(ThemeResolverFilter.java:76)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:117)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.cq.wcm.core.impl.WCMRequestFilter.doFilter(WCMRequestFilter.java:89)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.rewriter.impl.RewriterFilter.doFilter(RewriterFilter.java:83)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.bgservlets.impl.BackgroundServletStarterFilter.doFilter(BackgroundServletStarterFilter.java:135)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processRequest(SlingRequestProcessorImpl.java:153)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.SlingMainServlet.service(SlingMainServlet.java:206)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:117)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:179)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:238)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.http.base.internal.DispatcherServlet.service(DispatcherServlet.java:67)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.j2ee.servletengine.ServletRuntimeEnvironment.service(ServletRuntimeEnvironment.java:250)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.j2ee.servletengine.RequestDispatcherImpl.doFilter(RequestDispatcherImpl.java:315)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:334)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.j2ee.servletengine.RequestDispatcherImpl.service(RequestDispatcherImpl.java:377)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.j2ee.servletengine.ServletHandlerImpl.process(ServletHandlerImpl.java:351)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.j2ee.servletengine.HttpListener$Worker.run(HttpListener.java:625)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at java.lang.Thread.run(Thread.java:745)<br />
Caused by: org.apache.sling.api.SlingException:<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspExceptionInternal(JspServletWrapper.java:563)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:499)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:451)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.JspServletWrapperAdapter.service(JspServletWrapperAdapter.java:59)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:233)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:85)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:453)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:358)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>... 99 more<br />
Caused by: java.lang.NullPointerException<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.jsp.apps.ankit.components.page.commonPageLayout.commonPageLayout_jsp._jspService(commonPageLayout_jsp.java:148)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)<br />
<span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:420)<br />
<br />
<b><u><span style="font-family: Courier New, Courier, monospace;">Solution :</span></u></b><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">After spending hours to figured out the problem and I found out that <b>jcr:content</b> <b>node</b> of my design page was missing (<b>/etc/designs/myDesign/jcr:content node</b>).As there was no jcr:conent node under myDesign page because of that currentDesign.getDoctype(currentStyle) was returning <b>null </b>and this was the main reason of the <b>NullPointerExcpetion/NPE</b></span><span style="font-family: 'Courier New', Courier, monospace;">. So, the moment I added the <b>jcr:content node</b> under myDesign page, code came back to life again.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;"><b><span style="color: blue;">Your comments and suggestions are welcome.</span></b></span></div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-44419873513926949872014-07-12T03:42:00.000-07:002014-07-13T23:29:59.997-07:00Unable to start CQ instance. javax.jcr.RepositoryException while installing CQ<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Courier New, Courier, monospace;">Couple of days back I was installing CQ5.5 back on my Linux machine. So, I started the instance from command line using command </span><br />
<span style="font-family: Courier New, Courier, monospace;">"<i><b>java -XX:MaxPermSize=512m -Xmx1520m -XX:-UseSplitVerifier -jar cq5-author-8502.jar</b></i>" </span><br />
<span style="font-family: Courier New, Courier, monospace;">and everything went fine. But when installation was completed and it came up with url in the browser that should have shown Login page instead it came with <b>503 ERROR : Service Unavailable</b>. On investigating in the error logs i found the following error stack :</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<i><span style="font-family: inherit;">10.07.2014 22:02:31.526 *INFO* [FelixStartLevel] org.apache.jackrabbit.core.RepositoryImpl Shutting down repository...</span></i><br />
<i><span style="font-family: inherit;">10.07.2014 22:02:31.529 *INFO* [FelixStartLevel] org.apache.jackrabbit.core.RepositoryImpl Repository has been shutdown</span></i><br />
<i><span style="font-family: inherit;">10.07.2014 22:02:31.551 *ERROR* [FelixStartLevel] com.day.crx.sling.server [com.day.crx.sling.server.impl.jmx.ManagedRepository] The activate method has thrown an exception (javax.jcr.RepositoryException: Unable to register data store in cluster.) javax.jcr.RepositoryException: Unable to register data store in cluster.</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.data.ClusterDataStore.init(ClusterDataStore.java:183)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.CRXRepositoryImpl.createClusterNode(CRXRepositoryImpl.java:999)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.jackrabbit.core.RepositoryImpl.<init>(RepositoryImpl.java:294)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.CRXRepositoryImpl.<init>(CRXRepositoryImpl.java:283)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.CRXRepositoryImpl.create(CRXRepositoryImpl.java:258)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.CRXRepositoryImpl.create(CRXRepositoryImpl.java:243)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.sling.server.impl.jmx.ManagedRepository.activate(ManagedRepository.java:164)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.lang.reflect.Method.invoke(Method.java:606)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:227)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:38)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:591)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:472)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:146)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:226)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:118)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.DelayedComponentManager.createRealComponent(DelayedComponentManager.java:95)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager$Registered.getService(AbstractComponentManager.java:1296)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.DelayedComponentManager.getService(DelayedComponentManager.java:88)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:310)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:221)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:292)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.getService(Felix.java:3010)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:329)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.osgi.util.tracker.ServiceTracker.addingService(ServiceTracker.java:442)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.aries.jmx.whiteboard.Activator$MBeanTracker.addingService(Activator.java:101)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:233)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:840)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:871)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:733)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:662)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3765)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.registerService(Felix.java:2877)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:251)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:456)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerComponentService(AbstractComponentManager.java:508)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:1157)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:334)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:158)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.config.ImmediateComponentHolder.enableComponents(ImmediateComponentHolder.java:313)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.BundleComponentActivator.loadDescriptor(BundleComponentActivator.java:241)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:147)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:111)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:274)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.Activator.bundleChanged(Activator.java:192)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:807)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:729)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:610)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3754)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.startBundle(Felix.java:1780)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1156)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.lang.Thread.run(Thread.java:745)</span></i><br />
<i><span style="font-family: inherit;">Caused by: java.net.UnknownHostException: AnkitGubrani: AnkitGubrani: Name or service not known</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.InetAddress.getLocalHost(InetAddress.java:1473)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:198)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.Socket.connect(Socket.java:579)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.Socket.connect(Socket.java:528)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.Socket.<init>(Socket.java:425)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.Socket.<init>(Socket.java:241)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.cluster.ClusterMaster$3.execute(ClusterMaster.java:385)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.cluster.ClusterController.attempt(ClusterController.java:1385)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.cluster.ClusterMaster.listen(ClusterMaster.java:383)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.cluster.ClusterMaster.startListener(ClusterMaster.java:196)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.cluster.ClusterController.startMasterListener(ClusterController.java:840)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.cluster.ClusterController.start(ClusterController.java:684)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.cluster.ClusterController.register(ClusterController.java:919)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.data.ClusterDataStoreSkeleton.init(ClusterDataStoreSkeleton.java:94)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at com.day.crx.core.data.ClusterDataStore.init(ClusterDataStore.java:177)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>... 56 more</span></i><br />
<i><span style="font-family: inherit;">Caused by: java.net.UnknownHostException: AnkitGubrani: Name or service not known</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.net.InetAddress.getLocalHost(InetAddress.java:1469)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>... 72 more</span></i><br />
<i><span style="font-family: inherit;">10.07.2014 22:02:31.552 *ERROR* [FelixStartLevel] com.day.crx.sling.server [com.day.crx.sling.server.impl.jmx.ManagedRepository] Failed creating the component instance; see log for reason</span></i><br />
<i><span style="font-family: inherit;">10.07.2014 22:02:31.554 *ERROR* [FelixStartLevel] org.apache.aries.jmx.whiteboard.JmxWhiteboardSupport registerMBean: Cannot register MBean service null with MBean servers: Not an instanceof DynamicMBean or not MBean spec compliant standard MBean</span></i><br />
<i><span style="font-family: inherit;">10.07.2014 22:02:31.555 *INFO* [FelixStartLevel] com.day.crx.sling.server Service [com.day.crx.sling.server.impl.jmx.ManagedRepository,74] ServiceEvent REGISTERED</span></i><br />
<i><span style="font-family: inherit;">10.07.2014 22:02:31.554 *ERROR* [FelixDispatchQueue] com.day.crx.sling.server FrameworkEvent ERROR (org.osgi.framework.ServiceException: Service factory returned null.) org.osgi.framework.ServiceException: Service factory returned null.</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:343)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:221)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:292)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.getService(Felix.java:3010)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:329)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.osgi.util.tracker.ServiceTracker.addingService(ServiceTracker.java:442)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.aries.jmx.whiteboard.Activator$MBeanTracker.addingService(Activator.java:101)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:233)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:840)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:871)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:733)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:662)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:3765)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.registerService(Felix.java:2877)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:251)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:456)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerComponentService(AbstractComponentManager.java:508)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager$Unsatisfied.activate(AbstractComponentManager.java:1157)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:334)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:158)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.config.ImmediateComponentHolder.enableComponents(ImmediateComponentHolder.java:313)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.BundleComponentActivator.loadDescriptor(BundleComponentActivator.java:241)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:147)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:111)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:274)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.scr.impl.Activator.bundleChanged(Activator.java:192)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:807)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:729)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:610)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3754)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.startBundle(Felix.java:1780)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1156)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266)</span></i><br />
<i><span style="font-family: inherit;"><span class="Apple-tab-span" style="white-space: pre;"> </span>at java.lang.Thread.run(Thread.java:745)</span></i><br />
<i><span style="font-family: Courier New, Courier, monospace;"><br /></span></i>
<i><span style="font-family: Courier New, Courier, monospace;"><br /></span></i>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2FJGKd06IJhouVM4L4-L3rF8Lg6ak1RhNQhOvZy06gmGwLu1WXou5E8JTgukq9FDx_XiMQZNe-Q9p5o6rdAD5DchbKCx91QN2YPYNcliRDsOeQNOEc45K2peU0jaJelIbLc0zWVxvEPbf/s1600/CQStartuperror.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2FJGKd06IJhouVM4L4-L3rF8Lg6ak1RhNQhOvZy06gmGwLu1WXou5E8JTgukq9FDx_XiMQZNe-Q9p5o6rdAD5DchbKCx91QN2YPYNcliRDsOeQNOEc45K2peU0jaJelIbLc0zWVxvEPbf/s1600/CQStartuperror.jpg" height="358" width="580" /></a><br />
<i><span style="font-family: Courier New, Courier, monospace;"><br /></span></i>
<i><span style="font-family: Courier New, Courier, monospace;"><br /></span></i>
<i><span style="font-family: Courier New, Courier, monospace;"><br /></span></i>
<i><span style="font-family: Courier New, Courier, monospace;"><br /></span></i>
<span style="font-family: Courier New, Courier, monospace; font-size: large;"><b><u>Solution:</u></b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">On investing I found that CQ was trying to resolve to a server named as AnkitGubrani which was the hostname of my machine (i.e name in <b>/etc/hostname</b> file). So adding this entry in the <b>/etc/hosts</b> file resolved the problem. Following entry resolved the problem :</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">127.0.0.1 localhost AnkitGubrani</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">After adding above line <b>/etc/hosts</b> file should be saved and apache2 service should be restarted. </span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">And if everything went fine following command should give name of the host : <b>hostname -f</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">In my case it returned <b>localhost</b> after adding entry into /etc/hosts while earlier it returned <b>AnkitGubrani: Name or service not known.</b></span><br />
<span style="font-family: Courier New, Courier, monospace;"><b><br /></b></span>
<span style="color: #cccccc; font-size: 13px; line-height: 18.479999542236328px; text-align: justify;"><i><span style="color: #0b5394;"><span style="font-family: Courier New, Courier, monospace;"><b>Your comments and suggestions are welcome.</b></span></span></i></span><br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-family: Courier New, Courier, monospace;"><b><br /></b></span>
<span style="font-family: Courier New, Courier, monospace;"><b><br /></b></span></div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0tag:blogger.com,1999:blog-3002661968176035495.post-42870401755188230012014-07-09T02:02:00.001-07:002014-07-12T03:50:43.861-07:00Content Personalization with Adobe CQ<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="text-align: left;">
<h3 style="text-align: justify;">
<b><span style="color: #b45f06;"><i>What is Content Personalization ?</i></span></b></h3>
</div>
<div style="text-align: left;">
<div style="text-align: justify;">
People visiting your website might have different purpose to visit your site. Some might visit to shop things on your site while others are just for gathering some knowledge. But each time any such users come to your website they all get to see the same set of content on the Home Page even if they are for shopping or just browsing or be it any other reason.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Don't you think it will be great if you could display data that visitor wants to see by analyzing his/her needs ? That way visitors coming to your site will be happy and will tend to visit your site more often.</div>
<div style="text-align: justify;">
<br /></div>
<h3 style="text-align: justify;">
<span style="color: #b45f06;"><i>
How does CQ5 provides us personalization ?</i></span></h3>
<div style="text-align: justify;">
CQ5 comes with a powerful mechanism that helps you study the traffic coming to your website and on behalf of that you can show the user with a tailor-made content that is selected according to their specific needs. In Adobe CQ5 it is named as <b><i>Campaign Management.</i></b></div>
<div style="text-align: justify;">
<b><i><br /></i></b>
</div>
<div class="text parbase section">
<div class="text">
<div style="text-align: justify;">
In general this personalization of content works by looking at the data that is available for the user - it could be done againts things like gender, location from where user is accessing, keywords, browser using, Operating system and many more elements.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1g9lvlC3X4Nq47a1NhBSsA2soG-BEmeePjhr1NW3UjpKghjInKue6Ut7nqi21SoiAcHiI2UIUWZrfzjGBGft_CjGLHAhvp04VLRsKo1peCeep0PIFFn6wiBQVI6YS9AUsFWZih7CHFskg/s1600/finalBLogImg.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto; text-align: center;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1g9lvlC3X4Nq47a1NhBSsA2soG-BEmeePjhr1NW3UjpKghjInKue6Ut7nqi21SoiAcHiI2UIUWZrfzjGBGft_CjGLHAhvp04VLRsKo1peCeep0PIFFn6wiBQVI6YS9AUsFWZih7CHFskg/s1600/finalBLogImg.jpg" height="385" width="570" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Personalized Content visible on a page</td></tr>
</tbody></table>
</div>
<div style="text-align: justify;">
<br />
Three key elements of personalization are :</div>
<ul style="text-align: left;">
<li style="text-align: justify;"><b>Users :- </b>These the profiles that contains characteristics against which actual personalization of content is performed. </li>
<li style="text-align: justify;"><b>Content :- </b>This is what that will be show to user or in simple term data that attracts or is of users interest.</li>
<li style="text-align: justify;"><b>Rule</b> <b>:-</b> This defines how actually personalization is happening. It is a rule that define on fullfillment of which characteristic which content is to be displayed.</li>
</ul>
</div>
</div>
</div>
<div style="text-align: justify;">
<br /></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBbaAIaCuD3yJ2Wa1TcOKgdSTew8_9PXz-WH7grwaaACOR9kFOS20oioan5mcrY67ZXjziNs2dPq8QQhmzyAoVIqD9c6dJL0j1fJ0V7Iums_Vf4NTWQr9TtjezlqVu6mxbStOS0XwEJ5Z4/s1600/ffinalblogimg2.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgBbaAIaCuD3yJ2Wa1TcOKgdSTew8_9PXz-WH7grwaaACOR9kFOS20oioan5mcrY67ZXjziNs2dPq8QQhmzyAoVIqD9c6dJL0j1fJ0V7Iums_Vf4NTWQr9TtjezlqVu6mxbStOS0XwEJ5Z4/s1600/ffinalblogimg2.jpg" height="358" width="570" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Client Context On a page</td></tr>
</tbody></table>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="color: #999999;">The image shown above shows the Client Context(Box in the middle that says user's charactersitcs).</span></div>
<div style="text-align: justify;">
<br /></div>
<h3 style="text-align: justify;">
<span style="color: #b45f06;"><i>
How does content personalization works in CQ5 ?</i></span></h3>
<div style="text-align: justify;">
CQ5 provides Marketing and Campaign Management that allows you to personalize content and show tailored data to your customers. It allows you to manage marketing different campaigns.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Campaign management is made up of various elements:</div>
<div>
<br />
<br />
<li><div style="text-align: justify;">
<b>Brands</b></div>
<div style="text-align: justify;">
In CQ, Brands are the most basic unit of campaign management and are made of collection of <b>campaigns</b>.</div>
</li>
<li><div style="text-align: justify;">
<b>Campaigns</b></div>
<div style="text-align: justify;">
After brands comes Campaigns these are made from collection of <b>Experiences</b>.</div>
</li>
<li><div style="text-align: justify;">
<b>Experiences</b></div>
<div style="text-align: justify;">
Experience is something that end user see i.e this is the personalized content that is displayed to the end user when a rule is matched successfully. There are 3 types of experiences available :</div>
<ul>
<li><div style="text-align: justify;">
<b>Teasers</b></div>
<div style="text-align: justify;">
Teaser pages contains content of user's interest that is displayed when a rule(<b>Segment</b>) matches successfully against the users information.</div>
</li>
<li><div style="text-align: justify;">
<b>Newsletters</b></div>
<div style="text-align: justify;">
Newsletters are emails that are sent to the users(<b>Leads</b>) of your website and these emails(Newsletters) contains data so as to attract users to visit your website.</div>
</li>
<li><div style="text-align: justify;">
<b>Test&Target</b></div>
<div style="text-align: justify;">
This allows integration with Adobe's Test and target.</div>
</li>
</ul>
</li>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<b><span style="color: #0b5394; font-size: large;"><i>MCM Dashboard </i></span></b></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
The Marketing and Campaign Management dashboard allows you to manage everything related to marketing and campaigning. For example it allows you to create a <b>Brand</b> and under a brand is helps you to add <b>Campaigns</b> and under campaigns it helps you to add various <b>Experiences</b></div>
<div style="text-align: justify;">
<b><br /></b></div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdWMVJbxycZZMBsryAHNvHTc0PxMOc8NFC6gw0GxNKtfTV53JzozpkU9EVOaoIfpapI0UYVZbS8Rg-kv61r8a-JsoeJ0CO3-x-6HgviXKkC3eHEd-g7OukcJ51BvYdvCWEUvD_V1O2E_gB/s1600/fmcmadmin.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdWMVJbxycZZMBsryAHNvHTc0PxMOc8NFC6gw0GxNKtfTV53JzozpkU9EVOaoIfpapI0UYVZbS8Rg-kv61r8a-JsoeJ0CO3-x-6HgviXKkC3eHEd-g7OukcJ51BvYdvCWEUvD_V1O2E_gB/s1600/fmcmadmin.jpg" height="355" width="570" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">CQ MCM Dashboard</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
So here is my first blog giving you an idea about what is Content personalization in general and how CQ provides us Content personalization as Campaign management. I will soon come up with a blog on how to create your own Campaigns and how to personalize data in the Client context.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<b><i><span style="color: #0b5394;">Your comments and suggestions are welcome.</span></i></b></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<span style="color: #666666;">*Note : Help taken from adobe's link on <a href="http://dev.day.com/docs/en/cq/current/wcm/campaigns.html">Campaign management</a> . </span></div>
<div style="text-align: justify;">
<b><br /></b></div>
</div>
Ankit Gubranihttp://www.blogger.com/profile/18249316630883972859noreply@blogger.com0