WebSearch: sorting fixes

* Refactors sort_records() in search_engine.py in the same way rank_records()
  has been refactored: the new behavior of print_records() is to not reverse
  records anymore.  So we can avoid reversing them beforehand too.
  (closes #1674)

Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
DocExtract: new CMS PAS report numbers

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
installation: pip requirement version updates

* Updates requirements.txt with specific versions for all requirements.

* Updates mysql-python to 1.2.5 to make it work with the new pip.

* Changes the requirement from PIL to Pillow as PIL is abandoned.

Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
Merge branch 'maint-1.0' into maint-1.1

* maint-1.0:
  installation: pip requirement version updates
Merge branch 'maint-1.1'

* maint-1.1:
  installation: pip requirement version updates

Conflicts:
	requirements.txt

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: timestamp detection fix for empty sites

* Fixes get_database_last_updated_timestamp() so that it would not return
  None in case no records are present in the system.  This solves webcoll
  traceback issues when running on an empty site.

Reported-by: Ole Rønning <ole@tindtechnologies.com>
Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
redisutils: initial release

* Utilities to connect a Redis database.

Tested-by: Tibor Simko <tibor.simko@cern.ch>
WebSession: new Redis session storage backend

* Allows to store sessions in Redis.  (closes #1688)

* Introduces a new config variable CFG_WEBSESSION_STORAGE
  that can be set to mysql or redis.

Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibRank: citation blobs in Redis

* Stores citations dictionaries in Redis for faster access when loading
  Invenio.  The number of parallel queries used slow down the database
  at apache startup.  (closes #1689)

Tested-by: Tibor Simko <tibor.simko@cern.ch>
installation: Redis and Nydus pre-requisites

* Amends the installation guide WRT Redis.

* Adds Redis and Nydus to pip requirements.

* NOTE Invenio now uses Redis for session management by default.
  Please install it or change CFG_WEBSESSION_STORAGE settings.
  See INSTALL file for more details.

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
textutils: show_diff() API clean-up

* Fixes the spelling mistake in 'sufix' parameter.  (closes #1465)

* Makes the function more generic by removing the hard coded html tags.

* Adds tests to the textutils_unit_tests for show_diff() function.

* Fixes the usage of show_diff function in bibedit_engine, so it will
  work after changes in this function.

Signed-off-by: Sebastian Witowski <sebastian.witowski@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
WebSearch: nonexisting record API test case fix

* Amends test case `test_search_engine_python_api_for_nonexisting_record()`
  which was showing problems on some Jenkins builds due to warning being
  emitted on stderr which led to xunit infinite recursion.  Using
  still-nonexisting record ID, but within mediumint unsigned bounds (16M)
  does not emit any warning and hence avoids this problem.  (closes #1692)

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
Merge branch 'maint-1.0' into maint-1.1

* maint-1.0:
  WebSearch: nonexisting record API test case fix

Conflicts:
	modules/websearch/lib/websearch_regression_tests.py

Signed-off-by: Tibor Simko <tibor.simko@cern.ch>
Merge branch 'maint-1.1'

* maint-1.1:
  WebSearch: nonexisting record API test case fix
global: removal of leftover files

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
BibAuthorID: user prefs and session fix

* The claim link was wrongly stored in user preferences.

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
WebSession: user preference to enable profiling

* Adds a user preference that is available if you have 'profiling' permissions.
  With this preference, you can enable permanently enable profiling for your
  user. Useful for debugging random slowness.

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
sequtils: increases size of seqSTORE.seq_value

* varchar(60) was still not big enough, varchar(255) is the max.

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
Reviewed-by: Tibor Simko <tibor.simko@cern.ch>
BibRank: record ID citations catchup

* The catchup for record ids got lost in one of the merges...it is now
  added back. This accounts for removed citations for $0 when a cited record
  was modified.

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>
BibDocFile: display counts in tabs

* The files tab in detailed record pages was not displaying the counts
  next to the tabs, e.g. citations instead of citations(4).

Signed-off-by: Alessio Deiana <alessio.deiana@cern.ch>
Tested-by: Tibor Simko <tibor.simko@cern.ch>