From 461e8d0db820bf0d5f0fd499320a11d358cb83be Mon Sep 17 00:00:00 2001 From: Mat Allen Date: Tue, 8 Oct 2019 09:51:10 -0500 Subject: [PATCH] update --- src/main/java/com/redhat/sso/Controller2.java | 13 +++++++++---- src/main/java/com/redhat/sso/InitServlet.java | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/redhat/sso/Controller2.java b/src/main/java/com/redhat/sso/Controller2.java index 23c196b..8548f6b 100644 --- a/src/main/java/com/redhat/sso/Controller2.java +++ b/src/main/java/com/redhat/sso/Controller2.java @@ -274,12 +274,14 @@ private List aggregateIntoOfferings(List alldocuments, Strin // get data from overview pages int docTitlePosition=Math.max(overview.name.toLowerCase().indexOf("overview"), overview.name.toLowerCase().indexOf(" page")); + boolean titleOnLeft=false; if (overview.name.lastIndexOf("-")>docTitlePosition){ o.offering=StrParse.get(overview.name).rightOf("-").trim(); overview.name=StrParse.get(overview.name).leftOf("-").trim(); }else{ o.offering=StrParse.get(overview.name).leftOf("-").trim(); overview.name=StrParse.get(overview.name).rightOf("-").trim(); + titleOnLeft=true; } // o.offering=StrParse.get(overview.name).rightOf("-").trim(); @@ -300,9 +302,6 @@ private List aggregateIntoOfferings(List alldocuments, Strin o.related.addAll(extractSectionListToDocuments("<[Hh]\\d.*?>(.+?)", overview.description, new String[]{"RELATED SOLUTIONS:","Related Solutions:"})); o.related.addAll(extractSectionListToDocuments("<[Hh]\\d.*?>(.+?)", overview.description, new String[]{"RELATED OFFERINGS:","Related Offerings:"})); - //now, if the overview has a "Related Documents" section, then append those links too - o.documents.addAll(extractOtherDocuments2(overview, overview.description, new String[]{"OTHER MATERIALS:", "Other Materials:"})); - // overview.name=StrParse.get(overview.name).leftOf("-").trim(); overview.description=""; @@ -318,7 +317,10 @@ private List aggregateIntoOfferings(List alldocuments, Strin // find the related docs using the groupTag for (Document d:alldocuments){ if (d.tags.contains(groupTag)){ - d.name=StrParse.get(d.name).leftOf("-").trim(); + if (titleOnLeft){ + d.name=StrParse.get(d.name).rightOf("-").trim(); + }else + d.name=StrParse.get(d.name).leftOf("-").trim(); d.description=""; log.debug("Overview ("+o.offering+"):: Adding (Mojo) document -> ("+d.id+")"+d.name); o.documents.add(d); @@ -326,6 +328,9 @@ private List aggregateIntoOfferings(List alldocuments, Strin } } alldocuments.removeAll(remove); remove.clear(); + + //now, if the overview has a "Related Documents" section, then append those links too + o.documents.addAll(extractOtherDocuments2(overview, overview.description, new String[]{"OTHER MATERIALS:", "Other Materials:"})); } log.debug("Overview ("+o.offering+") type="+o.type); diff --git a/src/main/java/com/redhat/sso/InitServlet.java b/src/main/java/com/redhat/sso/InitServlet.java index ca3f3fb..bc1e712 100644 --- a/src/main/java/com/redhat/sso/InitServlet.java +++ b/src/main/java/com/redhat/sso/InitServlet.java @@ -8,7 +8,7 @@ public class InitServlet extends HttpServlet { @Override public void init(ServletConfig config) throws ServletException { - Heartbeat.start(120000l); // 2 mins + //Heartbeat.start(120000l); // 2 mins super.init(config); }