Skip to content

Commit

Permalink
Feature #13573 : See also: improve display order of the publications
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverDav committed Apr 26, 2023
1 parent 992061c commit 9e98d06
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 189 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ vignetteWidth = 150

publication_defaultsorting = pubId desc
# Possible values -
# pubDescription, pubCreationDate, pubBeginDate, pubEndDate, pubCreatorId,
# pubDescription, pubName, pubCreationDate, pubBeginDate, pubEndDate, pubCreatorId,
# pubImportance, pubVersion, pubKeywords, pubStatus, pubStatus, pubUpdaterId,
# pubValidateDate, pubValidatorId

Expand Down Expand Up @@ -79,33 +79,12 @@ showNoPublisMessage = true
# in a HTML content or only the first occurrence
highlightFirstOccurence= false

# concerning the Files storage : allows displaying the publications in the list of attachments.
fileStorageShowPublication= true

#### FileStorage extraInfo ###
# shows the complete information relating to publication in the publication list
fileStorageShowExtraInfoPub = false
# shows the complete information relating to attachment in the publication list
fileStorageShowExtraInfoAttachment = false

#### Publication link manager ###
linkManagerSortByPubId = false
linkManagerShowPubId = false


# concerning the Files storage : allows displaying the publications in the list of attachments.
fileStorageShowPublication= true

#### FileStorage extraInfo ###
# shows the complete information relating to publication in the publication list
fileStorageShowExtraInfoPub = false
# shows the complete information relating to attachment in the publication list
fileStorageShowExtraInfoAttachment = false

#### Publication link manager ###
linkManagerSortByPubId = false
linkManagerShowPubId = false

templatePath=${env.SILVERPEAS_HOME}/resources/StringTemplates/components/kmelia/ (d\u00e9fini dans SilverpeasSettings.xml)
customersTemplatePath=${sys.SILVERPEAS_DATA_HOME}/StringTemplates/components/kmelia/ (d\u00e9fini dans SilverpeasSettings.xml)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ private static void displayJavascriptAndFormToOperations(KmeliaSessionController
out.println("windowName = \"publicationWindow\";");
out.println("windowParams = \"directories=0,menubar=0,toolbar=0,alwaysRaised,scrollbars\";");
out.println("larg = \"900\";");
out.println("haut = \"600\";");
out.println("haut = \"800\";");
out.println(
"publicationWindow = SP_openWindow(url, windowName, larg, haut, windowParams, false);");
out.println("}");
Expand All @@ -100,8 +100,7 @@ private static void displayJavascriptAndFormToOperations(KmeliaSessionController
}

public static void displayAllOperations(String id, KmeliaSessionController kmeliaScc,
GraphicElementFactory gef, String action, MultiSilverpeasBundle resources, JspWriter out) throws
IOException {
GraphicElementFactory gef, String action, MultiSilverpeasBundle resources, JspWriter out) throws IOException {
boolean kmaxMode = false;
displayAllOperations(id, kmeliaScc, gef, action, resources, out, kmaxMode);
}
Expand Down Expand Up @@ -148,15 +147,15 @@ public static void displayAllOperations(String id, KmeliaSessionController kmeli
if (invisibleTabs.indexOf(KmeliaSessionController.TAB_CONTENT) == -1) {
tabbedPane.addTab(resources.getString("Model") + decoration,
"javaScript:onClick=goToOperation('" + routerUrl + "ToPubliContent', '" + sureId
+ "', 'ModelUpdateView')", "ModelUpdateView".equals(action) || "NewModel".equals(action)
|| "ModelChoice".equals(action), enabled);
+ "', 'ModelUpdateView')", "ModelUpdateView".equals(action) || "NewModel".equals(action)
|| "ModelChoice".equals(action), enabled);
}
if (invisibleTabs.indexOf(KmeliaSessionController.TAB_ATTACHMENTS) == -1) {
if (kmeliaScc.getComponentId().startsWith("toolbox")) {
decoration = "";
tabbedPane.addTab(resources.getString("GML.attachments") + decoration,
"javaScript:onClick=goToOperationByGet('" + routerUrl + "ViewAttachments', '" + pubId
+ "', 'ViewAttachments')", "ViewAttachments".equals(action), enabled);
+ "', 'ViewAttachments')", "ViewAttachments".equals(action), enabled);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.silverpeas.components.kmelia.KmeliaPublicationHelper;
import org.silverpeas.components.kmelia.control.KmeliaSessionController;
import org.silverpeas.components.kmelia.model.KmeliaPublication;
import org.silverpeas.components.kmelia.model.KmeliaPublicationComparator;
import org.silverpeas.components.kmelia.model.TopicDetail;
import org.silverpeas.components.kmelia.model.ValidatorsList;
import org.silverpeas.components.kmelia.service.KmeliaHelper;
Expand Down Expand Up @@ -215,21 +214,14 @@ public void doPost(HttpServletRequest request, HttpServletResponse res) throws I
String role = kmeliaSC.getProfile();
if (toLink) {
currentTopic = kmeliaSC.getSessionTopicToLink();
sortAllowed = false;
sortAllowed = true;
linksAllowed = false;
seeAlso = true;
// get selected publication ids from session
selectedIds = processPublicationsToLink(req);
String currentPubId = req.getParameter("PubId");
String currentPubComponentId = req.getParameter("PubComponentName");
PublicationPK publicationPK = null;
if (StringUtil.isDefined(currentPubId) && StringUtil.isDefined(currentPubComponentId)) {
publicationPK = new PublicationPK(currentPubId, currentPubComponentId);
}
publications = currentTopic.getValidPublications(publicationPK);
if (resources.getSetting("linkManagerSortByPubId", false)) {
publications.sort(new KmeliaPublicationComparator());
}
kmeliaSC.setCurrentFolderId(currentTopic.getNodePK().getId(), true);
kmeliaSC.loadPublicationsOfCurrentFolder();
publications = kmeliaSC.getSessionPublicationsList();
} else if (toPortlet) {
sortAllowed = false;
publications = kmeliaSC.getSessionPublicationsList();
Expand Down Expand Up @@ -645,7 +637,7 @@ void displayDefaultFragmentOfPublication(KmeliaPublication aPub,
if (fragmentSettings.seeAlso && resources.getSetting("linkManagerShowPubId", false)) {
ref = " [ " + pub.getPK().getId() + " ] ";
}
out.write("<div class=\"");
out.write("<div class=\"");
out.write(fragmentSettings.pubColor);
out.write("\"><span class=\"" + fragmentSettings.highlightClass + "\">");
out.write(ref);
Expand Down Expand Up @@ -812,8 +804,8 @@ void displaySortingListBox(MultiSilverpeasBundle resources, KmeliaSessionControl

out.
write(
"<select name=\"sortBy\" id=\"sortingList\" onChange=\"javascript:sortGoTo(this" +
".selectedIndex);\">");
"<select name=\"sortBy\" id=\"sortingList\" onChange=\"javascript:sortGoTo(this" +
".selectedIndex);\">");
out.write("<option>" + resources.getString("SortBy") + "</option>");
out.write("<option>-------------------------------</option>");
out.write(getSortingListBoxEntry(SORT_UPDATE_ASC, resources.getString("DateAsc"), ksc));
Expand Down Expand Up @@ -1169,11 +1161,11 @@ private void displayLastPublications(KmeliaSessionController kmeliaScc,
resources.getString("kmelia.CopyPublicationLink") + "\" /></a>");
}
writer.write("<p class=\"publication-description\">"+WebEncodeHelper.convertBlanksForHtml(Encode.forHtml(pub.
getDescription(language))));
getDescription(language))));
writer.write("</p>");
writer.write("</li>");
}

writer.write("</ul>");
}

Expand Down Expand Up @@ -1231,5 +1223,5 @@ private void initSearch(QueryDescription queryDescription, PagesContext formCont
}
}
}

}

0 comments on commit 9e98d06

Please sign in to comment.