Mar 2, 2018 5:59:45 PM seb leridon avatar

Evolution of Version 5

Version 5.0.0

Using CSS framework Bootstrap 3 for the Front Office

Starting from Lutece v5.0, the front office templates are based on version 3 of the Bootstrap framework. Official documentation describing the migration from version 2.x to 3.0

Upgrading Lucene libraries

Update of the indexing and analysis library (Lucène and Tika). Lucene is now in version 4.6.1 and Tika in version 1.5. This evolution has strong impacts on all plugins using indexing (ex: directory, form, calendar, ...). Here are the aspects to take into account for the migration:

  • The class Searcher has disappeared and has been replaced by IndexSearcher. The construction method is now:
    IndexReader ir = DirectoryReader.open (% INDEX_PATH%);
            searcher = new IndexSearcher (ir);
  • The HTMLParser class provided by lucene-demos has been superseded by the HtmlParser class provided by Tika. HTML document parsing is now done as follows:
    String strContentToIndex = getContentToIndex (document);
            ContentHandler handler = new BodyContentHandler ();
            Metadata metadata = new Metadata ();
            try
            {
            new HtmlParser () .parse (new ByteArrayInputStream (strContentToIndex.getBytes ()), handler, metadata,
            new ParseContext ());
            }
            catch (SAXException e)
            {
            throw new AppException ("Error during page parsing.");
            }
            catch (TikaException e)
            {
            throw new AppException ("Error during page parsing.");
            }
    
            // the content of the article is recovered in the parser because this one
            // had replaced the encoded caracters (as) by the corresponding special character (as?)
            StringBuilder sb = new StringBuilder (handler.toString ());

Field classes that index and analyze Lucene fields have been refactored. Here are the changes to make:

Field.Store.NO, Field.Index.ANALYZED TextField.TYPE_NOT_STORED
Field.Store.YES, Field.Index.ANALYZED TextField.TYPE_STORED
Field.Store.YES, Field.Index.NOT_ANALYZED FieldType ft = new FieldType (StringField.TYPE_STORED);
ft.setOmitNorms (false);
Field.Store.YES, Field.Index.NO FieldType ftNo = new FieldType (StringField.TYPE_STORED);
ftNo.setIndexed (false);
ftNo.setTokenized (false);
ftNo.setOmitNorms (false);
Field.Store.NO, Field.Index.NOT_ANALYZED FieldType ftNotStored = new FieldType (StringField.TYPE_NOT_STORED);
ftNotStored.setOmitNorms (false);
ftNotStored.setTokenized (false);
Field.Store.NO, Field.Index.ANALYZED FieldType ftNotStored = new FieldType (StringField.TYPE_NOT_STORED);
ftNotStored.setOmitNorms (false);

i18n labels with parameters

It is possible from Lutece v5 to pass parameters to an i18n label using the pattern of the Java MessageFormat class in the myplugin_messages.properties resource file:

mykey.message = My message using 2 arguments: {0} and {1}
$ {i18n ("myplugin.mykey.message", argument1, argument2)}

Value overload i18n

The default values ​​of the i18n keys are overloaded in files placed under / WEB-INF / conf / override / and respecting the same tree.