Skip to content

Commit

Permalink
Fixed bug in eclipse toolset to exclude mappings in repository search…
Browse files Browse the repository at this point in the history
… result
  • Loading branch information
aedelmann committed Sep 26, 2016
1 parent f4c815f commit 425a939
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
package org.eclipse.vorto.repository;

import java.net.URL;
import java.net.URLEncoder;
import java.util.List;
import java.util.Objects;
import java.util.Observable;
Expand Down Expand Up @@ -76,11 +78,14 @@ public RestModelRepository(ConnectionInfo connectionUrlSupplier) {
@Override
public List<ModelResource> search(String expression) {
try {
String searchExpr = expression;
String searchExpr = null;
if (Strings.isNullOrEmpty(expression)) {
searchExpr = "*";
searchExpr = "-Mapping";
} else {
searchExpr = expression + " -Mapping";
}
List<ModelView> result = httpClient.executeGet("model/query=" + searchExpr, searchResultConverter);
searchExpr = searchExpr.replaceAll(" ", "%20");
List<ModelView> result = httpClient.executeGet(("model/query=" + searchExpr), searchResultConverter);

// Convert the searchResult in result to return type
return Lists.transform(result, modelViewToModelResource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ repositoryControllers.controller('SearchController', [ '$scope','$http', '$locat
$scope.search = function() {
var filter = null;
if ($scope.modelType === 'all') {
filter = $scope.queryFilter + "-Mapping";
filter = $scope.queryFilter + " -Mapping";
} else {
filter = $scope.queryFilter + " -Mapping "+$scope.modelType;
}
Expand Down

0 comments on commit 425a939

Please sign in to comment.