diff --git a/Dockerfile b/Dockerfile index 018f97d415..16e963f862 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,8 @@ ENV APP_CONTEXT="mir" \ MCR_OVERRIDE_DIR="/mcr/override/" \ SOLR_CORE="mir" \ SOLR_CLASSIFICATION_CORE="mir-classifications" \ + SOLR_MAIN_CONFIGSET="mycore_main" \ + SOLR_CLASSIFICATION_CONFIGSET="mycore_classification" \ XMX="1g" \ XMS="1g" COPY --from=regreb/bibutils --chown=mcr:mcr /usr/local/bin/* /usr/local/bin/ diff --git a/README.md b/README.md index a500c244e3..67f6b723f4 100644 --- a/README.md +++ b/README.md @@ -67,17 +67,21 @@ The docker container has its own install script which uses the environment varia ### Environment Variables | Property | Default, required | Description | |--------------------------------|---------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| ENABLE_SOLR_CLOUD | false | If true the Solr Cloud mode is enabled. (solr cores will be created on install) | -| SOLR_ADMIN_USER | none | The username for the Solr Admin. (will be used for admin commands like creating cores) | +| ENABLE_SOLR_CLOUD | false | If true the Solr Cloud mode is enabled. (solr cores/collections will be created on install). Sets `MCR.Solr.IndexRegistry.Index.*.Class` to `MCRConfigurableSolrCloudCollection` instead of `MCRConfigurableSolrCore`. | +| SOLR_URL | none | The HTTP URL to the Solr server. In standalone mode sets `MCR.Solr.IndexRegistry.Index.*.SolrUrl`. In cloud mode sets `MCR.Solr.IndexRegistry.Index.*.SolrUrls`. Not required if `SOLR_ZK_HOST` is set in cloud mode. | +| SOLR_ZK_HOST | none | ZooKeeper URL(s) for SolrCloud (comma-separated). Sets `MCR.Solr.IndexRegistry.Index.*.ZkUrls`. Only used when `ENABLE_SOLR_CLOUD=true`. Takes precedence over `SOLR_URL` for the connection when both are set. | +| SOLR_ZK_CHROOT | none | Optional ZooKeeper chroot path for SolrCloud. Sets `MCR.Solr.IndexRegistry.Index.*.ZkChroot`. Only used when `SOLR_ZK_HOST` is set. | +| SOLR_CORE | mir | In standalone mode: the core name (`MCR.Solr.IndexRegistry.Index.main.CoreName`). In cloud mode: the collection name (`MCR.Solr.IndexRegistry.Index.main.CollectionName`). | +| SOLR_CLASSIFICATION_CORE | mir-classifications | In standalone mode: the classification core name (`MCR.Solr.IndexRegistry.Index.classification.CoreName`). In cloud mode: the classification collection name (`MCR.Solr.IndexRegistry.Index.classification.CollectionName`). | +| SOLR_MAIN_CONFIGSET | mycore_main | The Solr configset template for the main collection. Sets `MCR.Solr.IndexRegistry.Index.main.ConfigSetTemplate`. Only used in cloud mode. | +| SOLR_CLASSIFICATION_CONFIGSET | mycore_classification | The Solr configset template for the classification collection. Sets `MCR.Solr.IndexRegistry.Index.classification.ConfigSetTemplate`. Only used in cloud mode. | +| SOLR_ADMIN_USER | none | The username for the Solr Admin. (will be used for admin commands like creating cores). Sets `MCR.Solr.Server.Auth.Admin.*`. | | SOLR_ADMIN_PASSWORD | none | The password for the Solr Admin. | -| SOLR_INDEX_USER | none | The username for the Solr Indexer. (will be used for indexing) | +| SOLR_INDEX_USER | none | The username for the Solr Indexer. (will be used for indexing). Sets `MCR.Solr.Server.Auth.Index.*`. | | SOLR_INDEX_PASSWORD | none | The password for the Solr Indexer. | -| SOLR_SEARCH_USER | none | The username for the Solr Searcher. (will be used for searching) | +| SOLR_SEARCH_USER | none | The username for the Solr Searcher. (will be used for searching). Sets `MCR.Solr.Server.Auth.Search.*`. | | SOLR_SEARCH_PASSWORD | none | The password for the Solr Searcher. | | TIKASERVER_URL | none | The URL to the Tika Server. Same as `MCR.Solr.Tika.ServerURL` in `mycore.properties`. (also sets `MCR.Solr.FileIndexStrategy` to `org.mycore.solr.index.file.tika.MCRTikaSolrFileStrategy`) | -| SOLR_URL | none, required | The URL to the SOLR Server. Same as `MCR.Solr.ServerURL` in `mycore.properties`. | -| SOLR_CORE | mir | The name of the Solr main core. Same as `MCR.Solr.Core.main.Name` in `mycore.properties`. | -| SOLR_CLASSIFICATION_CORE | mir-classifications | The name of the Solr classification core. Same as `MCR.Solr.Core.classification.Name` in `mycore.properties`. | | JDBC_NAME | none, required | The username for the Database authentication. Same as `javax.persistence.jdbc.user` in `persistence.xml`. | | JDBC_PASSWORD | none, required | The password for the Database authentication. Same as `javax.persistence.jdbc.password` in `persistence.xml`. | | JDBC_DRIVER | none, required | The driver for the Database. Same as `javax.persistence.jdbc.driver` in `persistence.xml`. If you use `org.postgresql.Driver`, `org.mariadb.jdbc.Driver`, `org.hsqldb.jdbcDriver`, `org.h2.Driver` or `com.mysql.jdbc.Driver`, the right database drivers get downloaded by the installer script. | diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 2cefc00526..1daf8a0596 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -94,16 +94,71 @@ function setOrAddProperty() { function setDockerValues() { echo "Set Docker Values to Config!" - if [ -n "${SOLR_URL}" ]; then - setOrAddProperty "MCR.Solr.ServerURL" "${SOLR_URL}" - fi - - if [ -n "${SOLR_CORE}" ]; then - setOrAddProperty "MCR.Solr.Core.main.Name" "${SOLR_CORE}" - fi - - if [ -n "${SOLR_CLASSIFICATION_CORE}" ]; then - setOrAddProperty "MCR.Solr.Core.classification.Name" "${SOLR_CLASSIFICATION_CORE}" + if [[ "$ENABLE_SOLR_CLOUD" == "true" ]]; then + # SolrCloud mode + if [ -n "${SOLR_ZK_HOST}" ]; then + # Connect via ZooKeeper + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.Class" "org.mycore.solr.cloud.collection.MCRConfigurableSolrCloudCollection" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.ZkUrls" "${SOLR_ZK_HOST}" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.Class" "org.mycore.solr.cloud.collection.MCRConfigurableSolrCloudCollection" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.ZkUrls" "${SOLR_ZK_HOST}" + if [ -n "${SOLR_ZK_CHROOT}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.ZkChroot" "${SOLR_ZK_CHROOT}" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.ZkChroot" "${SOLR_ZK_CHROOT}" + fi + elif [ -n "${SOLR_URL}" ]; then + # Connect via Solr HTTP URL + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.Class" "org.mycore.solr.cloud.collection.MCRConfigurableSolrCloudCollection" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.SolrUrls" "${SOLR_URL}" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.Class" "org.mycore.solr.cloud.collection.MCRConfigurableSolrCloudCollection" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.SolrUrls" "${SOLR_URL}" + fi + if [ -n "${SOLR_CORE}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.CollectionName" "${SOLR_CORE}" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.ConfigSetTemplate" "${SOLR_MAIN_CONFIGSET:-mycore_main}" + fi + if [ -n "${SOLR_CLASSIFICATION_CORE}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.CollectionName" "${SOLR_CLASSIFICATION_CORE}" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.ConfigSetTemplate" "${SOLR_CLASSIFICATION_CONFIGSET:-mycore_classification}" + fi + if [ -n "${SOLR_CORE_NUM_SHARDS}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.NumShards" "${SOLR_CORE_NUM_SHARDS}" + fi + if [ -n "${SOLR_CORE_NUM_NRT_REPLICAS}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.NumNrtReplicas" "${SOLR_CORE_NUM_NRT_REPLICAS}" + fi + if [ -n "${SOLR_CORE_NUM_TLOG_REPLICAS}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.NumTlogReplicas" "${SOLR_CORE_NUM_TLOG_REPLICAS}" + fi + if [ -n "${SOLR_CORE_NUM_PULL_REPLICAS}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.NumPullReplicas" "${SOLR_CORE_NUM_PULL_REPLICAS}" + fi + if [ -n "${SOLR_CLASSIFICATION_CORE_NUM_SHARDS}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.NumShards" "${SOLR_CLASSIFICATION_CORE_NUM_SHARDS}" + fi + if [ -n "${SOLR_CLASSIFICATION_CORE_NUM_NRT_REPLICAS}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.NumNrtReplicas" "${SOLR_CLASSIFICATION_CORE_NUM_NRT_REPLICAS}" + fi + if [ -n "${SOLR_CLASSIFICATION_CORE_NUM_TLOG_REPLICAS}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.NumTlogReplicas" "${SOLR_CLASSIFICATION_CORE_NUM_TLOG_REPLICAS}" + fi + if [ -n "${SOLR_CLASSIFICATION_CORE_NUM_PULL_REPLICAS}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.NumPullReplicas" "${SOLR_CLASSIFICATION_CORE_NUM_PULL_REPLICAS}" + fi + else + # Standalone mode + if [ -n "${SOLR_URL}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.Class" "org.mycore.solr.standalone.core.MCRConfigurableSolrCore" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.SolrUrl" "${SOLR_URL}" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.Class" "org.mycore.solr.standalone.core.MCRConfigurableSolrCore" + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.SolrUrl" "${SOLR_URL}" + fi + if [ -n "${SOLR_CORE}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.main.CoreName" "${SOLR_CORE}" + fi + if [ -n "${SOLR_CLASSIFICATION_CORE}" ]; then + setOrAddProperty "MCR.Solr.IndexRegistry.Index.classification.CoreName" "${SOLR_CLASSIFICATION_CORE}" + fi fi if [ -n "${JDBC_NAME}" ]; then diff --git a/mir-it/src/test/integration/mycore.properties b/mir-it/src/test/integration/mycore.properties index c122bdcd3c..f7ae9cb54c 100644 --- a/mir-it/src/test/integration/mycore.properties +++ b/mir-it/src/test/integration/mycore.properties @@ -1,6 +1,18 @@ -MCR.Solr.ServerURL=http\://localhost\:${solr.port}/ MCR.Solr.DelayIndexing_inMS=200 -MCR.Solr.SolrClient.SocketTimeout=70000 + +MCR.Solr.Default.Client.RequestTimeout=70 +MCR.Solr.Default.Client.RequestTimeout.Unit=SECONDS + +MCR.Solr.Default.Client.IdleTimeout=70 +MCR.Solr.Default.Client.IdleTimeout.Unit=SECONDS + +MCR.Solr.IndexRegistry.Index.classification.Class=org.mycore.solr.cloud.collection.MCRConfigurableSolrCloudCollection +MCR.Solr.IndexRegistry.Index.classification.CollectionName=mir-classifications +MCR.Solr.IndexRegistry.Index.classification.SolrUrls=http\://localhost\:${solr.port}/ + +MCR.Solr.IndexRegistry.Index.main.Class=org.mycore.solr.cloud.collection.MCRConfigurableSolrCloudCollection +MCR.Solr.IndexRegistry.Index.main.CollectionName=mir +MCR.Solr.IndexRegistry.Index.main.SolrUrls=http\://localhost\:${solr.port}/ MCR.Solr.Server.Auth.Admin.Class=org.mycore.solr.auth.MCRSolrPropertyBasicAuthenticator MCR.Solr.Server.Auth.Admin.Password=alleswirdgut diff --git a/mir-module/src/main/java/org/mycore/mir/impexp/MIRRelatedItemFinderUtils.java b/mir-module/src/main/java/org/mycore/mir/impexp/MIRRelatedItemFinderUtils.java index ce7a0278da..b309929247 100644 --- a/mir-module/src/main/java/org/mycore/mir/impexp/MIRRelatedItemFinderUtils.java +++ b/mir-module/src/main/java/org/mycore/mir/impexp/MIRRelatedItemFinderUtils.java @@ -1,14 +1,21 @@ package org.mycore.mir.impexp; +import java.io.IOException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.apache.solr.client.solrj.SolrServerException; +import org.apache.solr.client.solrj.request.QueryRequest; +import org.apache.solr.client.solrj.request.SolrQuery; +import org.apache.solr.client.solrj.response.QueryResponse; import org.jdom2.Element; import org.jdom2.filter.Filters; import org.jdom2.input.DOMBuilder; import org.jdom2.xpath.XPathExpression; import org.jdom2.xpath.XPathFactory; import org.mycore.common.MCRConstants; -import org.mycore.solr.MCRXMLFunctions; +import org.mycore.solr.MCRSolrIndexRegistryManager; +import org.mycore.solr.auth.MCRSolrAuthenticationLevel; +import org.mycore.solr.auth.MCRSolrAuthenticationManager; import org.w3c.dom.NodeList; /** @@ -18,6 +25,26 @@ public class MIRRelatedItemFinderUtils { private static final Logger LOGGER = LogManager.getLogger(); + private static String getIdentifierOfFirst(String q) throws SolrServerException, IOException { + if (q == null || q.isEmpty()) { + throw new IllegalArgumentException("The query string must not be null"); + } + SolrQuery solrQuery = new SolrQuery(q); + solrQuery.set("rows", 1); + QueryResponse queryResponse; + QueryRequest queryRequest = new QueryRequest(solrQuery); + MCRSolrAuthenticationManager.obtainInstance().applyAuthentication(queryRequest, + MCRSolrAuthenticationLevel.SEARCH); + queryResponse = queryRequest.process(MCRSolrIndexRegistryManager.obtainRegistry() + .requireMainIndex().getClient()); + + if (queryResponse.getResults().getNumFound() == 0) { + return null; + } + + return queryResponse.getResults().getFirst().get("id").toString(); + } + public static String findRelatedItem(final NodeList sources) { if (sources.getLength() == 0) { LOGGER.warn("Cannot get first element of node list 'sources'."); @@ -32,14 +59,14 @@ public static String findRelatedItem(final NodeList sources) { String mcrID = ""; try { if (identifierElement != null) { - mcrID = MCRXMLFunctions.getIdentifierOfFirst("mods.identifier:\"" + identifierElement.getText() + "\""); + mcrID = getIdentifierOfFirst("mods.identifier:\"" + identifierElement.getText() + "\""); } if (identifierElement == null || mcrID == null) { XPathExpression xpathTitle = XPathFactory.instance().compile("mods:titleInfo/mods:title", Filters.element(), null, MCRConstants.MODS_NAMESPACE, MCRConstants.XLINK_NAMESPACE); Element titleElement = xpathTitle.evaluateFirst(relatedItem); if (titleElement != null) { - mcrID = MCRXMLFunctions.getIdentifierOfFirst("mods.title.main:\"" + titleElement.getText() + "\""); + mcrID = getIdentifierOfFirst("mods.title.main:\"" + titleElement.getText() + "\""); } } } catch (Exception e) { diff --git a/mir-module/src/main/resources/config/mir/mycore.properties b/mir-module/src/main/resources/config/mir/mycore.properties index 8dc792e214..b20ddd04c3 100644 --- a/mir-module/src/main/resources/config/mir/mycore.properties +++ b/mir-module/src/main/resources/config/mir/mycore.properties @@ -253,8 +253,11 @@ MCR.mir-module.sendEditorMailToCurrentAuthor=false ############################################################################## # SOLR # ############################################################################## -MCR.Solr.Core.main.Name=%MIR.projectid.default% -MCR.Solr.Core.classification.Name=%MCR.Solr.Core.main.Name%-classifications +MCR.Solr.IndexRegistry.Index.main.CoreName=%MIR.projectid.default% +MCR.Solr.IndexRegistry.Index.classification.CoreName=%MCR.Solr.Core.main.Name%-classifications +MCR.Solr.IndexRegistry.Index.main.CollectionName=%MIR.projectid.default% +MCR.Solr.IndexRegistry.Index.classification.CollectionName=%MCR.Solr.Core.main.Name%-classifications + MCR.Category.LinkService=org.mycore.solr.classification.MCRSolrCategLinkService MCR.Category.DAO=org.mycore.solr.classification.MCRSolrCategoryDAO MCR.Solr.SolrInputDocument.Path.Factory=org.mycore.mir.index.MirPathDocumentFactory diff --git a/mir-wizard/src/main/java/org/mycore/mir/wizard/command/MIRWizardSolr.java b/mir-wizard/src/main/java/org/mycore/mir/wizard/command/MIRWizardSolr.java index 428cf8eaa9..23de88caff 100644 --- a/mir-wizard/src/main/java/org/mycore/mir/wizard/command/MIRWizardSolr.java +++ b/mir-wizard/src/main/java/org/mycore/mir/wizard/command/MIRWizardSolr.java @@ -23,11 +23,11 @@ package org.mycore.mir.wizard.command; import java.util.Optional; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.jdom2.Element; import org.mycore.mir.wizard.MIRWizardCommand; +import org.mycore.solr.MCRSolrIndexRegistryManager; import org.mycore.solr.commands.MCRSolrCloudCommands; import org.mycore.solr.commands.MCRSolrCoreAdminCommands; @@ -66,6 +66,8 @@ public void doExecute() { .map(input -> input.getChild("createCores")) .filter(input -> input.getTextTrim().equals("true")); + MCRSolrIndexRegistryManager.reloadRegistry(); + if (createCores.isPresent()) { MCRSolrCloudCommands.uploadLocalConfig(DEFAULT_CORE); MCRSolrCloudCommands.uploadLocalConfig(DEFAULT_CLASSIFICATION); diff --git a/mir-wizard/src/main/resources/META-INF/resources/wizard/index.xed b/mir-wizard/src/main/resources/META-INF/resources/wizard/index.xed index b1d61a2c83..4a5285b019 100644 --- a/mir-wizard/src/main/resources/META-INF/resources/wizard/index.xed +++ b/mir-wizard/src/main/resources/META-INF/resources/wizard/index.xed @@ -45,48 +45,130 @@ - - - + + + + + + + + + + + + + + + + + + + + + - + + + + + i18n="component.mir.wizard.solr.admin.username" + tooltip="component.mir.wizard.solr.admin.username.tooltip" /> + i18n="component.mir.wizard.solr.admin.password" + tooltip="component.mir.wizard.solr.admin.password.tooltip" /> + i18n="component.mir.wizard.solr.index.username" + tooltip="component.mir.wizard.solr.index.username.tooltip" /> + i18n="component.mir.wizard.solr.index.password" + tooltip="component.mir.wizard.solr.index.password.tooltip" /> + i18n="component.mir.wizard.solr.search.username" + tooltip="component.mir.wizard.solr.search.username.tooltip" /> + i18n="component.mir.wizard.solr.search.password" + tooltip="component.mir.wizard.solr.search.password.tooltip" /> + i18n="component.mir.wizard.solr.tikaUrl" + tooltip="component.mir.wizard.solr.tikaUrl.tooltip" />
diff --git a/mir-wizard/src/main/resources/META-INF/resources/wizard/js/wizard.js b/mir-wizard/src/main/resources/META-INF/resources/wizard/js/wizard.js index 5418032ca6..9b15ad28a7 100644 --- a/mir-wizard/src/main/resources/META-INF/resources/wizard/js/wizard.js +++ b/mir-wizard/src/main/resources/META-INF/resources/wizard/js/wizard.js @@ -80,7 +80,9 @@ jQuery(document).ready(function() { * * Description: Initialize all Bootstrap Tooltips. */ - $('*[data-bs-toggle="tooltip"]').tooltip(); + document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(function(el) { + new bootstrap.Tooltip(el); + }); const formGroupSelector = '.mir-form-group.row'; @@ -91,10 +93,27 @@ jQuery(document).ready(function() { * @returns {void} */ const setFormGroupVisible = (containedElementID, visible) => { - document.querySelector(`#${containedElementID}`) - .closest(formGroupSelector).style.display = visible ? '' : 'none'; + const el = document.querySelector(`#${containedElementID}`); + if (!el) return; + const group = el.closest(formGroupSelector); + if (!group) return; + group.style.display = visible ? '' : 'none'; + }; + + const updateCreateCoresForms = () => { + const createCoresCheckbox = document.getElementById('createCores'); + const solrCloudCreationOptions = document.getElementById('solrCloudCreationOptions'); + if (solrCloudCreationOptions) { + solrCloudCreationOptions.style.display = (createCoresCheckbox && createCoresCheckbox.checked) ? '' : 'none'; + } }; + document.addEventListener('change', function(e) { + if (e.target && e.target.id === 'createCores') { + updateCreateCoresForms(); + } + }); + const adminAuthCheckbox = document.getElementById('adminUserEnabled'); const indexAuthCheckbox = document.getElementById('indexUserEnabled'); const searchAuthCheckbox = document.getElementById('searchUserEnabled'); @@ -143,4 +162,43 @@ jQuery(document).ready(function() { updateTikaServerForms(); + // Solr mode handling + const modeStandaloneRadio = document.getElementById('solrMode-standalone'); + const modeCloudUrlRadio = document.getElementById('solrMode-cloud-url'); + const modeCloudZkRadio = document.getElementById('solrMode-cloud-zk'); + + const getCurrentSolrMode = () => { + if (modeCloudUrlRadio?.checked) return 'cloud-url'; + if (modeCloudZkRadio?.checked) return 'cloud-zk'; + return 'standalone'; + }; + + const updateSolrMode = () => { + const mode = getCurrentSolrMode(); + const isStandalone = mode === 'standalone'; + const isCloudZk = mode === 'cloud-zk'; + const isCloud = !isStandalone; + + setFormGroupVisible('solrServerUrl', !isCloudZk); + setFormGroupVisible('solrZkUrl', isCloudZk); + setFormGroupVisible('solrZkChroot', isCloudZk); + setFormGroupVisible('solrMainCore', isStandalone); + setFormGroupVisible('solrClassificationCore', isStandalone); + setFormGroupVisible('solrMainCollection', isCloud); + setFormGroupVisible('solrClassificationCollection', isCloud); + setFormGroupVisible('createCores', isCloud); + if (!isCloud) { + const solrCloudCreationOptions = document.getElementById('solrCloudCreationOptions'); + if (solrCloudCreationOptions) solrCloudCreationOptions.style.display = 'none'; + } else { + updateCreateCoresForms(); + } + }; + + [modeStandaloneRadio, modeCloudUrlRadio, modeCloudZkRadio].forEach(radio => { + if (radio) radio.addEventListener('change', updateSolrMode); + }); + + updateSolrMode(); + }); diff --git a/mir-wizard/src/main/resources/config/mir-wizard/messages_de.properties b/mir-wizard/src/main/resources/config/mir-wizard/messages_de.properties index d96fe35ced..0c48bd439e 100644 --- a/mir-wizard/src/main/resources/config/mir-wizard/messages_de.properties +++ b/mir-wizard/src/main/resources/config/mir-wizard/messages_de.properties @@ -40,9 +40,42 @@ component.mir.wizard.smtp.numTries.error = Die Anzahl der Versuche mus component.mir.wizard.smtp.password = Passwort component.mir.wizard.smtp.title = SMTP-Einstellungen component.mir.wizard.smtp.user = Benutzername -component.mir.wizard.solr.classificationCore = Klassifikationen Kern -component.mir.wizard.solr.mainCore = Anwendungs Kern +component.mir.wizard.solr.classificationCore = Klassifikations-Kern/-Collection +component.mir.wizard.solr.mainCore = Anwendungs-Kern/-Collection +component.mir.wizard.solr.mode = Verbindungstyp +component.mir.wizard.solr.mode.standalone = Standalone +component.mir.wizard.solr.mode.cloudUrl = SolrCloud (Solr-URL) +component.mir.wizard.solr.mode.cloudZk = SolrCloud (ZooKeeper) +component.mir.wizard.solr.zkUrl = ZooKeeper-Host(s) +component.mir.wizard.solr.zkUrl.required = Bitte tragen Sie g\u00FCltige ZooKeeper-Hosts ein! +component.mir.wizard.solr.zkChroot = ZooKeeper Chroot (optional) +component.mir.wizard.solr.url.tooltip = URL des Solr-Servers. Bei SolrCloud (Solr-URL) mehrere URLs kommagetrennt angeben. +component.mir.wizard.solr.zkUrl.tooltip = ZooKeeper-Hosts und Ports, kommagetrennt (z.B. zk1:2181,zk2:2181). +component.mir.wizard.solr.zkChroot.tooltip = Optionaler ZooKeeper-Pfad (Chroot), unter dem SolrCloud seine Daten ablegt (z.B. /solr). +component.mir.wizard.solr.mainCore.tooltip = Name des Solr-Kerns f\u00FCr den Hauptindex. +component.mir.wizard.solr.classificationCore.tooltip = Name des Solr-Kerns f\u00FCr den Klassifikationsindex. +component.mir.wizard.solr.mainCollection.tooltip = Name der SolrCloud-Collection f\u00FCr den Hauptindex. +component.mir.wizard.solr.classificationCollection.tooltip = Name der SolrCloud-Collection f\u00FCr den Klassifikationsindex. +component.mir.wizard.solr.admin.username.tooltip = Benutzername f\u00FCr administrative Solr-Anfragen (z.B. Collection-Erstellung). +component.mir.wizard.solr.admin.password.tooltip = Passwort f\u00FCr den Solr-Administrations-Benutzer. +component.mir.wizard.solr.index.username.tooltip = Benutzername f\u00FCr Solr-Indexierungs-Anfragen. +component.mir.wizard.solr.index.password.tooltip = Passwort f\u00FCr den Solr-Indexierungs-Benutzer. +component.mir.wizard.solr.search.username.tooltip = Benutzername f\u00FCr Solr-Suchanfragen. +component.mir.wizard.solr.search.password.tooltip = Passwort f\u00FCr den Solr-Such-Benutzer. +component.mir.wizard.solr.tikaUrl.tooltip = URL des Tika-Servers f\u00FCr die Volltext-Extraktion aus Dokumenten (z.B. http://tika:9998). component.mir.wizard.solr.createCores = Erstelle Solr-Kerne per SolrCloud REST-API +component.mir.wizard.solr.main.numShards = Anzahl Shards (Haupt-Collection, optional) +component.mir.wizard.solr.main.numNrtReplicas = NRT-Replikate (Haupt-Collection, optional) +component.mir.wizard.solr.main.numTlogReplicas = TLOG-Replikate (Haupt-Collection, optional) +component.mir.wizard.solr.main.numPullReplicas = Pull-Replikate (Haupt-Collection, optional) +component.mir.wizard.solr.classification.numShards = Anzahl Shards (Klassifikations-Collection, optional) +component.mir.wizard.solr.classification.numNrtReplicas = NRT-Replikate (Klassifikations-Collection, optional) +component.mir.wizard.solr.classification.numTlogReplicas = TLOG-Replikate (Klassifikations-Collection, optional) +component.mir.wizard.solr.classification.numPullReplicas = Pull-Replikate (Klassifikations-Collection, optional) +component.mir.wizard.solr.numShards.tooltip = Anzahl der Shards, auf die die Collection verteilt wird. Leer lassen f\u00FCr den Solr-Standardwert. +component.mir.wizard.solr.numNrtReplicas.tooltip = Near-Real-Time-Replikate: aktive Schreibreplikate, die den Leader ersetzen k\u00F6nnen. Leer lassen f\u00FCr den Solr-Standardwert. +component.mir.wizard.solr.numTlogReplicas.tooltip = Transaction-Log-Replikate: passive Replikate, die \u00FCber den Tlog replizieren und keinen Leader w\u00E4hlen k\u00F6nnen. Leer lassen f\u00FCr den Solr-Standardwert. +component.mir.wizard.solr.numPullReplicas.tooltip = Pull-Replikate: reine Lesereplikate ohne Schreibf\u00E4higkeit. Leer lassen f\u00FCr den Solr-Standardwert. component.mir.wizard.solr.adminUserEnabled = Konfiguriere einen Benutzer f\u00FCr die Solr-Administration component.mir.wizard.solr.admin.username = Benutzername component.mir.wizard.solr.admin.password = Passwort @@ -56,7 +89,7 @@ component.mir.wizard.solr.useTika = Verwende einen externen Tik component.mir.wizard.solr.tikaUrl = Tika-Server URL component.mir.wizard.solr.title = SOLR-Server -component.mir.wizard.solr.url = URL +component.mir.wizard.solr.url = URL(s) (bei SolrCloud kommagetrennt) component.mir.wizard.solr.url.required = Bitte tragen Sie eine g\u00FCltiger SOLR-Server-URL ein! component.mir.wizard.status.false = Fehler component.mir.wizard.status.true = OK diff --git a/mir-wizard/src/main/resources/config/mir-wizard/messages_en.properties b/mir-wizard/src/main/resources/config/mir-wizard/messages_en.properties index 3cc127d5da..41b96c13c9 100644 --- a/mir-wizard/src/main/resources/config/mir-wizard/messages_en.properties +++ b/mir-wizard/src/main/resources/config/mir-wizard/messages_en.properties @@ -40,9 +40,42 @@ component.mir.wizard.smtp.numTries.error = The number of tries must be component.mir.wizard.smtp.password = Password component.mir.wizard.smtp.title = SMTP settings component.mir.wizard.smtp.user = Username -component.mir.wizard.solr.classificationCore = Classification Core -component.mir.wizard.solr.mainCore = Main Core +component.mir.wizard.solr.classificationCore = Classification Core/Collection +component.mir.wizard.solr.mainCore = Main Core/Collection +component.mir.wizard.solr.mode = Connection Mode +component.mir.wizard.solr.mode.standalone = Standalone +component.mir.wizard.solr.mode.cloudUrl = SolrCloud (Solr URL) +component.mir.wizard.solr.mode.cloudZk = SolrCloud (ZooKeeper) +component.mir.wizard.solr.zkUrl = ZooKeeper Host(s) +component.mir.wizard.solr.zkUrl.required = Please enter valid ZooKeeper host(s)! +component.mir.wizard.solr.zkChroot = ZooKeeper Chroot (optional) +component.mir.wizard.solr.url.tooltip = URL of the Solr server. For SolrCloud (Solr URL), provide multiple URLs comma-separated. +component.mir.wizard.solr.zkUrl.tooltip = ZooKeeper hosts and ports, comma-separated (e.g. zk1:2181,zk2:2181). +component.mir.wizard.solr.zkChroot.tooltip = Optional ZooKeeper chroot path where SolrCloud stores its data (e.g. /solr). +component.mir.wizard.solr.mainCore.tooltip = Name of the Solr core for the main index. +component.mir.wizard.solr.classificationCore.tooltip = Name of the Solr core for the classification index. +component.mir.wizard.solr.mainCollection.tooltip = Name of the SolrCloud collection for the main index. +component.mir.wizard.solr.classificationCollection.tooltip = Name of the SolrCloud collection for the classification index. +component.mir.wizard.solr.admin.username.tooltip = Username for administrative Solr requests (e.g. collection creation). +component.mir.wizard.solr.admin.password.tooltip = Password for the Solr administration user. +component.mir.wizard.solr.index.username.tooltip = Username for Solr indexing requests. +component.mir.wizard.solr.index.password.tooltip = Password for the Solr indexing user. +component.mir.wizard.solr.search.username.tooltip = Username for Solr search requests. +component.mir.wizard.solr.search.password.tooltip = Password for the Solr search user. +component.mir.wizard.solr.tikaUrl.tooltip = URL of the Tika server for full-text extraction from documents (e.g. http://tika:9998). component.mir.wizard.solr.createCores = Create cores in SOLR server via SolrCloud API +component.mir.wizard.solr.main.numShards = Number of Shards (Main Collection, optional) +component.mir.wizard.solr.main.numNrtReplicas = NRT Replicas (Main Collection, optional) +component.mir.wizard.solr.main.numTlogReplicas = TLOG Replicas (Main Collection, optional) +component.mir.wizard.solr.main.numPullReplicas = Pull Replicas (Main Collection, optional) +component.mir.wizard.solr.classification.numShards = Number of Shards (Classification Collection, optional) +component.mir.wizard.solr.classification.numNrtReplicas = NRT Replicas (Classification Collection, optional) +component.mir.wizard.solr.classification.numTlogReplicas = TLOG Replicas (Classification Collection, optional) +component.mir.wizard.solr.classification.numPullReplicas = Pull Replicas (Classification Collection, optional) +component.mir.wizard.solr.numShards.tooltip = Number of shards the collection is distributed across. Leave empty for Solr default. +component.mir.wizard.solr.numNrtReplicas.tooltip = Near-Real-Time replicas: active write replicas that can replace the leader. Leave empty for Solr default. +component.mir.wizard.solr.numTlogReplicas.tooltip = Transaction-log replicas: passive replicas that replicate via tlog and cannot be elected leader. Leave empty for Solr default. +component.mir.wizard.solr.numPullReplicas.tooltip = Pull replicas: read-only replicas with no write capability. Leave empty for Solr default. component.mir.wizard.solr.adminUserEnabled = Configure a user for Solr administration component.mir.wizard.solr.admin.username = Username component.mir.wizard.solr.admin.password = Password @@ -56,7 +89,7 @@ component.mir.wizard.solr.useTika = Use an external Tika server component.mir.wizard.solr.tikaUrl = Tika server URL component.mir.wizard.solr.title = SOLR Server -component.mir.wizard.solr.url = URL +component.mir.wizard.solr.url = URL(s) (comma-separated for SolrCloud) component.mir.wizard.solr.url.required = Please input a valid SOLR Server URL! component.mir.wizard.status.false = Error component.mir.wizard.status.true = OK diff --git a/mir-wizard/src/main/resources/config/mir-wizard/mycore.properties b/mir-wizard/src/main/resources/config/mir-wizard/mycore.properties index 1d0624bba7..3b837d2265 100644 --- a/mir-wizard/src/main/resources/config/mir-wizard/mycore.properties +++ b/mir-wizard/src/main/resources/config/mir-wizard/mycore.properties @@ -18,3 +18,8 @@ MCR.ContentTransformer.MyCoReWizard_temp.Stylesheet=xsl/MyCoReWizard.xsl MCR.ContentTransformer.MyCoReWizard_temp2.Stylesheet=xslt/mir-wizard-layout.xsl MCR.ContentTransformer.MyCoReWizard_temp2.TransformerFactoryClass=%SAXON% +MCR.ContentTransformer.wizard.Class=org.mycore.common.content.transformer.MCRTransformerPipe +MCR.ContentTransformer.wizard.Steps=wizard_temp,MyCoReWizard_temp2 + +MCR.ContentTransformer.wizard_temp.TransformerFactoryClass=%XALAN% +MCR.ContentTransformer.wizard_temp.Stylesheet=xsl/wizard.xsl diff --git a/mir-wizard/src/main/resources/xsl/wizard-postprocessor.xsl b/mir-wizard/src/main/resources/xsl/wizard-postprocessor.xsl deleted file mode 100644 index 732837a7eb..0000000000 --- a/mir-wizard/src/main/resources/xsl/wizard-postprocessor.xsl +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/mir-wizard/src/main/resources/xsl/wizard.xsl b/mir-wizard/src/main/resources/xsl/wizard.xsl index f4e78cb5ca..f4e55e820d 100644 --- a/mir-wizard/src/main/resources/xsl/wizard.xsl +++ b/mir-wizard/src/main/resources/xsl/wizard.xsl @@ -4,19 +4,22 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="mcri18n"> - + + - - - - - - + + + + + + + + diff --git a/mir-wizard/src/main/resources/xslt/wizard-postprocessor.xsl b/mir-wizard/src/main/resources/xslt/wizard-postprocessor.xsl new file mode 100644 index 0000000000..e069235662 --- /dev/null +++ b/mir-wizard/src/main/resources/xslt/wizard-postprocessor.xsl @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + standalone + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.mycore.solr.standalone.core.MCRConfigurableSolrCore + org.mycore.solr.standalone.core.MCRConfigurableSolrCore + + + org.mycore.solr.cloud.collection.MCRConfigurableSolrCloudCollection + org.mycore.solr.cloud.collection.MCRConfigurableSolrCloudCollection + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +