WikiPageEntityRevisionLookup loads entity data directly from a mediawiki database. It already supports accessign a "foreign" wiki database (not the local wiki). It now needs to support foreign entity IDs. To achieve this, we must do two things:
- check that the EntityId used to request the desired entity revision belongs to the correct repository. That is, EntityId::getRepositoryName should return the name of the repo to corresponds to the database name used by the WikiPageEntityRevisionLookup. Note that repo name and database name are usually but not necessarily the same. We can assume that the repo name is the same as the global site ID. Note: checking this should happen already in WikiPageEntityMetaDataAccessor.
- the factory logic that instantiates the WikiPageEntityRevisionLookup must make sure to provide a EntityContentDataCodec that uses a Deserializer that is configured to apply the correct ID prefix mapping for the given foreign repo. We may want to introduce a ForeignEntityRevisionLookupFactory for this purpose, which can be used to acquire an EntityRevisionLookup for a given repo. Creating that interface should be tracked in a separate task.