~~ 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.0 to 1.5 ------ Migration from Tobago 1.0 to 1.5 Tobago 1.5 has a lot of changes compared to Tobago 1.0. The good news: Most of these changes are made internally in Tobago. If you use Tobago, you don't have to change too much. The amount of things you have to change in your application depends on how do you use it. On the Tobago Tag Library are very few changes made. On the Tobago Java Classes and the Themes are more changes. Here you can see which changes has been made. Deprecated There are also <<<@Deprecated>>> annotations in the code and some logging warning when using deprecated code via the <<>> logging category. Before 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 <<>> 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 new <<>> 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 a handled in the same manner. Tag Library The main changes in the tag library are *--+--+ | <> | <> | *--+--+ | <<>> | <<>> | *--+--+ | <<>> | <<>> | *--+--+ | <<>> | <<>> | *--+--+ In <<>> the default for <<>> has been changed from 100 to 0, which means "unlimited". For JSP and the <<>> library all <<>> attributes have to be renamed to <<>>. This is to adjust the JSP library to the Facelet library. The tree tag <<>> has changed comprehensive. Please check the documentation and demo examples. The <<>> attribute of commands has been removed. It is no longer needed, when using <<>>, <<>> or <<>>. Layout Manager On of the basic changes in Tobago 1.5 is the reimplementation of the layout manager. The usage if it, has only been changed a bit. The most important is that the constraints will be set with the <<>> tag. The <<>> tag is deprecated now. Spans can be set directly into the component with the <<>> tag. The keyword "fixed" has been renamed to "auto". UIComponent Classes Some of the UIComponent classes has been renamed or restructured, to get a consistent naming schema. The used UIComponents where generated and have super classes with an "Abstract" as prefix. All getters and setters are generated in the UIComponent classes. The following code will not work in 1.5 <<>>. Please set the value to null. \ *--+--+--+--+ | | <> | <> *--+--+--+--+ | divided | org.apache.myfaces.tobago.component.UISelectOne | org.apache.myfaces.tobago.internal.component.AbstractUISelectOneBase *--+--+--+--+ | | | *--+--+--+--+ | ... | | *--+--+--+--+ Naming Container UITab is now a naming container, so you may have to change ids of AJAX calls in your application. Other API Classes *--+--+--+--+ | | <> | <> *--+--+--+--+ | moved | org.apache.myfaces.tobago.OnComponentCreated | org.apache.myfaces.tobago.component.OnComponentCreated *--+--+--+--+ | moved | org.apache.myfaces.tobago.component.ComponentUtil | org.apache.myfaces.tobago.util.ComponentUtils *--+--+--+--+ | moved | org.apache.myfaces.tobago.renderkit.RenderUtil | org.apache.myfaces.tobago.renderkit.util.RenderUtils *--+--+--+--+ | renamed | org.apache.myfaces.tobago.renderkit.html.HtmlRendererUtil | org.apache.myfaces.tobago.renderkit.html.util.HtmlRendererUtils *--+--+--+--+ | | | *--+--+--+--+ | ... | | *--+--+--+--+ Themes and CSS Note: This effects your application only, when you've written your own theme, or using this classes in a separate style file. The basic changes in CSS are: [[1]] Using CSS 2.1 compliant content box model instead of border box model. [[1]] Changed HTML structure for some components. The CSS class name schema has been revised. See the JavaDoc of the <<>> class to check the naming schema. *--+--+--+--+ | | <> | <> *--+--+--+--+ | renamed | <<>><<<-default>>> | <<>> | *--+--+--+--+ | renamed | <<>><<<-error>>> | <<>><<<-markup-error>>> | *--+--+--+--+ | renamed | <<>><<<-required>>> | <<>><<<-markup-required>>> | *--+--+--+--+ | renamed | <<>><<<-readonly>>> | <<>><<<-markup-readonly>>> | *--+--+--+--+ | renamed | <<>><<<-disabled>>> | <<>><<<-markup-disabled>>> | *--+--+--+--+ | renamed | <<>> | <<>> | *--+--+--+--+ | renamed | <<>>* | <<>>* | *--+--+--+--+ | renamed | <<>> | <<>> | *--+--+--+--+ | renamed | <<>> | <<>> | *--+--+--+--+ | renamed | <<>>* | <<>>* | *--+--+--+--+ | renamed | <<>>* | <<>>* | *--+--+--+--+ | deleted | <<>>* | | *--+--+--+--+ JavaScript The JavaScript API has been refactored. Most application do not use the Tobago JavaScript API directly. But if it does, you have to apply some changes. The most important things, is the additional first parameter on the submitting functions to compute the position of the action element. If you are using <<>> in the old code, you have to add the action element or just <<>>. If you are using <<>> in the old code, you have to rename it to <<>>. *--+--+--+--+ | added first parameter and put all parameters after the second to an options map | <<>> | | *--+--+--+--+ | renamed | <<>> | <<>> | *--+--+--+--+ | added first parameter | <<>> | | *--+--+--+--+ | renamed | <<>> | <<>> | *--+--+--+--+ | added first parameter | <<>> | | *--+--+--+--+ | renamed | <<>> | <<>> | *--+--+--+--+ | added first parameter | <<>> | | *--+--+--+--+ | renamed | <<>> | <<>> | *--+--+--+--+ | added first parameter | <<>> | | *--+--+--+--+ | renamed | <<>> | <<>> | *--+--+--+--+ | added first parameter | <<>> | | *--+--+--+--+ | renamed | <<>> | <<>> | *--+--+--+--+ Configuration To define an own theme, please use now a file tobago-config.xml instead of tobago-theme.xml. The content of tobago-theme.xml is a subset of the tobago-config.xml, you have only to change the root node. Please use the tobago-config-1.5.xsd to validate the configuration. Own Components and Renderers The renderers must now declared inside the <<>>. For the Tobago classes, this will be generated at compile time from annotations like in e. g. <<>>.