Skip to content

Commit

Permalink
fixing bug #4421
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasEYSSERIC committed Mar 25, 2013
1 parent 75ad05a commit bb22ef8
Showing 1 changed file with 12 additions and 12 deletions.
Expand Up @@ -168,7 +168,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse res)
kmeliaSC.processSelectedPublicationIds(selectedPublicationIds, notSelectedPublicationIds);

boolean toPortlet = "1".equals(sToPortlet);
boolean toSearch = StringUtil.isDefined(query);
boolean searchInProgress = StringUtil.isDefined(query);

if (StringUtil.isDefined(index)) {
kmeliaSC.setIndexOfFirstPubToDisplay(index);
Expand Down Expand Up @@ -209,7 +209,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse res)
sortAllowed = false;
publications = kmeliaSC.getSessionPublicationsList();
role = SilverpeasRole.user.toString();
} else if (toSearch) {
} else if (searchInProgress) {
// Insert this new search inside persistence layer in order to compute statistics
saveTopicSearch(componentId, nodeId, kmeliaSC, query);
publications = kmeliaSC.search(query);
Expand All @@ -221,7 +221,7 @@ public void doPost(HttpServletRequest req, HttpServletResponse res)
sortAllowed = false;
linksAllowed = false;
seeAlso = false;
toSearch = false;
searchInProgress = false;
}

if (KmeliaHelper.isToolbox(componentId)) {
Expand All @@ -244,14 +244,14 @@ public void doPost(HttpServletRequest req, HttpServletResponse res)
writer.write("</table>");
writer.write(board.printAfter());
} else if (NodePK.ROOT_NODE_ID.equals(kmeliaSC.getCurrentFolderId()) &&
kmeliaSC.getNbPublicationsOnRoot() != 0 && kmeliaSC.isTreeStructure()) {
List<KmeliaPublication> publicationsToDisplay = kmeliaSC.getLatestPublications();
displayLastPublications(publicationsToDisplay, kmeliaSC, resources, gef, writer);
kmeliaSC.getNbPublicationsOnRoot() != 0 && kmeliaSC.isTreeStructure() &&
!searchInProgress) {
displayLastPublications(kmeliaSC, resources, gef, writer);
} else {
if (publications != null) {
displayPublications(publications, sortAllowed, linksAllowed, seeAlso,
toSearch, kmeliaSC, role, gef, context, resources, selectedIds, pubIdToHighlight,
writer, attachmentToLink);
displayPublications(publications, sortAllowed, linksAllowed, seeAlso, searchInProgress,
kmeliaSC, role, gef, context, resources, selectedIds, pubIdToHighlight, writer,
attachmentToLink);
}
}
}
Expand Down Expand Up @@ -1196,10 +1196,10 @@ private String displayFile(String url, String title, String info, String icon,

}

private void displayLastPublications(List<KmeliaPublication> pubs,
KmeliaSessionController kmeliaScc, ResourcesWrapper resources, GraphicElementFactory gef,
Writer writer) throws IOException {
private void displayLastPublications(KmeliaSessionController kmeliaScc,
ResourcesWrapper resources, GraphicElementFactory gef, Writer writer) throws IOException {

List<KmeliaPublication> pubs = kmeliaScc.getLatestPublications();
boolean displayLinks = URLManager.displayUniversalLinks();
PublicationDetail pub;
KmeliaPublication kmeliaPub;
Expand Down

0 comments on commit bb22ef8

Please sign in to comment.