diff --git a/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/journal-search-widget.xsl b/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/journal-search-widget.xsl index 8b1378917..d7bccef75 100644 --- a/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/journal-search-widget.xsl +++ b/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/journal-search-widget.xsl @@ -1 +1,110 @@ + + + + + + + +
+ + +

+ +

+ +
+ +

+ + + +

+
+
+ + +

+ + +

+
+ + + + +
+
+ + + + + + +
+ +
+ + + $name + + +
+
+
+ +
+ +
diff --git a/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/publication-search-widget.xsl b/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/publication-search-widget.xsl index 8b1378917..1672fa53a 100644 --- a/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/publication-search-widget.xsl +++ b/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/publication-search-widget.xsl @@ -1 +1,129 @@ + + + + + + + +
+ + +

+ +

+ +
+ +

+ + + +

+ +
+
+ + +

+ + +

+
+ + + + +
+
+ + + + + + + + + + + + + + +
+ + + + + +
+ $publicationStr + + $type +
+
+
+
+
+ +
diff --git a/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/series-search-widget.xsl b/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/series-search-widget.xsl index 8b1378917..258703e71 100644 --- a/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/series-search-widget.xsl +++ b/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/lib/cms/series-search-widget.xsl @@ -1 +1,112 @@ - + + + + + + + +
+ + +

+ +

+ +
+ +

+ + + +

+
+
+ + +

+ + +

+
+ + + + +
+
+ + + + + + + +
+ + + +
+ + + $name + + +
+
+
+ +
+ +
diff --git a/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/scripts/cms-admin.js b/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/scripts/cms-admin.js index 81e13da80..ee7e2be27 100644 --- a/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/scripts/cms-admin.js +++ b/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/scripts/cms-admin.js @@ -174,10 +174,9 @@ function toggleSelectItemDialog(mode, dialogId) { } } -function getJournalsForSelectAssetDialog(dialogId) { +function getJournalsForSelectJournalDialog(dialogId) { var dialog = document.querySelector("#" + dialogId); - var type = dialog.getAttribute("data-assettype"); var targetId = dialog.getAttribute('data-targetId'); var filter = document.querySelector('#' + dialogId + '-journals-filter'); var query = filter.value; @@ -188,7 +187,11 @@ function getJournalsForSelectAssetDialog(dialogId) { 0, dispatcherPrefix.length - "/ccm".length ) - + "/sci-publications/journals"; + + "/scipublications/journals"; + + if (query !== null && query.length > 0) { + url = `${url}?query=${query}`; + } request.open("GET", url); request.addEventListener("load", function (event) { @@ -199,21 +202,262 @@ function getJournalsForSelectAssetDialog(dialogId) { for (i = 0; i < journals.length; ++i) { var journal = journals[i]; tableRows = tableRows - + "" - + "" - + "" - + journal["title"] - + "" - + ""; + + ` + + + ${journal["title"]} + + +`; } document .querySelector("#" + dialogId + " tbody") .innerHTML = tableRows; + } else { + alert("Error while retrieving journals. " + + `Response code: ${request.status} ` + + `Message: ${request.statusText}`); } }); request.send(); } +function setSelectedJournal(journalId, journalTitle, targetId, dialogId) { + var target = document.querySelector(`#${targetId}`); + var targetText = document.querySelector(`#${targetId}-selected`); + + target.value = journalId; + targetText.textContent = journalTitle; + + toggleSelectJournalDialog('hide', dialogId); +} + +function toggleSelectJournalDialog(mode, dialogId) { + var dialog = document.querySelector("#" + dialogId); + + if ('show' === mode) { + dialog.setAttribute('open', 'open'); + getAssetsForSelectAssetDialog(dialogId); + } else { + dialog.setAttribute('open', 'false'); + } +} + +function getItemsForSelectPublicationDialog(dialogId) { + var dialog = document.querySelector('#' + dialogId); + var type = dialog.getAttribute("data-publicationtype"); + var targetId = dialog.getAttribute('data-targetId'); + var filter = document.querySelector(`#${dialogId}-publication-filter`); + var query = filter.value; + var dispatcherPrefix = dialog.getAttribute('data-dispatcherPrefix'); + + var request = new XMLHttpRequest(); + var url = `${dispatcherPrefix.substring(0, + dispatcherPrefix.length - "/ccm".length)}/scipublications/publications`; + if (filter !== null && type.length > 0) { + url = `${url}?type=${type}`; + } + + if ((type !== null && type.length > 0) + && (query !== null && query.length > 0)) { + url = `${url}&query=${query}`; + } else if (query !== null && query.length > 0) { + url = `${url}?query=${query}`; + } + + request.open("GET", url); + request.addEventListener("load", function (event) { + if (request.status >= 200 && request.status < 300) { + var publications = JSON.parse(request.responseText); + var tableRows = ""; + var i; + for (i = 0; i < publications.length; ++i) { + var publication = publications[i]; + var publicationStr = `${publication.authors} (${publication.year}): ${publication.title}`; + + if (publications.publisher) { + publicationStr = `${publicationStr}: ${publication.place}: ${publication.publisher}`; + } + + tableRows = tableRows + + ` + + + ${publicationStr} + + +`; + } + document + .querySelector(`#${dialogId} tbody`) + .innerHTML = tableRows; + } else { + alert("Error while retrieving publications. " + + "Response code: " + request.status + " " + + "Message: " + request.statusText); + } + }); + request.send(); +} + +function setSelectedPublication(publicationId, publicationStr, targetId, + dialogId) { + var target = document.querySelector(`#${targetId}`); + var targetText = document.querySelector(`#${targetId}-selected`); + + target.value = publicationId; + targetText.textContent = publicationStr; + + toggleSelectPublicationDialog('hide', dialogId); +} + +function toggleSelectPublicationDialog(mode, dialogId) { + var dialog = document.querySelector("#" + dialogId); + + if ('show' === mode) { + dialog.setAttribute('open', 'open'); + getAssetsForSelectAssetDialog(dialogId); + } else { + dialog.setAttribute('open', 'false'); + } +} + +function getPublishersForSelectPublisherDialog(dialogId) { + var dialog = document.querySelector("#" + dialogId); + var targetId = dialog.getAttribute('data-targetId'); + var filter = document.querySelector('#' + dialogId + '-publisher-filter'); + var query = filter.value; + var dispatcherPrefix = dialog.getAttribute('data-dispatcherPrefix'); + + var request = new XMLHttpRequest(); + var url = `${dispatcherPrefix.substring(0, + dispatcherPrefix.length - "/ccm".length)}/scipublications/publishers}`; + if (query !== null && query.length > 0) { + url = `${url}?query=${query}`; + } + + request.open("GET", url); + request.addEventListener("load", function (event) { + if (request.status >= 200 && request.status < 300) { + var publishers = JSON.parse(request.responseText); + var tableRows = ""; + var i; + for (i = 0; i < publishers.length; ++i) { + var publisher = publishers[i]; + tableRows = tableRows + + ` + + + ${publisher.name}, ${publisher.place} + + +`; + } + document + .querySelector("#" + dialogId + " tbody") + .innerHTML = tableRows; + } else { + alert("Error while retrieving publishers. " + + `Response code: ${request.status} ` + + `Message: ${request.statusText}`); + } + }); + request.send(); +} + +function setSelectedPublisher(publisherId, publisherStr, targetId, dialogId) { + var target = document.querySelector(`#${targetId}`); + var targetText = document.querySelector(`#${targetId}-selected`); + + target.value = publisherId; + targetText.textContent = publisherStr; + + toggleSelectPublisherDialog("hide", dialogId); +} + +function toggleSelectPublisherDialog(mode, dialogId) { + var dialog = document.querySelector("#" + dialogId); + + if ('show' === mode) { + dialog.setAttribute('open', 'open'); + getAssetsForSelectAssetDialog(dialogId); + } else { + dialog.setAttribute('open', 'false'); + } +} + +function getSeriesForSelectSeriesDialog(dialogId) { + var dialog = document.querySelector("#" + dialogId); + var targetId = dialog.getAttribute('data-targetId'); + var filter = document.querySelector('#' + dialogId + '-series-filter'); + var query = filter.value; + var dispatcherPrefix = dialog.getAttribute('data-dispatcherPrefix'); + + var request = new XMLHttpRequest(); + var url = dispatcherPrefix.substring( + 0, + dispatcherPrefix.length - "/ccm".length + ) + + "/scipublications/series"; + + if (query !== null && query.length > 0) { + url = `${url}?query=${query}`; + } + + request.open("GET", url); + request.addEventListener("load", function (event) { + if (request.status >= 200 && request.status < 300) { + var seriesList = JSON.parse(request.responseText); + var tableRows = ""; + var i; + for (i = 0; i < seriesList.length; ++i) { + var series = seriesList[i]; + tableRows = tableRows + + ` + + + ${series.name} + + +`; + } + document + .querySelector("#" + dialogId + " tbody") + .innerHTML = tableRows; + } else { + alert("Error while retrieving series. " + + `Response code: ${request.status} ` + + `Message: ${request.statusText}`); + } + }); + request.send(); +} + +function setSelectedSeries(seriesId, seriesName, targetId, dialogId) { + var target = document.querySelector(`#${targetId}`); + var targetText = document.querySelector(`#${targetId}-selected`); + + target.value = seriesId; + targetText.textContent = seriesName; + + toggleSelectSeriesDialog('hide', dialogId); +} + +function toggleSelectSeriesDialog(mode, dialogId) { + var dialog = document.querySelector("#" + dialogId); + + if ('show' === mode) { + dialog.setAttribute('open', 'open'); + getAssetsForSelectAssetDialog(dialogId); + } else { + dialog.setAttribute('open', 'false'); + } +} + document.addEventListener('DOMContentLoaded', function () { var i; diff --git a/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/texts/cms.xml b/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/texts/cms.xml index ad63c9d6d..b8b815b60 100644 --- a/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/texts/cms.xml +++ b/ccm-theme-foundry/src/main/resources/themes/foundry/foundry/texts/cms.xml @@ -122,6 +122,43 @@ Close + + Filtern nach + Filter using + + + Anwenden + Apply + + + Keine Zeitschrift ausgewählt + No journal selected + + + Ausgewählte Zeitschrift + Selected journal + + + Name + Name + + + Zeitschrift auswählen + Select journal + + + Name + Name + + + Wählen Sie die zu verwendende Zeitschrift aus + Select the journal to use + + + Ohne Auswahl schließen + Close without selecting an journal + + Filtern nach Filter using @@ -167,6 +204,97 @@ Close without selecting an publisher + + Filtern nach + Filter using + + + Anwenden + Apply + + + Keine Publikation ausgewählt + No publication selected + + + Ausgewählte Publikation + Selected publication + + + Publikation + Publication + + + Type + Typ + + + Publikation auswählen + Select publication + + + Name + Name + + + Name + Name + + + Wählen Sie den zu verwendende Publikation aus + Select the publication to use + + + Ohne Auswahl schließen + Close without selecting an + + + + + Filtern nach + Filter using + + + Anwenden + Apply + + + Keine Reihe ausgewählt + No series selected + + + Ausgewählte Reihe + Selected series + + + Name + Name + + + Type + Typ + + + Reihe auswählen + Select series + + + Name + Name + + + Name + Name + + + Wählen Sie den zu verwendende Reihe aus + Select the series to use + + + Ohne Auswahl schließen + Close without selecting an + + Item Summary Zusammenfassung