Package com.redhat.topicindex.rest.entities

Examples of com.redhat.topicindex.rest.entities.TranslatedTopicDataV1


              /* wrap the xref up in a listitem */
              if (sequenceID.optional)
              {
                if (internal)
                {
                  final TranslatedTopicDataV1 relatedTranslatedTopicData = translatedTopicData.getLatestRelatedTranslationDataByTopicID(relatedTopic.getId());
                 
                  if (relatedTranslatedTopicData != null)
                  {
                    final String url = getURLToInternalTranslatedTopic(relatedTranslatedTopicData.getTranslatedTopic().getId(), relatedTranslatedTopicData.getTranslationLocale());
                   
                    /* Get the related translated data object and the title from the XML */
                    final String relatedTitle = DocBookUtilities.findTitle(relatedTranslatedTopicData.getTranslatedXml());
                   
                    list.add(DocbookUtils.buildEmphasisPrefixedULink(xmlDocument, XMLPreProcessor.OPTIONAL_LIST_PREFIX, url, relatedTitle));
                  }
                  else
                  {
                    final String url = getURLToInternalTopic(relatedTopic.getId());
                   
                    final String relatedTopicTitle = "[" + relatedTopic.getLocale() + "] " + relatedTopic.getTitle() + "*";
                   
                    list.add(DocbookUtils.buildEmphasisPrefixedULink(xmlDocument, XMLPreProcessor.OPTIONAL_LIST_PREFIX, url, relatedTopicTitle));
                   
                    /* Create an error note that is added at the bottom of the topic */
                  }
                }
                else
                {
                  if (usedFixedUrls)
                  {
                    final PropertyTagV1 propTag = relatedTopic.getProperty(CommonConstants.FIXED_URL_PROP_TAG_ID);
                    if (propTag != null)
                    {
                      list.add(DocbookUtils.buildEmphasisPrefixedXRef(xmlDocument, XMLPreProcessor.OPTIONAL_LIST_PREFIX, propTag.getValue()));
                    }
                    else
                    {
                      list.add(DocbookUtils.buildEmphasisPrefixedXRef(xmlDocument, XMLPreProcessor.OPTIONAL_LIST_PREFIX, relatedTopic.getXRefID()));
                    }
                  }
                  else
                  {
                    list.add(DocbookUtils.buildEmphasisPrefixedXRef(xmlDocument, XMLPreProcessor.OPTIONAL_LIST_PREFIX, relatedTopic.getXRefID()));
                  }
                }
              }
              else
              {
                if (internal)
                {
                  final TranslatedTopicDataV1 relatedTranslatedTopicData = translatedTopicData.getLatestRelatedTranslationDataByTopicID(relatedTopic.getId());
                 
                  if (relatedTranslatedTopicData != null)
                  {
                    final String url = getURLToInternalTranslatedTopic(relatedTranslatedTopicData.getTranslatedTopic().getId(), relatedTranslatedTopicData.getTranslationLocale());
                   
                    /* Get the related translated data object and the title from the XML */
                    final String relatedTitle = DocBookUtilities.findTitle(relatedTranslatedTopicData.getTranslatedXml());
                   
                    list.add(DocbookUtils.buildULink(xmlDocument, url, relatedTitle));
                  }
                  else
                  {
View Full Code Here


            for (final TopicV1 relatedTopic : relatedTopics)
            {
              if (internal)
              {
                /* Try and find the related translation data to inject */
                final TranslatedTopicDataV1 relatedTranslatedTopicData = translatedTopicData.getLatestRelatedTranslationDataByTopicID(relatedTopic.getId());
               
                /*
                 * If there is related translation data found then add it normally.
                 * If no data is found then use the english title and make a note
                 * at the bottom of the topic XML.
                 */
                if (relatedTranslatedTopicData != null)
                {
                  final String relatedTopicTitle = DocBookUtilities.findTitle(relatedTranslatedTopicData.getTranslatedXml());
                 
                  final String url = getURLToInternalTranslatedTopic(relatedTranslatedTopicData.getTranslatedTopic().getId(), relatedTranslatedTopicData.getTranslationLocale());
               
                  DocbookUtils.createRelatedTopicULink(xmlDoc, url, relatedTopicTitle, itemizedlist);
                }
                else
                {
View Full Code Here

             * make sure the topic we are trying to inject has been
             * related
             */
            if (topic.isRelatedTo(topicID))
            {
              final TranslatedTopicDataV1 relatedTranslatedTopicData = translatedTopicData.getLatestRelatedTranslationDataByTopicID(topicID);
              final Document relatedTopicXML = XMLUtilities.convertStringToDocument(relatedTranslatedTopicData.getTranslatedXml());
              if (relatedTopicXML != null)
              {
                final Node relatedTopicDocumentElement = relatedTopicXML.getDocumentElement();
                final Node importedXML = xmlDocument.importNode(relatedTopicDocumentElement, true);

View Full Code Here

             * make sure the topic we are trying to inject has been
             * related
             */
            if (topic.isRelatedTo(topicID))
            {
              final TranslatedTopicDataV1 relatedTranslatedTopicData = translatedTopicData.getLatestRelatedTranslationDataByTopicID(topicID);
              final Element titleNode = xmlDocument.createElement("title");
              if (relatedTranslatedTopicData.getTranslatedTopicTitle() != null)
              {
                titleNode.setTextContent(relatedTranslatedTopicData.getTranslatedTopicTitle());
              }
              else
              {
                final TopicV1 relatedTopic = topic.getRelatedTopicByID(topicID);
                titleNode.setTextContent(relatedTopic.getTitle());
View Full Code Here

TOP

Related Classes of com.redhat.topicindex.rest.entities.TranslatedTopicDataV1

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.