Exemplo n.º 1
0
 /**
  * Loads a help topic given by a relative help topic name (i.e. "/Action/New")
  *
  * <p>First tries to load the language specific help topic. If it is missing, tries to load the
  * topic in english.
  *
  * @param relativeHelpTopic the relative help topic
  */
 protected void loadRelativeHelpTopic(String relativeHelpTopic) {
   String url = HelpUtil.getHelpTopicUrl(HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic));
   String content = null;
   try {
     content = reader.fetchHelpTopicContent(url, true);
   } catch (MissingHelpContentException e) {
     url =
         HelpUtil.getHelpTopicUrl(
             HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, Locale.ENGLISH));
     try {
       logger.info("fetching url: " + url);
       content = reader.fetchHelpTopicContent(url, true);
     } catch (MissingHelpContentException e1) {
       this.url = url;
       handleMissingHelpContent(relativeHelpTopic);
       return;
     } catch (HelpContentReaderException e1) {
       e1.printStackTrace();
       handleHelpContentReaderException(relativeHelpTopic, e1);
       return;
     }
   } catch (HelpContentReaderException e) {
     e.printStackTrace();
     handleHelpContentReaderException(relativeHelpTopic, e);
     return;
   }
   help.setText(content);
   history.setCurrentUrl(url);
   this.url = url;
   scrollToTop();
 }
Exemplo n.º 2
0
 /**
  * Loads a help topic given by a relative help topic name (i.e. "/Action/New")
  *
  * <p>First tries to load the language specific help topic. If it is missing, tries to load the
  * topic in English.
  *
  * @param relativeHelpTopic the relative help topic
  */
 protected void loadRelativeHelpTopic(String relativeHelpTopic) {
   String url =
       HelpUtil.getHelpTopicUrl(
           HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.DEFAULTNOTENGLISH));
   String content = null;
   try {
     content = reader.fetchHelpTopicContent(url, true);
   } catch (MissingHelpContentException e) {
     url =
         HelpUtil.getHelpTopicUrl(
             HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.BASELANGUAGE));
     try {
       content = reader.fetchHelpTopicContent(url, true);
     } catch (MissingHelpContentException e1) {
       url =
           HelpUtil.getHelpTopicUrl(
               HelpUtil.buildAbsoluteHelpTopic(relativeHelpTopic, LocaleType.ENGLISH));
       try {
         content = reader.fetchHelpTopicContent(url, true);
       } catch (MissingHelpContentException e2) {
         this.url = url;
         handleMissingHelpContent(relativeHelpTopic);
         return;
       } catch (HelpContentReaderException e2) {
         e2.printStackTrace();
         handleHelpContentReaderException(relativeHelpTopic, e2);
         return;
       }
     } catch (HelpContentReaderException e1) {
       e1.printStackTrace();
       handleHelpContentReaderException(relativeHelpTopic, e1);
       return;
     }
   } catch (HelpContentReaderException e) {
     e.printStackTrace();
     handleHelpContentReaderException(relativeHelpTopic, e);
     return;
   }
   loadTopic(content);
   history.setCurrentUrl(url);
   this.url = url;
 }