Skip to content

Commit

Permalink
Merge tag 'vufind-9.0.3' of github.com:vufind-org/vufind-browse-handl…
Browse files Browse the repository at this point in the history
…er into tuefind90
  • Loading branch information
mtrojan-ub committed Oct 4, 2023
2 parents c96f184 + cec8dd7 commit 039ff62
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ jobs:
with:
php-version: '8.0'
extensions: intl, xsl
tools: composer:2.0.13
tools: composer:2

- name: Setup Java
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: ${{ matrix.java-version }}

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up VuFind environment
run: |
echo VUFIND_HOME=~/vufind >> $GITHUB_ENV
echo VUFIND_LOCAL_DIR=$VUFIND_HOME/local >> $GITHUB_ENV
- name: Cache VuFind data
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ~/vufind
key: "vufind-${{ github.sha }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.net.URL;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
Expand All @@ -21,6 +22,7 @@
import org.apache.solr.handler.RequestHandlerBase;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.search.SolrIndexSearcher;
import org.apache.solr.security.AuthorizationContext;
import org.apache.solr.util.RefCounted;
import org.vufind.util.NormalizerFactory;

Expand Down Expand Up @@ -153,6 +155,15 @@ public void handleRequestBody(org.apache.solr.request.SolrQueryRequest req,
CoreDescriptor cd = core.getCoreDescriptor();
CoreContainer cc = core.getCoreContainer();
SolrCore authCore = cc.getCore(authCoreName);
if (authCore == null) {
Collection<String> names = cc.getAllCoreNames();
String name = names.stream().filter(n -> n.startsWith(authCoreName)).findFirst().orElse(null);
if (name == null)
throw new Exception("Could not find a core with a name starting with " + authCoreName);
authCore = cc.getCore(name);
if (authCore == null)
throw new Exception("Could not get the core with the name " + name);
}
//Must decrement RefCounted when finished!
RefCounted<SolrIndexSearcher> authSearcherRef = authCore.getSearcher();

Expand Down Expand Up @@ -230,4 +241,8 @@ public URL[] getDocs()
{
return null;
}

public Name getPermissionName(AuthorizationContext request) {
return Name.ALL;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public BrowseRequest(METHOD m, String path)
// TODO Auto-generated constructor stub
}

public String getRequestType()
{
return "VuFindBrowseRequest";
}

@Override
public SolrParams getParams()
{
Expand Down
29 changes: 22 additions & 7 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<property name="vufind.dir" value="/usr/local/vufind"/>
<property name="absolute.vufind.dir" location="${vufind.dir}"/>
<property name="solr.solr.home" value="${absolute.vufind.dir}/solr/vufind"/>
<!-- The solr.install.dir property was added to work around an issue in the Solr 9.1 test suite;
it can probably be safely removed once VuFind upgrades to Solr 9.2 or higher. -->
<property name="solr.install.dir" value="${absolute.vufind.dir}/solr/vendor"/>
<property name="java.compat.version" value="1.8"/>
<property name="ant.build.javac.source" value="1.8"/>
<property name="ant.build.javac.target" value="1.8"/>
Expand All @@ -22,15 +25,26 @@
<fileset dir="libs">
<include name="**/*.jar"/>
</fileset>
<fileset dir="tests/lib">
<include name="**/*.jar"/>
</fileset>
<!-- For Solr 8 and below: -->
<fileset erroronmissingdir="false" dir="${absolute.vufind.dir}/solr/vendor/contrib/analysis-extras">
<include name="**/*.jar"/>
</fileset>
<!-- For Solr 9 and above: -->
<fileset erroronmissingdir="false" dir="${absolute.vufind.dir}/solr/vendor/modules/analysis-extras">
<include name="**/*.jar"/>
</fileset>
<fileset erroronmissingdir="false" dir="${absolute.vufind.dir}/solr/vendor/dist">
<include name="**/*.jar"/>
</fileset>
<fileset erroronmissingdir="false" dir="${absolute.vufind.dir}/solr/vendor/server/solr-webapp/webapp/WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
<fileset erroronmissingdir="false" dir="${absolute.vufind.dir}/import/lib">
<include name="**/*.jar"/>
</fileset>
<!-- Needed for building tests that invoke Solr -->
<fileset erroronmissingdir="false" dir="${absolute.vufind.dir}/solr/vendor/server/lib">
<include name="**/*.jar"/>
Expand Down Expand Up @@ -181,8 +195,8 @@
</exec>
</target>

<!-- =================================
target: test-main
<!-- =================================
target: test-main
================================= -->
<target name="test-main"
description="Run tests, assumes build is current and test cores are set up">
Expand All @@ -194,9 +208,10 @@
<compilerarg line="-encoding UTF-8" />
</javac>

<junit showoutput="yes" fork="true">
<junit showoutput="yes" fork="true" haltonfailure="on">
<sysproperty key="absolute.vufind.dir" value="${absolute.vufind.dir}" />
<sysproperty key="solr.solr.home" value="${solr.solr.home}" />
<sysproperty key="solr.install.dir" value="${solr.install.dir}" />
<jvmarg value="-Dfile.encoding=UTF-8" />
<classpath>
<pathelement location="tests/lib/junit-4.11.jar"/>
Expand Down Expand Up @@ -227,16 +242,16 @@

</target>

<!-- =================================
target: test
<!-- =================================
target: test
================================= -->
<target name="test" depends="build, setup-test-cores"
description="Run tests after build and setting up the test cores">
<antcall target="test-main"/>
</target>

<!-- =================================
target: test-skip-setup
<!-- =================================
target: test-skip-setup
================================= -->
<target name="test-skip-setup" depends="build"
description="Run tests after build, assumes test cores are already set up">
Expand Down
2 changes: 1 addition & 1 deletion common/java/org/vufind/util/DeweyCallNormalizer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.vufind.util;

import org.solrmarc.callnum.DeweyCallNumber;
import org.marc4j.callnum.DeweyCallNumber;
import java.util.logging.Logger;

public class DeweyCallNormalizer implements Normalizer
Expand Down
2 changes: 1 addition & 1 deletion common/java/org/vufind/util/LCCallNormalizer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.vufind.util;

import org.solrmarc.callnum.LCCallNumber;
import org.marc4j.callnum.LCCallNumber;
import java.util.logging.Logger;

public class LCCallNormalizer implements Normalizer
Expand Down
Binary file removed libs/MarcImporter.jar
Binary file not shown.

0 comments on commit 039ff62

Please sign in to comment.