From 6a35ea7299d8c34e86a5ec69ccb064a51d27ae1a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 1 Feb 2010 21:32:33 +0100 Subject: [PATCH] autorecovery: more sophisticated configuration data for interaction handlers The generic css.task.InteractionHandler implementation in module uui is now able to instantiate "sub handlers", i.e. components to delegate a request to, based on the type of the request, and some configuration data. The "old" (and now deprecated) configuration scheme at org.openoffice.ucb.InteractionHandler did not contain type information, so any handlers registered there were always called when no default implementation for a given request was available. The "new" configuration scheme at org.openoffice.Interaction contains UNO type information. That is, a given handler implementation can declare itself responsible for an arbitrary set of UNO types, and for each of those types, whether it is also responsible for sub types. The generic interaction handler implementation uses this configuration data, when it encounteres an interaction request it cannot fullfill itself, to instantiate a component to delegate the request to. As with the "old" data, such a component is required to support the css.task.XInteractionHandler2 interface. Also, if it supports css.lang.XInitialization, then it will be initialized with a name-value pair, the name being "Parent", the value being the XWindow interface of the parent window for any message boxes. As an examplary implementation for this feature, the css.sdb.InteractionHandler has been deprecated. Now the css.sdb.DatabaseInteractionHandler is reponsible for database-related interactions, and the new configuration scheme is pre-filled with data assigning this responsibility. Consequently, a lot of places previously creating an css.sdb.InteractionHandler have been modified to create the default css.task.InteractionHandler. --- odk/examples/CLI/CSharp/Spreadsheet/SpreadsheetSample.cs | 2 +- odk/examples/DevelopersGuide/Forms/GridFieldValidator.java | 2 +- odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/odk/examples/CLI/CSharp/Spreadsheet/SpreadsheetSample.cs b/odk/examples/CLI/CSharp/Spreadsheet/SpreadsheetSample.cs index 34ea967fe710..9b78a289fb21 100644 --- a/odk/examples/CLI/CSharp/Spreadsheet/SpreadsheetSample.cs +++ b/odk/examples/CLI/CSharp/Spreadsheet/SpreadsheetSample.cs @@ -1084,7 +1084,7 @@ public class SpreadsheetSample : SpreadsheetDocHelper unoidl.com.sun.star.task.XInteractionHandler xHandler = (unoidl.com.sun.star.task.XInteractionHandler) xServiceManager.createInstance( - "com.sun.star.sdb.InteractionHandler" ); + "com.sun.star.task.InteractionHandler" ); unoidl.com.sun.star.sdbcx.XTablesSupplier xSupplier = (unoidl.com.sun.star.sdbcx.XTablesSupplier) xSource.connectWithCompletion( xHandler ); diff --git a/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java b/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java index 1afd640fb413..0a924b100e97 100644 --- a/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java +++ b/odk/examples/DevelopersGuide/Forms/GridFieldValidator.java @@ -118,7 +118,7 @@ class GridFieldValidator implements XUpdateListener XInteractionHandler xHandler = (XInteractionHandler)UnoRuntime.queryInterface( XInteractionHandler.class, m_xCtx.getServiceManager().createInstanceWithContext( - "com.sun.star.sdb.InteractionHandler", m_xCtx ) ); + "com.sun.star.task.InteractionHandler", m_xCtx ) ); // create a new request and execute it InteractionRequest aRequest = new InteractionRequest( aError ); diff --git a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java index 283f36fcbfd3..9a2253a9460f 100644 --- a/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java +++ b/odk/examples/DevelopersGuide/Spreadsheet/SpreadsheetSample.java @@ -1106,7 +1106,7 @@ public class SpreadsheetSample extends SpreadsheetDocHelper (com.sun.star.task.XInteractionHandler)UnoRuntime.queryInterface( com.sun.star.task.XInteractionHandler.class, xServiceManager.createInstanceWithContext( - "com.sun.star.sdb.InteractionHandler", getContext()) ); + "com.sun.star.task.InteractionHandler", getContext()) ); com.sun.star.sdbcx.XTablesSupplier xSupplier = (com.sun.star.sdbcx.XTablesSupplier)UnoRuntime.queryInterface( com.sun.star.sdbcx.XTablesSupplier.class,