Changeset 6412


Ignore:
Timestamp:
08/04/15 11:46:13 (9 years ago)
Author:
davor.ostojic@oeaw.ac.at
Message:

merged with trunk
#746

Location:
vlo/branches/vlo-3.3-oeaw
Files:
2 added
26 edited
7 copied

Legend:

Unmodified
Added
Removed
  • vlo/branches/vlo-3.3-oeaw

  • vlo/branches/vlo-3.3-oeaw/CHANGES.txt

    r6239 r6412  
    11Bug Fixes and Features
     2
     3VLO 3.3 (...)
     4
     5* Ranking based on relevance with boosts for matches in certain fields and on
     6basis of record properties such as hierarchy level and presence of name,
     7description and resource references
     8        <https://trac.clarin.eu/ticket/750>, <https://trac.clarin.eu/ticket/761>
     9* Support for advanced search via query syntax, with instructions accessible
     10via web application
     11        <https://trac.clarin.eu/ticket/762>, <https://trac.clarin.eu/ticket/770>
     12* Metadata hierarchies are processed on import and interactively presented
     13in the web application
     14        <https://trac.clarin.eu/ticket/382>
     15* Further exlusion of actor languages in the 'language' facet
     16        <https://trac.clarin.eu/ticket/246>
     17* Hiding of language code prefixes in multi-lingual description fields
     18        <https://trac.clarin.eu/ticket/778>
     19* Addition of importer option to only import specific data roots
     20        <https://trac.clarin.eu/ticket/768>
     21
     22VLO 3.2.1 (July 2015)
     23* Graceful handling of requests for all values of nonexistent facets
     24* Included the VLO iframe page for the CLARIN-D homepage
     25* Fixed a potential file descriptor leak in the VLO importer
     26* Fixed appearence of 'jsessionid' parameter in the URL
    227
    328VLO 3.2 (June 2015)
  • vlo/branches/vlo-3.3-oeaw/DEPLOY-README.txt

    r6298 r6412  
     1VLO DEPLOY-README.txt
     2
    13The instructions below describe the installation of the applications necessary
    24for browsing: the VLO web application, the Solr server, and the meta data
    35importer.
    46
     7$VLO            – installation folder for VLO e.g.: /opt/vlo/
     8$CATALINA_HOME  – tomcat’s installation folder
     9$SOLR_DATA      - SOLR location for storing indexed data
     10xxx             - VLO version number
     11
    5121. The archive
    613
    7    The VLO importer and web application are contained in an
    8    archive. In the case of version 3.0, the archive is named
     14   The VLO importer and web application are contained in an archive:
    915
    10         vlo-3.0-Distribution.tar.gz
     16        vlo-xxx-Distribution.tar.gz
    1117
    1218   Deploying the VLO application means:
    1319   - unpacking the archive in a suitable location
    1420   - unpacking the war files contained in the archive
    15    - adapt the application's context files
    16    and
    17    - adapt the VloConfig.xml main configuration file.
     21   - adapt the application's context files and
     22   - adapt the VloConfig.xml main configuration file and/or the dataroot config
     23     included in that file
    1824   - optionally executing upgrade steps described in the UPGRADE file
    19 
     25   
    20262. Archive unpacking
    2127
    22    Unpack the archive, for example
     28        » service tomcat6 stop (or $CATALINA_HOME/bin/shutdown.sh if tomcat is
     29          not installed as a service)
     30        » mkdir $VLO
     31        » tar -C $VLO --strip-components=1 -zxvf vlo-xxx-Distribution.tar.gz
     32       
     33        In the tree starting in $VLO, the configuration of the application is
     34        stored under subfolder config.
    2335
    24          vlo-3.0-Distribution.tar.gz
     363. Solr server & web-app installation
    2537
    26    in a temporary directory: 'temp'. Next, stop the Tomcat server, e.g.:
     38        » unzip -d $CATALINA_HOME/webapps/vlo  $VLO/war/vlo-web-app-xxx.war
     39        » unzip -d $CATALINA_HOME/webapps/vlo-solr $VLO/war/vlo-solr-xxx.war
    2740
    28      /etc/init.d/tomcat6 stop
     41        Modify (if needed):
     42                $CATALINA_HOME/webapps/vlo/META-INF/context.xml
     43                - parameter "eu.carlin.cmdi.vlo.config.location"
     44                    should point to VloConfig.xml,
     45                     e.g. value="$VLO/config/VloConfig.xml"
     46                - parameter "eu.carlin.cmdi.vlo.solr.serverUrl"
     47                    is for custom SOLR server, leave commented for the default
     48               
     49                $CATALINA_HOME/webapps/vlo-solr/META-INF/context.xml
     50                - parameter "solr/home"
     51                    should point to the folder with config files for SOLR,
     52                    e.g. value="$VLO/config/solr"/>
     53               
     54        and copy them to  $CATALINA_HOME/conf/Catalina/localhost/ as vlo.xml and
     55        vlo-solr.xml respectively.
     56                » cp $CATALINA_HOME /webapps/vlo/META-INF/context.xml\
     57                        $CATALINA_HOME/conf/Catalina/localhost/vlo.xml
     58                » cp $CATALINA_HOME /webapps/vlo-solr/META-INF/context.xml\
     59                        $CATALINA_HOME/conf/Catalina/localhost/vlo-solr.xml
     60               
     61        Add following line to the $CATALINA_HOME/bin/setenv.sh:
     62                » echo 'export JAVA_OPTS="$JAVA_OPTS -Dsolr.data.dir=$SOLR_DATA"'\
     63                        >> $CATALINA_HOME/bin/setenv.sh
     64               
     65        Optional:
     66               
     67                Modify log4j settings in:
     68                - $CATALINA_HOME/webapps/vlo/WEB-INF/classes/log4j.properties
     69                - $CATALINA_HOME/webapps/vlo-solr/WEB-INF/classes/log4j.properties
     70               
     71                Wicket runs in development mode by default, to change it add
     72                following parameter to the JAVA_OPTS in
     73                $CATALINA_HOME/bin/setenv.sh:
     74                        -Dwicket.configuration=deployment
     75                or set a context parameter 'configuration' to the value
     76                'deployment' in the application's context fragment.
     77               
     784. Importer configuration
     79       
     80        Modify DataRoot for importer directly in $VLO/config/VloConfig.xml or in
     81        the file that is included into that file via XInclude
    2982
    30    After the server has stopped, copy the contents of the vlo_parent-2.13
    31    directory just created to a permanent directory, 'vlo', for example. In the
    32    tree starting in vlo, the configuration of the application is stored. Also,
    33    from the
     83                <originName>MPI self harvest</originName>
     84                        <rootFile>path to the metada root folder</rootFile>           
     85                        <prefix>http://m12404423/vlomd/</prefix>
     86                        <tostrip>/var/www/vlomd/</tostrip>
     87                        <deleteFirst>false</deleteFirst>
     88                </DataRoot>
     89       
     90        A dataRoot element describes the meta data files. The toStrip part of
     91        the description is left out of the rootFile part to create a http link
     92        to the metadata; the links starts with the prefix.
     93       
     94       
     955. Importing data
     96       
     97        importer can be found in $VLO/bin/ folder
    3498
    35         vlo/bin
    36    
    37    directory, you can run the importer application. Since this application
    38    relies on the Solr server, we first need to install the Solr web application.
     99        Before starting data import, first start the Tomcat server:
    39100
    40    Recursively assign ownership of the entire unpacked distribution to the appropriate
    41    user (i.e. 'vlouser' on catalog.clarin.eu).
     101        » service tomcat6 start
    42102
    43 3. Solr server installation
     103        (or $CATALINA_HOME/bin/startup.sh if tomcat is not installed as a
     104        service)
     105       
     106        run importer:
    44107
    45    The VLO importer and web application use Solr as their database
    46    server. To install this server, assuming that the Tomcat server
    47    has not started yet, copy the Solr server web application archive
    48    to the Tomcat server web application directory. This could for
    49    example be
    50 
    51         /var/lib/tomcat6/webapps
    52 
    53    Step into this directory, lets call it 'apps',
    54 
    55         cd apps
    56         cp temp/vlo-3.0/war/vlo-solr-3.0.war .
    57 
    58    If it does not exist, create the vlo_solr directory, and unpack the web
    59    application archive in it:
    60 
    61         cd vlo_solr
    62         unzip ../vlo-solr-3.0.war 
    63 
    64    After unzipping, remove the vlo-solr-3.0.war file. Next, if necessary,
    65    modify the solr/home parameter in the
    66  
    67         apps/META-INF/context.xml
    68 
    69    file to the path where the solr server finds its configuration and stores
    70    its data:
    71 
    72         vlo/config/solr
    73 
    74    Solr needs a location to store its index data. This needs to be configured
    75    through a Java system property 'solr.data.dir'. Configure this in your
    76    Tomcat instance, for example by adding the following to
    77    ${catalina.home}/bin/setenv.sh:
    78    
    79     export JAVA_OPTS="$JAVA_OPTS -Dsolr.data.dir=/var/vlo/solr/data"
    80 
    81    The directory does not have to exist, but its parent does and the Tomcat
    82    user needs write access in that location.
    83    
    84    Copy the new context.xml file to the Tomcat configuration:
    85 
    86         cp apps/META-INF/context.xml \
    87                 $CATALINA_HOME/conf/Catalina/localhost/vlo_solr.xml
    88 
    89    If you would like logging to be configured different from the type of
    90    logging packaged, please modify
    91 
    92         apps/WEB-INF/classes/log4j.properties
    93    
    94    If necessary, change the ownership of the files in the tree starting in
    95 
    96         vlo/config/solr
    97 
    98    to that of the Tomcat user. This will enable the Solr server can store data
    99    in it. Now the Solr server has been installed, the importer and web
    100    application could use it. Next we will install the VLO web application.
    101 
    102 4. Web application installation
    103 
    104    Similar to the Solr archive, unpack
    105 
    106         temp/vlo-3.0/war/vlo-web-app-3.0.war in
    107    
    108    the 
    109 
    110         apps/vlo
    111 
    112    directory.
    113 
    114    Because the packaged configuration is suitable to very specific (development)
    115    circumstances only, in most cases it does fit the production environment. You
    116    can specify an alternative, external configuration file, preferably the same
    117    file as the one used by the importer (see 5). Please modify
    118 
    119         apps/META-INF/context.xml
    120 
    121    by adding a reference to an external configuration file. By modifying this
    122    file, you can adapt the VLO configuration to your needs. You might, for
    123    example, need to assign another value to the solrUrl parameter also. This
    124    parameter is used to let the VLO web application know where it can reach the
    125    Solr server.
    126 
    127    Instead of changing the value of the solrUrl parameter in the external
    128    configuration file, you could also supply an alternative value by adding
    129    the parameter to
    130 
    131         apps/META-INF/context.xml
    132 
    133    directly. The comments in this file will tell you how to add the parameter.
    134 
    135    Like in the case of the Solr server, copy the apps/META-INF/context.xml
    136    context file to:
    137 
    138         /var/lib/tomcat6/conf/Catalina/localhost/vlo.xml
    139 
    140    or to another, comparable path.
    141 
    142    If you like, you can change the web application's way of logging. This time,
    143    modifications should be applied to:
    144 
    145         apps/WEB-INF/classes/log4j.properties
    146        
    147    Wicket runs in development mode by default, and depending on the environment
    148    you are deploying to this may be undesirable. To make sure it runs in
    149    production ('deployment') mode, set the following JVM option in the
    150    Tomcat JVM:
    151        
    152         -Dwicket.configuration=deployment
    153    
    154    OR set a context parameter 'configuration' to the value 'deployment' in the
    155    application's context fragment.
    156 
    157    Now the web application has been installed and configured, we only need to
    158    have a look at the VLO importer's configuration.
    159 
    160 5. Importer configuration
    161 
    162    As mentioned in the description of the web application installation, a
    163    typical setup needs an external configuration file. For consistency reasons
    164    both the web application and application that imports data into the Solr
    165    data base should use one and the same configuration file. So if, for example,
    166    the web application's configuration is in
    167 
    168         $VLO_CONFIG/VloConfig.xml, use
    169 
    170         ./vlo_solr_importer.sh $VLO_CONFIG/VloConfig.xml
    171 
    172    to run the importer in 'bin'. A default configuration file is supplied as
    173    'config/VloConfig.xml'. The importer script will default to this location
    174    if no location is specified on the command line.
    175 
    176    Most likely, in the configuration file, the dataRoot values need to be
    177    changed. This is what a dataRoot definition could look like:
    178 
    179            <originName>MPI self harvest</originName>
    180                  <rootFile>/var/www/vlomd/self/</rootFile>           
    181                  <prefix>http://m12404423/vlomd/</prefix>
    182                  <tostrip>/var/www/vlomd/</tostrip>
    183                  <deleteFirst>false</deleteFirst>
    184            </DataRoot>
    185 
    186    A dataRoot element describes the meta data files. The toStrip part of the
    187    description is left out of the rootFile part to create a http link to the
    188    meta data; the links starts with the prefix.
    189 
    190    Apart from the dataRoot values, the solrUrl parameter might need to be
    191    changed. Please note that the context path value defined in
    192 
    193         $CATALINA_HOME/conf/Catalina/localhost/vlo_solr.xml
    194 
    195    or in a file equivalent to this one, should be reflected in the value of
    196    this parameter.
    197 
    198    Whenever the definition of the database changes, it is recommended to clear
    199    the database before starting an importer run. To do this, make sure that the
    200    'deletaAllFirst' parameter equals true before the run. After that, the
    201    original value of the parameter could be restored.
    202 
    203 6. Importing data
    204 
    205    Before starting data import, first start the Tomcat server, e.g.:
    206 
    207          /etc/init.d/tomcat6 start
    208 
    209    To be sure the Solr server is working as it should, inspect the Tomcat log
    210    file directory, and in that directory, check the solr.log and vlo.log files.
    211 
    212    Next, you can run the importer by starting the
    213 
    214          ./vlo_solr_importer.sh
    215 
    216    script in the vlo/bin directory. Messages are logged to the a log file.
    217    Because meta data is not static, it is recommended to run the importer a
    218    couple of times a week. Please note that, given the current (04.2014) set of
    219    data, a  run typically takes between two and four hours.
    220    
    221    More information about running the importer can be found in the README.txt
    222    file.
    223    
     108         Â» $VLO/bin/vlo_solr_importer.sh
     109       
     110        (optionally pass the path to custom VloConfig.xml, default is in
     111        $VLO/config)
     112       
     113        The importer logs information in  $VLO/log
     114       
     115        Because meta data is not static, it is recommended to run the importer a
     116        couple of times a week. Please note that, for the tar file with metadata
     117        of 270 MB run approximately takes 2h.
  • vlo/branches/vlo-3.3-oeaw/UPGRADE.txt

    r6295 r6412  
    1515        appropriate user, i.e. 'vlouser' on catalog.clarin.eu)
    1616
    17 - In the 'config' directory, adjust VloConfig.xml as needed (make a backup
    18 first). In particular, make sure that the following instance specific sections
    19 are kept from the current version:
    20         - dataRoots and its children
    21         - solrUrl
    22         - homeUrl
    23         - deleteAllFirst
    24         - maxDaysInSolr
    25 - Make any further version specific adjustments as described in this document
     17- In the 'config' directory, inspect VloConfig.xml and the data roots
     18configuration file that is included into this file by means of XInclude. It is
     19advised to perform a diff between the old and new versions of these files.
     20Depending on configuration preferences, you may want to copy settings from the
     21old configuration to the new one.
    2622
    2723- Stop the Tomcat or at least the VLO web app and Solr applications
     
    3228    ./vlo_solr_importer.sh -c ../config/VloConfig.xml
    3329
     30--------------------------
     31Upgrading from 3.2 to 3.3
     32--------------------------
     33* Take note of the change in VloConfig.xml which moves the data roots definition
     34out of VloConfig.xml by means of XInclude. The configuration file now gets
     35prepared for deployment environments at build time, so it is no longer necessary
     36to copy over old configuration values in all cases.
     37
     38* In the context fragment for the VLO web application, ADD the following
     39attribute to the <Context> root element:
     40
     41   sessionCookiePath="/"
     42
     43and, if set, REMOVE any "crossContext" parameter.
     44 
    3445---------------------------
    3546Upgrading from 3.1 to 3.2
  • vlo/branches/vlo-3.3-oeaw/vlo-commons/pom.xml

    r6365 r6412  
    1313    <name>VLO Commons</name>
    1414    <url>http://maven.apache.org</url>
    15    
     15
    1616    <properties>
    1717        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     18
     19                <!-- default config values -->
     20        <vloconfig.deleteAllFirst>true</vloconfig.deleteAllFirst>
     21        <vloconfig.maxDaysInSolr>0</vloconfig.maxDaysInSolr>
     22        <vloconfig.homeUrl>http://www.clarin.eu/vlo</vloconfig.homeUrl>
     23        <vloconfig.helpUrl>http://www.clarin.eu/vlo</vloconfig.helpUrl>
     24               
    1825        <xml.path>src/main/resources</xml.path>
    1926        <xslt.path>${xml.path}/xslt</xslt.path>
    20         <dest.path>${xml.path}/uniform_maps</dest.path>       
     27        <dest.path>${xml.path}/uniform_maps</dest.path> 
    2128    </properties>
    2229   
    23     <dependencies>
    24         <dependency>
    25             <groupId>javax.servlet</groupId>
    26             <artifactId>servlet-api</artifactId>
    27             <version>2.5</version>
    28             <scope>provided</scope>
    29         </dependency>
    30         <dependency>
    31             <groupId>org.slf4j</groupId>
    32             <artifactId>slf4j-log4j12</artifactId>
    33             <version>${slf4j.version}</version>
    34             <scope>test</scope>
    35         </dependency>
    36        
    37         <dependency>
    38             <groupId>xmlunit</groupId>
    39             <artifactId>xmlunit</artifactId>
    40             <version>1.5</version>
    41             <scope>test</scope>
    42             <type>xml</type>
    43             <classifier>ivy</classifier>
    44         </dependency>
    45     </dependencies>
    46    
    47  
    48    
    4930    <build>
     31                <resources>
     32            <resource>
     33                <directory>src/main/resources</directory>
     34                <filtering>true</filtering>
     35            </resource>
     36        </resources>
     37        <testResources>
     38            <testResource>
     39                <directory>src/test/resources</directory>
     40                <filtering>true</filtering>
     41            </testResource>
     42        </testResources>
    5043    <pluginManagement>
    5144        <plugins>
     
    116109    </pluginManagement>
    117110    </build>
     111       
     112
     113         <!-- Build profiles prepare VloConfig.xml for different deployment enviroments -->
     114    <profiles>
     115        <profile>
     116            <!-- For local testing, default profile -->
     117            <id>local-testing</id>
     118            <activation>
     119                <activeByDefault>true</activeByDefault>
     120            </activation>
     121            <properties>
     122                <vloconfig.solrUrl>http://localhost:8080/vlo-solr/core0/</vloconfig.solrUrl>
     123                <vloconfig.dataRootsFile>dataroots-local.xml</vloconfig.dataRootsFile>
     124            </properties>
     125        </profile>
     126       
     127        <profile>
     128            <!-- For deployment to vlo.clarin.eu -->
     129            <id>production</id>
     130            <properties>
     131                <vloconfig.deleteAllFirst>false</vloconfig.deleteAllFirst>
     132                <vloconfig.maxDaysInSolr>7</vloconfig.maxDaysInSolr>
     133                <vloconfig.solrUrl>http://localhost:8080/solr/core0/</vloconfig.solrUrl>
     134                <vloconfig.homeUrl>http://vlo.clarin.eu</vloconfig.homeUrl>
     135                <vloconfig.dataRootsFile>dataroots-production.xml</vloconfig.dataRootsFile>
     136            </properties>
     137        </profile>
     138       
     139        <profile>
     140            <!-- For deployment to vlo.clarin.eu -->
     141            <id>dev-vm</id>
     142            <properties>
     143                <vloconfig.solrUrl>http://localhost:8080/vlo-solr/core0/</vloconfig.solrUrl>
     144                <vloconfig.dataRootsFile>dataroots-testvm.xml</vloconfig.dataRootsFile>
     145            </properties>
     146        </profile>
     147       
     148        <profile>
     149            <!--  For deployment to beta.vlo.clarin.eu -->
     150            <id>beta</id>
     151            <properties>
     152                <vloconfig.solrUrl><!-- TODO!!! --></vloconfig.solrUrl>
     153                <vloconfig.homeUrl>http://beta.vlo.clarin.eu</vloconfig.homeUrl>
     154                <vloconfig.dataRootsFile>dataroots-production.xml</vloconfig.dataRootsFile>
     155            </properties>
     156        </profile>
     157       
     158        <profile>
     159            <!--  Hephaistos - dev server -->
     160            <id>hephaistos</id>
     161            <properties>
     162                <vloconfig.solrUrl>http://localhost:9080/vlo-solr/core0/</vloconfig.solrUrl>
     163                <vloconfig.homeUrl>http://hephaistos.arz.oeaw.ac.at/vlo</vloconfig.homeUrl>
     164                <vloconfig.dataRootsFile>dataroots-hephaistos.xml</vloconfig.dataRootsFile>
     165            </properties>
     166        </profile>
     167       
     168        <profile>
     169            <!--  Minerva - beta server -->
     170            <id>minerva</id>
     171            <properties>
     172                <vloconfig.solrUrl>http://localhost:9080/vlo-solr/core0/</vloconfig.solrUrl>
     173                <vloconfig.homeUrl>http://minerva.arz.oeaw.ac.at/vlo</vloconfig.homeUrl>
     174                <vloconfig.dataRootsFile>dataroots-minerva.xml</vloconfig.dataRootsFile>
     175            </properties>
     176        </profile>
     177       
     178    </profiles>
     179       
     180
     181        <dependencies>
     182        <dependency>
     183            <groupId>javax.servlet</groupId>
     184            <artifactId>servlet-api</artifactId>
     185            <version>2.5</version>
     186            <scope>provided</scope>
     187        </dependency>
     188        <dependency>
     189            <groupId>org.slf4j</groupId>
     190            <artifactId>slf4j-log4j12</artifactId>
     191            <version>${slf4j.version}</version>
     192            <scope>test</scope>
     193        </dependency>
     194       
     195        <dependency>
     196            <groupId>xmlunit</groupId>
     197            <artifactId>xmlunit</artifactId>
     198            <version>1.5</version>
     199            <scope>test</scope>
     200            <type>xml</type>
     201            <classifier>ivy</classifier>
     202        </dependency>
     203    </dependencies>
    118204</project>
  • vlo/branches/vlo-3.3-oeaw/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/FacetConstants.java

    r6313 r6412  
    8484     * 1 matches the ISO639-3 language code)
    8585     */
    86     public static final String DESCRIPTION_LANGUAGE_PATTERN = "^\\{lang='([a-z]{3})'\\}";
     86    public static final String DESCRIPTION_LANGUAGE_PATTERN = "^\\{lang='([A-z-]+)'\\}";
    8787
    8888    /**
  • vlo/branches/vlo-3.3-oeaw/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/config/AbstractXmlVloConfigFactory.java

    r6203 r6412  
    4242        final InputStream fileStream = getXmlConfigurationInputStream();
    4343        try {
    44             final VloConfig config = marshaller.unmarshal(new StreamSource(fileStream));
     44            final VloConfig config = marshaller.unmarshal(new StreamSource(fileStream, getLocation().toString()));
    4545            config.setConfigLocation(getLocation());
    4646            return config;
     
    5959     */
    6060    protected abstract InputStream getXmlConfigurationInputStream() throws IOException;
    61    
     61
    6262    protected abstract URI getLocation();
    6363
  • vlo/branches/vlo-3.3-oeaw/vlo-commons/src/main/java/eu/clarin/cmdi/vlo/config/VloConfigMarshaller.java

    r4517 r6412  
    2121import javax.xml.bind.Marshaller;
    2222import javax.xml.bind.Unmarshaller;
     23import javax.xml.parsers.ParserConfigurationException;
     24import javax.xml.parsers.SAXParserFactory;
    2325import javax.xml.transform.Result;
    2426import javax.xml.transform.Source;
     27import javax.xml.transform.sax.SAXSource;
    2528import javax.xml.transform.stream.StreamResult;
     29import org.xml.sax.InputSource;
     30import org.xml.sax.SAXException;
     31import org.xml.sax.XMLReader;
    2632
    2733/**
     
    6066     */
    6167    public final VloConfig unmarshal(Source source) throws JAXBException {
    62         Unmarshaller unmarshaller = jc.createUnmarshaller();
    63         return (VloConfig) unmarshaller.unmarshal(source);
     68        final Unmarshaller unmarshaller = jc.createUnmarshaller();
     69       
     70        // custom parser, so that we can make it XInclude aware
     71        final SAXParserFactory spf = SAXParserFactory.newInstance();
     72        spf.setXIncludeAware(true);
     73        spf.setNamespaceAware(true);
     74
     75        try {
     76            final XMLReader xr = spf.newSAXParser().getXMLReader();
     77            // XML transformation 'source' needs to be converted to a SAX 'input source'
     78            final InputSource inputSource = SAXSource.sourceToInputSource(source);
     79            final SAXSource saxSource = new SAXSource(xr, inputSource);
     80
     81            return (VloConfig) unmarshaller.unmarshal(saxSource);
     82        } catch (ParserConfigurationException ex) {
     83            throw new JAXBException(ex);
     84        } catch (SAXException ex) {
     85            throw new JAXBException(ex);
     86        }
    6487    }
    6588
  • vlo/branches/vlo-3.3-oeaw/vlo-commons/src/main/resources/VloConfig.xml

    r6398 r6412  
    11<VloConfig>
     2   
     3    <deleteAllFirst>${vloconfig.deleteAllFirst}</deleteAllFirst>
     4   
     5    <maxDaysInSolr>${vloconfig.maxDaysInSolr}</maxDaysInSolr>
     6   
     7    <solrUrl>${vloconfig.solrUrl}</solrUrl>
     8   
     9    <homeUrl>${vloconfig.homeUrl}</homeUrl>
     10   
     11    <helpUrl>${vloconfig.helpUrl}</helpUrl>
     12   
     13    <xi:include href="${vloconfig.dataRootsFile}" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
    214   
    315    <!-- Sets the maximum number of page instances which will be stored in the application scoped second level cache for faster retrieval -->
     
    719    <sessionCacheSize>10000</sessionCacheSize>
    820   
    9     <deleteAllFirst>true</deleteAllFirst>
    10    
    1121    <maxDocsInList>128</maxDocsInList>
    1222   
     
    1727    <maxFileSize>10000000</maxFileSize>
    1828   
    19     <maxDaysInSolr>0</maxDaysInSolr>
    20    
    2129    <useHandleResolver>false</useHandleResolver>
    2230   
    2331    <printMapping>false</printMapping>
    24    
    25     <dataRoots>
    26         <DataRoot>
    27             <originName>CLARIN Centers</originName>
    28             <rootFile>/data/oai-harvest/results/cmdi/</rootFile>
    29             <prefix>http://catalog.clarin.eu/</prefix>
    30             <tostrip>/data/</tostrip>
    31             <deleteFirst>true</deleteFirst>
    32                 </DataRoot>
    33     </dataRoots>
    34    
    35     <solrUrl>http://localhost:8080/vlo-solr/core0/</solrUrl>
    36    
    37     <homeUrl>http://www.clarin.eu/vlo</homeUrl>
    38    
    39     <helpUrl>http://www.clarin.eu/vlo</helpUrl>
    4032   
    4133    <!-- leave empty to use default packaged definition -->
     
    5648    <licenseAvailabilityMapUrl>/LicenseAvailabilityMap.xml</licenseAvailabilityMapUrl>
    5749   
    58     <resourceClassMapUrl>/resourceTypeMap.xml</resourceClassMapUrl>
    59    
    6050    <!-- resourceAvailabilityMapUrl
    6151        Facet field used to populate collection selector on search page
     
    7262        <facetField>collection</facetField>
    7363        <facetField>resourceClass</facetField>
    74         <facetField>resourceClassOrig</facetField>
    7564        <facetField>continent</facetField>
    7665        <facetField>country</facetField>
     
    8473        <facetField>keywords</facetField>
    8574        <facetField>dataProvider</facetField>
    86                 <facetField>profileName</facetField>
    87                 <facetField>profileId</facetField>
    8875    </facetFields>
    8976       
     
    9885    <!-- Fields shown in expanded search results on the search page -->
    9986    <searchResultFields>
    100         <facetField>resourceClassOrig</facetField>
    10187        <searchResultField>name</searchResultField>
    10288        <searchResultField>country</searchResultField>
     
    10894        <searchResultField>collection</searchResultField>
    10995        <searchResultField>nationalProject</searchResultField>
    110                 <searchResultField>profileName</searchResultField>
    111                 <searchResultField>profileId</searchResultField>
    11296    </searchResultFields>
    11397   
  • vlo/branches/vlo-3.3-oeaw/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/DefaultVloConfigFactoryTest.java

    r6284 r6412  
    44import java.util.Arrays;
    55import java.util.List;
     6import java.util.Properties;
    67import java.util.Set;
    78import static org.hamcrest.CoreMatchers.hasItems;
     
    2021
    2122    private VloConfig config;
     23    private Properties testProps;
    2224
    2325    @Before
    2426    public void setUp() throws Exception {
    2527        config = new DefaultVloConfigFactory().newConfig();
     28        testProps = new Properties();
     29        testProps.load(getClass().getResourceAsStream("/vloconfig.properties"));
    2630    }
    2731
     
    3438    @Test
    3539    public void testGetDataRoots() {
    36 
    37         List<DataRoot> dataRoots = Arrays.asList(
    38                 new DataRoot("CLARIN Centres",
    39                         new File("/lat/apache/htdocs/oai-harvester/clarin/results/cmdi/"),
    40                         "http://catalog.clarin.eu/",
    41                         "/lat/apache/htdocs/", false),
    42                 new DataRoot("Other",
    43                         new File("/lat/apache/htdocs/oai-harvester/others/results/cmdi"),
    44                         "http://catalog.clarin.eu/",
    45                         "/lat/apache/htdocs/", false));
    46 
    47         List<DataRoot> rootsReturned = config.getDataRoots();
    48         assertArrayEquals(dataRoots.toArray(), rootsReturned.toArray());
     40        final List<DataRoot> rootsReturned = config.getDataRoots();
     41
     42        assertNotNull(rootsReturned);
     43        assertTrue("One or more data roots should be defined", rootsReturned.size() > 0);
     44        assertNotNull(rootsReturned.get(0).getOriginName());
     45        assertTrue("Origin name cannot be empty", rootsReturned.get(0).getOriginName().length() > 0);
     46        assertNotNull(rootsReturned.get(0).getPrefix());
     47        assertTrue("Prefix cannot be empty", rootsReturned.get(0).getPrefix().length() > 0);
     48        assertNotNull(rootsReturned.get(0).getRootFile());
     49        assertTrue("Root file cannot be empty", rootsReturned.get(0).getRootFile().getName().length() > 0);
     50        assertNotNull(rootsReturned.get(0).getToStrip());
    4951    }
    5052
     
    272274        System.out.println("deleteAllFirst");
    273275
    274         boolean expResult = true;
     276        boolean expResult = Boolean.valueOf(testProps.getProperty("deleteAllFirst"));
    275277        boolean result = config.getDeleteAllFirst();
    276278
     
    333335        System.out.println("getVloHomeLink");
    334336
    335         String expResult = "http://www.clarin.eu/vlo";
     337        String expResult = testProps.getProperty("homeUrl");
    336338        String result = config.getHomeUrl();
    337339
     
    364366        System.out.println("getHelpUrl");
    365367
    366         String expResult = "http://www.clarin.eu/vlo";
     368        String expResult = testProps.getProperty("helpUrl");
    367369        String result = config.getHelpUrl();
    368370
     
    395397        System.out.println("getSolrUrl");
    396398
    397         String expResult = "http://localhost:8080/vlo-solr/core0/";
     399        String expResult = testProps.getProperty("solrUrl");
    398400        String result = config.getSolrUrl();
    399401
  • vlo/branches/vlo-3.3-oeaw/vlo-commons/src/test/java/eu/clarin/cmdi/vlo/config/VloConfigMarshallerTest.java

    r6087 r6412  
    2121import java.io.StringWriter;
    2222import java.util.Arrays;
     23import java.util.Properties;
    2324import javax.xml.transform.stream.StreamResult;
    2425import javax.xml.transform.stream.StreamSource;
     
    3132
    3233/**
    33  * 
     34 *
    3435 * @author twagoo
    3536 */
    3637public class VloConfigMarshallerTest {
    3738   
     39    private final static String VLO_CONFIG_FILE = "/VloConfig.xml";
    3840    private final static Logger logger = LoggerFactory.getLogger(VloConfigMarshallerTest.class);
    3941    private VloConfigMarshaller instance;
     42    private Properties testProps;
    4043   
    4144    @Before
    4245    public void setUp() throws Exception {
    4346        instance = new VloConfigMarshaller();
     47        testProps = new Properties();
     48        testProps.load(getClass().getResourceAsStream("/vloconfig.properties"));
    4449    }
    4550
     
    4954    @Test
    5055    public void testUnmarshal() throws Exception {
    51         InputStream configFile = getClass().getResourceAsStream("/VloConfig.xml");
    52         VloConfig config = instance.unmarshal(new StreamSource(configFile));
     56        InputStream configFile = getClass().getResourceAsStream(VLO_CONFIG_FILE);
     57        VloConfig config = instance.unmarshal(new StreamSource(configFile, getClass().getResource(VLO_CONFIG_FILE).toString()));
    5358        configFile.close();
    5459       
    5560        assertNotNull(config);
    56         assertEquals("http://localhost:8080/vlo-solr/core0/", config.getSolrUrl());
    57         assertEquals(2, config.getDataRoots().size());
     61        assertEquals(testProps.getProperty("solrUrl"), config.getSolrUrl());
    5862        assertEquals(14, config.getFacetFields().size());
    5963    }
  • vlo/branches/vlo-3.3-oeaw/vlo-distribution/src/main/assembly/installPackageBuilder.xml

    r6367 r6412  
    108108        <!-- config -->
    109109        <fileSet>
    110             <directory>${project.parent.basedir}/vlo-commons/src/main/resources</directory>
     110            <directory>${project.parent.basedir}/vlo-commons/target/classes</directory>
    111111            <includes>
    112112                <include>VloConfig.xml</include>
    113                  <include>facetConcepts.xml</include>
     113                <include>facetConcepts.xml</include>
     114                <include>dataroots*.xml</include>
    114115            </includes>
    115116            <outputDirectory>config</outputDirectory>
  • vlo/branches/vlo-3.3-oeaw/vlo-importer/src/main/java/eu/clarin/cmdi/vlo/importer/CMDIParserVTDXML.java

    r6400 r6412  
    3838    @Override
    3939    public CMDIData process(File file) throws VTDException, IOException {
    40         CMDIData cmdiData = new CMDIData();
    41         VTDGen vg = new VTDGen();
    42         FileInputStream fileInputStream = new FileInputStream(file);
    43         vg.setDoc(IOUtils.toByteArray(fileInputStream));
    44         vg.parse(true);
    45         fileInputStream.close();
    46 
     40        final CMDIData cmdiData = new CMDIData();
     41        final VTDGen vg = new VTDGen();
     42        final FileInputStream fileInputStream = new FileInputStream(file);
     43        try {
     44            vg.setDoc(IOUtils.toByteArray(fileInputStream));
     45            vg.parse(true);
     46        } finally {
     47            fileInputStream.close();
     48        }
     49
     50<<<<<<< .working
    4751        VTDNav nav = vg.getNav();
    4852        String profileId = extractXsd(nav.cloneNav());
    4953        cmdiData.setProfileId(profileId);
    5054        FacetMapping facetMapping = getFacetMapping(profileId);
     55=======
     56        final VTDNav nav = vg.getNav();
     57        final FacetMapping facetMapping = getFacetMapping(nav.cloneNav());
     58>>>>>>> .merge-right.r6411
    5159
    5260        if (facetMapping.getFacets().isEmpty()) {
  • vlo/branches/vlo-3.3-oeaw/vlo-solr/src/main/solr_conf/solr/collection1/conf/solrconfig.xml

    r6350 r6412  
    404404            <!-- TODO: prefer CLARIN records over non-CLARIN? -->
    405405            <!-- TODO: boost records with one or more resources (_resourceRefCount) -->
     406        </str>
     407       
     408        <!-- boost fields with a name -->
     409        <str name="bq">
     410            name:[* TO *]^2
     411        </str>
     412
     413        <!-- boost fields with a description -->
     414        <str name="bq">
     415            description:[* TO *]
     416        </str>
     417       
     418        <!-- boost fields with a resource or part -->
     419        <str name="bq">
     420            _hasPart:[* TO *] OR _resourceRef:[* TO *]
    406421        </str>
    407422       
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/VloWicketApplication.java

    r6350 r6412  
    1414import eu.clarin.cmdi.vlo.wicket.pages.VloBasePage;
    1515import eu.clarin.cmdi.vlo.wicket.provider.FieldValueConverterProvider;
     16import java.io.IOException;
     17import java.io.InputStream;
     18import java.util.Properties;
    1619import javax.inject.Inject;
    1720import org.apache.wicket.Application;
     
    5154
    5255    private ApplicationContext applicationContext;
     56    private String appVersionQualifier;
    5357
    5458    /**
     
    7680        // configure Wicket cache according to parameters set in VloConfig
    7781        setupCache();
     82
     83        // determine version qualifier (e.g. 'beta'), which can be used to visually mark the base page
     84        appVersionQualifier = determineVersionQualifier();
     85        logger.info("Version qualifier: {}", appVersionQualifier);
    7886    }
    7987
     
    127135    /**
    128136     *
     137     * @return a version qualifier, either 'snapshot', 'beta' or null
     138     */
     139    private String determineVersionQualifier() {
     140        try (InputStream applicationPropertiesStream = getClass().getResourceAsStream("/application.properties")) {
     141            Properties applicationProperties = new Properties();
     142            applicationProperties.load(applicationPropertiesStream);
     143            final String version = applicationProperties.getProperty("vlo.version");
     144            if (version != null) {
     145                if (version.endsWith("-SNAPSHOT")) {
     146                    return "snapshot";
     147                } else if (version.contains("beta")) {
     148                    return "beta";
     149                }
     150            }
     151        } catch (IOException ex) {
     152            logger.error("Could not read application properties on init", ex);
     153        }
     154        return null;
     155    }
     156
     157    /**
     158     *
    129159     * @return the active VLO wicket application
    130160     */
     
    173203    }
    174204
     205    public String getAppVersionQualifier() {
     206        return appVersionQualifier;
     207    }
     208
    175209}
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/service/impl/ResourceStringConverterImpl.java

    r4981 r6412  
    2828import java.util.regex.Pattern;
    2929import org.apache.commons.io.FilenameUtils;
     30import org.slf4j.Logger;
     31import org.slf4j.LoggerFactory;
    3032
    3133/**
     
    3436 */
    3537public class ResourceStringConverterImpl implements ResourceStringConverter {
     38
     39    private final static Logger logger = LoggerFactory.getLogger(ResourceStringConverterImpl.class);
    3640
    3741    private final static String SPLIT_PATTERN = Pattern.quote(FacetConstants.FIELD_RESOURCE_SPLIT_CHAR);
     
    8387                return href;
    8488            } else {
    85                 return FilenameUtils.getName(path);
     89                //strip trailing slash, then get name
     90                return FilenameUtils.getName(path.replaceAll("\\/$", ""));
    8691            }
    8792        } catch (URISyntaxException ex) {
     93            logger.debug("Invalid URI, coult not extract file name: {}", href, ex);
    8894            return href;
    8995        }
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/AllFacetValuesPage.java

    r4987 r6412  
    1717package eu.clarin.cmdi.vlo.wicket.pages;
    1818
     19import eu.clarin.cmdi.vlo.config.VloConfig;
    1920import eu.clarin.cmdi.vlo.pojo.FacetSelection;
    2021import eu.clarin.cmdi.vlo.pojo.QueryFacetsSelection;
     22import eu.clarin.cmdi.vlo.service.FacetParameterMapper;
    2123import eu.clarin.cmdi.vlo.service.PageParametersConverter;
    2224import eu.clarin.cmdi.vlo.service.solr.FacetFieldsService;
     
    3335import org.apache.wicket.model.Model;
    3436import org.apache.wicket.model.PropertyModel;
     37import org.apache.wicket.request.http.flow.AbortWithHttpErrorCodeException;
    3538import org.apache.wicket.request.mapper.parameter.PageParameters;
    3639import org.apache.wicket.spring.injection.annot.SpringBean;
     
    4750    @SpringBean
    4851    private FacetFieldsService facetFieldsService;
    49     @SpringBean(name="queryParametersConverter")
     52    @SpringBean(name = "queryParametersConverter")
    5053    private PageParametersConverter<QueryFacetsSelection> parametersConverter;
     54    @SpringBean
     55    private FacetParameterMapper facetParamMapper;
     56    @SpringBean
     57    private VloConfig vloConfig;
    5158
    5259    private final IModel<QueryFacetsSelection> selectionModel;
     
    5663
    5764        this.selectionModel = Model.of(parametersConverter.fromParameters(params));
    58         final StringValue facet = params.get(SELECTED_FACET_PARAM);
    59         if (facet.isEmpty()) {
     65        final StringValue facetValue = params.get(SELECTED_FACET_PARAM);
     66        if (facetValue.isEmpty()) {
    6067            Session.get().error("No facet provided for all values page");
    6168            throw new RestartResponseException(new FacetedSearchPage(selectionModel));
    6269        }
    6370
    64         // create a new model so that all values will be retrieved
    65         setModel(new FacetFieldModel(facetFieldsService, facet.toString(), selectionModel, -1)); // gets all facet values
     71        final String facet = facetParamMapper.getFacet(facetValue.toString());
     72
     73        if (vloConfig.getAllFacetFields().contains(facet)) {
     74            // create a new model so that all values will be retrieved
     75            setModel(new FacetFieldModel(facetFieldsService, facet, selectionModel, -1)); // gets all facet values
     76        }
    6677        if (getModelObject() == null) {
    67             Session.get().error(String.format("Facet '%s' could not be found", facet));
    68             throw new RestartResponseException(new FacetedSearchPage(selectionModel));
     78            final String message = String.format("Facet '%s' could not be found", facet);
     79            throw new AbortWithHttpErrorCodeException(404, message);
    6980        }
    7081
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/VloBasePage.html

    r6194 r6412  
    3636    <body>
    3737        <div id="main">
    38             <div id="header">
     38            <div wicket:id="header" id="header">
    3939                <div id="logo">
    4040                    <h1>CLARIN Virtual Language Observatory</h1>
    4141                    <a id="headerlink_clarin" href="http://www.clarin.eu/"><span>CLARIN</span></a>
     42                    <div class="qualifier snapshot">TESTING</div>
     43                    <div class="qualifier beta">BETA</div>
    4244                </div>
    4345            </div>
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/pages/VloBasePage.java

    r6210 r6412  
    1919import eu.clarin.cmdi.vlo.JavaScriptResources;
    2020import eu.clarin.cmdi.vlo.VloWebAppParameters;
     21import eu.clarin.cmdi.vlo.VloWicketApplication;
    2122import eu.clarin.cmdi.vlo.config.VloConfig;
    2223import eu.clarin.cmdi.vlo.wicket.HideJavascriptFallbackControlsBehavior;
     
    2829import org.apache.wicket.markup.html.GenericWebPage;
    2930import org.apache.wicket.markup.html.WebComponent;
     31import org.apache.wicket.markup.html.WebMarkupContainer;
    3032import org.apache.wicket.markup.html.basic.Label;
    3133import org.apache.wicket.markup.html.link.ExternalLink;
     
    177179        add(new ExternalLink("help", vloConfig.getHelpUrl()));
    178180
     181        // add 'class' attribute to header indicating version qualifier (e.g. 'beta')
     182        add(new WebMarkupContainer("header").add(new AttributeAppender("class", VloWicketApplication.get().getAppVersionQualifier())));
     183
    179184        add(new HideJavascriptFallbackControlsBehavior());
    180185    }
    181186
    182 
    183187}
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/HierarchyPanel.html

    r6350 r6412  
    3333            <div wicket:id="parents">
    3434                <div class="tree-parent" wicket:id="parentsList">
    35                     <a wicket:id="link">[link]</a>
     35                    <a class="parent-up" wicket:id="up" title="Move up in hierarchy"><span>[up]</span></a>
     36                    <wicket:container wicket:id="link">[link]</wicket:container>
    3637                </div>
    3738                <a wicket:id="showAll">Show all... (<span wicket:id="itemCount">999</span>)</a>
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/java/eu/clarin/cmdi/vlo/wicket/panels/record/HierarchyPanel.java

    r6350 r6412  
    2121import eu.clarin.cmdi.vlo.FacetConstants;
    2222import eu.clarin.cmdi.vlo.service.solr.SolrDocumentService;
     23import eu.clarin.cmdi.vlo.wicket.components.IndicatingNestedTree;
    2324import eu.clarin.cmdi.vlo.wicket.components.NamedRecordPageLink;
    2425import eu.clarin.cmdi.vlo.wicket.model.SolrDocumentModel;
     
    3031import org.apache.wicket.ajax.AjaxRequestTarget;
    3132import org.apache.wicket.behavior.AttributeAppender;
     33import org.apache.wicket.behavior.Behavior;
    3234import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxFallbackLink;
    33 import org.apache.wicket.extensions.markup.html.repeater.tree.DefaultNestedTree;
     35import org.apache.wicket.extensions.markup.html.repeater.tree.AbstractTree;
    3436import org.apache.wicket.extensions.markup.html.repeater.util.SortableTreeProvider;
    3537import org.apache.wicket.markup.html.WebMarkupContainer;
     
    4244import org.apache.wicket.model.AbstractReadOnlyModel;
    4345import org.apache.wicket.model.IModel;
     46import org.apache.wicket.model.Model;
    4447import org.apache.wicket.model.PropertyModel;
    4548import org.apache.wicket.spring.injection.annot.SpringBean;
     
    6063
    6164    private final IDataProvider<SolrDocument> parentsProvider;
     65    private final AbstractTree<SolrDocument> tree;
     66    private final IModel<SolrDocument> pageDocumentModel;
    6267
    6368    public HierarchyPanel(String id, IModel<SolrDocument> documentModel) {
    6469        super(id, documentModel);
     70        pageDocumentModel = documentModel;
    6571
    6672        parentsProvider = new ParentsDataProvider();
    6773
    6874        add(createParentLinks("parents"));
    69         add(createTree("tree"));
     75
     76        tree = createTree("tree");
     77        add(tree);
     78
     79        setOutputMarkupId(true);
    7080    }
    7181
     
    7989
    8090            @Override
    81             protected void populateItem(Item<SolrDocument> item) {
     91            protected void populateItem(final Item<SolrDocument> item) {
    8292                item.add(new NamedRecordPageLink("link", item.getModel()));
     93                item.add(new IndicatingAjaxFallbackLink("up") {
     94
     95                    @Override
     96                    public void onClick(AjaxRequestTarget target) {
     97                        // tree root up one level, expand root for traceability by user
     98                        HierarchyPanel.this.setModel(item.getModel());
     99                        tree.expand(item.getModelObject());
     100                        if (target != null) {
     101                            target.add(HierarchyPanel.this);
     102                        }
     103                    }
     104                });
     105               
     106                item.add(new Behavior() {
     107
     108                    @Override
     109                    public void onConfigure(Component component) {
     110                        // null parent, hide
     111                        component.setVisible(item.getModelObject() != null);
     112                    }
     113
     114                });
    83115            }
    84116
     
    116148    }
    117149
    118     private Component createTree(String id) {
    119         final DefaultNestedTree<SolrDocument> tree = new DefaultNestedTree<SolrDocument>(id, new HierarchyTreeProvider()) {
     150    private AbstractTree<SolrDocument> createTree(String id) {
     151        final AbstractTree<SolrDocument> result = new IndicatingNestedTree<SolrDocument>(id, new HierarchyTreeProvider()) {
    120152
    121153            @Override
     
    125157                    @Override
    126158                    protected void onConfigure() {
    127                         setEnabled(!node.equals(HierarchyPanel.this.getModel()));
     159                        setEnabled(!node.equals(pageDocumentModel));
    128160                    }
    129161                };
     
    132164        };
    133165        // style of tree depends on presence of parent nodes
    134         tree.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
     166        result.add(new AttributeAppender("class", new AbstractReadOnlyModel<String>() {
    135167
    136168            @Override
     
    143175            }
    144176        }, " "));
    145         return tree;
     177        return result;
    146178    }
    147179
     
    149181    public void detachModels() {
    150182        super.detachModels();
     183        pageDocumentModel.detach();
    151184    }
    152185
     
    170203
    171204                @Override
    172                 public SolrDocument apply(Object input) {
    173                     String childId = input.toString();
    174                     return documentService.getDocument(childId);
     205                public SolrDocument apply(Object childId) {
     206                    return documentService.getDocument(childId.toString());
    175207                }
    176208            });
     
    223255        @Override
    224256        public IModel<SolrDocument> model(SolrDocument object) {
    225             return new SolrDocumentModel(object);
     257            if (object == null) {
     258                // dangling hasPart references can happen...
     259                return new Model<>();
     260            } else {
     261                return new SolrDocumentModel(object);
     262            }
    226263        }
    227264
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/jquery-ui-1.11.4.custom

    • Property svn:mergeinfo set to (toggle deleted branches)
      /vlo/trunk/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/jquery-ui-1.11.4.custommergedeligible
      /vlo/branches/to-wicket-1.6-twagoo/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/jquery-ui-1.11.4.custom4212-4219
      /vlo/branches/vlo-2.13-param/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/jquery-ui-1.11.4.custom2570-2767
      /vlo/branches/vlo-3.0/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/jquery-ui-1.11.4.custom5201
      /vlo/branches/vlo-3.2-ticket575/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/jquery-ui-1.11.4.custom6112-6188
      /vlo/branches/vlo-ticket761/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/jquery-ui-1.11.4.custom6189-6283
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/js/eu/clarin/cmdi/vlo/wicket/pages/searchhi.js

    r6308 r6412  
    1313    "and",
    1414    "or",
    15     "not"
     15    "not",
     16    "to"
    1617];
    1718
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/less/eu/clarin/cmdi/vlo/wicket/pages/inc/vlo-record.less

    r6350 r6412  
    278278#recordtree {
    279279    padding-bottom: 1em;
    280 }
    281 
    282 #recordtree #thisrecord {
    283     list-style-type: circle;
    284     font-weight: bold;
    285 }
    286 
    287 #recordtree .tree-parent {
    288     padding-left: 16px;
    289     background-image: url('up-3-filled-64.png'); /* icon from icons8.com */
    290     background-repeat: no-repeat;
    291     background-size: 12px;
    292     background-position: top left;
    293 
    294     min-height: 12px;
    295     padding-bottom: 2px;
    296 }
    297 
    298 #recordtree .tree-parent a {
    299     color: black;
    300 }
    301 
    302 #recordtree #tree.has-parent {
    303     padding-left: 18px;
    304 }
    305 
    306 #recordtree .tree-branch {
    307     clear: both;
    308 }
    309 
    310 #recordtree .tree-branch a {
    311    
    312 }
     280
     281
     282    #thisrecord {
     283        list-style-type: circle;
     284        font-weight: bold;
     285    }
     286
     287    .tree-parent a.parent-up {
     288        display: inline-block;
     289        width: 16px;
     290        background-image: url('up-3-filled-64.png'); /* icon from icons8.com */
     291        background-repeat: no-repeat;
     292        background-size: 12px;
     293        background-position: top left;
     294
     295        min-height: 12px;
     296        padding-bottom: 2px;
     297
     298        vertical-align: top;
     299
     300        &:hover {
     301            background-color: #ccc;
     302            text-decoration: none;
     303        }
     304
     305        span {
     306            display: none;
     307        }
     308    }
     309
     310    .tree-parent, .tree-branch content {
     311        a {
     312            color: black;
     313
     314            &:hover {
     315                text-decoration: underline;
     316            }
     317        }
     318    }
     319
     320    #tree.has-parent {
     321        padding-left: 18px;
     322    }
     323
     324    .tree-branch {
     325        clear: both;
     326    }
     327}
     328
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/less/eu/clarin/cmdi/vlo/wicket/pages/inc/vlo-top.less

    r5148 r6412  
    114114    font-weight: bold;
    115115}
     116
     117div#header .qualifier {
     118    display: none; /* overridden depending on header class */
     119
     120    position: absolute;
     121    top: 1em;
     122    border: 1px solid;
     123    text-align: center;
     124    line-height: 2em;   
     125   
     126    border-color: red;
     127    color: red;
     128}
     129
     130div#header.snapshot div.qualifier.snapshot {
     131    display: block;
     132    width: 8em;
     133}
     134
     135div#header.beta div.qualifier.beta {
     136    display: block;
     137    width: 5em;
     138}
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/webapp/META-INF/context.xml

    r4583 r6412  
    11<?xml version="1.0" encoding="UTF-8"?>
    2 <Context antiJARLocking="true" path="/vlo-web-app">
     2<Context antiJARLocking="true" path="/vlo-web-app" sessionCookiePath="/">
    33    <!--
    44        If set, configuration will get read from this external location
  • vlo/branches/vlo-3.3-oeaw/vlo-web-app/src/main/webapp/WEB-INF/web.xml

    r4767 r6412  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    22<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    3         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    4         version="2.5">
     3         xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
     4         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
     5         version="3.0">
    56
    67  <display-name>vlo-web-app</display-name>
Note: See TracChangeset for help on using the changeset viewer.