/*
* Create a TocTopicDatabase to hold the related topics. The
* TocTopicDatabase provides a convenient way to access
* these topics
*/
TocTopicDatabase relatedTopicsDatabase = new TocTopicDatabase();
relatedTopicsDatabase.setTopics(relatedTopics);
/* sort the InjectionTopicData list if required */
if (sortComparator != null)
{
sortComparator.sort(relatedTopics, sequenceIDs);
}
/* loop over all the topic ids in the injection point */
for (final InjectionTopicData sequenceID : sequenceIDs)
{
/*
* topics that are injected into custom injection points
* are excluded from the generic related topic lists at
* the beginning and end of a topic. adding the topic id
* here means that when it comes time to generate the
* generic related topic lists, we can skip this topic
*/
customInjectionIds.add(sequenceID.topicId);
/*
* Pull the topic out of the list of related topics
*/
final TopicV1 relatedTopic = relatedTopicsDatabase.getTopic(sequenceID.topicId);
/*
* See if the topic is also available in the main
* database (if the main database is available)
*/