Skip to content

Commit

Permalink
[feature] Update for TEI Completer 1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
adamretter committed Apr 3, 2024
1 parent 39d5dd9 commit ed59a53
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<dependency>
<groupId>org.humanistika.oxygen</groupId>
<artifactId>tei-completer</artifactId>
<version>1.2.1-SNAPSHOT</version>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.oxygenxml</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public List<CIValue> filterAttributeValues(List<CIValue> list, final WhatPossibl

@SuppressWarnings("unchecked")
@Override
protected Configuration getConfiguration() {
public Configuration getConfiguration() {
if(configuration == null) {
synchronized(this) {
if(configuration == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.humanistika.oxygen.tei.completer.configuration.beans.Dependent;
import org.humanistika.oxygen.tei.completer.configuration.beans.RequestInfo;
import org.humanistika.oxygen.tei.completer.configuration.beans.ResponseAction;
import org.humanistika.oxygen.tei.completer.configuration.beans.Selection;

import javax.annotation.Nullable;

import java.util.Map;
Expand All @@ -34,7 +36,7 @@ public class AutoComplete extends org.humanistika.oxygen.tei.completer.configura
@Nullable
private final UploadInfo uploadInfo;

public AutoComplete(final Map<String, String> namespaceBindings, final String context, final String attribute, final Dependent dependent, final String selection, final RequestInfo requestInfo, final ResponseAction responseAction, @Nullable final UploadInfo uploadInfo) {
public AutoComplete(final Map<String, String> namespaceBindings, final String context, final String attribute, final Dependent dependent, final Selection selection, final RequestInfo requestInfo, final ResponseAction responseAction, @Nullable final UploadInfo uploadInfo) {
super(namespaceBindings, context, attribute, dependent, selection, requestInfo, responseAction);
this.uploadInfo = uploadInfo;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
import org.humanistika.oxygen.tei.authorizer.configuration.beans.BodyInfo;
import org.humanistika.oxygen.tei.authorizer.configuration.beans.UploadInfo;
import org.humanistika.oxygen.tei.authorizer.configuration.beans.UserFieldInfo;

import javax.annotation.Nullable;

import org.humanistika.oxygen.tei.completer.configuration.beans.Authentication;
import org.humanistika.oxygen.tei.completer.configuration.beans.Dependent;
import org.humanistika.oxygen.tei.completer.configuration.beans.RequestInfo;
import org.humanistika.oxygen.tei.completer.configuration.beans.ResponseAction;
import javax.annotation.Nullable;
import org.humanistika.oxygen.tei.completer.configuration.beans.Selection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -97,8 +100,19 @@ private List<AutoComplete> expandConfig(final Config config) {
dependent = null;
} else {
dependent = new Dependent(
autoComplete.getDependent().getDefault(),
autoComplete.getDependent().getValue()
autoComplete.getDependent().getDefault(),
autoComplete.getDependent().getValue(),
autoComplete.getDependent().getLabel()
);
}

final Selection selection;
if(autoComplete.getSelection() == null) {
selection = null;
} else {
selection = new Selection(
autoComplete.getSelection().getValue(),
autoComplete.getSelection().getLabel()
);
}

Expand Down Expand Up @@ -167,7 +181,7 @@ private List<AutoComplete> expandConfig(final Config config) {
autoComplete.getContext(),
autoComplete.getAttribute(),
dependent,
autoComplete.getSelection(),
selection,
requestInfo,
responseAction,
uploadInfo
Expand Down
18 changes: 17 additions & 1 deletion src/main/resources/config.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,30 @@
<xs:documentation>An optional default value to be used for the dependency if the attribute value is empty</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="label" type="xs:string" default="Dependent">
<xs:annotation>
<xs:documentation>A human-readable label for the dependent, this is used in the GUI.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="selection" type="ta:xpathRelativePath">
<xs:element name="selection">
<xs:annotation>
<xs:documentation>The XPath (relative to the context) to use for the selection. e.g. text()</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="ta:xpathRelativePath">
<xs:attribute name="label" type="xs:string" default="Selection">
<xs:annotation>
<xs:documentation>A human-readable label for the selection, this is used in the GUI.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="request">
<xs:annotation>
Expand Down

0 comments on commit ed59a53

Please sign in to comment.