Skip to content

Webservice Configuration

anja edited this page Dec 19, 2016 · 3 revisions

Configure Roles

⚠️
Missing:
How do the role configurations relate to each other? (All roles inherit from default. They extent default (NOT overwrite). )
Can you chain roles? How?
Example with Includes? Why is there an empty role "anonymus"?

The config files are located in src/main/resources/config.

You have to specify a default behavior and zero or more special cases, called roles.

A minimum xml for this project looks like this:

minimum XML config file

<?xml version= "1.0" encoding='UTF-8'?>
<!DOCTYPE document SYSTEM "config.dtd">
<document>
    <default>
    </default>
</document>

Every default or role element can contain a fields element. This fields element have to contain at least one field element, which themselves have to contain a name and a value element.

The structure of an xml can then look like this:

structure of an xml config file

<?xml version= "1.0" encoding='UTF-8'?>
<!DOCTYPE document SYSTEM "config.dtd">
<document>
    <default>
        <fields>
            <field>
                <name></name>
                <value></value>
            </field>
            <field>
                <name></name>
                <value></value>
            </field>
        </fields>
    </default>
    <role id="example">
        <fields>
            <field>
                <name></name>
                <value></value>
            </field>
        </fields>
    </role>
</document>

The possible values for name and value fields will be presented in the following table.

In this context the list elements are separated by an comma.

Name meaning value

DEFAULT_QUERY

the solr query, if no is provided by the user

a solr query. more info

DEFAULT_FQ

the solr filterquery, if this is not providet by the user

a list of solrfilterqueries. more info

DEFAULT_FIELDS

the fields the user will see, if this is not provided by the user

a list of fields in our database. more info

DEFAULT_HL_FIELDS

the fields to highlight, if this is not provided by the user

a list of fields in your database. more info

DEFAULT_SORT_FIELD

the field to sort on, if this is not provided by the user

a single fields in your database. more info

DEFAULT_SORT_ORDER

the sort order, if this is not provided by the user

"asc" for ascending order or "desc" for descending order

DEFAULT_FACET_LIMIT

the facet limit, if this is not provided by the user

a number. more info

APPEND_QUERY

the documents to find have to match this query and the query provided by the user

a solr query. more info

ALLOWED_FIELDS

the solr fields which are returned in the response

a list of fields in your database. more info

ALLOWED_FACET_FIELDS

the solr fields which can be used to build facet filter

a list of fields in your database. more info

Example config.xml

Short config presentation

<?xml version= "1.0" encoding='UTF-8'?>
<!DOCTYPE document SYSTEM "config.dtd">
<document>
    <default>
        <fields>
            <field>
                <name>DEFAULT_QUERY</name>
                <value>*:*</value>
            </field>
            <field>
                <name>DEFAULT_FIELDS</name>
                <value>id</value>
            </field>
        </fields>
    </default>
    <role id="example">
        <fields>
            <field>
                <name>ALLOWED_FIELDS</name>
                <value>this, is,a, list , id</value>
            </field>
        </fields>
    </role>
</document>

Configure Export

BibTeX

The bibtex.xml spcifies which fields from the solr index are mapped to which bibtex type (e.g. artice, book, etc. for all types see http://www.andy-roberts.net/res/writing/latex/bibentries.pdf) or tag (e.g. title, author, etc. For all tag see also the previous link. There the tags are called fields.)

<?xml version= "1.0" encoding='UTF-8'?>
<!DOCTYPE bibtex SYSTEM "bibtex.dtd">
<bibtex>
    <types>
        <type>
            <name>${bibtex type}</name>
            <value>${equivalent to type from index}</value>
        </type>
    </types>
    <tags>
        <tag>
            <name>${bibtex tag}</name>
            <value>${equivalent to tag from index}</value>
        </tag>
    </tags>
</bibtex>
⚠️
Please note: The BibTeX exporter is unable to handle arrays.