Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
Extending search support for types different from cm:content
  • Loading branch information
angelborroy-ks committed Aug 30, 2017
1 parent 70641e1 commit 0dffee8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This patch, remove the parameter locale in Solr6 http requests.
The plugin is licensed under the [LGPL v3.0](http://www.gnu.org/licenses/lgpl-3.0.html).

**State**
Current patch release is 1.0.0
Current patch release is 1.1.0

**Compatibility**
The current version has been developed using Alfresco 201702 and Alfresco SDK 3.0.1
Expand All @@ -23,7 +23,7 @@ Downloading the ready-to-deploy-plugin
--------------------------------------
The binary distribution is made of one JAR file to be deployed in Alfresco as a repo module:

* [repo JAR](https://github.com/keensoft/alf-21940-repo/releases/download/201707/patch-alf-21940-repo-1.0.0.jar)
* [repo JAR](https://github.com/keensoft/alf-21940-repo/releases/download/1.1.0/patch-alf-21940-repo-1.1.0.jar)

You can install it by copying JAR file to `$ALFRESCO_HOME/modules/platform` and re-starting Alfresco.

Expand Down
2 changes: 1 addition & 1 deletion patch-alf-21940-repo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>es.keensoft</groupId>
<artifactId>patch-alf-21940-repo</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
<name>patch-alf-21940-repo Platform Jar Module - SDK 3</name>
<description>Platform JAR Module (to be included in the alfresco.war) - SDK 3</description>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
import org.apache.commons.httpclient.URIException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

// Find results for every locale by using '*' as parameter value
public class EnhancedSolrQueryHTTPClient extends SolrQueryHTTPClient {

static Log logger = LogFactory.getLog(EnhancedSolrQueryHTTPClient.class);
Expand All @@ -25,12 +27,19 @@ protected JSONResult postSolrQuery(HttpClient httpClient, String url, JSONObject
SolrJsonProcessor<?> jsonProcessor, String spellCheckParams)
throws UnsupportedEncodingException, IOException, HttpException, URIException, JSONException {

int posPrev = url.toString().indexOf("&locale=");
// Sanitize URL
int posPrev = url.toString().indexOf("&locale=");
int posAfter = url.toString().indexOf("&", posPrev + 1 + LOCALE_PARAM.length());
url = url.toString().substring(0, posPrev) + url.toString().substring(posAfter);

url = url.toString().substring(0, posPrev) + "&locale=*" + url.toString().substring(posAfter);
logger.debug("Sanitized URL: " + url);

// Sanitize Body
body.remove("locales");
JSONArray locales = new JSONArray();
locales.put("*");
body.put("locales", locales);
logger.debug("Sanitized Body: " + body);

return super.postSolrQuery(httpClient, url, body, jsonProcessor, spellCheckParams);

}
Expand Down

0 comments on commit 0dffee8

Please sign in to comment.