DMS: handle gracefully unauthorized ingestion scenarios

Instead of using UnrestrictedMethod for the whole duration of
discoverMetadata, revert to the original user permissions for the last
part where we merge revision or change state, because we want this to
fail when user is not allowed.

This adjusts also the high level Base_contribute script to catch these
errors and report them nicely to the user and while doing this some
other problems were discovered and are also fixed.

Some problems in ContributionTool.newContent were fixed, this was
already trying to detect that a document is going to be merged and
synchronously checked that this existing document can be replaced, to
display an error to the user, but this part has two issues:
  - first it was using getMatchedFilenamePatternDict to find the
  document coordinates, but this method only supports
  preferred_document_filename_regular_expression capturing reference,
  but not the combination of node_reference and local_reference, so this
  was changed to use getPropertyDictFromFilename, which is what is
  actually used to compute the reference.
  - The second problem here was that this check was done with a
  standard restricted catalog search, but later mergeRevision uses an
  unrestricted search, so this was changed to use unrestricted catalog
  search to match mergeRevision

The testing also revealed that the PDFDocument._setFile hack to clear
the _content_information was only for _setFile, but not for _setData,
so this was extended to _setData as well, so that a case where the PDF
content is updated by setData also update content information.
22 jobs for fix/contribution_tool_erase_doc in 0 seconds (queued for 3 seconds)
Status Job ID Name Coverage
  External
passed ERP5.CodingStyleTest-TestRunner2

02:20:28

failed ERP5.UnitTest-TestRunner2

03:31:12

passed ERP5.UnitTest-Zope2-ForTestRunner2

03:38:16

passed ERP5.CodingStyleTest-TestRunner2

01:47:58

passed ERP5.CodingStyleTest-TestRunner2

02:05:21

passed ERP5.CodingStyleTest-TestRunner2

00:28:42

passed ERP5.CodingStyleTest-TestRunner2

01:10:33

passed ERP5.CodingStyleTest-TestRunner2

01:00:07

passed ERP5.CodingStyleTest-TestRunner2

01:07:05

passed ERP5.CodingStyleTest-TestRunner2

00:56:22

failed ERP5.UnitTest-TestRunner2

02:05:16

failed ERP5.UnitTest-TestRunner2

03:09:29

passed ERP5.UnitTest-TestRunner2

02:21:48

failed ERP5.UnitTest-TestRunner2

02:48:18

passed ERP5.UnitTest-TestRunner2

02:05:38

failed ERP5.UnitTest-TestRunner2

01:52:36

failed ERP5.UnitTest-Zope2-ForTestRunner2

02:57:30

failed ERP5.UnitTest-Zope2-ForTestRunner2

02:01:01

failed ERP5.UnitTest-Zope2-ForTestRunner2

02:06:04

failed ERP5.UnitTest-Zope2-ForTestRunner2

02:24:00

failed ERP5.UnitTest-Zope2-ForTestRunner2

03:56:20

passed ERP5.UnitTest-Zope2-ForTestRunner2

01:51:59