Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
dennis monsewicz
Append Parameters configuration
August 6, 2009 12:12 PM
Answer

dennis monsewicz

Rank: Junior Member

Posts: 71

Join Date: May 28, 2009

Recent Posts

I was looking through liferay's "documentation" and noticed that there was something talking about Portlet URLs and turning off the parameters...

portlet.url.append.parameters=false

Where can I find this at to turn this to false?

This section is found on page 195 of the liferay administration guide

Thanks!
Minhchau Dang
RE: Append Parameters configuration
August 6, 2009 5:47 PM
Answer

Minhchau Dang

LIFERAY STAFF

Rank: Expert

Posts: 349

Join Date: October 22, 2007

Recent Posts

You change the value in portal-ext.properties (see here for additional documentation on how to do so). However, the field already defaults to false, and it doesn't do what you think it does.

#
# Set this to true if calling setParameter on a portlet URL appends the
# parameter value versus replacing it. There is some disagreement in the
# interpretation of the JSR 168 spec among portlet developers over this
# specific behavior. Liferay Portal successfully passes the portlet TCK
# tests whether this value is set to true or false.
#
# See http://issues.liferay.com/browse/LEP-426 for more information.
#
portlet.url.append.parameters=false
dennis monsewicz
RE: Append Parameters configuration
August 7, 2009 8:31 AM
Answer

dennis monsewicz

Rank: Junior Member

Posts: 71

Join Date: May 28, 2009

Recent Posts

Hmmm alright

Well when I create a custom portlet and place <a></a> tags on the page with href's within the page Liferay adds its gunkiness to the links

For example:

<a href="google.com"></a> will produce: <a href="http://mysite.com/web/pcc/page/childpage?p_p_id=portletname_WAR_portletname&p_p_lifecycle=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-3&p_p_col_count=1&_portletname_WAR_portletname_phpURI=google.com></a>

Is there anyway to stop the liferay from doing this to links?

Thanks!
Minhchau Dang
RE: Append Parameters configuration
August 7, 2009 9:52 AM
Answer

Minhchau Dang

LIFERAY STAFF

Rank: Expert

Posts: 349

Join Date: October 22, 2007

Recent Posts

I do not believe it's possible out of the box, since the portlet class you're probably using (com.liferay.util.bridges.php.PHPPortlet) isn't looking at any properties when it's deciding whether or not to update the URLs.

The alternative is to write your own PHPPortlet class modeled after this one which either (a) doesn't make a call to the rewriteURLs method, or (b) overrides the rewriteURLs method to do nothing.
dennis monsewicz
RE: Append Parameters configuration
August 7, 2009 10:04 AM
Answer

dennis monsewicz

Rank: Junior Member

Posts: 71

Join Date: May 28, 2009

Recent Posts

Hmmm... That would work... do you know where this class would be located to even begin to look on how to modify the class?

As of right now when we install PHP portlets our directory structure is as follows

{{ NAME_OF_ZIP_FILE
index.php
other_dir/
inc/
include.pages.php
otherpage.php
}}

And then once our zip file is installed Liferay natively adds the WEB_INF and META-INF folders in the webapp
Minhchau Dang
RE: Append Parameters configuration
August 7, 2009 11:56 AM
Answer

Minhchau Dang

LIFERAY STAFF

Rank: Expert

Posts: 349

Join Date: October 22, 2007

Recent Posts

The class itself is found in util-bridges.jar (which you can see in webapps/ROOT/WEB-INF/lib, where the "webapps" folder is where your PHP portlet gets deployed to), and you can find the source code in util-bridges, under src/com/liferay/portal/util/bridges/php/PHPPortlet.java in the portal source.

Customizing the class will require some Java knowledge, which you probably don't have very much experience with. So, if you want to see if the change will work at all (I cannot say for sure whether it will work), download the attached ZIP and extract the contents to the webapps/ROOT/WEB-INF/classes, where the "webapps" folder is where your PHP portlet gets deployed to.

Note: Make sure that the directory structure is webapps/ROOT/WEB-INF/classes/com and not webapps/ROOT/WEB-INF/classes/php-portlet-customization/com

.
Attachments: php-portlet-customization.zip (3.8k)
dennis monsewicz
RE: Append Parameters configuration
August 10, 2009 7:55 AM
Answer

dennis monsewicz

Rank: Junior Member

Posts: 71

Join Date: May 28, 2009

Recent Posts

Thanks! I will give this a shot and get back with you!
dennis monsewicz
RE: Append Parameters configuration
August 10, 2009 8:32 AM
Answer

dennis monsewicz

Rank: Junior Member

Posts: 71

Join Date: May 28, 2009

Recent Posts

What did you modify in the class? Cause it didn't do anything for me emoticon
Minhchau Dang
RE: Append Parameters configuration
August 10, 2009 9:39 AM
Answer

Minhchau Dang

LIFERAY STAFF

Rank: Expert

Posts: 349

Join Date: October 22, 2007

Recent Posts

As indicated in an earlier post, I removed the call to the rewriteURLs method in com.liferay.util.bridges.php.PHPPortlet (which is found in the util-bridges folder in the portal source).

You can look through the source for that portlet if you want to try something else.
dennis monsewicz
RE: Append Parameters configuration
August 10, 2009 9:54 AM
Answer

dennis monsewicz

Rank: Junior Member

Posts: 71

Join Date: May 28, 2009

Recent Posts

Hmmm... Well that actually didn't have any effect on our code...

Here is the directory we placed it in:

/webapps/ROOT/WEB-INF/classes/com/liferay/util/bridges/php