~~ Licensed to the Apache Software Foundation (ASF) under one or more ~~ contributor license agreements. See the NOTICE file distributed with ~~ this work for additional information regarding copyright ownership. ~~ The ASF licenses this file to You under the Apache License, Version 2.0 ~~ (the "License"); you may not use this file except in compliance with ~~ the License. You may obtain a copy of the License at ~~ ~~ http://www.apache.org/licenses/LICENSE-2.0 ~~ ~~ Unless required by applicable law or agreed to in writing, software ~~ distributed under the License is distributed on an "AS IS" BASIS, ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ~~ See the License for the specific language governing permissions and ~~ limitations under the License. ------ Migration from Tobago 1.5 to 2.0 ------ Migration from Tobago 1.5 to 2.0 Tobago 2.0 has some API changes compared to Tobago 1.5. The most changes are in the tree API, which is more easy to use, but also more flexible. Artifacts (JAR-Files) The following JAR files are no longer needed. They have to be removed from the project (depends on your build system). * tobago-taglib-extension-\.jar * tobago-facelets-\.jar CSP Tobago supports Content Security Policy (CSP) to prevent cross-site scripting (XSS) and related attacks. It is specified by {{{http://www.w3.org/TR/CSP/}W3C}}. In short: The HTML page doesn't contain any JavaScript or CSS information. All allowed sources for JavaScript, CSS and other resources have to be declared in special header. If you have own renderers or own JavaScript in your application, this code also needs to support CSP, to use this feature. * Warning: CSP requires a different handling of JavaScript and other resources. If you use own JavaScript in the HTML page or including resources from other sites you may need to adapt your application, (or turn this feature off). * Configuration To add sites to the CSP headers, add <<<\>>> tags to <<<\>>> in the <<>>. To turn off CSP, add an empty <<<\>>> tag in the configuration. For development, you may also use mode="report-only", which sets the appropriate header. Clickjacking By default, it no longer possible to use a Tobago application in an HTML frame or iframe. This is to protect against {{{https://www.owasp.org/index.php/Clickjacking}Clickjacking}} To disable this feature consult the <<>> and set <<<\false\>>>. Java-API The class org.apache.myfaces.tobago.model.TreeState which has been deprecated in 1.5.x is used in 2.0.x with a changed API. Please check the occurrences. Class <<>> has been renamed to <<>>. Renderer classes The set of existing renderers has been repacked from <<>> to <<>>. If you have an own theme with own renderer classes implemented, which are extending the Tobago renderer classes, you will need to adapt the package name of the base classes. Facelets Tobago 2.0.x is using Facelets 2.0. When still using Facelets 1.1 in the current application, this must be removed: * Remove facelets JAR (e.g. <<>>) from the library. * Remove \org.apache.myfaces.tobago.internal.application.ViewHandlerImpl\ from the faces-config.xml file. * Remove the parameter <<>> from the <<>> file. * Remove or replace the <<>> entries from the <<>> file. * Rename all JSTL declarations from <<>> to <<>> in the Facelets. * Ensure the version of the faces-config tag in the faces-config.xml is at least 2.0. [] Deprecated There are also <<<@Deprecated>>> annotations in the code and some logging warning when using deprecated code via the <<>> logging category. Before and after migrating you should check your application about that. For the migration phase you may add the tobago-deprecation.jar as dependency to your project. It contains classes that has been moved (e. g. to the new internal package) or removed. So you can resolve any migration steps step by step. It is not recommended to use the tobago-deprecation.jar for production. Internal The package <<>> contains classes that should not be used directly in an application. This classes may change in minor revisions without announcement. Classes in the package <<>> are handled in the same manner. Tag Library The main changes in the tag library are that the deprecated facets "resizeAction" and "menupopup" has been removed. Suggest Please use the new <<<\>>> tag instead of using the inline attribute inside of <<<\>>> *--+--+ | <> | <> | *--+--+ | <<<\>>> | <<<\\\>>> | *--+--+ | <<<\>>> | <<<\\\>>> | *--+--+ Tree * The Tree now extends a UIData. * The <<>> tag shouldn't longer be used. * The <<>> has no longer the attributes: "selected", "expanded", "marked", "treeMarkedListener", "treeExpansionListener" * The class <<>> is no longer deprecated, but the functionality has slightly been changed. Date/Time The date and time input controls have been refactored. The old (deprecated) functionality can be activated via <<>>. If using the new: <<>> can do the job of <<>>. You only need to set the <<>> inside the <<>>. ToolBar with dropDownMenu facet Usually you need to set <<>> in the <<>>, to avoid a submit. Configuration To define an own theme, please use now a file <<>> instead of <<>>. The content of <<>> is a subset of the <<>>, you have only to change the root node. Please use the {{{http://myfaces.apache.org/tobago/tobago-config-2.0.xsd}<<>>}} to validate the configuration. JavaScript Date/Time/Calendar components: The JavaScript for this components has been refactored. All method have now a namespace and are using jQuery. JavaScript code has been removed from the renderers. For data the HTML5 data attribute is used instead of directly coding it into the event handler, or using hidden input fields. CSS The class <<>> is renamed to <<>>. The class <<>> is renamed to <<>>. The class <<>> is no longer needed. The class <<>> is no longer needed. Internal The facet name of the picker popup is now named "popup" instead of "pickerPopup".