<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Day Communique</title>
	<atom:link href="http://daycommunique.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://daycommunique.wordpress.com</link>
	<description>Everything about Day Communique</description>
	<lastBuildDate>Tue, 16 Dec 2008 14:33:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='daycommunique.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Day Communique</title>
		<link>http://daycommunique.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://daycommunique.wordpress.com/osd.xml" title="Day Communique" />
	<atom:link rel='hub' href='http://daycommunique.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to create JCR connection</title>
		<link>http://daycommunique.wordpress.com/2008/12/16/how-to-create-jcr-connection/</link>
		<comments>http://daycommunique.wordpress.com/2008/12/16/how-to-create-jcr-connection/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 14:04:37 +0000</pubDate>
		<dc:creator>bhatasuj01</dc:creator>
				<category><![CDATA[JCR]]></category>
		<category><![CDATA[Day Communique]]></category>
		<category><![CDATA[jcr connection]]></category>
		<category><![CDATA[jcr session]]></category>

		<guid isPermaLink="false">http://daycommunique.wordpress.com/?p=3</guid>
		<description><![CDATA[In a nutshell, I want to establish a JCR connection with the repository based on Day Communique CMS.  The most common approach for getting the connection by using  JNDI name exposed by Day communique itself . But in this approach you need to know few extra credentials also in terms of userid/password along with the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daycommunique.wordpress.com&amp;blog=5869069&amp;post=3&amp;subd=daycommunique&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In a nutshell, I want to establish a JCR connection with the repository based on Day Communique CMS.  The most common approach for getting the connection by using  JNDI name exposed by Day communique itself . But in this approach you need to know few extra credentials also in terms of userid/password along with the workspace name.</p>
<p>The sample code is as given below.</p>
<p>public static Session getSession() throws NamingException, RepositoryException {</p>
<p>Hashtable&lt;String, String&gt; env = new Hashtable&lt;String, String&gt;();<br />
env.put(&#8220;java.naming.provider.url&#8221;, &#8220;http://jcr.day.com&#8221;);<br />
env.put(&#8220;java.naming.factory.initial&#8221;,<br />
&#8220;com.day.util.jndi.provider.MemoryInitialContextFactory&#8221;);<br />
InitialContext initial = new InitialContext(env);<br />
Object obj = initial.lookup(&#8220;crxauthor&#8221;);<br />
Repository repository = (Repository) PortableRemoteObject.narrow(obj, Repository.class);<br />
String workspace = &#8220;live_author&#8221;;<br />
Session session = repository.login(new SimpleCredentials(&#8220;admin&#8221;, &#8220;admin&#8221;.toCharArray()), workspace);<br />
log.error(&#8220;Connection successful&#8221;);<br />
return session;<br />
}</p>
<p>The above code is perfectly fine if you know all the credentials. But say there could be some scenario where all those credentials will not be known by you.  But nothing to worry. The following piece of code will creating the connection for you irrespective of the required credentials.</p>
<p>public static Session getSession(Ticket ticket) {<br />
Ticket realTicket = ticket;<br />
while (true)<br />
{<br />
try {<br />
Method getTicket = realTicket.getClass().getMethod(&#8220;getTicket&#8221;, new Class[]{});<br />
getTicket.setAccessible(true);<br />
realTicket = (Ticket) getTicket.invoke(realTicket, new Object[]{});<br />
} catch (Exception e) {<br />
break;<br />
}<br />
}<br />
final Session session = ((TicketAdapter) realTicket).getSession();<br />
try {<br />
session.refresh(true);<br />
} catch (RepositoryException e) {<br />
log.error(&#8220;problem&#8221;, e);<br />
}<br />
return session;<br />
}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/daycommunique.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/daycommunique.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/daycommunique.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/daycommunique.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/daycommunique.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/daycommunique.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/daycommunique.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/daycommunique.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/daycommunique.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/daycommunique.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/daycommunique.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/daycommunique.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/daycommunique.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/daycommunique.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daycommunique.wordpress.com&amp;blog=5869069&amp;post=3&amp;subd=daycommunique&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://daycommunique.wordpress.com/2008/12/16/how-to-create-jcr-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/85897588d628293125e8b5e5014531df?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">bhatasuj01</media:title>
		</media:content>
	</item>
		<item>
		<title>About BLOG</title>
		<link>http://daycommunique.wordpress.com/2008/12/16/hello-world/</link>
		<comments>http://daycommunique.wordpress.com/2008/12/16/hello-world/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 13:07:14 +0000</pubDate>
		<dc:creator>ambuj</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[CQ 5]]></category>
		<category><![CDATA[JCR]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Day Communique]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[It will contain the findings on Day Communique.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daycommunique.wordpress.com&amp;blog=5869069&amp;post=1&amp;subd=daycommunique&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It will contain the findings on Day Communique.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/daycommunique.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/daycommunique.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/daycommunique.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/daycommunique.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/daycommunique.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/daycommunique.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/daycommunique.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/daycommunique.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/daycommunique.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/daycommunique.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/daycommunique.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/daycommunique.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/daycommunique.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/daycommunique.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=daycommunique.wordpress.com&amp;blog=5869069&amp;post=1&amp;subd=daycommunique&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://daycommunique.wordpress.com/2008/12/16/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f105ca71b5e0d280309478b7a440fd22?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ambuj</media:title>
		</media:content>
	</item>
	</channel>
</rss>
