public class Littera extends SearchOnlyApi
OpacApi.CancelResult, OpacApi.MultiStepResult, OpacApi.OpacErrorException, OpacApi.ProlongAllResult, OpacApi.ProlongResult, OpacApi.ReservationResult
Modifier and Type | Field and Description |
---|---|
protected static java.util.Map<java.lang.String,java.lang.String> |
LANGUAGE_CODES |
protected java.lang.String |
languageCode |
protected java.util.List<SearchQuery> |
lastQuery |
protected static java.util.Map<java.lang.String,SearchResult.MediaType> |
MEDIA_TYPES |
protected java.lang.String |
opac_url |
protected static java.util.List<java.lang.String> |
SEARCH_FIELDS_FOR_DROPDOWN |
http_client, httpLoggingEnabled, initialised, KEY_SEARCH_QUERY_AUDIENCE, KEY_SEARCH_QUERY_AUTHOR, KEY_SEARCH_QUERY_AVAILABLE, KEY_SEARCH_QUERY_BARCODE, KEY_SEARCH_QUERY_BRANCH, KEY_SEARCH_QUERY_CATEGORY, KEY_SEARCH_QUERY_DIGITAL, KEY_SEARCH_QUERY_FREE, KEY_SEARCH_QUERY_HOME_BRANCH, KEY_SEARCH_QUERY_ISBN, KEY_SEARCH_QUERY_KEYWORDA, KEY_SEARCH_QUERY_KEYWORDB, KEY_SEARCH_QUERY_LOCATION, KEY_SEARCH_QUERY_ORDER, KEY_SEARCH_QUERY_PUBLISHER, KEY_SEARCH_QUERY_SYSTEM, KEY_SEARCH_QUERY_TITLE, KEY_SEARCH_QUERY_YEAR, KEY_SEARCH_QUERY_YEAR_RANGE_END, KEY_SEARCH_QUERY_YEAR_RANGE_START, library, stringProvider, supportedLanguages
SUPPORT_FLAG_ACCOUNT_PROLONG_ALL, SUPPORT_FLAG_CHANGE_ACCOUNT, SUPPORT_FLAG_ENDLESS_SCROLLING, SUPPORT_FLAG_QUICKLINKS, SUPPORT_FLAG_WARN_PROLONG_FEES, SUPPORT_FLAG_WARN_RESERVATION_FEES
Constructor and Description |
---|
Littera() |
Modifier and Type | Method and Description |
---|---|
protected void |
addAdvancedSearchFields(java.util.List<SearchField> fields) |
protected void |
addDropdownValuesForField(DropdownSearchField field,
java.lang.String id) |
protected void |
addSimpleSearchField(java.util.List<SearchField> fields) |
protected void |
addSortingSearchFields(java.util.List<SearchField> fields) |
protected java.lang.String |
buildSearchUrl(java.util.List<SearchQuery> query,
int page) |
protected SearchRequestResult |
executeSearch(java.util.List<SearchQuery> query,
int pageIndex) |
SearchRequestResult |
filterResults(Filter filter,
Filter.Option option)
If your
OpacApi.search(List) implementation puts something different from null
into SearchRequestResult.setFilters(List) , this will be called to apply a filter to
the last search request. |
protected java.lang.String |
getApiUrl() |
protected java.lang.String |
getDefaultEncoding() |
protected java.lang.String |
getLanguage() |
DetailledItem |
getResult(int position)
Get details for the item at
position from last OpacApi.search(java.util.List<de.geeksfactory.opacclient.searchfields.SearchQuery>) or OpacApi.searchGetPage(int) call. |
DetailledItem |
getResultById(java.lang.String id,
java.lang.String homebranch)
Get details for the item with unique ID id.
|
java.lang.String |
getShareUrl(java.lang.String id,
java.lang.String title)
Some library systems allow us to share search results.
|
java.util.Set<java.lang.String> |
getSupportedLanguages()
Get all languages supported by this library.
|
int |
getSupportFlags()
Return which optional features your API implementation supports.
|
void |
init(Library library,
HttpClientFactory httpClientFactory)
Initializes HTTP client and String Provider
|
java.util.List<SearchField> |
parseSearchFields() |
SearchRequestResult |
search(java.util.List<SearchQuery> query)
Performs a catalogue search.
|
SearchRequestResult |
searchGetPage(int page)
Get result page
page of the search performed last with OpacApi.search(java.util.List<de.geeksfactory.opacclient.searchfields.SearchQuery>) . |
void |
setLanguage(java.lang.String language)
Set the language to use.
|
account, cancel, checkAccountData, prolong, prolongAll, reservation
buildHttpGetParams, cleanUrl, convertStreamToString, convertStreamToString, downloadCover, getQueryParams, getQueryParamsFirst, getSearchFields, httpGet, httpGet, httpGet, httpGet, httpPost, httpPost, httpPost, httpPost, logHttpError, searchQueryListToMap, setHttpLoggingEnabled, setStringProvider, shouldUseMeaningDetector, start, volumeSearch
protected static final java.util.Map<java.lang.String,java.lang.String> LANGUAGE_CODES
protected static final java.util.Map<java.lang.String,SearchResult.MediaType> MEDIA_TYPES
protected static final java.util.List<java.lang.String> SEARCH_FIELDS_FOR_DROPDOWN
protected java.lang.String opac_url
protected java.lang.String languageCode
protected java.util.List<SearchQuery> lastQuery
public void init(Library library, HttpClientFactory httpClientFactory)
BaseApi
init
in interface OpacApi
init
in class BaseApi
library
- The library the Api is initialized forhttpClientFactory
- A HttpClientFactory instance that will be used for instantiating
HTTP clients. This factory is pluggable because we want to use
platform-specific code on Android.protected java.lang.String getApiUrl()
public SearchRequestResult search(java.util.List<SearchQuery> query) throws java.io.IOException, OpacApi.OpacErrorException, org.json.JSONException
OpacApi
List<SearchQuery>
contains the
search criteria. See documentation on SearchResult
for details.
This function is always called from a background thread, you can use blocking network
operations in it. See documentation on DetailledItem for details.query
- see aboveorg.json.JSONException
java.io.IOException
OpacApi.OpacErrorException
SearchResult
public SearchRequestResult searchGetPage(int page) throws java.io.IOException, OpacApi.OpacErrorException, org.json.JSONException
OpacApi
page
of the search performed last with OpacApi.search(java.util.List<de.geeksfactory.opacclient.searchfields.SearchQuery>)
.
This function is always called from a background thread, you can use blocking network
operations in it. See documentation on DetailledItem for details.page
- page number to fetchjava.io.IOException
OpacApi.OpacErrorException
org.json.JSONException
OpacApi.search(List)
,
SearchResult
protected SearchRequestResult executeSearch(java.util.List<SearchQuery> query, int pageIndex) throws java.io.IOException, OpacApi.OpacErrorException, org.json.JSONException
java.io.IOException
OpacApi.OpacErrorException
org.json.JSONException
protected java.lang.String buildSearchUrl(java.util.List<SearchQuery> query, int page) throws java.io.IOException, org.json.JSONException, java.net.URISyntaxException
java.io.IOException
org.json.JSONException
java.net.URISyntaxException
public DetailledItem getResultById(java.lang.String id, java.lang.String homebranch) throws java.io.IOException, OpacApi.OpacErrorException
OpacApi
id
- id of object to fetchhomebranch
- The users "home branch". "Home" library branch. Some library systems
require this information at search request time to determine where book
reservations should be placed. If in doubt, set to null
.java.io.IOException
OpacApi.OpacErrorException
DetailledItem
public SearchRequestResult filterResults(Filter filter, Filter.Option option) throws java.io.IOException, OpacApi.OpacErrorException
OpacApi
OpacApi.search(List)
implementation puts something different from null
into SearchRequestResult.setFilters(List)
, this will be called to apply a filter to
the last search request.
If your OpacApi.search(List)
implementation does not set SearchRequestResult.setFilters(List)
, this wil never be called. Just return
null
.
This function is always called from a background thread, you can use blocking network
operations in it. See documentation on DetailledItem for details.filter
- The filter to be applied.option
- The filters option to be applied. If the option.isApplied()
returns true
, the filter is to be removed!java.io.IOException
OpacApi.OpacErrorException
SearchResult
,
Filter
public DetailledItem getResult(int position) throws java.io.IOException, OpacApi.OpacErrorException
OpacApi
position
from last OpacApi.search(java.util.List<de.geeksfactory.opacclient.searchfields.SearchQuery>)
or OpacApi.searchGetPage(int)
call.
We generally prefer OpacApi.getResultById(String, String)
, so if you implement
getResultById
AND every search result of your driver
has an id set, you can omit this method (respectively, return null).
This function is always called from a background thread, you can use blocking network
operations in it.position
- position of object in last searchjava.io.IOException
OpacApi.OpacErrorException
DetailledItem
public java.util.List<SearchField> parseSearchFields() throws java.io.IOException, OpacApi.OpacErrorException, org.json.JSONException
parseSearchFields
in class BaseApi
java.io.IOException
OpacApi.OpacErrorException
org.json.JSONException
protected void addSimpleSearchField(java.util.List<SearchField> fields) throws java.io.IOException, org.json.JSONException
java.io.IOException
org.json.JSONException
protected void addAdvancedSearchFields(java.util.List<SearchField> fields) throws java.io.IOException, org.json.JSONException
java.io.IOException
org.json.JSONException
protected void addDropdownValuesForField(DropdownSearchField field, java.lang.String id) throws java.io.IOException, org.json.JSONException
java.io.IOException
org.json.JSONException
protected void addSortingSearchFields(java.util.List<SearchField> fields) throws java.io.IOException, org.json.JSONException
java.io.IOException
org.json.JSONException
protected java.lang.String getDefaultEncoding()
getDefaultEncoding
in class BaseApi
public java.lang.String getShareUrl(java.lang.String id, java.lang.String title)
OpacApi
null
. If you
library only accepts direkt links when a session is open, get in touch with me
(mail@raphaelmichel.de) to get it integrated in the opacapp.de proxy.id
- Media id of the item to be sharedtitle
- Title of the item to be sharedpublic int getSupportFlags()
OpacApi
SUPPORT_FLAG_*
constantspublic java.util.Set<java.lang.String> getSupportedLanguages() throws java.io.IOException
OpacApi
java.io.IOException
public void setLanguage(java.lang.String language)
OpacApi
language
- the language to useprotected java.lang.String getLanguage()