Monday, March 7, 2011

How to dump database perfectly?

Sometimes you're requested to repair some portal function. To do that, maybe you need to test is at localhost.
Then you're provided database. This database must be dumped into database in localhost.

The common things that happened are database cannot be dumped perfectly. Maybe you found error on generate Foreign Key, or table name not existed etc.

I will explain base on these criteria.
A. Application Server: XAMPP
B. OS: Windows (XP or 7)
C. My DB Name: myportal

I installed application server in the shortest path; i.e C:\xampp

1. Open my.ini file in C:\xampp\mysql\bin
2. Then under [mysqldump] add this line
lower_case_table_names=1
3. Change max_allowed_packet to greater value
max_allowed_packet = 80M
Note: Make sure both values for max_allowed_packet under [mysqldump] and [mysqld] are same.
4. Restart mysql service in xampp Control Panel. [Click 'Stop' and then 'Start']

[Figure1: xampp Control Panel]

5. Open cmd windows. Point to bin.
cd \xampp\mysql\bin
6. Type command line to dump database
mysql -u root myportal < "C:\project\myportal\myportalbackup03072011.sql"
7. Press Enter
8. Restart tomcat server.

Thursday, February 17, 2011

How to embed portlet in portlet




I want to create a page with tab panel. There are three tab headers.
Under each tab header, I want content manager update content but he not deal with my tab panel script.

He only update content in each portlet which is configured.
So I embed journal content portlet in a journal content.

<div id="tabs-perolehan" class="ui-tabs-nav">
<ul class="ui-tabs-nav ui-widget-header ui-corner-all">
<li class="ui-corner-top ui-state-default ui-tabs-selected" id="tab-title-1"><a href="#tab-panel-1"><span>TENDER</span></a></li>
<li class="ui-corner-top ui-state-default" id="tab-title-2"><a href="#tab-panel-2"><span>SEBUT HARGA</span></a></li>
<li class="ui-corner-top ui-state-default" id="tab-title-3"><a href="#tab-panel-3"><span>E-BIDDING</span></a></li>
</ul>
<div id="tab-panel-1" class="ui-tabs-panel" style="display: block;">
<div id="embedded-tender">
<runtime-portlet name="56" instance="4411" queryString=""/>
</div>
</div>
<div id="tab-panel-2" class="ui-tabs-panel ui-tabs-hide">
<div id="embedded-sebutharga">
<runtime-portlet name="56" instance="4422" queryString=""/>
</div>
</div>

<div id="tab-panel-3" class="ui-tabs-panel ui-tabs-hide">
<div id="embedded-ebidding">
<runtime-portlet name="56" instance="4433" queryString=""/>
</div>
</div>

</div>

Details:
name="56"; this name belongs to journal content as stated in /WEB-INF/liferay-portlet.xml
instance="xxxx"; We can use any 4 digit number to instance.

Thursday, January 20, 2011

How to solve error: WARN: [PortletRequestProcessor:507]

Liferay version: 5.2.3
-----------------------------
When you try uploading certain file in Document Library, maybe you will find this warning

WARN: [PortletRequestProcessor:507]

Then the file cannot be uploaded.

Why? The size exceed the limit.

Solution;
1. adjust the size limit size in the Server Administration.

Go to Control Panel > Server Administration > File Uploads


Then adjust the size. In my case, I increased the size to 12 MB.