Forums

Home » Liferay Portal » English » Liferay Legacy

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
stripbolt stripbolt
How to refactor the shopping portlet?
August 19, 2004 9:49 AM
Answer

stripbolt stripbolt

Rank: New Member

Posts: 5

Join Date: August 18, 2004

Recent Posts

Hi,<br /> I&#39;m writing my college paper about liferay and trying to refactor the shopping portlet. My idea is splitting the shop portlet into several portlets such as category list, item list, detail of items, search items, shopping cart and so on. So I can make the liferay shopping portlet look like amazon.com (put category list and search items portlet in the left narrow column, news portlet in the middle wide column, and shopping cart portlet in the right narrow column). I want to use the liferay�s shopping portlet�s java codes and only modify view tier (*.jsp and *.xml files). I�m confused by how to organize many portlets by using struts framework and write the struts-config.xml and tiles-def.xml. Could anyone tell me how to do it and give me some advice? Thank you&#33;
Brian Chan
How to refactor the shopping portlet?
August 19, 2004 11:59 AM
Answer

Brian Chan

LIFERAY STAFF

Rank: Liferay Master

Posts: 751

Join Date: August 4, 2004

Recent Posts

I would recommend keeping all the EJBs in the same layer, but adding new portlets.<br /><br />Check out the Recent Documents portlet. That&#39;s a view of the Document Library portlet with stuff missing.<br /><br />A good way would be to create a new portlet, with x functionality, duplicate it in the shopping portlet. Then remove it from the shopping portlet. It&#39;s really quite a task. I would question the usefulness of it though. Since we have many portlets besides shopping, it&#39;d be bad if the user picked one portlet but wasn&#39;t able to add to cart because their cart portlet wasn&#39;t added. It&#39;s easier and more useful to just bundle it all in.<br /><br />Now, a very useful refactoring, imho, is to be able to make it hit a CC like CyberSource. <!--emo&;)--><img src='@theme_images_path@/emotions/wink.gif' border='0' style='vertical-align:middle' alt='wink.gif' /><!--endemo--> and having it go from http to https and back. Others have submitted code like it already, we just haven&#39;t had time to include it all in.
stripbolt stripbolt
How to refactor the shopping portlet?
August 19, 2004 8:26 PM
Answer

stripbolt stripbolt

Rank: New Member

Posts: 5

Join Date: August 18, 2004

Recent Posts

Thank you for your advice. <!--emo&^_^--><img src='@theme_images_path@/emotions/happy.gif' border='0' style='vertical-align:middle' alt='happy.gif' /><!--endemo--> I&#39;d thought the problem you said over. My original refactoring idea is spitting the shopping portlet into several windows(some can be put in the left or right narrow column, some can be put in the middle column), and all the windows belong to a single portlet so that they can be managed easily. But I&#39;m wondering how to implement this, I think a portlet&#39;s window can be set in only one column though it can has several rows.
Brian Kim
How to refactor the shopping portlet?
August 30, 2004 3:27 PM
Answer

Brian Kim

LIFERAY STAFF

Rank: Expert

Posts: 319

Join Date: August 16, 2004

Recent Posts

You may want to check out how tiles is being used in portal-web/docroot/html/tiles/portlet_default.jsp. Then see how in portal-web/docroot/web-inf/tiles-defs.xml many portlets are extending the portlet_default definition? perhaps this is along the lines of what you&#39;re looking for?<br /><br />We&#39;d also be interested to hear what your paper is about exactly, and even read it over when you are done.