Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Search Engine (issue 535) #97

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3916bcd
Added search bar UI
halfcurry May 18, 2017
17b6d5f
Worked on SearchResults classes
halfcurry May 23, 2017
e052d70
New tab opens but is Singleton
halfcurry May 26, 2017
e3a44e5
Work on Search results page title
halfcurry May 29, 2017
695f257
Multiple tabs open but bugs exist
halfcurry May 31, 2017
5f749b4
Attempt at connecting to Solr Server
halfcurry Jun 4, 2017
883460a
Minor changes to the search classes
halfcurry Jun 7, 2017
34597da
Added an index button to do full import
halfcurry Jun 9, 2017
c08b492
Attempt at presentation of results on screen
halfcurry Jun 12, 2017
cfa0418
Results rendering but views not changing
halfcurry Jun 13, 2017
882cc0e
Fixed Search results view changing issue and cleaned code
halfcurry Jun 14, 2017
8dd81b4
[Issue #535]: Attempt at opening a project on clicking project search…
halfcurry Jun 22, 2017
b533347
[Issue #535]:Contacts, OrgUnits open on clicking results
halfcurry Jun 27, 2017
0fc5440
[Issue 535]: Made search results pretty
halfcurry Jun 28, 2017
049a3ee
[Issue 535]:Added search filtering and resolved first-time connection…
halfcurry Jun 28, 2017
14db114
[Issue #535]:Added icons to differentiate between types of results
halfcurry Jun 30, 2017
9d15b0a
[Issue #535]:Added filtering (using existing permissions of user) for…
halfcurry Jul 5, 2017
d3e1fb3
[Issue #535]: Contacts and OrgUnits permmission filtering and cleanin…
halfcurry Jul 7, 2017
dd095d6
[Issue #535]: Added an auto full-data import indexing job
halfcurry Jul 9, 2017
0604656
[Issue #535]: Modified pom.xml to include global sigmah core url prop…
halfcurry Jul 9, 2017
1fd1e1c
[Issue #535]:Added solr sonfig files
halfcurry Jul 10, 2017
44ef000
[Issue #535]: Added a panel in admin settings for solr settings
halfcurry Jul 16, 2017
bec9e80
[Issue #535]:Added a column to table organization to store and use so…
halfcurry Jul 19, 2017
ae9af1a
[Issue #535]:Multiple failed attempts at querying the database for a …
halfcurry Jul 28, 2017
b235197
[Issue #535]:Added File indexing capability via existing command patt…
halfcurry Jul 30, 2017
9b2bdd4
[Issue #535]:Small error in last commit
halfcurry Jul 30, 2017
1f7d1f3
[Issue #535]:Modified automatic and manual indexing to include files …
halfcurry Jul 30, 2017
035c728
[Issue #535]:Presentation of files in search results
halfcurry Aug 2, 2017
05abe0b
[Issue #535]:Made UI changes and very rudimentary files results filte…
halfcurry Aug 5, 2017
fb2f93e
[Issue #535]:Multiple changes to UIs of search bar, results and admin
halfcurry Aug 6, 2017
39b19a1
[Issue #535]:Added proper errror messages for different cases
halfcurry Aug 8, 2017
6b2ed5f
[Issue #535]:Code cleanup #1
halfcurry Aug 12, 2017
4999b3a
[Issue #535]:Code cleanup #2, added comments
halfcurry Aug 12, 2017
8f9281a
[Issue #535]:Added Global Permission SEARCH for viewing search bar
halfcurry Aug 13, 2017
9df59b2
[Issue #535]:Added a search button image
halfcurry Aug 13, 2017
4e9ea32
[Issue #535]:Final few changes and code cleanup
halfcurry Aug 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,15 @@
<artifactId>mail</artifactId>
<version>1.4.5</version>
</dependency>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ignore any local changes I have made. The only one which matters is this solr dependency.

<!-- SolrJ -->
<dependency>
<artifactId>solr-solrj</artifactId>
<groupId>org.apache.solr</groupId>
<version>6.5.0</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

<!-- MISC -->
<dependency>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/sigmah/client/Sigmah.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ private void clientInitializing() {
injector.getAppLoaderPresenter();
injector.getMenuBannerPresenter();
injector.getMessageBannerPresenter();
injector.getSearchPresenter();

// Pages.
injector.getLoginPresenter();
Expand Down Expand Up @@ -165,6 +166,7 @@ private void clientInitializing() {
injector.getReportCreatePresenter();
injector.getAttachFilePresenter();
injector.getImportationPresenter();
injector.getSearchResultsPresenter();

injector.getAdminPresenter();
injector.getUsersAdminPresenter();
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/org/sigmah/client/inject/Injector.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.sigmah.client.ui.presenter.HelpPresenter;
import org.sigmah.client.ui.presenter.LoginPresenter;
import org.sigmah.client.ui.presenter.MockUpPresenter;
import org.sigmah.client.ui.presenter.SearchResultsPresenter;
import org.sigmah.client.ui.presenter.admin.AdminPresenter;
import org.sigmah.client.ui.presenter.admin.CategoriesAdminPresenter;
import org.sigmah.client.ui.presenter.admin.ParametersAdminPresenter;
Expand Down Expand Up @@ -99,6 +100,7 @@
import org.sigmah.client.ui.presenter.zone.MessageBannerPresenter;
import org.sigmah.client.ui.presenter.zone.OfflineBannerPresenter;
import org.sigmah.client.ui.presenter.zone.OrganizationBannerPresenter;
import org.sigmah.client.ui.presenter.zone.SearchPresenter;
import org.sigmah.client.ui.theme.Theme;
import org.sigmah.offline.dao.FileDataAsyncDAO;
import org.sigmah.offline.dao.TransfertAsyncDAO;
Expand Down Expand Up @@ -178,6 +180,8 @@ public interface Injector extends Ginjector {
MenuBannerPresenter getMenuBannerPresenter();

MessageBannerPresenter getMessageBannerPresenter();

SearchPresenter getSearchPresenter();

CreditsPresenter getCreditsPresenter();

Expand All @@ -204,6 +208,8 @@ public interface Injector extends Ginjector {
AttachFilePresenter getAttachFilePresenter();

ImportationPresenter getImportationPresenter();

SearchResultsPresenter getSearchResultsPresenter();

// ---- Project presenters.

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/org/sigmah/client/page/Page.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ public enum Page implements IsSerializable {
CREDITS("credits", true),
HELP("help", true),
CREATE_PROJECT("create-project", true),
IMPORT_VALUES("import-values"), ;
IMPORT_VALUES("import-values"),
SEARCH_RESULTS("search-results") ;

private final String parentKey;
private final String token;
Expand Down Expand Up @@ -320,6 +321,8 @@ public static String getTitle(final Page page) {
return I18N.CONSTANTS.adminboard();
case CREATE_PROJECT:
return I18N.CONSTANTS.createProject();
case SEARCH_RESULTS:
return "Search Results";
default:
return PropertyName.error(page.token);
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/sigmah/client/page/RequestParameter.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ public enum RequestParameter {
CLOSE_CURRENT_TAB,
CONTACT_ID,
ELEMENTS,
PROJECT_ID;
PROJECT_ID,
;

// If the parameter is part of the tab uniqueness logic.
private final boolean unique;
Expand Down
44 changes: 44 additions & 0 deletions src/main/java/org/sigmah/client/search/SearchService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package org.sigmah.client.search;

/*
* #%L
* Sigmah
* %%
* Copyright (C) 2010 - 2016 URD
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/

import java.util.ArrayList;

import org.sigmah.shared.dto.search.SearchResultsDTO;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
* Interface used by the client side for calling search related methods using GWT's
* async callbacks. {@link SearchServiceAsync} is the associated Async interface
*
* @author Aditya Adhikary ([email protected])
*
*/
@RemoteServiceRelativePath("search")
public interface SearchService extends RemoteService {
ArrayList<SearchResultsDTO> search(String searchStr, String filter);
Boolean index();
Boolean updateCore(String solrCoreUrl);
}
43 changes: 43 additions & 0 deletions src/main/java/org/sigmah/client/search/SearchServiceAsync.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.sigmah.client.search;

/*
* #%L
* Sigmah
* %%
* Copyright (C) 2010 - 2016 URD
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/

import java.util.ArrayList;

import org.sigmah.server.search.SearchServiceImpl;
import org.sigmah.shared.dto.search.SearchResultsDTO;

import com.google.gwt.user.client.rpc.AsyncCallback;

/**
* Async interface on the client side which is implemented by
* {@link SearchServiceImpl} on the server side.
*
* @author Aditya Adhikary ([email protected])
*/
public interface SearchServiceAsync {

public void search(String searchStr, String filter, AsyncCallback<ArrayList<SearchResultsDTO>> callback);
public void index(AsyncCallback<Boolean> callback);
public void updateCore(String solrCoreUrl, AsyncCallback<Boolean> callback);
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.sigmah.client.ui.presenter.zone.MessageBannerPresenter;
import org.sigmah.client.ui.presenter.zone.OfflineBannerPresenter;
import org.sigmah.client.ui.presenter.zone.OrganizationBannerPresenter;
import org.sigmah.client.ui.presenter.zone.SearchPresenter;
import org.sigmah.client.ui.view.ApplicationView;
import org.sigmah.client.ui.view.base.ViewInterface;
import org.sigmah.client.ui.view.base.ViewPopupInterface;
Expand Down Expand Up @@ -95,7 +96,7 @@ public static interface View extends ViewInterface {
*/
void initZones(OrganizationBannerPresenter.View organizationBannerView, AuthenticationBannerPresenter.View authenticationBannerPresenter,
OfflineBannerPresenter.View offlineBannerPresenter, AppLoaderPresenter.View appLoaderPresenter, MenuBannerPresenter.View menuBannerPresenter,
MessageBannerPresenter.View messageBannerPresenter);
MessageBannerPresenter.View messageBannerPresenter, SearchPresenter.View searchPresenter);

/**
* Returns the <em>credits</em> widget capable of handling a {@code ClickHandler}.
Expand Down Expand Up @@ -142,7 +143,7 @@ public ApplicationPresenter(final View view, final Injector injector) {

view.initZones(injector.getOrganizationBannerPresenter().getView(), injector.getAuthenticationBannerPresenter().getView(), injector
.getOfflineBannerPresenter().getView(), injector.getAppLoaderPresenter().getView(), injector.getMenuBannerPresenter().getView(), injector
.getMessageBannerPresenter().getView());
.getMessageBannerPresenter().getView(), injector.getSearchPresenter().getView());

}

Expand Down
Loading