Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
matallen committed Oct 8, 2019
1 parent af365f3 commit 461e8d0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/main/java/com/redhat/sso/Controller2.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,14 @@ private List<Offering> aggregateIntoOfferings(List<Document> 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();
Expand All @@ -300,9 +302,6 @@ private List<Offering> aggregateIntoOfferings(List<Document> alldocuments, Strin
o.related.addAll(extractSectionListToDocuments("<[Hh]\\d.*?>(.+?)</[Hh]\\d>", overview.description, new String[]{"RELATED SOLUTIONS:","Related Solutions:"}));
o.related.addAll(extractSectionListToDocuments("<[Hh]\\d.*?>(.+?)</[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="";

Expand All @@ -318,14 +317,20 @@ private List<Offering> aggregateIntoOfferings(List<Document> 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);
remove.add(d);
}
}
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);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/redhat/sso/InitServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 461e8d0

Please sign in to comment.