LeventeHudak/liferay-portal — pull request #19 by lipusz (2013-01-06 14:37:30+00:00)
Title: [TECHNICAL-SUPPORT] LPS-32107 Add exception handling to Search portlet and fix RangeFacet to do not throw IllegalArgumentException for Custom Range

Hi, Levente,

Could you please review my changes?
I have added several comments for the modified lines to explain my modifications.

### 1. Explanation of changes in Language.properties

I couldn't find any applicable existing message relating searches, that's why I have added a new one.

### 2. Explanation of changes in RangeFacet.java

- "start" and "end" is already checked by Validator.isNull() at line 76, thus, there is no need to repeat these null-checks later.

- Take a look at https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/portlet/search/facets/modified.jsp#L169
We invert "fromDate and "endDate" in case the "startDate" > "endDate" >>> I have applied this rule in RangeFacet.java to have the same logic in the service layer.

- Why is it problem if "start" = "end"? I have tested these scenarios (with OpenSearch as well), and have not found anything indicating the ">=" condition.

### 3. Explanation of changes in modified.jsp

We should not allow users to enter date values manually. Therefore, I have disabled these input fields.

### 4. Explanation of changes in search.jsp

https://github.com/liferay/liferay-portal/blob/master/portal-service/src/com/liferay/portal/kernel/search/FacetedSearcher.java#L101 can throw SearchException, but Search portlet is not designed to handle exceptions. >>> I have modified the source similar to https://github.com/liferay/liferay-portal/blob/master/portal-web/docroot/html/portlet/asset_publisher/view_content.jsp#L105

Let me know if you have any questions or problems regarding my commits.

Thanks,
Tibor