Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Extend SearchService: Add search for private and restricted content. #1758

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
language: java
before_install:
- sed -i.bak -e 's|https://nexus.codehaus.org/snapshots/|https://oss.sonatype.org/content/repositories/codehaus-snapshots/|g' ~/.m2/settings.xml
install: echo 'Skipping mvn install'
before_script:
- ./test-whitespaces.sh
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ EntityList<Result> getResultsWithConstraint(String query, Constraint constraint)
return getSearchService().getResultsWithConstraint(query, constraint);
}

EntityList<Result> getMyResults(String query) throws ClientServicesException {
return getSearchService().getMyResults(query);
}

EntityList<Result> getMyResults(String query, Map<String, String> parameters) throws ClientServicesException {
return getSearchService().getMyResults(query, parameters);
}

EntityList<Result> getMyResultsWithConstraint(String query, Constraint constraint) throws ClientServicesException {
return getSearchService().getMyResultsWithConstraint(query, constraint);
}

/**
* Demo.
*
Expand All @@ -74,11 +86,18 @@ public static void main(String[] args) {
try {
sa = new SearchApp(url, user, password);

System.out.println("*** Public entities:");
EntityList<Result> results = sa.getResults(query);
for (Result result : results) {
System.out.println(result.getTitle() + " " + result.getUpdated());
}

System.out.println("*** Non-public entities accessible by given user:");
results = sa.getMyResults(query);
for (Result result : results) {
System.out.println(result.getTitle() + " " + result.getUpdated());
}

} catch (Exception e) {
e.printStackTrace();
}
Expand Down
Loading