From a3ba5c95c6b7f1b2054b6cbd73eb74c29735a7d9 Mon Sep 17 00:00:00 2001
From: Jens-Heiner Rechtien
Date: Wed, 19 Mar 2003 15:20:19 +0000
Subject: MWS_SRX644: migrate branch mws_srx644 -> HEAD
---
configmgr/prj/build.lst | 3 +-
configmgr/source/api/confeventhelpers.cxx | 11 +-
configmgr/source/api/confeventhelpers.hxx | 8 +-
configmgr/source/api/confevents.cxx | 12 +-
configmgr/source/api/makefile.mk | 26 +-
configmgr/source/api2/accessimpl.cxx | 140 +-
configmgr/source/api2/accessimpl.hxx | 32 +-
configmgr/source/api2/apifactory.cxx | 11 +-
configmgr/source/api2/apifactory.hxx | 17 +-
configmgr/source/api2/apifactoryimpl.cxx | 5 +-
configmgr/source/api2/apinodeaccess.hxx | 13 +-
configmgr/source/api2/apinodeupdate.hxx | 11 +-
configmgr/source/api2/apinotifierimpl.hxx | 9 +-
configmgr/source/api2/apitreeaccess.hxx | 15 +-
configmgr/source/api2/apitreeimplobj.cxx | 89 +-
configmgr/source/api2/apitreeimplobj.hxx | 29 +-
configmgr/source/api2/broadcaster.cxx | 93 +-
configmgr/source/api2/broadcaster.hxx | 5 +-
configmgr/source/api2/committer.cxx | 18 +-
configmgr/source/api2/confignotifier.hxx | 17 +-
configmgr/source/api2/confprovider2.cxx | 177 +-
configmgr/source/api2/confprovider2.hxx | 16 +-
configmgr/source/api2/confproviderimpl2.cxx | 87 +-
configmgr/source/api2/confproviderimpl2.hxx | 6 +-
configmgr/source/api2/elementaccess.cxx | 114 +-
configmgr/source/api2/elementaccess.hxx | 9 +-
configmgr/source/api2/elementimpl.cxx | 7 +-
configmgr/source/api2/elementimpl.hxx | 9 +-
configmgr/source/api2/groupaccess.cxx | 31 +-
configmgr/source/api2/groupaccess.hxx | 9 +-
configmgr/source/api2/groupupdate.cxx | 10 +-
configmgr/source/api2/groupupdate.hxx | 8 +-
configmgr/source/api2/listenercontainer.cxx | 6 +-
configmgr/source/api2/listenercontainer.hxx | 38 +-
configmgr/source/api2/makefile.mk | 13 +-
configmgr/source/api2/notifierimpl.hxx | 6 +-
configmgr/source/api2/objectregistry.hxx | 5 +-
configmgr/source/api2/propertyinfohelper.cxx | 10 +-
configmgr/source/api2/propertyinfohelper.hxx | 12 +-
configmgr/source/api2/propertysetaccess.cxx | 53 +-
configmgr/source/api2/propertysetaccess.hxx | 9 +-
configmgr/source/api2/propsetaccessimpl.cxx | 13 +-
configmgr/source/api2/propsetaccessimpl.hxx | 9 +-
configmgr/source/api2/provider.cxx | 120 +-
configmgr/source/api2/provider.hxx | 24 +-
configmgr/source/api2/providerimpl.cxx | 183 +-
configmgr/source/api2/providerimpl.hxx | 80 +-
configmgr/source/api2/setaccess.cxx | 63 +-
configmgr/source/api2/setaccess.hxx | 32 +-
configmgr/source/api2/setupdate.cxx | 46 +-
configmgr/source/api2/setupdate.hxx | 8 +-
configmgr/source/api2/translatechanges.hxx | 6 +-
configmgr/source/api2/treeiterators.cxx | 127 ++
configmgr/source/api2/treeiterators.hxx | 135 ++
configmgr/source/api2/updateimpl.cxx | 7 +-
configmgr/source/api2/updateimpl.hxx | 9 +-
configmgr/source/backend/backendaccess.cxx | 33 +-
configmgr/source/backend/backendaccess.hxx | 16 +-
configmgr/source/backend/backendfactory.cxx | 283 +++-
configmgr/source/backend/componentdatahelper.cxx | 30 +-
configmgr/source/backend/componentdatahelper.hxx | 28 +-
configmgr/source/backend/emptylayerimpl.hxx | 6 +-
configmgr/source/backend/importsvc.cxx | 28 +-
configmgr/source/backend/importsvc.hxx | 21 +-
configmgr/source/backend/layermerge.cxx | 132 +-
configmgr/source/backend/layermerge.hxx | 17 +-
configmgr/source/backend/layerupdatehandler.cxx | 12 +-
configmgr/source/backend/layerupdatehandler.hxx | 6 +-
configmgr/source/backend/makefile.mk | 4 +-
configmgr/source/backend/mergedcomponentdata.cxx | 20 +-
configmgr/source/backend/mergedcomponentdata.hxx | 12 +-
configmgr/source/backend/schemabuilder.cxx | 69 +-
configmgr/source/backend/schemabuilder.hxx | 10 +-
configmgr/source/backend/singlebackendadapter.cxx | 33 +-
configmgr/source/backend/singlebackendadapter.hxx | 16 +-
configmgr/source/backend/updatesvc.cxx | 10 +-
configmgr/source/backend/updatesvc.hxx | 11 +-
configmgr/source/cmdtools/makefile.mk | 32 +-
configmgr/source/inc/anynoderef.hxx | 6 +-
configmgr/source/inc/apitypes.hxx | 25 +-
configmgr/source/inc/attributes.hxx | 9 +-
configmgr/source/inc/backendfactory.hxx | 39 +-
configmgr/source/inc/bootstrap.hxx | 412 ++---
configmgr/source/inc/bootstrapcontext.hxx | 154 +-
configmgr/source/inc/cachefactory.hxx | 19 +-
configmgr/source/inc/change.hxx | 12 +-
configmgr/source/inc/commontypes.hxx | 29 +-
configmgr/source/inc/confapifactory.hxx | 122 +-
configmgr/source/inc/confevents.hxx | 27 +-
configmgr/source/inc/configdefaultprovider.hxx | 11 +-
configmgr/source/inc/configexcept.hxx | 20 +-
configmgr/source/inc/configgroup.hxx | 7 +-
configmgr/source/inc/configpath.hxx | 14 +-
configmgr/source/inc/configset.hxx | 7 +-
configmgr/source/inc/defaultprovider.hxx | 24 +-
configmgr/source/inc/localizedtreeactions.hxx | 6 +-
configmgr/source/inc/mergeddataprovider.hxx | 58 +-
configmgr/source/inc/nodechange.hxx | 7 +-
configmgr/source/inc/nodechangeinfo.hxx | 7 +-
configmgr/source/inc/noderef.hxx | 17 +-
configmgr/source/inc/options.hxx | 58 +-
configmgr/source/inc/request.hxx | 18 +-
configmgr/source/inc/requestoptions.hxx | 34 +-
configmgr/source/inc/requesttypes.hxx | 8 +-
configmgr/source/inc/roottree.hxx | 10 +-
configmgr/source/inc/serviceinfohelper.hxx | 8 +-
configmgr/source/inc/strdecl.hxx | 75 +-
configmgr/source/inc/template.hxx | 15 +-
configmgr/source/inc/tracer.hxx | 38 +-
configmgr/source/inc/treeactions.hxx | 9 +-
configmgr/source/inc/treechangefactory.hxx | 10 +-
configmgr/source/inc/treechangelist.hxx | 45 +-
configmgr/source/inc/treemanager.hxx | 34 +-
configmgr/source/inc/treenodefactory.hxx | 14 +-
configmgr/source/inc/treeprovider.hxx | 63 +-
configmgr/source/inc/utility.hxx | 7 +-
configmgr/source/inc/valuenode.hxx | 58 +-
configmgr/source/inc/valueref.hxx | 7 +-
configmgr/source/inc/valuetypeconverter.hxx | 7 +-
configmgr/source/inc/wrapexception.hxx | 50 +-
configmgr/source/localbe/localdataimportsvc.cxx | 14 +-
configmgr/source/localbe/localdataimportsvc.hxx | 11 +-
.../source/localbe/localhierarchybrowsersvc.cxx | 8 +-
.../source/localbe/localhierarchybrowsersvc.hxx | 11 +-
configmgr/source/localbe/localsinglebackend.cxx | 298 +++-
configmgr/source/localbe/localsinglebackend.hxx | 50 +-
configmgr/source/misc/bootstrap.cxx | 1771 ++++++--------------
configmgr/source/misc/bootstrapcontext.cxx | 373 ++++-
configmgr/source/misc/configunoreg.cxx | 200 ++-
configmgr/source/misc/makefile.mk | 22 +-
configmgr/source/misc/providerfactory.cxx | 471 ++----
configmgr/source/misc/providerfactory.hxx | 153 +-
configmgr/source/misc/providerwrapper.cxx | 220 +++
configmgr/source/misc/providerwrapper.hxx | 155 ++
configmgr/source/misc/requestoptions.cxx | 21 +-
configmgr/source/misc/strimpl.cxx | 78 +-
configmgr/source/misc/tracer.cxx | 59 +-
configmgr/source/registry/configregistry.cxx | 30 +-
configmgr/source/tree/cmtree.cxx | 18 +-
configmgr/source/tree/cmtreemodel.cxx | 12 +-
configmgr/source/tree/localizedtreeactions.cxx | 15 +-
configmgr/source/tree/makefile.mk | 14 +-
configmgr/source/tree/mergehelper.cxx | 9 +-
configmgr/source/tree/subtree.hxx | 8 +-
configmgr/source/tree/treechangefactory.cxx | 17 +-
configmgr/source/tree/treenodefactory.cxx | 21 +-
configmgr/source/tree/updatehelper.cxx | 6 +-
configmgr/source/treecache/cacheaccess.cxx | 6 +-
configmgr/source/treecache/cacheaccess.hxx | 11 +-
configmgr/source/treecache/cachecontroller.cxx | 15 +-
configmgr/source/treecache/cachecontroller.hxx | 4 +-
configmgr/source/treecache/cachedata.cxx | 6 +-
configmgr/source/treecache/cachedata.hxx | 4 +-
configmgr/source/treecache/cachefactory.cxx | 8 +-
configmgr/source/treecache/cacheline.cxx | 223 +--
configmgr/source/treecache/cacheline.hxx | 9 +-
configmgr/source/treecache/disposetimer.hxx | 7 +-
configmgr/source/treecache/invalidatetree.cxx | 4 +-
configmgr/source/treecache/timestamp.hxx | 5 +-
configmgr/source/treecache/treemanager.cxx | 104 +-
configmgr/source/treemgr/configdefaultprovider.cxx | 9 +-
configmgr/source/treemgr/configexcept.cxx | 8 +-
configmgr/source/treemgr/configset.cxx | 12 +-
configmgr/source/treemgr/defaultproviderproxy.cxx | 16 +-
configmgr/source/treemgr/defaultproviderproxy.hxx | 16 +-
configmgr/source/treemgr/makefile.mk | 5 +-
configmgr/source/treemgr/nodechangeimpl.hxx | 7 +-
configmgr/source/treemgr/nodeimpl.cxx | 8 +-
configmgr/source/treemgr/nodeimpl.hxx | 7 +-
configmgr/source/treemgr/noderef.cxx | 18 +-
configmgr/source/treemgr/roottree.cxx | 9 +-
configmgr/source/treemgr/setnodeimpl.cxx | 6 +-
configmgr/source/treemgr/template.cxx | 11 +-
configmgr/source/treemgr/templateimpl.cxx | 17 +-
configmgr/source/treemgr/templateimpl.hxx | 19 +-
configmgr/source/treemgr/treeimpl.hxx | 15 +-
configmgr/source/treemgr/valuemembernode.cxx | 6 +-
configmgr/source/treemgr/valuemembernode.hxx | 6 +-
configmgr/source/xml/layerwriter.cxx | 14 +-
configmgr/source/xml/layerwriter.hxx | 6 +-
configmgr/source/xml/makefile.mk | 32 +-
configmgr/source/xml/parsersvc.cxx | 26 +-
configmgr/source/xml/parsersvc.hxx | 11 +-
configmgr/source/xml/typeconverter.cxx | 5 +-
configmgr/source/xml/valueconverter.cxx | 292 +---
configmgr/source/xml/valueformatter.cxx | 9 +-
configmgr/source/xml/valueformatter.hxx | 11 +-
configmgr/source/xml/writersvc.cxx | 10 +-
configmgr/source/xml/writersvc.hxx | 13 +-
configmgr/source/xml/xmlstrings.hxx | 5 +-
configmgr/util/makefile.mk | 6 +-
configmgr/workben/apitest/cfgadduser.cxx | 7 +-
configmgr/workben/apitest/cfgadmin.cxx | 10 +-
configmgr/workben/apitest/cfgapi.cxx | 608 ++++---
configmgr/workben/apitest/cfgapi_timetest.cxx | 16 +-
configmgr/workben/apitest/cfgupdate.cxx | 12 +-
configmgr/workben/apitest/makefile.mk | 8 +-
configmgr/workben/apitest/sregistry | 8 +
configmgr/workben/local_io/makefile.mk | 5 +-
configmgr/workben/local_io/simpletest.cxx | 19 +-
200 files changed, 4993 insertions(+), 5296 deletions(-)
create mode 100644 configmgr/source/api2/treeiterators.cxx
create mode 100644 configmgr/source/api2/treeiterators.hxx
create mode 100644 configmgr/source/misc/providerwrapper.cxx
create mode 100644 configmgr/source/misc/providerwrapper.hxx
create mode 100644 configmgr/workben/apitest/sregistry
diff --git a/configmgr/prj/build.lst b/configmgr/prj/build.lst
index 91f16e0b92..d06f880644 100644
--- a/configmgr/prj/build.lst
+++ b/configmgr/prj/build.lst
@@ -3,7 +3,6 @@ cg configmgr usr1 - all cg_mkout NULL
cg configmgr\source\cmdtools nmake - all cg_cmdtools cg_misc NULL
cg configmgr\source\cppugen nmake - all cg_cppugen NULL
cg configmgr\source\misc nmake - all cg_misc cg_cppugen NULL
-cg configmgr\source\session nmake - all cg_session cg_cppugen NULL
cg configmgr\source\data nmake - all cg_data cg_cppugen NULL
cg configmgr\source\tree nmake - all cg_tree cg_cppugen NULL
cg configmgr\source\treecache nmake - all cg_trcache cg_cppugen NULL
@@ -13,6 +12,6 @@ cg configmgr\source\api nmake - all cg_api cg_cppugen NULL
cg configmgr\source\api2 nmake - all cg_api2 cg_cppugen NULL
cg configmgr\source\treemgr nmake - all cg_treemgr cg_cppugen NULL
cg configmgr\source\registry nmake - all cg_reg cg_cppugen NULL
-cg configmgr\util nmake - all cg_util cg_api cg_api2 cg_cmdtools cg_misc cg_reg cg_session cg_trcache cg_data cg_tree cg_treemgr cg_xml cg_backend cg_localbe NULL
+cg configmgr\util nmake - all cg_util cg_api cg_api2 cg_cmdtools cg_misc cg_reg cg_trcache cg_data cg_tree cg_treemgr cg_xml cg_backend cg_localbe NULL
cg configmgr\source\localbe nmake - all cg_localbe cg_cppugen NULL
diff --git a/configmgr/source/api/confeventhelpers.cxx b/configmgr/source/api/confeventhelpers.cxx
index 874dcda5fd..24c51a9a57 100644
--- a/configmgr/source/api/confeventhelpers.cxx
+++ b/configmgr/source/api/confeventhelpers.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: confeventhelpers.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: hr $ $Date: 2002-02-21 14:07:21 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -63,9 +63,6 @@
#include
#include "confeventhelpers.hxx"
-#ifndef INCLUDED_CONFIGMGR_NAMECREATOR_HXX
-#include "namecreator.hxx"
-#endif
#ifndef CONFIGMGR_CONFIGEXCEPT_HXX_
#include "configexcept.hxx"
#endif
@@ -211,7 +208,7 @@ void ConfigChangesBroadcasterImpl::dispatchInner
using namespace configuration;
try
{
- OSL_ASSERT(pTarget.isValid());
+ OSL_ASSERT(pTarget.is());
OSL_ASSERT( Path::hasPrefix( _aTargetPath, _aChangeLocation ) );
RelativePath aLocalPath = Path::stripPrefix( _aTargetPath, _aChangeLocation );
@@ -246,7 +243,7 @@ void ConfigChangesBroadcasterImpl::dispatchOuter
IConfigBroadcaster* pSource
)
{
- OSL_ASSERT(pTarget.isValid());
+ OSL_ASSERT(pTarget.is());
OSL_ASSERT( Path::hasPrefix( _aChangeLocation, _aTargetPath) );
pTarget->nodeChanged(_aChangedDataAccessor, rBaseChange, _aChangeLocation, pSource);
diff --git a/configmgr/source/api/confeventhelpers.hxx b/configmgr/source/api/confeventhelpers.hxx
index d5487bbfb2..edb431be50 100644
--- a/configmgr/source/api/confeventhelpers.hxx
+++ b/configmgr/source/api/confeventhelpers.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: confeventhelpers.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -195,10 +195,10 @@ namespace configmgr
INodeListener& operator*() const { return *m_pListener; }
// needed to allow if (info) ...
struct HasListener;
- operator HasListener const*() const { return reinterpret_cast(m_pListener.getBodyPtr()); }
+ operator HasListener const*() const { return reinterpret_cast(m_pListener.get()); }
bool operator < (NodeListenerInfo const& aInfo) const
- { return std::less()(m_pListener.getBodyPtr(), aInfo.m_pListener.getBodyPtr()); }
+ { return std::less()(m_pListener.get(), aInfo.m_pListener.get()); }
bool operator == (NodeListenerInfo const& aInfo) const
{ return !!( m_pListener == aInfo.m_pListener); }
diff --git a/configmgr/source/api/confevents.cxx b/configmgr/source/api/confevents.cxx
index 159aaecbda..fe494fb2c1 100644
--- a/configmgr/source/api/confevents.cxx
+++ b/configmgr/source/api/confevents.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: confevents.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: hr $ $Date: 2002-02-21 14:07:21 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -123,9 +123,9 @@ namespace configmgr
/////////////////////////////////////////////////////////////////////////
// IConfigBroadcaster implementation
- void ConfigChangeBroadcaster::addListener(AbsolutePath const& aName, const vos::ORef < OOptions >& _xOptions, INodeListenerRef const& pHandler)
+ void ConfigChangeBroadcaster::addListener(AbsolutePath const& aName, RequestOptions const & _aOptions, INodeListenerRef const& pHandler)
{
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_xOptions,true))
+ if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_aOptions,true))
{
pHelper->addListener(aName, pHandler);
}
@@ -133,9 +133,9 @@ namespace configmgr
OSL_ASSERT(false);
}
- void ConfigChangeBroadcaster::removeListener(const vos::ORef < OOptions >& _xOptions, INodeListenerRef const& pHandler)
+ void ConfigChangeBroadcaster::removeListener(RequestOptions const & _aOptions, INodeListenerRef const& pHandler)
{
- if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_xOptions,false))
+ if (ConfigChangeBroadcastHelper* pHelper = getBroadcastHelper(_aOptions,false))
{
pHelper->removeListener( pHandler);
}
diff --git a/configmgr/source/api/makefile.mk b/configmgr/source/api/makefile.mk
index ab54f03f9c..4ca3956e27 100644
--- a/configmgr/source/api/makefile.mk
+++ b/configmgr/source/api/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.2 $
+# $Revision: 1.3 $
#
-# last change: $Author: dg $ $Date: 2000-11-30 08:17:49 $
+# last change: $Author: hr $ $Date: 2003-03-19 16:18:24 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -74,32 +74,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files -------------------------------------
SLOFILES= \
- $(SLO)$/encodename.obj \
$(SLO)$/confevents.obj \
$(SLO)$/confeventhelpers.obj \
$(SLO)$/confsvccomponent.obj
-
-# $(SLO)$/useradminimpl.obj \
-# $(SLO)$/readaccessimpl.obj \
-# $(SLO)$/confaccessfactory.obj \
-# $(SLO)$/cfgupdatehelper.obj \
-# $(SLO)$/nodepropset.obj \
-# $(SLO)$/confreadaccess.obj \
-# $(SLO)$/confgroupaccess.obj \
-# $(SLO)$/confsetaccess.obj \
-# $(SLO)$/confupdateimpl.obj \
-# $(SLO)$/confupdateaccess.obj \
-# $(SLO)$/confbaseelement.obj \
-# $(SLO)$/confbaseaccess.obj \
-# $(SLO)$/confaccess.obj \
-# $(SLO)$/confsvccomponent.obj \
-# $(SLO)$/confeventhelpers.obj \
-# $(SLO)$/confprovider.obj \
-# $(SLO)$/confproviderimpl.obj \
-# $(SLO)$/confchangesset.obj \
-# $(SLO)$/changenotifier.obj \
-
# --- Targets ----------------------------------
.INCLUDE : target.mk
diff --git a/configmgr/source/api2/accessimpl.cxx b/configmgr/source/api2/accessimpl.cxx
index 01a3b0ec6b..08cfdeaa96 100644
--- a/configmgr/source/api2/accessimpl.cxx
+++ b/configmgr/source/api2/accessimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accessimpl.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,15 +80,18 @@
#ifndef CONFIGMGR_CONFIGNOTIFIER_HXX_
#include "confignotifier.hxx"
#endif
-#ifndef CONFIGMGR_API_ENCODENAME_HXX_
-#include "encodename.hxx"
-#endif
#ifndef CONFIGMGR_API_PROPERTYINFOIMPL_HXX_
#include "propertyinfohelper.hxx"
#endif
#ifndef CONFIGMGR_TREEITERATORS_HXX_
#include "treeiterators.hxx"
#endif
+#ifndef CONFIGMGR_CONFIGURATION_ATTRIBUTES_HXX_
+#include "attributes.hxx"
+#endif
+#ifndef CONFIGMGR_API_APITYPES_HXX_
+#include "apitypes.hxx"
+#endif
#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
#include
@@ -132,7 +135,7 @@ namespace configmgr
using configuration::Name;
using configuration::AbsolutePath;
using configuration::RelativePath;
- using configuration::Attributes;
+ using node::Attributes;
//-----------------------------------------------------------------------------------
// Constructors
@@ -535,7 +538,7 @@ OUString implGetExactName(NodeSetInfoAccess& rNode, const OUString& rApproximate
return rApproximateName;
}
-// XNameAccess
+// XProperty
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
@@ -568,6 +571,87 @@ beans::Property implGetAsProperty(NodeAccess& rNode)
OSL_ASSERT(!"Unreachable code");
return Property();
}
+// XPropertySetInfo
+//-----------------------------------------------------------------------------------
+
+//-----------------------------------------------------------------------------------
+uno::Sequence< css::beans::Property > implGetProperties( NodeAccess& rNode ) throw (uno::RuntimeException)
+{
+ CollectPropertyInfo aCollect;
+
+ try
+ {
+ GuardedNodeDataAccess lock( rNode );
+
+ lock.getTree().dispatchToChildren(lock.getNode(), aCollect);
+ }
+ catch (configuration::Exception& ex)
+ {
+ ExceptionMapper e(ex);
+ e.setContext( rNode.getUnoInstance() );
+ e.unhandled();
+ }
+
+ return makeSequence( aCollect.list() );
+}
+
+//-----------------------------------------------------------------------------------
+css::beans::Property implGetPropertyByName( NodeAccess& rNode, const OUString& aName )
+ throw (css::beans::UnknownPropertyException, uno::RuntimeException)
+{
+ try
+ {
+ GuardedNodeDataAccess lock( rNode );
+
+ Tree aTree( lock.getTree() );
+ NodeRef const aNode( lock.getNode() );
+
+ Name aChildName = configuration::validateChildOrElementName(aName,aTree,aNode);
+
+ AnyNodeRef aChildNode = configuration::getChildOrElement(aTree,aNode, aChildName);
+
+ if (!aChildNode.isValid())
+ {
+ OSL_ENSURE(!configuration::hasChildOrElement(aTree,aNode,aChildName),"ERROR: Configuration: Existing Property not found by implementation");
+
+ OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration - Cannot get Property. Property '") );
+ sMessage += aName;
+ sMessage += OUString( RTL_CONSTASCII_USTRINGPARAM("' could not be found in ") );
+ sMessage += aTree.getAbsolutePath(aNode).toString();
+
+ Reference xContext( rNode.getUnoInstance() );
+ throw css::beans::UnknownPropertyException( sMessage, xContext );
+ }
+
+ Attributes aChildAttributes = aTree.getAttributes(aChildNode);
+ uno::Type aApiType = aChildNode.isNode() ? getUnoInterfaceType() : aTree.getUnoType(aChildNode.toValue());
+
+ return helperMakeProperty( aChildName,aChildAttributes,aApiType, aTree.hasNodeDefault(aChildNode) );
+ }
+ catch (configuration::InvalidName& ex)
+ {
+ ExceptionMapper e(ex);
+ Reference xContext( rNode.getUnoInstance() );
+ throw css::beans::UnknownPropertyException( e.message(), xContext );
+ }
+ catch (configuration::Exception& ex)
+ {
+ ExceptionMapper e(ex);
+ e.setContext( rNode.getUnoInstance() );
+ e.unhandled();
+ }
+
+ // unreachable, but still there to make some compilers happy
+ OSL_ASSERT(!"Unreachable code");
+ return css::beans::Property();
+}
+
+
+//-----------------------------------------------------------------------------------
+sal_Bool implHasPropertyByName( NodeAccess& rNode, const OUString& Name ) throw (uno::RuntimeException)
+{
+ return implHasByName(rNode, Name);
+}
// XNameAccess
//-----------------------------------------------------------------------------------
@@ -833,48 +917,6 @@ OUString SAL_CALL implGetElementTemplateName(NodeSetInfoAccess& rNode)
return rNode.getElementInfo(lock.getDataAccessor()).getTemplateInfo().getTemplatePathString();
}
-// XStringEscape
-//-----------------------------------------------------------------------------------
-OUString SAL_CALL implEscapeString(NodeAccess& rNode, const OUString& aString)
- throw(css::lang::IllegalArgumentException, RuntimeException)
-{
- OUString sRet;
- try
- {
- sRet = escaped_name::escapeString(aString,0,1);
- }
- catch (css::lang::IllegalArgumentException& ex)
- {
- ex.Context = rNode.getUnoInstance();
- throw;
- }
- catch (uno::Exception& ex)
- {
- throw RuntimeException(ex.Message, rNode.getUnoInstance());
- }
- return sRet;
-}
-
-OUString SAL_CALL implUnescapeString(NodeAccess& rNode, const OUString& aEscapedString)
- throw(css::lang::IllegalArgumentException, RuntimeException)
-{
- OUString sRet;
- try
- {
- sRet = escaped_name::unescapeString(aEscapedString,0,1);
- }
- catch (css::lang::IllegalArgumentException& ex)
- {
- ex.Context = rNode.getUnoInstance();
- throw;
- }
- catch (uno::Exception& ex)
- {
- throw RuntimeException(ex.Message, rNode.getUnoInstance());
- }
- return sRet;
-}
-
//-----------------------------------------------------------------------------------
} // namespace configapi
diff --git a/configmgr/source/api2/accessimpl.hxx b/configmgr/source/api2/accessimpl.hxx
index 66ad90ac24..d1914a4ae9 100644
--- a/configmgr/source/api2/accessimpl.hxx
+++ b/configmgr/source/api2/accessimpl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: accessimpl.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jb $ $Date: 2001-09-28 12:44:03 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,10 +62,6 @@
#ifndef CONFIGMGR_API_BASEACCESSIMPL_HXX_
#define CONFIGMGR_API_BASEACCESSIMPL_HXX_
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
#ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAME_HPP_
#include
#endif
@@ -87,17 +83,18 @@
#ifndef _COM_SUN_STAR_BEANS_XPROPERTY_HPP_
#include
#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
+#include
+#endif
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYWITHSTATE_HPP_
#include
#endif
-#ifndef _COM_SUN_STAR_UTIL_XSTRINGESCAPE_HPP_
-#include
-#endif
namespace configmgr
{
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
+ using rtl::OUString;
/* implementations of the interfaces supported by a (parent) node
within the configuration tree.
@@ -160,6 +157,17 @@ namespace configmgr
css::beans::Property implGetAsProperty(NodeAccess& rNode)
throw(uno::RuntimeException);
+ // XPropertySetInfo
+ uno::Sequence< css::beans::Property > implGetProperties( NodeAccess& rNode )
+ throw (uno::RuntimeException);
+
+ css::beans::Property implGetPropertyByName( NodeAccess& rNode, const OUString& aName )
+ throw (css::beans::UnknownPropertyException, uno::RuntimeException);
+
+ sal_Bool implHasPropertyByName( NodeAccess& rNode, const OUString& Name )
+ throw (uno::RuntimeException);
+
+
// XPropertyWithState
css::beans::PropertyState implGetStateAsProperty(NodeAccess& rNode)
throw (uno::RuntimeException);
@@ -176,12 +184,6 @@ namespace configmgr
OUString SAL_CALL implGetElementTemplateName(NodeSetInfoAccess& rNode)
throw(uno::RuntimeException);
- // XStringEscape
- OUString SAL_CALL implEscapeString(NodeAccess& rNode, const OUString& aString)
- throw(css::lang::IllegalArgumentException, uno::RuntimeException);
-
- OUString SAL_CALL implUnescapeString(NodeAccess& rNode, const OUString& aEscapedString)
- throw(css::lang::IllegalArgumentException, uno::RuntimeException);
}
}
diff --git a/configmgr/source/api2/apifactory.cxx b/configmgr/source/api2/apifactory.cxx
index 6fee1037f3..11981f92ad 100644
--- a/configmgr/source/api2/apifactory.cxx
+++ b/configmgr/source/api2/apifactory.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apifactory.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -108,7 +108,7 @@ Factory::Factory(ObjectRegistryHolder pRegistry)
: m_pRegistry(pRegistry)
, m_aTunnelID()
{
- OSL_ENSURE(pRegistry.isValid(), "ERROR: Factory requires a Object Registry");
+ OSL_ENSURE(pRegistry.is(), "ERROR: Factory requires a Object Registry");
}
//-----------------------------------------------------------------------------
@@ -276,7 +276,7 @@ void Factory::revokeElement(NodeID const& aNodeID, NodeElement& rElement)
}
//-----------------------------------------------------------------------------
-TreeElement* Factory::makeAccessRoot(Tree const& aTree, vos::ORef< OOptions >const& _xOptions)
+TreeElement* Factory::makeAccessRoot(Tree const& aTree, RequestOptions const& _aOptions)
{
OSL_PRECOND( !aTree.isEmpty() , "ERROR: Configuration: Making element from tree requires valid tree");
if (aTree.isEmpty()) return 0;
@@ -297,7 +297,8 @@ TreeElement* Factory::makeAccessRoot(Tree const& aTree, vos::ORef< OOptions >con
if (0 == pRet)
{
TemplateHolder aTemplate = implGetSetElementTemplate(aTree,aRoot);
- pRet = doCreateAccessRoot(aTree,aTemplate.get(), _xOptions);
+ vos::ORef xOptions = new OOptions(_aOptions);
+ pRet = doCreateAccessRoot(aTree,aTemplate.get(), xOptions);
implHaveNewElement (aNodeID,pRet);
}
return pRet;
diff --git a/configmgr/source/api2/apifactory.hxx b/configmgr/source/api2/apifactory.hxx
index 03f738c440..464aa647b2 100644
--- a/configmgr/source/api2/apifactory.hxx
+++ b/configmgr/source/api2/apifactory.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apifactory.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,12 +62,12 @@
#ifndef CONFIGMGR_API_FACTORY_HXX_
#define CONFIGMGR_API_FACTORY_HXX_
-#ifndef CONFIGMGR_API_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
#ifndef CONFIGMGR_MISC_OPTIONS_HXX_
#include "options.hxx"
#endif
+#ifndef CONFIGMGR_UTILITY_HXX_
+#include "utility.hxx"
+#endif
#ifndef _RTL_REF_HXX_
#include
@@ -97,6 +97,7 @@ namespace configmgr
}
namespace configapi
{
+ namespace uno = com::sun::star::uno;
typedef uno::XInterface UnoInterface;
typedef uno::Reference< uno::XInterface > UnoInterfaceRef;
typedef uno::Any UnoAny;
@@ -110,11 +111,11 @@ namespace configmgr
// used to register objects
class ObjectRegistry;
- typedef vos::ORef ObjectRegistryHolder;
+ typedef rtl::Reference ObjectRegistryHolder;
typedef cppu::OImplementationId UnoTunnelID;
// used to create UNO objects
- class Factory : NotCopyable
+ class Factory : Noncopyable
{
ObjectRegistryHolder m_pRegistry;
UnoTunnelID const m_aTunnelID;
@@ -137,7 +138,7 @@ namespace configmgr
NodeElement* findElement(configuration::NodeID const& aNode);
NodeElement* makeGroupMember(configuration::Tree const& aTree, configuration::NodeRef const& aNode);
- TreeElement* makeAccessRoot(configuration::Tree const& aTree, vos::ORef< OOptions >const& _xOptions);
+ TreeElement* makeAccessRoot(configuration::Tree const& aTree, RequestOptions const& _aOptions);
SetElement* makeSetElement(configuration::ElementTree const& aTree);
SetElement* findSetElement(configuration::ElementRef const& aElement);
diff --git a/configmgr/source/api2/apifactoryimpl.cxx b/configmgr/source/api2/apifactoryimpl.cxx
index e4a39aae23..094046db72 100644
--- a/configmgr/source/api2/apifactoryimpl.cxx
+++ b/configmgr/source/api2/apifactoryimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apifactoryimpl.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:28 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,6 +69,7 @@
#include "template.hxx"
#include "noderef.hxx"
#include "objectregistry.hxx"
+#include "attributes.hxx"
namespace configmgr
{
diff --git a/configmgr/source/api2/apinodeaccess.hxx b/configmgr/source/api2/apinodeaccess.hxx
index 9776c720a6..033b9c9867 100644
--- a/configmgr/source/api2/apinodeaccess.hxx
+++ b/configmgr/source/api2/apinodeaccess.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apinodeaccess.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,7 +62,9 @@
#ifndef CONFIGMGR_API_NODEACCESS_HXX_
#define CONFIGMGR_API_NODEACCESS_HXX_
-#include "apitypes.hxx"
+#ifndef CONFIGMGR_UTILITY_HXX_
+#include "utility.hxx"
+#endif
namespace osl { class Mutex; }
@@ -94,6 +96,7 @@ namespace configmgr
class ApiTreeImpl;
+ namespace uno = com::sun::star::uno;
typedef uno::XInterface UnoInterface;
typedef uno::Any UnoAny;
@@ -101,7 +104,7 @@ namespace configmgr
// these objects just provide the pieces needed to navigate and manipulate trees and nodes
// The common part of all nodes, provides all you need to read and listen
- class NodeAccess : NotCopyable
+ class NodeAccess : Noncopyable
{
public:
virtual ~NodeAccess();
@@ -184,7 +187,7 @@ namespace configmgr
// Guarding and locking implementations
/// guards a NodeAccess; provides an object (read) lock, ensures object was not disposed
- class NodeReadGuardImpl : NotCopyable
+ class NodeReadGuardImpl : Noncopyable
{
osl::MutexGuard m_aLock;
NodeAccess& m_rNode;
diff --git a/configmgr/source/api2/apinodeupdate.hxx b/configmgr/source/api2/apinodeupdate.hxx
index 7991cd528e..cfbea1da42 100644
--- a/configmgr/source/api2/apinodeupdate.hxx
+++ b/configmgr/source/api2/apinodeupdate.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apinodeupdate.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,14 +62,15 @@
#ifndef CONFIGMGR_API_NODEUPDATE_HXX_
#define CONFIGMGR_API_NODEUPDATE_HXX_
-#include "apitypes.hxx"
-
#ifndef CONFIGMGR_API_NODEACCESS_HXX_
#include "apinodeaccess.hxx"
#endif
#ifndef CONFIGMGR_ACCESSOR_HXX
#include "accessor.hxx"
#endif
+#ifndef CONFIGMGR_UTILITY_HXX_
+#include "utility.hxx"
+#endif
namespace configmgr
{
@@ -151,7 +152,7 @@ namespace configmgr
// Guarding and locking implementations
/// guards a NodeGroupAccess, or NodeSetAccess; provides an object (write)/provider(read) lock; ensures object was not disposed
- class UpdateGuardImpl : NotCopyable
+ class UpdateGuardImpl : Noncopyable
{
memory::Accessor m_aDataAccess;
osl::MutexGuard m_aViewLock;
diff --git a/configmgr/source/api2/apinotifierimpl.hxx b/configmgr/source/api2/apinotifierimpl.hxx
index cca1cd4115..bb77932237 100644
--- a/configmgr/source/api2/apinotifierimpl.hxx
+++ b/configmgr/source/api2/apinotifierimpl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apinotifierimpl.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jb $ $Date: 2000-11-07 14:34:32 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,10 +62,6 @@
#ifndef CONFIGMGR_API_NOTIFIERIMPL_HXX_
#define CONFIGMGR_API_NOTIFIERIMPL_HXX_
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
#include
#endif
@@ -86,6 +82,7 @@ namespace configmgr
{
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
+ using rtl::OUString;
/* implementations of the event notification interfaces
supported by a node within the configuration tree.
diff --git a/configmgr/source/api2/apitreeaccess.hxx b/configmgr/source/api2/apitreeaccess.hxx
index b8e1450101..87906c8f87 100644
--- a/configmgr/source/api2/apitreeaccess.hxx
+++ b/configmgr/source/api2/apitreeaccess.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apitreeaccess.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jb $ $Date: 2002-12-06 13:08:28 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,15 +62,15 @@
#ifndef CONFIGMGR_API_TREEACCESS_HXX_
#define CONFIGMGR_API_TREEACCESS_HXX_
-#ifndef CONFIGMGR_API_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
#ifndef CONFIGMGR_ACCESSOR_HXX
#include "accessor.hxx"
#endif
#ifndef CONFIGMGR_MISC_OPTIONS_HXX_
#include "options.hxx"
#endif
+#ifndef CONFIGMGR_UTILITY_HXX_
+#include "utility.hxx"
+#endif
namespace osl { class Mutex; }
@@ -99,6 +99,7 @@ namespace configmgr
namespace configapi
{
//-----------------------------------------------------------------------------
+ namespace uno = com::sun::star::uno;
typedef uno::XInterface UnoInterface;
typedef uno::Any UnoAny;
//-----------------------------------------------------------------------------
@@ -115,7 +116,7 @@ namespace configmgr
// these objects just provide the pieces needed to navigate and manipulate trees and nodes
// A common base class for 'element' classes
- class NodeElement : NotCopyable
+ class NodeElement : Noncopyable
{
public:
typedef ServiceImplementationInfo ServiceInfo;
@@ -202,7 +203,7 @@ namespace configmgr
};
//-----------------------------------------------------------------------------
/// guards a TreeElement; provides an object (read) lock, ensures object was not disposed
- class TreeReadGuardImpl : NotCopyable
+ class TreeReadGuardImpl : Noncopyable
{
osl::MutexGuard m_aViewLock;
TreeElement& m_rTree;
diff --git a/configmgr/source/api2/apitreeimplobj.cxx b/configmgr/source/api2/apitreeimplobj.cxx
index f9f7ffb1b7..dd4d15ebe5 100644
--- a/configmgr/source/api2/apitreeimplobj.cxx
+++ b/configmgr/source/api2/apitreeimplobj.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apitreeimplobj.cxx,v $
*
- * $Revision: 1.33 $
+ * $Revision: 1.34 $
*
- * last change: $Author: jb $ $Date: 2002-10-15 15:03:52 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:29 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -171,7 +171,7 @@ void ApiTreeImpl::ComponentAdapter::setComponent(
aGuard.clear();
- if (xOld.is()) xOld->removeEventListener(this);
+ if (xOld.is()) try { xOld->removeEventListener(this); } catch (uno::Exception & ) {}
if (xComp.is()) xComp->addEventListener(this);
}
}
@@ -251,8 +251,8 @@ void ApiTreeImpl::ComponentAdapter::clear()
aGuard.clear();
- if (xParent.is()) xParent->removeEventListener(this);
- if (xProvider.is()) xProvider->removeEventListener(this);
+ if (xParent.is()) try { xParent ->removeEventListener(this); } catch (uno::Exception & ) {}
+ if (xProvider.is()) try { xProvider->removeEventListener(this); } catch (uno::Exception & ) {}
}
//-----------------------------------------------------------------------------
@@ -262,7 +262,7 @@ class ApiRootTreeImpl::NodeListener : public INodeListener
ApiRootTreeImpl* pParent;
IConfigBroadcaster* pSource;
- vos::ORef< OOptions > m_xOptions;
+ TreeOptions m_xOptions;
AbsolutePath m_aLocationPath;
public:
NodeListener(ApiRootTreeImpl& _rParent)
@@ -288,31 +288,42 @@ public:
{
if (pNew != pSource)
{
- if (pSource)
- pSource->removeListener(m_xOptions, this);
-
- pSource = pNew;
- if (pNew)
+ OSL_ENSURE(m_xOptions.isValid(),"Cannot set IConfigListener without Options");
+ if (m_xOptions.isValid())
{
- OSL_ENSURE(!m_aLocationPath.isRoot(), "Cannot register for notifications: no location set");
- pNew->addListener(m_aLocationPath, m_xOptions, this);
+ if (pSource)
+ pSource->removeListener(m_xOptions->getRequestOptions(), this);
+
+ pSource = pNew;
+ if (pNew)
+ {
+ OSL_ENSURE(!m_aLocationPath.isRoot(), "Cannot register for notifications: no location set");
+ pNew->addListener(m_aLocationPath, m_xOptions->getRequestOptions(), this);
+ }
}
+ else
+ pSource = 0;
}
}
}
- void setLocation(AbsolutePath const& _aLocation, vos::ORef< OOptions > const& _xOptions)
+ void setLocation(AbsolutePath const& _aLocation, TreeOptions const& _xOptions)
{
+ OSL_ASSERT(_xOptions.isValid());
+
osl::MutexGuard aGuard(mutex);
if (pSource && pParent)
- pSource->removeListener(m_xOptions, this);
+ {
+ OSL_ASSERT(m_xOptions.isValid());
+ pSource->removeListener(m_xOptions->getRequestOptions(), this);
+ }
m_aLocationPath = _aLocation;
m_xOptions = _xOptions;
if (pSource && pParent)
- pSource->addListener(m_aLocationPath, m_xOptions, this);
+ pSource->addListener(m_aLocationPath, m_xOptions->getRequestOptions(), this);
}
void unbind()
@@ -322,7 +333,8 @@ public:
pParent = 0;
if (pSource)
{
- pSource->removeListener(m_xOptions, this);
+ OSL_ASSERT(m_xOptions.isValid());
+ pSource->removeListener(m_xOptions->getRequestOptions(), this);
m_xOptions.unbind();
m_aLocationPath = AbsolutePath::root();
}
@@ -339,7 +351,7 @@ public:
if (pSource)
{
IConfigBroadcaster* pOrgSource = pSource;
- vos::ORef< OOptions > xOptions = m_xOptions;
+ TreeOptions xOptions = m_xOptions;
pSource = 0;
m_xOptions.unbind();
@@ -347,7 +359,8 @@ public:
aGuard.clear();
- pOrgSource->removeListener(xOptions, this);
+ OSL_ASSERT(xOptions.isValid());
+ pOrgSource->removeListener(xOptions->getRequestOptions(), this);
}
}
}
@@ -379,13 +392,16 @@ inline
configuration::DefaultProvider createDefaultProvider(
ApiProvider& rProvider,
configuration::Tree const& aTree,
- vos::ORef< OOptions >const& _xOptions
+ TreeOptions const& _xOptions
)
{
OProviderImpl& rProviderImpl = rProvider.getProviderImpl();
rtl::Reference< IConfigDefaultProvider > xDefaultProvider = rProviderImpl.getDefaultProvider();
- return configuration::DefaultProvider::create(aTree,_xOptions,xDefaultProvider,&rProviderImpl);
+ OSL_ASSERT(_xOptions.isValid());
+ RequestOptions const aOptions = _xOptions.isValid() ? _xOptions->getRequestOptions() : RequestOptions();
+
+ return configuration::DefaultProvider::create(aTree,aOptions,xDefaultProvider,&rProviderImpl);
}
//-------------------------------------------------------------------------
static
@@ -444,7 +460,7 @@ ApiTreeImpl::~ApiTreeImpl()
}
//-------------------------------------------------------------------------
-ApiRootTreeImpl::ApiRootTreeImpl(UnoInterface* pInstance, ApiProvider& rProvider, configuration::Tree const& aTree, vos::ORef< OOptions >const& _xOptions)
+ApiRootTreeImpl::ApiRootTreeImpl(UnoInterface* pInstance, ApiProvider& rProvider, configuration::Tree const& aTree, TreeOptions const& _xOptions)
: m_aTreeImpl(pInstance, rProvider, aTree.getRef(), createDefaultProvider(rProvider, aTree, _xOptions))
, m_pNotificationListener(NULL)
, m_xOptions(_xOptions)
@@ -456,7 +472,7 @@ ApiRootTreeImpl::ApiRootTreeImpl(UnoInterface* pInstance, ApiProvider& rProvider
//-------------------------------------------------------------------------
ApiRootTreeImpl::~ApiRootTreeImpl()
{
- if (m_pNotificationListener.isValid())
+ if (m_pNotificationListener.is())
{
m_pNotificationListener->setSource(0);
m_pNotificationListener->clearParent();
@@ -554,11 +570,11 @@ bool ApiRootTreeImpl::disposeTree()
// ensure our provider stays alive
UnoInterfaceRef xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
- vos::ORef xListener = m_pNotificationListener;
- if (xListener.isValid())
+ rtl::Reference xListener = m_pNotificationListener;
+ if (xListener.is())
{
xListener->clearParent();
- xListener.unbind();
+ xListener.clear();
}
bool bDisposed = m_aTreeImpl.disposeTreeNow();
@@ -774,12 +790,12 @@ IConfigBroadcaster* ApiRootTreeImpl::implSetNotificationSource(IConfigBroadcaste
{
osl::MutexGuard aGuard(getApiTree().getApiLock());
- IConfigBroadcaster* pOld = m_pNotificationListener.isValid() ? m_pNotificationListener->getSource() : 0;
+ IConfigBroadcaster* pOld = m_pNotificationListener.is() ? m_pNotificationListener->getSource() : 0;
if (pOld != pNew)
{
OSL_ENSURE(m_xOptions.isValid(), "Cannot change notification source without options");
- if (!m_pNotificationListener.isValid())
+ if (!m_pNotificationListener.is())
m_pNotificationListener = new NodeListener(*this);
m_pNotificationListener->setSource(pNew);
@@ -805,7 +821,7 @@ void ApiRootTreeImpl::implSetLocation(configuration::Tree const& _aTree)
m_aLocationPath = configuration::AbsolutePath::root();
}
- if (!m_pNotificationListener.isValid())
+ if (!m_pNotificationListener.is())
m_pNotificationListener = new NodeListener(*this);
OSL_ENSURE(!m_aLocationPath.isRoot() && !m_aLocationPath.isDetached(), "Cannot reregister for notifications: setting empty location");
@@ -826,8 +842,9 @@ void ApiRootTreeImpl::releaseData()
OSL_ENSURE( !m_aLocationPath.isRoot() && !m_aLocationPath.isDetached(), "Location still needed to release data" );
OSL_ENSURE( m_xOptions.isValid(), "Options still needed to release data" );
- getApiTree().getProvider().getProviderImpl().releaseSubtree(m_aLocationPath,m_xOptions);
+ getApiTree().getProvider().getProviderImpl().releaseSubtree(m_aLocationPath,m_xOptions->getRequestOptions());
m_xOptions.unbind();
+
m_aLocationPath = configuration::AbsolutePath::detachedRoot();
}
// ---------------------------------------------------------------------------------------------------
@@ -854,11 +871,11 @@ void ApiRootTreeImpl::disposing(IConfigBroadcaster* pSource)
// ensure our provider stays alive
UnoInterfaceRef xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
- vos::ORef xListener = m_pNotificationListener;
- if (xListener.isValid())
+ rtl::Reference xListener = m_pNotificationListener;
+ if (xListener.is())
{
xListener->clearParent();
- xListener.unbind();
+ xListener.clear();
}
if (m_aTreeImpl.disposeTreeNow())
@@ -1077,11 +1094,11 @@ void ApiRootTreeImpl::nodeDeleted(data::Accessor const& _aChangedDataAccessor, A
// ensure our provider stays alive
UnoInterfaceRef xKeepProvider( m_aTreeImpl.getUnoProviderInstance() );
- vos::ORef xListener = m_pNotificationListener;
- if (xListener.isValid())
+ rtl::Reference xListener = m_pNotificationListener;
+ if (xListener.is())
{
xListener->clearParent();
- xListener.unbind();
+ xListener.clear();
}
if (m_aTreeImpl.disposeTreeNow())
diff --git a/configmgr/source/api2/apitreeimplobj.hxx b/configmgr/source/api2/apitreeimplobj.hxx
index 8d65dd3d3f..69cd49b0e5 100644
--- a/configmgr/source/api2/apitreeimplobj.hxx
+++ b/configmgr/source/api2/apitreeimplobj.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apitreeimplobj.hxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: jb $ $Date: 2002-12-06 13:08:28 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,10 +62,6 @@
#ifndef CONFIGMGR_API_TREEIMPLOBJECTS_HXX_
#define CONFIGMGR_API_TREEIMPLOBJECTS_HXX_
-#ifndef CONFIGMGR_API_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
#ifndef CONFIGMGR_CONFIGNODE_HXX_
#include "noderef.hxx"
#endif
@@ -81,10 +77,16 @@
#ifndef CONFIGMGR_MISC_OPTIONS_HXX_
#include "options.hxx"
#endif
+#ifndef CONFIGMGR_UTILITY_HXX_
+#include "utility.hxx"
+#endif
#ifndef _VOS_REF_HXX_
#include
#endif
+#ifndef _RTL_REF_HXX_
+#include
+#endif
#ifndef _OSL_MUTEX_HXX_
#include
#endif
@@ -119,16 +121,17 @@ namespace configmgr
typedef vos::ORef NotifierImplHolder;
//-----------------------------------------------------------------------------
class ObjectRegistry;
- typedef vos::ORef ObjectRegistryHolder;
+ typedef rtl::Reference ObjectRegistryHolder;
typedef uno::XInterface UnoInterface;
typedef uno::Reference UnoInterfaceRef;
typedef uno::Reference UnoTypeConverter;
+ typedef vos::ORef< OOptions > TreeOptions;
//-----------------------------------------------------------------------------
// API object implementation wrappers
//-------------------------------------------------------------------------
- class ApiProvider : NotCopyable
+ class ApiProvider : Noncopyable
{
Factory& m_rFactory;
OProviderImpl& m_rProviderImpl;
@@ -146,7 +149,7 @@ namespace configmgr
//-----------------------------------------------------------------------------
//-------------------------------------------------------------------------
- class ApiTreeImpl : NotCopyable
+ class ApiTreeImpl : Noncopyable
{
class ComponentAdapter;
typedef uno::Reference ComponentRef;
@@ -221,17 +224,17 @@ namespace configmgr
{
typedef configuration::AbsolutePath AbsolutePath;
typedef configuration::DefaultProvider DefaultProvider;
- vos::ORef< OOptions > m_xOptions;
+ TreeOptions m_xOptions;
public:
- explicit ApiRootTreeImpl(UnoInterface* pInstance, ApiProvider& rProvider, configuration::Tree const& aTree, vos::ORef< OOptions >const& _xOptions);
+ explicit ApiRootTreeImpl(UnoInterface* pInstance, ApiProvider& rProvider, configuration::Tree const& aTree, TreeOptions const& _xOptions);
~ApiRootTreeImpl();
ApiTreeImpl& getApiTree() { return m_aTreeImpl; }
ApiTreeImpl const& getApiTree() const { return m_aTreeImpl; }
AbsolutePath const & getLocation() const { return m_aLocationPath; }
- vos::ORef< OOptions > getOptions() const { return m_xOptions; }
+ TreeOptions getOptions() const { return m_xOptions; }
// self-locked methods for dispose handling
bool disposeTree();
@@ -257,7 +260,7 @@ namespace configmgr
private:
ApiTreeImpl m_aTreeImpl;
AbsolutePath m_aLocationPath;
- vos::ORef m_pNotificationListener;
+ rtl::Reference m_pNotificationListener;
};
//-----------------------------------------------------------------------------
}
diff --git a/configmgr/source/api2/broadcaster.cxx b/configmgr/source/api2/broadcaster.cxx
index ccf5918444..f7d74579bd 100644
--- a/configmgr/source/api2/broadcaster.cxx
+++ b/configmgr/source/api2/broadcaster.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: broadcaster.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: jb $ $Date: 2002-10-15 15:06:26 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -426,18 +426,29 @@ namespace configmgr
if (configapi::fillEventDataFromResolved(aEvent,aChange,bMore))
{
-
+ // Catch only RuntimeExceptions here: vetoableChange issues its veto by throwing
+ // a PropertyVetoException (which is not a RuntimeException)
if (pListeners)
{
ListenerIterator aIterator(*pListeners);
while (aIterator.hasMoreElements())
+ try
+ {
aIterator.next()->vetoableChange(aEvent);
+ }
+ catch (uno::RuntimeException & )
+ {}
}
if (pSpecial)
{
ListenerIterator aIterator(*pSpecial);
while (aIterator.hasMoreElements())
+ try
+ {
aIterator.next()->vetoableChange(aEvent);
+ }
+ catch (uno::RuntimeException & )
+ {}
}
}
}
@@ -469,6 +480,7 @@ namespace configmgr
ContainerListenerIterator aIterator(*pContainerListeners);
while (aIterator.hasMoreElements())
+ try
{
uno::Reference xListener( aIterator.next() );
OSL_ASSERT( xListener.is() );
@@ -497,6 +509,8 @@ namespace configmgr
break;
}
}
+ catch (uno::Exception &)
+ {}
}
}
@@ -513,7 +527,7 @@ namespace configmgr
{
PropertyListenerIterator aIterator(*pPropertyListeners);
while (aIterator.hasMoreElements())
- aIterator.next()->propertyChange(rEvent);
+ try { aIterator.next()->propertyChange(rEvent); } catch (uno::Exception & ) {}
}
ListenerContainer* pSpecialListeners = pNotifierImpl->m_aListeners.getSpecialContainer( aChange.location.getChangingValueID() );
@@ -521,7 +535,7 @@ namespace configmgr
{
PropertyListenerIterator aIterator(*pSpecialListeners);
while (aIterator.hasMoreElements())
- aIterator.next()->propertyChange(rEvent);
+ try { aIterator.next()->propertyChange(rEvent); } catch (uno::Exception & ) {}
}
++pCurEvent;
@@ -634,7 +648,7 @@ namespace configmgr
{
ListenerIterator aIterator(*pContainer);
while (aIterator.hasMoreElements())
- aIterator.next()->propertiesChange(aPropertyEvents);
+ try { aIterator.next()->propertiesChange(aPropertyEvents); } catch (uno::Exception & ) {}
}
}
}
@@ -760,7 +774,7 @@ namespace configmgr
{
ListenerIterator aIterator(*pContainer);
while (aIterator.hasMoreElements())
- aIterator.next()->propertiesChange(aPropertyEvents);
+ try { aIterator.next()->propertiesChange(aPropertyEvents); } catch (uno::Exception & ) {}
}
}
}
@@ -1173,7 +1187,7 @@ namespace configmgr
aGuardRoot.clear();
while (aIter.hasMoreElements())
- aIter.next()->changesOccurred(aEvent);
+ try { aIter.next()->changesOccurred(aEvent); } catch (uno::Exception & ) {}
}
}
}
@@ -1219,7 +1233,7 @@ Broadcaster::~Broadcaster()
}
// ---------------------------------------------------------------------------------------------------
-void Broadcaster::queryConstraints(NodeChange const& aChange) throw(com::sun::star::beans::PropertyVetoException)
+void Broadcaster::queryConstraints(NodeChange const& aChange) throw(beans::PropertyVetoException)
{
OSL_ENSURE(aChange.isChange(),"Constraint query without a change !");
@@ -1229,14 +1243,29 @@ void Broadcaster::queryConstraints(NodeChange const& aChange) throw(com::sun::st
}
// ---------------------------------------------------------------------------------------------------
-void Broadcaster::queryConstraints(NodeChanges const& aChanges, bool bSingleBase) throw(com::sun::star::beans::PropertyVetoException)
+void Broadcaster::queryConstraints(NodeChanges const& aChanges, bool bSingleBase) throw(beans::PropertyVetoException)
{
OSL_ENSURE(!aChanges.isEmpty(),"Constraint query without a change !");
- NodeChangesInformation aInfos;
- if (m_pImpl->translateChanges(aInfos,aChanges,bSingleBase))
+ try
+ {
+ NodeChangesInformation aInfos;
+ if (m_pImpl->translateChanges(aInfos,aChanges,bSingleBase))
+ {
+ m_pImpl->queryConstraints(aInfos);
+ }
+ }
+ catch (beans::PropertyVetoException & )
+ {
+ throw;
+ }
+ catch (uno::Exception & )
+ {
+ OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected UNO exception in notifyListeners");
+ }
+ catch (configuration::Exception & )
{
- m_pImpl->queryConstraints(aInfos);
+ OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected internal exception in notifyListeners");
}
}
// ---------------------------------------------------------------------------------------------------
@@ -1265,11 +1294,22 @@ void Broadcaster::notifyListeners(NodeChanges const& aChanges, bool bSingleBase)
{
OSL_ENSURE(!aChanges.isEmpty(),"Notifying without a change !");
- NodeChangesInformation aInfos;
- if (m_pImpl->translateChanges(aInfos,aChanges, bSingleBase))
+ try
{
- m_pImpl->notifyListeners(aInfos);
- m_pImpl->notifyRootListeners(aInfos);
+ NodeChangesInformation aInfos;
+ if (m_pImpl->translateChanges(aInfos,aChanges, bSingleBase))
+ {
+ m_pImpl->notifyListeners(aInfos);
+ m_pImpl->notifyRootListeners(aInfos);
+ }
+ }
+ catch (uno::Exception & )
+ {
+ OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected UNO exception in notifyListeners");
+ }
+ catch (configuration::Exception & )
+ {
+ OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected internal exception in notifyListeners");
}
}
// ---------------------------------------------------------------------------------------------------
@@ -1278,11 +1318,22 @@ void Broadcaster::notifyListeners(NodeChangesInformation const& aChanges, bool b
{
OSL_ENSURE(!aChanges.empty(),"Notifying without a change !");
- NodeChangesInformation aInfos;
- if (m_pImpl->translateChanges(aInfos,aChanges, bSingleBase))
+ try
+ {
+ NodeChangesInformation aInfos;
+ if (m_pImpl->translateChanges(aInfos,aChanges, bSingleBase))
+ {
+ m_pImpl->notifyListeners(aInfos);
+ m_pImpl->notifyRootListeners(aInfos);
+ }
+ }
+ catch (uno::Exception & )
+ {
+ OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected UNO exception in notifyListeners");
+ }
+ catch (configuration::Exception & )
{
- m_pImpl->notifyListeners(aInfos);
- m_pImpl->notifyRootListeners(aInfos);
+ OSL_ENSURE(false, "configmgr::Broadcaster: Unexpected internal exception in notifyListeners");
}
}
// ---------------------------------------------------------------------------------------------------
diff --git a/configmgr/source/api2/broadcaster.hxx b/configmgr/source/api2/broadcaster.hxx
index f0d1a7f538..94662f8300 100644
--- a/configmgr/source/api2/broadcaster.hxx
+++ b/configmgr/source/api2/broadcaster.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: broadcaster.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: hr $ $Date: 2001-09-27 18:43:10 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,7 +66,6 @@
#include
#endif
-#include "apitypes.hxx"
#include
namespace configmgr
diff --git a/configmgr/source/api2/committer.cxx b/configmgr/source/api2/committer.cxx
index 68f9363349..4c88342671 100644
--- a/configmgr/source/api2/committer.cxx
+++ b/configmgr/source/api2/committer.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: committer.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: jb $ $Date: 2002-03-28 08:19:54 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:30 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -67,9 +67,6 @@
#ifndef CONFIGMGR_ROOTTREE_HXX_
#include "roottree.hxx"
#endif
-#ifndef CONFIGMGR_CMTREEMODEL_HXX
-#include "cmtreemodel.hxx"
-#endif
#ifndef CONFIGMGR_API_PROVIDERIMPL2_HXX_
#include "confproviderimpl2.hxx"
#endif
@@ -79,6 +76,9 @@
#ifndef CONFIGMGR_TREEACCESSOR_HXX
#include "treeaccessor.hxx"
#endif
+#ifndef CONFIGMGR_TREECHANGELIST_HXX
+#include "treechangelist.hxx"
+#endif
namespace configmgr
{
@@ -133,10 +133,14 @@ void Committer::commit()
OSL_PRECOND(!m_rTree.getLocation().isRoot(),"INTERNAL ERROR: Empty location used.");
OSL_PRECOND(m_rTree.getOptions().isValid(),"INTERNAL ERROR: Invalid Options used.");
+ if (!m_rTree.getOptions().isValid()) return;
+
+ RequestOptions aOptions = m_rTree.getOptions()->getRequestOptions();
+
ITreeManager* pUpdateProvider = getUpdateProvider();
OSL_ASSERT(pUpdateProvider);
- memory::Segment * pCacheSegment = pUpdateProvider->getDataSegment(m_rTree.getLocation(),m_rTree.getOptions());
+ memory::Segment * pCacheSegment = pUpdateProvider->getDataSegment(m_rTree.getLocation(),aOptions);
OSL_ASSERT(rApiTree.getSourceData() == pCacheSegment);
memory::UpdateAccessor aUpdateAccessor(pCacheSegment);
@@ -145,7 +149,7 @@ void Committer::commit()
Tree aTree( aUpdateAccessor.accessor(), rApiTree.getTree());
if (!aTree.hasChanges()) return;
- TreeChangeList aChangeList(m_rTree.getOptions(),
+ TreeChangeList aChangeList(aOptions,
aTree.getRootPath(),
aTree.getAttributes(aTree.getRootNode()));
diff --git a/configmgr/source/api2/confignotifier.hxx b/configmgr/source/api2/confignotifier.hxx
index b8b57bf6b3..4034f35561 100644
--- a/configmgr/source/api2/confignotifier.hxx
+++ b/configmgr/source/api2/confignotifier.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: confignotifier.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: hr $ $Date: 2001-09-27 18:43:10 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,14 +62,23 @@
#ifndef CONFIGMGR_CONFIGNOTIFIER_HXX_
#define CONFIGMGR_CONFIGNOTIFIER_HXX_
-#include "apitypes.hxx"
+#ifndef CONFIGMGR_CONFIGEXCEPT_HXX_
#include "configexcept.hxx"
+#endif
+#ifndef CONFIGMGR_CONFIGPATH_HXX_
#include "configpath.hxx"
+#endif
+#ifndef CONFIGMGR_UTILITY_HXX_
+#include "utility.hxx"
+#endif
#include
#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
#include
#endif
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include
+#endif
namespace com { namespace sun { namespace star {
namespace beans
@@ -214,7 +223,7 @@ namespace configmgr
class TreeElement;
/// guards a NodeAccess; provides a simple lock for non-data access, does not check for disposed state
- class DisposeGuardImpl : NotCopyable
+ class DisposeGuardImpl : Noncopyable
{
osl::MutexGuard m_aLock;
public:
diff --git a/configmgr/source/api2/confprovider2.cxx b/configmgr/source/api2/confprovider2.cxx
index 81fe41c2c7..a825fd621d 100644
--- a/configmgr/source/api2/confprovider2.cxx
+++ b/configmgr/source/api2/confprovider2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: confprovider2.cxx,v $
*
- * $Revision: 1.24 $
+ * $Revision: 1.25 $
*
- * last change: $Author: jb $ $Date: 2002-12-06 13:08:28 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,9 +66,18 @@
#ifndef CONFIGMGR_API_PROVIDERIMPL2_HXX_
#include "confproviderimpl2.hxx"
#endif
+#ifndef CONFIGMGR_API_FACTORY_HXX_
+#include "confapifactory.hxx"
+#endif
#ifndef CONFIGMGR_BOOTSTRAP_HXX_
#include "bootstrap.hxx"
#endif
+#ifndef CONFIGMGR_BOOTSTRAPCONTEXT_HXX_
+#include "bootstrapcontext.hxx"
+#endif
+#ifndef CONFIGMGR_WRAPEXCEPTION_HXX
+#include "wrapexception.hxx"
+#endif
#ifndef _CONFIGMGR_TRACER_HXX_
#include "tracer.hxx"
#endif
@@ -79,8 +88,9 @@
#ifndef _RTL_USTRBUF_HXX_
#include
#endif
-#ifndef __SGI_STL_ALGORITHM
+#ifndef INCLUDED_ALGORITHM
#include
+#define INCLUDED_ALGORITHM
#endif
#ifndef _COMPHELPER_SEQUENCE_HXX_
#include
@@ -107,34 +117,63 @@ namespace configmgr
namespace
{
- typedef uno::Reference< uno::XInterface > (OConfigurationProviderImpl::*CreatorFunc)(const uno::Sequence< uno::Any >& aArguments);
- struct ServiceCreationInfo
- {
- ServiceRegistrationInfo const* info;
- CreatorFunc create;
- };
-
- AsciiServiceName const aProviderServices[] =
+ //------------------------------------------------------------------------
+ AsciiServiceName const aConfigProviderServices[] =
{
"com.sun.star.configuration.ConfigurationProvider",
0
};
- AsciiServiceName const aLocalAdminProviderServices[] =
+ AsciiServiceName const aAdminProviderServices[] =
{
"com.sun.star.configuration.AdministrationProvider",
0
};
- ServiceImplementationInfo const aProviderInfo =
+ //------------------------------------------------------------------------
+
+ ServiceImplementationInfo const aConfigProviderInfo =
{
"com.sun.star.comp.configuration.ConfigurationProvider",
- aProviderServices,
+ aConfigProviderServices,
+ 0
+ };
+ ServiceImplementationInfo const aAdminProviderInfo =
+ {
+ "com.sun.star.comp.configuration.AdministrationProvider",
+ aAdminProviderServices,
+ aConfigProviderServices
+ };
+ //------------------------------------------------------------------------
+
+ AsciiServiceName const
+ aDefaultProviderServiceAndImplName = A_DefaultProviderServiceAndImplName;
+
+ //------------------------------------------------------------------------
+
+ AsciiServiceName const aDefaultProviderServices[] =
+ {
+ aDefaultProviderServiceAndImplName,
0
};
- ServiceImplementationInfo const aLocalAdminProviderInfo =
+ //------------------------------------------------------------------------
+
+ ServiceRegistrationInfo const aDefaultProviderInfo =
{
- "com.sun.star.comp.configuration.LocalAdministrationProvider",
- aLocalAdminProviderServices,
- aProviderServices
+ aDefaultProviderServiceAndImplName,
+ aDefaultProviderServices
+ };
+ SingletonRegistrationInfo const aDefaultProviderSingletonInfo =
+ {
+ A_DefaultProviderSingletonName,
+ aDefaultProviderServiceAndImplName,
+ aDefaultProviderServiceAndImplName,
+ 0
+ };
+ //------------------------------------------------------------------------
+ typedef uno::Reference< uno::XInterface > (OConfigurationProviderImpl::*CreatorFunc)(const uno::Sequence< uno::Any >& aArguments);
+ struct ServiceCreationInfo
+ {
+ ServiceRegistrationInfo const* info;
+ CreatorFunc create;
};
static sal_Int32 getCreateServiceDataCount()
@@ -153,6 +192,7 @@ namespace configmgr
"getCreateServiceData : inconsistent data !");
return createServiceData;
}
+ //------------------------------------------------------------------------
}
static ServiceCreationInfo const* findCreationInfo( const OUString& aServiceSpecifier )
@@ -192,52 +232,95 @@ namespace configmgr
//= OConfigurationProvider
//=============================================================================
// service info export
- const ServiceRegistrationInfo* getConfigurationProviderServices()
+ const ServiceRegistrationInfo* getConfigurationProviderServiceInfo()
{
- return getRegistrationInfo(&aProviderInfo);
+ return getRegistrationInfo(&aConfigProviderInfo);
}
- const ServiceRegistrationInfo* getLocalAdminProviderServices()
+ const ServiceRegistrationInfo* getAdminProviderServiceInfo()
{
- return getRegistrationInfo(&aLocalAdminProviderInfo);
+ return getRegistrationInfo(&aAdminProviderInfo);
}
- //-----------------------------------------------------------------------------
- // provider instantiation
- uno::Reference< uno::XInterface > SAL_CALL instantiateConfigProvider( uno::Reference< lang::XMultiServiceFactory > const& rServiceManager, ConnectionSettings const& _aSettings )
+ const ServiceRegistrationInfo* getDefaultProviderServiceInfo()
{
- OConfigurationProvider* pNewProvider = new OConfigurationProvider(rServiceManager,&aProviderInfo);
- uno::Reference< lang::XMultiServiceFactory > aRet( pNewProvider );
-
- ::rtl::OUString const sService(RTL_CONSTASCII_USTRINGPARAM("configuration"));
+ return &aDefaultProviderInfo;
+ }
- ConnectionSettings aSettings(_aSettings);
- aSettings.setUserSession(sService);
-
- pNewProvider->connect(aSettings);
+ const SingletonRegistrationInfo* getDefaultProviderSingletonInfo()
+ {
+ return &aDefaultProviderSingletonInfo;
+ }
- return aRet;
+ //-----------------------------------------------------------------------------
+ uno::Reference SAL_CALL
+ getDefaultConfigProviderSingleton( CreationContext const& xContext )
+ {
+ OSL_ENSURE( xContext.is(), "ERROR: NULL context has no singletons" );
+
+ UnoContextTunnel aTunnel;
+ aTunnel.passthru( xContext );
+
+ uno::Reference xResult;
+
+ if (xContext.is())
+ try
+ {
+ OUString aSingletonName = SINGLETON(A_DefaultProviderSingletonName);
+ uno::Any aResult = xContext->getValueByName(aSingletonName);
+ aResult >>= xResult;
+ }
+ catch (uno::Exception & )
+ {
+ // to do: really use the tunneled failure when that is set properly
+ if ( aTunnel.recoverFailure(true).hasValue() )
+ {
+ // have a failure, but can't recover it
+ // -> try to regenerate
+ instantiateDefaultProvider(xContext);
+
+ OSL_ENSURE(false, "Cannot recreate configuration backend instantiation failure - using generic error");
+ }
+ // cannot recover any failure
+ throw;
+ }
+
+ return xResult;
}
+ // ------------------------------------------------------------------------
+ // ----------------------------------------------------------------------------
+ #define TUNNEL_ALL_EXCEPTIONS() \
+ WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS1( UnoContextTunnel::tunnelFailure, true)
- uno::Reference< uno::XInterface > SAL_CALL instantiateLocalAdminProvider( uno::Reference< lang::XMultiServiceFactory > const& rServiceManager, ConnectionSettings const& _aSettings )
+ // ----------------------------------------------------------------------------
+ // ------------------------------------------------------------------------
+
+ uno::Reference< uno::XInterface > SAL_CALL instantiateDefaultProvider( OProvider::CreationContext const & xTargetContext )
{
- OConfigurationProvider* pNewProvider = new OConfigurationProvider(rServiceManager,&aLocalAdminProviderInfo);
+ CreationContext xContext = UnoContextTunnel::recoverContext(xTargetContext);
+
+ ServiceImplementationInfo const * pProviderInfo =
+ ContextReader::testAdminService(xContext,true) ? &aAdminProviderInfo : &aConfigProviderInfo;
+
+ OConfigurationProvider* pNewProvider = new OConfigurationProvider(xContext,pProviderInfo);
uno::Reference< lang::XMultiServiceFactory > aRet( pNewProvider );
- ConnectionSettings aSettings(_aSettings);
- aSettings.setAdminSession();
-
- pNewProvider->connect(aSettings);
+ try
+ {
+ pNewProvider->connect();
+ }
+ TUNNEL_ALL_EXCEPTIONS()
return aRet;
}
+ //-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
OConfigurationProvider::OConfigurationProvider(
- const uno::Reference< lang::XMultiServiceFactory >& _xServiceFactory,
+ CreationContext const & xContext,
const ServiceImplementationInfo* pServices
)
- :OProvider(_xServiceFactory,pServices)
+ :OProvider(xContext,pServices)
,m_pImpl(NULL)
{
registerProperty(rtl::OUString::createFromAscii("PrefetchNodes"), ID_PREFETCH, 0,&m_aPrefetchNodes, ::getCppuType(static_cast< uno::Sequence< rtl::OUString > const * >(0) ));
@@ -250,13 +333,13 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
- void OConfigurationProvider::connect(const ConnectionSettings& _rSettings) throw (uno::Exception)
+ void OConfigurationProvider::connect() throw (uno::Exception)
{
OSL_ENSURE( m_pImpl == NULL, "Error: Configuration Provider already is connected");
- std::auto_ptr pNewImpl( new OConfigurationProviderImpl(this, m_xServiceFactory) );
+ std::auto_ptr pNewImpl( new OConfigurationProviderImpl(this, m_xContext) );
- implConnect(*pNewImpl,_rSettings);
+ implConnect(*pNewImpl,ContextReader(m_xContext));
m_pImpl = pNewImpl.release();
}
@@ -380,13 +463,13 @@ namespace configmgr
uno::Sequence< OUString > aNodeList;
rValue >>= aNodeList;
- ::vos::ORef xOptions(new OOptions(m_pImpl->getDefaultOptions()));
+ RequestOptions const aOptions = m_pImpl->getDefaultOptions();
for (sal_Int32 i = 0; i < aNodeList.getLength(); i++)
{
using namespace configuration;
AbsolutePath aModulePath = AbsolutePath::makeModulePath(aNodeList[i], AbsolutePath::NoValidate());
- m_pImpl->fetchSubtree(aModulePath , xOptions);
+ m_pImpl->fetchSubtree(aModulePath , aOptions);
}
}
diff --git a/configmgr/source/api2/confprovider2.hxx b/configmgr/source/api2/confprovider2.hxx
index 3b498e0580..2167108779 100644
--- a/configmgr/source/api2/confprovider2.hxx
+++ b/configmgr/source/api2/confprovider2.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: confprovider2.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jb $ $Date: 2002-12-06 13:08:28 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,12 +89,10 @@ namespace configmgr
OConfigurationProviderImpl* m_pImpl;
uno::Sequence< ::rtl::OUString > m_aPrefetchNodes;
- protected:
- OConfigurationProvider(const uno::Reference< lang::XMultiServiceFactory >& _xServiceFactory, ServiceImplementationInfo const* pServices);
- void connect(const ConnectionSettings& _rSettings) throw (uno::Exception);
+ public:
+ OConfigurationProvider(CreationContext const & xContext, ServiceImplementationInfo const* pServices);
+ void connect() throw (uno::Exception);
- friend uno::Reference< uno::XInterface > SAL_CALL instantiateConfigProvider( uno::Reference< lang::XMultiServiceFactory > const& rServiceManager, ConnectionSettings const& _aSettings );
- friend uno::Reference< uno::XInterface > SAL_CALL instantiateLocalAdminProvider( uno::Reference< lang::XMultiServiceFactory > const& rServiceManager, ConnectionSettings const& _aSettings );
public:
~OConfigurationProvider();
@@ -119,9 +117,9 @@ namespace configmgr
throw (::com::sun::star::uno::Exception);
// XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual uno::Any SAL_CALL queryInterface( const uno::Type & rType ) throw(uno::RuntimeException);
//XTypeProvider
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual uno::Sequence< uno::Type > SAL_CALL getTypes( ) throw(uno::RuntimeException);
protected:
virtual void SAL_CALL disposing();
diff --git a/configmgr/source/api2/confproviderimpl2.cxx b/configmgr/source/api2/confproviderimpl2.cxx
index db690aba79..4b5fa0e7cb 100644
--- a/configmgr/source/api2/confproviderimpl2.cxx
+++ b/configmgr/source/api2/confproviderimpl2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: confproviderimpl2.cxx,v $
*
- * $Revision: 1.29 $
+ * $Revision: 1.30 $
*
- * last change: $Author: jb $ $Date: 2002-03-28 08:21:39 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -107,8 +107,8 @@ namespace configmgr
//= OConfigurationProviderImpl
//=============================================================================
//-----------------------------------------------------------------------------------
- OConfigurationProviderImpl::OConfigurationProviderImpl(OConfigurationProvider* _pProvider, const uno::Reference< lang::XMultiServiceFactory >& _xServiceFactory)
- :OProviderImpl(_pProvider, _xServiceFactory)
+ OConfigurationProviderImpl::OConfigurationProviderImpl(OConfigurationProvider* _pProvider, CreationContext const & xContext)
+ :OProviderImpl(_pProvider, xContext)
{
}
//--------------------------------------------------------------------------
@@ -120,46 +120,18 @@ namespace configmgr
// extract the args
OUString sPath;
sal_Int32 nLevels;
- vos::ORef xOptions = new OOptions(getDefaultOptions());
+
+ RequestOptions aOptions = getDefaultOptions();
- OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, nLevels, xOptions);
+ OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, nLevels, aOptions);
CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sPath));
CFG_TRACE_INFO_NI("config provider: level depth extracted from the args is %i", nLevels);
- if (!xOptions->canUseCache()) CFG_TRACE_INFO_NI("config provider: Ignoring cache for request");
-
- OUString sUser = xOptions->getUser();
- if (sUser.getLength())
- {
- if (xOptions->getDefaultUser() == sUser)
- {
- OSL_ASSERT(xOptions->isForSessionUser());
- OSL_ASSERT(xOptions->getUser() == sUser);
- // respecified the actual user
- CFG_TRACE_WARNING_NI("config provider: User should not be specified again when creating an Access");
- OSL_ENSURE(false,"config provider: User should not be specified again when creating an Access");
- }
- else if (!xOptions->getDefaultUser().getLength() )
- {
- // have no default user - cannot tell whether the argument is the wrong one
- CFG_TRACE_WARNING_NI("config provider: No user should be specified, when creating an Access - user parameter is ignored");
- OSL_ENSURE(false,"config provider: No user should be specified, when creating an Access - user parameter is ignored");
- }
- else
- {
- // specified a different user
- CFG_TRACE_ERROR_NI("config provider: Cannot access foreign user data");
- throw lang::IllegalArgumentException(OUString::createFromAscii("config provider: Cannot access foreign user data"),this->getProviderInstance(), -1);
- }
- // user should always be the default user!
- xOptions->setUser(xOptions->getDefaultUser());
- }
-
// create the access object
uno::Reference< uno::XInterface > xReturn;
- NodeElement* pElement = buildReadAccess(sPath, xOptions, nLevels);
+ NodeElement* pElement = buildReadAccess(sPath, aOptions, nLevels);
if (pElement != 0)
{
xReturn = pElement->getUnoInstance();
@@ -180,53 +152,18 @@ namespace configmgr
// extract the args
OUString sPath;
sal_Int32 nLevels;
- vos::ORef xOptions = new OOptions(getDefaultOptions());
- OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, nLevels, xOptions);
+ RequestOptions aOptions = getDefaultOptions();
+
+ OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, nLevels, aOptions);
CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sPath));
CFG_TRACE_INFO_NI("config provider: level depth extracted from the args is %i", nLevels);
- if (!xOptions->canUseCache())
- {
- CFG_TRACE_INFO_NI("config provider: Ignoring cache for request");
- OSL_ENSURE( !xOptions->getLazyWrite(), "WARNING: Async writing is enabled for non-cached node. Results may be unexpected.");
- if (xOptions->getLazyWrite())
- CFG_TRACE_WARNING_NI("config provider: Async writing is enabled for non-cached node. Results may be unexpected.");
- }
-
-
- OUString sUser = xOptions->getUser();
- if (sUser.getLength())
- {
- if (xOptions->getDefaultUser() == sUser)
- {
- OSL_ASSERT(xOptions->isForSessionUser());
- OSL_ASSERT(xOptions->getUser() == sUser);
- // respecified the actual user
- CFG_TRACE_WARNING_NI("config provider: User should not be specified again when creating an Access");
- OSL_ENSURE(false,"config provider: User should not be specified again when creating an Access");
- }
- else if (!xOptions->getDefaultUser().getLength() )
- {
- // have no default user - cannot tell whether the argument is the wrong one
- CFG_TRACE_WARNING_NI("config provider: No user should be specified, when creating an Access - user parameter is ignored");
- OSL_ENSURE(false,"config provider: No user should be specified, when creating an Access - user parameter is ignored");
- }
- else
- {
- // specified a different user
- CFG_TRACE_ERROR_NI("config provider: Cannot access foreign user data");
- throw lang::IllegalArgumentException(OUString::createFromAscii("config provider: Cannot access foreign user data"),this->getProviderInstance(), -1);
- }
- // user should always be the default user!
- xOptions->setUser(xOptions->getDefaultUser());
- }
-
// create the access object
uno::Reference< uno::XInterface > xReturn;
- NodeElement* pElement = buildUpdateAccess(sPath, xOptions, nLevels);
+ NodeElement* pElement = buildUpdateAccess(sPath, aOptions, nLevels);
if (pElement != 0)
{
xReturn = pElement->getUnoInstance();
diff --git a/configmgr/source/api2/confproviderimpl2.hxx b/configmgr/source/api2/confproviderimpl2.hxx
index fd7476293f..e34fbe8ad4 100644
--- a/configmgr/source/api2/confproviderimpl2.hxx
+++ b/configmgr/source/api2/confproviderimpl2.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: confproviderimpl2.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jb $ $Date: 2001-11-09 11:23:57 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,7 +89,7 @@ namespace configmgr
uno::Reference createUpdateAccess( uno::Sequence const& aArgs) CFG_UNO_THROW_ALL( );
private:
OConfigurationProviderImpl(OConfigurationProvider* _pProvider,
- const uno::Reference< lang::XMultiServiceFactory >& _xServiceFactory);
+ CreationContext const & xContext);
};
} // namespace configmgr
diff --git a/configmgr/source/api2/elementaccess.cxx b/configmgr/source/api2/elementaccess.cxx
index 1b9bcd66b3..81e1241b14 100644
--- a/configmgr/source/api2/elementaccess.cxx
+++ b/configmgr/source/api2/elementaccess.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementaccess.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jb $ $Date: 2001-02-05 10:05:51 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:31 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,8 +70,8 @@
namespace configmgr
{
//-----------------------------------------------------------------------------------
- using namespace configapi;
+ namespace uno = com::sun::star::uno;
using uno::Reference;
using uno::Sequence;
using uno::Any;
@@ -92,7 +92,7 @@ void SAL_CALL BasicInnerElement::release() throw()
{
if (1 == m_refCount)
{
- implDisposeObject( getNodeAccess(), getElementClass() );
+ configapi::implDisposeObject( getNodeAccess(), getElementClass() );
}
BaseImplHelper::release();
}
@@ -102,7 +102,7 @@ void SAL_CALL BasicSetElement::release() throw()
{
if (1 == m_refCount)
{
- implDisposeObject( getNodeAccess(), getElementClass() );
+ configapi::implDisposeObject( getNodeAccess(), getElementClass() );
}
BaseImplHelper::release();
}
@@ -112,7 +112,7 @@ void SAL_CALL BasicRootElement::release() throw()
{
if (1 == m_refCount)
{
- implDisposeObject( getNodeAccess(), getElementClass() );
+ configapi::implDisposeObject( getNodeAccess(), getElementClass() );
}
BaseImplHelper::release();
}
@@ -122,7 +122,7 @@ void SAL_CALL BasicUpdateElement::release() throw()
{
if (1 == m_refCount)
{
- implDisposeObject( getNodeAccess(), getElementClass() );
+ configapi::implDisposeObject( getNodeAccess(), getElementClass() );
}
BaseImplHelper::release();
}
@@ -134,25 +134,25 @@ void SAL_CALL BasicUpdateElement::release() throw()
uno::Sequence SAL_CALL BasicInnerElement::getImplementationId( ) throw(uno::RuntimeException)
{
- return implGetImplementationId( getNodeAccess(), getElementClass() );
+ return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
uno::Sequence SAL_CALL BasicSetElement::getImplementationId( ) throw(uno::RuntimeException)
{
- return implGetImplementationId( getNodeAccess(), getElementClass() );
+ return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
uno::Sequence SAL_CALL BasicRootElement::getImplementationId( ) throw(uno::RuntimeException)
{
- return implGetImplementationId( getNodeAccess(), getElementClass() );
+ return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
uno::Sequence SAL_CALL BasicUpdateElement::getImplementationId( ) throw(uno::RuntimeException)
{
- return implGetImplementationId( getNodeAccess(), getElementClass() );
+ return configapi::implGetImplementationId( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
@@ -162,13 +162,13 @@ uno::Sequence SAL_CALL BasicUpdateElement::getImplementationId( ) thr
Reference< uno::XInterface > SAL_CALL BasicInnerElement::getParent( ) throw(RuntimeException)
{
- return implGetParent( getNodeAccess(), getElementClass() );
+ return configapi::implGetParent( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
Reference< uno::XInterface > SAL_CALL BasicSetElement::getParent( ) throw(RuntimeException)
{
- return implGetParent( getNodeAccess(), getElementClass() );
+ return configapi::implGetParent( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
@@ -176,14 +176,14 @@ Reference< uno::XInterface > SAL_CALL BasicSetElement::getParent( ) throw(Runti
void SAL_CALL BasicInnerElement::setParent( const Reference< uno::XInterface >& xParent )
throw(css::lang::NoSupportException, RuntimeException)
{
- implSetParent( getNodeAccess(), getElementClass(), xParent );
+ configapi::implSetParent( getNodeAccess(), getElementClass(), xParent );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicSetElement::setParent( const Reference< uno::XInterface >& xParent )
throw(css::lang::NoSupportException, RuntimeException)
{
- implSetParent( getNodeAccess(), getElementClass(), xParent );
+ configapi::implSetParent( getNodeAccess(), getElementClass(), xParent );
}
//-----------------------------------------------------------------------------------
@@ -193,50 +193,50 @@ void SAL_CALL BasicSetElement::setParent( const Reference< uno::XInterface >& xP
OUString SAL_CALL BasicInnerElement::getName( ) throw(RuntimeException)
{
- return implGetName( getNodeAccess(), getElementClass() );
+ return configapi::implGetName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
OUString SAL_CALL BasicSetElement::getName( ) throw(RuntimeException)
{
- return implGetName( getNodeAccess(), getElementClass() );
+ return configapi::implGetName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
OUString SAL_CALL BasicRootElement::getName( ) throw(RuntimeException)
{
- return implGetName( getNodeAccess(), getElementClass() );
+ return configapi::implGetName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
OUString SAL_CALL BasicUpdateElement::getName( ) throw(RuntimeException)
{
- return implGetName( getNodeAccess(), getElementClass() );
+ return configapi::implGetName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
void SAL_CALL BasicInnerElement::setName( const OUString& aName ) throw(RuntimeException)
{
- implSetName( getNodeAccess(), getElementClass(), aName );
+ configapi::implSetName( getNodeAccess(), getElementClass(), aName );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicSetElement::setName( const OUString& aName ) throw(RuntimeException)
{
- implSetName( getNodeAccess(), getElementClass(), aName );
+ configapi::implSetName( getNodeAccess(), getElementClass(), aName );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicRootElement::setName( const OUString& aName ) throw(RuntimeException)
{
- implSetName( getNodeAccess(), getElementClass(), aName );
+ configapi::implSetName( getNodeAccess(), getElementClass(), aName );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicUpdateElement::setName( const OUString& aName ) throw(RuntimeException)
{
- implSetName( getNodeAccess(), getElementClass(), aName );
+ configapi::implSetName( getNodeAccess(), getElementClass(), aName );
}
//-----------------------------------------------------------------------------------
@@ -247,14 +247,14 @@ void SAL_CALL BasicUpdateElement::setName( const OUString& aName ) throw(Runtime
void SAL_CALL BasicRootElement::addChangesListener( const Reference< css::util::XChangesListener >& xListener )
throw(RuntimeException)
{
- implAddListener( getNodeAccess(), xListener );
+ configapi::implAddListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicUpdateElement::addChangesListener( const Reference< css::util::XChangesListener >& xListener )
throw(RuntimeException)
{
- implAddListener( getNodeAccess(), xListener );
+ configapi::implAddListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
@@ -262,14 +262,14 @@ void SAL_CALL BasicUpdateElement::addChangesListener( const Reference< css::util
void SAL_CALL BasicRootElement::removeChangesListener( const Reference< css::util::XChangesListener >& xListener )
throw(RuntimeException)
{
- implRemoveListener( getNodeAccess(), xListener );
+ configapi::implRemoveListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicUpdateElement::removeChangesListener( const Reference< css::util::XChangesListener >& xListener )
throw(RuntimeException)
{
- implRemoveListener( getNodeAccess(), xListener );
+ configapi::implRemoveListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
@@ -279,19 +279,19 @@ void SAL_CALL BasicUpdateElement::removeChangesListener( const Reference< css::u
void SAL_CALL BasicSetElement::dispose( ) throw(uno::RuntimeException)
{
- implDispose( getElementClass() );
+ configapi::implDispose( getElementClass() );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicRootElement::dispose( ) throw(uno::RuntimeException)
{
- implDispose( getElementClass() );
+ configapi::implDispose( getElementClass() );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicUpdateElement::dispose( ) throw(uno::RuntimeException)
{
- implDispose( getElementClass() );
+ configapi::implDispose( getElementClass() );
}
//-----------------------------------------------------------------------------------
@@ -299,21 +299,21 @@ void SAL_CALL BasicUpdateElement::dispose( ) throw(uno::RuntimeException)
void SAL_CALL BasicSetElement::addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
throw(uno::RuntimeException)
{
- implAddListener( getNodeAccess(), xListener );
+ configapi::implAddListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicRootElement::addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
throw(uno::RuntimeException)
{
- implAddListener( getNodeAccess(), xListener );
+ configapi::implAddListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicUpdateElement::addEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
throw(uno::RuntimeException)
{
- implAddListener( getNodeAccess(), xListener );
+ configapi::implAddListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
@@ -321,21 +321,21 @@ void SAL_CALL BasicUpdateElement::addEventListener( const uno::Reference< css::l
void SAL_CALL BasicSetElement::removeEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
throw(uno::RuntimeException)
{
- implRemoveListener( getNodeAccess(), xListener );
+ configapi::implRemoveListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicRootElement::removeEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
throw(uno::RuntimeException)
{
- implRemoveListener( getNodeAccess(), xListener );
+ configapi::implRemoveListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicUpdateElement::removeEventListener( const uno::Reference< css::lang::XEventListener >& xListener )
throw(uno::RuntimeException)
{
- implRemoveListener( getNodeAccess(), xListener );
+ configapi::implRemoveListener( getNodeAccess(), xListener );
}
//-----------------------------------------------------------------------------------
@@ -345,75 +345,75 @@ void SAL_CALL BasicUpdateElement::removeEventListener( const uno::Reference< css
OUString SAL_CALL BasicInnerElement::getImplementationName( ) throw(uno::RuntimeException)
{
- return implGetImplementationName( getNodeAccess(), getElementClass() );
+ return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
OUString SAL_CALL BasicSetElement::getImplementationName( ) throw(uno::RuntimeException)
{
- return implGetImplementationName( getNodeAccess(), getElementClass() );
+ return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
OUString SAL_CALL BasicRootElement::getImplementationName( ) throw(uno::RuntimeException)
{
- return implGetImplementationName( getNodeAccess(), getElementClass() );
+ return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
OUString SAL_CALL BasicUpdateElement::getImplementationName( ) throw(uno::RuntimeException)
{
- return implGetImplementationName( getNodeAccess(), getElementClass() );
+ return configapi::implGetImplementationName( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
sal_Bool SAL_CALL BasicInnerElement::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
{
- return implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
+ return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
}
//-----------------------------------------------------------------------------------
sal_Bool SAL_CALL BasicSetElement::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
{
- return implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
+ return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
}
//-----------------------------------------------------------------------------------
sal_Bool SAL_CALL BasicRootElement::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
{
- return implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
+ return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
}
//-----------------------------------------------------------------------------------
sal_Bool SAL_CALL BasicUpdateElement::supportsService( const OUString& ServiceName ) throw(uno::RuntimeException)
{
- return implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
+ return configapi::implSupportsService( getNodeAccess(), getElementClass(), ServiceName );
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL BasicInnerElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
- return implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
+ return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL BasicSetElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
- return implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
+ return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL BasicRootElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
- return implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
+ return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
uno::Sequence< OUString > SAL_CALL BasicUpdateElement::getSupportedServiceNames( ) throw(uno::RuntimeException)
{
- return implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
+ return configapi::implGetSupportedServiceNames( getNodeAccess(), getElementClass() );
}
//-----------------------------------------------------------------------------------
@@ -426,7 +426,7 @@ uno::Sequence< OUString > SAL_CALL BasicUpdateElement::getSupportedServiceNames
OUString SAL_CALL BasicSetElement::getTemplateName( ) throw(uno::RuntimeException)
{
- return implGetTemplateName( getElementClass() );
+ return configapi::implGetTemplateName( getElementClass() );
}
//-----------------------------------------------------------------------------------
@@ -436,7 +436,7 @@ OUString SAL_CALL BasicSetElement::getTemplateName( ) throw(uno::RuntimeExceptio
sal_Int64 SAL_CALL BasicSetElement::getSomething( const uno::Sequence< sal_Int8 >& aIdentifier )
throw(uno::RuntimeException)
{
- return implGetSomething( getElementClass(), aIdentifier);
+ return configapi::implGetSomething( getElementClass(), aIdentifier);
}
//-----------------------------------------------------------------------------------
@@ -450,26 +450,26 @@ sal_Int64 SAL_CALL BasicSetElement::getSomething( const uno::Sequence< sal_Int8
css::lang::Locale SAL_CALL BasicRootElement::getLocale( ) throw(uno::RuntimeException)
{
- return implGetLocale( getElementClass() );
+ return configapi::implGetLocale( getElementClass() );
}
//-----------------------------------------------------------------------------------
css::lang::Locale SAL_CALL BasicUpdateElement::getLocale( ) throw(uno::RuntimeException)
{
- return implGetLocale( getElementClass() );
+ return configapi::implGetLocale( getElementClass() );
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
void SAL_CALL BasicRootElement::setLocale( const css::lang::Locale& eLocale ) throw(uno::RuntimeException)
{
- implSetLocale( getElementClass(), eLocale );
+ configapi::implSetLocale( getElementClass(), eLocale );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicUpdateElement::setLocale( const css::lang::Locale& eLocale ) throw(uno::RuntimeException)
{
- implSetLocale( getElementClass(), eLocale );
+ configapi::implSetLocale( getElementClass(), eLocale );
}
//-----------------------------------------------------------------------------------
@@ -479,19 +479,19 @@ void SAL_CALL BasicUpdateElement::setLocale( const css::lang::Locale& eLocale )
void SAL_CALL BasicUpdateElement::commitChanges( ) throw(css::lang::WrappedTargetException, uno::RuntimeException)
{
- implCommitChanges( getElementClass() );
+ configapi::implCommitChanges( getElementClass() );
}
//-----------------------------------------------------------------------------------
sal_Bool SAL_CALL BasicUpdateElement::hasPendingChanges( ) throw(uno::RuntimeException)
{
- return implHasPendingChanges( getElementClass() );
+ return configapi::implHasPendingChanges( getElementClass() );
}
//-----------------------------------------------------------------------------------
uno::Sequence< css::util::ElementChange > SAL_CALL BasicUpdateElement::getPendingChanges( ) throw(uno::RuntimeException)
{
- return implGetPendingChanges( getElementClass() );
+ return configapi::implGetPendingChanges( getElementClass() );
}
//-----------------------------------------------------------------------------------
diff --git a/configmgr/source/api2/elementaccess.hxx b/configmgr/source/api2/elementaccess.hxx
index 0667dcf50e..6a9f11a0f5 100644
--- a/configmgr/source/api2/elementaccess.hxx
+++ b/configmgr/source/api2/elementaccess.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementaccess.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jb $ $Date: 2001-02-05 10:05:51 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,15 +100,12 @@
#include
#endif
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
namespace configmgr
{
//-----------------------------------------------------------------------------
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
+ using rtl::OUString;
//-----------------------------------------------------------------------------
namespace configapi
diff --git a/configmgr/source/api2/elementimpl.cxx b/configmgr/source/api2/elementimpl.cxx
index 8601aad390..aba915c3ac 100644
--- a/configmgr/source/api2/elementimpl.cxx
+++ b/configmgr/source/api2/elementimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementimpl.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: jb $ $Date: 2002-12-06 13:08:28 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -83,6 +83,9 @@
#ifndef CONFIGMGR_API_TRANSLATECHANGES_HXX_
#include "translatechanges.hxx"
#endif
+#ifndef CONFIGMGR_API_APITYPES_HXX_
+#include "apitypes.hxx"
+#endif
#ifndef CONFIGMGR_CONFIGSET_HXX_
#include "configset.hxx"
diff --git a/configmgr/source/api2/elementimpl.hxx b/configmgr/source/api2/elementimpl.hxx
index 970a9eae14..eebc1473f5 100644
--- a/configmgr/source/api2/elementimpl.hxx
+++ b/configmgr/source/api2/elementimpl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementimpl.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,10 +62,6 @@
#ifndef CONFIGMGR_API_ELEMENTIMPL_HXX_
#define CONFIGMGR_API_ELEMENTIMPL_HXX_
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_
#include
#endif
@@ -86,6 +82,7 @@ namespace configmgr
{
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
+ using rtl::OUString;
/* implementations of the interfaces supported by a (parent) node
within the configuration tree.
diff --git a/configmgr/source/api2/groupaccess.cxx b/configmgr/source/api2/groupaccess.cxx
index 10f701ab41..d14ef74d99 100644
--- a/configmgr/source/api2/groupaccess.cxx
+++ b/configmgr/source/api2/groupaccess.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: groupaccess.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jb $ $Date: 2000-11-07 14:34:32 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,7 +66,6 @@
namespace configmgr
{
- using namespace configapi;
using uno::Reference;
using uno::Sequence;
@@ -77,14 +76,14 @@ namespace configmgr
//------------------------------------------------------------------------------------------------------------------
OUString SAL_CALL BasicGroupAccess::getHierarchicalName( ) throw(RuntimeException)
{
- return implGetHierarchicalName( getNode() );
+ return configapi::implGetHierarchicalName( getNode() );
}
//------------------------------------------------------------------------------------------------------------------
OUString SAL_CALL BasicGroupAccess::composeHierarchicalName( const OUString& sRelativeName )
throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, RuntimeException)
{
- return implComposeHierarchicalName( getNode(), sRelativeName );
+ return configapi::implComposeHierarchicalName( getNode(), sRelativeName );
}
//------------------------------------------------------------------------------------------------------------------
@@ -95,13 +94,13 @@ OUString SAL_CALL BasicGroupAccess::composeHierarchicalName( const OUString& sRe
//-----------------------------------------------------------------------------------
uno::Type SAL_CALL BasicGroupAccess::getElementType( ) throw(RuntimeException)
{
- return implGetElementType( getNode() );
+ return configapi::implGetElementType( getNode() );
}
//-----------------------------------------------------------------------------------
sal_Bool SAL_CALL BasicGroupAccess::hasElements( ) throw(RuntimeException)
{
- return implHasElements( getNode() );
+ return configapi::implHasElements( getNode() );
}
// XExactName
@@ -109,7 +108,7 @@ sal_Bool SAL_CALL BasicGroupAccess::hasElements( ) throw(RuntimeException)
OUString SAL_CALL BasicGroupAccess::getExactName( const OUString& rApproximateName ) throw(RuntimeException)
{
- return implGetExactName( getNode(), rApproximateName);
+ return configapi::implGetExactName( getNode(), rApproximateName);
}
// XProperty
@@ -117,7 +116,7 @@ OUString SAL_CALL BasicGroupAccess::getExactName( const OUString& rApproximateNa
css::beans::Property SAL_CALL BasicGroupAccess::getAsProperty( ) throw(uno::RuntimeException)
{
- return implGetAsProperty( getNode() );
+ return configapi::implGetAsProperty( getNode() );
}
// XNameAccess
@@ -125,34 +124,34 @@ css::beans::Property SAL_CALL BasicGroupAccess::getAsProperty( ) throw(uno::Run
sal_Bool SAL_CALL BasicGroupAccess::hasByName( const OUString& sName ) throw(RuntimeException)
{
- return implHasByName( getNode(), sName);
+ return configapi::implHasByName( getNode(), sName);
}
//-----------------------------------------------------------------------------------
Any SAL_CALL BasicGroupAccess::getByName( const OUString& sName )
throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, RuntimeException)
{
- return implGetByName( getNode(), sName );
+ return configapi::implGetByName( getNode(), sName );
}
//-----------------------------------------------------------------------------------
Sequence< OUString > SAL_CALL BasicGroupAccess::getElementNames( ) throw( RuntimeException)
{
- return implGetElementNames( getNode() );
+ return configapi::implGetElementNames( getNode() );
}
// XHierarchicalNameAccess
//-----------------------------------------------------------------------------------
sal_Bool SAL_CALL BasicGroupAccess::hasByHierarchicalName( const OUString& sName ) throw(RuntimeException)
{
- return implHasByHierarchicalName( getNode(), sName);
+ return configapi::implHasByHierarchicalName( getNode(), sName);
}
//-----------------------------------------------------------------------------------
Any SAL_CALL BasicGroupAccess::getByHierarchicalName( const OUString& sName )
throw(css::container::NoSuchElementException, RuntimeException)
{
- return implGetByHierarchicalName( getNode(), sName );
+ return configapi::implGetByHierarchicalName( getNode(), sName );
}
@@ -162,14 +161,14 @@ Any SAL_CALL BasicGroupAccess::getByHierarchicalName( const OUString& sName )
void SAL_CALL BasicGroupAccess::addContainerListener( const Reference< css::container::XContainerListener >& xListener )
throw(RuntimeException)
{
- implAddListener( getNode(), xListener );
+ configapi::implAddListener( getNode(), xListener );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicGroupAccess::removeContainerListener( const Reference< css::container::XContainerListener >& xListener )
throw(RuntimeException)
{
- implRemoveListener( getNode(), xListener );
+ configapi::implRemoveListener( getNode(), xListener );
}
diff --git a/configmgr/source/api2/groupaccess.hxx b/configmgr/source/api2/groupaccess.hxx
index 7e4f6d033e..dd84060fda 100644
--- a/configmgr/source/api2/groupaccess.hxx
+++ b/configmgr/source/api2/groupaccess.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: groupaccess.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jb $ $Date: 2000-11-07 14:34:32 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -85,14 +85,11 @@
#include
#endif
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
namespace configmgr
{
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
+ using rtl::OUString;
namespace configapi { class NodeGroupInfoAccess; }
diff --git a/configmgr/source/api2/groupupdate.cxx b/configmgr/source/api2/groupupdate.cxx
index 4f6d9d217b..1eae58326e 100644
--- a/configmgr/source/api2/groupupdate.cxx
+++ b/configmgr/source/api2/groupupdate.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: groupupdate.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jb $ $Date: 2000-11-07 14:34:32 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,6 +62,7 @@
#include "groupupdate.hxx"
#include "updateimpl.hxx"
#include "apinodeaccess.hxx"
+#include "apitypes.hxx"
#include
#include
@@ -69,7 +70,6 @@
namespace configmgr
{
//////////////////////////////////////////////////////////////////////////////////
- using namespace configapi;
using uno::Reference;
using uno::Sequence;
@@ -100,7 +100,7 @@ uno::Sequence< uno::Type > SAL_CALL BasicGroup::getTypes( ) throw (uno::RuntimeE
{
/*static ?*/
cppu::OTypeCollection aTypes(
- getReferenceType(static_cast< css::container::XNameReplace *>(this)),
+ configapi::getReferenceType(static_cast< css::container::XNameReplace *>(this)),
BasicGroupAccess::getTypes());
return aTypes.getTypes();
@@ -133,7 +133,7 @@ configapi::NodeGroupAccess& BasicGroup::getGroupNode()
void SAL_CALL BasicGroup::replaceByName( const OUString& rName, const uno::Any& rElement )
throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
{
- implReplaceByName( getGroupNode(), rName, rElement );
+ configapi::implReplaceByName( getGroupNode(), rName, rElement );
}
//-----------------------------------------------------------------------------------
diff --git a/configmgr/source/api2/groupupdate.hxx b/configmgr/source/api2/groupupdate.hxx
index a5c32b25ba..cd6b367e05 100644
--- a/configmgr/source/api2/groupupdate.hxx
+++ b/configmgr/source/api2/groupupdate.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: groupupdate.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jb $ $Date: 2000-11-07 14:34:32 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,10 +68,6 @@
#include
#endif
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
//........................................................................
namespace configmgr
{
diff --git a/configmgr/source/api2/listenercontainer.cxx b/configmgr/source/api2/listenercontainer.cxx
index 5442d31920..50a82e7340 100644
--- a/configmgr/source/api2/listenercontainer.cxx
+++ b/configmgr/source/api2/listenercontainer.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: listenercontainer.cxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jb $ $Date: 2000-11-13 13:27:15 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -98,7 +98,7 @@ void DisposeNotifier::notify()
{
if (it->is())
{
- (*it)->disposing(aEvent);
+ try { (*it)->disposing(aEvent); } catch (uno::Exception & ) {}
it->clear();
}
}
diff --git a/configmgr/source/api2/listenercontainer.hxx b/configmgr/source/api2/listenercontainer.hxx
index d8e4fcd540..da8e606315 100644
--- a/configmgr/source/api2/listenercontainer.hxx
+++ b/configmgr/source/api2/listenercontainer.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: listenercontainer.hxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: jb $ $Date: 2002-10-15 15:02:27 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,8 +62,6 @@
#ifndef CONFIGMGR_API_LISTENERCONTAINER_HXX_
#define CONFIGMGR_API_LISTENERCONTAINER_HXX_
-#include "apitypes.hxx"
-
#ifndef _COM_SUN_STAR_LANG_XEVENTLISTENER_HPP_
#include
#endif
@@ -262,14 +260,14 @@ namespace configmgr
* Call disposing on all object in all the containers that
* support XEventListener. Then clear the container.
*/
- bool disposeAll(KeyFinder _aFinder) throw(uno::RuntimeException);
+ bool disposeAll(KeyFinder _aFinder) throw();
/**
* Call disposing on all object in all the container for anIndex
* and in the containers for the associated indices
* support XEventListener. Then clear the container.
*/
- bool disposeOne( KeyFinder _aFinder, Index anIndex ) throw(uno::RuntimeException);
+ bool disposeOne( KeyFinder _aFinder, Index anIndex ) throw();
/**
* Start disposing this object, leave the mutex locked for dispose processing
@@ -289,7 +287,7 @@ namespace configmgr
* @return
* if disposing had already been started before
*/
- void notifyDisposing(KeyFinder _aFinder) throw(uno::RuntimeException);
+ void notifyDisposing(KeyFinder _aFinder) throw();
/// mark the end of the dispose processing
void endDisposing() throw();
@@ -334,7 +332,7 @@ namespace configmgr
* the same pointer more than once.
* @return the new count of elements in the container (or 0 if the object is ready being disposed).
*/
- sal_Int32 addListener( Index nIndex, const UnoType& aType, uno::Reference< lang::XEventListener > const& xListener) throw(uno::RuntimeException);
+ sal_Int32 addListener( Index nIndex, const UnoType& aType, uno::Reference< lang::XEventListener > const& xListener) throw();
/**
* Remove an element from the container specified with the index and type.
@@ -343,7 +341,7 @@ namespace configmgr
* @param xListener the removed interface.
* @return the new count of elements in the container (or 0 if the object is ready being disposed).
*/
- sal_Int32 removeListener( Index nIndex, const UnoType& aType, uno::Reference< lang::XEventListener > const& xListener) throw(uno::RuntimeException);
+ sal_Int32 removeListener( Index nIndex, const UnoType& aType, uno::Reference< lang::XEventListener > const& xListener) throw();
/**
@@ -354,7 +352,7 @@ namespace configmgr
* the same pointer more than once.
* @return the new count of elements in the container (or 0 if the object is ready being disposed).
*/
- sal_Int32 addSpecialListener( const Key_& aKey, uno::Reference< lang::XEventListener > const& xListener) throw(uno::RuntimeException);
+ sal_Int32 addSpecialListener( const Key_& aKey, uno::Reference< lang::XEventListener > const& xListener) throw();
/**
* Remove an element from the container specified with the key.
@@ -363,7 +361,7 @@ namespace configmgr
* @param xListener the removed interface.
* @return the new count of elements in the container (or 0 if the object is ready being disposed).
*/
- sal_Int32 removeSpecialListener( const Key_& aKey, uno::Reference< lang::XEventListener > const& xListener) throw(uno::RuntimeException);
+ sal_Int32 removeSpecialListener( const Key_& aKey, uno::Reference< lang::XEventListener > const& xListener) throw();
private:
void implFillDisposer(DisposeNotifier& aNotifier, KeyFinder _aFinder, Index nIndex);
@@ -409,7 +407,7 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
template
- bool SpecialListenerContainer::disposeAll(KeyFinder _aFinder) throw(uno::RuntimeException)
+ bool SpecialListenerContainer::disposeAll(KeyFinder _aFinder) throw()
{
if (beginDisposing())
{
@@ -422,7 +420,7 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
template
- bool SpecialListenerContainer::disposeOne(KeyFinder _aFinder, Index nIndex) throw(uno::RuntimeException)
+ bool SpecialListenerContainer::disposeOne(KeyFinder _aFinder, Index nIndex) throw()
{
// OSL_ENSURE(!isDisposed(),"Object is already disposed in toto");
@@ -467,7 +465,7 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
template
- void SpecialListenerContainer::notifyDisposing(KeyFinder _aFinder) throw(uno::RuntimeException)
+ void SpecialListenerContainer::notifyDisposing(KeyFinder _aFinder) throw()
{
OSL_ENSURE(isDisposing(),"Disposing isn't in progress on this object");
OSL_ENSURE(m_bDisposeLock,"Duplicate call for dispose notification or disposing is not taking place");
@@ -529,7 +527,7 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
template
- sal_Int32 SpecialListenerContainer::addListener( Index nIndex, const UnoType& aType, const uno::Reference< lang::XEventListener > & xListener ) throw(uno::RuntimeException)
+ sal_Int32 SpecialListenerContainer::addListener( Index nIndex, const UnoType& aType, const uno::Reference< lang::XEventListener > & xListener ) throw()
{
osl::ClearableMutexGuard aGuard( mutex() );
@@ -547,7 +545,7 @@ namespace configmgr
{
lang::EventObject aEvent(m_aContainers[nIndex].pInterface);
aGuard.clear();
- xListener->disposing(aEvent);
+ try { xListener->disposing(aEvent); } catch (uno::Exception & ) {}
}
}
@@ -558,7 +556,7 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
template
- sal_Int32 SpecialListenerContainer::addSpecialListener( const Key_& aKey, const uno::Reference< lang::XEventListener > & xListener ) throw(uno::RuntimeException)
+ sal_Int32 SpecialListenerContainer::addSpecialListener( const Key_& aKey, const uno::Reference< lang::XEventListener > & xListener ) throw()
{
osl::ClearableMutexGuard aGuard( mutex() );
@@ -574,7 +572,7 @@ namespace configmgr
{
lang::EventObject aEvent(m_aContainers[nIndex].pInterface);
aGuard.clear();
- xListener->disposing(aEvent);
+ try { xListener->disposing(aEvent); } catch (uno::Exception & ) {}
}
}
else
@@ -585,7 +583,7 @@ namespace configmgr
//-----------------------------------------------------------------------------
template
- sal_Int32 SpecialListenerContainer::removeListener( Index nIndex, const UnoType& aType, const uno::Reference< lang::XEventListener > & xListener ) throw(uno::RuntimeException)
+ sal_Int32 SpecialListenerContainer::removeListener( Index nIndex, const UnoType& aType, const uno::Reference< lang::XEventListener > & xListener ) throw()
{
osl::MutexGuard aGuard( mutex() );
OSL_ENSURE( !isDisposed(), "object is disposed" );
@@ -602,7 +600,7 @@ namespace configmgr
//-----------------------------------------------------------------------------
template
- sal_Int32 SpecialListenerContainer::removeSpecialListener( const Key_& aKey, const uno::Reference< lang::XEventListener > & xListener ) throw(uno::RuntimeException)
+ sal_Int32 SpecialListenerContainer::removeSpecialListener( const Key_& aKey, const uno::Reference< lang::XEventListener > & xListener ) throw()
{
osl::MutexGuard aGuard( mutex() );
OSL_ENSURE( !isDisposed(), "object is disposed" );
diff --git a/configmgr/source/api2/makefile.mk b/configmgr/source/api2/makefile.mk
index a6de27ed09..8360e5174b 100644
--- a/configmgr/source/api2/makefile.mk
+++ b/configmgr/source/api2/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.8 $
+# $Revision: 1.9 $
#
-# last change: $Author: dg $ $Date: 2001-10-11 14:18:27 $
+# last change: $Author: hr $ $Date: 2003-03-19 16:18:34 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -74,21 +74,15 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files -------------------------------------
SLOFILES= \
- $(SLO)$/adminimpl.obj \
- $(SLO)$/userimpl.obj \
- $(SLO)$/groupimpl.obj \
- $(SLO)$/confapifactory.obj \
$(SLO)$/broadcaster.obj \
$(SLO)$/listenercontainer.obj \
$(SLO)$/provider.obj \
$(SLO)$/providerimpl.obj \
- $(SLO)$/adminprovider.obj \
- $(SLO)$/adminproviderimpl.obj \
$(SLO)$/confprovider2.obj \
$(SLO)$/confproviderimpl2.obj \
$(SLO)$/accessimpl.obj \
$(SLO)$/apiaccessobj.obj \
- $(SLO)$/apiserviceinfo.obj \
+ $(SLO)$/apiserviceinfo.obj \
$(SLO)$/apifactory.obj \
$(SLO)$/apifactoryimpl.obj \
$(SLO)$/apinodeaccess.obj \
@@ -111,6 +105,7 @@ SLOFILES= \
$(SLO)$/setobjects.obj \
$(SLO)$/setupdate.obj \
$(SLO)$/translatechanges.obj \
+ $(SLO)$/treeiterators.obj \
$(SLO)$/updateimpl.obj \
diff --git a/configmgr/source/api2/notifierimpl.hxx b/configmgr/source/api2/notifierimpl.hxx
index 9277369255..afe580940b 100644
--- a/configmgr/source/api2/notifierimpl.hxx
+++ b/configmgr/source/api2/notifierimpl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: notifierimpl.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,8 +62,6 @@
#ifndef CONFIGMGR_API_NOTIFIERIMPL_HXX_
#define CONFIGMGR_API_NOTIFIERIMPL_HXX_
-#include "apitypes.hxx"
-
#include "listenercontainer.hxx"
#include "noderef.hxx"
diff --git a/configmgr/source/api2/objectregistry.hxx b/configmgr/source/api2/objectregistry.hxx
index a6337b2290..491ffc07a1 100644
--- a/configmgr/source/api2/objectregistry.hxx
+++ b/configmgr/source/api2/objectregistry.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: objectregistry.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: armin $ $Date: 2001-03-07 17:18:22 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,7 +62,6 @@
#ifndef CONFIGMGR_API_OBJECTREGISTRY_HXX_
#define CONFIGMGR_API_OBJECTREGISTRY_HXX_
-#include "apitypes.hxx"
#include "noderef.hxx"
#include
diff --git a/configmgr/source/api2/propertyinfohelper.cxx b/configmgr/source/api2/propertyinfohelper.cxx
index 3287f1239a..08458727e5 100644
--- a/configmgr/source/api2/propertyinfohelper.cxx
+++ b/configmgr/source/api2/propertyinfohelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertyinfohelper.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -64,6 +64,10 @@
#ifndef CONFIGMGR_CONFIGPATH_HXX_
#include "configpath.hxx"
#endif
+#ifndef CONFIGMGR_CONFIGURATION_ATTRIBUTES_HXX_
+#include "attributes.hxx"
+#endif
+
#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HDL_
#include
#endif
@@ -78,7 +82,7 @@ namespace configmgr
{
//-----------------------------------------------------------------------------
beans::Property helperMakeProperty(configuration::Name const& aName,
- configuration::Attributes const aAttributes,
+ node::Attributes const aAttributes,
uno::Type const& aType,
bool bDefaultable )
throw(uno::RuntimeException)
diff --git a/configmgr/source/api2/propertyinfohelper.hxx b/configmgr/source/api2/propertyinfohelper.hxx
index a34cf8a465..b07a8f0117 100644
--- a/configmgr/source/api2/propertyinfohelper.hxx
+++ b/configmgr/source/api2/propertyinfohelper.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertyinfohelper.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jb $ $Date: 2001-09-28 12:44:03 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,17 +62,15 @@
#ifndef CONFIGMGR_API_PROPERTYINFOIMPL_HXX_
#define CONFIGMGR_API_PROPERTYINFOIMPL_HXX_
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
#ifndef _COM_SUN_STAR_BEANS_PROPERTY_HPP_
#include
#endif
+#ifndef _COM_SUN_STAR_UNO_RUNTIMEEXCEPTION_HPP_
+#include
+#endif
namespace configmgr
{
- namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
namespace beans = ::com::sun::star::beans;
diff --git a/configmgr/source/api2/propertysetaccess.cxx b/configmgr/source/api2/propertysetaccess.cxx
index 72b4d5e2e1..ee02d6c3d3 100644
--- a/configmgr/source/api2/propertysetaccess.cxx
+++ b/configmgr/source/api2/propertysetaccess.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertysetaccess.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jb $ $Date: 2001-09-28 12:44:03 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,7 +68,6 @@
namespace configmgr
{
//////////////////////////////////////////////////////////////////////////////////
- using namespace configapi;
using uno::Reference;
using uno::Sequence;
@@ -88,7 +87,7 @@ namespace configmgr
uno::Reference< beans::XPropertySetInfo > SAL_CALL BasicPropertySet::getPropertySetInfo( )
throw(uno::RuntimeException)
{
- return implGetPropertySetInfo( getNode(), NULL != maybeGetUpdateAccess() );
+ return configapi::implGetPropertySetInfo( getNode(), NULL != maybeGetUpdateAccess() );
}
// XHierarchicalPropertySet & XHierarchicalMultiPropertySet
@@ -96,7 +95,7 @@ uno::Reference< beans::XPropertySetInfo > SAL_CALL BasicPropertySet::getProperty
uno::Reference< beans::XHierarchicalPropertySetInfo > SAL_CALL BasicPropertySet::getHierarchicalPropertySetInfo( )
throw(uno::RuntimeException)
{
- return implGetHierarchicalPropertySetInfo( getNode() );
+ return configapi::implGetHierarchicalPropertySetInfo( getNode() );
}
//////////////////////////////////////////////////////////////////////////////////
@@ -125,7 +124,7 @@ void SAL_CALL BasicPropertySet::setPropertyValue( const OUString& aPropertyName,
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
- implSetPropertyValue( getGroupNode(), aPropertyName, aValue );
+ configapi::implSetPropertyValue( getGroupNode(), aPropertyName, aValue );
}
// XMultiPropertySet
@@ -134,7 +133,7 @@ void SAL_CALL BasicPropertySet::setPropertyValues( const uno::Sequence< OUString
throw(beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
- implSetPropertyValues( getGroupNode(), PropertyNames, Values );
+ configapi::implSetPropertyValues( getGroupNode(), PropertyNames, Values );
}
// XHierarchicalPropertySet
@@ -143,7 +142,7 @@ void SAL_CALL BasicPropertySet::setHierarchicalPropertyValue( const OUString& aP
throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
- implSetHierarchicalPropertyValue( getGroupNode(), aPropertyName, aValue );
+ configapi::implSetHierarchicalPropertyValue( getGroupNode(), aPropertyName, aValue );
}
// XMultiHierarchicalPropertySet
@@ -152,7 +151,7 @@ void SAL_CALL BasicPropertySet::setHierarchicalPropertyValues( const uno::Sequen
throw(beans::PropertyVetoException, lang::IllegalArgumentException,
lang::WrappedTargetException, uno::RuntimeException)
{
- implSetHierarchicalPropertyValues( getGroupNode(), PropertyNames, Values );
+ configapi::implSetHierarchicalPropertyValues( getGroupNode(), PropertyNames, Values );
}
@@ -164,7 +163,7 @@ void SAL_CALL BasicPropertySet::setHierarchicalPropertyValues( const uno::Sequen
uno::Any SAL_CALL BasicPropertySet::getPropertyValue( const OUString& aPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- return implGetPropertyValue( getNode(), aPropertyName );
+ return configapi::implGetPropertyValue( getNode(), aPropertyName );
}
// XMultiPropertySet
@@ -172,7 +171,7 @@ uno::Any SAL_CALL BasicPropertySet::getPropertyValue( const OUString& aPropertyN
uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyValues( const uno::Sequence< OUString >& aPropertyNames )
throw(uno::RuntimeException)
{
- return implGetPropertyValues( getNode(), aPropertyNames );
+ return configapi::implGetPropertyValues( getNode(), aPropertyNames );
}
// XHierarchicalPropertySet
@@ -180,7 +179,7 @@ uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyValues( const un
uno::Any SAL_CALL BasicPropertySet::getHierarchicalPropertyValue( const OUString& aPropertyName )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- return implGetHierarchicalPropertyValue( getNode(), aPropertyName );
+ return configapi::implGetHierarchicalPropertyValue( getNode(), aPropertyName );
}
// XMultiHierarchicalPropertySet
@@ -188,7 +187,7 @@ uno::Any SAL_CALL BasicPropertySet::getHierarchicalPropertyValue( const OUString
uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getHierarchicalPropertyValues( const uno::Sequence< OUString >& aPropertyNames )
throw(uno::RuntimeException)
{
- return implGetHierarchicalPropertyValues( getNode(), aPropertyNames );
+ return configapi::implGetHierarchicalPropertyValues( getNode(), aPropertyNames );
}
//////////////////////////////////////////////////////////////////////////////////
@@ -198,40 +197,40 @@ uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getHierarchicalPropertyValu
void SAL_CALL BasicPropertySet::addVetoableChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& xListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- implAddListener( getNode(), xListener, aPropertyName );
+ configapi::implAddListener( getNode(), xListener, aPropertyName );
}
void SAL_CALL BasicPropertySet::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- implAddListener( getNode(), xListener, aPropertyName );
+ configapi::implAddListener( getNode(), xListener, aPropertyName );
}
void SAL_CALL BasicPropertySet::addPropertiesChangeListener( const uno::Sequence< OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
throw(uno::RuntimeException)
{
- implAddListener( getNode(), xListener, aPropertyNames );
+ configapi::implAddListener( getNode(), xListener, aPropertyNames );
}
//////////////////////////////////////////////////////////////////////////////////
void SAL_CALL BasicPropertySet::removeVetoableChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XVetoableChangeListener >& xListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- implRemoveListener( getNode(), xListener, aPropertyName );
+ configapi::implRemoveListener( getNode(), xListener, aPropertyName );
}
//---------------------------------------------------------------------------------
void SAL_CALL BasicPropertySet::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- implRemoveListener( getNode(), xListener, aPropertyName );
+ configapi::implRemoveListener( getNode(), xListener, aPropertyName );
}
//---------------------------------------------------------------------------------
void SAL_CALL BasicPropertySet::removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& xListener )
throw(uno::RuntimeException)
{
- implRemoveListener( getNode(), xListener );
+ configapi::implRemoveListener( getNode(), xListener );
}
//---------------------------------------------------------------------------------
@@ -242,7 +241,7 @@ void SAL_CALL BasicPropertySet::removePropertiesChangeListener( const uno::Refer
void SAL_CALL BasicPropertySet::firePropertiesChangeEvent( const uno::Sequence< OUString >& aPropertyNames, const uno::Reference< beans::XPropertiesChangeListener >& xListener )
throw(uno::RuntimeException)
{
- implFirePropertiesChangeEvent( getNode(),aPropertyNames , xListener );
+ configapi::implFirePropertiesChangeEvent( getNode(),aPropertyNames , xListener );
}
//////////////////////////////////////////////////////////////////////////////////
@@ -255,14 +254,14 @@ void SAL_CALL BasicPropertySet::firePropertiesChangeEvent( const uno::Sequence<
beans::PropertyState SAL_CALL BasicPropertySet::getPropertyState( const OUString& sPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- return implGetPropertyState( getNode(), sPropertyName);
+ return configapi::implGetPropertyState( getNode(), sPropertyName);
}
//---------------------------------------------------------------------------------
uno::Sequence< beans::PropertyState > SAL_CALL BasicPropertySet::getPropertyStates( const uno::Sequence< OUString >& aPropertyNames )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- return implGetPropertyStates( getNode(), aPropertyNames );
+ return configapi::implGetPropertyStates( getNode(), aPropertyNames );
}
//---------------------------------------------------------------------------------
@@ -272,21 +271,21 @@ uno::Sequence< beans::PropertyState > SAL_CALL BasicPropertySet::getPropertyStat
void SAL_CALL BasicPropertySet::setPropertyToDefault( const OUString& sPropertyName )
throw(beans::UnknownPropertyException, uno::RuntimeException)
{
- implSetPropertyToDefault( getGroupNode(), sPropertyName);
+ configapi::implSetPropertyToDefault( getGroupNode(), sPropertyName);
}
//---------------------------------------------------------------------------------
void SAL_CALL BasicPropertySet::setPropertiesToDefault( const uno::Sequence< OUString >& aPropertyNames )
throw (beans::UnknownPropertyException, uno::RuntimeException)
{
- implSetPropertiesToDefault( getGroupNode(), aPropertyNames);
+ configapi::implSetPropertiesToDefault( getGroupNode(), aPropertyNames);
}
//---------------------------------------------------------------------------------
void SAL_CALL BasicPropertySet::setAllPropertiesToDefault( )
throw (uno::RuntimeException)
{
- implSetAllPropertiesToDefault( getGroupNode() );
+ configapi::implSetAllPropertiesToDefault( getGroupNode() );
}
//---------------------------------------------------------------------------------
@@ -297,14 +296,14 @@ uno::Any SAL_CALL BasicPropertySet::getPropertyDefault( const OUString& sPropert
throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- return implGetPropertyDefault( getNode(), sPropertyName);
+ return configapi::implGetPropertyDefault( getNode(), sPropertyName);
}
//---------------------------------------------------------------------------------
uno::Sequence< uno::Any > SAL_CALL BasicPropertySet::getPropertyDefaults( const uno::Sequence< OUString >& aPropertyNames )
throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
{
- return implGetPropertyDefaults( getNode(), aPropertyNames);
+ return configapi::implGetPropertyDefaults( getNode(), aPropertyNames);
}
//---------------------------------------------------------------------------------
diff --git a/configmgr/source/api2/propertysetaccess.hxx b/configmgr/source/api2/propertysetaccess.hxx
index f0f15f7a39..f125970cad 100644
--- a/configmgr/source/api2/propertysetaccess.hxx
+++ b/configmgr/source/api2/propertysetaccess.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertysetaccess.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jb $ $Date: 2001-09-28 12:44:03 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:35 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -86,10 +86,6 @@
#include
#endif
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
namespace configmgr
{
/////////////////////////////////////////////////////////////////////////////////////////////
@@ -97,6 +93,7 @@ namespace configmgr
namespace uno = css::uno;
namespace lang = css::lang;
namespace beans = css::beans;
+ using rtl::OUString;
namespace configapi
{
diff --git a/configmgr/source/api2/propsetaccessimpl.cxx b/configmgr/source/api2/propsetaccessimpl.cxx
index b3062012b5..53da26f4a4 100644
--- a/configmgr/source/api2/propsetaccessimpl.cxx
+++ b/configmgr/source/api2/propsetaccessimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propsetaccessimpl.cxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -88,11 +88,14 @@
#ifndef CONFIGMGR_CONFIGNOTIFIER_HXX_
#include "confignotifier.hxx"
#endif
+#ifndef CONFIGMGR_API_BROADCASTER_HXX_
+#include "broadcaster.hxx"
+#endif
#ifndef CONFIGMGR_API_APITYPES_HXX_
#include "apitypes.hxx"
#endif
-#ifndef CONFIGMGR_API_BROADCASTER_HXX_
-#include "broadcaster.hxx"
+#ifndef CONFIGMGR_CONFIGURATION_ATTRIBUTES_HXX_
+#include "attributes.hxx"
#endif
#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
@@ -185,7 +188,7 @@ public:
}
private:
- typedef configuration::Attributes NodeAttributes;
+ typedef node::Attributes NodeAttributes;
void reset() { m_aProperties.clear(); }
diff --git a/configmgr/source/api2/propsetaccessimpl.hxx b/configmgr/source/api2/propsetaccessimpl.hxx
index 08e90763e4..426bdb0b2e 100644
--- a/configmgr/source/api2/propsetaccessimpl.hxx
+++ b/configmgr/source/api2/propsetaccessimpl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propsetaccessimpl.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jb $ $Date: 2001-09-28 12:44:03 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,10 +62,6 @@
#ifndef CONFIGMGR_API_PROPERTYSETIMPL_HXX_
#define CONFIGMGR_API_PROPERTYSETIMPL_HXX_
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include
#endif
@@ -91,6 +87,7 @@ namespace configmgr
namespace uno = ::com::sun::star::uno;
namespace lang = ::com::sun::star::lang;
namespace beans = ::com::sun::star::beans;
+ using rtl::OUString;
/* implementations of the interfaces supported by a (parent) node
within the configuration tree.
diff --git a/configmgr/source/api2/provider.cxx b/configmgr/source/api2/provider.cxx
index 31a406b6a1..ae5181be73 100644
--- a/configmgr/source/api2/provider.cxx
+++ b/configmgr/source/api2/provider.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: provider.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: jb $ $Date: 2002-12-06 13:08:29 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,9 +68,6 @@
#include "bootstrap.hxx"
#endif
-#ifndef CONFIGMGR_CMTREEMODEL_HXX
-#include "cmtreemodel.hxx"
-#endif
#ifndef _OSL_MUTEX_HXX_
#include
#endif
@@ -117,9 +114,12 @@ namespace configmgr
virtual void SAL_CALL disposing(com::sun::star::lang::EventObject const& rEvt) throw()
{
- CFG_TRACE_INFO("Service Manager disposed, disposing the provider");
- if (m_pProvider)
- m_pProvider->disposing(rEvt);
+ CFG_TRACE_INFO("Service Manager or context disposed, disposing the provider");
+ if (OProvider* pProvider = m_pProvider)
+ {
+ m_pProvider = NULL;
+ pProvider->disposing(rEvt);
+ }
}
};
@@ -127,28 +127,85 @@ namespace configmgr
//= OProvider
//=============================================================================
//-----------------------------------------------------------------------------
- OProvider::OProvider(const uno::Reference< lang::XMultiServiceFactory >& _xServiceFactory, ServiceImplementationInfo const* pInfo)
+ OProvider::OProvider(CreationContext const & xContext, ServiceImplementationInfo const* pInfo)
:ServiceComponentImpl(pInfo)
,OPropertyContainer(ServiceComponentImpl::rBHelper)
- ,m_xServiceFactory(_xServiceFactory)
+ ,m_xContext(xContext)
{
- m_xDisposeListener = new OProviderDisposingListener(this);
- uno::Reference xComponent(m_xServiceFactory, uno::UNO_QUERY);
- if (xComponent.is())
- xComponent->addEventListener(m_xDisposeListener);
+ OSL_ENSURE(m_xContext.is(), "Creating a provider without a context");
+ attachToContext();
}
//-----------------------------------------------------------------------------
OProvider::~OProvider()
+ {
+ discardContext(releaseContext());
+ }
+
+ //-----------------------------------------------------------------------------
+ void OProvider::attachToContext()
+ {
+ ::osl::MutexGuard aGuard(ServiceComponentImpl::rBHelper.rMutex);
+ OSL_ASSERT(!m_xDisposeListener.is());
+ if (m_xContext.is())
+ {
+ uno::Reference< lang::XComponent > xContextComp(m_xContext, uno::UNO_QUERY);
+ uno::Reference< lang::XComponent > xServiceMgrComp(m_xContext->getServiceManager(), uno::UNO_QUERY);
+
+ m_xDisposeListener = new OProviderDisposingListener(this);
+
+ if (xContextComp.is()) xContextComp ->addEventListener(m_xDisposeListener);
+ if (xServiceMgrComp.is()) xServiceMgrComp->addEventListener(m_xDisposeListener);
+
+ OSL_ENSURE(xServiceMgrComp.is() || xContextComp.is(),
+ "Provider cannot detect shutdown -> no XComponent found");
+ }
+ }
+
+ //-----------------------------------------------------------------------------
+ uno::Reference< lang::XComponent > OProvider::releaseContext()
{
- if (m_xDisposeListener.is() && m_xServiceFactory.is())
+ ::osl::MutexGuard aGuard(ServiceComponentImpl::rBHelper.rMutex);
+
+ uno::Reference< lang::XComponent > xContextComp(m_xContext, uno::UNO_QUERY);
+ if (m_xDisposeListener.is() && m_xContext.is())
{
- uno::Reference xComponent(m_xServiceFactory, uno::UNO_QUERY);
- if (xComponent.is())
- xComponent->removeEventListener(m_xDisposeListener);
+ uno::Reference< lang::XComponent > xServiceMgrComp(m_xContext->getServiceManager(), uno::UNO_QUERY);
+
+ if (xContextComp.is())
+ {
+ try { xContextComp ->removeEventListener(m_xDisposeListener); }
+ catch (uno::Exception & ) {}
+ }
+
+ if (xServiceMgrComp.is())
+ {
+ try { xServiceMgrComp->removeEventListener(m_xDisposeListener); }
+ catch (uno::Exception & ) {}
+ }
}
+ m_xDisposeListener = NULL;
+ m_xContext = NULL;
+
+ return xContextComp;
}
+ //-----------------------------------------------------------------------------
+ void OProvider::discardContext(uno::Reference< lang::XComponent > const & xContext)
+ {
+ if (xContext.is())
+ {
+ uno::Reference< uno::XComponentContext > xCC(xContext,uno::UNO_QUERY);
+ OSL_ASSERT(xCC.is());
+
+ if (BootstrapContext::isWrapper(xCC))
+ {
+ try { xContext->dispose(); }
+ catch (uno::Exception & ) {}
+ }
+ }
+ }
+ //-----------------------------------------------------------------------------
// XTypeProvider
//-----------------------------------------------------------------------------
uno::Sequence< uno::Type > SAL_CALL OProvider::getTypes( ) throw(uno::RuntimeException)
@@ -174,7 +231,7 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
- void OProvider::implConnect(OProviderImpl& _rFreshProviderImpl, const ConnectionSettings& _rSettings) throw(uno::Exception)
+ void OProvider::implConnect(OProviderImpl& _rFreshProviderImpl, const ContextReader& _rSettings) throw(uno::Exception)
{
if (!_rFreshProviderImpl.initSession(_rSettings))
throw uno::Exception(::rtl::OUString::createFromAscii("Could not connect to the configuration. Please check your settings."), THISREF() );
@@ -182,33 +239,20 @@ namespace configmgr
//-----------------------------------------------------------------------------
void SAL_CALL OProvider::disposing(com::sun::star::lang::EventObject const& rEvt) throw()
- {
- {
- ::osl::MutexGuard aGuard(ServiceComponentImpl::rBHelper.rMutex);
- m_xDisposeListener = NULL;
- m_xServiceFactory = NULL;
- }
- dispose();
+ {
+ releaseContext();
+ this->dispose();
}
//-----------------------------------------------------------------------------
void SAL_CALL OProvider::disposing()
{
- {
- ::osl::MutexGuard aGuard(ServiceComponentImpl::rBHelper.rMutex);
- if (m_xDisposeListener.is() && m_xServiceFactory.is())
- {
- uno::Reference xComponent(m_xServiceFactory, uno::UNO_QUERY);
- if (xComponent.is())
- xComponent->removeEventListener(m_xDisposeListener);
- }
-
- m_xServiceFactory = NULL;
- m_xDisposeListener = NULL;
- }
+ uno::Reference< lang::XComponent > xComp = releaseContext();
ServiceComponentImpl::disposing();
OPropertyContainer::disposing();
+
+ discardContext( xComp );
}
/*
// com::sun::star::lang::XUnoTunnel
diff --git a/configmgr/source/api2/provider.hxx b/configmgr/source/api2/provider.hxx
index 08def66f02..9ca36f5b38 100644
--- a/configmgr/source/api2/provider.hxx
+++ b/configmgr/source/api2/provider.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: provider.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jb $ $Date: 2002-12-06 13:08:29 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,15 +65,15 @@
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
#include
#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include
+#endif
#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HDL_
#include
#endif
#ifndef CONFIGMGR_API_SVCCOMPONENT_HXX_
#include "confsvccomponent.hxx"
#endif
-#ifndef _CONFIGMGR_COMMONTYPES_HXX_
-#include "commontypes.hxx"
-#endif
#ifndef _RTL_USTRING_HXX_
#include
#endif
@@ -96,7 +96,7 @@ namespace configmgr
using ::vos::ORef;
class Module;
- class ConnectionSettings;
+ class ContextReader;
class OProviderImpl;
typedef ::cppu::ImplHelper1 < lang::XMultiServiceFactory
@@ -121,7 +121,7 @@ namespace configmgr
friend class OProviderDisposingListener;
protected:
- uno::Reference< lang::XMultiServiceFactory > m_xServiceFactory;
+ uno::Reference< uno::XComponentContext > m_xContext;
uno::Reference< lang::XEventListener > m_xDisposeListener;
public:
@@ -131,7 +131,9 @@ namespace configmgr
static void SAL_CALL operator delete( void * pMem ) throw()
{ ServiceComponentImpl::operator delete( pMem ); }
- OProvider(const uno::Reference< lang::XMultiServiceFactory >& xServiceFactory, ServiceImplementationInfo const* pInfo);
+ typedef uno::Reference< uno::XComponentContext > CreationContext;
+
+ OProvider(CreationContext const & xContext, ServiceImplementationInfo const* pInfo);
virtual ~OProvider();
/// XTypeOProvider
@@ -159,7 +161,7 @@ namespace configmgr
protected:
// creates a new session
- void implConnect(OProviderImpl& rFreshProviderImpl, const ConnectionSettings& _rSettings) throw (uno::Exception);
+ void implConnect(OProviderImpl& rFreshProviderImpl, const ContextReader& _rSettings) throw (uno::Exception);
protected:
/// Component Helper override
@@ -179,6 +181,10 @@ namespace configmgr
uno::Any SAL_CALL queryPropertyInterface(uno::Type const& rType) throw (uno::RuntimeException)
{ return OPropertyContainer::queryInterface(rType);}
+ private:
+ void attachToContext();
+ uno::Reference< lang::XComponent > releaseContext();
+ void discardContext(uno::Reference< lang::XComponent > const & xContext);
};
} // namespace configmgr
diff --git a/configmgr/source/api2/providerimpl.cxx b/configmgr/source/api2/providerimpl.cxx
index 80312ed163..35e4b01766 100644
--- a/configmgr/source/api2/providerimpl.cxx
+++ b/configmgr/source/api2/providerimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: providerimpl.cxx,v $
*
- * $Revision: 1.55 $
+ * $Revision: 1.56 $
*
- * last change: $Author: ssmith $ $Date: 2002-12-13 10:25:01 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,9 +87,6 @@
#ifndef CONFIGMGR_BOOTSTRAP_HXX_
#include "bootstrap.hxx"
#endif
-#ifndef _CONFIGMGR_SESSION_CONFIGSESSION_HXX_
-#include "configsession.hxx"
-#endif
#ifndef CONFIGMGR_CACHEFACTORY_HXX_
#include "cachefactory.hxx"
#endif
@@ -187,25 +184,22 @@ namespace configmgr
//=============================================================================
//-----------------------------------------------------------------------------
OProviderImpl::OProviderImpl(OProvider* _pProvider, CreationContext const & _xContext)
- :m_xContext(_xContext)
- ,m_pNewProviders(0)
+ :m_pNewProviders(0)
,m_pProvider(_pProvider)
,m_aTreeManagerMutex()
,m_pTreeManager(NULL)
- ,m_pSession(NULL)
+ ,m_aDefaultOptions()
{
- OSL_ENSURE(m_xContext.is(), "Module::Module : missing service factory !");
+ OSL_ENSURE(_xContext.is(), "OProviderImpl : NULL context !");
+
+ uno::Reference< lang::XMultiComponentFactory > xFactory = _xContext->getServiceManager();
+ OSL_ENSURE(xFactory.is(), "OProviderImpl : missing service factory !");
+
m_xTypeConverter = m_xTypeConverter.query(
- m_xContext->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.Converter" ))));
+ xFactory->createInstanceWithContext( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.script.Converter" )),
+ _xContext));
+
OSL_ENSURE(m_xTypeConverter.is(), "Module::Module : could not create an instance of the type converter !");
-
- m_xDefaultOptions = new OOptions();
- }
- //-----------------------------------------------------------------------------
- IConfigSession * OProviderImpl::getSession() const
- {
- OSL_ENSURE( m_pSession, "Trying to get the legacy session from a new-style provider" );
- return m_pSession;
}
//-----------------------------------------------------------------------------
rtl::Reference< TreeManager > OProviderImpl::maybeGetTreeManager() const CFG_NOTHROW()
@@ -253,7 +247,7 @@ namespace configmgr
}
}
//-----------------------------------------------------------------------------
- bool OProviderImpl::initSession(const ConnectionSettings& _rSettings)
+ bool OProviderImpl::initSession(const ContextReader& _rSettings)
{
bool bNeedProfile = false;
rtl::Reference< TreeManager > xNewTreeManager;
@@ -261,7 +255,7 @@ namespace configmgr
{
this->implInitFromSettings(_rSettings,bNeedProfile);
- xNewTreeManager = CacheFactory::instance().createCacheManager(_rSettings, m_xContext);
+ xNewTreeManager = CacheFactory::instance().createCacheManager(_rSettings.getBaseContext());
}
else
{
@@ -281,12 +275,14 @@ namespace configmgr
static ::rtl::OUString ssUserProfile(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Setup"));
AbsolutePath aProfileModule = AbsolutePath::makeModulePath(ssUserProfile, AbsolutePath::NoValidate());
- data::NodeAccess aProfileTree = xNewTreeManager->requestSubtree(aProfileModule, m_xDefaultOptions);
+ data::NodeAccess aProfileTree = xNewTreeManager->requestSubtree(aProfileModule, m_aDefaultOptions);
if (aProfileTree.isValid())
+ {
implInitFromProfile(aProfileTree);
- // should we clean this up ?
- // m_pTreeMgr->releaseSubtree(ssUserProfile, m_xDefaultOptions);
+ // should we clean this up ?
+ // xNewTreeManager->releaseSubtree(aProfileModule, xTempOptions);
+ }
}
catch (uno::Exception& e)
{
@@ -299,7 +295,7 @@ namespace configmgr
//-----------------------------------------------------------------------------
// these can be overridden. default does nothing
- void OProviderImpl::initFromSettings(const ConnectionSettings& , bool& )
+ void OProviderImpl::initFromSettings(const ContextReader& , bool& )
{
}
//-----------------------------------------------------------------------------
@@ -308,30 +304,27 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
// these implement the base class behavior
- void OProviderImpl::implInitFromSettings(const ConnectionSettings& _rSettings, bool& rNeedProfile)
+ void OProviderImpl::implInitFromSettings(const ContextReader& _rSettings, bool& rNeedProfile)
{
bool bIntrinsicNeedProfile = true;
- // if we have a user name, we have to add and remember it for the session
- if (_rSettings.hasUser())
- {
- // the username is also part of the connection settings
- rtl::OUString sDefaultUser = _rSettings.getUser();
- m_xDefaultOptions->setDefaultUser(sDefaultUser);
- }
-
if (_rSettings.hasLocale())
{
bIntrinsicNeedProfile = false;
rtl::OUString sDefaultLocale = _rSettings.getLocale();
- m_xDefaultOptions->setDefaultLocale(sDefaultLocale);
+ m_aDefaultOptions.setLocale(sDefaultLocale);
+ }
+ else if (_rSettings.isAdminService())
+ {
+ bIntrinsicNeedProfile = false;
+ m_aDefaultOptions.setAllLocales();
}
else
- OSL_ASSERT(m_xDefaultOptions->getDefaultLocale().getLength() == 0);
+ OSL_ASSERT(!m_aDefaultOptions.hasLocale());
if (_rSettings.hasAsyncSetting())
{
- m_xDefaultOptions->setLazyWrite( !!_rSettings.getAsyncSetting() );
+ m_aDefaultOptions.enableAsync( !!_rSettings.getAsyncSetting() );
}
// call the template method
@@ -350,7 +343,7 @@ namespace configmgr
OSL_ASSERT(aProfileNode.isValid());
// read the default locale for the user
- if (m_xDefaultOptions->getDefaultLocale().getLength() == 0)
+ if (!m_aDefaultOptions.hasLocale())
{
using configuration::Name;
using configuration::makeNodeName;
@@ -367,7 +360,7 @@ namespace configmgr
rtl::OUString sDefaultLocale;
if (aValue.getValue() >>= sDefaultLocale)
{
- m_xDefaultOptions->setDefaultLocale(sDefaultLocale);
+ m_aDefaultOptions.setLocale(sDefaultLocale);
}
else
OSL_ENSURE(false, "Could not extract locale parameter into string");
@@ -385,7 +378,6 @@ namespace configmgr
clearTreeManager();
delete m_pNewProviders;
- delete m_pSession;
}
// --------------------------------- disposing ---------------------------------
@@ -398,9 +390,6 @@ namespace configmgr
if (xTM.is())
xTM->dispose();
- if (m_pSession)
- m_pSession->close();
-
clearTreeManager();
}
catch (uno::Exception& e)
@@ -438,20 +427,21 @@ namespace configmgr
// ITreeProvider /ITreeManager
//-----------------------------------------------------------------------------
- data::NodeAccess OProviderImpl::requestSubtree( AbsolutePath const& aSubtreePath, const vos::ORef < OOptions >& _xOptions,
- sal_Int16 nMinLevels) CFG_UNO_THROW_ALL( )
+ data::NodeAccess OProviderImpl::requestSubtree( AbsolutePath const& aSubtreePath,
+ RequestOptions const & _aOptions
+ ) CFG_UNO_THROW_ALL( )
{
rtl::Reference< TreeManager > xTreeManager = getTreeManager();
data::NodeAccess aTree = data::NodeAccess::emptyNode();
try
{
- aTree = xTreeManager->requestSubtree(aSubtreePath, _xOptions, nMinLevels);
+ aTree = xTreeManager->requestSubtree(aSubtreePath, _aOptions);
}
catch(uno::Exception&e)
{
- ::rtl::OUString sMessage = getErrorMessage(aSubtreePath, _xOptions);
+ ::rtl::OUString sMessage = getErrorMessage(aSubtreePath, _aOptions);
// append the error message given by the tree provider
sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\nThe backend returned the following error:\n"));
sMessage += e.Message;
@@ -461,7 +451,7 @@ namespace configmgr
if (!aTree.isValid())
{
- ::rtl::OUString sMessage = getErrorMessage(aSubtreePath, _xOptions);
+ ::rtl::OUString sMessage = getErrorMessage(aSubtreePath, _aOptions);
sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n\nNo backend error message available\n"));
@@ -478,19 +468,19 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
- void OProviderImpl::releaseSubtree( AbsolutePath const& aSubtreePath, const vos::ORef < OOptions >& _xOptions ) CFG_NOTHROW()
+ void OProviderImpl::releaseSubtree( AbsolutePath const& aSubtreePath, RequestOptions const& _aOptions ) CFG_NOTHROW()
{
rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
if (xTM.is())
- xTM->releaseSubtree(aSubtreePath, _xOptions);
+ xTM->releaseSubtree(aSubtreePath, _aOptions);
}
//-----------------------------------------------------------------------------
- void OProviderImpl::disposeData(const vos::ORef < OOptions >& _xOptions) CFG_NOTHROW()
+ void OProviderImpl::disposeData(RequestOptions const& _aOptions) CFG_NOTHROW()
{
rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
if (xTM.is())
- xTM->disposeData(_xOptions);
+ xTM->disposeData(_aOptions);
}
//-----------------------------------------------------------------------------
@@ -500,17 +490,17 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
- void OProviderImpl::fetchSubtree(AbsolutePath const& aSubtreePath, const vos::ORef < OOptions >& _xOptions, sal_Int16 nMinLevels) CFG_NOTHROW()
+ void OProviderImpl::fetchSubtree(AbsolutePath const& aSubtreePath, RequestOptions const& _aOptions) CFG_NOTHROW()
{
rtl::Reference< TreeManager > xTM = maybeGetTreeManager();
if (xTM.is())
- xTM->fetchSubtree(aSubtreePath, _xOptions, nMinLevels);
+ xTM->fetchSubtree(aSubtreePath, _aOptions);
}
//-----------------------------------------------------------------------------
- sal_Bool OProviderImpl::fetchDefaultData(memory::UpdateAccessor& _aAccessToken, AbsolutePath const& aSubtreePath, const vos::ORef < OOptions >& _xOptions, sal_Int16 nMinLevels) CFG_UNO_THROW_ALL( )
+ sal_Bool OProviderImpl::fetchDefaultData(memory::UpdateAccessor& _aAccessToken, AbsolutePath const& aSubtreePath, RequestOptions const& _aOptions) CFG_UNO_THROW_ALL( )
{
- return getTreeManager()->fetchDefaultData(_aAccessToken, aSubtreePath, _xOptions, nMinLevels);
+ return getTreeManager()->fetchDefaultData(_aAccessToken, aSubtreePath, _aOptions);
}
// IInterface
@@ -533,27 +523,27 @@ namespace configmgr
}
//-----------------------------------------------------------------------------
- memory::Segment* OProviderImpl::getDataSegment(AbsolutePath const& _rAccessor, const vos::ORef < OOptions >& _xOptions)
+ memory::Segment* OProviderImpl::getDataSegment(AbsolutePath const& _rAccessor, RequestOptions const& _aOptions)
{
- return getTreeManager()->getDataSegment(_rAccessor, _xOptions);
+ return getTreeManager()->getDataSegment(_rAccessor, _aOptions);
}
//-----------------------------------------------------------------------------------
- OUString OProviderImpl::getErrorMessage(AbsolutePath const& _rAccessor, const vos::ORef < OOptions >& _xOptions)
+ OUString OProviderImpl::getErrorMessage(AbsolutePath const& _rAccessor, RequestOptions const& _aOptions)
{
OUString const sAccessor = _rAccessor.toString();
CFG_TRACE_ERROR("config provider: the cache manager could not provide the tree (neither from the cache nor from the session)");
::rtl::OUString sMessage;
- ::rtl::OUString sUser(_xOptions->getUser());
- ::rtl::OUString sLocale(_xOptions->getLocale());
- CFG_TRACE_INFO_NI("config provider: the user we tried this for is \"%s\", the locale \"%s\", the path \"%s\"", OUSTRING2ASCII(sUser), OUSTRING2ASCII(sLocale), OUSTRING2ASCII(sAccessor));
+ ::rtl::OUString sEntity(_aOptions.getEntity());
+ ::rtl::OUString sLocale(_aOptions.getLocale());
+ CFG_TRACE_INFO_NI("config provider: the entity we tried this for is \"%s\", the locale \"%s\", the path \"%s\"", OUSTRING2ASCII(sEntity), OUSTRING2ASCII(sLocale), OUSTRING2ASCII(sAccessor));
sMessage += sAccessor;
- if (sUser.getLength())
+ if (sEntity.getLength())
{
- sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (and for user "));
- sMessage += sUser;
+ sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" (and for entity "));
+ sMessage += sEntity;
sMessage += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")"));
}
@@ -570,7 +560,7 @@ namespace configmgr
// actual factory methods
//-----------------------------------------------------------------------------------
- NodeElement* OProviderImpl::buildReadAccess(OUString const& _rAccessor, const vos::ORef < OOptions >& _xOptions, sal_Int32 nMinLevels) CFG_UNO_THROW_ALL( )
+ NodeElement* OProviderImpl::buildReadAccess(OUString const& _rAccessor, RequestOptions const& _aOptions, sal_Int32 nMinLevels) CFG_UNO_THROW_ALL( )
{
CFG_TRACE_INFO("config provider: requesting the tree from the cache manager");
@@ -585,21 +575,21 @@ namespace configmgr
AbsolutePath aAccessorPath = AbsolutePath::parse(_rAccessor);
- data::NodeAccess aTree = this->requestSubtree(aAccessorPath,_xOptions, sal_Int16(nMinLevels));
+ data::NodeAccess aTree = this->requestSubtree(aAccessorPath,_aOptions);
RTL_LOGFILE_CONTEXT_TRACE(aLog, "data loaded" );
- TreeDepth nDepth = (nMinLevels == ALL_LEVELS) ? C_TreeDepthAll : TreeDepth(nMinLevels);
+ TreeDepth nDepth = (nMinLevels == treeop::ALL_LEVELS) ? C_TreeDepthAll : TreeDepth(nMinLevels);
RTL_LOGFILE_CONTEXT_AUTHOR(aLog2, "configmgr::OProviderImpl", "jb99855", "configmgr: createReadOnlyTree()");
RootTree aRootTree( createReadOnlyTree(
- aAccessorPath, this->getDataSegment(aAccessorPath,_xOptions),
+ aAccessorPath, this->getDataSegment(aAccessorPath,_aOptions),
aTree, nDepth,
- TemplateProvider( this->getTemplateProvider(), _xOptions )
+ TemplateProvider( this->getTemplateProvider(), _aOptions )
));
- return m_pNewProviders->getReaderFactory().makeAccessRoot(aRootTree, _xOptions);
+ return m_pNewProviders->getReaderFactory().makeAccessRoot(aRootTree, _aOptions);
}
catch (configuration::Exception& e)
{
@@ -612,7 +602,7 @@ namespace configmgr
//-----------------------------------------------------------------------------------
- NodeElement* OProviderImpl::buildUpdateAccess(OUString const& _rAccessor, const vos::ORef < OOptions >& _xOptions,
+ NodeElement* OProviderImpl::buildUpdateAccess(OUString const& _rAccessor, RequestOptions const& _aOptions,
sal_Int32 nMinLevels) CFG_UNO_THROW_ALL( )
{
CFG_TRACE_INFO("config provider: requesting the tree from the cache manager");
@@ -627,22 +617,22 @@ namespace configmgr
AbsolutePath aAccessorPath = AbsolutePath::parse(_rAccessor);
- data::NodeAccess aTree = requestSubtree(aAccessorPath, _xOptions, sal_Int16(nMinLevels));
+ data::NodeAccess aTree = requestSubtree(aAccessorPath, _aOptions);
RTL_LOGFILE_CONTEXT_TRACE(aLog, "data loaded" );
- TreeDepth nDepth = (nMinLevels == ALL_LEVELS) ? C_TreeDepthAll : TreeDepth(nMinLevels);
+ TreeDepth nDepth = (nMinLevels == treeop::ALL_LEVELS) ? C_TreeDepthAll : TreeDepth(nMinLevels);
RTL_LOGFILE_CONTEXT_AUTHOR(aLog2, "configmgr::OProviderImpl", "jb99855", "createUpdatableTree()");
RootTree aRootTree( createUpdatableTree(
- aAccessorPath, this->getDataSegment(aAccessorPath,_xOptions),
+ aAccessorPath, this->getDataSegment(aAccessorPath,_aOptions),
aTree, nDepth,
- TemplateProvider( this->getTemplateProvider(), _xOptions )
+ TemplateProvider( this->getTemplateProvider(), _aOptions )
));
- return m_pNewProviders->getWriterFactory().makeAccessRoot(aRootTree, _xOptions);
+ return m_pNewProviders->getWriterFactory().makeAccessRoot(aRootTree, _aOptions);
}
catch (configuration::Exception& e)
{
@@ -659,12 +649,15 @@ namespace configmgr
sal_Char const * const OProviderImpl::FactoryArguments::asciiArgumentNames[] =
{
- "nodepath", // ARG_NODEPATH, // requested node path
- "depth", // ARG_DEPTH, // depth of the tree
- "user", // ARG_USER, // name of the user - only for admin
- "locale", // ARG_LOCALE, // desired locale
- "nocache", // ARG_NOCACHE, // cache disabling
- "lazywrite" // ARG_ASYNC, // lasy write data
+ "nodepath", // ARG_NODEPATH, // requested node path
+ "depth", // ARG_DEPTH, // depth of the tree
+ "user", // ARG_USER_DEPRECATED, // name of the user - only for admin
+ "locale", // ARG_LOCALE, // desired locale
+ "nocache", // ARG_NOCACHE_OBSOLETE, // cache disabling
+ "lazywrite", // ARG_ASYNC_DEPRECATED, // lasy write data
+ "enableasync", // ARG_ASYNC, // lasy write data
+ "entity", // ARG_ENTITY, // name of the entity to be manipulated - only for admin
+
};
OUString OProviderImpl::FactoryArguments::getArgumentName(Argument _which) CFG_NOTHROW()
@@ -719,7 +712,7 @@ namespace configmgr
OUString const& aName, uno::Any const& aValue,
OUString& /* [out] */ _rNodeAccessor,
sal_Int32& /* [out] */ _nLevels,
- vos::ORef /* [in/out] */ _xOptions )
+ RequestOptions& /* [in/out] */ _rOptions )
CFG_NOTHROW()
{
switch ( lookupArgument(aName) )
@@ -744,11 +737,12 @@ namespace configmgr
}
break;
- case ARG_USER:
+ case ARG_ENTITY:
+ case ARG_USER_DEPRECATED:
{
OUString sStringVal;
if (aValue >>= sStringVal)
- _xOptions->setUser(sStringVal);
+ _rOptions.setEntity(sStringVal);
else
return false;
}
@@ -759,14 +753,14 @@ namespace configmgr
OUString sStringVal;
if (aValue >>= sStringVal)
{
- _xOptions->setLocale(sStringVal);
+ _rOptions.setLocale(sStringVal);
break;
}
lang::Locale aLocale;
if (aValue >>= aLocale)
{
- _xOptions->setLocale(makeLocaleString(aLocale));
+ _rOptions.setLocale(makeLocaleString(aLocale));
break;
}
@@ -774,21 +768,22 @@ namespace configmgr
}
break;
- case ARG_NOCACHE:
+ case ARG_NOCACHE_OBSOLETE:
{
sal_Bool bBoolVal;
if (aValue >>= bBoolVal)
- _xOptions->setNoCache(!!bBoolVal);
+ OSL_ENSURE(false,"ConfigurationProvider: Parameter \"nocache\" is obsolete and has no effect");
else
return false;
}
break;
case ARG_ASYNC:
+ case ARG_ASYNC_DEPRECATED:
{
sal_Bool bBoolVal;
if (aValue >>= bBoolVal)
- _xOptions->setLazyWrite(!!bBoolVal);
+ _rOptions.enableAsync(!!bBoolVal);
else
return false;
}
@@ -909,10 +904,10 @@ namespace configmgr
void OProviderImpl::FactoryArguments::extractArgs( const uno::Sequence& _rArgs,
OUString& /* [out] */ _rNodeAccessor,
sal_Int32& /* [out] */ _nLevels,
- vos::ORef /* [in/out] */ _xOptions )
+ RequestOptions & /* [in/out] */ _aOptions )
CFG_THROW1 (lang::IllegalArgumentException)
{
- _nLevels = ITreeProvider::ALL_LEVELS; // setting a fallback
+ _nLevels = treeop::ALL_LEVELS; // setting a fallback
// the args have to be a sequence of property values
bool bLegacyFormat = false;
@@ -923,12 +918,12 @@ namespace configmgr
{
if (_rArgs[i] >>= aPV)
{
- if ( !extractOneArgument(aPV.Name,aPV.Value,_rNodeAccessor,_nLevels,_xOptions) )
+ if ( !extractOneArgument(aPV.Name,aPV.Value,_rNodeAccessor,_nLevels,_aOptions) )
failInvalidArgValue(aPV.Name,aPV.Value,i);
}
else if (_rArgs[i] >>= aNV)
{
- if ( !extractOneArgument(aNV.Name,aNV.Value,_rNodeAccessor,_nLevels,_xOptions) )
+ if ( !extractOneArgument(aNV.Name,aNV.Value,_rNodeAccessor,_nLevels,_aOptions) )
failInvalidArgValue(aNV.Name,aNV.Value,i);
}
else
diff --git a/configmgr/source/api2/providerimpl.hxx b/configmgr/source/api2/providerimpl.hxx
index c0518bb572..e43f14fdeb 100644
--- a/configmgr/source/api2/providerimpl.hxx
+++ b/configmgr/source/api2/providerimpl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: providerimpl.hxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: jb $ $Date: 2002-10-28 14:41:43 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:36 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,11 +68,17 @@
#ifndef CONFIGMGR_DEFAULTPROVIDER_HXX
#include "defaultprovider.hxx"
#endif
+#ifndef _CONFIGMGR_COMMONTYPES_HXX_
+#include "commontypes.hxx" // IInterface
+#endif
-#ifndef CONFIGMGR_MISC_OPTIONS_HXX_
-#include "options.hxx"
+#ifndef CONFIGMGR_MISC_REQUESTOPTIONS_HXX_
+#include "requestoptions.hxx"
#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include
+#endif
#ifndef _COM_SUN_STAR_SCRIPT_XTYPECONVERTER_HPP_
#include
#endif
@@ -122,9 +128,8 @@ namespace configmgr
class ISubtree;
class ITemplateManager;
class IConfigDefaultProvider;
- class IConfigSession;
class TreeManager;
- class ConnectionSettings;
+ class ContextReader;
struct IConfigBroadcaster;
@@ -150,12 +155,14 @@ namespace configmgr
/// possible arguments, given only in small letters.
enum Argument
{
- ARG_NODEPATH, // requested node path
- ARG_DEPTH, // depth of the tree
- ARG_USER, // name of the user - only for admin
- ARG_LOCALE, // desired locale
- ARG_NOCACHE, // cache disabling
- ARG_ASYNC, // lasy write data
+ ARG_NODEPATH, // requested node path
+ ARG_DEPTH, // depth of the tree
+ ARG_USER_DEPRECATED, // name of the entity to be manipulated - deprecated version
+ ARG_LOCALE, // desired locale
+ ARG_NOCACHE_OBSOLETE, // cache disabling - obsolete and nonfunctional
+ ARG_ASYNC_DEPRECATED, // lasy write data - deprecated version
+ ARG_ASYNC, // lazy write data
+ ARG_ENTITY, // name of the entity to be manipulated - only for admin
_arg_count,
ARG_NOT_FOUND = _arg_count
@@ -165,11 +172,12 @@ namespace configmgr
static OUString getArgumentName(Argument _which) CFG_NOTHROW();
static Argument lookupArgument(OUString const& sArgumentName) CFG_NOTHROW();
- static OUString getUserArgumentName() CFG_NOTHROW() { return getArgumentName(ARG_USER); }
+ static OUString getUserArgumentNameD() CFG_NOTHROW() { return getArgumentName(ARG_USER_DEPRECATED); }
+ static OUString getEntityArgumentName() CFG_NOTHROW() { return getArgumentName(ARG_ENTITY); }
static OUString getNodePathArgumentName() CFG_NOTHROW() { return getArgumentName(ARG_NODEPATH); }
static OUString getDepthArgumentNameArgumentName() CFG_NOTHROW() { return getArgumentName(ARG_DEPTH); }
static OUString getLocaleArgumentName() CFG_NOTHROW() { return getArgumentName(ARG_LOCALE); }
- static OUString getNoCacheArgumentName() CFG_NOTHROW() { return getArgumentName(ARG_NOCACHE); }
+ static OUString getNoCacheArgumentNameD() CFG_NOTHROW() { return getArgumentName(ARG_NOCACHE_OBSOLETE); }
static OUString getAsyncArgumentName() CFG_NOTHROW() { return getArgumentName(ARG_ASYNC); }
public:
/** extracts arguments from the argument sequence into to the parameter variables
@@ -185,34 +193,31 @@ namespace configmgr
static void extractArgs( const uno::Sequence& _rArgs,
OUString& /* [out] */ _rNodeAccessor,
sal_Int32& /* [out] */ _nLevels,
- vos::ORef /* [in/out] */ xOptions
+ RequestOptions& /* [in/out] */ xOptions
) CFG_THROW1(lang::IllegalArgumentException);
static bool extractOneArgument( OUString const& aName, uno::Any const& aValue,
OUString& /* [out] */ _rNodeAccessor,
sal_Int32& /* [out] */ _nLevels,
- vos::ORef /* [in/out] */ _xOptions
+ RequestOptions& /* [in/out] */ xOptions
) CFG_NOTHROW();
};
- private:
- typedef uno::Reference< lang::XMultiServiceFactory > CreationContext;
+ public:
+ typedef uno::Reference< uno::XComponentContext > CreationContext;
typedef uno::Reference< script::XTypeConverter > TypeConverterRef;
- CreationContext m_xContext;
+ private:
TypeConverterRef m_xTypeConverter;
- vos::ORef m_xDefaultOptions;
+ RequestOptions m_aDefaultOptions;
configapi::ApiProviderInstances* m_pNewProviders; /// order depedency - this must be after the TreeManager
mutable osl::Mutex m_aTreeManagerMutex;
TreeManager* m_pTreeManager; /// the tree cache. Will hold a reference to us as long as it life
- IConfigSession* m_pSession;
rtl::Reference< TreeManager > maybeGetTreeManager() const CFG_NOTHROW();
rtl::Reference< TreeManager > getTreeManager() const CFG_UNO_THROW_RTE();
void setTreeManager(TreeManager * pTreeManager) CFG_UNO_THROW_RTE();
void clearTreeManager() CFG_NOTHROW();
- protected:
- IConfigSession* getSession() const;
public:
OProviderImpl(OProvider* _pProvider, CreationContext const & _xContext);
@@ -220,19 +225,18 @@ namespace configmgr
virtual ~OProviderImpl();
/// ITreeManager
- virtual memory::Segment* getDataSegment(AbsolutePath const& _rAccessor, const vos::ORef < OOptions >& _xOptions);
- virtual data::NodeAccess requestSubtree(AbsolutePath const& aSubtreePath, const vos::ORef < OOptions >& _xOptions,
- sal_Int16 nMinLevels = ALL_LEVELS) CFG_UNO_THROW_ALL( );
+ virtual memory::Segment* getDataSegment(AbsolutePath const& _rAccessor, const RequestOptions& _aOptions);
+ virtual data::NodeAccess requestSubtree(AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions) CFG_UNO_THROW_ALL( );
virtual void updateTree(memory::UpdateAccessor& _aAccessToken, TreeChangeList& aChanges) CFG_UNO_THROW_ALL( );
- virtual void releaseSubtree( AbsolutePath const& aSubtreePath, const vos::ORef < OOptions >& _xOptions ) CFG_NOTHROW();
+ virtual void releaseSubtree( AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions ) CFG_NOTHROW();
virtual void saveAndNotifyUpdate(memory::Accessor const& _aChangedDataAccessor, TreeChangeList const& aChanges) CFG_UNO_THROW_ALL( );
- virtual void disposeData(const vos::ORef < OOptions >& _xOptions) CFG_NOTHROW();
- virtual void fetchSubtree(AbsolutePath const& aSubtreePath, const vos::ORef < OOptions >& _xOptions, sal_Int16 nMinLevels = ALL_LEVELS) CFG_NOTHROW();
+ virtual void disposeData(const RequestOptions& _aOptions) CFG_NOTHROW();
+ virtual void fetchSubtree(AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions) CFG_NOTHROW();
/// IDefaultableTreeManager
virtual sal_Bool fetchDefaultData( memory::UpdateAccessor& _aAccessToken,
- AbsolutePath const& aSubtreePath, const vos::ORef < OOptions >& _xOptions,
- sal_Int16 nMinLevels) CFG_UNO_THROW_ALL( );
+ AbsolutePath const& aSubtreePath, const RequestOptions& _aOptions
+ ) CFG_UNO_THROW_ALL( );
// IInterface
virtual void SAL_CALL acquire( ) throw ();
@@ -245,11 +249,11 @@ namespace configmgr
rtl::Reference< IConfigTemplateManager > getTemplateProvider() const CFG_UNO_THROW_RTE( );
protected:
- static OUString getErrorMessage(AbsolutePath const& _rAccessor, const vos::ORef < OOptions >& _xOptions);
+ static OUString getErrorMessage(AbsolutePath const& _rAccessor, const RequestOptions& _aOptions);
virtual void SAL_CALL dispose() throw();
public:
- const OOptions& getDefaultOptions() const {return *m_xDefaultOptions;}
+ RequestOptions const& getDefaultOptions() const {return m_aDefaultOptions;}
TypeConverterRef getTypeConverter() const {return m_xTypeConverter;}
configapi::Factory& getWriterFactory();
IConfigBroadcaster* getNotifier() CFG_NOTHROW();
@@ -257,17 +261,17 @@ namespace configmgr
// actual factory methods
// the returned object (if any) has to be acquired once)
- configapi::NodeElement* buildReadAccess( OUString const& _rAccessor, const vos::ORef < OOptions >& _xOptions, sal_Int32 nMinLevels) CFG_UNO_THROW_ALL( );
+ configapi::NodeElement* buildReadAccess( OUString const& _rAccessor, const RequestOptions& _aOptions, sal_Int32 nMinLevels) CFG_UNO_THROW_ALL( );
// the returned object (if any) has to be acquired once)
- configapi::NodeElement* buildUpdateAccess(OUString const& _rAccessor, const vos::ORef < OOptions >& _xOptions, sal_Int32 nMinLevels) CFG_UNO_THROW_ALL( );
+ configapi::NodeElement* buildUpdateAccess(OUString const& _rAccessor, const RequestOptions& _aOptions, sal_Int32 nMinLevels) CFG_UNO_THROW_ALL( );
private:
- bool initSession(const ConnectionSettings& _rSettings);
+ bool initSession(const ContextReader& _rSettings);
private:
- void implInitFromSettings(const ConnectionSettings& _rSettings, bool& rNeedProfile);
+ void implInitFromSettings(const ContextReader& _rSettings, bool& rNeedProfile);
void implInitFromProfile(data::NodeAccess const& aProfile);
- virtual void initFromSettings(const ConnectionSettings& _rSettings, bool& rNeedProfile);
+ virtual void initFromSettings(const ContextReader& _rSettings, bool& rNeedProfile);
virtual void initFromProfile(data::NodeAccess const& aProfile);
};
} // namespace configmgr
diff --git a/configmgr/source/api2/setaccess.cxx b/configmgr/source/api2/setaccess.cxx
index 52f5528981..f9495c4264 100644
--- a/configmgr/source/api2/setaccess.cxx
+++ b/configmgr/source/api2/setaccess.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: setaccess.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jb $ $Date: 2001-07-05 17:05:44 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,7 +66,6 @@
namespace configmgr
{
- using namespace configapi;
using uno::Reference;
using uno::Sequence;
@@ -77,14 +76,14 @@ namespace configmgr
//------------------------------------------------------------------------------------------------------------------
OUString SAL_CALL BasicSetAccess::getHierarchicalName( ) throw(RuntimeException)
{
- return implGetHierarchicalName( getNode() );
+ return configapi::implGetHierarchicalName( getNode() );
}
//------------------------------------------------------------------------------------------------------------------
OUString SAL_CALL BasicSetAccess::composeHierarchicalName( const OUString& sRelativeName )
throw(css::lang::IllegalArgumentException, css::lang::NoSupportException, RuntimeException)
{
- return implComposeHierarchicalName( getNode(), sRelativeName );
+ return configapi::implComposeHierarchicalName( getNode(), sRelativeName );
}
//------------------------------------------------------------------------------------------------------------------
@@ -94,13 +93,13 @@ OUString SAL_CALL BasicSetAccess::composeHierarchicalName( const OUString& sRela
uno::Type SAL_CALL BasicSetAccess::getElementType( ) throw(RuntimeException)
{
- return implGetElementType( getNode() );
+ return configapi::implGetElementType( getNode() );
}
//-----------------------------------------------------------------------------------
sal_Bool SAL_CALL BasicSetAccess::hasElements( ) throw(RuntimeException)
{
- return implHasElements( getNode() );
+ return configapi::implHasElements( getNode() );
}
// XExactName
@@ -108,50 +107,70 @@ sal_Bool SAL_CALL BasicSetAccess::hasElements( ) throw(RuntimeException)
OUString SAL_CALL BasicSetAccess::getExactName( const OUString& rApproximateName ) throw(RuntimeException)
{
- return implGetExactName( getNode(), rApproximateName);
+ return configapi::implGetExactName( getNode(), rApproximateName);
}
// XProperty
//-----------------------------------------------------------------------------------
-css::beans::Property SAL_CALL BasicSetAccess::getAsProperty( ) throw(uno::RuntimeException)
+css::beans::Property SAL_CALL BasicSetAccess::getAsProperty( ) throw(RuntimeException)
{
- return implGetAsProperty( getNode() );
+ return configapi::implGetAsProperty( getNode() );
}
+// XPropertySetInfo
+//-----------------------------------------------------------------------------------
+
+Sequence< css::beans::Property > SAL_CALL BasicSetAccess::getProperties( ) throw (uno::RuntimeException)
+{
+ return configapi::implGetProperties( getNode() );
+}
+
+css::beans::Property SAL_CALL BasicSetAccess::getPropertyByName( const OUString& aName )
+ throw (css::beans::UnknownPropertyException, RuntimeException)
+{
+ return configapi::implGetPropertyByName( getNode(), aName );
+}
+
+sal_Bool SAL_CALL BasicSetAccess::hasPropertyByName( const OUString& Name ) throw (RuntimeException)
+{
+ return configapi::implHasPropertyByName( getNode(), Name );
+}
+
+
// XNameAccess
//-----------------------------------------------------------------------------------
sal_Bool SAL_CALL BasicSetAccess::hasByName( const OUString& sName ) throw(RuntimeException)
{
- return implHasByName( getNode(), sName);
+ return configapi::implHasByName( getNode(), sName);
}
//-----------------------------------------------------------------------------------
Any SAL_CALL BasicSetAccess::getByName( const OUString& sName )
throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, RuntimeException)
{
- return implGetByName( getNode(), sName );
+ return configapi::implGetByName( getNode(), sName );
}
//-----------------------------------------------------------------------------------
Sequence< OUString > SAL_CALL BasicSetAccess::getElementNames( ) throw( RuntimeException)
{
- return implGetElementNames( getNode() );
+ return configapi::implGetElementNames( getNode() );
}
// XHierarchicalNameAccess
//-----------------------------------------------------------------------------------
sal_Bool SAL_CALL BasicSetAccess::hasByHierarchicalName( const OUString& sName ) throw(RuntimeException)
{
- return implHasByHierarchicalName( getNode(), sName);
+ return configapi::implHasByHierarchicalName( getNode(), sName);
}
//-----------------------------------------------------------------------------------
Any SAL_CALL BasicSetAccess::getByHierarchicalName( const OUString& sName )
throw(css::container::NoSuchElementException, RuntimeException)
{
- return implGetByHierarchicalName( getNode(), sName );
+ return configapi::implGetByHierarchicalName( getNode(), sName );
}
@@ -161,13 +180,13 @@ Any SAL_CALL BasicSetAccess::getByHierarchicalName( const OUString& sName )
void SAL_CALL BasicSetAccess::addContainerListener( const Reference< css::container::XContainerListener >& xListener )
throw(RuntimeException)
{
- implAddListener( getNode(), xListener );
+ configapi::implAddListener( getNode(), xListener );
}
void SAL_CALL BasicSetAccess::removeContainerListener( const Reference< css::container::XContainerListener >& xListener )
throw(RuntimeException)
{
- implRemoveListener( getNode(), xListener );
+ configapi::implRemoveListener( getNode(), xListener );
}
//-----------------------------------------------------------------------------------
@@ -179,7 +198,7 @@ void SAL_CALL BasicSetAccess::removeContainerListener( const Reference< css::con
OUString SAL_CALL BasicSetAccess::getElementTemplateName( )
throw(uno::RuntimeException)
{
- return implGetElementTemplateName( getNode() );
+ return configapi::implGetElementTemplateName( getNode() );
}
// XStringEscape
@@ -187,21 +206,13 @@ OUString SAL_CALL BasicSetAccess::getElementTemplateName( )
OUString SAL_CALL BasicSetAccess::escapeString( const OUString& aString )
throw(css::lang::IllegalArgumentException, RuntimeException)
{
-#ifndef CFG_ESCAPE_ENABLED
return aString;
-#else
- return implEscapeString( getNode(), aString );
-#endif
}
OUString SAL_CALL BasicSetAccess::unescapeString( const OUString& aEscapedString )
throw(css::lang::IllegalArgumentException, RuntimeException)
{
-#ifndef CFG_ESCAPE_ENABLED
return aEscapedString;
-#else
- return implUnescapeString( getNode(), aEscapedString );
-#endif
}
//-----------------------------------------------------------------------------------
diff --git a/configmgr/source/api2/setaccess.hxx b/configmgr/source/api2/setaccess.hxx
index d847a64435..6a0560b21d 100644
--- a/configmgr/source/api2/setaccess.hxx
+++ b/configmgr/source/api2/setaccess.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: setaccess.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jb $ $Date: 2000-11-07 14:34:32 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -83,22 +83,22 @@
#ifndef _COM_SUN_STAR_BEANS_XPROPERTY_HPP_
#include
#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_
+#include
+#endif
#ifndef _COM_SUN_STAR_UTIL_XSTRINGESCAPE_HPP_
#include
#endif
-#ifndef _CPPUHELPER_IMPLBASE8_HXX_
-#include
-#endif
-
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
+#ifndef _CPPUHELPER_IMPLBASE9_HXX_
+#include
#endif
namespace configmgr
{
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
+ using rtl::OUString;
namespace configapi { class NodeSetInfoAccess; }
@@ -107,13 +107,14 @@ namespace configmgr
Is an interface adapter around NodeAccess.
*/
class BasicSetAccess
- : public ::cppu::ImplHelper8
+ : public ::cppu::ImplHelper9
< css::container::XNameAccess
, css::container::XHierarchicalName
, css::container::XHierarchicalNameAccess
, css::container::XContainer
, css::beans::XExactName
, css::beans::XProperty
+ , css::beans::XPropertySetInfo
, css::configuration::XTemplateContainer
, css::util::XStringEscape
>
@@ -185,6 +186,19 @@ namespace configmgr
getAsProperty( )
throw(uno::RuntimeException);
+ // XPropertySetInfo
+ virtual uno::Sequence< css::beans::Property > SAL_CALL
+ getProperties( )
+ throw (uno::RuntimeException);
+
+ virtual css::beans::Property SAL_CALL
+ getPropertyByName( const OUString& aName )
+ throw (css::beans::UnknownPropertyException, uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL
+ hasPropertyByName( const OUString& Name )
+ throw (uno::RuntimeException);
+
// XTemplateContainer
OUString SAL_CALL
getElementTemplateName( )
diff --git a/configmgr/source/api2/setupdate.cxx b/configmgr/source/api2/setupdate.cxx
index e792498e30..978497b480 100644
--- a/configmgr/source/api2/setupdate.cxx
+++ b/configmgr/source/api2/setupdate.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: setupdate.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jb $ $Date: 2001-09-28 12:44:03 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,6 +71,9 @@
#ifndef CONFIGMGR_API_NODEUPDATE_HXX_
#include "apinodeupdate.hxx"
#endif
+#ifndef CONFIGMGR_API_APITYPES_HXX_
+#include "apitypes.hxx"
+#endif
#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_
#include
@@ -82,7 +85,6 @@
namespace configmgr
{
//////////////////////////////////////////////////////////////////////////////////
- using namespace configapi;
using uno::Reference;
using uno::Sequence;
@@ -129,9 +131,9 @@ uno::Sequence< uno::Type > SAL_CALL BasicSet::getTypes( ) throw (uno::RuntimeExc
{
/*static ?*/
cppu::OTypeCollection aTypes(
- getReferenceType(static_cast< css::container::XNameContainer *>(this)),
- getReferenceType(static_cast< css::container::XNameReplace *>(this)),
- getReferenceType(static_cast< css::lang::XSingleServiceFactory *>(this)),
+ configapi::getReferenceType(static_cast< css::container::XNameContainer *>(this)),
+ configapi::getReferenceType(static_cast< css::container::XNameReplace *>(this)),
+ configapi::getReferenceType(static_cast< css::lang::XSingleServiceFactory *>(this)),
BasicSetAccess::getTypes());
return aTypes.getTypes();
@@ -142,8 +144,8 @@ uno::Sequence< uno::Type > SAL_CALL BasicValueSet::getTypes( ) throw (uno::Runti
{
/*static ?*/
cppu::OTypeCollection aTypes(
- getReferenceType(static_cast< css::container::XNameContainer *>(this)),
- getReferenceType(static_cast< css::container::XNameReplace *>(this)),
+ configapi::getReferenceType(static_cast< css::container::XNameContainer *>(this)),
+ configapi::getReferenceType(static_cast< css::container::XNameReplace *>(this)),
BasicSetAccess::getTypes());
return aTypes.getTypes();
@@ -190,14 +192,14 @@ configapi::NodeValueSetAccess& BasicValueSet::getSetNode()
void SAL_CALL BasicSet::replaceByName( const OUString& rName, const uno::Any& rElement )
throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
{
- implReplaceByName( getSetNode(), rName, rElement );
+ configapi::implReplaceByName( getSetNode(), rName, rElement );
}
//..............................................................................
void SAL_CALL BasicValueSet::replaceByName( const OUString& rName, const uno::Any& rElement )
throw(css::lang::IllegalArgumentException, css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
{
- implReplaceByName( getSetNode(), rName, rElement );
+ configapi::implReplaceByName( getSetNode(), rName, rElement );
}
// XNameContainer
@@ -205,28 +207,28 @@ void SAL_CALL BasicValueSet::replaceByName( const OUString& rName, const uno::An
void SAL_CALL BasicSet::insertByName( const OUString& rName, const uno::Any& rElement)
throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException)
{
- implInsertByName( getSetNode(), rName, rElement );
+ configapi::implInsertByName( getSetNode(), rName, rElement );
}
//..............................................................................
void SAL_CALL BasicValueSet::insertByName( const OUString& rName, const uno::Any& rElement)
throw(css::lang::IllegalArgumentException, css::container::ElementExistException, css::lang::WrappedTargetException, uno::RuntimeException)
{
- implInsertByName( getSetNode(), rName, rElement );
+ configapi::implInsertByName( getSetNode(), rName, rElement );
}
//----------------------------------------------------------------------------------
void SAL_CALL BasicSet::removeByName( const OUString& rName )
throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
{
- implRemoveByName( getSetNode(), rName );
+ configapi::implRemoveByName( getSetNode(), rName );
}
//..............................................................................
void SAL_CALL BasicValueSet::removeByName( const OUString& rName )
throw(css::container::NoSuchElementException, css::lang::WrappedTargetException, uno::RuntimeException)
{
- implRemoveByName( getSetNode(), rName );
+ configapi::implRemoveByName( getSetNode(), rName );
}
// XPropertyWithState
@@ -234,37 +236,37 @@ void SAL_CALL BasicValueSet::removeByName( const OUString& rName )
css::beans::PropertyState SAL_CALL BasicSet::getStateAsProperty() throw (uno::RuntimeException)
{
- return implGetStateAsProperty( getSetNode() );
+ return configapi::implGetStateAsProperty( getSetNode() );
}
//..............................................................................
css::beans::PropertyState SAL_CALL BasicValueSet::getStateAsProperty() throw (uno::RuntimeException)
{
- return implGetStateAsProperty( getSetNode() );
+ return configapi::implGetStateAsProperty( getSetNode() );
}
//-----------------------------------------------------------------------------------
void SAL_CALL BasicSet::setToDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
{
- implSetToDefaultAsProperty( getSetNode() );
+ configapi::implSetToDefaultAsProperty( getSetNode() );
}
//..............................................................................
void SAL_CALL BasicValueSet::setToDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
{
- implSetToDefaultAsProperty( getSetNode() );
+ configapi::implSetToDefaultAsProperty( getSetNode() );
}
//-----------------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL BasicSet::getDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
{
- return implGetDefaultAsProperty( getSetNode() );
+ return configapi::implGetDefaultAsProperty( getSetNode() );
}
//..............................................................................
uno::Reference< uno::XInterface > SAL_CALL BasicValueSet::getDefaultAsProperty() throw (css::lang::WrappedTargetException, uno::RuntimeException)
{
- return implGetDefaultAsProperty( getSetNode() );
+ return configapi::implGetDefaultAsProperty( getSetNode() );
}
// XSingleServiceFactory (not for ValueSet)
@@ -272,14 +274,14 @@ uno::Reference< uno::XInterface > SAL_CALL BasicValueSet::getDefaultAsProperty()
uno::Reference< uno::XInterface > SAL_CALL BasicSet::createInstance( )
throw(uno::Exception, uno::RuntimeException)
{
- return implCreateElement( getSetNode() );
+ return configapi::implCreateElement( getSetNode() );
}
//----------------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL BasicSet::createInstanceWithArguments( const uno::Sequence< uno::Any >& aArguments )
throw(uno::Exception, uno::RuntimeException)
{
- return implCreateElement( getSetNode(), aArguments );
+ return configapi::implCreateElement( getSetNode(), aArguments );
}
//-----------------------------------------------------------------------------------
diff --git a/configmgr/source/api2/setupdate.hxx b/configmgr/source/api2/setupdate.hxx
index 9ab6a0122c..9fbcfe40ca 100644
--- a/configmgr/source/api2/setupdate.hxx
+++ b/configmgr/source/api2/setupdate.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: setupdate.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jb $ $Date: 2001-09-28 12:44:03 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -76,10 +76,6 @@
#include
#endif
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
//........................................................................
namespace configmgr
{
diff --git a/configmgr/source/api2/translatechanges.hxx b/configmgr/source/api2/translatechanges.hxx
index f8977dd882..08a45a07a0 100644
--- a/configmgr/source/api2/translatechanges.hxx
+++ b/configmgr/source/api2/translatechanges.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: translatechanges.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,8 +62,6 @@
#ifndef CONFIGMGR_API_TRANSLATECHANGES_HXX_
#define CONFIGMGR_API_TRANSLATECHANGES_HXX_
-#include "apitypes.hxx"
-
#include
#include
#include
diff --git a/configmgr/source/api2/treeiterators.cxx b/configmgr/source/api2/treeiterators.cxx
new file mode 100644
index 0000000000..246a09e451
--- /dev/null
+++ b/configmgr/source/api2/treeiterators.cxx
@@ -0,0 +1,127 @@
+/*************************************************************************
+ *
+ * $RCSfile: treeiterators.cxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:37 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (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.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include
+
+#include "treeiterators.hxx"
+
+#include "apitypes.hxx"
+#include "configpath.hxx"
+#include "attributes.hxx"
+#include "valueref.hxx"
+#include "propertyinfohelper.hxx"
+
+// .......................................................................
+namespace configmgr
+{
+// .......................................................................
+ namespace configapi
+ {
+ using configuration::Name;
+ using node::Attributes;
+
+ // ===================================================================
+ // = CollectNodeNames
+ // ===================================================================
+ // -------------------------------------------------------------------
+ CollectPropertyInfo::Result CollectNodeNames::handle(configuration::Tree const& aTree, configuration::NodeRef const& aNode)
+ {
+ m_aList.push_back(aTree.getName(aNode).toString());
+ return CONTINUE;
+ }
+
+ // -------------------------------------------------------------------
+ CollectPropertyInfo::Result CollectNodeNames::handle(configuration::Tree const& aTree, configuration::ValueRef const& aNode)
+ {
+ m_aList.push_back(aTree.getName(aNode).toString());
+ return CONTINUE;
+ }
+
+ // ===================================================================
+ // = CollectPropertyInfo
+ // ===================================================================
+ // -------------------------------------------------------------------
+ CollectNodeNames::Result CollectPropertyInfo::handle(configuration::Tree const& aTree, configuration::NodeRef const& aNode)
+ {
+ Name aName = aTree.getName(aNode);
+ Attributes aAttributes = aTree.getAttributes(aNode);
+ uno::Type aApiType = getUnoInterfaceType();
+
+ m_aList.push_back( helperMakeProperty(aName,aAttributes,aApiType,aTree.hasNodeDefault(aNode)) );
+ return CONTINUE;
+ }
+
+ // -------------------------------------------------------------------
+ CollectNodeNames::Result CollectPropertyInfo::handle(configuration::Tree const& aTree, configuration::ValueRef const& aNode)
+ {
+ Name aName = aTree.getName(aNode);
+ Attributes aAttributes = aTree.getAttributes(aNode);
+ uno::Type aApiType = aTree.getUnoType(aNode);
+
+ m_aList.push_back( helperMakeProperty(aName,aAttributes,aApiType,aTree.hasNodeDefault(aNode)) );
+ return CONTINUE;
+ }
+// .......................................................................
+ } // namespace configapi
+
+// .......................................................................
+} // namespace configmgr
+// .......................................................................
+
diff --git a/configmgr/source/api2/treeiterators.hxx b/configmgr/source/api2/treeiterators.hxx
new file mode 100644
index 0000000000..b349e498b0
--- /dev/null
+++ b/configmgr/source/api2/treeiterators.hxx
@@ -0,0 +1,135 @@
+/*************************************************************************
+ *
+ * $RCSfile: treeiterators.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:38 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (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.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef CONFIGMGR_TREEITERATORS_HXX_
+#define CONFIGMGR_TREEITERATORS_HXX_
+
+#ifndef CONFIGMGR_CONFIGNODE_HXX_
+#include "noderef.hxx"
+#endif
+
+#ifndef _COM_SUN_STAR_BEANS_PROPERTY_HPP_
+#include
+#endif
+#ifndef _RTL_USTRING_HXX_
+#include
+#endif
+
+#ifndef INCLUDED_VECTOR
+#include
+#define INCLUDED_VECTOR
+#endif
+
+// .......................................................................
+namespace configmgr
+{
+// .......................................................................
+ using rtl::OUString;
+
+ namespace configapi
+ {
+ // ===================================================================
+ // = CollectNodeNames
+ // ===================================================================
+ class CollectNodeNames : public configuration::NodeVisitor
+ {
+ public:
+ typedef std::vector NameList;
+
+ protected:
+ NameList m_aList;
+
+ public:
+ CollectNodeNames() { }
+
+ virtual Result handle(configuration::Tree const& aTree, configuration::NodeRef const& aNode); // NodeVisitor
+ virtual Result handle(configuration::Tree const& aTree, configuration::ValueRef const& aNode); // NodeVisitor
+
+ NameList const& list() const { return m_aList; }
+ };
+
+ // ===================================================================
+ // = CollectPropertyInfo
+ // ===================================================================
+ class CollectPropertyInfo : public configuration::NodeVisitor
+ {
+ public:
+ typedef com::sun::star::beans::Property Property;
+ typedef std::vector PropertyList;
+
+ protected:
+ PropertyList m_aList;
+
+ public:
+ CollectPropertyInfo() { }
+
+ virtual Result handle(configuration::Tree const& aTree, configuration::NodeRef const& aNode); // NodeVisitor
+ virtual Result handle(configuration::Tree const& aTree, configuration::ValueRef const& aNode); // NodeVisitor
+
+ PropertyList const& list() const { return m_aList; }
+ };
+ }
+// .......................................................................
+} // namespace configmgr
+// .......................................................................
+
+#endif // _CONFIGMGR_TREEITERATORS_HXX_
+
diff --git a/configmgr/source/api2/updateimpl.cxx b/configmgr/source/api2/updateimpl.cxx
index 6598fd193e..c170e9cd02 100644
--- a/configmgr/source/api2/updateimpl.cxx
+++ b/configmgr/source/api2/updateimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: updateimpl.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:53 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -93,9 +93,6 @@
#ifndef CONFIGMGR_API_BROADCASTER_HXX_
#include "broadcaster.hxx"
#endif
-#ifndef CONFIGMGR_API_ENCODENAME_HXX_
-#include "encodename.hxx"
-#endif
#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
#include
diff --git a/configmgr/source/api2/updateimpl.hxx b/configmgr/source/api2/updateimpl.hxx
index 74e6a32332..36a7a85377 100644
--- a/configmgr/source/api2/updateimpl.hxx
+++ b/configmgr/source/api2/updateimpl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: updateimpl.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jb $ $Date: 2001-09-28 12:44:03 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,10 +62,6 @@
#ifndef CONFIGMGR_API_BASEUPDATEIMPL_HXX_
#define CONFIGMGR_API_BASEUPDATEIMPL_HXX_
-#ifndef CONFIGMGR_APITYPES_HXX_
-#include "apitypes.hxx"
-#endif
-
#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
#include
#endif
@@ -80,6 +76,7 @@ namespace configmgr
{
namespace css = ::com::sun::star;
namespace uno = ::com::sun::star::uno;
+ using rtl::OUString;
/* implementations of the interfaces supported by a (parent) node
within the configuration tree.
diff --git a/configmgr/source/backend/backendaccess.cxx b/configmgr/source/backend/backendaccess.cxx
index e6d6d447df..d0c0c999cf 100644
--- a/configmgr/source/backend/backendaccess.cxx
+++ b/configmgr/source/backend/backendaccess.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: backendaccess.cxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: ssmith $ $Date: 2002-12-13 10:14:44 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -92,9 +92,13 @@ namespace configmgr { namespace backend {
BackendAccess::BackendAccess(
const uno::Reference& xBackend,
- const uno::Reference& xFactory)
- : mFactory(xFactory), mBackend(xBackend)
+ const uno::Reference& xContext)
+ : mFactory(xContext->getServiceManager(), uno::UNO_QUERY)
+ , mBackend(xBackend)
{
+ OSL_ENSURE(mFactory.is(), "BackendAccess: Context has no ServiceManager (or it is missing an interface)");
+ if (!mFactory.is())
+ throw uno::RuntimeException(OUString::createFromAscii("BackendAccess: Context has no ServiceManager (or it is missing an interface)"), NULL);
}
//------------------------------------------------------------------------------
@@ -128,9 +132,10 @@ static void merge(
MergedComponentData& aData,
const uno::Sequence >& aLayers,
sal_Int32 aNbLayers,
- const rtl::OUString& aLocale)
+ const rtl::OUString& aLocale,
+ ITemplateDataProvider *aTemplateProvider=NULL)
{
- LayerMergeHandler * pMerger = new LayerMergeHandler(aFactory, aData, OUString());
+ LayerMergeHandler * pMerger = new LayerMergeHandler(aFactory, aData, aTemplateProvider);
uno::Reference xLayerMerger(pMerger);
RTL_LOGFILE_CONTEXT_AUTHOR(aLog, "configmgr::backend::BackendAccess", "jb99855", "configmgr: BackendAccess::merge()");
@@ -138,18 +143,19 @@ static void merge(
for (sal_Int32 i = 0 ; i < aNbLayers ; ++ i)
{
- promoteToDefault(aData) ;
+ pMerger->prepareLayer() ;
aLayers [i]->readData(xLayerMerger) ;
uno::Reference compositeLayer(
aLayers [i], uno::UNO_QUERY) ;
- if (compositeLayer.is()) {
+ if (compositeLayer.is())
+ {
rtl::OUString bestLocale = findBestLocale(
compositeLayer->listSubLayerIds(), aLocale) ;
- if (bestLocale.getLength() > 0) {
- promoteToDefault(aData) ;
+ if (pMerger->prepareSublayer(bestLocale) )
+ {
compositeLayer->readSubLayerData(xLayerMerger, bestLocale) ;
}
}
@@ -158,11 +164,12 @@ static void merge(
//------------------------------------------------------------------------------
ComponentResult BackendAccess::getNodeData(const ComponentRequest& aRequest,
+ ITemplateDataProvider *aTemplateProvider,
INodeDataListener *aListener)
CFG_UNO_THROW_ALL()
{
rtl::OUString component = aRequest.getComponentName().toString() ;
- SchemaBuilder *schemaBuilder = new backend::SchemaBuilder( component ) ;
+ SchemaBuilder *schemaBuilder = new backend::SchemaBuilder( component, aTemplateProvider == NULL ? this:aTemplateProvider ) ;
uno::Reference schemaHandler = schemaBuilder ;
uno::Sequence > layers ;
uno::Reference schema ;
@@ -177,7 +184,7 @@ ComponentResult BackendAccess::getNodeData(const ComponentRequest& aRequest,
schema->readSchema(schemaHandler) ;
merge(mFactory, schemaBuilder->result(), layers, layers.getLength(),
- aNodeRequest.getOptions().getLocale());
+ aNodeRequest.getOptions().getLocale(),aTemplateProvider );
ComponentInstance retCode(schemaBuilder->result().extractSchemaTree(),
schemaBuilder->result().extractTemplatesTree(),
@@ -260,7 +267,7 @@ TemplateResult BackendAccess::getTemplateData(const TemplateRequest& aRequest)
templateId.Name = aRequest.getTemplateName().toString() ;
templateId.Component = aRequest.getComponentName().toString() ;
- aResultData = schemaBuilder->result().extractTemplateNode(templateId);
+ aResultData = schemaBuilder->result().extractTemplateNode(templateId.Name);
}
TemplateInstance retCode(aResultData,aRequest.getTemplateName(), aRequest.getComponentName()) ;
diff --git a/configmgr/source/backend/backendaccess.hxx b/configmgr/source/backend/backendaccess.hxx
index 6ebe9509d8..c84209ea16 100644
--- a/configmgr/source/backend/backendaccess.hxx
+++ b/configmgr/source/backend/backendaccess.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: backendaccess.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: ssmith $ $Date: 2002-12-13 10:14:44 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -82,9 +82,12 @@
#include
#endif // _COM_SUN_STAR_CONFIGURATION_BACKEND_XBACKEND_HPP_
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include
+#endif
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
#include
-#endif // _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#endif
namespace configmgr { namespace backend {
@@ -105,15 +108,16 @@ class BackendAccess : public IMergedDataProvider {
service factory.
@param xBackend backend used for access to data
- @param xFactory factory for instantiation of services
+ @param xContext uno context for instantiation of services
*/
- BackendAccess(const uno::Reference& xBackend,
- const uno::Reference& xFactory) ;
+ BackendAccess( const uno::Reference& xBackend,
+ const uno::Reference& xContext) ;
/** Destructor */
~BackendAccess(void) ;
// IMergedDataProvider
virtual ComponentResult getNodeData(const ComponentRequest& aRequest,
+ ITemplateDataProvider* aTemplateProvider,
INodeDataListener *aListener = NULL)
CFG_UNO_THROW_ALL() ;
virtual void removeRequestListener(INodeDataListener *aListener)
diff --git a/configmgr/source/backend/backendfactory.cxx b/configmgr/source/backend/backendfactory.cxx
index c77a9ac2ea..7fc095af68 100644
--- a/configmgr/source/backend/backendfactory.cxx
+++ b/configmgr/source/backend/backendfactory.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: backendfactory.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: ssmith $ $Date: 2002-12-13 10:14:45 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,6 +61,9 @@
#include "backendfactory.hxx"
+#ifndef CONFIGMGR_API_FACTORY_HXX_
+#include "confapifactory.hxx"
+#endif
#ifndef CONFIGMGR_BOOTSTRAPCONTEXT_HXX_
#include "bootstrapcontext.hxx"
#endif
@@ -70,6 +73,12 @@
#ifndef CONFIGMGR_BACKEND_BACKENDACCESS_HXX_
#include "backendaccess.hxx"
#endif
+#ifndef CONFIGMGR_SERVICEINFOHELPER_HXX_
+#include "serviceinfohelper.hxx"
+#endif
+#ifndef CONFIGMGR_WRAPEXCEPTION_HXX
+#include "wrapexception.hxx"
+#endif
#ifndef _COM_SUN_STAR_CONFIGURATION_CANNOTLOADCONFIGURATIONEXCEPTION_HPP_
@@ -91,27 +100,183 @@ namespace configmgr
// -------------------------------------------------------------------------
const sal_Char k_DefaultBackendWrapper[] = "com.sun.star.comp.configuration.backend.SingleBackendAdapter";
const sal_Char k_DefaultBackendService[] = "com.sun.star.comp.configuration.backend.LocalSingleBackend";
+
+// -------------------------------------------------------------------------
+const sal_Char k_DefaultBackendServiceAndImplName[] = K_DefaultBackendServiceAndImplName ;
+const sal_Char k_DefaultSingleBackendServiceAndImplName[] = K_DefaultSingleBackendServiceAndImplName ;
+
+// -------------------------------------------------------------------------
+const sal_Char k_GenericBackendServiceAndImplName[] = "com.sun.star.configuration.backend.Backend" ;
+const sal_Char k_GenericSingleBackendServiceAndImplName[] = "com.sun.star.configuration.backend.SingleBackend" ;
+
+// -------------------------------------------------------------------------
+static AsciiServiceName const k_BackendServiceNames [] =
+{
+ k_DefaultBackendServiceAndImplName,
+ k_GenericBackendServiceAndImplName,
+ 0
+};
+static AsciiServiceName const k_SingleBackendServiceNames [] =
+{
+ k_DefaultSingleBackendServiceAndImplName,
+ k_GenericSingleBackendServiceAndImplName,
+ 0
+};
+// -------------------------------------------------------------------------
+static const ServiceRegistrationInfo k_DefaultBackendServiceInfo =
+{
+ k_DefaultBackendServiceAndImplName,
+ k_BackendServiceNames
+};
+static const ServiceRegistrationInfo k_DefaultSingleBackendServiceInfo =
+{
+ k_DefaultSingleBackendServiceAndImplName,
+ k_SingleBackendServiceNames
+};
+// -------------------------------------------------------------------------
+static const ServiceRegistrationInfo k_GenericBackendServiceInfo =
+{
+ k_GenericBackendServiceAndImplName,
+ k_BackendServiceNames + 1
+};
+static const ServiceRegistrationInfo k_GenericSingleBackendServiceInfo =
+{
+ k_GenericSingleBackendServiceAndImplName,
+ k_SingleBackendServiceNames + 1
+};
+// -------------------------------------------------------------------------
+static const SingletonRegistrationInfo k_DefaultBackendSingletonInfo =
+{
+ K_DefaultBackendSingletonName,
+ k_DefaultBackendServiceAndImplName,
+ k_DefaultBackendServiceAndImplName,
+ & k_GenericBackendServiceInfo
+};
+static const SingletonRegistrationInfo k_DefaultSingleBackendSingletonInfo =
+{
+ K_DefaultSingleBackendSingletonName,
+ k_DefaultSingleBackendServiceAndImplName,
+ k_DefaultSingleBackendServiceAndImplName,
+ & k_GenericSingleBackendServiceInfo
+};
+// -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
+const SingletonRegistrationInfo * getDefaultBackendSingletonInfo()
+{
+ return & k_DefaultBackendSingletonInfo;
+}
+// -------------------------------------------------------------------------
+const SingletonRegistrationInfo * getDefaultSingleBackendSingletonInfo()
+{
+ return & k_DefaultSingleBackendSingletonInfo;
+}
+// -------------------------------------------------------------------------
+
+const ServiceRegistrationInfo * getDefaultBackendServiceInfo()
+{
+ return & k_DefaultBackendServiceInfo;
+}
+// -------------------------------------------------------------------------
+const ServiceRegistrationInfo * getDefaultSingleBackendServiceInfo()
+{
+ return & k_DefaultSingleBackendServiceInfo;
+}
+// -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
+
+uno::Reference SAL_CALL
+ getDefaultBackendSingleton( CreationContext const& xContext )
+{
+ OSL_ENSURE( xContext.is(), "ERROR: NULL context has no singletons" );
+
+ UnoContextTunnel aTunnel;
+ aTunnel.passthru( xContext );
+
+ uno::Reference xResult;
+
+ if (xContext.is())
+ try
+ {
+ xContext->getValueByName(SINGLETON(K_DefaultBackendSingletonName))
+ >>= xResult;
+ }
+ catch (uno::Exception & )
+ {
+ // to do: really use the tunneled failure when that is set properly
+ if ( aTunnel.recoverFailure(true).hasValue() )
+ {
+ // have a failure, but can't recover it
+ // -> try to regenerate
+ instantiateDefaultBackend(xContext);
+
+ OSL_ENSURE(false, "Cannot recreate configuration backend instantiation failure - using generic error");
+ }
+ // cannot recover any failure
+ throw;
+ }
+
+ return xResult;
+}
+// -------------------------------------------------------------------------
+
+uno::Reference SAL_CALL
+ getDefaultSingleBackendSingleton( CreationContext const& xContext )
+{
+ OSL_ENSURE( xContext.is(), "ERROR: NULL context has no singletons" );
+
+ UnoContextTunnel aTunnel;
+ aTunnel.passthru( xContext );
+
+ uno::Reference xResult;
+
+ if (xContext.is())
+ try
+ {
+ xContext->getValueByName(SINGLETON(K_DefaultSingleBackendSingletonName))
+ >>= xResult;
+ }
+ catch (uno::Exception & )
+ {
+ // to do: really use the tunneled failure when that is set properly
+ if ( aTunnel.recoverFailure(true).hasValue() )
+ {
+ // have a failure, but can't recover it
+ // -> try to regenerate
+ instantiateDefaultSingleBackend(xContext);
+
+ OSL_ENSURE(false, "Cannot recreate configuration backend instantiation failure - using generic error");
+ }
+ // cannot recover any failure
+ throw;
+ }
+
+ return xResult;
+}
+// -------------------------------------------------------------------------
+// -------------------------------------------------------------------------
+
+typedef BackendFactory::CreationContext CreationContext;
+typedef uno::Sequence< uno::Any > UnoInitArgs;
// -------------------------------------------------------------------------
-typedef uno::Sequence< uno::Any > UnoInitArgs;
static
-UnoInitArgs createInitArgs(ConnectionSettings const & _aSettings)
+UnoInitArgs createInitArgs(ContextReader const & _aContext)
{
- uno::Reference< uno::XCurrentContext > xBootstrapArgs = new BootstrapContext(_aSettings.getUnoSettings());
+ OSL_ASSERT(_aContext.hasBootstrapContext());
uno::Sequence< uno::Any > aResult( 1 );
- aResult[0] <<= xBootstrapArgs;
+ aResult[0] <<= _aContext.getBootstrapContext();
return aResult;
}
// -------------------------------------------------------------------------
-typedef BackendFactory::CreationContext CreationContext;
-
static
inline
-uno::Reference< uno::XInterface > createService(CreationContext const & _xCtx, UnoInitArgs const & _aInitArgs, OUString const & _aSvc)
+uno::Reference< uno::XInterface > createService(ContextReader const & _aCtx, UnoInitArgs const & _aInitArgs, OUString const & _aSvc)
{
- OSL_ASSERT(_xCtx.is());
- return _xCtx->createInstanceWithArguments( _aSvc, _aInitArgs);
+ uno::Reference< lang::XMultiComponentFactory > xFactory = _aCtx.getServiceManager();
+ OSL_ENSURE(xFactory.is(),"ERROR: ComponentContext has no service manager\n");
+ if (!xFactory.is()) throw uno::RuntimeException( OUString::createFromAscii("ERROR: ComponentContext has no service manager\n"), NULL );
+ return xFactory->createInstanceWithArgumentsAndContext( _aSvc, _aInitArgs, _aCtx.getBaseContext());
}
// -------------------------------------------------------------------------
@@ -119,8 +284,10 @@ typedef uno::Reference< backenduno::XSingleBackend > UnoSingleBackend;
typedef uno::Reference< backenduno::XBackend > UnoBackend;
static
-UnoBackend wrapSingleBackend(ConnectionSettings const & _aSettings, CreationContext const & _xCtx, UnoInitArgs const & _aInitArgs, UnoSingleBackend const & _xWrappedBackend)
+UnoBackend wrapSingleBackend(ContextReader const & _aSettings, UnoInitArgs const & _aInitArgs, UnoSingleBackend const & _xWrappedBackend)
{
+ OSL_ASSERT(_aSettings.hasUnoBackendWrapper() || _aSettings.hasBootstrapContext());
+
OUString aWrapperSvc = _aSettings.hasUnoBackendWrapper() ?
_aSettings.getUnoBackendWrapper() :
OUString::createFromAscii(k_DefaultBackendWrapper);
@@ -133,19 +300,21 @@ UnoBackend wrapSingleBackend(ConnectionSettings const & _aSettings, CreationCont
aExtendedArgs.realloc( nBaseArgsCount + 1 );
aExtendedArgs[nBaseArgsCount] <<= _xWrappedBackend;
- return UnoBackend::query( createService(_xCtx,aExtendedArgs,aWrapperSvc) );
+ return UnoBackend::query( createService(_aSettings,aExtendedArgs,aWrapperSvc) );
}
// -------------------------------------------------------------------------
static
-UnoBackend createOfflineBackend(ConnectionSettings const & _aSettings, CreationContext const & _xCtx, UnoInitArgs const & _aInitArgs)
+UnoBackend createOfflineBackend(ContextReader const & _aSettings, UnoInitArgs const & _aInitArgs)
{
+ OSL_ASSERT(_aSettings.hasUnoBackendWrapper() || _aSettings.hasBootstrapContext());
+
UnoBackend xResult;
if ( _aSettings.hasUnoBackendWrapper() )
{
OUString const aWrapperSvc = _aSettings.getUnoBackendWrapper();
- xResult = UnoBackend::query( createService(_xCtx,_aInitArgs,aWrapperSvc) );
+ xResult = UnoBackend::query( createService(_aSettings,_aInitArgs,aWrapperSvc) );
}
return xResult;
@@ -153,34 +322,36 @@ UnoBackend createOfflineBackend(ConnectionSettings const & _aSettings, CreationC
// -------------------------------------------------------------------------
static
-uno::Reference< uno::XInterface > createRealBackend(ConnectionSettings const & _aSettings, CreationContext const & _xCtx, UnoInitArgs const & _aInitArgs)
+uno::Reference< uno::XInterface > createRealBackend(ContextReader const & _aSettings, UnoInitArgs const & _aInitArgs)
{
+ OSL_ASSERT(_aSettings.hasUnoBackendService() || _aSettings.hasBootstrapContext());
+
OUString const aBackendServiceName = _aSettings.hasUnoBackendService() ?
_aSettings.getUnoBackendService() :
OUString::createFromAscii(k_DefaultBackendService);
uno::Reference< uno::XInterface > xResult =
- createService(_xCtx,_aInitArgs,aBackendServiceName);
+ createService(_aSettings,_aInitArgs,aBackendServiceName);
return xResult;
}
// -------------------------------------------------------------------------
static
-UnoBackend createOnlineBackend(ConnectionSettings const & _aSettings, CreationContext const & _xCtx, UnoInitArgs const & _aInitArgs)
+UnoBackend createOnlineBackend(ContextReader const & _aSettings, UnoInitArgs const & _aInitArgs)
{
OSL_ENSURE( _aSettings.isUnoBackend(), "ERROR - BackendFactory: For legacy backends use createSessionBackend()");
UnoBackend xResult;
- uno::Reference< uno::XInterface > xRealBackend = createRealBackend(_aSettings,_xCtx,_aInitArgs);
+ uno::Reference< uno::XInterface > xRealBackend = createRealBackend(_aSettings,_aInitArgs);
if (_aSettings.hasUnoBackendWrapper())
{
// try wrapping a single backend
UnoSingleBackend xSingleRealBackend( xRealBackend, uno::UNO_QUERY);
if (xSingleRealBackend.is())
- xResult = wrapSingleBackend(_aSettings,_xCtx,_aInitArgs,xSingleRealBackend);
+ xResult = wrapSingleBackend(_aSettings,_aInitArgs,xSingleRealBackend);
// if we don't have one, try using it as unwrapped backend
else
@@ -195,7 +366,7 @@ UnoBackend createOnlineBackend(ConnectionSettings const & _aSettings, CreationCo
// try the default wrapper if we only have a single backend
UnoSingleBackend xSingleRealBackend( xRealBackend, uno::UNO_QUERY);
if (xSingleRealBackend.is())
- xResult = wrapSingleBackend(_aSettings,_xCtx,_aInitArgs,xSingleRealBackend);
+ xResult = wrapSingleBackend(_aSettings,_aInitArgs,xSingleRealBackend);
else
OSL_ENSURE( !xRealBackend.is(), "Configuration Backend implements no known backend interface" );
@@ -206,52 +377,82 @@ UnoBackend createOnlineBackend(ConnectionSettings const & _aSettings, CreationCo
}
// -------------------------------------------------------------------------
-UnoBackend BackendFactory::createDefaultUnoBackend(CreationContext const & _xCtx)
+static UnoBackend createUnoBackend(CreationContext const& _xCtx)
{
- BootstrapSettings aBootstrapData( getBootstrapContext(_xCtx) );
-
- return createUnoBackend(aBootstrapData.settings,_xCtx);
-}
-// -------------------------------------------------------------------------
+ ContextReader aSettings(_xCtx);
+ OSL_ENSURE( aSettings.isUnoBackend(), "ERROR - BackendFactory: Legacy backends are not supported any more");
-UnoBackend BackendFactory::createUnoBackend(ConnectionSettings const & _aSettings, CreationContext const & _xCtx)
-{
- UnoInitArgs aArguments = createInitArgs(_aSettings);
+ UnoInitArgs aArguments = createInitArgs(aSettings);
- sal_Bool bOffline = _aSettings.hasOfflineSetting() ? _aSettings.getOfflineSetting() : !_aSettings.hasUnoBackendService();
+ sal_Bool bOffline = aSettings.hasOfflineSetting() ? aSettings.getOfflineSetting() : !aSettings.hasUnoBackendService();
UnoBackend xResult;
if (!bOffline)
- xResult = createOnlineBackend(_aSettings,_xCtx,aArguments);
+ xResult = createOnlineBackend (aSettings,aArguments);
if (!xResult.is())
- xResult = createOfflineBackend(_aSettings,_xCtx,aArguments);
+ xResult = createOfflineBackend(aSettings,aArguments);
return xResult;
}
// -------------------------------------------------------------------------
+// to do: tunnel and raise fully typed exception information (and use it in the get..Singleton wrappers)
+ #define TUNNEL_ALL_EXCEPTIONS() \
+ WRAP_CONFIGBACKEND_CREATION_EXCEPTIONS1( UnoContextTunnel::tunnelFailure, true )
+
+// -------------------------------------------------------------------------
-rtl::Reference
- BackendFactory::createBackend(ConnectionSettings const & _aSettings, CreationContext const & _xCtx)
+uno::Reference SAL_CALL instantiateDefaultBackend( CreationContext const& xTargetContext )
{
- OSL_ENSURE( _aSettings.isUnoBackend(), "ERROR - BackendFactory: For legacy backends use createSessionBackend()");
+ CreationContext xContext = UnoContextTunnel::recoverContext(xTargetContext);
+
+ try
+ {
+ return createUnoBackend(xContext);
+ }
+ TUNNEL_ALL_EXCEPTIONS()
+}
+// -------------------------------------------------------------------------
+uno::Reference SAL_CALL instantiateDefaultSingleBackend( CreationContext const& xTargetContext )
+{
+ CreationContext xContext = UnoContextTunnel::recoverContext(xTargetContext);
+
+ ContextReader aSettings( xContext );
+
+ UnoInitArgs aArguments = createInitArgs(aSettings);
+ try
+ {
+ return createRealBackend(aSettings,aArguments);
+ }
+ TUNNEL_ALL_EXCEPTIONS()
+}
+
+// -------------------------------------------------------------------------
+
+UnoBackend BackendFactory::getUnoBackend()
+{
+ return UnoBackend::query( getDefaultBackendSingleton(m_xCtx) );
+}
+// -------------------------------------------------------------------------
+
+rtl::Reference BackendFactory::createBackend()
+{
rtl::Reference< IMergedDataProvider > xBackend;
- UnoBackend xBackendService = createUnoBackend(_aSettings, _xCtx);
+ UnoBackend xBackendService = this->getUnoBackend();
if (xBackendService.is())
- xBackend = new BackendAccess(xBackendService, _xCtx);
+ xBackend = new BackendAccess(xBackendService, m_xCtx);
return xBackend;
}
// -------------------------------------------------------------------------
-BackendFactory & BackendFactory::instance()
+BackendFactory BackendFactory::instance(CreationContext const & _xCtx)
{
- static BackendFactory aStaticFactory;
- return aStaticFactory;
+ return BackendFactory(_xCtx);
}
//-----------------------------------------------------------------------------
diff --git a/configmgr/source/backend/componentdatahelper.cxx b/configmgr/source/backend/componentdatahelper.cxx
index bf7e885d1b..7df88cafbf 100644
--- a/configmgr/source/backend/componentdatahelper.cxx
+++ b/configmgr/source/backend/componentdatahelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: componentdatahelper.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: ssmith $ $Date: 2002-10-24 12:59:33 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:46 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -98,21 +98,23 @@ DataBuilderContext::DataBuilderContext( )
}
// -----------------------------------------------------------------------------
-DataBuilderContext::DataBuilderContext( uno::XInterface * _pContext )
+DataBuilderContext::DataBuilderContext( uno::XInterface * _pContext, ITemplateDataProvider* aTemplateProvider )
: m_aParentStack()
, m_aActiveComponent()
, m_pContext(_pContext)
, m_aExpectedComponentName(OUString())
+, m_aTemplateProvider( aTemplateProvider )
{
}
// -----------------------------------------------------------------------------
-DataBuilderContext::DataBuilderContext( uno::XInterface * _pContext, const OUString& aExpectedComponentName )
+DataBuilderContext::DataBuilderContext( uno::XInterface * _pContext, const OUString& aExpectedComponentName, ITemplateDataProvider* aTemplateProvider )
: m_aParentStack()
, m_aActiveComponent()
, m_pContext(_pContext)
, m_aExpectedComponentName( aExpectedComponentName )
+, m_aTemplateProvider( aTemplateProvider )
{
}
@@ -227,21 +229,19 @@ ISubtree & DataBuilderContext::implGetCurrentParent() const
}
// -----------------------------------------------------------------------------
-void DataBuilderContext::ensureWritable(INode const * pNode) const
- CFG_UNO_THROW1( lang::IllegalAccessException )
+bool DataBuilderContext::isWritable(INode const * pNode) const
+ CFG_NOTHROW( )
{
OSL_PRECOND(pNode,"Unexpected NULL node pointer");
- if (!pNode->getAttributes().bWritable)
- raiseIllegalAccessException("Illegal Access: Cannot remove or replace. Item is mandatory.");
+ return pNode->getAttributes().bWritable;
}
// -----------------------------------------------------------------------------
-void DataBuilderContext::ensureRemovable(ISubtree const * pItem) const
- CFG_UNO_THROW1( lang::IllegalAccessException )
+bool DataBuilderContext::isRemovable(ISubtree const * pItem) const
+ CFG_NOTHROW( )
{
OSL_PRECOND(pItem,"Unexpected NULL item pointer");
- if (!pItem->getAttributes().bNullable && !pItem->getAttributes().isReplacedForUser())
- raiseIllegalAccessException("Illegal Access: Cannot remove or replace. Item is mandatory.");
+ return pItem->getAttributes().bNullable || pItem->getAttributes().isReplacedForUser();
}
// -----------------------------------------------------------------------------
@@ -473,8 +473,12 @@ void DataBuilderContext::endActiveComponent()
OSL_POSTCOND(!hasActiveComponent(), "Component Builder Context: Could not end Component/Template");
}
// -----------------------------------------------------------------------------
+TemplateResult DataBuilderContext::getTemplateData (TemplateRequest const & _aRequest )
+{
+ return(m_aTemplateProvider->getTemplateData (_aRequest));
+}
+// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
-
ComponentDataFactory::ComponentDataFactory()
: m_rNodeFactory( getDefaultTreeNodeFactory() )
{
diff --git a/configmgr/source/backend/componentdatahelper.hxx b/configmgr/source/backend/componentdatahelper.hxx
index 6f591f4449..3defd08e6d 100644
--- a/configmgr/source/backend/componentdatahelper.hxx
+++ b/configmgr/source/backend/componentdatahelper.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: componentdatahelper.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: ssmith $ $Date: 2002-10-24 12:59:33 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -111,6 +111,13 @@
#define INCLUDED_MEMORY
#endif
+#ifndef CONFIGMGR_BACKEND_MERGEDDATAPROVIDER_HXX
+#include "mergeddataprovider.hxx"
+#endif
+#ifndef CONFIGMGR_BACKEND_REQUEST_HXX_
+#include "request.hxx"
+#endif
+
namespace configmgr
{
// -----------------------------------------------------------------------------
@@ -137,11 +144,12 @@ namespace configmgr
Stack< ISubtree * > m_aParentStack;
OUString m_aActiveComponent;
uno::XInterface * m_pContext;
- OUString m_aExpectedComponentName;
+ OUString m_aExpectedComponentName;
+ ITemplateDataProvider * m_aTemplateProvider;
public:
DataBuilderContext();
- explicit DataBuilderContext(uno::XInterface * _pContext );
- explicit DataBuilderContext(uno::XInterface * _pContext, const OUString& aExpectedComponentName );
+ explicit DataBuilderContext(uno::XInterface * _pContext , ITemplateDataProvider* aTemplateProvider = NULL);
+ explicit DataBuilderContext(uno::XInterface * _pContext, const OUString& aExpectedComponentName,ITemplateDataProvider* aTemplateProvider = NULL );
~DataBuilderContext();
bool isDone() const;
@@ -192,10 +200,10 @@ namespace configmgr
ISubtree * findNode(OUString const & _aName)
CFG_THROW2( MalformedDataException, uno::RuntimeException );
- void ensureWritable(INode const * pNode) const
- CFG_UNO_THROW1( lang::IllegalAccessException );
- void ensureRemovable(ISubtree const * pItem) const
- CFG_UNO_THROW1( lang::IllegalAccessException );
+ bool isWritable(INode const * pNode) const
+ CFG_NOTHROW( );
+ bool isRemovable(ISubtree const * pItem) const
+ CFG_NOTHROW( );
ISubtree * addNodeToCurrent(std::auto_ptr _aNode)
CFG_THROW3( MalformedDataException, container::ElementExistException, uno::RuntimeException );
@@ -222,6 +230,7 @@ namespace configmgr
CFG_UNO_THROW1( beans::PropertyExistException );
void raiseIllegalTypeException (sal_Char const * _pText) const
CFG_UNO_THROW1( beans::IllegalTypeException );
+ TemplateResult getTemplateData (TemplateRequest const & _aRequest );
private:
INode * findChild(OUString const & _aName)
CFG_THROW2( MalformedDataException, uno::RuntimeException );
@@ -231,6 +240,7 @@ namespace configmgr
ISubtree & implGetCurrentParent() const
CFG_THROW2( MalformedDataException, uno::RuntimeException );
+
};
// -----------------------------------------------------------------------------
diff --git a/configmgr/source/backend/emptylayerimpl.hxx b/configmgr/source/backend/emptylayerimpl.hxx
index 1b74a70489..58683ac365 100644
--- a/configmgr/source/backend/emptylayerimpl.hxx
+++ b/configmgr/source/backend/emptylayerimpl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: emptylayerimpl.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jb $ $Date: 2002-11-28 12:58:17 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -174,4 +174,4 @@ namespace configmgr
// -----------------------------------------------------------------------------
} // namespace configmgr
-#endif
\ No newline at end of file
+#endif
diff --git a/configmgr/source/backend/importsvc.cxx b/configmgr/source/backend/importsvc.cxx
index 14a20e0601..459e8a0b34 100644
--- a/configmgr/source/backend/importsvc.cxx
+++ b/configmgr/source/backend/importsvc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: importsvc.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jb $ $Date: 2002-12-06 13:08:32 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -108,16 +108,16 @@ const ServiceRegistrationInfo* getMergeImportServiceInfo()
{ return getRegistrationInfo(& aMergeImporterSI); }
// -----------------------------------------------------------------------------
-MergeImportService::MergeImportService(CreationArg _xServiceFactory)
-: ImportService(_xServiceFactory, &aMergeImporterSI)
+MergeImportService::MergeImportService(CreationArg _xContext)
+: ImportService(_xContext, &aMergeImporterSI)
{
}
// -----------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL instantiateMergeImporter
-( CreationContext const& rServiceManager )
+( CreationContext const& xContext )
{
- return * new MergeImportService( rServiceManager );
+ return * new MergeImportService( xContext );
}
// -----------------------------------------------------------------------------
@@ -154,16 +154,16 @@ const ServiceRegistrationInfo* getCopyImportServiceInfo()
{ return getRegistrationInfo(& aCopyImporterSI); }
// -----------------------------------------------------------------------------
-CopyImportService::CopyImportService(CreationArg _xServiceFactory)
-: ImportService(_xServiceFactory, &aCopyImporterSI)
+CopyImportService::CopyImportService(CreationArg _xContext)
+: ImportService(_xContext, &aCopyImporterSI)
{
}
// -----------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL instantiateCopyImporter
-( CreationContext const& rServiceManager )
+( CreationContext const& xContext )
{
- return * new CopyImportService( rServiceManager );
+ return * new CopyImportService( xContext );
}
// -----------------------------------------------------------------------------
@@ -195,13 +195,13 @@ sal_Bool CopyImportService::setImplementationProperty(OUString const & aName, un
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
-ImportService::ImportService(CreationArg _xServiceFactory, ServiceInfoHelper const & aSvcInfo )
+ImportService::ImportService(CreationArg _xContext, ServiceInfoHelper const & aSvcInfo )
: m_aMutex()
-, m_xServiceFactory(_xServiceFactory)
+, m_xContext(_xContext)
, m_xDestinationBackend()
, m_aServiceInfo(aSvcInfo)
{
- if (!m_xServiceFactory.is())
+ if (!m_xContext.is())
{
OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Importer: Unexpected NULL context"));
throw lang::NullPointerException(sMessage,NULL);
@@ -215,7 +215,7 @@ ImportService::~ImportService()
ImportService::Backend ImportService::createDefaultBackend() const
{
- return BackendFactory::createDefaultUnoBackend( m_xServiceFactory );
+ return BackendFactory::instance( m_xContext ).getUnoBackend();
}
// -----------------------------------------------------------------------------
diff --git a/configmgr/source/backend/importsvc.hxx b/configmgr/source/backend/importsvc.hxx
index cf090e893c..3091d60885 100644
--- a/configmgr/source/backend/importsvc.hxx
+++ b/configmgr/source/backend/importsvc.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: importsvc.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: jb $ $Date: 2002-11-28 09:05:12 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,6 +73,9 @@
#include
#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include
+#endif
#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
#include
#endif
@@ -104,10 +107,10 @@ namespace configmgr
>
{
public:
- typedef uno::Reference< lang::XMultiServiceFactory > const & CreationArg;
+ typedef uno::Reference< uno::XComponentContext > const & CreationArg;
explicit
- ImportService(CreationArg _xServiceFactory, ServiceInfoHelper const & aSvcInfo);
+ ImportService(CreationArg _xContext, ServiceInfoHelper const & aSvcInfo);
~ImportService();
// XInitialization
@@ -147,14 +150,14 @@ namespace configmgr
throw ( lang::WrappedTargetException, lang::IllegalArgumentException,
lang::NullPointerException, uno::RuntimeException);
protected:
+ typedef uno::Reference< uno::XComponentContext > Context;
typedef uno::Reference< lang::XMultiServiceFactory > ServiceFactory;
typedef uno::Reference< backenduno::XBackend > Backend;
typedef uno::Reference< backenduno::XLayerHandler > InputHandler;
Backend createDefaultBackend() const;
- ServiceFactory getServiceFactory() const
- { return m_xServiceFactory; }
+ //ServiceFactory getServiceFactory() const
virtual sal_Bool setImplementationProperty( OUString const & aName, uno::Any const & aValue);
private:
@@ -163,7 +166,7 @@ namespace configmgr
private:
osl::Mutex m_aMutex;
- ServiceFactory m_xServiceFactory;
+ Context m_xContext;
Backend m_xDestinationBackend;
ServiceInfoHelper m_aServiceInfo;
@@ -175,7 +178,7 @@ namespace configmgr
class MergeImportService : public ImportService
{
public:
- explicit MergeImportService(CreationArg _xServiceFactory);
+ explicit MergeImportService(CreationArg _xContext);
private:
InputHandler createImportHandler(Backend const & xBackend, OUString const & aEntity);
};
@@ -184,7 +187,7 @@ namespace configmgr
class CopyImportService : public ImportService
{
public:
- explicit CopyImportService(CreationArg _xServiceFactory);
+ explicit CopyImportService(CreationArg _xContext);
private:
InputHandler createImportHandler(Backend const & xBackend, OUString const & aEntity);
sal_Bool setImplementationProperty( OUString const & aName, uno::Any const & aValue);
diff --git a/configmgr/source/backend/layermerge.cxx b/configmgr/source/backend/layermerge.cxx
index ca2b0e157a..a0758c7e89 100644
--- a/configmgr/source/backend/layermerge.cxx
+++ b/configmgr/source/backend/layermerge.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: layermerge.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: jb $ $Date: 2002-08-20 10:21:31 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -112,7 +112,7 @@ namespace configmgr
MergedComponentData aData;
uno::Reference< backenduno::XLayerHandler >
- test(new LayerMergeHandler(_xServiceFactory, aData, localehelper::getDefaultLocale()));
+ test(new LayerMergeHandler(_xServiceFactory, aData));
}
// -----------------------------------------------------------------------------
@@ -132,15 +132,15 @@ struct LayerMergeHandler::Converter
bool m_bConvertData;
};
// -----------------------------------------------------------------------------
-LayerMergeHandler::LayerMergeHandler(ServiceFactory const & _xServiceFactory, MergedComponentData & _rData, OUString const & _aLocale )
+LayerMergeHandler::LayerMergeHandler(ServiceFactory const & _xServiceFactory, MergedComponentData & _rData, ITemplateDataProvider* aTemplateProvider )
: m_rData(_rData)
-, m_aContext(static_cast(this))
+, m_aContext(static_cast(this),aTemplateProvider )
, m_aFactory()
-, m_aLocale(_aLocale)
+, m_aLocale()
, m_pProperty(NULL)
, m_pConverter( new Converter(_xServiceFactory) )
, m_nSkipping(0)
-, m_bSublayer(_aLocale.getLength() != 0)
+, m_bSublayer(false)
{
OSL_ENSURE( m_rData.hasSchema(), "Creating layer merger without default data" );
}
@@ -151,10 +151,31 @@ LayerMergeHandler::~LayerMergeHandler( )
delete m_pConverter;
}
// -----------------------------------------------------------------------------
+
+void LayerMergeHandler::prepareLayer()
+{
+ OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Previous layer or schema not terminated properly");
+ m_aLocale = OUString();
+ m_bSublayer = false;
+
+ promoteToDefault(m_rData);
+}
+// -----------------------------------------------------------------------------
+
+bool LayerMergeHandler::prepareSublayer(OUString const & aLocale)
+{
+ OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Previous layer not terminated properly");
+
+ m_aLocale = aLocale;
+ m_bSublayer = (aLocale.getLength() != 0);
+
+ return m_bSublayer;
+}
+// -----------------------------------------------------------------------------
MergedComponentData & LayerMergeHandler::result()
{
- OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Schema not terminated properly");
+ OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Layer not terminated properly");
return m_rData;
}
@@ -162,7 +183,7 @@ MergedComponentData & LayerMergeHandler::result()
MergedComponentData const & LayerMergeHandler::result() const
{
- OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Schema not terminated properly");
+ OSL_ENSURE(isDone(), "LayerMergeHandler: Warning: Layer not terminated properly");
return m_rData;
}
@@ -477,12 +498,14 @@ void LayerMergeHandler::applyAttributes(INode * pNode, sal_Int16 aNodeAttributes
}
// -----------------------------------------------------------------------------
-void LayerMergeHandler::startOverride(INode * pNode) /* ensure writable, mark merged */
- CFG_UNO_THROW1( lang::IllegalAccessException )
+bool LayerMergeHandler::startOverride(INode * pNode) /* ensure writable, mark merged */
+ CFG_NOTHROW( )
{
- m_aContext.ensureWritable(pNode);
+ if (!m_aContext.isWritable(pNode)) return false;
if (pNode->isDefault()) pNode->modifyState( node::isMerged );
+
+ return true;
}
// -----------------------------------------------------------------------------
@@ -492,8 +515,9 @@ void LayerMergeHandler::ensureUnchanged(INode const * pNode) const
// to do: change state handling to detect this within sets
OSL_PRECOND(pNode,"INTERNAL ERROR: Unexpected NULL node pointer");
- if (pNode->getAttributes().state() == node::isMerged)
- m_aContext.raiseMalformedDataException("Layer merging: Duplicate node or property in this layer");
+ if (!this->isInSublayer())
+ if (pNode->getAttributes().state() == node::isMerged)
+ m_aContext.raiseMalformedDataException("Layer merging: Duplicate node or property in this layer");
}
// -----------------------------------------------------------------------------
@@ -529,6 +553,8 @@ void SAL_CALL LayerMergeHandler::endLayer( )
m_aContext.endActiveComponent();
+ m_bSublayer = false;
+
OSL_POSTCOND( !m_aContext.hasActiveComponent(), "Layer merging: could not clear active component");
OSL_POSTCOND( m_aContext.isDone(), "Layer merging: could not finish processing");
}
@@ -550,14 +576,17 @@ void LayerMergeHandler::overrideLayerRoot( const OUString& aName, sal_Int16 aAtt
ensureUnchanged(pSchema);
- startOverride(pSchema);
-
- applyAttributes(pSchema,aAttributes);
+ if (startOverride(pSchema))
+ {
+ applyAttributes(pSchema,aAttributes);
- m_aContext.pushNode(pSchema);
+ m_aContext.pushNode(pSchema);
- OSL_POSTCOND( m_aContext.hasActiveComponent(), "Layer merging: could not set active component");
- OSL_POSTCOND( !m_aContext.isDone(), "Layer merging: could not start component");
+ OSL_POSTCOND( m_aContext.hasActiveComponent(), "Layer merging: could not set active component");
+ OSL_POSTCOND( !m_aContext.isDone(), "Layer merging: could not start component");
+ }
+ else
+ this->skipNode();
}
else
{
@@ -582,11 +611,14 @@ void SAL_CALL LayerMergeHandler::overrideNode( const OUString& aName, sal_Int16
{
ensureUnchanged(pNode);
- startOverride(pNode);
-
- applyAttributes(pNode, aAttributes);
+ if (startOverride(pNode))
+ {
+ applyAttributes(pNode, aAttributes);
- m_aContext.pushNode(pNode);
+ m_aContext.pushNode(pNode);
+ }
+ else
+ this->skipNode();
}
else // ignore non-matched data
{
@@ -598,20 +630,38 @@ void SAL_CALL LayerMergeHandler::overrideNode( const OUString& aName, sal_Int16
// -----------------------------------------------------------------------------
void LayerMergeHandler::implAddOrReplaceNode( const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes )
- CFG_THROW5 (MalformedDataException, container::NoSuchElementException, lang::IllegalAccessException, lang::IllegalArgumentException, uno::RuntimeException)
-{
- std::auto_ptr apNewInstance = m_rData.instantiateTemplate(aName, aTemplate);
+ CFG_THROW4 (MalformedDataException, container::NoSuchElementException, lang::IllegalArgumentException, uno::RuntimeException)
+{
+ ISubtree * pReplacedNode = m_aContext.findNode(aName);
+ if (pReplacedNode)
+ {
+ this->ensureUnchanged(pReplacedNode);
+
+ if (!m_aContext.isRemovable(pReplacedNode))
+ {
+ this->skipNode();
+ return;
+ }
+ }
+
+ std::auto_ptr apNewInstance;
+ if (aTemplate.Component == m_aContext.getActiveComponent())
+ {
+ apNewInstance = m_rData.instantiateTemplate(aName, aTemplate.Name);
+ }
+ else
+ {
+ TemplateRequest aTemplateRequest(configuration::makeName(aTemplate.Name, configuration::Name::NoValidate()),
+ configuration::makeName(aTemplate.Component, configuration::Name::NoValidate()) );
+ apNewInstance = m_aContext.getTemplateData( aTemplateRequest ).extractDataAndClear();
+ }
+
if (NULL == apNewInstance.get())
m_aContext.raiseNoSuchElementException("Layer merging: Cannot instantiate template.", aTemplate.Name);
applyAttributes(apNewInstance.get(), aAttributes);
- if (ISubtree * pReplaced = m_aContext.findNode(aName))
- {
- this->ensureUnchanged(pReplaced);
- m_aContext.ensureRemovable(pReplaced);
- m_aContext.getCurrentParent().removeChild( aName );
- }
+ if (pReplacedNode) m_aContext.getCurrentParent().removeChild( aName );
INode * pAddedInstance = m_aContext.getCurrentParent().addChild( apNewInstance );
@@ -670,7 +720,8 @@ void SAL_CALL LayerMergeHandler::dropNode( const OUString& aName )
if (ISubtree * pDropped = m_aContext.findNode(aName))
{
this->ensureUnchanged(pDropped);
- m_aContext.ensureRemovable(pDropped);
+ if (!m_aContext.isRemovable(pDropped))
+ return;
}
else
{
@@ -692,13 +743,16 @@ void SAL_CALL LayerMergeHandler::overrideProperty( const OUString& aName, sal_In
{
ensureUnchanged(pProp);
- startOverride(pProp);
-
- applyAttributes(pProp,aAttributes);
+ if (startOverride(pProp))
+ {
+ applyAttributes(pProp,aAttributes);
- m_pProperty = pProp;
+ m_pProperty = pProp;
- checkPropertyType(aType);
+ checkPropertyType(aType);
+ }
+ else
+ this->skipNode();
}
else // ignore non-matched data
{
diff --git a/configmgr/source/backend/layermerge.hxx b/configmgr/source/backend/layermerge.hxx
index c30ba48159..dad909a2ee 100644
--- a/configmgr/source/backend/layermerge.hxx
+++ b/configmgr/source/backend/layermerge.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: layermerge.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jb $ $Date: 2002-07-11 16:58:27 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -105,11 +105,16 @@ namespace configmgr
typedef uno::Reference< lang::XMultiServiceFactory > ServiceFactory;
explicit
- LayerMergeHandler(ServiceFactory const & _xServiceFactory , MergedComponentData & _rData, OUString const & _aLocale);
+ LayerMergeHandler(ServiceFactory const & _xServiceFactory , MergedComponentData & _rData, ITemplateDataProvider* aTemplateProvider = NULL);
virtual ~LayerMergeHandler();
+ // prepare merging
+ void prepareLayer();
+ bool prepareSublayer(OUString const & aLocale);
+
// checking the result
bool isDone() const { return m_aContext.isDone(); }
+ bool isInSublayer() const { return m_bSublayer; }
MergedComponentData & result();
MergedComponentData const & result() const;
@@ -189,11 +194,11 @@ namespace configmgr
void overrideLayerRoot( const OUString& aName, sal_Int16 aAttributes )
CFG_THROW4 (MalformedDataException, lang::IllegalAccessException, lang::IllegalArgumentException, uno::RuntimeException);
- void startOverride(INode * pNode) /* ensure writable, mark merged */
- CFG_THROW3( MalformedDataException, lang::IllegalAccessException, uno::RuntimeException );
+ bool startOverride(INode * pNode) /* check if writable, mark merged */
+ CFG_NOTHROW( );
void implAddOrReplaceNode(const OUString& aName, const TemplateIdentifier& aTemplate, sal_Int16 aAttributes)
- CFG_THROW5 (MalformedDataException, container::NoSuchElementException, lang::IllegalAccessException, lang::IllegalArgumentException, uno::RuntimeException);
+ CFG_THROW4 (MalformedDataException, container::NoSuchElementException, lang::IllegalArgumentException, uno::RuntimeException);
void ensureUnchanged(INode const * pNode) const
CFG_THROW2( MalformedDataException, uno::RuntimeException );
diff --git a/configmgr/source/backend/layerupdatehandler.cxx b/configmgr/source/backend/layerupdatehandler.cxx
index 0cbb271261..e4b02567d8 100644
--- a/configmgr/source/backend/layerupdatehandler.cxx
+++ b/configmgr/source/backend/layerupdatehandler.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: layerupdatehandler.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jb $ $Date: 2002-11-28 12:49:12 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -87,15 +87,15 @@ namespace configmgr
// -----------------------------------------------------------------------------
uno::Reference< uno::XInterface > SAL_CALL instantiateUpdateMerger
-( CreationContext const& rServiceManager )
+( CreationContext const& xContext )
{
- return * new LayerUpdateHandler( rServiceManager );
+ return * new LayerUpdateHandler( xContext );
}
// -----------------------------------------------------------------------------
-LayerUpdateHandler::LayerUpdateHandler(CreationArg _xServiceFactory)
-: UpdateService(_xServiceFactory)
+LayerUpdateHandler::LayerUpdateHandler(CreationArg _xContext)
+: UpdateService(_xContext)
, m_aBuilder()
{
}
diff --git a/configmgr/source/backend/layerupdatehandler.hxx b/configmgr/source/backend/layerupdatehandler.hxx
index a15de7dcb0..b2eaf5ba80 100644
--- a/configmgr/source/backend/layerupdatehandler.hxx
+++ b/configmgr/source/backend/layerupdatehandler.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: layerupdatehandler.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jb $ $Date: 2002-06-07 12:01:22 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -98,7 +98,7 @@ namespace configmgr
{
public:
explicit
- LayerUpdateHandler(CreationArg _xServiceFactory);
+ LayerUpdateHandler(CreationArg _xContext);
~LayerUpdateHandler();
diff --git a/configmgr/source/backend/makefile.mk b/configmgr/source/backend/makefile.mk
index c34c7255da..5d63e8ed0a 100644
--- a/configmgr/source/backend/makefile.mk
+++ b/configmgr/source/backend/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.10 $
+# $Revision: 1.11 $
#
-# last change: $Author: ssmith $ $Date: 2002-12-13 10:14:47 $
+# last change: $Author: hr $ $Date: 2003-03-19 16:18:48 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
diff --git a/configmgr/source/backend/mergedcomponentdata.cxx b/configmgr/source/backend/mergedcomponentdata.cxx
index 04f4506969..531d683bd9 100644
--- a/configmgr/source/backend/mergedcomponentdata.cxx
+++ b/configmgr/source/backend/mergedcomponentdata.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: mergedcomponentdata.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: jb $ $Date: 2002-05-27 10:34:15 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -112,10 +112,10 @@ OUString MergedComponentData::getTemplateAccessor (TemplateIdentifier const & _a
}
// -----------------------------------------------------------------------------
-bool MergedComponentData::hasTemplate(TemplateIdentifier const & _aTemplateName) const
+bool MergedComponentData::hasTemplate(OUString const & _aTemplateName) const
{
return m_pTemplatesTree.get() != NULL &&
- m_pTemplatesTree->getChild( getTemplateAccessor(_aTemplateName) ) != NULL;
+ m_pTemplatesTree->getChild( _aTemplateName ) != NULL;
}
// -----------------------------------------------------------------------------
@@ -131,12 +131,12 @@ std::auto_ptr MergedComponentData::extractTemplatesTree()
}
// -----------------------------------------------------------------------------
-std::auto_ptr MergedComponentData::extractTemplateNode(TemplateIdentifier const & _aTemplateName)
+std::auto_ptr MergedComponentData::extractTemplateNode(OUString const & _aTemplateName)
{
if (m_pTemplatesTree.get() == NULL)
return std::auto_ptr();
- return m_pTemplatesTree->removeChild(getTemplateAccessor(_aTemplateName));
+ return m_pTemplatesTree->removeChild(_aTemplateName);
}
// -----------------------------------------------------------------------------
@@ -146,9 +146,9 @@ ISubtree const * MergedComponentData::getSchemaTree() const
}
// -----------------------------------------------------------------------------
-ISubtree const * MergedComponentData::findTemplate(TemplateIdentifier const & _aTemplateName) const
+ISubtree const * MergedComponentData::findTemplate(OUString const & _aTemplateName) const
{
- INode const * pTemplateNode = m_pTemplatesTree->getChild(getTemplateAccessor(_aTemplateName));
+ INode const * pTemplateNode = m_pTemplatesTree->getChild(_aTemplateName);
ISubtree const * pTemplateTree = pTemplateNode ? pTemplateNode->asISubtree() : NULL;
@@ -158,9 +158,9 @@ ISubtree const * MergedComponentData::findTemplate(TemplateIdentifier const & _a
}
// -----------------------------------------------------------------------------
-std::auto_ptr MergedComponentData::instantiateTemplate(OUString const & _aName, TemplateIdentifier const & _aTemplateName) const
+std::auto_ptr MergedComponentData::instantiateTemplate(OUString const & _aName, OUString const & _aTemplateName) const
{
- if (INode const * pTemplateNode = m_pTemplatesTree->getChild(getTemplateAccessor(_aTemplateName)))
+ if (INode const * pTemplateNode = m_pTemplatesTree->getChild(_aTemplateName))
{
std::auto_ptr aResult = pTemplateNode->clone();
aResult->setName(_aName);
diff --git a/configmgr/source/backend/mergedcomponentdata.hxx b/configmgr/source/backend/mergedcomponentdata.hxx
index 0013461b40..64e450bc92 100644
--- a/configmgr/source/backend/mergedcomponentdata.hxx
+++ b/configmgr/source/backend/mergedcomponentdata.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: mergedcomponentdata.hxx,v $
*
- * $Revision: 1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: jb $ $Date: 2002-05-16 10:56:07 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -99,17 +99,17 @@ namespace configmgr
bool hasSchema() const;
bool hasTemplates() const;
- bool hasTemplate(TemplateIdentifier const & _aTemplateName) const;
+ bool hasTemplate(OUString const & _aTemplateName) const;
OUString getTemplateAccessor (TemplateIdentifier const & _aTemplateName) const;
ISubtree const * getSchemaTree() const;
- ISubtree const * findTemplate(TemplateIdentifier const & _aTemplateName) const;
+ ISubtree const * findTemplate(OUString const & _aTemplateName) const;
ISubtree * getSchemaTree() { return m_pSchemaTree.get(); }
ISubtree * getTemplatesTree() { return m_pTemplatesTree.get(); }
- std::auto_ptr instantiateTemplate(OUString const & _aName, TemplateIdentifier const & _aTemplateName) const;
+ std::auto_ptr instantiateTemplate(OUString const & _aName, OUString const & _aTemplateName) const;
void clear();
@@ -118,7 +118,7 @@ namespace configmgr
std::auto_ptr extractSchemaTree();
std::auto_ptr extractTemplatesTree();
- std::auto_ptr extractTemplateNode(TemplateIdentifier const & _aTemplateName);
+ std::auto_ptr extractTemplateNode(OUString const & _aTemplateName);
private:
std::auto_ptr m_pSchemaTree;
std::auto_ptr m_pTemplatesTree;
diff --git a/configmgr/source/backend/schemabuilder.cxx b/configmgr/source/backend/schemabuilder.cxx
index 1a4d375d6f..75ec433fb5 100644
--- a/configmgr/source/backend/schemabuilder.cxx
+++ b/configmgr/source/backend/schemabuilder.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: schemabuilder.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: ssmith $ $Date: 2002-10-24 12:59:34 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,10 +100,11 @@ namespace configmgr
}
// -----------------------------------------------------------------------------
-SchemaBuilder::SchemaBuilder( const OUString& aExpectedComponentName )
+SchemaBuilder::SchemaBuilder( const OUString& aExpectedComponentName, ITemplateDataProvider* aTemplateProvider )
: m_aData()
-, m_aContext(static_cast(this), aExpectedComponentName )
+, m_aContext(static_cast(this), aExpectedComponentName, aTemplateProvider )
, m_aFactory()
+, m_aTemplateProvider(aTemplateProvider)
{
}
@@ -160,7 +161,7 @@ void SAL_CALL SchemaBuilder::endSchema( )
void SAL_CALL SchemaBuilder::importComponent( const OUString& aName )
throw (MalformedDataException, container::NoSuchElementException, lang::IllegalArgumentException, uno::RuntimeException)
{
- OSL_TRACE("WARNING: Configuration schema parser: Cross-component references are not yet supported\n");
+ //OSL_TRACE("WARNING: Configuration schema parser: Cross-component references are not yet supported\n");
// OSL_ENSURE(false, "Cross-component references are not yet supported");
}
// -----------------------------------------------------------------------------
@@ -211,7 +212,7 @@ void SAL_CALL SchemaBuilder::startGroupTemplate( const TemplateIdentifier& aTemp
m_aContext.startActiveComponent(aTemplate.Component);
- if (m_aData.hasTemplate(aTemplate))
+ if (m_aData.hasTemplate(aTemplate.Name))
m_aContext.raiseElementExistException("Schema builder: Template already exists",aTemplate.Name);
OUString aName = m_aData.getTemplateAccessor(aTemplate);
@@ -234,7 +235,7 @@ void SAL_CALL SchemaBuilder::startSetTemplate( const TemplateIdentifier& aTempla
m_aContext.startActiveComponent(aTemplate.Component);
- if (m_aData.hasTemplate(aTemplate))
+ if (m_aData.hasTemplate(aTemplate.Name))
m_aContext.raiseElementExistException("Schema builder: Template already exists",aTemplate.Name);
OUString aName = m_aData.getTemplateAccessor(aTemplate);
@@ -418,13 +419,13 @@ namespace
MergedComponentData & m_rData;
DataBuilderContext m_aContext;
ComponentDataFactory m_aFactory;
-
+
InstanceList m_aReplacementList;
TemplateStack m_aTemplateStack;
public:
- SubstitutionHelper(MergedComponentData & _rData, uno::XInterface * _pContext)
+ SubstitutionHelper(MergedComponentData & _rData, uno::XInterface * _pContext, ITemplateDataProvider* aTemplateProvider=NULL )
: m_rData(_rData)
- , m_aContext(_pContext)
+ , m_aContext(_pContext,aTemplateProvider)
, m_aReplacementList()
, m_aTemplateStack()
{}
@@ -445,7 +446,7 @@ namespace
void SchemaBuilder::substituteInstances()
{
- SubstitutionHelper helper(m_aData, static_cast(this));
+ SubstitutionHelper helper(m_aData, static_cast(this),m_aTemplateProvider);
helper.substituteInData();
}
@@ -507,6 +508,7 @@ namespace
void SubstitutionHelper::substitute(OUString const & _aName)
{
+
ISubtree & rParent = m_aContext.getCurrentParent();
std::auto_ptr pReplacedNode = rParent.removeChild(_aName);
@@ -516,33 +518,46 @@ namespace
OSL_ASSERT( pReplacedInstance != NULL );
TemplateIdentifier aTemplateName = m_aFactory.getInstanceType(*pReplacedInstance);
-
- if (ISubtree const * pTemplate = m_rData.findTemplate(aTemplateName))
+ if (aTemplateName.Component == m_aContext.getActiveComponent())
{
- TemplateStack::iterator beg = m_aTemplateStack.begin(), end = m_aTemplateStack.end();
- if (std::find(beg,end,pTemplate) != end)
- m_aContext.raiseMalformedDataException("SchemaBuilder: Could not expand instances: Template is recursive");
+ if (ISubtree const * pTemplate = m_rData.findTemplate(aTemplateName.Name))
+ {
+ TemplateStack::iterator beg = m_aTemplateStack.begin(), end = m_aTemplateStack.end();
+ if (std::find(beg,end,pTemplate) != end)
+ m_aContext.raiseMalformedDataException("SchemaBuilder: Could not expand instances: Template is recursive");
- m_aTemplateStack.push_back(pTemplate);
+ m_aTemplateStack.push_back(pTemplate);
- std::auto_ptr< INode > pTemplateInstance = pTemplate->clone();
+ std::auto_ptr< INode > pTemplateInstance = pTemplate->clone();
- pTemplateInstance->setName(_aName);
- // TODO: adjust state/attributes here (?)
+ pTemplateInstance->setName(_aName);
+ // TODO: adjust state/attributes here (?)
- ISubtree * pAddedTree = rParent.addChild(pTemplateInstance)->asISubtree();
+ ISubtree * pAddedTree = rParent.addChild(pTemplateInstance)->asISubtree();
- OSL_ENSURE(pAddedTree, "Could not obtain added template instance");
+ OSL_ENSURE(pAddedTree, "Could not obtain added template instance");
- this->substituteInNode(*pAddedTree);
+ this->substituteInNode(*pAddedTree);
- m_aTemplateStack.pop_back();
+ m_aTemplateStack.pop_back();
+ }
+ else
+ {
+ m_aContext.raiseMalformedDataException("SchemaBuilder: Could not expand instances: Template not found");
+ }
}
+ //Import Template from different component
else
- {
- m_aContext.raiseMalformedDataException("SchemaBuilder: Could not expand instances: Template not found");
+ {
+ TemplateRequest aTemplateRequest(configuration::makeName(aTemplateName.Name, configuration::Name::NoValidate()),
+ configuration::makeName(aTemplateName.Component, configuration::Name::NoValidate()) );
+ TemplateResult aResult = m_aContext.getTemplateData( aTemplateRequest );
+
+ std::auto_ptr pTemplateInstance = aResult.extractDataAndClear();
+ pTemplateInstance->setName(_aName);
+ ISubtree * pAddedTree = rParent.addChild(pTemplateInstance)->asISubtree();
+ OSL_ENSURE(pAddedTree, "Could not obtain added template instance");
}
-
}
// -----------------------------------------------------------------------------
diff --git a/configmgr/source/backend/schemabuilder.hxx b/configmgr/source/backend/schemabuilder.hxx
index 61f94ecc26..f84594408c 100644
--- a/configmgr/source/backend/schemabuilder.hxx
+++ b/configmgr/source/backend/schemabuilder.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: schemabuilder.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: ssmith $ $Date: 2002-10-24 12:59:35 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -68,6 +68,9 @@
#ifndef CONFIGMGR_BACKEND_COMPONENTDATAHELPER_HXX
#include "componentdatahelper.hxx"
#endif
+#ifndef CONFIGMGR_BACKEND_MERGEDDATAPROVIDER_HXX
+#include "mergeddataprovider.hxx"
+#endif
#include
@@ -98,7 +101,7 @@ namespace configmgr
: public SchemaBuilder_Base
{
public:
- SchemaBuilder( const OUString& aExpectedComponentName );
+ SchemaBuilder( const OUString& aExpectedComponentName, ITemplateDataProvider* aTemplateProvider = NULL );
virtual ~SchemaBuilder();
// checking the result
@@ -181,6 +184,7 @@ namespace configmgr
MergedComponentData m_aData;
DataBuilderContext m_aContext;
ComponentDataFactory m_aFactory;
+ ITemplateDataProvider * m_aTemplateProvider;
};
// -----------------------------------------------------------------------------
diff --git a/configmgr/source/backend/singlebackendadapter.cxx b/configmgr/source/backend/singlebackendadapter.cxx
index 48f5435225..7e15cb5310 100644
--- a/configmgr/source/backend/singlebackendadapter.cxx
+++ b/configmgr/source/backend/singlebackendadapter.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: singlebackendadapter.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jb $ $Date: 2002-12-06 13:08:32 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,8 +80,8 @@ namespace configmgr { namespace backend {
//==============================================================================
SingleBackendAdapter::SingleBackendAdapter(
- const uno::Reference& aFactory)
-: BackendBase(mMutex), mFactory(aFactory) {
+ const uno::Reference& xContext)
+ : BackendBase(mMutex), mFactory(xContext->getServiceManager(),uno::UNO_QUERY) {
}
//------------------------------------------------------------------------------
@@ -148,8 +148,25 @@ SAL_CALL SingleBackendAdapter::listLayers(const rtl::OUString& aComponent,
lang::IllegalArgumentException,
uno::RuntimeException)
{
- return mBackend->getLayers(mBackend->listLayerIds(aComponent, aEntity),
- rtl::OUString()) ;
+ uno::Sequence > retCode =
+ mBackend->getLayers(mBackend->listLayerIds(aComponent, aEntity),
+ rtl::OUString()) ;
+
+ // There might be non-existent layers in the list if there's no
+ // actual data associated to a given layer id. Hence we have to
+ // compress the list.
+ sal_Int32 maxLayer = 0 ;
+
+ for (sal_Int32 i = 0 ; i < retCode.getLength() ; ++ i)
+ {
+ if (retCode [i].is())
+ {
+ if (i != maxLayer) { retCode [maxLayer] = retCode [i] ; }
+ ++ maxLayer ;
+ }
+ }
+ retCode.realloc(maxLayer) ;
+ return retCode ;
}
//------------------------------------------------------------------------------
@@ -200,9 +217,9 @@ const ServiceRegistrationInfo *getSingleBackendAdapterServiceInfo()
}
uno::Reference SAL_CALL
-instantiateSingleBackendAdapter(const CreationContext& aContext)
+instantiateSingleBackendAdapter(const CreationContext& xContext)
{
- return *new SingleBackendAdapter(aContext) ;
+ return *new SingleBackendAdapter(xContext) ;
}
//------------------------------------------------------------------------------
diff --git a/configmgr/source/backend/singlebackendadapter.hxx b/configmgr/source/backend/singlebackendadapter.hxx
index 02e72bb7cb..99d6ab6033 100644
--- a/configmgr/source/backend/singlebackendadapter.hxx
+++ b/configmgr/source/backend/singlebackendadapter.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: singlebackendadapter.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: cyrillem $ $Date: 2002-06-17 14:28:57 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,6 +70,10 @@
#include
#endif // _COM_SUN_STAR_CONFIGURATION_BACKEND_XSINGLEBACKEND_HPP_
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include
+#endif
+
#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
#include
#endif // _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
@@ -78,10 +82,6 @@
#include
#endif // _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
-#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
-#include
-#endif // _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
-
#ifndef _CPPUHELPER_COMPBASE3_HXX_
#include
#endif // _CPPUHELPER_COMPBASE3_HXX_
@@ -109,7 +109,7 @@ class SingleBackendAdapter : public BackendBase {
@param aFactory service factory
*/
SingleBackendAdapter(
- const uno::Reference& aFactory) ;
+ const uno::Reference& xContext) ;
/** Destructor */
~SingleBackendAdapter(void) ;
@@ -169,7 +169,7 @@ class SingleBackendAdapter : public BackendBase {
protected :
private :
/** Service factory */
- const uno::Reference& mFactory ;
+ uno::Reference mFactory ;
/** Mutex for resource protection */
osl::Mutex mMutex ;
/** Remote backend that the offline cache is handling */
diff --git a/configmgr/source/backend/updatesvc.cxx b/configmgr/source/backend/updatesvc.cxx
index 05d3e798f8..d3ca0f39cc 100644
--- a/configmgr/source/backend/updatesvc.cxx
+++ b/configmgr/source/backend/updatesvc.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: updatesvc.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: jb $ $Date: 2002-12-06 13:08:32 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -112,13 +112,13 @@ ServiceInfoHelper UpdateService::getServiceInfo()
// -----------------------------------------------------------------------------
-UpdateService::UpdateService(CreationArg _xServiceFactory)
-: m_xServiceFactory(_xServiceFactory)
+UpdateService::UpdateService(CreationArg _xContext)
+: m_xServiceFactory(_xContext->getServiceManager(),uno::UNO_QUERY)
, m_aSourceMode(merge)
{
if (!m_xServiceFactory.is())
{
- OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Update Merger: Unexpected NULL context"));
+ OUString sMessage( RTL_CONSTASCII_USTRINGPARAM("Configuration Update Merger: Context has no service manager (or missing interface)"));
throw uno::RuntimeException(sMessage,NULL);
}
}
diff --git a/configmgr/source/backend/updatesvc.hxx b/configmgr/source/backend/updatesvc.hxx
index 2118b0e41d..5a7ed9132a 100644
--- a/configmgr/source/backend/updatesvc.hxx
+++ b/configmgr/source/backend/updatesvc.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: updatesvc.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jb $ $Date: 2002-11-28 12:49:13 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -70,6 +70,9 @@
#include
#endif
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include
+#endif
#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
#include
#endif
@@ -107,10 +110,10 @@ namespace configmgr
>
{
public:
- typedef uno::Reference< lang::XMultiServiceFactory > const & CreationArg;
+ typedef uno::Reference< uno::XComponentContext > const & CreationArg;
explicit
- UpdateService(CreationArg _xServiceFactory);
+ UpdateService(CreationArg _xContext);
// XInitialization
virtual void SAL_CALL
diff --git a/configmgr/source/cmdtools/makefile.mk b/configmgr/source/cmdtools/makefile.mk
index eedbd37bc7..89e8d9a46e 100644
--- a/configmgr/source/cmdtools/makefile.mk
+++ b/configmgr/source/cmdtools/makefile.mk
@@ -2,9 +2,9 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.3 $
+# $Revision: 1.4 $
#
-# last change: $Author: jb $ $Date: 2002-11-26 08:54:02 $
+# last change: $Author: hr $ $Date: 2003-03-19 16:18:52 $
#
# The Contents of this file are made available subject to the terms of
# either of the following licenses
@@ -124,31 +124,3 @@ APP2OBJS= \
.INCLUDE : target.mk
-#**************************************************************************
-# history:
-# $Log: not supported by cvs2svn $
-# Revision 1.2 2002/10/24 15:29:25 jb
-# #102602# New application for importing configuration data into a backend
-#
-# Revision 1.1.1.1 2000/09/18 16:13:40 hr
-# initial import
-#
-# Revision 1.4 2000/09/15 09:51:48 willem.vandorp
-# OpenOffice header added
-#
-# Revision 1.3 2000/08/27 15:44:53 fs
-# #78183# replaced cout/cerr with fprintf
-#
-# Revision 1.2 2000/08/25 13:22:39 fs
-# #78116# on unx, build *.bin
-#
-# Revision 1.1 2000/08/25 13:02:07 fs
-# common reg server related command line tools
-#
-# Revision 1.1 2000/06/23 08:47:33 fs
-# socket related helpers/samples
-#
-#
-# Revision 1.0 26.05.00 17:11:32 fs
-#**************************************************************************
-
diff --git a/configmgr/source/inc/anynoderef.hxx b/configmgr/source/inc/anynoderef.hxx
index 610fcf7756..3feae98ece 100644
--- a/configmgr/source/inc/anynoderef.hxx
+++ b/configmgr/source/inc/anynoderef.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: anynoderef.hxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:54 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -69,12 +69,12 @@
namespace configmgr
{
namespace configapi { class Factory; }
+ namespace node { struct Attributes; }
namespace configuration
{
//-------------------------------------------------------------------------
class Name;
- struct Attributes;
//-------------------------------------------------------------------------
namespace argument { struct NoValidate; }
diff --git a/configmgr/source/inc/apitypes.hxx b/configmgr/source/inc/apitypes.hxx
index f1a0636d19..c737a98568 100644
--- a/configmgr/source/inc/apitypes.hxx
+++ b/configmgr/source/inc/apitypes.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apitypes.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: kr $ $Date: 2001-09-12 12:07:26 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -89,14 +89,10 @@
namespace configmgr
{
- namespace css = ::com::sun::star;
- namespace uno = ::com::sun::star::uno;
-
- using ::std::vector;
- using ::rtl::OUString;
-
namespace configapi
{
+ namespace uno = ::com::sun::star::uno;
+
inline
uno::Type getAnyType( )
{
@@ -125,7 +121,7 @@ namespace configmgr
template
inline
- uno::Sequence makeSequence(vector const& aVector)
+ uno::Sequence makeSequence(::std::vector const& aVector)
{
if (aVector.empty())
return uno::Sequence();
@@ -133,17 +129,6 @@ namespace configmgr
}
}
- // and one on the side
- class NotCopyable
- {
- protected:
- NotCopyable() {}
- ~NotCopyable() {}
- private:
- NotCopyable (NotCopyable& notImplemented);
- void operator= (NotCopyable& notImplemented);
- };
-
}
#endif // CONFIGMGR_API_APITYPES_HXX_
diff --git a/configmgr/source/inc/attributes.hxx b/configmgr/source/inc/attributes.hxx
index fba0d57817..750aad7957 100644
--- a/configmgr/source/inc/attributes.hxx
+++ b/configmgr/source/inc/attributes.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: attributes.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: jb $ $Date: 2002-02-11 13:47:54 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -118,11 +118,6 @@ namespace configmgr
};
}
- // for backward compatibility - this used to be in namespace configuration
- namespace configuration
- {
- using node::Attributes;
- }
}
#endif
diff --git a/configmgr/source/inc/backendfactory.hxx b/configmgr/source/inc/backendfactory.hxx
index 97b5a41e83..c2dedefc0a 100644
--- a/configmgr/source/inc/backendfactory.hxx
+++ b/configmgr/source/inc/backendfactory.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: backendfactory.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: ssmith $ $Date: 2002-12-13 10:26:50 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,19 +66,13 @@
#include
#endif
-#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
-#include
-#endif
-#ifndef _COM_SUN_STAR_SCRIPT_XTYPECONVERTER_HPP_
-#include
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include
#endif
#include
namespace configmgr
{
-//-----------------------------------------------------------------------------
- class ConnectionSettings;
- class IConfigSession;
//-----------------------------------------------------------------------------
namespace backend
{
@@ -86,27 +80,28 @@ namespace configmgr
struct IMergedDataProvider;
//-----------------------------------------------------------------------------
- struct BackendFactory
+ class BackendFactory
{
- typedef com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >
+ public:
+ typedef com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >
CreationContext;
- typedef com::sun::star::uno::Reference< com::sun::star::script::XTypeConverter >
- TypeConverterRef;
-
typedef com::sun::star::uno::Reference< drafts::com::sun::star::configuration::backend::XBackend >
UnoBackend;
- rtl::Reference
- createBackend(ConnectionSettings const & _aSettings, CreationContext const & _xCtx);
+ rtl::Reference createBackend();
+
+ UnoBackend getUnoBackend();
- static UnoBackend
- createDefaultUnoBackend(CreationContext const & _xCtx);
+ static BackendFactory instance(CreationContext const & _xCtx);
- static UnoBackend
- createUnoBackend(ConnectionSettings const & _aSettings, CreationContext const & _xCtx);
+ private:
+ explicit
+ BackendFactory(CreationContext const & _xCtx)
+ : m_xCtx(_xCtx)
+ {}
- static BackendFactory & instance();
+ CreationContext m_xCtx;
};
//-----------------------------------------------------------------------------
}
diff --git a/configmgr/source/inc/bootstrap.hxx b/configmgr/source/inc/bootstrap.hxx
index 4463688e1c..80197061a5 100644
--- a/configmgr/source/inc/bootstrap.hxx
+++ b/configmgr/source/inc/bootstrap.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: bootstrap.hxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: jb $ $Date: 2002-10-24 15:44:01 $
+ * last change: $Author: hr $ $Date: 2003-03-19 16:18:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -62,322 +62,214 @@
#ifndef CONFIGMGR_BOOTSTRAP_HXX_
#define CONFIGMGR_BOOTSTRAP_HXX_
-#ifndef _COM_SUN_STAR_UNO_REFERENCE_HXX_
-#include
-#endif
-#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
-#include
-#endif
-#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
-#include
-#endif
-#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPP_
-#include
-#endif
-#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
-#include
-#endif
-#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_
-#include
-#endif
-#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
-#include
-#endif
-#ifndef _RTL_USTRING_HXX_
-#include
-#endif
-
-#ifndef INCLUDED_MAP
-#include