<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4699115486564444835</id><updated>2026-10-14T14:06:00.901+05:30</updated><category term="java"/><category term="Liferay"/><category term="Derby"/><category term="Embedded Database"/><category term="JavaDB"/><category term="Netbeans"/><category term="Liferay integration"/><category term="Netbeans Module Startup"/><category term="coin slider"/><category term="coin-slider"/><category term="coinslider"/><category term="design"/><category term="gis"/><category term="google maps"/><category term="mashup"/><category term="modularity"/><category term="osgi"/><category term="smashup"/><category term="travel"/><category term="travel planning"/><category term="Library"/><category term="Netbeans Module"/><category term="Swing"/><category term="Swinglets"/><category term="architecture"/><category term="desktop"/><category term="desktop platform"/><category term="dynamic script"/><category term="expando"/><category term="framework"/><category term="googl"/><category term="google api"/><category term="greenscape"/><category term="introduction"/><category term="j2ee"/><category term="j2me"/><category term="javaee"/><category term="javame"/><category term="javase"/><category term="module"/><category term="nosql"/><category term="opendaylight"/><category term="orientdb"/><category term="page loading"/><category term="planning"/><category term="plugins"/><category term="protocols"/><category term="responsiviness"/><category term="review"/><category term="services"/><category term="slideshow"/><category term="speed"/><category term="sql"/><category term="tip"/><category term="web"/><title type='text'>My Java Experiences</title><subtitle type='html'>This blog showcases my experience working with Java and related technologies.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sheikh Sajid</name><uri>http://www.blogger.com/profile/11365341442254116504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>16</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-6094207133805451546</id><published>2013-10-20T19:07:00.000+05:30</published><updated>2013-10-23T10:30:53.219+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="architecture"/><category scheme="http://www.blogger.com/atom/ns#" term="design"/><category scheme="http://www.blogger.com/atom/ns#" term="framework"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="modularity"/><category scheme="http://www.blogger.com/atom/ns#" term="osgi"/><title type='text'>OSGi - Road Ahead</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;a href=&quot;http://www.osgi.org/&quot; target=&quot;_blank&quot;&gt;OSGi&lt;/a&gt; has been &lt;a href=&quot;https://blogs.oracle.com/ruminations/entry/intro_to_java_modular_frameworks&quot; target=&quot;_blank&quot;&gt;introduced&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://www.javacodegeeks.com/2012/01/osgi-introduction.html&quot; target=&quot;_blank&quot;&gt;many&lt;/a&gt; &lt;a href=&quot;http://www.developerfusion.com/article/84923/an-introduction-to-osgi/&quot; target=&quot;_blank&quot;&gt;times&lt;/a&gt; in the &lt;a href=&quot;http://ctpjava.blogspot.in/2010/09/introduction-to-osgi.html&quot; target=&quot;_blank&quot;&gt;past&lt;/a&gt; &lt;a href=&quot;http://moi.vonos.net/java/osgi-intro/&quot; target=&quot;_blank&quot;&gt;few&lt;/a&gt; &lt;a href=&quot;http://www.slideshare.net/stephanj/intro-to-osgi&quot; target=&quot;_blank&quot;&gt;years&lt;/a&gt;&amp;nbsp;and will still require some in the &lt;a href=&quot;http://lanyrd.com/2013/jdays2013/scqmyx/&quot; target=&quot;_blank&quot;&gt;future&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4699115486564444835#1&quot; name=&quot;top1&quot;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;. With so many introductions, one might be inclined to think that this is a new technology. To the contrary, OSGi is a good 14 year old technology &lt;a href=&quot;http://www.osgi.org/About/HomePage&quot; target=&quot;_blank&quot;&gt;started&lt;/a&gt; in 1999!&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
So why does such an old technology still require an introduction? Is it because it is not yet popular and not reached mainstream yet? Even after 14 years! There are more than &lt;a href=&quot;https://github.com/themodularbook/osgi-ecosystem/wiki#the-implementations&quot; target=&quot;_blank&quot;&gt;3 implementations&lt;/a&gt; of the OSGi specification. Glassfish and Websphere uses it. JBoss supports it. Apache Geronimo &lt;a href=&quot;http://www.pcworld.com/article/244103/apache_moves_geronimo_to_osgi_base.html&quot; target=&quot;_blank&quot;&gt;provides it&lt;/a&gt;. Eclipse is built on it. Netbeans supports it. Spring dmServer and Oracle JDeveloper is &lt;a href=&quot;http://www.infoq.com/news/2011/06/jdeveloper-osgi&quot; target=&quot;_blank&quot;&gt;built on it&lt;/a&gt;. As you can see, most of the middleware servers and the top IDEs are either built on OSGi or has support for it. So, popular it is! But mainstream? That is debatable.&lt;br /&gt;
&lt;br /&gt;
The applications mentioned above are middleware or tooling products. You can use any of these products without knowing anything about OSGi. This is good as well as bad. Good because it helps adoption, as unlike other frameworks, OSGi does not come in the developers&#39; way. Bad because developers tend not to follow the OSGi principles while developing applications. Besides, middleware and tooling product developers are far less compared to general java developers. There have been few attempts to make OSGi available for general purpose development like Spring dmServer (now Eclipse Virgo). But it did not gain much traction. So, why is OSGi not mainstream yet in spite of all the benefits that it provides? Here, I summarize some of my &lt;b&gt;personal observations&lt;/b&gt; behind the reasons of OSGi&#39;s non-adopt-ability:&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Observation One: Elitist&lt;/h3&gt;
&lt;br /&gt;
The OSGi group looks like an elitist club with minimal public engagement up until recently. Only big companies seem to be part of it. There is no open-source-community-like engagement with the general public or at least it appears so.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;
Solution&lt;/h4&gt;
&lt;br /&gt;
The name (OSGi Alliance) itself sounds very technical and non-mainstream. I agree that OSGi started in a niche area and now have expanded to general purpose usage. But since the context has changed, so should the engagement. I think, a name like `OSGi Foundation` will make it less intimidating (`OSGi` itself cannot be dropped because of brand value and historical reasons).&lt;br /&gt;
&lt;br /&gt;
The group should allow individual technical contributors without corporate affiliations to be part of the top membership. A similar model like the current Java Community Process (JCP) or Spring community will make it look more open. I know many will disagree that the JCP is an open community. But it does allow individual membership and is becoming more open.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
Observation Two: Too many jargon&lt;/h2&gt;
&lt;br /&gt;
The OSGi specification is full of jargon. Names like blueprint and compendium, for example, sounds complex although they have simpler names. The use of `Specification` instead of `API` to describe a standard makes it sound too technical like the CORBA specification. Yes, I know that OSGi IS a `Specification`.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
Solution&lt;/h4&gt;
&lt;br /&gt;
Can&#39;t we have a specification without calling it a specification? I think `API` is a much simpler term to use just like how the JCP uses it. All JCP APIs are standard specifications. But for marketing purpose, API sounds more appealing to the general masses. Similarly, call it dependency injection container or CDI container instead of blueprint container to make it sound familiar with JavaEE CDI concepts.&lt;br /&gt;
&lt;h3&gt;
&lt;/h3&gt;
&lt;h3&gt;
&lt;/h3&gt;
&lt;h3&gt;
&lt;/h3&gt;
&lt;h3&gt;
Observation Three: FUD&lt;/h3&gt;
&lt;br /&gt;
Lots of FUD (Fear, Uncertainty, Doubt) has been generated regarding OSGi. Read &lt;a href=&quot;http://www.sdtimes.com/FROM_THE_EDITORS_OSGI_IS_TOO_COMPLEX/By_SD_TIMES_EDITORIAL_BOARD/About_OPENSOURCE_and_OSGI/34281&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;http://www.adam-bien.com/roller/abien/entry/how_to_kill_an_osgi&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt;&amp;nbsp;and &lt;a href=&quot;http://peterrietzler.blogspot.in/2008/12/is-osgi-going-to-become-next-ejb-bubble.html&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt;&amp;nbsp;and &lt;a href=&quot;http://wiki.apidesign.org/wiki/OSGi&quot; target=&quot;_blank&quot;&gt;this&lt;/a&gt;&amp;nbsp;and &lt;a href=&quot;http://blogs.mulesoft.org/osgi-no-thanks/&quot; target=&quot;_blank&quot;&gt;that&lt;/a&gt;. Some of those opinions have been presented with the sole intention to garner page hits. The title do not match the contents. &lt;a href=&quot;http://java.dzone.com/articles/dozen-osgi-myths-and&quot; target=&quot;_blank&quot;&gt;Some&lt;/a&gt; of these has been &lt;a href=&quot;http://java.dzone.com/articles/osgi-complexity-not-problem&quot; target=&quot;_blank&quot;&gt;addressed&lt;/a&gt;&amp;nbsp;while &lt;a href=&quot;http://www.theserverside.com/news/2240037102/OSGi-Not-Easy-Enough-to-Use-Not-as-Productive-as-it-Should-Be&quot; target=&quot;_blank&quot;&gt;some&lt;/a&gt; may not. &lt;a href=&quot;http://blog.linkedin.com/2009/02/17/osgi-at-linkedin-bundle-repositories/&quot; target=&quot;_blank&quot;&gt;Some&lt;/a&gt; are genuine concerns. When a new developer reads such articles, they become very skeptical about adopting it. When people like Rod Johnson says it is complex, people(developer, architect, project manager, IT department) tend to believe it.&lt;br /&gt;
&lt;br /&gt;
&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;
Solution&lt;/h4&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To counter these FUDs, more and more real life examples of successful projects should be published. Additionally, architecture, design patterns, anti-patterns, best practices, etc. should be published frequently. Some of these are available but they have become dated. Fresh information on latest technologies will create the buzz around OSGi. The following links addresses the strength of OSGi:&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://jaxenter.com/jax-magazine/JTJ-2011-04&quot;&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;http://jaxenter.com/jax-magazine/JTJ-2011-04&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://blog.linkedin.com/?s=osgi&quot;&gt;LinkedIn&#39;s use of OSGi&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://javadepend.wordpress.com/2012/10/11/the-osgi-puzzle/&quot;&gt;http://javadepend.wordpress.com/2012/10/11/the-osgi-puzzle/&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://soupinadeli.com/pdfs/a-year-with-osgi.pdf&quot;&gt;http://soupinadeli.com/pdfs/a-year-with-osgi.pdf&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://branchandbound.net/blog/java/2013/07/java-modularity-story/&quot;&gt;http://branchandbound.net/blog/java/2013/07/java-modularity-story/&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
Observation Four: No centralized implementation&lt;/h3&gt;
&lt;br /&gt;
The OSGi site does not provide an official reference implementation of all the specifications. Individual specifications/API are implemented by different project groups mostly from the Apache stable. Core implementation is provided by Eclipse Equinox project. Some of the enterprise APIs are provided by Apache Aries, Apache CXF and other projects. This means a developer has to pull together different parts from various sources to meet his needs. This can be overwhelming sometimes.&lt;br /&gt;
&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;
Solution&lt;/h4&gt;
&lt;br /&gt;
Similar to how JavaEE provides an official reference implementation and complete product (Glassfish), OSGi should provide a reference implementation together with every specification release. OSGi R5 has been released in 2012 but still there is no complete R5 implementation after one year. This implementation need not be a new project. One of the main two projects, Equinox or Felix, should be made the centralized implementation of all core and compendium specifications.&lt;br /&gt;
&lt;br /&gt;
A concurrent implementation release with every new specification release will allow users to start &#39;playing&#39; with the new features. This will create more buzz as people will start blogging, tweeting and pinning their experiences.&lt;br /&gt;
&lt;br /&gt;
In fact, a core product similar to OpenJDK project, would be more appealing. The core can be maintained by all parties interested (Equinox, Felix, Knoplerfish, JBoss) while individually they can differentiate by additional components or integration with their products.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Observation Five: Community, community&lt;/h3&gt;
&lt;br /&gt;
The &lt;a href=&quot;http://blog.osgi.org/&quot;&gt;OSGi blog&lt;/a&gt; seems to be the personal blog of Peter Kriens. There are no other contributors to the blog. Don&#39;t misunderstand me. His posts are always very informative and insightful and a Body of Knowledge by itself. I always look forward to his posts. But, only one person speaking about OSGi in a community that boasts of hundreds of members does not correctly reflect the diversity of the community. On the other hand, the OSGi wiki is non existent. It is hardly being maintained.&lt;br /&gt;
&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;
&lt;/h4&gt;
&lt;h4&gt;
Solution&lt;/h4&gt;
&lt;br /&gt;
Blogs from different community members should be published in the official blog area and not just as RSS feed. This will complement the efforts to counter the FUD mentioned earlier.&lt;br /&gt;
&lt;br /&gt;
The wiki should also be maintained more regularly with up-to-date information. More tutorials, code snippets, design rationale, etc. should be provided.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
General Observations&lt;/h3&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The OSGi site design is dated. A modern theme should be applied to make it more appealing.&lt;/li&gt;
&lt;li&gt;Community engagement must be made a priority. Programs similar to &lt;a href=&quot;https://java.net/projects/adoptajsr/pages/Home&quot; target=&quot;_blank&quot;&gt;Adopt a JSR&lt;/a&gt; should be adopted to encourage community participation.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;hr width=&quot;80%&quot; /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4699115486564444835&quot; name=&quot;1&quot;&gt;&lt;b&gt;1 &lt;/b&gt;&lt;/a&gt;This will become a past event after the scheduled date.&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=4699115486564444835#top1&quot;&gt;&lt;sup&gt;↩&lt;/sup&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/6094207133805451546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2013/10/osgi-road-ahead.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/6094207133805451546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/6094207133805451546'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2013/10/osgi-road-ahead.html' title='OSGi - Road Ahead'/><author><name>Sheikh Sajid</name><uri>http://www.blogger.com/profile/11365341442254116504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-1526970945046621340</id><published>2013-09-09T23:47:00.000+05:30</published><updated>2013-09-09T23:48:16.234+05:30</updated><title type='text'>OpenStack on Windows Azure?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Although this is off-topic from my blog interest, just thought about sharing this.&lt;br /&gt;
&lt;br /&gt;
I was searching for information on the &lt;a href=&quot;http://www.openstack.org/&quot; target=&quot;_blank&quot;&gt;OpenStack&lt;/a&gt; project and did a Google search. This is what came up:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhME8qyn9jZL2UBJYsTdN3CGs9q44HIywZ4o1CizS8ZMEABa9_EXk0DriIv6X1Iwhu8fziq8jfaUCeehZb3XvSzrymLsP6eErphbB_Lb2cS8l1AV08aV27rR1HE27fvvPju8F8bXA6_mS-x/s1600/Screenshot+from+2013-09-09+23:25:55.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;382&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhME8qyn9jZL2UBJYsTdN3CGs9q44HIywZ4o1CizS8ZMEABa9_EXk0DriIv6X1Iwhu8fziq8jfaUCeehZb3XvSzrymLsP6eErphbB_Lb2cS8l1AV08aV27rR1HE27fvvPju8F8bXA6_mS-x/s640/Screenshot+from+2013-09-09+23:25:55.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
See the ad on the right that has been highlighted. The title is &#39;Openstack&#39;. But the link points to www.windowsazure.com. Is this some false and misleading marketing strategy from Redmond to gain clicks and hits? Or does Redmond offer Openstack on its platform? Hardly so.&lt;br /&gt;
&lt;br /&gt;
I rest my case.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/1526970945046621340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2013/09/openstack-on-windows-azure.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/1526970945046621340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/1526970945046621340'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2013/09/openstack-on-windows-azure.html' title='OpenStack on Windows Azure?'/><author><name>Sheikh Sajid</name><uri>http://www.blogger.com/profile/11365341442254116504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhME8qyn9jZL2UBJYsTdN3CGs9q44HIywZ4o1CizS8ZMEABa9_EXk0DriIv6X1Iwhu8fziq8jfaUCeehZb3XvSzrymLsP6eErphbB_Lb2cS8l1AV08aV27rR1HE27fvvPju8F8bXA6_mS-x/s72-c/Screenshot+from+2013-09-09+23:25:55.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-4762851738452328438</id><published>2013-04-10T15:12:00.000+05:30</published><updated>2013-04-10T15:12:38.186+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="modularity"/><category scheme="http://www.blogger.com/atom/ns#" term="opendaylight"/><category scheme="http://www.blogger.com/atom/ns#" term="osgi"/><category scheme="http://www.blogger.com/atom/ns#" term="plugins"/><category scheme="http://www.blogger.com/atom/ns#" term="protocols"/><category scheme="http://www.blogger.com/atom/ns#" term="review"/><title type='text'>Java sees Daylight in the Open</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;With &lt;a href=&quot;http://en.wikipedia.org/wiki/Software-defined_networking&quot; target=&quot;_blank&quot;&gt;Software Defined Networking&lt;/a&gt; (or SDN in short) gaining huge traction over the past few years, numerous&amp;nbsp;start-ups,&amp;nbsp; protocols, frameworks and other applications have started coming up every few weeks. With this also came numerous efforts to standardize around this concept, chief among them being the &lt;a href=&quot;http://www.opennetworking.org/&quot; target=&quot;_blank&quot;&gt;Open Networking Foundation&lt;/a&gt;. Last week saw the emergence of another standards group (rather self-proclaimed) consisting of industry leading networking companies to launch the&amp;nbsp;&lt;a href=&quot;http://www.opendaylight.org/&quot; target=&quot;_blank&quot;&gt;OpenDaylight&lt;/a&gt; project. The OpenDaylight project is an open source effort similar to the &lt;a href=&quot;http://www.openstack.org/&quot; target=&quot;_blank&quot;&gt;OpenStack&lt;/a&gt; project to&amp;nbsp;collaborate&amp;nbsp;on SDN related technologies. An extract from the OpenDaylight describing its motivation:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif;&quot;&gt;&quot; At this early stage of SDN adoption, the industry acknowledges the benefits of establishing an open, reference framework for programmability and control through an open source SDN solution. Such a framework maintains the flexibility and choice to allow organizations to deploy SDN as they please, yet still mitigates many of the risks of adopting early stage technologies and integrating with existing infrastructure investments.&lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif;&quot;&gt;With OpenDaylight, a community has come together to fill this need through the combination of open community developers and open source code and project governance that guarantees an open, community decision making process on business and technical issues. Establishing an open source project in this way is designed to help accelerate the development of technology available to users and enable widespread adoption of Software-Defined Networking. &quot;&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;This is indeed a good development but as long as all groups collaborate with each other rather than compete against each other, which will lead to fragmentation and higher cost of implementation and deployment.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;However, what is interesting about this project is the use of Java for one of their central component! Yes, for all the cries of Java being dead, we see a new far-reaching project adopt Java as one of their underlying technology. This is indeed good news for the Java platform as well as the greater Java community. &amp;nbsp;This &lt;u&gt;underlines&lt;/u&gt;&amp;nbsp;the strength, robustness and applicability of the Java technology for myriad platforms. The architecture of the OpenDaylight project is reproduced below:&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.opendaylight.org/sites/www.opendaylight.org/files/pages/images/od_diagram3_rev6_0.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;299&quot; src=&quot;http://www.opendaylight.org/sites/www.opendaylight.org/files/pages/images/od_diagram3_rev6_0.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Java is used for the Controller platform described above. See this &lt;a href=&quot;https://wiki.opendaylight.org/view/OpenDaylight_Controller:Architectural_Framework&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt; for an architectural overview. Interestingly, as well, &lt;a href=&quot;http://www.osgi.org/Main/HomePage&quot; target=&quot;_blank&quot;&gt;OSGi&lt;/a&gt;&amp;nbsp;is also used by the Controller framework. OSGi is a dynamic modular framework for Java which has also been steadily gaining limelight in recent Java developments. OSGi enables the Service Abstraction Layer because of its modular and extensible nature.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://wiki.opendaylight.org/images/9/93/Service_Abstraction_Layer.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;272&quot; src=&quot;https://wiki.opendaylight.org/images/9/93/Service_Abstraction_Layer.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;There are indeed good times ahead for both the Java and OSGi community.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Happy daylighting!&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/4762851738452328438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2013/04/java-sees-daylight-in-open.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/4762851738452328438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/4762851738452328438'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2013/04/java-sees-daylight-in-open.html' title='Java sees Daylight in the Open'/><author><name>Sheikh Sajid</name><uri>http://www.blogger.com/profile/11365341442254116504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-8611552816150966618</id><published>2013-01-09T15:35:00.000+05:30</published><updated>2013-01-09T15:35:02.754+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="expando"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="Liferay"/><title type='text'>Liferay Expando Services</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;a _cke_saved_href=&quot;http://www.liferay.com&quot; href=&quot;http://www.liferay.com/&quot; style=&quot;color: #5b677d;&quot;&gt;Liferay&lt;/a&gt;&amp;nbsp;provides a mechanism to create tables, columns, rows and values dynamically. It provides these features through the Expando services. The mechanism is supported by using four database tables: ExpandoTable, ExpandoColumn, ExpandoRow and ExpandoValue.&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Creating tables dynamically&lt;/h3&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
The class com.liferay.portlet.expando.service.ExpandoTableLocalServiceUtil allows creation of dynamic tables.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
To create a new table, call:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoTable table = ExpandoTableLocalServiceUtil.addTable(&amp;lt;companyId&amp;gt;, &amp;lt;className&amp;gt;, &amp;lt;tableName&amp;gt;);&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Parameters:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;companyId&amp;gt; (Type: long) – The company id for the table. To get the company id, call&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
long companyId = CompanyLocalServiceUtil.getCompanies().get(0).getCompanyId();&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;className&amp;gt; (Type: String) – The class name should be the fully qualified class name of the java class that you are trying to save to database.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;tableName&amp;gt; (Type: String) – The name of the dynamic table to create.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
A new row is added to the ExpandoTable table.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Creating columns dynamically&lt;/h3&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
The class com.liferay.portlet.expando.service.ExpandoColumnLocalServiceUtil allows creation of dynamic columns.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
To create a new column, call:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoColumn column = ExpandoColumnLocalServiceUtil.addColumn(&amp;lt;tableId&amp;gt;, &amp;lt;columnName&amp;gt;, &amp;lt;type&amp;gt;);&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Parameters:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;tableId&amp;gt; (Type: long) – The table id for which to create column.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;columnName&amp;gt; (Type: String) – The name of the column.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;type&amp;gt; (Type: int) – The data type of the column. Use the ExpandoColumnConstants to specify the data type. For example, ExpandoColumnConstants.STRING;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
A new row is added to the ExpandoColumn table.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Creating rows dynamically&lt;/h3&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
The class com.liferay.portlet.expando.service.ExpandoRowLocalServiceUtil allows creation of dynamic rows.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
To create a new row, call:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoRow row = ExpandoRowLocalServiceUtil.addRow(&amp;lt;tableId&amp;gt;, &amp;lt;classPK&amp;gt;);&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Parameters:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;tableId&amp;gt; (Type: long) – The table id for which to create row.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;classPK&amp;gt; (Type: long) – The classPK .&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
A new row is added to the ExpandoRow table.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Storing values in a dynamic table&lt;/h3&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
The class com.liferay.portlet.expando.service.ExpandoValueLocalServiceUtil allows storing values for dynamic tables.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
To store a value, call:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoValue&lt;br /&gt;value = ExpandoValueLocalServiceUtil.addValue(&amp;lt;classNameId&amp;gt;,&lt;br /&gt;&amp;lt;tableId&amp;gt;, &amp;lt;columnId&amp;gt;, &amp;lt;classPK&amp;gt;, &amp;lt;value&amp;gt;);&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Parameters:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;classNameId&amp;gt; (Type: long) – The class name id.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;tableId&amp;gt; (Type: long) – The table id for which to store value.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;columnId&amp;gt; (Type: long) – The column id of the table for which to store value.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;classPK&amp;gt; (Type: long) – The classPK .&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&amp;lt;value&amp;gt; (Type: String) – The value to be stored .&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
A new row is added to the ExpandoValue table. There are several variations of the addValue API to store different data types.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Removing dynamic entities&lt;/h3&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Delete Table:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoTableLocalServiceUtil.deleteTable(long &amp;lt;tableId&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Delete Column:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoColumnLocalServiceUtil.deleteColumn(long &amp;lt;columnId&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Delete Row:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoRowLocalServiceUtil.deleteRow(long &amp;lt;rowId&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Delete Value:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoValueLocalServiceUtil.deleteValue(long&amp;lt;valueId&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
The above APIs for each entity is the simplest one. There are other variations depending on the parameters. The above APIs only removes the corresponding entity. It does not remove the related entities. For example, deleting table does not automatically delete the columns, rows and values.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Updating dynamic entities&lt;/h3&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Update Table:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoTableLocalServiceUtil.updateTable(long &amp;lt;tableId&amp;gt;, String &amp;lt;name&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoTableLocalServiceUtil.updateExpandoTable(ExpandoTable &amp;lt;table&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Update Column:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoColumnLocalServiceUtil.updateColumn(&amp;lt;...&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoColumnLocalServiceUtil.updateExpandoColumn(&amp;lt;...&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Update Row:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoRowLocalServiceUtil.updateExpandoRow(&amp;lt;...&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Update Value:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoValueLocalServiceUtil.updateExpandoValue(&amp;lt;...&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Searching for entities&lt;/h3&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Search Table:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoTableLocalServiceUtil.getTable(&amp;lt;...&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoTableLocalServiceUtil.getExpandoTable(long &amp;lt;tableId&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Search Column:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoColumnLocalServiceUtil.getColumn(&amp;lt;...&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoColumnLocalServiceUtil.getExpandoColumn(long &amp;lt;columnId&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Search Row:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoRowLocalServiceUtil.getRow(&amp;lt;...&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoRowLocalServiceUtil.getExpandoRow(long &amp;lt;rowId&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Search Value:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoValueLocalServiceUtil.getValue(&amp;lt;...&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoValueLocalServiceUtil.getExpandoValue(long &amp;lt;valueId&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
ExpandoValueLocalServiceUtil.getData(&amp;lt;...&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
Dynamic queries&lt;/h3&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
For dynamic queries, all the Local service util provide 2 APIs:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Expando[Table|Column|Row|Value]LocalServiceUtil.dynamicQuery(&amp;lt;...&amp;gt;)&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: verdana; font-size: 11px; line-height: 1.5; margin-bottom: 1em; padding: 0px;&quot;&gt;
Expando[Table|Column|Row|Value]LocalServiceUtil.dynamicQueryCount(DynamicQuery &amp;lt;dynamicQuery&amp;gt;)&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/8611552816150966618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2013/01/liferay-expando-services.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/8611552816150966618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/8611552816150966618'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2013/01/liferay-expando-services.html' title='Liferay Expando Services'/><author><name>Sheikh Sajid</name><uri>http://www.blogger.com/profile/11365341442254116504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-4158107220046016243</id><published>2012-08-26T00:07:00.000+05:30</published><updated>2012-08-26T00:13:04.640+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="coin slider"/><category scheme="http://www.blogger.com/atom/ns#" term="coin-slider"/><category scheme="http://www.blogger.com/atom/ns#" term="coinslider"/><category scheme="http://www.blogger.com/atom/ns#" term="design"/><category scheme="http://www.blogger.com/atom/ns#" term="Liferay"/><category scheme="http://www.blogger.com/atom/ns#" term="web"/><title type='text'>Integrating Coin Slider with Liferay 6.1.1 with zero development</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In my previous &lt;a href=&quot;http://myjavaexp.blogspot.in/2010/11/integrating-coin-slider-with-liferay.html&quot;&gt;blog&lt;/a&gt;, I demonstrated how to integrate the Coin Slider library in a Liferay portlet without having to develop any portlet. Coin Slider is a jQuery based image slider with many effects for image transition. That demonstration was based on Liferay 6.0.5. With Liferay 6.1.1 now &lt;a href=&quot;http://www.liferay.com/downloads/liferay-portal/available-releases&quot; target=&quot;_blank&quot;&gt;available&lt;/a&gt;, I decided to try my own example and see whether the steps still hold true for the latest version of Liferay. And guess what, it does! That&#39;s the power of Liferay! Congratulations to the Liferay Team!&lt;br /&gt;
&lt;br /&gt;
So here I demonstrate the same example with updated screenshots for the&amp;nbsp;benefit&amp;nbsp;of the community.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;color: red; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;Note: This solution is based on Liferay 6.1.1&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Download and extract the latest version of the Coin Slider library from &lt;a href=&quot;http://workshop.rs/projects/coin-slider/&quot; target=&quot;_blank&quot;&gt;http://workshop.rs/projects/coin-slider/ &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;Liferay now has a single Library for storing both documents, images, video and any other media files. Create a folder &lt;i&gt;slideshow&lt;/i&gt; in the Document and Media library of the community where you want to use the slider. Add the files c&lt;i&gt;oin-slider-min.js&lt;/i&gt;, &lt;i&gt;coin-slider-styles.css&lt;/i&gt;, &lt;i&gt;jquery-1.8.0.min.js&lt;/i&gt; to the &lt;i&gt;slideshow&lt;/i&gt; folder. Create a new file &lt;i&gt;javascript.js&lt;/i&gt; file in filesystem. Add the following code to this file:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;$(document).ready(function() { &lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&quot;#coin-slider&quot;).coinslider({ hoverPause: false }); &lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Upload the &lt;i&gt;javascript.js&lt;/i&gt; file to the &lt;i&gt;slideshow&lt;/i&gt;&amp;nbsp;library. The &lt;i&gt;slideshow&lt;/i&gt; folder should now look like this:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBDNdC5jQQCaJBxWOnTc25Et0B5JTIuPPScl9QJEXFnxeuMLqFd6GSk-fOE5hnPTFsXWNNkPF7Ci9Gts47jjK4fyqEPW0W-R4-xX8hWtf4zwjobDcn1aWYWyyzG3dl9HhCQeu_E7pTC-xG/s1600/screenshot1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;290&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBDNdC5jQQCaJBxWOnTc25Et0B5JTIuPPScl9QJEXFnxeuMLqFd6GSk-fOE5hnPTFsXWNNkPF7Ci9Gts47jjK4fyqEPW0W-R4-xX8hWtf4zwjobDcn1aWYWyyzG3dl9HhCQeu_E7pTC-xG/s640/screenshot1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Next, upload few images that you want to display in the slider in the Document and Media Library.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdVHfcAj9vlVYEGgPfIeThnuMKThVDe0TZ1BMMuSnmIIjGjdWiglYLQCg7eZdqpKrq8dPPQKCHed8CLK-iqbRpGOxZruGQQ7xBDldupqRmPtIKFaP7TftLzpTDKuLhC7BFedeqC8hoowFN/s1600/screenshot1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;338&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdVHfcAj9vlVYEGgPfIeThnuMKThVDe0TZ1BMMuSnmIIjGjdWiglYLQCg7eZdqpKrq8dPPQKCHed8CLK-iqbRpGOxZruGQQ7xBDldupqRmPtIKFaP7TftLzpTDKuLhC7BFedeqC8hoowFN/s640/screenshot1.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
There are 8 images in the library above.&lt;br /&gt;
&lt;br /&gt;
Now create a new web content structure. Name it &lt;i&gt;coin-slideshow&lt;/i&gt;. Add xml schema definition to the structure as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6cKnXUxqU2u-_XZz3YKncL_ni6IhNecKBt47JeF_NpQK17zDcOJtbsNUvL0cTgS6KJYYqnvZV8KTMoIiiMRr7CW_dgKgHqbWG3jHsyg7jOdqtaPhUM1MNpF4B0eYUXh5jiRwB2Lpj6L9W/s1600/screenshot2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;260&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6cKnXUxqU2u-_XZz3YKncL_ni6IhNecKBt47JeF_NpQK17zDcOJtbsNUvL0cTgS6KJYYqnvZV8KTMoIiiMRr7CW_dgKgHqbWG3jHsyg7jOdqtaPhUM1MNpF4B0eYUXh5jiRwB2Lpj6L9W/s640/screenshot2.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Click &lt;i&gt;Save&lt;/i&gt; when done.&lt;br /&gt;
&lt;br /&gt;
Create a new web content template and name it &lt;i&gt;coin-slideshow-template&lt;/i&gt;. Select &lt;i&gt;coin-slideshow&lt;/i&gt; as the structure for the new template. Click the L&lt;i&gt;aunch Editor &lt;/i&gt;button. In the dialog that appears, paste the following code:&lt;/div&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;lt;link href=&quot;$css.getData()&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;$jquery.getData()&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;$coinjs.getData()&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;$slidestart.getData()&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&quot;coin-slider&quot;&amp;gt;&lt;br /&gt;
#foreach ($item in $slide.getSiblings())&lt;br /&gt;
&amp;nbsp;&amp;nbsp; #foreach ( $itemData in $item.getChildren() )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#if ( &quot;$itemData.getName()&quot; == &quot;href&quot; )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#set ( $href = $itemData.getData() )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#elseif ( &quot;$itemData.getName()&quot; == &quot;img_src&quot; )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#set ( $img_src = $itemData.getData() )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#elseif ( &quot;$itemData.getName()&quot; == &quot;description&quot; )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#set ( $description = $itemData.getData() )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#end&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#end&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;a href=&quot;$href&quot;&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;img src=&quot;$img_src&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;gt;$description&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/a&amp;gt;&lt;br /&gt;
#end&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
Click &lt;i&gt;Update&lt;/i&gt; button when done. Click &lt;i&gt;Save&lt;/i&gt; again in the main dialog.&lt;br /&gt;
&lt;br /&gt;
Now is the time to add the slider in our page. Add &lt;i&gt;Web Content Display&lt;/i&gt; portlet to the page where you want the slider. Click the &lt;i&gt;Add Web Content&lt;/i&gt; link in the portlet to create content for the portlet. In the new dialog box, give a name to the content, say &lt;i&gt;Slideshow&lt;/i&gt;. Change the structure of the web content by clicking the &lt;i&gt;Choose&lt;/i&gt; button under the &lt;i&gt;Structure&lt;/i&gt; section on the right. Select the structure &lt;i&gt;coin-slideshow&lt;/i&gt; that we created earlier. This will automatically choose the template that we associated with the structure. Instead of the HTML editor, a web form with fields are shown.&lt;br /&gt;
&lt;br /&gt;
In the &lt;i&gt;css&lt;/i&gt; field, choose the &lt;i&gt;coin-slider-styles.css&lt;/i&gt; from the document library. Similarly, choose &lt;i&gt;jquery-1.4.2.min.js&lt;/i&gt; for &lt;i&gt;jquer&lt;/i&gt;y field, &lt;i&gt;coin-slider-min.js&lt;/i&gt; for &lt;i&gt;coinjs&lt;/i&gt; field and &lt;i&gt;javascript.js&lt;/i&gt; for &lt;i&gt;coinstart&lt;/i&gt; field. For the first slide, name it &lt;i&gt;slide1&lt;/i&gt;. Select a image from the&amp;nbsp;Document and Media Library&amp;nbsp;for the &lt;i&gt;img_src&lt;/i&gt; field. Select target location when an image is clicked from the dropdown list for the &lt;i&gt;href&lt;/i&gt; field. Type some text to be displayed for the image in the &lt;i&gt;description&lt;/i&gt; field. Similarly, add more slides for each image that you want to be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHxyuJeut1-VaA_PbUMzUn5h2ncYGutxhpsQlGldjEEDj-X27xTC7fFWoqMxkV103jt20MaOIY2P5EU98_pSobCCQm3qbEj13sHCEWQnJ-ny5eDIO1rsZzbtZC5qeNqwEeLVC4u0I1_CA_/s1600/screenshot4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHxyuJeut1-VaA_PbUMzUn5h2ncYGutxhpsQlGldjEEDj-X27xTC7fFWoqMxkV103jt20MaOIY2P5EU98_pSobCCQm3qbEj13sHCEWQnJ-ny5eDIO1rsZzbtZC5qeNqwEeLVC4u0I1_CA_/s400/screenshot4.jpg&quot; width=&quot;387&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfuUO9ciPyE-TXzIV-r97WJqx5yfaqN2iGlOaEr6eiVy8Oi2UKC6AuRee8HtWVhvcTKCEr-db3EXxS4jfPoNEP1kbWykncTKdhrRHb-V_066agVdCYYJTQ_6fDsNPIJsZ9P25x0CFj8rxp/s1600/screenshot5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;305&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfuUO9ciPyE-TXzIV-r97WJqx5yfaqN2iGlOaEr6eiVy8Oi2UKC6AuRee8HtWVhvcTKCEr-db3EXxS4jfPoNEP1kbWykncTKdhrRHb-V_066agVdCYYJTQ_6fDsNPIJsZ9P25x0CFj8rxp/s400/screenshot5.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Click &lt;i&gt;Publish&lt;/i&gt; button to save the content and make it viewable.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrBXh9Ulp3iZ-seQQM8SiN3lCNMlh5zDULKDkwIyYCtSq1dzB0OQ6OfExEX5qMK3VOYMJJJRHnImGAHCfFIlswbuPtuF1S09tQn465ukJwTBcVZ4I6_GI6ZU0SUtQjYyVQhggebtL6MzOr/s1600/screenshot3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrBXh9Ulp3iZ-seQQM8SiN3lCNMlh5zDULKDkwIyYCtSq1dzB0OQ6OfExEX5qMK3VOYMJJJRHnImGAHCfFIlswbuPtuF1S09tQn465ukJwTBcVZ4I6_GI6ZU0SUtQjYyVQhggebtL6MzOr/s640/screenshot3.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/4158107220046016243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2012/08/integrating-coin-slider-with-liferay.html#comment-form' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/4158107220046016243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/4158107220046016243'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2012/08/integrating-coin-slider-with-liferay.html' title='Integrating Coin Slider with Liferay 6.1.1 with zero development'/><author><name>Sheikh Sajid</name><uri>http://www.blogger.com/profile/11365341442254116504</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiBDNdC5jQQCaJBxWOnTc25Et0B5JTIuPPScl9QJEXFnxeuMLqFd6GSk-fOE5hnPTFsXWNNkPF7Ci9Gts47jjK4fyqEPW0W-R4-xX8hWtf4zwjobDcn1aWYWyyzG3dl9HhCQeu_E7pTC-xG/s72-c/screenshot1.jpg" height="72" width="72"/><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-1085595397955355941</id><published>2011-06-14T11:04:00.000+05:30</published><updated>2011-06-14T11:04:11.473+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="greenscape"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="nosql"/><category scheme="http://www.blogger.com/atom/ns#" term="orientdb"/><category scheme="http://www.blogger.com/atom/ns#" term="sql"/><title type='text'>OrientDB - Pure Java NoSQL Datastore</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;I have been following the so-called &#39;NoSQL movement&#39; (as if such a movement exists!). In my opinion, it is just another way of storing and retrieving data. And this new (rather different, I am sure the method is not new) way is only suitable for certain type of applications. Not all applications require NoSQL-type storage and retrieval regardless of those who claim it to be. SQL and NoSQL complement each other. They are not rivals.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Having said that, I was pretty much interested in the concepts. I love trying out new things. While I was planning the design and architecture of a new open source project that I intend to develop (It is not exactly new. I have already started it but now plan to move it to a new architecture - &lt;a href=&quot;http://greenscape.sourceforge.net/&quot;&gt;Greenscape&lt;/a&gt;), one of the choices I had to make was on the data storage. My application will be highly dynamic with ability of end users to add and remove columns to a database table frequently. Doing it in relational database will incur heavy performance and complexity. After much consideration, I decided that a non-relational database will be the best choice for my application. But this choice is not without its share of challenges:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;I loose JPA/Hibernate support which means I may have to come up with an equivalent framework.&lt;/li&gt;
&lt;li&gt;I loose portability. NoSQL is non-standard. There is no standard query language. There are no standard protocol. So, tomorrow, I cannot replace the database with a better performing one without rewriting my application.&lt;/li&gt;
&lt;li&gt;Few documentation. What are the best practices, design patterns, etc?&lt;/li&gt;
&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;In spite of the challenges, I went ahead with my choice. The compelling reason was the ability to create knowledge because of the void.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Now that the decision was made, I had to choose a NoSQL database. I analysed all the popular ones but none fitted my requirements. I had one criteria for selecting a database: I must be able to code in Java. Most available systems were non-Java based which would be a significant issue for a one man project. Even if they had Java interface, the installation, setup, etc. were a tedious process. Having a database developed purely in Java has many advantages:&lt;/div&gt;&lt;ol&gt;&lt;li&gt;Easy packaging with other applications&lt;/li&gt;
&lt;li&gt;Easy to install and run&lt;/li&gt;
&lt;li&gt;Can be embedded&lt;/li&gt;
&lt;li&gt;Can run in same or different VM&lt;/li&gt;
&lt;li&gt;Easy to debug&lt;/li&gt;
&lt;li&gt;Easy to test&lt;/li&gt;
&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;After much searching, I came across &lt;a href=&quot;http://www.orientechnologies.com/&quot;&gt;OrientDB&lt;/a&gt;. Voila! That was what I needed! Going through its features only reinforced by belief in it. It is a pure Java solution and very small in size (&lt;strike&gt;500KB!&lt;/strike&gt;&amp;nbsp;2MB since last release) . It can be embedded as well as deployed in networked mode. &lt;b&gt;It is both schema-less and schema-based! &lt;/b&gt;This topped the feature list. It also supports SQL as a query language (Hmm, need to call NoSQL by some other name).&lt;br /&gt;
&lt;br /&gt;
Some of the features taken from its &lt;a href=&quot;http://www.orientechnologies.com/orient-db.htm&quot;&gt;homepage&lt;/a&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;SQL&lt;/li&gt;
&lt;li&gt;Super fast&lt;/li&gt;
&lt;li&gt;Transactional&lt;/li&gt;
&lt;li&gt;GraphDB&lt;/li&gt;
&lt;li&gt;Web ready (HTTP, REST, JSON)&lt;/li&gt;
&lt;li&gt;Everywhere (Pure Java)&lt;/li&gt;
&lt;li&gt;Extremely light&lt;/li&gt;
&lt;li&gt;Apache License (Here&#39;s the money)&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;End of architecture choice 1 for Greenscape.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Next decision on application framework pending.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/1085595397955355941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2011/06/orientdb-pure-java-nosql-datastore.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/1085595397955355941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/1085595397955355941'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2011/06/orientdb-pure-java-nosql-datastore.html' title='OrientDB - Pure Java NoSQL Datastore'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-1791625592236079033</id><published>2011-02-19T13:25:00.004+05:30</published><updated>2011-02-23T12:14:07.917+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="desktop"/><category scheme="http://www.blogger.com/atom/ns#" term="desktop platform"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="javase"/><category scheme="http://www.blogger.com/atom/ns#" term="module"/><category scheme="http://www.blogger.com/atom/ns#" term="services"/><title type='text'>Grow Up Java! Proposing Java Desktop Edition</title><content type='html'>&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;No, this is not another &#39;Java is Dead&#39; rant. Java is very much alive and kicking. It is one of the best development and runtime platform available. By far the most stable platform of those. And that might just be its biggest bane. Ridiculous! How is stability a bane? You might ask. Well, you can see the slow progress in path breaking innovation, due to it. See the debate on closures and the progress on module system/OSGI.&lt;br /&gt;
&lt;br /&gt;
The Java platform is growing only by a few APIs and small language changes/additions every year. There is no major big innovation happening. All the major changes that has been happening are outside it. Be it the&amp;nbsp; Dependency Injection, Persistence API, Scripting API, Desktop API, Application Framework API, they were only added to the platform subsequently. But they are just APIs. What we need is something big. Something that is 10 years advanced than today.&lt;br /&gt;
&lt;br /&gt;
What I feel is Java is advancing in a bottom-up fashion. Small and slow changes at a time. What we need is a top-down approach. Think futuristic, design it and then only implement it in a bottom-up approach.&lt;br /&gt;
&lt;br /&gt;
Take the example of new Swing Application Framework (now dropped from  the standard). I think this new framework is a poorly envisioned idea.  Look at the poor state of JMF. No substantial progress can be made on  the desktop without support for multimedia. Yes, JavaFX is coming soon  (for 3+ years ?). It is a big step forward but is not a standard (yet.  Will it be ever?).&lt;br /&gt;
&lt;br /&gt;
We have the JavaSE and JavaEE is built on top of it. Why can&#39;t we do the same with the desktop? Why can&#39;t we have something like the Java Desktop Edition or JavaDE ? Put all the big stuffs here. In this way, we can keep the JavaSE simple. Language and VM changes goes into JavaSE. Common APIs applicable to both EE and &#39;DE&#39; goes into SE. But desktop additions like application framework, multimedia, browsing capabilities, gadget bar?, JavaFX, etc. goes into &#39;DE&#39;. Of course, JavaME also needs to be considered but since industry&#39;s mood is to bring SE to ME, they can be considered the same for the sake of this blog.&lt;br /&gt;
&lt;br /&gt;
Some might argue that the desktop is becoming irrelevant with the popularity of web applications and powerful browsers (with HTML 5). But as any unbiased report will say, the irrelevance of desktop will not happen anytime soon. After all, the browser needs to run on a desktop!&lt;br /&gt;
&lt;br /&gt;
Basically, Java Desktop Edition becomes the new Operating System. It should have transparent integration with the underlying OS. Have functionalities in the form of services and modules on the lines of OSGI. So everything is a service: print service, document service, file service, graphic service, database service, &amp;lt; add your favorite services here &amp;gt;. So advanced capabilities can be exposed as a service to any module or applications (collection of modules) in the system. Imagine having Eclipse plugins as services exposed to all applications.&lt;br /&gt;
&lt;br /&gt;
Think of the innovative possibilities of a Java Desktop (heard it before?):&lt;br /&gt;
- Java Browser with built-in support for applets, JavaFX - we can have applet plugins&lt;br /&gt;
- Browser can be embedded in any application&lt;br /&gt;
- GIMP like editor - JIMP?&lt;br /&gt;
- Standard installer for all applications -  No OS specific versions of Eclipse or Netbeans (Java WAS supposed to be Write Once, Run Everywhere)&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;- Finally, a Java media player&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;- Desktop gadget bar&lt;/div&gt;&lt;div style=&quot;font-family: inherit; text-align: justify;&quot;&gt;- Java Office&lt;br /&gt;
- &amp;lt; your favorite application here &amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is time for Java to grow up and act its age. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/1791625592236079033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2011/02/grow-up-java-proposing-java-desktop.html#comment-form' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/1791625592236079033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/1791625592236079033'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2011/02/grow-up-java-proposing-java-desktop.html' title='Grow Up Java! Proposing Java Desktop Edition'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-2645746912262237076</id><published>2011-01-27T16:24:00.001+05:30</published><updated>2011-01-27T16:27:19.643+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="gis"/><category scheme="http://www.blogger.com/atom/ns#" term="google maps"/><category scheme="http://www.blogger.com/atom/ns#" term="Liferay"/><category scheme="http://www.blogger.com/atom/ns#" term="Liferay integration"/><category scheme="http://www.blogger.com/atom/ns#" term="mashup"/><category scheme="http://www.blogger.com/atom/ns#" term="smashup"/><category scheme="http://www.blogger.com/atom/ns#" term="travel"/><category scheme="http://www.blogger.com/atom/ns#" term="travel planning"/><title type='text'>Liferay (s)mashup - Google Maps</title><content type='html'>&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;div align=&quot;JUSTIFY&quot;&gt;Part One - &lt;a href=&quot;http://myjavaexp.blogspot.com/2010/12/liferay-smashup-beginning.html&quot; id=&quot;aui-3-2-0PR1-1837&quot;&gt;Liferay (s)mashup - The Beginning &lt;/a&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot;&gt;In the previous blog, we saw how to fire events asynchronously on the client side. In this blog, we will see the integration of &lt;a href=&quot;http://maps.google.com/&quot;&gt;Google Maps&lt;/a&gt; in a portlet.&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot;&gt;Showing Google Maps in a portlet is a breeze. For this, create a portlet called &#39;Visual View&#39;. This portlet displays the Google Map for visual interaction. It receives the source and destination from the Plan Your Travel portlet and shows the road route in the map.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggZpvDKpvG_inS16fgY2SZ00tWBl2Q7ZYQGS24GrBK6Olq1EUq-z9eYkyt8swcm6ixrcdyfoQicl-lLfLHiaPJlexse7p3tpSPo5jimFdK0hmfzgNNAQKfYzdmLifupgSCKMWE4sJsUQU/s1600/map.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggZpvDKpvG_inS16fgY2SZ00tWBl2Q7ZYQGS24GrBK6Olq1EUq-z9eYkyt8swcm6ixrcdyfoQicl-lLfLHiaPJlexse7p3tpSPo5jimFdK0hmfzgNNAQKfYzdmLifupgSCKMWE4sJsUQU/s1600/map.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot;&gt;&lt;/div&gt;&lt;h2&gt;Using Google Maps API&lt;/h2&gt;&lt;div align=&quot;JUSTIFY&quot;&gt;Google Maps API is a collection of web services providing geographic data for creating maps applications. These web services use HTTP requests to specific URLs, passing URL parameters as arguments to the services. Generally, these services return data in the HTTP request as either JSON or XML for parsing and/or processing by an application.&amp;nbsp; Let&#39;s get straight to the code.&lt;/div&gt;&lt;h2&gt;Code Listing&lt;/h2&gt;&lt;pre class=&quot;brush: js; toolbar: false;&quot;&gt;&amp;lt;%@ taglib uri=&quot;http://java.sun.com/portlet_2_0&quot; prefix=&quot;portlet&quot;%&amp;gt;
&amp;lt;portlet:defineObjects /&amp;gt;
&amp;lt;style type=&quot;text/css&quot;&amp;gt;
#map_canvas {
    height: 500px;
    width: 400px
}
&amp;lt;/style&amp;gt;

&amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;var &amp;lt;portlet:namespace /&amp;gt;map;
&amp;nbsp;&amp;nbsp; &amp;nbsp;var &amp;lt;portlet:namespace /&amp;gt;geocoder;
&amp;nbsp;&amp;nbsp; &amp;nbsp;var &amp;lt;portlet:namespace /&amp;gt;directionDisplay;
&amp;nbsp;&amp;nbsp; &amp;nbsp;var &amp;lt;portlet:namespace /&amp;gt;directionsService;
&amp;nbsp;&amp;nbsp; &amp;nbsp;var &amp;lt;portlet:namespace /&amp;gt;rendererOptions = {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; draggable : true //make the map points draggable
&amp;nbsp;&amp;nbsp; &amp;nbsp;};
&amp;nbsp;&amp;nbsp; &amp;nbsp;var &amp;lt;portlet:namespace /&amp;gt;initialLocation;
&amp;nbsp;&amp;nbsp; &amp;nbsp;var &amp;lt;portlet:namespace /&amp;gt;infowindow;

&amp;nbsp;&amp;nbsp; &amp;nbsp;function &amp;lt;portlet:namespace /&amp;gt;initialize() {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var myLatlng = new google.maps.LatLng(-34.397, 150.644);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var myOptions = {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; zoom : 8,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; center : myLatlng,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mapTypeId : google.maps.MapTypeId.ROADMAP
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };

&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;map = new google.maps.Map(document.getElementById(&quot;map_canvas&quot;), myOptions);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;geocoder = new google.maps.Geocoder();
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;directionsService = new google.maps.DirectionsService();
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;directionsDisplay = new google.maps.DirectionsRenderer(
                                                    &amp;lt;portlet:namespace /&amp;gt;rendererOptions);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;directionsDisplay.setMap(&amp;lt;portlet:namespace /&amp;gt;map);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;infowindow = new google.maps.InfoWindow();

&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //geo location
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Try W3C Geolocation method (Preferred)
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (navigator.geolocation) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; browserSupportFlag = true;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; navigator.geolocation.getCurrentPosition(function(position) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;initialLocation = new google.maps.LatLng(
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; position.coords.latitude, position.coords.longitude);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; contentString = &quot;Location found using W3C standard&quot;;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;map
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; .setCenter(&amp;lt;portlet:namespace /&amp;gt;initialLocation);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; var marker = new google.maps.Marker({
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; map : &amp;lt;portlet:namespace /&amp;gt;map,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; position : &amp;lt;portlet:namespace /&amp;gt;initialLocation
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }, function() {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;handleNoGeolocation(browserSupportFlag);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else if (google.gears) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;     // Try Google Gears Geolocation
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;     browserSupportFlag = true;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;     var geo = google.gears.factory.create(&#39;beta.geolocation&#39;);
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;     geo.getCurrentPosition(function(position) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;initialLocation = new google.maps.LatLng(
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; position.latitude, position.longitude);
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;         contentString = &quot;Location found using Google Gears&quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;         &amp;lt;portlet:namespace /&amp;gt;map.setCenter(&amp;lt;portlet:namespace /&amp;gt;initialLocation);
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;         &amp;lt;portlet:namespace /&amp;gt;infowindow.setContent(contentString);
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;         &amp;lt;portlet:namespace /&amp;gt;infowindow.setPosition(&amp;lt;portlet:namespace /&amp;gt;initialLocation);
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;         &amp;lt;portlet:namespace /&amp;gt;infowindow.open(&amp;lt;portlet:namespace /&amp;gt;map);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }, function() {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;handleNoGeolocation(browserSupportFlag);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // Browser doesn&#39;t support Geolocation
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; browserSupportFlag = false;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;handleNoGeolocation(browserSupportFlag);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //add listener for directions change
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; google.maps.event.addListener(
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;directionsDisplay,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &#39;directions_changed&#39;,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; function() {
                var leg = &amp;lt;portlet:namespace /&amp;gt;directionsDisplay.directions.routes[0].legs[0];
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Liferay.fire(&#39;directionsChanged&#39;, {
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; origin : leg.start_address,
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; destination : leg.end_address
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp; &amp;nbsp;}

&amp;nbsp;&amp;nbsp; &amp;nbsp;function &amp;lt;portlet:namespace /&amp;gt;handleNoGeolocation(errorFlag) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (errorFlag == true) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;initialLocation = newyork;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; contentString = &quot;Error: The Geolocation service failed.&quot;;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;initialLocation = siberia;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; contentString = &quot;Error: Your browser doesn&#39;t support geolocation. Are you in Siberia?&quot;;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;map.setCenter(&amp;lt;portlet:namespace /&amp;gt;initialLocation);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;infowindow.setContent(contentString);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;infowindow.setPosition(&amp;lt;portlet:namespace /&amp;gt;initialLocation);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;infowindow.open(&amp;lt;portlet:namespace /&amp;gt;map);
&amp;nbsp;&amp;nbsp; &amp;nbsp;}
&amp;nbsp;
&amp;nbsp;&amp;nbsp; &amp;nbsp;function &amp;lt;portlet:namespace /&amp;gt;loadScript() {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var script = document.createElement(&quot;script&quot;);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; script.type = &quot;text/javascript&quot;;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; script.src = &quot;http://maps.google.com/maps/api/js?sensor=false&amp;amp;callback=&amp;lt;portlet:namespace /&amp;gt;initialize&quot;;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.body.appendChild(script);
&amp;nbsp;&amp;nbsp; &amp;nbsp;}

&amp;nbsp;&amp;nbsp; &amp;nbsp;window.onload = &amp;lt;portlet:namespace /&amp;gt;loadScript;

&amp;nbsp;&amp;nbsp; &amp;nbsp;function &amp;lt;portlet:namespace /&amp;gt;showDirection(source, destination) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var request = {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; origin : source,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; destination : destination,
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; travelMode : google.maps.DirectionsTravelMode.DRIVING
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;directionsService.route(request, function(
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; response, status) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if (status == google.maps.DirectionsStatus.OK) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;directionsDisplay.setDirections(response);
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });
&amp;nbsp;&amp;nbsp; &amp;nbsp;}

&amp;nbsp;&amp;nbsp; &amp;nbsp;Liferay.on(&#39;planTravel&#39;, function(event) {
&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;portlet:namespace /&amp;gt;showDirection(event.origin, event.destination);
&amp;nbsp;&amp;nbsp; &amp;nbsp;});
&amp;lt;/script&amp;gt;

&amp;lt;div id=&quot;map_canvas&quot;&amp;gt;&amp;lt;/div&amp;gt;
&lt;/pre&gt;&lt;style type=&quot;text/css&quot;&gt;
p { margin-bottom: 0.21cm; }
&lt;/style&gt;&lt;br /&gt;
&lt;div align=&quot;JUSTIFY&quot; lang=&quot;en-US&quot;&gt;The Google Maps API requires a single div element with an id in the html page to be rendered. Here, we have given the id as &#39;map_canvas&#39;. The loadScript() method dynamically loads the maps script file. This speeds up the page display. The initialize() method loads the map view with pre-configured values. Also, latest versions of most browsers support geolocation. Geolocation allows tracking user&#39;s current location. This information is used to load the map with user&#39;s current location.&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; lang=&quot;en-US&quot;&gt;Note the listener for the directions changed event from the map in the initialize function. When the directions changed event occurs, we republish the event using &lt;a href=&quot;http://www.liferay.com/&quot;&gt;Liferay&lt;/a&gt;&#39;s event manager to notify other portlets. Other portlets receives this event to update their display. We saw this in the search form in the first part of this blog series.&lt;/div&gt;&lt;div align=&quot;JUSTIFY&quot; lang=&quot;en-US&quot;&gt;To use the two portlets that we have developed so far, type in the names of cities in the origin and destination and hit the Search button. The road rout between the two cities will be shown in the Google map. Now, try changing the cities by dragging the marker in the map. The cities&#39; names are updated in the Plan Your Travel portlet. We will see interesting applications of this event model in the next few portlets.&lt;/div&gt;For more details working on the Google Maps API, see &lt;a href=&quot;http://code.google.com/apis/maps/documentation/javascript/tutorial.html&quot;&gt;this&lt;/a&gt; and &lt;a href=&quot;http://code.google.com/apis/maps/documentation/javascript/basics.html&quot;&gt;this&lt;/a&gt;.&lt;br /&gt;
&lt;script&gt;
SyntaxHighlighter.all()
&lt;/script&gt;</content><link rel='enclosure' type='text/css' href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' length='0'/><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/2645746912262237076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2011/01/liferay-smashup-google-maps.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/2645746912262237076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/2645746912262237076'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2011/01/liferay-smashup-google-maps.html' title='Liferay (s)mashup - Google Maps'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggZpvDKpvG_inS16fgY2SZ00tWBl2Q7ZYQGS24GrBK6Olq1EUq-z9eYkyt8swcm6ixrcdyfoQicl-lLfLHiaPJlexse7p3tpSPo5jimFdK0hmfzgNNAQKfYzdmLifupgSCKMWE4sJsUQU/s72-c/map.png" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-174954395822801443</id><published>2010-12-29T11:33:00.007+05:30</published><updated>2011-01-27T16:30:02.636+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="gis"/><category scheme="http://www.blogger.com/atom/ns#" term="googl"/><category scheme="http://www.blogger.com/atom/ns#" term="google api"/><category scheme="http://www.blogger.com/atom/ns#" term="google maps"/><category scheme="http://www.blogger.com/atom/ns#" term="Liferay"/><category scheme="http://www.blogger.com/atom/ns#" term="mashup"/><category scheme="http://www.blogger.com/atom/ns#" term="planning"/><category scheme="http://www.blogger.com/atom/ns#" term="smashup"/><category scheme="http://www.blogger.com/atom/ns#" term="travel"/><category scheme="http://www.blogger.com/atom/ns#" term="travel planning"/><title type='text'>Liferay (s)mashup - The Beginning</title><content type='html'>&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;script src=&quot;http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;Part Two - &lt;a _cke_saved_href=&quot;http://www.mpowerglobal.com/web/sajid/home/-/blogs/liferay-s-mashup-google-maps?_33_redirect=http%3A%2F%2Fwww.mpowerglobal.com%2Fweb%2Fsajid%2Fhome%3Fp_p_id%3D33%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-2%26p_p_col_count%3D1&quot; href=&quot;http://myjavaexp.blogspot.com/2011/01/liferay-smashup-google-maps.html&quot;&gt;Liferay (s)mashup - Google Maps&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
There are many popular web services  available online. From the rich set of APIs from Google and Yahoo to  social sites likeTwitter and Facebook, almost all service providers make  available their services in the form of an open API. These rich APIs  has given rise to new kind of applications called &lt;i&gt;&lt;b&gt;mashups&lt;/b&gt;&lt;/i&gt;. They are basically an integration of various web APIs from different providers put together to form new kind of applications.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;In this and the next series of blogs, I will show how to integrate with some of these APIs.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;To make meaningful use of these APIs, let me propose a sample  application where these services can be used. Let us develop a travel  planning site that helps user to plan their travel dates and location.  Travelling is just not about location and date. There are other factors  like weather conditions, transport availabiity, political turmoil, other  events clashing with date. Questions such as &#39;&lt;i&gt;Are any of my friends travelling on that date or to that location?&lt;/i&gt;&#39;, &#39;&lt;i&gt;Do I know anyone from that location I am going to?&lt;/i&gt;&#39; frequently comes up. Our site will try to resolve these questions so that a probable date and location can be zeroed on.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;u&gt;Features of the Application&lt;/u&gt;&lt;br /&gt;
&amp;nbsp;- Display input form for receiving the source, destination, journey date and duration.&lt;br /&gt;
&amp;nbsp;- Show the road route of the origin and destination in Google map&lt;br /&gt;
&amp;nbsp;- Show weather information of origin and destination&lt;br /&gt;
&amp;nbsp;- Show the event happening in origin and destination on and around the journey date&lt;br /&gt;
&amp;nbsp;- Show news related to origin and destination&lt;br /&gt;
&amp;nbsp;- Moving the marker on the Google map must also update all other  information in real time like weather, events, news and&amp;nbsp; the input form.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&amp;nbsp;- More services as we go along&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;For the first requirement, create a new portlet. In the &lt;i&gt;view.jsp&lt;/i&gt; file, design a basic form&amp;nbsp; for the user to fill in: Origin, Destination, Journey Date and Duration.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMA0lsW8FTr1T3bHo91DZyeem9Vi_i8thzTl2WysiNKa5oejqJSST6z1yP0bToxwNBBnv2KxkNBlaaaMkVGlqSMB2jaUNfurH5UCveBpfiO2SZu13rd3kz-EPmCXeuBv-BYK-IVKsLliw/s1600/plantravel.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;207&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMA0lsW8FTr1T3bHo91DZyeem9Vi_i8thzTl2WysiNKa5oejqJSST6z1yP0bToxwNBBnv2KxkNBlaaaMkVGlqSMB2jaUNfurH5UCveBpfiO2SZu13rd3kz-EPmCXeuBv-BYK-IVKsLliw/s320/plantravel.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h3&gt;Code Listing&lt;/h3&gt;&lt;pre class=&quot;brush: html; toolbar: false;&quot;&gt;&amp;lt;form action=&quot;&amp;lt;liferay-portlet:actionURL portletConfiguration=&quot;true&quot; /&amp;gt;&quot; method=&quot;post&quot; name=&quot;&amp;lt;portlet:namespace /&amp;gt;fm&quot;&amp;gt;
    &amp;lt;aui:input name=&quot;origin&quot; label=&quot;Origin&quot; /&amp;gt;
    &amp;lt;aui:input name=&quot;destination&quot; label=&quot;Destination&quot; /&amp;gt;
    &amp;lt;aui:input name=&quot;journeyDate&quot; label=&quot;Journey Date&quot; /&amp;gt;
    &amp;lt;aui:input name=&quot;duration&quot; label=&quot;Duration&quot; suffix=&quot;(in days)&quot; /&amp;gt;
    &amp;lt;input type=&quot;button&quot; value=&quot;Search&quot; onclick=&quot;&amp;lt;portlet:namespace /&amp;gt;postPlanDetails()&quot; /&amp;gt;
&amp;lt;/form&amp;gt;&lt;/pre&gt;&lt;br /&gt;
The journeyDate is shown as a calendar when user clicks on the input field. Define it in javascript as:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;brush: js; toolbar: false;&quot;&gt;AUI().ready(&#39;aui-calendar&#39;, function(A) {
    var calendar1 = new A.Calendar({
        trigger : &#39;#&amp;lt;portlet:namespace /&amp;gt;journeyDate&#39;,
        dateFormat : &#39;%d/%m/%Y&#39;,
        setValue : true,
        selectMultipleDates : true,
        on : {
            select : function(event) {
                var normal = event.date.normal;
                var detailed = event.date.detailed;
                var formatted = event.date.formatted;
            }
        }
}).render();

A.on(&#39;mousedown&#39;, function() {
    A.CalendarManager.hideAll();
}, document);

});&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The postPlanDetails() javascript function is defined as follows:&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: js; toolbar: false;&quot;&gt;function &amp;lt;portlet:namespace /&amp;gt;postPlanDetails() {
    var origin = document.&amp;lt;portlet:namespace /&amp;gt;fm.&amp;lt;portlet:namespace /&amp;gt;origin.value;
    var dest = document.&amp;lt;portlet:namespace /&amp;gt;fm.&amp;lt;portlet:namespace /&amp;gt;destination.value;
    var journeyDate = document.&amp;lt;portlet:namespace /&amp;gt;fm.&amp;lt;portlet:namespace /&amp;gt;journeyDate.value;
    var duration = document.&amp;lt;portlet:namespace /&amp;gt;fm.&amp;lt;portlet:namespace /&amp;gt;duration.value;

    Liferay.fire(&#39;planTravel&#39;, {
        origin : origin,
        destination : dest,
        journeyDate : journeyDate,
        duration : duration
    });

}&lt;/pre&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;The code in bold above functions publishes the 4 parameters as an event using Liferay client side Inter Portlet Communication. For more details on IPC, see &lt;a href=&quot;http://www.mpowerglobal.com/web/zubair/home/-/blogs/portlet-to-portlet-communication?_33_redirect=http%3A%2F%2Fwww.mpowerglobal.com%2Fweb%2Fzubair%2Fhome%2F-%2Fblogs&quot; id=&quot;aui-3-2-0PR1-1243&quot;&gt;Portlet to Portlet Communication&lt;/a&gt;.&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;This portlet also receives the &#39;directionsChanged&#39; event from the Google Maps portlet. We will discuss this in the next blog.&lt;/div&gt;&lt;br /&gt;
&lt;pre class=&quot;brush: js; toolbar: false;&quot;&gt;Liferay.on(&#39;directionsChanged&#39;,
    function(event) {
        document.&amp;lt;portlet:namespace /&amp;gt;fm.&amp;lt;portlet:namespace /&amp;gt;origin.value = event.origin;
        document.&amp;lt;portlet:namespace /&amp;gt;fm.&amp;lt;portlet:namespace /&amp;gt;destination.value = event.destination;
});&lt;/pre&gt;&lt;script&gt;
SyntaxHighlighter.all()
&lt;/script&gt;</content><link rel='enclosure' type='text/css' href='http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css' length='0'/><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/174954395822801443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2010/12/liferay-smashup-beginning.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/174954395822801443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/174954395822801443'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2010/12/liferay-smashup-beginning.html' title='Liferay (s)mashup - The Beginning'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMA0lsW8FTr1T3bHo91DZyeem9Vi_i8thzTl2WysiNKa5oejqJSST6z1yP0bToxwNBBnv2KxkNBlaaaMkVGlqSMB2jaUNfurH5UCveBpfiO2SZu13rd3kz-EPmCXeuBv-BYK-IVKsLliw/s72-c/plantravel.png" height="72" width="72"/><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-2989451135375535361</id><published>2010-12-24T17:28:00.008+05:30</published><updated>2011-01-04T18:27:48.576+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="dynamic script"/><category scheme="http://www.blogger.com/atom/ns#" term="Liferay"/><category scheme="http://www.blogger.com/atom/ns#" term="page loading"/><category scheme="http://www.blogger.com/atom/ns#" term="responsiviness"/><category scheme="http://www.blogger.com/atom/ns#" term="speed"/><category scheme="http://www.blogger.com/atom/ns#" term="tip"/><title type='text'>Speeding up page loading</title><content type='html'>&lt;div class=&quot;entry-body&quot;&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;Developing  fast loading pages is a complex task. Some have even defined it as an  art. Large companies have dedicated professionals or hire external  consultants to audit their applications for speed and responsiveness.&lt;br /&gt;
&lt;br /&gt;
Here I provide some simple tips to speed up page loading in &lt;a href=&quot;http://www.liferay.com/&quot;&gt;Liferay&lt;/a&gt;. Liferay also  provides some in built features for fast page loading. Whenever  available, Liferay support will be shown for each tip.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Tip 1: Sharing script and css files across portlets&lt;/h2&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;For  each script and css file included in a page, the browser makes separate  requests to fetch them. This takes time. If the same file is included  many times, the browser only makes requests the first time and for  subsequent access, it picks from the cache. Therefore, common javascript  code should be placed in a single file and this file should be included  in all portlets that need it.&lt;br /&gt;
&lt;br /&gt;
To share scripts across portlets, use the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;header-portlet-javascript&amp;gt;&lt;/span&gt; tag or &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;footer-portlet-javascript&amp;gt;&lt;/span&gt; tag in the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;liferay-portlet.xml&lt;/span&gt; file. Similarly, use &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;header-portlet-css&amp;gt;&lt;/span&gt; tag or the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;footer-portlet-css&amp;gt;&lt;/span&gt; tag in the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;liferay-portlet.xml&lt;/span&gt; file.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Tip 2: Lazy loading of scripts&lt;/h2&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;Sometimes,  scripts are not immediately needed after page load but only after user  takes some action. To prevent such scripts being loaded on page load, we  can load in the background after the page has loaded. There are two  ways for lazy loading. One, the script is added to the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;head&amp;gt;&lt;/span&gt; tag and the other is to add it to the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;&amp;lt;body&amp;gt;&lt;/span&gt; tag.&lt;br /&gt;
&lt;br /&gt;
Adding to head tag:&lt;br /&gt;
&lt;code&gt;function loadScript() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;var script = document.createElement(&quot;script&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;script.type = &quot;text/javascript&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;script.src = &quot;&lt;url script=&quot;&quot; to=&quot;&quot;&gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;var head = document.getElementsByTagName(&quot;head&quot;)[0];&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;head.appendChild(script);&lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.onload = loadScript;&lt;/url&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
The function &lt;code style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;loadScript()&lt;/code&gt;  above creates a dynamic script tag and adds it to the first head tag  available. It registers this function to be called on load of the page.&lt;br /&gt;
&lt;br /&gt;
Adding to body tag:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt; function loadScript() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;var script = document.createElement(&quot;script&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;script.type = &quot;text/javascript&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;script.src = &quot;&lt;url script=&quot;&quot; to=&quot;&quot;&gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #cc0000;&quot;&gt;document.body.appendChild(script);&lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.onload = loadScript;&lt;/url&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
The function &lt;code style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;loadScript()&lt;/code&gt; above creates a dynamic script tag and adds it to the body. It registers this function to be called on load of the page.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Tip 3: Minimize script, stylesheet and html output&lt;/h2&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;Whitespace  and comments in script file or html pages takes up bandwith and so  slows down page load. While comments and whitespaces are necessary for  development, in production they should be removed. It would be nice to  not to change the source code for production while still be able to  remove the comments and whitespaces. A simple technique for this would  be to use server side comments in jsp files and not to use html or  javascript comments. Whitespaces cannot be handled this way.&lt;br /&gt;
Liferay  provides a minifier process that strips down both whitespaces and  comments from script and css files. The minifier also shortens function  and variable names to make the script even smaller. To enable the  minifier, set the option in the &lt;code style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;portlet-ext.properties&lt;/code&gt; file.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;com.liferay.portal.servlet.filters.minifier.MinifierFilter=true&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Another option Liferay provides is to load packed (compressed) versions of Liferay scripts and css. Enable it using&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;javascript.fast.load=true&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
By default, both the options are true. Make sure, they are not false on production systems.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Tip 4: Specify image and table width and height&lt;/h2&gt;&lt;span style=&quot;font-size: 12px;&quot;&gt;If  the browser can immediately determine the height and/or width of images  and tables, it will be able to display a web page without having to  reflow the content. This not only speeds the display of the page but  prevents annoying changes in a page&#39;s layout when the page completes  loading. For this reason, &lt;code style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;height&lt;/code&gt; and &lt;code style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;width&lt;/code&gt; should be specified for images and tables, whenever possible.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/2989451135375535361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2010/12/speeding-up-page-loading.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/2989451135375535361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/2989451135375535361'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2010/12/speeding-up-page-loading.html' title='Speeding up page loading'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-2711856101925680375</id><published>2010-11-15T15:44:00.000+05:30</published><updated>2010-11-16T13:57:29.935+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="coin slider"/><category scheme="http://www.blogger.com/atom/ns#" term="coin-slider"/><category scheme="http://www.blogger.com/atom/ns#" term="coinslider"/><category scheme="http://www.blogger.com/atom/ns#" term="Liferay"/><category scheme="http://www.blogger.com/atom/ns#" term="Liferay integration"/><category scheme="http://www.blogger.com/atom/ns#" term="slideshow"/><title type='text'>Integrating Coin Slider with Liferay with zero development</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;In this blog, I will show you how to integrate the Coin Slider library in a Liferay portlet without having to develop any portlet. Coin Slider is a jQuery based image slider with many effects for image transition.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;color: red; text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;Note: This solution is based on Liferay 6.0.5&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Download and extract the latest version of the Coin Slider library from &lt;a href=&quot;http://workshop.rs/projects/coin-slider/%20&quot;&gt;http://workshop.rs/projects/coin-slider/ &lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Create a folder &lt;i&gt;slideshow&lt;/i&gt; in the document library of the community where you want to use the slider. Add the files c&lt;i&gt;oin-slider-min.js&lt;/i&gt;, &lt;i&gt;coin-slider-styles.css&lt;/i&gt;, &lt;i&gt;jquery-1.4.2.min.js&lt;/i&gt; to the &lt;i&gt;slideshow&lt;/i&gt; folder. Create a new file &lt;i&gt;javascript.js&lt;/i&gt; file in filesystem. Add the following code to this file:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;blockquote&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;$(document).ready(function() { &lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&quot;#coin-slider&quot;).coinslider({ hoverPause: false }); &lt;/span&gt;&lt;br style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot; /&gt;&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,sans-serif;&quot;&gt;});&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/span&gt; &lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Upload the &lt;i&gt;javascript.js&lt;/i&gt; file to the &lt;i&gt;slideshow&lt;/i&gt; document library. The &lt;i&gt;slideshow&lt;/i&gt; folder should now look like this:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX9T_K2G5E5kK-4JoA0JCIwSVk5IqoF-4MlMXnyzdfCkwxJkPKJ-nDRlLMtRiGdZhc09CaV3J5Q6Jt3N6cPiZ5i0h81jBWdEHZaIJdriRPnjBOO6HbgKWus8caV2VuQDkkuQ0SboLwZE8/s1600/sliderlibrary.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;410&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX9T_K2G5E5kK-4JoA0JCIwSVk5IqoF-4MlMXnyzdfCkwxJkPKJ-nDRlLMtRiGdZhc09CaV3J5Q6Jt3N6cPiZ5i0h81jBWdEHZaIJdriRPnjBOO6HbgKWus8caV2VuQDkkuQ0SboLwZE8/s640/sliderlibrary.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Next upload few images that you want to display in the slider in the Image Gallery.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIvxCQ2jmVasAbeWRfefv1GyK2cSuImnDZN2wQATbLNu0LVDp6kO7t6t4p2sqG5aJcjTPOg61Dv4KOhQLfvM_Z8QIUw8NgRnb9Obo3RnO3DZmHRU564shGcoafwMPkXMBpbEvF_pdOwD0/s1600/image-gallery.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;334&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIvxCQ2jmVasAbeWRfefv1GyK2cSuImnDZN2wQATbLNu0LVDp6kO7t6t4p2sqG5aJcjTPOg61Dv4KOhQLfvM_Z8QIUw8NgRnb9Obo3RnO3DZmHRU564shGcoafwMPkXMBpbEvF_pdOwD0/s640/image-gallery.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;There are 3 images in the image gallery above.&lt;br /&gt;
&lt;br /&gt;
Now create a new web content structure. Name it &lt;i&gt;coin-slideshow&lt;/i&gt;. Add xml schema definition to the structure as shown below:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrwvd2_X2GmfTZSa70EymoKdXLW6F-aE39CmEHe9Gh11DV5R6zRb-oW38tCDauK2AhbT8oxRRfQGWP26NnrQC9JDBl0lswB6oREpclp7yX2aGKYRBIqQkYTgiefpR3bYj3xq60ANOoqYY/s1600/structure.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;363&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrwvd2_X2GmfTZSa70EymoKdXLW6F-aE39CmEHe9Gh11DV5R6zRb-oW38tCDauK2AhbT8oxRRfQGWP26NnrQC9JDBl0lswB6oREpclp7yX2aGKYRBIqQkYTgiefpR3bYj3xq60ANOoqYY/s640/structure.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Click &lt;i&gt;Save&lt;/i&gt; when done.&lt;br /&gt;
&lt;br /&gt;
Create a new web content template and name it &lt;i&gt;coin-slideshow-template&lt;/i&gt;. Select &lt;i&gt;coin-slideshow&lt;/i&gt; as the structure for the new template. Click the L&lt;i&gt;aunch Editor &lt;/i&gt;button. In the dialog that appears, paste the following code:&lt;/div&gt;&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;lt;link href=&quot;$css.getData()&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;$jquery.getData()&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;$coinjs.getData()&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&quot;text/javascript&quot; src=&quot;$slidestart.getData()&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&quot;coin-slider&quot;&amp;gt;&lt;br /&gt;
#foreach ($item in $slide.getSiblings())&lt;br /&gt;
&amp;nbsp;&amp;nbsp; #foreach ( $itemData in $item.getChildren() )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#if ( &quot;$itemData.getName()&quot; == &quot;href&quot; )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#set ( $href = $itemData.getData() )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#elseif ( &quot;$itemData.getName()&quot; == &quot;img_src&quot; )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#set ( $img_src = $itemData.getData() )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#elseif ( &quot;$itemData.getName()&quot; == &quot;description&quot; )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#set ( $description = $itemData.getData() )&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#end&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#end&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;a href=&quot;$href&quot;&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;img src=&quot;$img_src&quot; /&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;span&amp;gt;$description&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/a&amp;gt;&lt;br /&gt;
#end&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
Click &lt;i&gt;Update&lt;/i&gt; button when done. Click &lt;i&gt;Save&lt;/i&gt; again in the main dialog.&lt;br /&gt;
&lt;br /&gt;
Now is the time to add the slider in our page. Add &lt;i&gt;Web Content Display&lt;/i&gt; portlet to the page where you want the slider. Click the &lt;i&gt;Add Web Content&lt;/i&gt; link in the portlet to create content for the portlet. In the new dialog box, give a name to the content, say &lt;i&gt;Slideshow&lt;/i&gt;. Change the structure of the web content by clicking the &lt;i&gt;Choose&lt;/i&gt; button under the &lt;i&gt;Structure&lt;/i&gt; section on the right. Select the structure &lt;i&gt;coin-slideshow&lt;/i&gt; that we created earlier. This will automatically choose the template that we associated with the structure. Instead of the HTML editor, a web form with fields are shown.&lt;br /&gt;
&lt;br /&gt;
In the &lt;i&gt;css&lt;/i&gt; field, choose the &lt;i&gt;coin-slider-styles.css&lt;/i&gt; from the document library. Similarly, choose &lt;i&gt;jquery-1.4.2.min.js&lt;/i&gt; for &lt;i&gt;jquer&lt;/i&gt;y field, &lt;i&gt;coin-slider-min.js&lt;/i&gt; for &lt;i&gt;coinjs&lt;/i&gt; field and &lt;i&gt;javascript.js&lt;/i&gt; for &lt;i&gt;coinstart&lt;/i&gt; field. For the first slide, name it &lt;i&gt;slide1&lt;/i&gt;. Select a image from the Image Gallery for the &lt;i&gt;img_src&lt;/i&gt; field. Select target location when an image is clicked from the dropdown list for the &lt;i&gt;href&lt;/i&gt; field. Type some text to be displayed for the image in the &lt;i&gt;description&lt;/i&gt; field. Similarly, add more slides for each image that you want to be displayed.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGYPAeywcJpTHcGPYJaKSj5Z1Bcet-Prxv0DdSSt12whu5Px5WXTa78LuG9O5J5IpJKrqGhwos4Wf_63NqNwDxNFDp_R00x9kAKV8wzaXSKJcTp7Eb6c1S4N28kKfTjSf3LWAiX039o-E/s1600/preview1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGYPAeywcJpTHcGPYJaKSj5Z1Bcet-Prxv0DdSSt12whu5Px5WXTa78LuG9O5J5IpJKrqGhwos4Wf_63NqNwDxNFDp_R00x9kAKV8wzaXSKJcTp7Eb6c1S4N28kKfTjSf3LWAiX039o-E/s1600/preview1.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaYBThzQics1oZGCqJ-MkMCc7n2zXN2O8k6-IpOIVZIP3kq5pRcXyz7dzUarA3N6p4RpxblkhTeLEdSJyz6YKMX6Yv_MYmEagb13b3Sr3IVDaajF7aHIxjy4HtRwaGFOd8ksxd6RT8CyY/s1600/preview2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaYBThzQics1oZGCqJ-MkMCc7n2zXN2O8k6-IpOIVZIP3kq5pRcXyz7dzUarA3N6p4RpxblkhTeLEdSJyz6YKMX6Yv_MYmEagb13b3Sr3IVDaajF7aHIxjy4HtRwaGFOd8ksxd6RT8CyY/s1600/preview2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Click &lt;i&gt;Publish&lt;/i&gt; button to save the content and make it viewable.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdaorW2jZNDkc7n8N0jNbrvZgO-kT715lkXPtKnpnpwUsq6HXCKORfuw0zY3GHVeteFZBcATWJpBmeCVOExdrLwT8E7gZZi6XxZ0GryGMir7LxSlL5uX67OpH71LzZKBmcTUVDHCK33_U/s1600/slideshow.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdaorW2jZNDkc7n8N0jNbrvZgO-kT715lkXPtKnpnpwUsq6HXCKORfuw0zY3GHVeteFZBcATWJpBmeCVOExdrLwT8E7gZZi6XxZ0GryGMir7LxSlL5uX67OpH71LzZKBmcTUVDHCK33_U/s1600/slideshow.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/2711856101925680375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2010/11/integrating-coin-slider-with-liferay.html#comment-form' title='19 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/2711856101925680375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/2711856101925680375'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2010/11/integrating-coin-slider-with-liferay.html' title='Integrating Coin Slider with Liferay with zero development'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX9T_K2G5E5kK-4JoA0JCIwSVk5IqoF-4MlMXnyzdfCkwxJkPKJ-nDRlLMtRiGdZhc09CaV3J5Q6Jt3N6cPiZ5i0h81jBWdEHZaIJdriRPnjBOO6HbgKWus8caV2VuQDkkuQ0SboLwZE8/s72-c/sliderlibrary.jpg" height="72" width="72"/><thr:total>19</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-6302250987821681329</id><published>2008-06-12T11:24:00.000+05:30</published><updated>2008-06-12T11:45:21.305+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="Library"/><category scheme="http://www.blogger.com/atom/ns#" term="Swing"/><category scheme="http://www.blogger.com/atom/ns#" term="Swinglets"/><title type='text'>Swinglets 0.1 Beta Released</title><content type='html'>I have just released the first beta version of the &lt;a href=&quot;http://swinglets.dev.java.net/&quot;&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt;Swinglets&lt;/span&gt;&lt;/a&gt; project on &lt;a href=&quot;http://java.net/&quot;&gt;java.net&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This project is a collection of Java Swing components developed by me. In this release, only two components &lt;span style=&quot;font-weight: bold; color: rgb(51, 102, 255);&quot;&gt;JClock&lt;/span&gt;&lt;span style=&quot;color: rgb(51, 102, 255);&quot;&gt; &lt;/span&gt;and &lt;span style=&quot;font-weight: bold; color: rgb(51, 102, 255);&quot;&gt;JRuler&lt;/span&gt; is provided. I have few other components in development which will be released soon. This is not a stable release, so expect lots of bug and an unstable API. By sharing this project with the community, I intend to build and grow this library.&lt;br /&gt;&lt;br /&gt;Users are requested to use this library and send your feedback. Even better, join this project and submit your improvements.&lt;br /&gt;&lt;br /&gt;Please note that this library depends on the &lt;span style=&quot;font-weight: bold;&quot;&gt;jscience&lt;/span&gt; library from &lt;span style=&quot;font-weight: bold;&quot;&gt;jscience.org. &lt;/span&gt;This library is not included with this project. You need to separately place it in the classpath.</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/6302250987821681329/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2008/06/swinglets-01.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/6302250987821681329'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/6302250987821681329'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2008/06/swinglets-01.html' title='Swinglets 0.1 Beta Released'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-5175593916801529756</id><published>2008-04-17T00:45:00.000+05:30</published><updated>2008-04-27T01:21:18.030+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Derby"/><category scheme="http://www.blogger.com/atom/ns#" term="Embedded Database"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaDB"/><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans Module Startup"/><title type='text'>Integrating JavaDB with Netbeans modules - Series 3</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;In this last part of the series, I will show how to save and retrieve data from our embedded database.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;ol style=&quot;text-align: justify;&quot;&gt;&lt;li&gt;Create a new class called &lt;span style=&quot;font-style: italic;&quot;&gt;DBConect&lt;/span&gt; under the package &lt;span style=&quot;font-style: italic;&quot;&gt;org.embedded.db&lt;/span&gt;. Replace with the following code:&lt;br /&gt;&lt;pre&gt;&lt;ol&gt;&lt;li&gt;package org.embedded.db;&lt;/li&gt;&lt;li&gt;import java.sql.Connection;&lt;/li&gt;&lt;li&gt;import java.sql.DriverManager;&lt;/li&gt;&lt;li&gt;import java.sql.ResultSet;&lt;/li&gt;&lt;li&gt;import java.sql.SQLException;&lt;/li&gt;&lt;li&gt;import java.sql.Statement;&lt;/li&gt;&lt;li&gt;import java.util.Properties;&lt;/li&gt;&lt;li&gt;import org.openide.util.Exceptions;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;public class DBConect {&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;    Connection con = null;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;    public DBConect() {&lt;/li&gt;&lt;li&gt;        Properties prop = System.getProperties();&lt;/li&gt;&lt;li&gt;        prop.put(&quot;derby.system.home&quot;,&lt;br /&gt;             System.getProperty(&quot;user.home&quot;) + &quot;/&quot; + &quot;.mesh&quot;);&lt;/li&gt;&lt;li&gt;        try {&lt;/li&gt;&lt;li&gt;            //start the database and get a connection&lt;/li&gt;&lt;li&gt;            con = DriverManager.&lt;br /&gt;                    getConnection(&quot;jdbc:derby:mesh_db&quot;, prop);&lt;/li&gt;&lt;li&gt;        } catch (SQLException e) {&lt;/li&gt;&lt;li&gt;            Exceptions.printStackTrace(e);&lt;/li&gt;&lt;li&gt;        }&lt;/li&gt;&lt;li&gt;    }&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;    public ResultSet executeQuery(String sql) throws SQLException {&lt;/li&gt;&lt;li&gt;        Statement statement = con.createStatement();&lt;/li&gt;&lt;li&gt;        return statement.executeQuery(sql);&lt;/li&gt;&lt;li&gt;    }&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;    public int executeUpdate(String sql) throws SQLException {&lt;/li&gt;&lt;li&gt;        Statement statement = con.createStatement();&lt;/li&gt;&lt;li&gt;        return statement.executeUpdate(sql);&lt;/li&gt;&lt;li&gt;    }&lt;/li&gt;&lt;li&gt;}&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Now you can use this class to query the database or save data to the database using the two functions provided. This is a simple class. You can extend/modify it to do more complicated tasks.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/5175593916801529756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2008/04/integrating-javadb-with-netbeans_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/5175593916801529756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/5175593916801529756'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2008/04/integrating-javadb-with-netbeans_16.html' title='Integrating JavaDB with Netbeans modules - Series 3'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-6607997213646975190</id><published>2008-04-11T23:25:00.000+05:30</published><updated>2008-04-27T01:22:29.676+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Derby"/><category scheme="http://www.blogger.com/atom/ns#" term="Embedded Database"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaDB"/><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans Module Startup"/><title type='text'>Integrating JavaDB with Netbeans modules - Series 2</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;In my last post, we created MyDbModule project. In this part, I will tell you how to start the embedded database when our module gets loaded.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Expand the Source Packages folder of the embedded-db project. Right-click on &lt;span style=&quot;font-style: italic;&quot;&gt;org.embedded.db&lt;/span&gt; package and select New &gt; Java Class.&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijNqNjeKGxHwTzjyO8e_SdQdr0yMt49pHM91w83hBsRvq_E8FmggI2E6vj4jPCfeH2UTyGeRX6l2V7d_gn28fLyM7JQzvg-qAt_qZZ1dvg1E3jNlldMjGTTnoDR2oA06Og9VLjkdk8Spo/s1600-h/7-New+Java+Class.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijNqNjeKGxHwTzjyO8e_SdQdr0yMt49pHM91w83hBsRvq_E8FmggI2E6vj4jPCfeH2UTyGeRX6l2V7d_gn28fLyM7JQzvg-qAt_qZZ1dvg1E3jNlldMjGTTnoDR2oA06Og9VLjkdk8Spo/s400/7-New+Java+Class.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5189515089571039218&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Name the class as &lt;span style=&quot;font-style: italic;&quot;&gt;Startup.&lt;/span&gt; Then click on Finish.&lt;/li&gt;&lt;li&gt;This will be our startup class when the module is loaded. To make that happen we need to do two things. First, extend it with the NetBeans API class &lt;span style=&quot;font-style: italic;&quot;&gt;ModuleInstall&lt;/span&gt;. &lt;span style=&quot;font-style: italic;&quot;&gt;ModuleInstall&lt;/span&gt; exposes two methods for child classes: restored() and closed(). restored() is called when the module is loaded for the first time. and closed() is called when the module is unloaded. To use this API, add two module dependencies to the module. Right click on embedded-db project and select Properties. Select Libraries. On the right hand side, click Add Dependency... Select Module System API and Utilities API and then clcik Ok. The two APIs will be added to the project. Then click OK again on the  Project Properties Dialog box. &lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCL1sps3w2m-RZ-wEj24lR3gIvxqva3DEQJq-TVkaK80Nn3keFOP6F4lI2Nf1qWjrguwqc9_Tf8-49CJc2vk1TdOyMq6BwzK9Enap6muyj8_uFrK0san2WYeFYpr6Im31q_290oRhIaVQ/s1600-h/9-Project+Properties+-+embedded-db.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCL1sps3w2m-RZ-wEj24lR3gIvxqva3DEQJq-TVkaK80Nn3keFOP6F4lI2Nf1qWjrguwqc9_Tf8-49CJc2vk1TdOyMq6BwzK9Enap6muyj8_uFrK0san2WYeFYpr6Im31q_290oRhIaVQ/s400/9-Project+Properties+-+embedded-db.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5189905519278114834&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Second, open the Module manifest file (manifest.mf) from the Important Files folder of the module. Add the following line to it:&lt;br /&gt;&lt;br /&gt;OpenIDE-Module-Install: org/embedded/db/Startup.class&lt;br /&gt;&lt;br /&gt;This will register our class as the startup class when the module is loaded.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Now replace the Startup code with the following code:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;package org.embedded.db;&lt;/li&gt;&lt;li&gt;import java.sql.Connection;&lt;/li&gt;&lt;li&gt;import java.sql.DriverManager;&lt;/li&gt;&lt;li&gt;import java.sql.SQLException;&lt;/li&gt;&lt;li&gt;import java.util.Properties;&lt;/li&gt;&lt;li&gt;import org.openide.modules.ModuleInstall;&lt;/li&gt;&lt;li&gt;import org.openide.util.Exceptions;&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;public class Startup extends ModuleInstall {&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;    @Override&lt;/li&gt;&lt;li&gt;    public void restored() {&lt;/li&gt;&lt;li&gt;        super.restored();&lt;/li&gt;&lt;li&gt;        Properties prop = System.getProperties();&lt;/li&gt;&lt;li&gt;        prop.put(&quot;derby.system.home&quot;,&lt;br /&gt;               System.getProperty(&quot;user.home&quot;) + &quot;/&quot; + &quot;.mydb&quot;);&lt;/li&gt;&lt;li&gt;        Connection con = null;&lt;/li&gt;&lt;li&gt;        try {&lt;/li&gt;&lt;li&gt;            //start the database and get a connection&lt;/li&gt;&lt;li&gt;            con = DriverManager.&lt;br /&gt;                        getConnection(&quot;jdbc:derby:my_db&quot;, prop);&lt;/li&gt;&lt;li&gt;        } catch (SQLException ex) {&lt;/li&gt;&lt;li&gt;            if (ex.getErrorCode() == 40000) {&lt;/li&gt;&lt;li&gt;                //database does not exist. create it now&lt;/li&gt;&lt;li&gt;                try {&lt;/li&gt;&lt;li&gt;                    con = DriverManager.&lt;br /&gt;                          getConnection(&quot;jdbc:derby:my_db;create=true&quot;, prop);&lt;/li&gt;&lt;li&gt;                    //create the schema&lt;br /&gt;&lt;/li&gt;&lt;li&gt;                } catch (SQLException ex1) {&lt;/li&gt;&lt;li&gt;                }&lt;/li&gt;&lt;li&gt;            }&lt;/li&gt;&lt;li&gt;        } finally {&lt;/li&gt;&lt;li&gt;            try {&lt;/li&gt;&lt;li&gt;                if (con != null &amp;amp;&amp;amp; !con.isClosed()) {&lt;/li&gt;&lt;li&gt;                    con.close();&lt;/li&gt;&lt;li&gt;                }&lt;/li&gt;&lt;li&gt;            } catch (SQLException ex) {&lt;/li&gt;&lt;li&gt;            }&lt;/li&gt;&lt;li&gt;        }&lt;/li&gt;&lt;li&gt;    }&lt;/li&gt;&lt;li&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;    @Override&lt;/li&gt;&lt;li&gt;    public void close() {&lt;/li&gt;&lt;li&gt;        try {&lt;/li&gt;&lt;li&gt;            super.close();&lt;/li&gt;&lt;li&gt;            DriverManager.getConnection(&quot;jdbc:derby:;shutdown=true&quot;);&lt;/li&gt;&lt;li&gt;        } catch (SQLException ex) {&lt;/li&gt;&lt;li&gt;            if (!ex.getSQLState().equals(&quot;XJ015&quot;)) {&lt;/li&gt;&lt;li&gt;                Exceptions.printStackTrace(ex);&lt;/li&gt;&lt;li&gt;            }&lt;/li&gt;&lt;li&gt;        }&lt;/li&gt;&lt;li&gt;    }&lt;/li&gt;&lt;li&gt;}&lt;/li&gt;&lt;/ol&gt;&lt;/pre&gt;&lt;br /&gt;In line 13, we call the base class restored() function to perform the default operation. Then we customize according to our requirements. In line 15, we set the JavaDB home directory where the database will be stored, which is the user&#39;s home directory under &#39;.mydb&#39; directory. In line 19, we try to connect to our embedded database with the name &#39;my_db&#39;. First time, as the database is non-existent, it will throw an exception which will be caught by our handler. In line 24, we create the database by using the special connection string:&lt;br /&gt;&lt;br /&gt;&quot;jdbc:derby:my_db;create=true&quot;&lt;br /&gt;&lt;br /&gt;In line 25, we can create our database tables as required.&lt;br /&gt;&lt;br /&gt;To shutdown the database when our application is closed, we override the closed() method. Shutting down the JavaDB engine is the same as getting connection except we pass the &#39;shutdown=true&#39; parameter with the connection string as shown in line 43. Note the &#39;:;&#39; characters after &#39;jdbc:derby&#39;. While shutting down, JavaDB throws an SQLException with SQL state code &#39;XJ015&#39;. We need to ignore this exception which is done in line 45.&lt;br /&gt;&lt;br /&gt;That&#39;s it. We have created a module which loads and/or creates our database on startup and shuts it down when the application is closed.&lt;br /&gt;&lt;br /&gt;In the next and final blog, I will show how to connect to the database and save/retrieve data.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/6607997213646975190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2008/04/integrating-javadb-with-netbeans.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/6607997213646975190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/6607997213646975190'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2008/04/integrating-javadb-with-netbeans.html' title='Integrating JavaDB with Netbeans modules - Series 2'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijNqNjeKGxHwTzjyO8e_SdQdr0yMt49pHM91w83hBsRvq_E8FmggI2E6vj4jPCfeH2UTyGeRX6l2V7d_gn28fLyM7JQzvg-qAt_qZZ1dvg1E3jNlldMjGTTnoDR2oA06Og9VLjkdk8Spo/s72-c/7-New+Java+Class.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-3389237547211247629</id><published>2008-04-09T14:39:00.000+05:30</published><updated>2008-04-17T12:59:39.654+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Derby"/><category scheme="http://www.blogger.com/atom/ns#" term="Embedded Database"/><category scheme="http://www.blogger.com/atom/ns#" term="JavaDB"/><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans"/><category scheme="http://www.blogger.com/atom/ns#" term="Netbeans Module"/><title type='text'>Integrating JavaDB with Netbeans modules - Series 1</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Here, I outline the series of steps to integrate JavaDB a.k.a Apache Derby with your Netbeans module. JavaDB acts as the embedded database for our Netbeans module. The network server features of JavaDB will not be utilized. I will also show how to configure the database so that it is stored in a custom location rather than the default.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: rgb(204, 0, 0);font-size:85%;&quot; &gt;Note: In trying out this guide, it is assumed that you are familiar with the Netbeans Platform and related concepts such as module, suite, etc. This guide is based on the latest Netbeans 6.1 Beta platform.&lt;/span&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Create a module suite with the name &#39;MyDbModule&#39;. You can give any name you want. If you want to add JavaDB to an existing module suite project, skip this step.&lt;/div&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1R5J2bb2yQWhnLIaCvstUZsHGsAb3T4tL4jwuWAQnjPRo0QsuPLIcabhOXSpdSHT3BU6jZm-3FZq5KbiaSJiqrMr6BiJVDzBJ2IlEnZi_wT2jbEhyphenhyphen9zkjFBwax7bjUvVIMuurmxXXVvg/s1600-h/1-New+Module+Suite.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 432px; height: 239px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1R5J2bb2yQWhnLIaCvstUZsHGsAb3T4tL4jwuWAQnjPRo0QsuPLIcabhOXSpdSHT3BU6jZm-3FZq5KbiaSJiqrMr6BiJVDzBJ2IlEnZi_wT2jbEhyphenhyphen9zkjFBwax7bjUvVIMuurmxXXVvg/s400/1-New+Module+Suite.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5188027740626810834&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Right click on the project and select &lt;span style=&quot;font-style: italic;&quot;&gt;Properties. &lt;/span&gt;Select &lt;span style=&quot;font-style: italic;&quot;&gt;Libraries&lt;/span&gt;. In the &lt;span style=&quot;font-style: italic;&quot;&gt;Platform Modules&lt;/span&gt; section, uncheck all modules except &lt;span style=&quot;font-style: italic;&quot;&gt;platform8&lt;/span&gt;. We don&#39;t want other modules for now and if necessary, they can be added later.&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiCz5jv7KAiI_ci0czV__18jo-AfIjxuiCfVgm4_ZElUWrNuDM7yx_YdU_T9bniFXEiiT1fKCsCXOgKjw6oDzuvZ7h6MhMhQqgYCDL8rPR-80OfpPS8N4sl_7q_s6Aul3fxhnrmoc0Jnk/s1600-h/8-Project+Properties+-+MyDbModule.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiCz5jv7KAiI_ci0czV__18jo-AfIjxuiCfVgm4_ZElUWrNuDM7yx_YdU_T9bniFXEiiT1fKCsCXOgKjw6oDzuvZ7h6MhMhQqgYCDL8rPR-80OfpPS8N4sl_7q_s6Aul3fxhnrmoc0Jnk/s400/8-Project+Properties+-+MyDbModule.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5189504824599201762&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Click &lt;span style=&quot;font-style: italic;&quot;&gt;Ok&lt;/span&gt; when done.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Add a new module to this suite. &lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;(If you already have a module, skip this step)&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Expand the suite tree node.&lt;/li&gt;&lt;li&gt;Right click on &lt;span style=&quot;font-style: italic;&quot;&gt;Modules &lt;/span&gt;node and select &lt;span style=&quot;font-style: italic;&quot;&gt;Add New...&lt;/span&gt; You will see the following dialog:&lt;/li&gt;&lt;li&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Type the name of the module as &#39;embedded-db&#39;. Choose a location if required. Click Next. You will now see the following dialog:&lt;br /&gt;&lt;/div&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsUg6FFBlPbt0c5acrADYBpFv1wPDEdpBWmxj5skGGgg7ZG2V5vOxl7Ix4y7g31kyn-EwK8c0dUl6ynLIppAZqxYCGfsJ0bNA_tjJkSog_AeCe0S9woPe46gy0hFnhWVSK8YLoTlpe7t0/s1600-h/2-New+Module+Project.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsUg6FFBlPbt0c5acrADYBpFv1wPDEdpBWmxj5skGGgg7ZG2V5vOxl7Ix4y7g31kyn-EwK8c0dUl6ynLIppAZqxYCGfsJ0bNA_tjJkSog_AeCe0S9woPe46gy0hFnhWVSK8YLoTlpe7t0/s400/2-New+Module+Project.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5188030764283787234&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Type Code Name Base as &#39;org.embedded.db&#39;. Keep the rest as default. You may change the module display name.&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP61yQVZWUNUymrefEkgA-U7fJtZbZfM5P7_qK4GQNBibjt6Axq1uGMxRjitbJgguH4NTTcd9Ms27LwLq8Li1AXay08gDFQA4HzsFRhH4TF4zxjsAVLOCpao3dKwWP61O72woYiiwJpfM/s1600-h/3-Basic+Module+Configuration.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP61yQVZWUNUymrefEkgA-U7fJtZbZfM5P7_qK4GQNBibjt6Axq1uGMxRjitbJgguH4NTTcd9Ms27LwLq8Li1AXay08gDFQA4HzsFRhH4TF4zxjsAVLOCpao3dKwWP61O72woYiiwJpfM/s400/3-Basic+Module+Configuration.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5188036420755716098&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Click Finish.&lt;/li&gt;&lt;li&gt;Your new module is added to the suite &#39;MyDbModule&#39;.&lt;/li&gt;&lt;/ol&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Now add a dependency for JavaDB to this new/existing module. JavaDB is installed with Java SE 6. If you do not already have JavaDB, please install it first.&lt;/li&gt;&lt;ol&gt;&lt;li&gt;Expand &#39;embedded-db&#39; node.&lt;/li&gt;&lt;li&gt;Right-click on Libraries and select &#39;Add New Library...&#39;&lt;br /&gt;&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Browse for the JavaDB jar files. For a default installation in Linux, you will find it in &lt;span style=&quot;font-style: italic;&quot;&gt;/opt/sun/javadb/lib. &lt;/span&gt;For a default Windows installation, it will be in &lt;span style=&quot;font-style: italic;&quot;&gt;C:/Program&lt;/span&gt;&lt;span style=&quot;font-style: italic;&quot;&gt; Files/Sun/JavaDB/lib. &lt;/span&gt;Select derby.jar and then click Next.&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj53whT9QFfDEQg4pwr_ToWT_CbPlL9S9PgdNj9nAfo3WLeIFhFNWHJkNRNndzvdaUNlwblSDqe8XSI6Xqy561zi1VGCeQy0ASQxtQEYb5vVeJSmtehGDMIR8-SGQEUBNSrUIrMc3F6JcI/s1600-h/4-New+Library+Wrapper+Module+Project.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj53whT9QFfDEQg4pwr_ToWT_CbPlL9S9PgdNj9nAfo3WLeIFhFNWHJkNRNndzvdaUNlwblSDqe8XSI6Xqy561zi1VGCeQy0ASQxtQEYb5vVeJSmtehGDMIR8-SGQEUBNSrUIrMc3F6JcI/s400/4-New+Library+Wrapper+Module+Project.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5188038147332569106&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Give the project name as &#39;JavaDBLib&#39;. Then click next.&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdPfuq0_LXtszTAkFhbW_8vYtXHH9Esb3ySieOaBlDgupx2ZesY7pfpbPAdcaEigYcDmL-4HI1wesogIxVv0ZY-AocVfnJHeepfRHq3fuVqGVtB6hCvoAeo7FcorA_wra7pAZKx2Rhzls/s1600-h/5-New+Library+Wrapper+Module+Project.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdPfuq0_LXtszTAkFhbW_8vYtXHH9Esb3ySieOaBlDgupx2ZesY7pfpbPAdcaEigYcDmL-4HI1wesogIxVv0ZY-AocVfnJHeepfRHq3fuVqGVtB6hCvoAeo7FcorA_wra7pAZKx2Rhzls/s400/5-New+Library+Wrapper+Module+Project.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5188038873182042146&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Set code name base as &#39;org.embedded.javadb&#39;. Leave the rest as it is. Then click Finish.&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2FYYLSVBJWPfQhyphenhyphenOC5vvwRNwjWOt1gzNZpbsfjofpaK6oCKlCq2BFYCgztuuQKH1Xnq6MwLiCwRxEy9yXCSEy7Pg0WeKsrtchFhy652j6-tfM9nMucyHOQZtPQLTcvlvxTcQmC2ibJRo/s1600-h/6-New+Library+Wrapper+Module+Project.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2FYYLSVBJWPfQhyphenhyphenOC5vvwRNwjWOt1gzNZpbsfjofpaK6oCKlCq2BFYCgztuuQKH1Xnq6MwLiCwRxEy9yXCSEy7Pg0WeKsrtchFhy652j6-tfM9nMucyHOQZtPQLTcvlvxTcQmC2ibJRo/s400/6-New+Library+Wrapper+Module+Project.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5188039800894978098&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; The library is added to the suite as well as a dependent library to &#39;embedded-db&#39; project.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;    So far, we have created a new module suite, added a module and a JavaDB library wrapper to it. In the next part, we will dive into coding and see how to start up our database in our own location . Also, we will connect to the database using Java Persistence API and do some simple queries.&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/3389237547211247629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2008/01/integrating-javadb-with-netbeans.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/3389237547211247629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/3389237547211247629'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2008/01/integrating-javadb-with-netbeans.html' title='Integrating JavaDB with Netbeans modules - Series 1'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1R5J2bb2yQWhnLIaCvstUZsHGsAb3T4tL4jwuWAQnjPRo0QsuPLIcabhOXSpdSHT3BU6jZm-3FZq5KbiaSJiqrMr6BiJVDzBJ2IlEnZi_wT2jbEhyphenhyphen9zkjFBwax7bjUvVIMuurmxXXVvg/s72-c/1-New+Module+Suite.png" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4699115486564444835.post-1685577016155571297</id><published>2007-10-07T14:34:00.000+05:30</published><updated>2007-10-07T14:41:31.777+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="introduction"/><category scheme="http://www.blogger.com/atom/ns#" term="j2ee"/><category scheme="http://www.blogger.com/atom/ns#" term="j2me"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="javaee"/><category scheme="http://www.blogger.com/atom/ns#" term="javame"/><title type='text'>First Look</title><content type='html'>I have been working on various Java technologies for quite some time. I have always wanted to share my experiences but never got the time to do it. This is my first step in that direction.&lt;br /&gt;This post is just to intimidate users about what will be coming next. I have experiences in &lt;span style=&quot;color: rgb(51, 51, 255);&quot;&gt;Core Java, JavaEE, JavaME&lt;/span&gt;, web applications.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope that others may benefit from my experiences or share their experiences with me.&lt;br /&gt;&lt;br /&gt;Thanks &amp;amp; Good Luck!!</content><link rel='replies' type='application/atom+xml' href='http://myjavaexp.blogspot.com/feeds/1685577016155571297/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://myjavaexp.blogspot.com/2007/10/first-look.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/1685577016155571297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4699115486564444835/posts/default/1685577016155571297'/><link rel='alternate' type='text/html' href='http://myjavaexp.blogspot.com/2007/10/first-look.html' title='First Look'/><author><name>Sajux</name><uri>http://www.blogger.com/profile/06226187147025106954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nCVLEg1dbTODl9U_sjGKI-bbQQ3akFKXdA4nqvOlsMM--kWPodRNuk_WeeO5x_IGagsNrGJpgla6Yf26EpM5sSbIbS8129dtkcJaloBYkzNpINNmllyG8OseQQQumQ/s220/sajid.jpg'/></author><thr:total>0</thr:total></entry></feed>