Bug 887 - [Chameleon-Documentation]Mechanism for supporting deprecated widget names through several versions
: [Chameleon-Documentation]Mechanism for supporting deprecated widget names thr...
Status: RESOLVED FIXED
: Chameleon
Documentation
: 1.99
: PC Linux
: P2 normal
: 2.0 RC 1
Assigned To:
:
:
:
:
: 886
  Show dependency treegraph
 
Reported: 2004-12-02 13:28 by
Modified: 2004-12-20 12:26 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-12-02 13:28:24
I think it could be good to document the new mechanism to support deprecated
widget name.


We should also list somewhere widgets that are renamed:


MapDHTMLWidget -> MapDHTML
PrintWidget -> PrintProduction
HelpWidget -> EmbeddedHelp


---------------------------
Paul Spencer wrote:

> All,
>
> bugs 632 and 377 concern renaming widgets that have been in existance for
quite a while.  While the renaming itself is reasonably trivial, this will cause
existing templates to break immediately.
>
> To counteract this, I've added a widget renaming scheme in WidgetManager.php.
>
> I don't want to support old widget names indefinitely, so the widget renaming
is keyed to Chameleon versions.  There's no concept of a version in the code, so
I have added the following in chameleon.php:
>
> /*
>  * chameleon API version.
>  * The API version started with version 1.99.
>  * It is used by some components (starting with the widget name
>  * mapping in WidgetManger.php) to define an API version.  It
>  * can be expected that the API will be consistent between POINT
>  * versions but can change between MAJOR and MINOR versions.
>  *
>  * It could also be used for widgets that require a certain API
>  * version to work in the future.
>  *
>  * There are 5 values defined:
>  *
>  * CHAMELEON_MAJOR_VERSION - the major release number
>  * CHAMELEON_MINOR_VERSION - the minor release number, odd is dev, even is stable
>  * CHAMELEON_POINT_VERSION - a bugfix release within a minor version
>  * CHAMELEON_STATE_VERSION - a qualifier like ALPHA or BETA
>  * CHAMELEON_VERSION - a combination of the above, in the form:
>  *
>  * 1.99.0
>  * 2.2.0-beta3
>  *
>  *
>  */
> define( "CHAMELEON_MAJOR_VERSION", "1" );
> define( "CHAMELEON_MINOR_VERSION", "99" );
> define( "CHAMELEON_POINT_VERSION", "0" );
> define( "CHAMELEON_STATE_VERSION", "beta3" );
>
> define( "CHAMELEON_VERSION", CHAMELEON_MAJOR_VERSION.".".
>                              CHAMELEON_MINOR_VERSION.
>                              (CHAMELEON_POINT_VERSION == '' ? '' : "-" ).
>                              CHAMELEON_STATE_VERSION );
>
> Currently this is used only by the WidgetManager to associate versions with
deprecated widget names.  But I can see us using this in the future when we
distribute widget packs or individual widgets that might be installed into older
(or newer) chameleon installations.  The comments in the code say it all ...
>
> /*
>  * global mapping array for widgets that change their name
>  *
>  * widgets that get their name changed can be registered here to ensure
>  * backwards compatibility for several versions
>  *
>  * array uses old name as a key with new name and three version numbers:
>  * version 1 - the version that the name changed
>  * version 2 - the version at which warnings should appear
>  * version 3 - the version at which errors should appear
>  *
>  * at version 2, widgets will still work under the old name but a warning will
>  * be logged in the error manager
>  *
>  * at version 3, widgets will cease to work and will appear in RED in the
template.
>  *
>  * example:
>  * $GLOBALS['gaszRenamedWidgets']['MapDHTMLWidget'] =
>  *     array( "MapDHTML", "1.99", "2.2", "2.4" );
>  *
>  * NOTE that only the MAJOR and MINOR numbers are used in this comparison
>  */
>
> $GLOBALS['gaszRenamedWidgets'] = array();
>
> //bug MT 632: rename MapDHTML widget
> $GLOBALS['gaszRenamedWidgets']['MapDHTMLWidget'] =
>     array( "MapDHTML", "1.99", "2.2", "2.4" );
>
> so that existing templates will work without warning until we declare version
2.2 in the defines, and won't work when we declare 2.4 in the defines.
>
> Make sense?  This has all been committed to cvs (just now) so any problems
should be reported asap.
>
> Cheers,
>
> Paul
> _______________________________________________
> Chameleon-dev mailing list
> Chameleon-dev@lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon-dev
>
------- Comment #1 From 2004-12-02 14:56:37 -------
where should this feature be documented?  Seems like there should be another
document for describing Chameleon features ... something in between an
Application Developers Guide and a Widget Developers Guide
------- Comment #2 From 2004-12-03 10:23:05 -------
Well, I think this feature is closer to the Application Developers Guide in 
relevance than to a Widget Developers Guide. Probably, though, mention should 
eventually be made of it in both such places. 

For 1.99 I will make mention of the issue of deprecation in the Application 
Developers Guide, but only in the scope that deprecated widgets exist and that 
Chameleon handles them by.....But nothing of how that works internally. 

More details can be exposed, if necessary, in the 2.0 documentation.

Agreed?
------- Comment #3 From 2004-12-03 10:24:09 -------
Changed target to 1.99 RC 1.
------- Comment #4 From 2004-12-06 10:27:15 -------
Added a brief section on Widget Deprecation to Application Developers Guide. In 
CVS.
------- Comment #5 From 2004-12-20 12:26:11 -------
seems to be completed.