MH-9598 -- Prevented processing overhead because of parallel job creation

Job dispatching is implemented in a way that once a workflow operation has been dispatched, it can create sub jobs at will and all of those sub jobs will be dispatched regardless of whether resources are available or not. The result is more often than not an out of memory error since too many sub processes like ffmpeg are started at once.

This patch makes sure that actual work related jobs are processed first (through sorting) before the next workflow operation is started. In addition, jobs with the same parent will only be started if no sibling is already being executed.
MH-10259 -- replaced the null pointer exception by a 404 in cases where the organization has not been loaded.
MH-8930, pop-up appears if user tries to leave the page during upload.

Added a function to the onbeforeunload event.
MH-10270: This commit removes both the analytics UI, as well as the code required to support the export workflow.  Since neither of these works this should be a low impact change.
MH-10277, Fixes XML chars <>& in series auto create

Adds a simple escapeXML function to the utils script
MH-10283, Forbid trailing spaces and require newline at eof

As #proposed on list (passed 2014-04-29 19:12:41 +0000) all trailing
spaces in the Java code shall be forbidden and every file has to end
with a newline character.

Original Proposal
=================

A while ago we decided to be officially more lax about our code
conventions and allow everything not explicitly forbidden by the
automatick checkstyle rules.  This makes our life easier but brings
also some risks.

Recently I've seen some commits changing the style of a whole file
even though the patch is actually only about a couple of lines in the
code.  So about 90% were just unnecessary changes. Both styles passed
the automatic checkstyle rules and were thus ok, but something like
that messes up the history, makes patches confusing (you have to
search for the actual functionality) and if everything goes wrong, the
original author starts editing the file again and everything is
changed back.

Most of these happened with trailing spaces. We already forbid
trailing spaces in our code and a trailing space will cause a
checkstyle error.  That is, with one exception: Comments.

  To get rid of this problem, I hereby #propose to forbid trailing
  spaces in comments as well.

The second cause of these changes are missing newline characters at
the end of a file. If someone adds content at the end he has to add
this newline character and thus modifying the last line as well
without adding any actual content. Of course these changes will go
into a git patch and show up in the history. Furthermore, most editors
will insert such a newline by default and thus add a modification
automatically.  This is way less important, but still a nuisance.

  To get rid of this problem, I hereby #propose to require newline
  characters at the end of a file.

Both demands should not pose any problem for anybody as all modern IDEs
and editors should be easily configurable to do this automatically.

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
MH-10208 : Use correct endpoint for see more dropdown
MH-10291 set in etc/services/org.opencastproject.serviceregistry.impl.ServiceRegistryJpaImpl.properties jobstats.collect=false like proposed on list
MH-10288, Fix LTI Security Issues

This commit fixes the recently discovered LTI security issues. In
particular, this means that that “ROLE_...” are forbidden for
LTI authentication and that empty consumer and learner will get a
default value assigned.

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
MH-10288, Ignore the LTI Integration Tests by Default

LTI is now deactivated by default. That is why the integration tests
will fail if the system was not reconfigured before. As this should not
happen by default, his commit will mark the particular tests as to be
ignored.

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
MH-10240 Manually setting trim to beginning and end causes error

Remove unnecessarily strict check on mediapackage duration (checked more leniently further down)
MH-8747 -- fixed missing log4j initialization during execution of unit tests
MH-10255 -- Fixed merge issue with service policy and added persistence check to get organization list method
MH-10234, Fileinstall directory based on config dir

This patch will fix the default configuration for some of the
configuration fileinstall directories which were based on the felix.work
directory instead of the configuration directory.

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
MH-10239, Tracks do not show up in TrimUI

The value for the source flavor of the tracks selected and shown in the
trim-ui was hardcoded as everything containing “work”. This meant that
depending on the workflow tracks would not show up or incorrect ones
would show up.

This patch will go through the operation settings and check which flavors
are actually marked for input and then select the correct tracks
according to this configuration.

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
MH-10282 : Cannot delete scheduled recording when the title includes double quotes
MH-10313, Incorrect Ingest Parameters cause NullPointerException

Sending invalid data to most of the /ingest/add... endpoints would cause
internal NullPointerExceptions and thus a “500 Internal Server Error” to
be returned to the client.

This patch fixes this behaviour by checking the sanity of the input data
and if necessary and/or sensible returning a “400 Bad Request” instead.

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
MH-10220, Systemd Unit File

Most RedHat based distributions are slowly switching to Systemd in favor
of the classic SysV-Init tool. Fedora uses Systemd already for a couple
of versions, RHEL, CentOS and Scientific Linux will switch to Systemd
with the new version 7.

This commit contains a Systemd unit file utilizing the functionality of
the already included start script. This way Matterhorn can be run using
Systemd directly.

Signed-off-by: Lars Kiesow <lkiesow@uos.de>
MH-10316 Series endpoint shows non-public series when privileges are changed.

The ACLs (SolrFields.ACCESS_CONTROL_CONTRIBUTE, SolrFields.ACCESS_CONTROL_EDIT and SolrFields.ACCESS_CONTROL_READ) are not cleaned up
in the solr input document and it grows indefinitely. So when a series is changed to public it can never be set to private.

Contribution thanks to the support of the U. of Helsinki.
Merged in t/MH-9598-joblimit (pull request #176)

Still, it does NOT resolve the issue MH-9598 -- Prevented processing overhead because of parallel job creation.
However, it forces a sensible job dispatching order.