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

<channel>
	<title>The Jar in the Spotlight &#187; themes</title>
	<atom:link href="http://www.jarconnection.com/tag/themes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jarconnection.com</link>
	<description>Computation, Visualization and Programming lab</description>
	<lastBuildDate>Thu, 26 Aug 2010 11:22:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>How to develope a Liferay Theme</title>
		<link>http://www.jarconnection.com/developement/how-to-develope-a-liferay-theme/</link>
		<comments>http://www.jarconnection.com/developement/how-to-develope-a-liferay-theme/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 11:17:23 +0000</pubDate>
		<dc:creator>reych</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[Developement]]></category>
		<category><![CDATA[liferay]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[velocity]]></category>

		<guid isPermaLink="false">http://www.jarconnection.com/?p=170</guid>
		<description><![CDATA[This is the second article of the series where you can learn how to develope a portal in Liferay.This one will show how to develope a Liferay Theme.
]]></description>
			<content:encoded><![CDATA[<p>This article will show how to develope a Liferay Theme.</p>
<p>Requirements:</p>
<p>- Ant 1.8.1 (<em>or the latest stable version</em>)<br />
<a href="http://apache.rediris.es/ant/binaries/apache-ant-1.8.1-bin.zip" target="_blank">http://apache.rediris.es/ant/binaries/apache-ant-1.8.1-bin.zip</a></p>
<p>-  SDK Plugins</p>
<p><a href="http://downloads.sourceforge.net/lportal/liferay-plugins-sdk-5.2.3.zip">http://downloads.sourceforge.net/lportal/liferay-plugins-sdk-5.2.3.zip</a></p>
<p>- Eclipse IDE for Java EE Developers<br />
<a href="http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/heliosr" target="_blank">http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/heliosr</a></p>
<p>- Notepad ++ (or other text editor)</p>
<p><a href="http://notepad-plus-plus.org/release/5.7" target="_blank">http://notepad-plus-plus.org/release/5.7</a></p>
<p>- Your CSS and HTML design</p>
<p>Unzip all the files in your HD. Remember the path in order to the  next step.</p>
<p>We need to add a new user variable. Click on “Environment Variables”  at “System Properties” section on “My Computer”. Click on “New” and add  the variable with this values:</p>
<p><em>variable name: ANT_HOME<br />
variable value: </em>C:\ant<br />
<em> (you have to put your ant path here)</em></p>
<p><em> </em></p>
<div id="attachment_180" class="wp-caption aligncenter" style="width: 310px"><em><em><a href="http://www.jarconnection.com/wp-content/uploads/2010/07/ant_home.jpg"><img class="size-medium wp-image-180" title="ant_home" src="http://www.jarconnection.com/wp-content/uploads/2010/07/ant_home-300x172.jpg" alt="" width="300" height="172" /></a></em></em><p class="wp-caption-text">Fig. 1. Environment Variable &quot;ANT_HOME&quot;</p></div>
<p>Then, edit the system variable “Path” and add the new variable. Save all changes.</p>
<p><em>variable value: %ANT_HOME%\bin; (don’t delete the other values)</em></p>
<p>Create a &#8220;build.{your windows session name}.properties in yor sdk folder and paste in it your tomcat path:</p>
<p><em>app.server.dir=C:/liferay-portal-5.2.3/tomcat-6.0.18</em></p>
<p>Now execute your command window (<em>run-&gt;cmd</em>) and go to the &#8220;Themes&#8221; folder of  sdk plugins folder. Then create the theme:</p>
<p><em>create jarconnection &#8220;Jarconnection Theme&#8221;</em><br />
(where <em>jarconnection </em>is the name of the theme and <em>&#8220;Jarconnection Theme&#8221; is a description of it</em>)</p>
<div id="attachment_184" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.jarconnection.com/wp-content/uploads/2010/07/create_theme.jpg"><img class="size-medium wp-image-184" title="create_theme" src="http://www.jarconnection.com/wp-content/uploads/2010/07/create_theme-300x202.jpg" alt="" width="300" height="202" /></a><p class="wp-caption-text">Fig. 2. Creating the theme files</p></div>
<p>If you look at the &#8220;Theme&#8221; folder, you&#8217;ll see a new folder with the name you gave to, followed by &#8220;-theme&#8221;.</p>
<p>Create the project in Eclipse. Go to &#8220;File&#8221;-&gt;&#8221;New&#8221;-&gt;&#8221;Other&#8221; and select &#8220;Java Project&#8221;. Then clic &#8220;Next&#8221;. Write out the project name and select &#8220;Create project from existing source&#8221;. Click on &#8220;Browse&#8221; and select your theme folder (in C:\liferay-plugins-sdk-5.2.3\themes\jarconnection-theme). Finally, click on &#8220;Finish&#8221;.</p>
<div id="attachment_191" class="wp-caption aligncenter" style="width: 224px"><a href="http://www.jarconnection.com/wp-content/uploads/2010/07/them_structure.jpg"><img class="size-medium wp-image-191" title="theme_structure" src="http://www.jarconnection.com/wp-content/uploads/2010/07/them_structure-214x300.jpg" alt="" width="214" height="300" /></a><p class="wp-caption-text">Fig. 3. Theme project in Eclipse</p></div>
<p>Delete &#8220;src&#8221; folder. Now go to the project and edit &#8220;build.xml&#8221; file and change the value of  property &#8220;theme.parent&#8221; to &#8220;classic&#8221; instead of &#8220;_styled&#8221;. Drag &#8220;build.xml&#8221; file and drop it into &#8220;ant&#8221; window. Execute it (double click). You&#8217;ll see the theme structure in the package explorer window.</p>
<div id="attachment_196" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.jarconnection.com/wp-content/uploads/2010/07/theme_structure_1.jpg"><img class="size-medium wp-image-196" title="theme_structure_1" src="http://www.jarconnection.com/wp-content/uploads/2010/07/theme_structure_1-300x182.jpg" alt="" width="300" height="182" /></a><p class="wp-caption-text">Fig.4. Theme structure</p></div>
<p>If you see &#8220;C:\sdk\dist&#8221;, there&#8217;ll be a war file (your war theme). If you execute liferay portal, you&#8217;ll see your theme is available (but now is a copy of classic theme).</p>
<p style="text-align: left;">It&#8217;s time to develope the theme. Create a folder named &#8220;templates&#8221; in &#8220;_diffs&#8221; folder. Then copy &#8220;portal_normal.vm&#8221; file in this folder and open it.</p>
<p style="text-align: left;">Note: &#8220;_diffs&#8221; folder lets you add and overwrite templates, images, javascript code, &#8230;</p>
<p style="text-align: left;">If you see the code, there&#8217;ll be HTML code and other tags. This is <em><a href="http://www.jarconnection.com/developement/velocity/" target="_self">velocity</a> code</em>. Most of the code are velocity variables, defined on &#8220;init.vm&#8221; (you can find the file at &#8220;C:\liferay-portal-5.2.3\tomcat-6.0.18\webapps\ROOT\html\themes\_unstyled\templates&#8221;).</p>
<p style="text-align: left;">Paste your HTML design on &#8220;portal_normal.vm&#8221; file (on &#8220;_diffs&#8221; folder). Be carefull not to delete these variables, you have to place them in your HTML where they better fit.</p>
<p style="text-align: left;">Create a &#8220;css&#8221; folder in &#8220;_diffs&#8221; folder. Create a &#8220;custom.css&#8221; in it and your css design. Here you can overwrite css default styles of the theme. If you have images in your css design, create a &#8220;images&#8221; folder and paste it in &#8220;_diffs&#8221; folder. Create a new folder in it called &#8220;css&#8221; and paste your images. Remember to change the path in your css code. The new path will be:</p>
<p style="text-align: left;"><em>background-image:url(<strong>../images/css/</strong>butllet.gif);</em></p>
<p style="text-align: center;"><em> </em></p>
<div id="attachment_222" class="wp-caption aligncenter" style="width: 118px"><em><em><a href="http://www.jarconnection.com/wp-content/uploads/2010/07/diffs_structure.jpg"><img class="size-medium wp-image-222 " title="diffs_structure" src="http://www.jarconnection.com/wp-content/uploads/2010/07/diffs_structure-108x300.jpg" alt="" width="108" height="300" /></a></em></em><p class="wp-caption-text">Fig. 5. _diffs folder structure</p></div>
<p style="text-align: left;">If you have to add a javascript file, create a folder in &#8220;_diffs&#8221; called &#8220;javascript&#8221; and paste your javascript file in it.</p>
<p style="text-align: left;">Now it&#8217;s time to build the theme. Execute build file on ant window and wait until<em> </em>appears &#8220;Build successful&#8221; on console window.</p>
<p style="text-align: left;">To set this theme, you have to login as an admin and go to &#8220;Manage pages&#8221; at dock menu. Click on &#8220;Look &amp; feel&#8221; tab and select your theme. Click on &#8220;Return to Full Page&#8221; to see your Homepage with the new theme.</p>
<div id="attachment_208" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.jarconnection.com/wp-content/uploads/2010/07/web.jpg"><img class="size-medium wp-image-208  " title="web" src="http://www.jarconnection.com/wp-content/uploads/2010/07/web-300x182.jpg" alt="" width="300" height="182" /></a><p class="wp-caption-text">Fig. 6. Theme</p></div>
<p><em><strong>Note</strong>: each time you modify anyhing of the theme, you&#8217;ll have to build the theme again and verify at the Tomcat console the theme is available for use.</em></p>
<p>Now you can modify and desing your theme.</p>
<p>You can download a pdf version <a href="http://www.jarconnection.com/wp-content/uploads/2010/08/How-to-develope-a-Liferay-Theme.pdf" target="_blank">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarconnection.com/developement/how-to-develope-a-liferay-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To Access Objects From A Velocity Template</title>
		<link>http://www.jarconnection.com/cms/how-to-access-objects-from-a-velocity-template/</link>
		<comments>http://www.jarconnection.com/cms/how-to-access-objects-from-a-velocity-template/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 11:20:03 +0000</pubDate>
		<dc:creator>reych</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[velocity]]></category>

		<guid isPermaLink="false">http://www.jarconnection.com/?p=45</guid>
		<description><![CDATA[You want to display an image in a template or a jsp file of a portlet? Velocity Theme variables can help you!!]]></description>
			<content:encoded><![CDATA[<p>Recently I started developing a new theme in Liferay. I had some troubles because I had to display images in the &#8220;portal_normal.vm&#8221; not only in the &#8220;custom.css&#8221; by requirements of design.</p>
<p>After looking in several posts and blogs and aiming us to display them in the css file (why we would not do it?) I found an interesting post about Velocity objects.</p>
<p>And now the is an application:</p>
<p>&lt;a href=&#8221;#&#8221;&gt;&lt;img src=&#8221;$themeDisplay.getPathThemeImages()/theme/logo.gif&#8221; alt=&#8221;Logo&#8221;&gt;&lt;/a&gt;</p>
<p>In the &#8220;Theme&#8221; scenario, we have the &#8220;$themeDisplay&#8221; variable. We can get the name of the css class, its folder path, the logo name, &#8230;</p>
<p>All these variables are in the &#8220;init.vm&#8221; file in :</p>
<p>{your  root\liferay-portal-5.2.3\tomcat-6.0.18\webapps\ROOT\html\themes\_unstyled\templates</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarconnection.com/cms/how-to-access-objects-from-a-velocity-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Velocity</title>
		<link>http://www.jarconnection.com/developement/velocity/</link>
		<comments>http://www.jarconnection.com/developement/velocity/#comments</comments>
		<pubDate>Wed, 04 Nov 2009 11:04:40 +0000</pubDate>
		<dc:creator>reych</dc:creator>
				<category><![CDATA[Developement]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[templates]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[velocity]]></category>

		<guid isPermaLink="false">http://www.jarconnection.com/?p=48</guid>
		<description><![CDATA[Liferay uses Velocity templates not only to design a theme, also to reference objects defined in Java  code.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.liferay.com" target="_blank">Liferay</a> uses Velocity templates not only to design a theme, also to reference objects defined in Java  code.</p>
<p>Velocity is a Java-based template engine.  As we use Velocity for web development, web designers can work in parallel with Java programmers to develop web sites according to the Model-View-Controller (MVC) model. That means that web page designers can focus wholly on creating a site with an awesome, and programmers can focus solely on writing code.<br />
Velocity separates Java code from the web pages, making the web site more maintainable over its lifespan and providing a viable alternative to <a href="http://java.sun.com/products/jsp/" target="_blank">Java Server Pages</a> (JSPs) or <a href="http://www.php.net/" target="_blank">PHP</a> .</p>
<p>But Velocity&#8217;s capabilities reach well beyond the realm of the web; for example, it can be used to generate SQL, PostScript and XML from templates. It can be used either as a standalone utility for generating source code and reports, or as an integrated component of other systems. For instance, Velocity provides template services for the <a href="http://jakarta.apache.org/turbine/">Turbine</a> web application framework, together resulting in a view engine facilitating development of web applications according to a true MVC model.</p>
<p>Here are some links:<br />
<a href="http://velocity.apache.org/" target="_blank">Apache Velocity Project</a><br />
<a href="http://en.wikipedia.org/wiki/Apache_Velocity" target="_blank">Velocity on the Wikipedia</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarconnection.com/developement/velocity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
