Unlocking The Asset Publisher

Company Blogs June 13, 2008 By Craig Kaneko Staff

If you’re just getting involved with Liferay, you may have come across an interesting portlet called the asset publisher.  There are so many different ways to configure this portlet so that it displays content differently. I’ll try to show you how to configure the asset publisher so that it looks more like a familiar real world example. 

Here’s a screenshot of a site you may have wasted countless hours on.

 

 

You can do this basic functionality in Liferay using two portlets and without having to write any code.  Just some cut and paste and a little configuration.  It’s not exactly the same but you can see the potential in this portlet, thus unlocking the asset publisher.  Here is the Liferay version of the site.

 

 

Creating Pages

First, I created different pages for the different categories under the “Filter By” section.  Notice that I changed the friendly URL to show the title of the page too. 

 

Filter By Content

Next, I created the “Filter By” content using the journal content portlet.  I created 4 of these journal articles and placed each one of them on their respective page with the correct friendly URL.

 

 

 

Categories: Featured | Most Recent |  Most Viewed | All

Link each of these words with each of the Friendly URLs you just created.  I didn’t link “featured” because this is the current page that I’m on.

*Don’t forget to change the title of the portlet from Journal Content to “Featured” by clicking on the portlet title.

 

Featured Video Content

To create my video content, I added the asset publisher to each of the 4 pages.  On the asset publisher, on the” Featured Page”, I added a new journal article. Then, I added the title of the video “Liferay Portal in Ten Minutes, I clicked on source and added the embedded javascript code for my video from YouTube.  Then, I added two tags- videos and featured, these tags will be used when I configure my asset publisher.  Under the “Abstract Section”, I added the description for the video that was on YouTube and I also added the thumbnail for the video as well.  I repeated this for all of my videos and I left out the featured tag, if the video wasn’t featured.  You could also add a new tag for a new category.

 

 

 

Configuring the Asset Publisher

Now on to configuring the Asset Publisher to display the right categorized content for each of my pages.  I clicked on the gear icon on my Asset Publisher.  Assuming that I’m on the “Featured” page, I chose “Journal Article” for Asset Type and added featured and videos as tags and also chose the search operator as “And”.  *Remember to save.

 

Then I clicked on display settings, for display style I chose abstract for display style and for order by column 1, I chose create date descending (so that it would show the most recent videos created first that would also have the tags videos and featured).   Here you can try testing out different combinations and most of the options are self-explanatory.  I also enabled comments and ratings too.   Click save.

 

 

 

 

Now the asset publisher displays my video “Liferay Portal in Ten Minutes”.  I also changed the title to Featured Videos.

 

 

 

Click on the link “Liferay Portal in Ten Minutes and you’ll see this:

Now, just configure all of your asset publishers to display the correct content for each of your pages and woohoo you just duplicated YouTube…well sort of. =)

 

Craig

 

How I set up a pseudo demo server

Company Blogs November 6, 2007 By Craig Kaneko Staff

So a couple of weeks ago, Ivan and I were trying to figure out how he could let his friend hit his Liferay tomcat without having to set up a demo server or using adobe acrobat connect. Basically, he needed the fastest way for someone to hit his local box from outside his network (China to US). A week earlier, I stumbled upon this tool called Hamachi, which allows you to create private vpn networks quickly and easily. 
 

What we did was this:

 
  1. We installed Hamachi on both our boxes.
  2. I “created a new network” called Liferay and added a password.
  3. Ivan “joined an existing network” called Liferay and entered that password.
  4. The Hamachi client displayed both the Liferay network and also our “new” ip addresses for our machines.
  5. Ivan started up his Liferay bundle
  6. I then entered in http://5.35.87.107:8080, (5.35.87.107 being “ivan’s new ip” instead of localhost)
  7. I was able to hit his local Liferay tomcat
 
You can transfer files using start > run > \\5.35.87.107 and you can also use vnc viewer to have remote access to your box. This is a really cool tool, especially if you’re running a home webserver. More posts to come on the exact steps that I took to get my Liferay site up at home using a dynamic ip through my cable provider.
 
 
Enjoy!

How I configured Liferay to use Gmail as my SMTP server

Company Blogs November 2, 2007 By Craig Kaneko Staff

 

I figured out how to do this when I was testing the message board subscriptions and the web form portlet.

Configure your ROOT.xml to look like this:

<Resource

                        name="mail/MailSession"

                        auth="Container"

                        type="javax.mail.Session"

                        mail.imap.host="localhost"

                        mail.pop.host="localhost"

                        mail.store.protocol="imap"

                        mail.transport.protocol="smtp"

                        mail.smtp.host="smtp.gmail.com"

                        mail.smtp.port="465"

                        mail.smtp.auth="true"

                        mail.smtp.starttls.enable="true"

                        mail.smtp.user="username"

                        password="password"

                        mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"

/>

 

Of course, don't forget to change username and password to your gmail username and password.  

Do not add @gmail.com to your username.  Just your username is fine.

 

Now Liferay will be able to send out emails using your gmail account.

 

Test it by using the web form portlet.  Make sure to configure the portlet to send the web form info to the email address you want.  Submit your form and you should get an email from the gmail account you just set up.

 

Showing 3 results.