API changes in 1.1 ------------------ [Diff from 1.14.1.1 to 2.1.1.47] Core: * Component-s know their own Id-s (accessible with getScope() method). Interface Scope and its implementation StandardScope have been added. Component's init() method now takes Scope as its first parameter. Implementation of that was done in BaseComponent. * Component-s have accessible environment now (added getEnvironment() method). * Components' lifecycle is more strictly defined, there are three states: UNBORN, ALIVE and DEAD. Resurrection cannot occur anymore, an IllegalStateException will be thrown. Leftover calls do not throw exceptions anymore, they are silently ignored. BaseComponent implementation manages the lifecycle status. In addition to the existing isInitialized method, the protected methods isAlive and isDead were added to BaseComponent class. Propagate call does not traverse below dead Component. BaseService lets the action call through only if the Component is alive. The convertInternal method in FormElement class runs the conversion and addInitEvent method in FormElement and ListWidget classes run the event only if the element/widget is alive. * Eliminated process() method from widget's lifecycle. Deleted process() method from Widget interface and BaseWidget, BaseWidget.WidgetImpl, BaseApplicationWidget, ExceptionHandlingFlowContainerWidget, BaseFilterWidget, StandardTransactionFilterWidget, FormElement, GenericFormElement, BaseControl.WidgetImpl, DisplayControl, StringArrayRequestControl classes. Deleted handleProcess() method from BaseApplicationWidget, FormElement, BaseFormListWidget, ListWidget classes. * Added another constructor to StandardPath class, which takes Collection as an argument. * Deleted FLOW_KEY and CALL_STACK_KEY constants from FlowContext interface. StandardFlowContainerWidget: frames have fixed names (generated sequentially) that are used for components ids, because component id's are fixed. * Eliminated OutputData attributes: deleted pushAttribute, popAttribute, getAttribute and getAttributes methods from OutputData interface (and StandardServletOutputData class). * Eliminated OutputData and InputData scoping: deleted getScope(), pushScope(), popScope and restoreScope methods from InputData (and StandardServletInputData) and OutputData (TODO StandardServletOutputData). Method getScopedData in InputData (and StandardServletInputData) now takes Path as a parameter. Everything uses getScope method (from Component) instead of OutputData/InputData.getScope. * Eliminated scopedWidgetId, scopedFullId and formScopedFullId, they were the same as their non-scoped counterparts anyway. Deleted WIDGET_SCOPED_ID_KEY constant from WidgetTag class and FORM_SCOPED_FULL_ID_KEY from FormTag class. Deleted scopedFullId field from BaseWidgetTag class. Deleted formScopedFullId field and getScopedFullFieldId method from BaseFormElementHtmlTag class. * Added getContainerPath and getContextPath methods to HttpInputData interface (and its implementing class StandardServletInputData). Services and filters: * Added ExpiringServiceContext interface (implemented by BaseExpiringServiceRouterService class), in order to access serviceTTLMap from BodyHtmlTag.writeKeepAliveRegistrationScripts (was previously done with OutputData attributes). * Deleted LOCALIZATION_CONTEXT_KEY constant from LocalizationContext interface. * Deleted MESSAGE_KEY constant from MessageContext interface. Added getMessages method to MessageContext interface (and its implementation to StandardMessagingFilterWidget class) in order to access messages from MessagesHtmlTag class (was previously done with OutputData attributes, which were added in render method of StandardMessagingFilterWidget class). * Added showMessages, hideMessages, hideMessage, hideErrorMessage, hideWarningMessage and hideInfoMessage methods to MessageContext interface and its implementation StandardMessagingFilterWidget class. * Deleted POPUPS_KEY constant from PopupWindowContext interface. Added getPopups method to PopupWindowContext interface (and StandardPopupFilterWidget class) in order to access popup windows from PopupRegistrationHtmlTag class. * Deleted SCROLL_HANDLER_KEY constant from WindowScrollPositionContext interface. WindowScrollPositionContext, used by ScrollHandlerRegistrationHtmlTag class, is now accessible from environment. * Deleted PATH_ARGUMENT constant from PathInfoServiceRouterService class. Added getPathInfo method to PathInfoServiceContext interface (and PathInfoServiceRouterService class). * Deleted ClientStateUtil class. Added EnvironmentUtil class, that contains convenience methods for getting topServiceId and threadServiceId. * Moved constant ACTION_PATH_KEY from StandardContainerWidget to ApplicationService interface. * Moved constant EVENT_PATH_KEY from StandardContainerWidget class to ApplicationWidget interface. * You are able to query the next transactionId from TransactionHelper and TransactionContext (added getNextTransactionId method to both). * StandardTransactionFilterWidget and StandardClientStateFilterWidget require SystemFormContext from environment (provided by StandardSystemFormFilterService). JSP: * JSP contextAttributes from parent JSP-s are no longer accessible after widgetInclude (for example, layout tags don't work across widgetInclude-s). They are deliberatly removed from PageContext in all widgetInclude-like tags (WidgetIncludeTag, TreeTag, WizardBodyTag) before calling render, by calling BaseTag.hideGlobalContextEntries method. Afterwards, they are restored, by calling BaseTag.restoreGlobalContextEntries method. * Also added getEnvironment, getContextWidget and getContextWidgetFullId methods to BaseTag class. Deleted static method getWidgetFromContext and renamed getContextWidgetFromContext method to getContextWidget in JspWidgetUtil class. * Deleted AraneaRootTag, AraneaViewPortTag, GlobalWidgetIncludeTag classes. Deleted ViewPortContext and UiWidgetContainer interfaces and UiAraneaWidgetContainer class. Deleted static method getContainer from JspWidgetCallUtil class. Deleted container field from BaseWidgetTag class. * Moved AraneaRootTag.StringAdapterResourceBundle inner class into ServeletUtil class. Added LOCALIZATION_CONTEXT_KEY constant to ServeletUtil class. JSP localizationContext is set in ServletUtil.include instead of root tag (if Aranea's LocalizationContext is accessible from environment). * Deleted StandardContainerWidget because viewport tag and ViewPortContext interface do not exist anymore. Moved other functionality (about not letting non-existent) events through) to StandardWidgetAdapterService class. * WidgetContext tag with no Id no longer has to be at the top of JSP file, this is done automatically in ServletUtil.include method. * Added CONTEXT_WIDGET_KEY constant to WidgetContextTag class. Instead of pushing/popping the scope of OutputData, the current contextwidget is stored in a contextentry. Deleted contextWidgetId field from BaseFormElementHtmlTag class. * Added UIWIDGET_KEY constant to ServletUtil class. The including widget is registered as a contextattribute in ServletUtil.include method under this key. * Eliminated systemForm's Id. No duplicate systemform check is done in server-side nor client-side. Client-side JavaScript searches for the first form tag with arn-systemForm attribute. Removed systemFormId field from BaseSimpleButtonTag and BaseFormElementHtmlTag classes. The get*OnChangePrecondition methods in BaseFormDateTimeInputHtmlTag class and fillXJSCallConstructor method in FormDateTimeInputHtmlTag and FormTimeInputHtmlTag classes and writeHourSelect and staticFillXJSCall methods in FormTimeInputHtmlTag class do not take systemFormId as an argument any more. The constructACUrl and constructServiceParameter methods in FormAutoCompleteTextInputHtmlTag class and static method getSubmitScriptForEvent in JspWidgetCallUtil class do not take systemFormId as an argument any more. * Added SystemFormContext interface and its implementation StandardSystemFormFilterService. Filters lower in the hierarchy (like TransactionFilter and ClientStateFilter) can use it to add fields to systemform, that must be written out in HTML by systemform tag. StandardSystemFormFilterService adds topServiceId and threadServiceId automatically, since these filters are located higher in the hierarchy. * Deleted JSP_CONFIGURATION_KEY constant from JspContext interface. * Added getSubmitCharset, getFormAction, getTagMapping, getConfiguration methods to JspContext interface; moved methods the same four method implementations from StandardJspFilterService.JspConfiguration inner class to StandardJspFilterService class. Removed getCurrentBundle, getCurrentLocale, getJspPath, getJspExtension methods from StandardJspFilterService.JspConfiguration inner class and deleted the inner class altogether. Thus, StandardJspFilterService doesn't depend on LocalizationContext anymore. * There are now two ServletUtil.include methods, in addition to the old one that takes Environment as a parameter, the new one takes ApplicationWidget instead. When ServletUtil.include is invoked from an ApplicationWidget (as is mostly the case), the new method signature should be used - then the including widget is made accessible to JSP. In addition to the including widget, ServletUtil.include sets the environment, JSP localization context and also the same five entries that widgetContext tag did. After including the JSP, the contextEntries that were set, are restored to previous values. * Added getEnvironment method to ServletUtil class. * The SPAN HTML tag surrounding a formelement does not have a random id any more (due to non-preservable contextattributes). The id is in the form of "fe-span-${fullFormElementId}". Deleted static method generateId from BaseFormElementHtmlTag class. Partial rendering: * UpdateRegion filter is a widget filter now: renamed StandardUpdateRegionFilterService class to StandardUpdateRegionFilterWidget. UpdateRegions use partial rendering, BaseUpdateRegionTag.doStartTag method registers the region name and renderable widget Id in the filter. * Eliminated globalUpdateRegions. Messages and popups data is sent in JSON format, they have JavaScript handlers in client-side. * Updateregion names in arn-updrgns HTML tag are no longer quoted, they are just comma-separated (see JspUpdateRegionUtil.formatUpdateRegionsJS method). * Added UpdateRegionContext interface. * ExceptionHandlingFlowContainerWidget class also overrides propagate method to catch exceptions from that. When an exception is handled in handleWidgetException method, UpdateRegionContext.disableOnce method is called in order to force browser to reload the page if it was an AJAX request. * Added MESSAGE_REGION_KEY constant and MessageRegionHandler inner class to StandardMessagingFilterWidget class. On initialization, an instance of this inner class is registered as a region handler under the name of the constant. * Added POPUP_REGION_KEY constant and PopupRegionHandler inner class to StandardPopupFilterWidget class. On initialization, an instance of this inner class is registered as a region handler under the name of the constant. * Added JsonArray and JsonObject utility classes. * Deleted POPUP_REGISTRATION_REGION constant from PopupRegistrationHtmlTag class. * MessagesHtmlTag writes out just one DIV instead of four. A DIV is always written out, even if there are no messages. The style class "aranea-messages" cannot be overriden by setStyleClass. Separated the writing into multiple methods for easier overriding. * UpdateRegionRowsHtmlTag does not write BEGINROWS comment any more. Synchronization: * Deleted StandardSynchronizingFilterService, its functionality is merged into StandardHttpSessionRouterService. Deleted SynchronizingContext interface. * Added SYNC_PARAMETER_KEY and SESSION_SYNC_OBJECT_KEY constants to StandardHttpSessionRouterService class. * StandardHttpSessionRouterService supports unsynchronized actions - when sync=false is specified as a request parameter. * Utility classes Mutex, ReadWriteLock, ReaderPreferenceReadWriteLock, Sync, WriterPreferenceReadWriteLock have been added from EDU.oswego.cs.dl.util.concurrent package. * StandardHttpSessionRouterService and StandardSerializingAuditFilterService use a read-write lock to track the progress of action calls and to know when all calls have finished so that session can be serialized. * StandardSerializingAuditFilterService class extends BaseFilterService (previously extended BaseService and implemented FilterService). TreeWidget: * TreeWidget supports unsynchronized actions. In client-side JavaScript, unsynchronized action is made when the tree HTML element has arn-tree-sync="false" attribute (aranea-tree.js) That attribute is written out in TreeTag.StandardTreeRenderer.renderTreeStart method. Added useSynchronizedActions method to TreeContext interface and TreeWidget class, added setUseSynchronizedActions method to TreeWidget class. * The render* methods in TreeRenderer interface and TreeTag.StandardTreeRenderer class do not take nodeFullId nor childNodeFullId as arguments any more. * Added getFullId method to TreeNodeContext interface and TreeNodeWidget class. Forms: * Deleted deprecated "dirty" field, clean() and isDirty() methods from Data class. * Added isIgnoreEvents and setIgnoreEvents methods to FormElement class. FormElement ignores events when it is disabled or was not rendered. * Removed processRows method from BaseFormListWidget class. Removed addFormRow method from BeanFormListWidget and FormListWidget classes -- they moved to BaseFormListWidget. * Added getMutableErrors method to GenericFormElement class. * Added makeRequestIdToRowMapping method to ListWidget class. Added getAllItemsShown method to SequenceHelper class. Added checkChanged and fireChange methods to ListWidget, SequenceHelper, TypeHelper and BaseFilterHelper classes. ListWidget getItemRange() method acts lazily. * The add*ButtonToRowForm methods in FormListUtil class now return added ButtonControl. * Added getLongestPrefix and getShortestSuffix static methods to NameUtil class. * Added getDeepestForm static method to NestedFormUtil class. * Event listeners ProxyEventListener, ProxyOnChangeEventListener, ProxyOnClickEventListener and ValidatingProxyEventListener take Widget as constructor parameter instead of Object. Also, the eventTarget field is of type Widget. JavaScript: * Added getSystemForm and setSystemForm functions to AraneaPage instance. Added findSystemForm function to AraneaPage object. It searches for the first form tag with arn-systemForm attribute and calls setSystemForm. It is added as a systemLoadEvent, so it is called on page load and after updateregions AJAX request. * Because element-based traversing is not performed anymore, deleted AraneaTraverser and removed getTraverser function from AraneaPage instance (aranea.js). Moved the five getEvent* functions from AraneaTraverser to AraneaPage instance. * Moved setFormEncoding function from aranea-ui.js to AraneaPage instance (aranea.js) and renamed it to setSystemFormEncoding. * JavaScript functions related to date and time controls (fillTimeText, fillTimeSelect) and scrollhandler (saveScrollCoordinates) do not take systemForm as a parameter any more (aranea-ui.js). * getActionSubmitURL, action and action_6 functions in AraneaPage instance take sync as an additional parameter. It was added as the last parameter, so it can be safely omitted -- the default behaviour on the absence of this parameter is to make a synchronized request. * Removed dependency on AjaxAnywhere, deleted aa.js. Updateregions functionality uses Prototype library now. * Added builder.js from script.aculo.us. * Added handleRequestException function to AraneaPage. Exceptions from action and AJAX submit (updateregions) are handled by it. * Added addRegionHandler function to AraneaPage. It can be used to register handlers for data regions coming from AJAX responses. Added TransactionIdRegionHandler, DocumentRegionHandler, MessageRegionHandler, PopupRegionHandler and ReloadRegionHandler classes to AraneaPage. An instance of each of them is also registered as region handler. * Added processResponse function to AraneaPage. * Added showLoadingMessage and hideLoadingMessage functions to AraneaPage. These are called to show and hide the loading message before starting and after completing the AJAX submit (updateregions). * Added Text class to aranea-util.js. Configuration and other files: * Added aranea.css, which contains style definitions for Aranea's AJAX loading message. * Moved araneaUpdateRegionFilter from araneaThreadFilters to araneaWidgetFilters in default-aranea-conf.xml Examples: * Messageregion has three DIV tags in root.jsp. "aranea-messages" CSS class is used in JavaScript for lookup purpose, styles are applied in aranea.css to this class. * Added "Unsynchronized actions" example under Trees. * Added "Error on render" button to Error on AJAX demo. * Added "Open immediately returning interactive popup" button to Popups demo. Library upgrades: + jakarta-regexp 1.2 -> 1.5 + log4j 1.2.8 -> 1.2.14 + commons-collections 3.1 -> 3.2 + commons-lang 2.1 -> 2.3 + commons-validator 1.3.0 -> 1.3.1 + commons-logging 1.0.4 -> 1.1 + spring 1.2.8 -> 1.2.9 + log4javascript 1.2 -> 1.3.1 (compressed) + prototype 1.5.0_rc0 -> 1.5.1 + scriptaculous ??? -> 1.7.1_beta2 + tiny_mce 2.0.6.1 -> 2.1.0 //TODO diagrams of Aranea filter hierarchies, one for 1.0, other for 1.1. [Changes in tests not covered]