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

<channel>
	<title>Content Anarchy</title>
	<atom:link href="http://blogs.adobe.com/sentah/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.adobe.com/sentah</link>
	<description>Blog dedicated to WEM from a different perspective</description>
	<lastBuildDate>Thu, 01 Mar 2012 05:50:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Recent Wiki Activity</title>
		<link>http://blogs.adobe.com/sentah/2012/03/01/recent-wiki-activity/</link>
		<comments>http://blogs.adobe.com/sentah/2012/03/01/recent-wiki-activity/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 05:50:38 +0000</pubDate>
		<dc:creator>Senthil Margandayan</dc:creator>
				<category><![CDATA[Component]]></category>
		<category><![CDATA[CQ5]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[CRXDE]]></category>
		<category><![CDATA[WEM]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/sentah/?p=59</guid>
		<description><![CDATA[This post is in continuation of the previous one where we added a component to display the upcoming events of a calendar. Here we would create a similar component and try to display the status of the recent wiki activity. &#8230; <a href="http://blogs.adobe.com/sentah/2012/03/01/recent-wiki-activity/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This post is in continuation of the previous <a title="Upcoming Events" href="http://blogs.adobe.com/sentah/2012/02/29/upcoming-events-2/">one </a>where we added a component to display the upcoming events of a calendar.</p>
<p>Here we would create a similar component and try to display the status of the recent wiki activity.</p>
<p>&nbsp;</p>
<p>As usual go ahead and create a new component using the component wizard in the CRXDE.</p>
<p><a class="lightbox" title="Recent Wiki Activity Properties" href="http://blogs.adobe.com/sentah/files/2012/02/Recent_Wiki_Activity_props.jpg"><img class="size-medium wp-image-61 aligncenter" title="Recent Wiki Activity Properties" src="http://blogs.adobe.com/sentah/files/2012/02/Recent_Wiki_Activity_props-300x68.jpg" alt="" width="300" height="68" /></a></p>
<p>&nbsp;</p>
<p>Once done open up the JSP page and add following piece of code to retrieve the nodes.<br />
<code><br />
String queryStatment = "select * from wiki:Topic where jcr:path like '"+currentPage.getPath()+"/wiki/%'order by wiki:lastModified desc";<br />
Query q = currentNode.getSession().getWorkspace().getQueryManager().createQuery(queryStatment,Query.SQL);<br />
NodeIterator nodeIter = q.execute().getNodes();</code></p>
<p>Iterate through the node entries and retrieve the version history like<br />
<code><br />
VersionHistory vh = node.getVersionHistory();<br />
long size = vh.getAllVersions().getSize();<br />
</code></p>
<p>For newly added wiki entries the version size would be 1 and for all other updated entries it will be greater than 1.</p>
<p>&nbsp;</p>
<p>After adding valid wiki entries and adding the component to the page it should resemble like given below.</p>
<p><a class="lightbox" title="Recent Wiki Activity" href="http://blogs.adobe.com/sentah/files/2012/03/Recent_Wiki_Activity.jpg"><img class="alignnone size-medium wp-image-68" title="Recent Wiki Activity" src="http://blogs.adobe.com/sentah/files/2012/03/Recent_Wiki_Activity-300x104.jpg" alt="" width="300" height="104" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblogs.adobe.com%2Fsentah%2F2012%2F03%2F01%2Frecent-wiki-activity%2F&amp;t=Recent%20Wiki%20Activity" id="facebook_share_link_59">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_59') || document.getElementById('facebook_share_icon_59') || document.getElementById('facebook_share_both_59') || document.getElementById('facebook_share_button_59');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_59') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/sentah/2012/03/01/recent-wiki-activity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upcoming Events</title>
		<link>http://blogs.adobe.com/sentah/2012/02/29/upcoming-events-2/</link>
		<comments>http://blogs.adobe.com/sentah/2012/02/29/upcoming-events-2/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 21:14:30 +0000</pubDate>
		<dc:creator>Senthil Margandayan</dc:creator>
				<category><![CDATA[Calendar]]></category>
		<category><![CDATA[Component]]></category>
		<category><![CDATA[CQ5]]></category>

		<guid isPermaLink="false">https://blogs.adobe.com/sentah/?p=46</guid>
		<description><![CDATA[The Calendar functionality in the CQ5 can be leveraged to build an intuitive portal experiencing for the users. One such experience would be to display the list of upcoming events. I would provide a simpler approach to achieve the same. Create a new component &#8230; <a href="http://blogs.adobe.com/sentah/2012/02/29/upcoming-events-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The Calendar functionality in the CQ5 can be leveraged to build an intuitive portal experiencing for the users. One such experience would be to display the list of upcoming events.</p>
<p>I would provide a simpler approach to achieve the same.</p>
<ul>
<li>Create a new component let&#8217;s say upcoming events.</li>
</ul>
<p><a class="lightbox" title="022912_2114_UpcomingEve1.png" href="http://blogs.adobe.com/sentah/files/2012/02/022912_2114_UpcomingEve1.png"><img class="size-medium wp-image-48 aligncenter" title="022912_2114_UpcomingEve1.png" src="http://blogs.adobe.com/sentah/files/2012/02/022912_2114_UpcomingEve1-300x64.png" alt="" width="300" height="64" /></a></p>
<ul>
<li>Open up the newly created JSP and add the following logical steps</li>
<ul>
<li>Retrieve the Calendar Source in the desired page either by looping through the child pages or parametrize the calendar location as a dialog entry for the component. In our case we shall assume that the dialog entry exists and proceed.</li>
<li><code>if(calendarLocation == null || calendarLocation.equals(""))<br />
{<br />
PageFilter filter = new PageFilter(request);<br />
Iterator iter = currentPage.listChildren(filter);<br />
while(iter.hasNext())<br />
{<br />
Page currPage = iter.next();<br />
Resource r = currPage.getContentResource("par/calendar");<br />
if( r != null) {<br />
calendarManager = currPage.getContentResource().getResourceResolver().adaptTo(CalendarManager.class);<br />
if(calendarManager != null){<br />
calendar = calendarManager.getCalendar(currPage.getPath());<br />
calendarUrl = currPage.getPath()+".html";<br />
break;<br />
}<br />
}// resource check<br />
}<br />
}<br />
else {<br />
calendarManager = currentPage.getContentResource().getResourceResolver().adaptTo(CalendarManager.class);<br />
if(calendarManager != null){<br />
calendar = calendarManager.getCalendar(calendarLocation);<br />
calendarUrl = currentPage.getPath()+".html";<br />
}<br />
}<br />
</code></li>
<li>Retrieve all the Calendar events using calendar API</li>
<li>Iterate over all the events and for each event , read the event properties.</li>
<li>If the event happens in future then display the event along with its read properties.</li>
</ul>
<li>Add the component to your webpage using the sidekick after enabling it.</li>
<li>The component should resemble like given below once its published or previewed with appropriate data</li>
</ul>
<p><a class="lightbox" title="Upcoming Events" href="http://blogs.adobe.com/sentah/files/2012/02/Upcoming_Events.jpg"><img class="size-medium wp-image-55 aligncenter" title="Upcoming Events" src="http://blogs.adobe.com/sentah/files/2012/02/Upcoming_Events-300x153.jpg" alt="" width="300" height="153" /></a></p>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblogs.adobe.com%2Fsentah%2F2012%2F02%2F29%2Fupcoming-events-2%2F&amp;t=Upcoming%20Events" id="facebook_share_link_46">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_46') || document.getElementById('facebook_share_icon_46') || document.getElementById('facebook_share_both_46') || document.getElementById('facebook_share_button_46');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_46') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/sentah/2012/02/29/upcoming-events-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom Color Coding  for CQ5 Calendar</title>
		<link>http://blogs.adobe.com/sentah/2012/02/29/custom-color-coding-for-cq5-calendar/</link>
		<comments>http://blogs.adobe.com/sentah/2012/02/29/custom-color-coding-for-cq5-calendar/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 04:02:31 +0000</pubDate>
		<dc:creator>Senthil Margandayan</dc:creator>
				<category><![CDATA[CQ5]]></category>

		<guid isPermaLink="false">http://blogs.adobe.com/sentah/?p=4</guid>
		<description><![CDATA[The CQ5 Calendars by default have color codes fixed for the derived events and the events that can be created. However we can also customize the color for certain event types. Lets take a scenario where we can define new &#8230; <a href="http://blogs.adobe.com/sentah/2012/02/29/custom-color-coding-for-cq5-calendar/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The CQ5 Calendars by default have color codes fixed for the derived events and the events that can be created.</p>
<p>However we can also customize the color for certain event types. Lets take a scenario where we can define new meeting types ( for our reference) and color code them.</p>
<p>This provides an intuitive experience for the user to decide the kind of event he/she is going to attend.</p>
<p>&nbsp;</p>
<p>To achieve this we have to perform the following steps.</p>
<p>&nbsp;</p>
<ol>
<ol>
<ol>
<ol>
<ol>
<li>Copy the Calendar folder structure (/libs/collab/calendar)  to your local apps folder to customize the features.</li>
<li>Customize the Calendar edit form to include a meeting type, in our case its defined as four (Meeting,Seminar,Speech and Conference)</li>
<ul>
<li>Create a new Event Edit Form and associate that for the Calendar.</li>
<li><a class="lightbox" title="EventType Definition" href="http://blogs.adobe.com/sentah/files/2012/02/EventType_Def.jpg"><img class="alignnone size-medium wp-image-15" title="EventType Definition" src="http://blogs.adobe.com/sentah/files/2012/02/EventType_Def-300x145.jpg" alt="" width="300" height="145" /></a></li>
<li>Create a new Event View Form and repeat the same except that now it is a read only mode.</li>
<li><a class="lightbox" title="EventType_Def_Publish" href="http://blogs.adobe.com/sentah/files/2012/02/EventType_Def_Publish.jpg"><img class="alignnone size-medium wp-image-24" title="EventType_Def_Publish" src="http://blogs.adobe.com/sentah/files/2012/02/EventType_Def_Publish-300x147.jpg" alt="" width="300" height="147" /></a></li>
<li></li>
</ul>
<li>We have to modify the java script which renders the color for the various event types. This is available under the file MonthLens.js file</li>
<ul>
<li>The function createAllDayEventDiv retrieves the color for the all day event in question  like given b<code></code>elow.</li>
<ul>var color = CQ.collab.cal.Calendar.getColorFor(event);</ul>
<ul>Replace the default function with a custom one like</ul>
<ul>var color = CQ.collab.cal.Calendar.getEventColorFor(event);</ul>
<li>Perform the same changes for renderTimeEvents function too ( i.e. replace the default one with the custom function getEventColorFor).</li>
</ul>
<li>The Event Type to the color code can be done in multiple ways, but here we will take a look at the simplest approach of matching the event Type with predefined color.</li>
<ul>
<li>Open the Calendar.js file and add the following piece of code</li>
</ul>
</ol>
</ol>
</ol>
</ol>
</ol>
<p><code> /**<br />
* Returns the color to use for an event. This color will be the same<br />
* for all events from the same calendar/subscription.<br />
*<br />
* @return {String} a hex color value in the form of "FF0000"<br />
*/<br />
getEventColorFor: function(event) {<br />
var colorValue = "40864B";<br />
var eventType = event.get("eventType");<br />
if(eventType == "seminar") {<br />
colorValue = "ED1C24"; // RED<br />
}<br />
else if (eventType == "meeting") {<br />
colorValue="00A2E8"; // BLUE<br />
}<br />
else if (eventType == "speech") {<br />
colorValue="FF7F27"; // orange<br />
}<br />
else if (eventType == "conference") {<br />
colorValue="22B14C"; // GREEN<br />
}<br />
return colorValue;<br />
}</code></p>
<ol>
<ol>
<ol>
<ol>
<ol>
<ul>
<li> Edit the calendar and add events of each type.</li>
<li>Once completed the calendar should looking similar to what is displayed here.</li>
</ul>
</ol>
</ol>
</ol>
</ol>
</ol>
<div id="attachment_33" class="wp-caption aligncenter" style="width: 310px"><a class="lightbox" title="Color_Coded_Calendar" href="http://blogs.adobe.com/sentah/files/2012/02/Color_Coded_Calendar.jpg"><img class="size-medium wp-image-33" title="Color_Coded_Calendar" src="http://blogs.adobe.com/sentah/files/2012/02/Color_Coded_Calendar-300x209.jpg" alt="Color Coded Calendar" width="300" height="209" /></a><p class="wp-caption-text">Color Coded Calendar</p></div>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fblogs.adobe.com%2Fsentah%2F2012%2F02%2F29%2Fcustom-color-coding-for-cq5-calendar%2F&amp;t=Custom%20Color%20Coding%20%20for%20CQ5%20Calendar" id="facebook_share_link_4">Share on Facebook</a>
	<script type="text/javascript">
	<!--
	var button = document.getElementById('facebook_share_link_4') || document.getElementById('facebook_share_icon_4') || document.getElementById('facebook_share_both_4') || document.getElementById('facebook_share_button_4');
	if (button) {
		button.onclick = function(e) {
			var url = this.href.replace(/share\.php/, 'sharer.php');
			window.open(url,'sharer','toolbar=0,status=0,width=626,height=436');
			return false;
		}
	
		if (button.id === 'facebook_share_button_4') {
			button.onmouseover = function(){
				this.style.color='#fff';
				this.style.borderColor = '#295582';
				this.style.backgroundColor = '#3b5998';
			}
			button.onmouseout = function(){
				this.style.color = '#3b5998';
				this.style.borderColor = '#d8dfea';
				this.style.backgroundColor = '#fff';
			}
		}
	}
	-->
	</script>
	]]></content:encoded>
			<wfw:commentRss>http://blogs.adobe.com/sentah/2012/02/29/custom-color-coding-for-cq5-calendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
