Skip to content

Commit

Permalink
Rename CollectionRewrite to AvailabilityRewrite
Browse files Browse the repository at this point in the history
Change-Id: If6de4f6bfd8234125f78fc5aedd6746e16be279e
  • Loading branch information
margaretha committed Dec 20, 2024
1 parent 82c75c2 commit c105e2f
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 30 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Use operation:override in query reference rewrite (#783)
- Fixed availability regex for all access in the config (important to correctly
determine required access of stored VC)
- Rename CollectionRewrite to AvailabilityRewrite


# version 0.75
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import de.ids_mannheim.korap.utils.KoralCollectionQueryBuilder;

/**
* CollectionRewrite determines which availability field values are
* AvailabilityRewrite determines which availability field values are
* possible for a user with respect to login and location of access.
*
* <br/><br/>
Expand All @@ -43,13 +43,13 @@
* @author margaretha
* @see CorpusAccess
*/
public class CollectionRewrite implements RewriteTask.RewriteQuery {
public class AvailabilityRewrite implements RewriteTask.RewriteQuery {

public static Logger jlog = LogManager.getLogger(CollectionRewrite.class);
public static Logger jlog = LogManager.getLogger(AvailabilityRewrite.class);

public static boolean DEBUG = false;

public CollectionRewrite () {
public AvailabilityRewrite () {
super();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @author hanl
* @date 03/09/2015
*/
public class CollectionRewriteTest extends SpringJerseyTest {
public class AvailabilityRewriteTest extends SpringJerseyTest {

@Autowired
public KustvaktConfiguration config;
Expand Down Expand Up @@ -172,7 +172,7 @@ public void testCollectionRemoveAndMoveOneFromGroupUpNoErrors ()
public void testPublicCollectionRewriteEmptyAdd ()
throws KustvaktException {
RewriteHandler handler = new RewriteHandler(config);
handler.add(CollectionRewrite.class);
handler.add(AvailabilityRewrite.class);
QuerySerializer s = new QuerySerializer();
s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
String org = s.toJSON();
Expand All @@ -192,7 +192,7 @@ public void testPublicCollectionRewriteEmptyAdd ()
public void testPublicCollectionRewriteNonEmptyAdd ()
throws KustvaktException {
RewriteHandler handler = new RewriteHandler(config);
handler.add(CollectionRewrite.class);
handler.add(AvailabilityRewrite.class);
QuerySerializer s = new QuerySerializer();
s.setQuery(TestVariables.SIMPLE_ADD_QUERY, "poliqarp");
s.setCollection("(docSigle=WPD_AAA & textClass=wissenschaft)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import de.ids_mannheim.korap.config.SpringJerseyTest;
import de.ids_mannheim.korap.config.TestVariables;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import de.ids_mannheim.korap.rewrite.CollectionRewrite;
import de.ids_mannheim.korap.rewrite.AvailabilityRewrite;
import de.ids_mannheim.korap.rewrite.RewriteHandler;
import de.ids_mannheim.korap.utils.JsonUtils;

Expand All @@ -22,7 +22,7 @@ public class ResultRewriteTest extends SpringJerseyTest {

@Test
public void testPostRewriteNothingToDo () throws KustvaktException {
assertEquals(true, ha.add(CollectionRewrite.class),
assertEquals(true, ha.add(AvailabilityRewrite.class),
"Handler could not be added to rewrite handler instance!");
String v = ha.processResult(TestVariables.RESULT, null);
assertEquals(JsonUtils.readTree(TestVariables.RESULT),
Expand Down
12 changes: 3 additions & 9 deletions src/test/resources/test-config-dnb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -213,23 +213,17 @@
<!-- Rewrite -->
<bean id="foundryRewrite"
class="de.ids_mannheim.korap.rewrite.FoundryRewrite" />
<bean id="collectionRewrite"
class="de.ids_mannheim.korap.rewrite.CollectionRewrite" />
<bean id="collectionCleanRewrite"
class="de.ids_mannheim.korap.rewrite.CollectionCleanRewrite" />
<bean id="availabilityRewrite"
class="de.ids_mannheim.korap.rewrite.AvailabilityRewrite" />
<bean id="virtualCorpusRewrite"
class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite" />
<bean id="collectionConstraint"
class="de.ids_mannheim.korap.rewrite.CollectionConstraint" />
<bean id="queryReferenceRewrite"
class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite" />

<util:list id="rewriteTasks"
value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
<!-- <ref bean="collectionConstraint" /> <ref bean="collectionCleanRewrite"
/> -->
<ref bean="foundryRewrite" />
<ref bean="collectionRewrite" />
<ref bean="availabilityRewrite" />
<ref bean="virtualCorpusRewrite" />
<ref bean="queryReferenceRewrite" />
</util:list>
Expand Down
9 changes: 0 additions & 9 deletions src/test/resources/test-config-icc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -217,23 +217,14 @@
<!-- Rewrite -->
<bean id="foundryRewrite"
class="de.ids_mannheim.korap.rewrite.FoundryRewrite" />
<bean id="collectionRewrite"
class="de.ids_mannheim.korap.rewrite.CollectionRewrite" />
<bean id="collectionCleanRewrite"
class="de.ids_mannheim.korap.rewrite.CollectionCleanRewrite" />
<bean id="virtualCorpusRewrite"
class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite" />
<bean id="collectionConstraint"
class="de.ids_mannheim.korap.rewrite.CollectionConstraint" />
<bean id="queryReferenceRewrite"
class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite" />

<util:list id="rewriteTasks"
value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
<!-- <ref bean="collectionConstraint" /> <ref bean="collectionCleanRewrite"
/> -->
<ref bean="foundryRewrite" />
<!-- <ref bean="collectionRewrite" /> -->
<ref bean="virtualCorpusRewrite" />
<ref bean="queryReferenceRewrite" />
</util:list>
Expand Down
6 changes: 3 additions & 3 deletions src/test/resources/test-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@
<!-- Rewrite -->
<bean id="foundryRewrite"
class="de.ids_mannheim.korap.rewrite.FoundryRewrite" />
<bean id="collectionRewrite"
class="de.ids_mannheim.korap.rewrite.CollectionRewrite" />
<bean id="availabilityRewrite"
class="de.ids_mannheim.korap.rewrite.AvailabilityRewrite" />
<bean id="virtualCorpusRewrite"
class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite" />
<bean id="queryReferenceRewrite"
Expand All @@ -203,7 +203,7 @@
<util:list id="rewriteTasks"
value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
<ref bean="foundryRewrite" />
<ref bean="collectionRewrite" />
<ref bean="availabilityRewrite" />
<ref bean="virtualCorpusRewrite" />
<ref bean="queryReferenceRewrite" />
<ref bean="queryContextRewrite" />
Expand Down

0 comments on commit c105e2f

Please sign in to comment.