summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorDirk Grobler <dg@openoffice.org>2000-12-04 18:34:56 +0000
committerDirk Grobler <dg@openoffice.org>2000-12-04 18:34:56 +0000
commit4d3e1ed17e8207b9a4dfedf35c4741719eb42ae3 (patch)
tree9995fa6e1a4b3d8c108b20a91d8910b0c31f6d41 /configmgr
parent9ba18783042ea4a173c22d1bb80bc472cb39929b (diff)
#80460# having different trees for options
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/api2/apitreeimplobj.cxx6
-rw-r--r--configmgr/source/api2/confproviderimpl2.cxx25
-rw-r--r--configmgr/source/api2/providerimpl.cxx41
3 files changed, 27 insertions, 45 deletions
diff --git a/configmgr/source/api2/apitreeimplobj.cxx b/configmgr/source/api2/apitreeimplobj.cxx
index 10ac5b4a4b12..28ba9042043a 100644
--- a/configmgr/source/api2/apitreeimplobj.cxx
+++ b/configmgr/source/api2/apitreeimplobj.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: apitreeimplobj.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: jb $ $Date: 2000-12-04 15:04:59 $
+ * last change: $Author: dg $ $Date: 2000-12-04 19:34:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,7 +100,7 @@ configuration::TemplateProvider ApiProvider::getTemplateProvider() const
UnoTypeConverter ApiProvider::getTypeConverter() const
{
- return m_rProviderImpl.getDefaultOptions()->getTypeConverter();
+ return m_rProviderImpl.getTypeConverter();
}
//-------------------------------------------------------------------------
diff --git a/configmgr/source/api2/confproviderimpl2.cxx b/configmgr/source/api2/confproviderimpl2.cxx
index 902344c87f87..cf712fa3f8af 100644
--- a/configmgr/source/api2/confproviderimpl2.cxx
+++ b/configmgr/source/api2/confproviderimpl2.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: confproviderimpl2.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: dg $ $Date: 2000-12-03 11:45:59 $
+ * last change: $Author: dg $ $Date: 2000-12-04 19:34:55 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -116,22 +116,18 @@ namespace configmgr
sal_Int32 nLevels;
OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, sUser, sLocale, nLevels);
- vos::ORef<OOptions> xOptions = new OOptions(*getDefaultOptions());
+ vos::ORef<OOptions> xOptions = new OOptions(getDefaultOptions());
xOptions->setUser(sUser);
xOptions->setLocale(sLocale);
- // determine which parts are need for the path
- m_pTreeMgr->getPathRequirements(sPath, xOptions, nLevels, sUser, sLocale);
- ::rtl::OUString sNodeAccessor = IConfigSession::composeNodeAccessor(sPath, sUser, sLocale);
-
- CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sNodeAccessor));
+ 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);
// create the access object
uno::Reference< uno::XInterface > xReturn;
if (aArgs.getLength() != 0)
{
- NodeElement* pElement = buildReadAccess(sNodeAccessor, xOptions, nLevels);
+ NodeElement* pElement = buildReadAccess(sPath, xOptions, nLevels);
if (pElement != 0)
{
xReturn = pElement->getUnoInstance();
@@ -154,23 +150,18 @@ namespace configmgr
sal_Int32 nLevels;
OProviderImpl::FactoryArguments::extractArgs(aArgs, sPath, sUser, sLocale, nLevels);
- vos::ORef<OOptions> xOptions = new OOptions(*getDefaultOptions());
+ vos::ORef<OOptions> xOptions = new OOptions(getDefaultOptions());
xOptions->setUser(sUser);
xOptions->setLocale(sLocale);
- // determine which parts are need for the path
- m_pTreeMgr->getPathRequirements(sPath, xOptions, nLevels, sUser, sLocale);
- ::rtl::OUString sNodeAccessor = IConfigSession::composeNodeAccessor(sPath, sUser, sLocale);
-
- CFG_TRACE_INFO_NI("config provider: node accessor extracted from the args is %s", OUSTRING2ASCII(sNodeAccessor));
+ 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);
-
// create the access object
uno::Reference< uno::XInterface > xReturn;
if (aArgs.getLength() != 0)
{
- NodeElement* pElement = buildUpdateAccess(sNodeAccessor, xOptions, nLevels);
+ NodeElement* pElement = buildUpdateAccess(sPath, xOptions, nLevels);
if (pElement != 0)
{
xReturn = pElement->getUnoInstance();
diff --git a/configmgr/source/api2/providerimpl.cxx b/configmgr/source/api2/providerimpl.cxx
index 4d1434bd20d0..e5f14d41c254 100644
--- a/configmgr/source/api2/providerimpl.cxx
+++ b/configmgr/source/api2/providerimpl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: providerimpl.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: jb $ $Date: 2000-12-04 09:20:27 $
+ * last change: $Author: dg $ $Date: 2000-12-04 19:34:56 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -147,10 +147,11 @@ namespace configmgr
IConfigSession* _pSession,
Module& _rModule, const ConnectionSettings& _rSettings)
:m_xDefaultOptions(new OOptions(_rModule.getConverter()))
- ,m_pTreeMgr(new TreeManager(_pSession, m_xDefaultOptions))
,m_pNewProviders(0)
,m_pProvider(_pProvider)
{
+
+ m_pTreeMgr = new TreeManager(_pSession, new OOptions(_rModule.getConverter()));
m_pTreeMgr->acquire();
// put out of line to get rid of the order dependency (and to have a acquired configuration)
@@ -158,23 +159,17 @@ namespace configmgr
// read the default locale for the user
rtl::OUString sDefaultLocale(ssDefaultLocale);
+ rtl::OUString sDefaultUser;
try
{
// if we have a user name, we have to add it for the request and we remember it for the session
- rtl::OUString sUserName;
- rtl::OUString sProfile;
if (_rSettings.hasUser())
{
// the username is also part of the connection settings
- m_xDefaultOptions->setUser(_rSettings.getUser());
-
- sProfile = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("["));
- sProfile += _rSettings.getUser();
- sProfile += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]/"));
+ sDefaultUser = _rSettings.getUser();
}
- sProfile += ssUserProfile;
- ISubtree* pSubTree = m_pTreeMgr->requestSubtree(sProfile, m_xDefaultOptions);
+ ISubtree* pSubTree = m_pTreeMgr->requestSubtree(ssUserProfile, m_xDefaultOptions);
if (pSubTree)
{
INode* pNode = pSubTree->getChild(ssInternational);
@@ -194,6 +189,7 @@ namespace configmgr
// default locale is en-US
}
m_xDefaultOptions->setDefaultLocale(sDefaultLocale);
+ m_xDefaultOptions->setDefaultUser(sDefaultUser);
}
//-----------------------------------------------------------------------------
@@ -312,15 +308,14 @@ namespace configmgr
}
//-----------------------------------------------------------------------------------
- OUString OProviderImpl::getErrorMessage(OUString const& _rAccessor)
+ OUString OProviderImpl::getErrorMessage(OUString const& _rAccessor, const vos::ORef < OOptions >& _xOptions)
{
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(RTL_CONSTASCII_USTRINGPARAM("The read access for node "));
- ::rtl::OUString sPurePath, sUser, sLocale;
- sal_Bool bHasExtension = IConfigSession::splitNodeAccessor(_rAccessor, sPurePath, sUser, sLocale) != 0;
- 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(sPurePath));
- sMessage += sPurePath;
+ ::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(_rAccessor));
+ sMessage += _rAccessor;
if (sUser.getLength())
{
@@ -360,7 +355,7 @@ namespace configmgr
if (!pTree)
{
- ::rtl::OUString sMessage = getErrorMessage(_rAccessor);
+ ::rtl::OUString sMessage = getErrorMessage(_rAccessor, _xOptions);
// append the error message given by the tree provider
if (sErrorMessage.getLength())
@@ -402,7 +397,7 @@ namespace configmgr
if (!pTree)
{
- ::rtl::OUString sMessage = getErrorMessage(_rAccessor);
+ ::rtl::OUString sMessage = getErrorMessage(_rAccessor, _xOptions);
// append the error message given by the tree provider
if (sErrorMessage.getLength())
@@ -422,10 +417,6 @@ namespace configmgr
*pTree, nDepth, getTemplateProvider()
));
- #if defined(DEBUG) || defined(_DEBUG)
- if (_rAccessor == IConfigSession::getUserAdminAccessor())
- { CFG_TRACE_ERROR("config provider: DATA ERROR: User Admin Accessor points to a non-set node"); }
- #endif
return m_pNewProviders->getWriterFactory().makeAccessRoot(aRootTree, _xOptions);
}