[Libreoffice-commits] .: Branch 'feature/gnumake4' - 4 commits - connectivity/source editeng/Library_editeng.mk framework/Library_fwe.mk framework/Library_fwi.mk linguistic/Library_lng.mk sfx2/Library_qstart.mk sfx2/Library_sfx.mk svx/Library_svxcore.mk svx/Library_svx.mk svx/Library_textconversiondlgs.mk vbahelper/Library_vbahelper.mk xmloff/Library_xo.mk xmlscript/Library_xcr.mk
Bjoern Michaelsen
bmichaelsen at kemper.freedesktop.org
Fri Jun 17 05:41:52 PDT 2011
connectivity/source/cpool/Zregistration.cxx | 4
connectivity/source/drivers/evoab/LCatalog.cxx | 72 -
connectivity/source/drivers/evoab/LCatalog.hxx | 49
connectivity/source/drivers/evoab/LColumnAlias.cxx | 232 ----
connectivity/source/drivers/evoab/LColumnAlias.hxx | 113 -
connectivity/source/drivers/evoab/LColumns.cxx | 57
connectivity/source/drivers/evoab/LColumns.hxx | 52
connectivity/source/drivers/evoab/LConfigAccess.cxx | 161 --
connectivity/source/drivers/evoab/LConfigAccess.hxx | 46
connectivity/source/drivers/evoab/LConnection.cxx | 267 ----
connectivity/source/drivers/evoab/LConnection.hxx | 78 -
connectivity/source/drivers/evoab/LDatabaseMetaData.cxx | 391 ------
connectivity/source/drivers/evoab/LDatabaseMetaData.hxx | 56
connectivity/source/drivers/evoab/LDebug.cxx | 42
connectivity/source/drivers/evoab/LDebug.hxx | 42
connectivity/source/drivers/evoab/LDriver.cxx | 505 --------
connectivity/source/drivers/evoab/LDriver.hxx | 115 -
connectivity/source/drivers/evoab/LFolderList.cxx | 563 ---------
connectivity/source/drivers/evoab/LFolderList.hxx | 92 -
connectivity/source/drivers/evoab/LNoException.cxx | 324 -----
connectivity/source/drivers/evoab/LPreparedStatement.cxx | 43
connectivity/source/drivers/evoab/LPreparedStatement.hxx | 50
connectivity/source/drivers/evoab/LResultSet.cxx | 190 ---
connectivity/source/drivers/evoab/LResultSet.hxx | 81 -
connectivity/source/drivers/evoab/LServices.cxx | 123 --
connectivity/source/drivers/evoab/LStatement.cxx | 43
connectivity/source/drivers/evoab/LStatement.hxx | 49
connectivity/source/drivers/evoab/LTable.cxx | 870 ---------------
connectivity/source/drivers/evoab/LTable.hxx | 100 -
connectivity/source/drivers/evoab/LTables.cxx | 62 -
connectivity/source/drivers/evoab/LTables.hxx | 52
connectivity/source/drivers/evoab/evoab.xcu | 61 -
connectivity/source/drivers/evoab/evoab.xml | 33
connectivity/source/drivers/evoab/exports.dxp | 2
connectivity/source/drivers/evoab/makefile.mk | 104 -
editeng/Library_editeng.mk | 6
framework/Library_fwe.mk | 9
framework/Library_fwi.mk | 3
linguistic/Library_lng.mk | 9
sfx2/Library_qstart.mk | 3
sfx2/Library_sfx.mk | 6
svx/Library_svx.mk | 3
svx/Library_svxcore.mk | 3
svx/Library_textconversiondlgs.mk | 4
vbahelper/Library_vbahelper.mk | 3
xmloff/Library_xo.mk | 3
xmlscript/Library_xcr.mk | 3
47 files changed, 18 insertions(+), 5161 deletions(-)
New commits:
commit 08cd54907c12da3b42abd66ea2997c9b60bbaf8d
Author: Ocke Janssen [oj] <Ocke.Janssen at oracle.com>
Date: Thu Apr 14 10:11:15 2011 +0200
gnumake4: added dbaccess and reportdesign [hg:a75d5667430f]
diff --git a/connectivity/source/cpool/Zregistration.cxx b/connectivity/source/cpool/Zregistration.cxx
index 43ae4a9..26d8352 100644
--- a/connectivity/source/cpool/Zregistration.cxx
+++ b/connectivity/source/cpool/Zregistration.cxx
@@ -44,13 +44,13 @@ extern "C"
{
//---------------------------------------------------------------------------------------
- void SAL_CALL component_getImplementationEnvironment(const sal_Char** _ppEnvTypeName, uno_Environment** /*_ppEnv*/)
+ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char** _ppEnvTypeName, uno_Environment** /*_ppEnv*/)
{
*_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//---------------------------------------------------------------------------------------
-void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
+SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* _pImplName, ::com::sun::star::lang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
{
void* pRet = NULL;
commit 1cd16db2052a9a3ad45c7598e449cd1c1f1bdb9c
Author: Ocke Janssen [oj] <Ocke.Janssen at oracle.com>
Date: Mon Apr 11 15:09:46 2011 +0200
gnumake4: remove evoab [hg:0109ce6e2910]
diff --git a/connectivity/source/drivers/evoab/LCatalog.cxx b/connectivity/source/drivers/evoab/LCatalog.cxx
deleted file mode 100644
index cae0a86..0000000
--- a/connectivity/source/drivers/evoab/LCatalog.cxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-
-#include "LCatalog.hxx"
-#include "LConnection.hxx"
-#include "LTables.hxx"
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-// -------------------------------------------------------------------------
-using namespace connectivity::evoab;
-// -------------------------------------------------------------------------
-OEvoabCatalog::OEvoabCatalog(OEvoabConnection* _pCon) : file::OFileCatalog(_pCon)
-{
-}
-// -------------------------------------------------------------------------
-void OEvoabCatalog::refreshTables()
-{
- TStringVector aVector;
- Sequence< ::rtl::OUString > aTypes;
- Reference< XResultSet > xResult = m_xMetaData->getTables(Any(),
- ::rtl::OUString::createFromAscii("%"),::rtl::OUString::createFromAscii("%"),aTypes);
-
- if(xResult.is())
- {
- Reference< XRow > xRow(xResult,UNO_QUERY);
- while(xResult->next())
- aVector.push_back(xRow->getString(3));
- }
- if(m_pTables)
- m_pTables->reFill(aVector);
- else
- m_pTables = new OEvoabTables(m_xMetaData,*this,m_aMutex,aVector);
-}
-// -----------------------------------------------------------------------------
-
-
-
diff --git a/connectivity/source/drivers/evoab/LCatalog.hxx b/connectivity/source/drivers/evoab/LCatalog.hxx
deleted file mode 100644
index f0e2e86..0000000
--- a/connectivity/source/drivers/evoab/LCatalog.hxx
+++ /dev/null
@@ -1,49 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_LCATALOG_HXX_
-#define _CONNECTIVITY_EVOAB_LCATALOG_HXX_
-
-#include "file/FCatalog.hxx"
-
-namespace connectivity
-{
- namespace evoab
- {
- class OEvoabConnection;
- class OEvoabCatalog : public file::OFileCatalog
- {
- public:
- virtual void refreshTables();
-
- public:
- OEvoabCatalog(OEvoabConnection* _pCon);
- };
- }
-}
-#endif // _CONNECTIVITY_EVOAB_LCATALOG_HXX_
-
diff --git a/connectivity/source/drivers/evoab/LColumnAlias.cxx b/connectivity/source/drivers/evoab/LColumnAlias.cxx
deleted file mode 100644
index bf2564e..0000000
--- a/connectivity/source/drivers/evoab/LColumnAlias.cxx
+++ /dev/null
@@ -1,232 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "LColumnAlias.hxx"
-#include "LDriver.hxx"
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include "LConfigAccess.hxx"
-
-using namespace ::connectivity;
-using namespace ::connectivity::evoab;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
-
-static const ::rtl::OUString sProgrammaticNames[] =
-{
- ::rtl::OUString::createFromAscii("FirstName"),
- ::rtl::OUString::createFromAscii("LastName"),
- ::rtl::OUString::createFromAscii("DisplayName"),
- ::rtl::OUString::createFromAscii("NickName"),
- ::rtl::OUString::createFromAscii("PrimaryEmail"),
- ::rtl::OUString::createFromAscii("SecondEmail"),
- ::rtl::OUString::createFromAscii("PreferMailFormat"),
- ::rtl::OUString::createFromAscii("WorkPhone"),
- ::rtl::OUString::createFromAscii("HomePhone"),
- ::rtl::OUString::createFromAscii("FaxNumber"),
- ::rtl::OUString::createFromAscii("PagerNumber"),
- ::rtl::OUString::createFromAscii("CellularNumber"),
- ::rtl::OUString::createFromAscii("HomeAddress"),
- ::rtl::OUString::createFromAscii("HomeAddress2"),
- ::rtl::OUString::createFromAscii("HomeCity"),
- ::rtl::OUString::createFromAscii("HomeState"),
- ::rtl::OUString::createFromAscii("HomeZipCode"),
- ::rtl::OUString::createFromAscii("HomeCountry"),
- ::rtl::OUString::createFromAscii("WorkAddress"),
- ::rtl::OUString::createFromAscii("WorkAddress2"),
- ::rtl::OUString::createFromAscii("WorkCity"),
- ::rtl::OUString::createFromAscii("WorkState"),
- ::rtl::OUString::createFromAscii("WorkZipCode"),
- ::rtl::OUString::createFromAscii("WorkCountry"),
- ::rtl::OUString::createFromAscii("JobTitle"),
- ::rtl::OUString::createFromAscii("Department"),
- ::rtl::OUString::createFromAscii("Company"),
- ::rtl::OUString::createFromAscii("WebPage1"),
- ::rtl::OUString::createFromAscii("WebPage2"),
- ::rtl::OUString::createFromAscii("BirthYear"),
- ::rtl::OUString::createFromAscii("BirthMonth"),
- ::rtl::OUString::createFromAscii("BirthDay"),
- ::rtl::OUString::createFromAscii("Notes")
-};
-//------------------------------------------------------------------------------
-OColumnAlias::OColumnAlias()
-{
- // Initialise m_aAlias with the default values from sProgrammaticNames.
- initialise();
-
- // Initialise m_aAlias map with the default values from sProgrammaticNames.
- setAliasMap();
-}
-//------------------------------------------------------------------
-OColumnAlias::~OColumnAlias()
-{
-}
-//------------------------------------------------------------------
-void OColumnAlias::initialise()
-{
- m_aAlias.reserve( END - FIRSTNAME + 1 );
- for (sal_Int32 i(FIRSTNAME); i < END; ++i)
- {
- m_aAlias.push_back(sProgrammaticNames[i]);
- m_aHeadLineNames.push_back(sProgrammaticNames[i]);
- }
-
- return;
-}
-//------------------------------------------------------------------
-void OColumnAlias::setAlias(const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory >& _rxORB)
-{
- OSL_TRACE("OColumnAlias::setAlias()entered");
-
- // open our driver settings config node
-
- // the config path for our own driver's settings
- Reference< XPropertySet > xEvoDriverNode = createDriverConfigNode( _rxORB, OEvoabDriver::getImplementationName_Static() );
- //Reference< XPropertySet > xMozDriverNode = createDriverConfigNode( _rxORB, mozab::OConnection::getDriverImplementationName() );
- Reference< XPropertySet > xMozDriverNode = createDriverConfigNode( _rxORB, ::rtl::OUString::createFromAscii ("com.sun.star.comp.sdbc.MozabDriver") );
- if ( xEvoDriverNode.is() && xMozDriverNode.is() )
- {
- try
- {
- //=============================================================
- Reference< XNameAccess > xEvoAliasesNode;
- Reference< XNameAccess > xMozAliasesNode;
- xEvoDriverNode->getPropertyValue( ::rtl::OUString::createFromAscii("ColumnAliases") ) >>= xEvoAliasesNode;
- xMozDriverNode->getPropertyValue( ::rtl::OUString::createFromAscii("ColumnAliases") ) >>= xMozAliasesNode;
- OSL_ENSURE( xEvoAliasesNode.is(), "OColumnAlias::setAlias: missing the evolution aliases node!" );
- OSL_ENSURE( xMozAliasesNode.is(), "OColumnAlias::setAlias: missing the mozilla aliases node!" );
-
- // this is a set of string nodes
- Sequence< ::rtl::OUString > aColumnProgrammaticNames;
- //OSL_TRACE("OColumnAlias::setAlias()before xAliasesNode->getElementNames()");
- if ( xEvoAliasesNode.is() )
- aColumnProgrammaticNames = xEvoAliasesNode->getElementNames();
- //OSL_TRACE("OColumnAlias::setAlias()after xAliasesNode->getElementNames()");
-
- //=============================================================
- // travel through all the set elements
- const ::rtl::OUString* pProgrammaticNames = aColumnProgrammaticNames.getConstArray();
- const ::rtl::OUString* pProgrammaticNamesEnd = pProgrammaticNames + aColumnProgrammaticNames.getLength();
- ::rtl::OUString sAssignedAlias;
- ::rtl::OUString sHeadLineName;
-
- for ( ; pProgrammaticNames < pProgrammaticNamesEnd; ++pProgrammaticNames )
- {
- //OSL_TRACE("OColumnAlias::setAlias()::*pProgrammaticNames = %s\n", ((OUtoCStr(*pProgrammaticNames)) ? (OUtoCStr(*pProgrammaticNames)):("NULL")) );
- OSL_ENSURE( m_aAliasMap.end() != m_aAliasMap.find( *pProgrammaticNames ),
- "OColumnAlias::setAlias: found an invalid programmtic name!" );
- // if this asserts, somebody stored a programmatic name in the configuration
- // which is not allowed (i.e. not in the list of known programmatics).
- //OSL_TRACE("OColumnAlias::setAlias()before xAliasesNode->getByName()");
-
-#if OSL_DEBUG_LEVEL > 0
- sal_Bool bExtractionSuccess =
-#endif
- xMozAliasesNode->getByName( *pProgrammaticNames) >>= sAssignedAlias;
- OSL_ENSURE( bExtractionSuccess, "OColumnAlias::setAlias: invalid mozilla config data!" );
-#if OSL_DEBUG_LEVEL > 0
- bExtractionSuccess =
-#endif
- xEvoAliasesNode->getByName( *pProgrammaticNames) >>= sHeadLineName;
- OSL_ENSURE( bExtractionSuccess, "OColumnAlias::setAlias: invalid evolution config data!" );
- //OSL_TRACE("OColumnAlias::setAlias()after xAliasesNode->getByName()");
-
- // normalize in case the config data is corrupted
- // (what we really don't need is an empty alias ...)
- if ( 0 == sAssignedAlias.getLength() )
- sAssignedAlias = *pProgrammaticNames;
- if ( 0 == sHeadLineName.getLength() )
- sHeadLineName = *pProgrammaticNames;
- //OSL_TRACE("OColumnAlias::setAlias()::sAssignedAlias = %s\n", ((OUtoCStr(sAssignedAlias)) ? (OUtoCStr(sAssignedAlias)):("NULL")) );
- //OSL_TRACE("OColumnAlias::setAlias()::sHeadLineName = %s\n", ((OUtoCStr(sHeadLineName)) ? (OUtoCStr(sHeadLineName)):("NULL")) );
-
- //=============================================================
- // check the value
- // look up the programmatic indicated by pProgrammaticNames in the known programmatics
- const ::rtl::OUString* pProgrammatic = sProgrammaticNames + FIRSTNAME;
- const ::rtl::OUString* pProgrammaticEnd = sProgrammaticNames + END;
-
- OSL_ENSURE( (sal_Int32)m_aAlias.size() == pProgrammaticEnd - pProgrammatic,
- "OColumnAlias::setAlias: aliases vector not yet initialized!" );
-
- // the destination where we want to remember the alias
- ::std::vector< ::rtl::OUString >::iterator aAlias = m_aAlias.begin();
- ::std::vector< ::rtl::OUString >::iterator aHeadLineName = m_aHeadLineNames.begin();
-
- for ( ; pProgrammatic < pProgrammaticEnd; ++pProgrammatic, ++aAlias, ++aHeadLineName )
- {
- //OSL_TRACE("OColumnAlias::setAlias()::*pProgrammatic = %s\n", ((OUtoCStr(*pProgrammatic)) ? (OUtoCStr(*pProgrammatic)):("NULL")) );
- if ( pProgrammaticNames->equals( *pProgrammatic ) )
- {
- // add alias to the vector
- *aAlias = sAssignedAlias;
- *aHeadLineName = sHeadLineName;
- break;
- }
- }
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "OColumnAlias::setAlias: could not read my driver's configuration data!" );
- }
- }
-
- // Initialise m_aAliasMap.
- setAliasMap();
-
- return;
-}
-//------------------------------------------------------------------
-const ::std::vector< ::rtl::OUString> & OColumnAlias::getAlias() const
-{
- return m_aAlias;
-}
-//------------------------------------------------------------------
-const ::std::map< ::rtl::OUString, ::rtl::OUString> & OColumnAlias::getAliasMap() const
-{
- return m_aAliasMap;
-}
-//------------------------------------------------------------------
-void OColumnAlias::setAliasMap()
-{
- // Fill the map with the values of m_aAlias
- // and the sProgrammaticNames array.
- for (sal_Int32 i(FIRSTNAME); i < END; ++i) {
- m_aAliasMap[m_aAlias[i]] = m_aHeadLineNames[i];
- //OSL_TRACE("OColumnAlias::setAliasMap()::m_aAlias[i] = %s\n", ((OUtoCStr(m_aAlias[i])) ? (OUtoCStr(m_aAlias[i])):("NULL")) );
- //OSL_TRACE("OColumnAlias::setAliasMap()::m_aAliasMap[m_aAlias[i]] = %s\n", ((OUtoCStr(m_aAliasMap[m_aAlias[i]])) ? (OUtoCStr(m_aAliasMap[m_aAlias[i]])):("NULL")) );
- }
-
- return;
-}
-//------------------------------------------------------------------
diff --git a/connectivity/source/drivers/evoab/LColumnAlias.hxx b/connectivity/source/drivers/evoab/LColumnAlias.hxx
deleted file mode 100644
index 57257f7..0000000
--- a/connectivity/source/drivers/evoab/LColumnAlias.hxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_LCOLUMNALIAS_HXX_
-#define _CONNECTIVITY_EVOAB_LCOLUMNALIAS_HXX_
-
-#include <unotools/confignode.hxx>
-
-#include <osl/mutex.hxx>
-#include <vector>
-#include <map>
-
-namespace connectivity
-{
- namespace evoab
- {
- typedef enum {
- FIRSTNAME = 0,
- LASTNAME,
- DISPLAYNAME,
- NICKNAME,
- PRIMARYEMAIL,
- SECONDEMAIL,
- PREFERMAILFORMAT,
- WORKPHONE,
- HOMEPHONE,
- FAXNUMBER,
- PAGERNUMBER,
- CELLULARNUMBER,
- HOMEADDRESS,
- HOMEADDRESS2,
- HOMECITY,
- HOMESTATE,
- HOMEZIPCODE,
- HOMECOUNTRY,
- WORKADDRESS,
- WORKADDRESS2,
- WORKCITY,
- WORKSTATE,
- WORKZIPCODE,
- WORKCOUNTRY,
- JOBTITLE,
- DEPARTMENT,
- COMPANY,
- WEBPAGE1,
- WEBPAGE2,
- BIRTHYEAR,
- BIRTHMONTH,
- BIRTHDAY,
- NOTES,
- END
- } ProgrammaticName;
-
- class OColumnAlias
- {
- /**
- * m_Alias holds aliases for the evolution addressbook
- * column names. This member gets initialised during
- * creation of the connection to the driver.
- * m_aAlias initialises m_aAliasMap which then can be
- * used to find the corresponding programmatic name
- * when an alias is used as a query attribute. Mozilla
- * expects programmatic names from its clients.
- *
- * m_aAlias: vector of aliases used to initialise m_aAliasMap.
- * m_AliasMap: map of {alias, programmaticname} pairs.
- *
- */
- private:
- ::std::vector< ::rtl::OUString> m_aAlias;
- ::std::vector< ::rtl::OUString> m_aHeadLineNames;
- ::std::map< ::rtl::OUString, ::rtl::OUString> m_aAliasMap;
- protected:
- ::osl::Mutex m_aMutex;
- public:
- void initialise(void);
- const ::std::vector< ::rtl::OUString> & getAlias(void) const;
- const ::std::map< ::rtl::OUString, ::rtl::OUString> & getAliasMap(void) const;
- void setAlias(const ::com::sun::star::uno::Reference<
- ::com::sun::star::lang::XMultiServiceFactory > &);
- private:
- void setAliasMap(void);
- public:
- OColumnAlias(void);
- ~OColumnAlias(void);
- };
- }
-}
-#endif // _CONNECTIVITY_EVOAB_LCOLUMNALIAS_HXX_
diff --git a/connectivity/source/drivers/evoab/LColumns.cxx b/connectivity/source/drivers/evoab/LColumns.cxx
deleted file mode 100644
index 87cd192..0000000
--- a/connectivity/source/drivers/evoab/LColumns.cxx
+++ /dev/null
@@ -1,57 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#include "LColumns.hxx"
-#include "LTable.hxx"
-#include "connectivity/sdbcx/VColumn.hxx"
-
-using namespace connectivity::evoab;
-using namespace connectivity;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-
-
-sdbcx::ObjectType OEvoabColumns::createObject(const ::rtl::OUString& _rName)
-{
-
- OEvoabTable* pTable = (OEvoabTable*)m_pTable;
- ::vos::ORef<OSQLColumns> aCols = pTable->getTableColumns();
- OSQLColumns::Vector::const_iterator aIter = find(aCols->get().begin(),aCols->get().end(),_rName,::comphelper::UStringMixEqual(isCaseSensitive()));
- sdbcx::ObjectType xRet;
- if(aIter != aCols->get().end())
- xRet = sdbcx::ObjectType(*aIter,UNO_QUERY);
- return xRet;
-}
-// -------------------------------------------------------------------------
-
-
diff --git a/connectivity/source/drivers/evoab/LColumns.hxx b/connectivity/source/drivers/evoab/LColumns.hxx
deleted file mode 100644
index 57ee63d..0000000
--- a/connectivity/source/drivers/evoab/LColumns.hxx
+++ /dev/null
@@ -1,52 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_LCOLUMNS_HXX_
-#define _CONNECTIVITY_EVOAB_LCOLUMNS_HXX_
-
-#include "file/FColumns.hxx"
-
-namespace connectivity
-{
- namespace evoab
- {
- class OEvoabColumns : public file::OColumns
- {
- protected:
- virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName);
- public:
- OEvoabColumns(file::OFileTable* _pTable,
- ::osl::Mutex& _rMutex,
- const TStringVector &_rVector
- ) : file::OColumns(_pTable,_rMutex,_rVector)
- {}
-
- };
- }
-}
-#endif // _CONNECTIVITY_EVOAB_LCOLUMNS_HXX_
-
diff --git a/connectivity/source/drivers/evoab/LConfigAccess.cxx b/connectivity/source/drivers/evoab/LConfigAccess.cxx
deleted file mode 100644
index 28a1a05..0000000
--- a/connectivity/source/drivers/evoab/LConfigAccess.cxx
+++ /dev/null
@@ -1,161 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "LConfigAccess.hxx"
-#include "LDriver.hxx"
-#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
-#include "LDebug.hxx"
-#endif
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::beans;
-
-//.........................................................................
-namespace connectivity
-{
- namespace evoab
- {
- //-----------------------------------------------------------------
- Reference< XPropertySet > createDriverConfigNode( Reference< XMultiServiceFactory > _rxORB, ::rtl::OUString _sDriverImplementationName )
- {
- OSL_TRACE("createDriverConfigNode()entered");
-
- Reference< XPropertySet > xNode;
- try
- {
- //=============================================================
- // create the config provider
- Reference< XMultiServiceFactory > xConfigProvider(
- _rxORB->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.configuration.ConfigurationProvider" ) ),
- UNO_QUERY
- );
- OSL_ENSURE( xConfigProvider.is(), "createDriverConfigNode: could not create the config provider!" );
-
- if ( xConfigProvider.is() )
- {
- ::rtl::OUString sCompleteNodePath = ::rtl::OUString::createFromAscii ("/org.openoffice.Office.DataAccess/DriverSettings/" );
- sCompleteNodePath += _sDriverImplementationName;
- //sCompleteNodePath += OEvoabConnection::getDriverImplementationName();
- //sCompleteNodePath += ::rtl::OUString::createFromAscii ("com.sun.star.comp.sdbc.MozabDriver");
- EVO_TRACE_STRING("createDriverConfigNode()::sCompleteNodePath = %s\n", sCompleteNodePath );
-
- //=========================================================
- // arguments for creating the config access
- Sequence< Any > aArguments(2);
- // the path to the node to open
- aArguments[0] <<= PropertyValue(
- ::rtl::OUString::createFromAscii( "nodepath"),
- 0,
- makeAny( sCompleteNodePath ),
- PropertyState_DIRECT_VALUE
- );
- // the depth: -1 means unlimited
- aArguments[1] <<= PropertyValue(
- ::rtl::OUString::createFromAscii( "depth"),
- 0,
- makeAny( (sal_Int32)-1 ),
- PropertyState_DIRECT_VALUE
- );
-
- //=========================================================
- // create the access
- Reference< XInterface > xAccess = xConfigProvider->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii( "com.sun.star.configuration.ConfigurationAccess" ),
- aArguments
- );
- OSL_ENSURE( xAccess.is(), "createDriverConfigNode: invalid access returned (should throw an exception instead)!" );
-
- xNode = xNode.query( xAccess );
- }
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "createDriverConfigNode: caught an exception while accessing the driver's config node!" );
- }
-
- // outta here
- return xNode;
- }
-
- //-----------------------------------------------------------------
- namespace
- {
- // a private helper to accessing the point where we store the reference
- // to the factory
- Reference< XMultiServiceFactory >& accessFactoryStorage( )
- {
- static Reference< XMultiServiceFactory > xEvoabServiceFactory;
- return xEvoabServiceFactory;
- }
- }
-
- //-----------------------------------------------------------------
- void setEvoabServiceFactory( const Reference< XMultiServiceFactory >& _rxFactory )
- {
- accessFactoryStorage( ) = _rxFactory;
- }
-
- //-----------------------------------------------------------------
- const Reference< XMultiServiceFactory >& getEvoabServiceFactory( )
- {
- return accessFactoryStorage( );
- }
-
- //-----------------------------------------------------------------
- ::rtl::OUString getFullPathExportingCommand( Reference< XMultiServiceFactory > _rxORB )
- {
- ::rtl::OUString sFullPathExportingCommand;
-
- //Reference< XMultiServiceFactory > xFactory = getEvoabServiceFactory();
- //OSL_ENSURE( xFactory.is(), "getPreferredProfileName: invalid service factory!" );
- OSL_ENSURE( _rxORB.is(), "getFullPathExportingCommand: invalid service factory!" );
- if ( _rxORB.is() )
- {
- try
- {
- Reference< XPropertySet > xDriverNode = createDriverConfigNode( _rxORB, OEvoabDriver::getImplementationName_Static() );
- Reference< XPropertySet > xEvoPrefsNode;
- if ( xDriverNode.is() )
- xDriverNode->getPropertyValue( ::rtl::OUString::createFromAscii( "EvolutionPreferences" ) ) >>= xEvoPrefsNode;
- OSL_ENSURE( xEvoPrefsNode.is(), "getFullPathExportingCommand: could not access the node for the evolution preferences!" );
- if ( xEvoPrefsNode.is() )
- xEvoPrefsNode->getPropertyValue( ::rtl::OUString::createFromAscii( "FullPathExportingCommand" ) ) >>= sFullPathExportingCommand;
- }
- catch( const Exception& )
- {
- OSL_ENSURE( sal_False, "getFullPathExportingCommand: caught an exception!" );
- }
- }
- return sFullPathExportingCommand;
- }
- }
-}
-
-//.........................................................................
diff --git a/connectivity/source/drivers/evoab/LConfigAccess.hxx b/connectivity/source/drivers/evoab/LConfigAccess.hxx
deleted file mode 100644
index 9844108..0000000
--- a/connectivity/source/drivers/evoab/LConfigAccess.hxx
+++ /dev/null
@@ -1,46 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_LCONFIGACCESS_HXX_
-#define _CONNECTIVITY_EVOAB_LCONFIGACCESS_HXX_
-
-// This is the extended version (for use on the SO side of the driver) of MConfigAccess
-// (which is for use on the mozilla side only)
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-namespace connectivity
-{
- namespace evoab
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
- createDriverConfigNode( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB, ::rtl::OUString _sDriverImplementationName );
- ::rtl::OUString getFullPathExportingCommand( ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > _rxORB );
- }
-}
-#endif // _CONNECTIVITY_EVOAB_LCONFIGACCESS_HXX_
diff --git a/connectivity/source/drivers/evoab/LConnection.cxx b/connectivity/source/drivers/evoab/LConnection.cxx
deleted file mode 100644
index 05abca5..0000000
--- a/connectivity/source/drivers/evoab/LConnection.cxx
+++ /dev/null
@@ -1,267 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "LConnection.hxx"
-#include "LDatabaseMetaData.hxx"
-#include "LCatalog.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <tools/urlobj.hxx>
-#include "LPreparedStatement.hxx"
-#include "LStatement.hxx"
-#include <comphelper/extract.hxx>
-#include <connectivity/dbcharset.hxx>
-#include <connectivity/dbexception.hxx>
-#include <comphelper/processfactory.hxx>
-#include <vos/process.hxx>
-#include <tools/debug.hxx>
-#include "LDebug.hxx"
-#include "diagnose_ex.h"
-#include <comphelper/sequence.hxx>
-#include <connectivity/dbexception.hxx>
-#include "resource/common_res.hrc"
-
-using namespace connectivity::evoab;
-using namespace connectivity::file;
-using namespace vos;
-
-typedef connectivity::file::OConnection OConnection_B;
-
-//------------------------------------------------------------------------------
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-
-::rtl::OUString implGetExceptionMsg( Exception& e, const ::rtl::OUString& aExceptionType_ )
-{
- ::rtl::OUString aExceptionType = aExceptionType_;
- if( aExceptionType.getLength() == 0 )
- aExceptionType = ::rtl::OUString( ::rtl::OUString::createFromAscii("Unknown" ) );
-
- ::rtl::OUString aTypeLine( ::rtl::OUString::createFromAscii("\nType: " ) );
- aTypeLine += aExceptionType;
-
- ::rtl::OUString aMessageLine( ::rtl::OUString::createFromAscii("\nMessage: " ) );
- aMessageLine += ::rtl::OUString( e.Message );
-
- ::rtl::OUString aMsg(aTypeLine);
- aMsg += aMessageLine;
- return aMsg;
-}
-
- // Exception type unknown
-::rtl::OUString implGetExceptionMsg( Exception& e )
-{
- ::rtl::OUString aMsg = implGetExceptionMsg( e, ::rtl::OUString() );
- return aMsg;
-}
-
-// --------------------------------------------------------------------------------
-OEvoabConnection::OEvoabConnection(OEvoabDriver* _pDriver) : OConnection(_pDriver)
- ,m_bHeaderLine(sal_True)
- ,m_cFieldDelimiter(',')
- ,m_cStringDelimiter('"')
- ,m_cDecimalDelimiter('.')
- ,m_cThousandDelimiter(' ')
-{
- // Initialise m_aColumnAlias.
- m_aColumnAlias.setAlias(_pDriver->getFactory());
-}
-//-----------------------------------------------------------------------------
-OEvoabConnection::~OEvoabConnection()
-{
-}
-
-// XServiceInfo
-// --------------------------------------------------------------------------------
-IMPLEMENT_SERVICE_INFO(OEvoabConnection, "com.sun.star.sdbc.drivers.evoab.Connection", "com.sun.star.sdbc.Connection")
-
-//-----------------------------------------------------------------------------
-void OEvoabConnection::construct(const ::rtl::OUString& url,const Sequence< PropertyValue >& info) throw(SQLException)
-{
- osl_incrementInterlockedCount( &m_refCount );
- EVO_TRACE_STRING("OEvoabConnection::construct()::url = %s\n", url );
-
-
- ::rtl::OUString aCLICommand = getDriver()->getEvoab_CLI_EffectiveCommand();
- ::rtl::OUString aWorkingDirPath = getDriver()->getWorkingDirPath();
- ::rtl::OUString aArg1 = ::rtl::OUString::createFromAscii(OEvoabDriver::getEVOAB_CLI_ARG_LIST_FOLDERS());
- ::rtl::OUString aArg2 = ::rtl::OUString::createFromAscii(OEvoabDriver::getEVOAB_CLI_ARG_OUTPUT_FILE_PREFIX());
- aArg2 += aWorkingDirPath;
- aArg2 += getDriver()->getEvoFolderListFileName();
- OArgumentList aArgs(2,&aArg1,&aArg2);
-
- EVO_TRACE_STRING("OEvoabConnection::construct()::aCLICommand = %s\n", aCLICommand );
- EVO_TRACE_STRING("OEvoabConnection::construct()::aWorkingDirPath = %s\n", aWorkingDirPath );
- EVO_TRACE_STRING("OEvoabConnection::construct()::aArg1 = %s\n", aArg1 );
- EVO_TRACE_STRING("OEvoabConnection::construct()::aArg2 = %s\n", aArg2 );
- OProcess aApp( aCLICommand,aWorkingDirPath);
- OSL_VERIFY_EQUALS(
- aApp.execute( (OProcess::TProcessOption)(OProcess::TOption_Hidden | OProcess::TOption_Wait | OProcess::TOption_SearchPath),aArgs),
- OProcess::E_None,
- "Error at execute evolution-addressbook-export to get VCards");
-
-
- Sequence<PropertyValue> aDriverParam;
- ::std::vector<PropertyValue> aParam;
-
- aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("EnableSQL92Check"), 0, Any(), PropertyState_DIRECT_VALUE));
- ::dbtools::OCharsetMap aLookupIanaName;
- ::dbtools::OCharsetMap::const_iterator aLookup = aLookupIanaName.find(RTL_TEXTENCODING_UTF8);
- aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("CharSet"), 0,
- makeAny((*aLookup).getIanaName()), PropertyState_DIRECT_VALUE));
- aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("Extension"), 0, makeAny(getDriver()->getFileExt()), PropertyState_DIRECT_VALUE));
- aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("HeaderLine"), 0, makeAny(m_bHeaderLine), PropertyState_DIRECT_VALUE));
- aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("FieldDelimiter"), 0, makeAny(::rtl::OUString(&m_cFieldDelimiter,1)), PropertyState_DIRECT_VALUE));
- aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("StringDelimiter"), 0, makeAny(::rtl::OUString(&m_cStringDelimiter,1)), PropertyState_DIRECT_VALUE));
- aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("DecimalDelimiter"), 0, makeAny(::rtl::OUString(&m_cDecimalDelimiter,1)), PropertyState_DIRECT_VALUE));
- aParam.push_back(PropertyValue(::rtl::OUString::createFromAscii("ThousandDelimiter"), 0, makeAny(::rtl::OUString(&m_cThousandDelimiter,1)), PropertyState_DIRECT_VALUE));
-
- // build a new parameter sequence from the original parameters, appended by the new parameters from above
- PropertyValue *pParams = aParam.empty() ? 0 : &aParam[0];
- aDriverParam = ::comphelper::concatSequences(
- info,
- Sequence< PropertyValue >( pParams, aParam.size() )
- );
-
- // transform "sdbc:address:evolution" part of URL to "sdbc:flat:file:///..."
- //
- sal_Int32 nLen = url.indexOf(':');
- nLen = url.indexOf(':',nLen+1);
- ::rtl::OUString aAddrbookURI(url.copy(nLen+1));
- // Get Scheme
- nLen = aAddrbookURI.indexOf(':');
- ::rtl::OUString aAddrbookScheme;
- if ( nLen == -1 )
- {
- // There isn't any subschema: - but could be just subschema
- if ( aAddrbookURI.getLength() > 0 )
- {
- aAddrbookScheme= aAddrbookURI;
- }
- else
- {
- OSL_TRACE( "No subschema given!!!\n");
- throwGenericSQLException(STR_URI_SYNTAX_ERROR ,*this);
- }
- }
- else
- {
- aAddrbookScheme = aAddrbookURI.copy(0, nLen);
- }
-
- EVO_TRACE_STRING("OEvoabConnection::construct()::URI = %s\n", aAddrbookURI );
- EVO_TRACE_STRING("OEvoabConnection::construct()::Scheme = %s\n", aAddrbookScheme );
-
- //
- // Now we have a URI convert it to a Evolution CLI flat file URI
- //
- // The Mapping being used is:
- //
- // * for Evolution
- // "sdbc:address:evolution:" -> "sdbc:flat:file:///(file path generated)
-
- rtl::OUString aEvoFlatURI;
- if ( aAddrbookScheme.compareToAscii( OEvoabDriver::getSDBC_SCHEME_EVOLUTION() ) == 0 )
- {
- aEvoFlatURI = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "sdbc:flat:" ));
- }
-
-
- aEvoFlatURI += getDriver()->getWorkingDirURL();
- EVO_TRACE_STRING("OEvoabConnection::construct()::m_aEvoFlatURI = %s\n", aEvoFlatURI );
- //setURL(aEvoFlatURI);
- m_aEvoFlatURI = aEvoFlatURI;
-
- osl_decrementInterlockedCount( &m_refCount );
- OConnection::construct(aEvoFlatURI,aDriverParam);
-}
-// --------------------------------------------------------------------------------
-Reference< XDatabaseMetaData > SAL_CALL OEvoabConnection::getMetaData( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_B::rBHelper.bDisposed);
-
-
- Reference< XDatabaseMetaData > xMetaData = m_xMetaData;
- if(!xMetaData.is())
- {
- xMetaData = new OEvoabDatabaseMetaData(this);
- m_xMetaData = xMetaData;
- }
-
- return xMetaData;
-}
-//------------------------------------------------------------------------------
-::com::sun::star::uno::Reference< XTablesSupplier > OEvoabConnection::createCatalog()
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- Reference< XTablesSupplier > xTab = m_xCatalog;
- if(!xTab.is())
- {
- OEvoabCatalog *pCat = new OEvoabCatalog(this);
- xTab = pCat;
- m_xCatalog = xTab;
- }
- return xTab;
-}
-// --------------------------------------------------------------------------------
-Reference< XStatement > SAL_CALL OEvoabConnection::createStatement( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_B::rBHelper.bDisposed);
-
- OEvoabStatement* pStmt = new OEvoabStatement(this);
-
- Reference< XStatement > xStmt = pStmt;
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return xStmt;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OEvoabConnection::prepareStatement( const ::rtl::OUString& sql ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- checkDisposed(OConnection_B::rBHelper.bDisposed);
-
-
- OEvoabPreparedStatement* pStmt = new OEvoabPreparedStatement(this);
- Reference< XPreparedStatement > xStmt = pStmt;
- pStmt->construct(sql);
-
- m_aStatements.push_back(WeakReferenceHelper(*pStmt));
- return xStmt;
-}
-// --------------------------------------------------------------------------------
-Reference< XPreparedStatement > SAL_CALL OEvoabConnection::prepareCall( const ::rtl::OUString& /*sql*/ ) throw(SQLException, RuntimeException)
-{
- ::dbtools::throwFeatureNotImplementedException( "XConnection::prepareCall", *this );
- return NULL;
-}
-// -------------------------------------------------------------------------
diff --git a/connectivity/source/drivers/evoab/LConnection.hxx b/connectivity/source/drivers/evoab/LConnection.hxx
deleted file mode 100644
index 492056c..0000000
--- a/connectivity/source/drivers/evoab/LConnection.hxx
+++ /dev/null
@@ -1,78 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_LCONNECTION_HXX_
-#define _CONNECTIVITY_EVOAB_LCONNECTION_HXX_
-
-#include "LDriver.hxx"
-#include "file/FConnection.hxx"
-#include "LColumnAlias.hxx"
-
-namespace connectivity
-{
- namespace evoab
- {
- class OEvoabConnection : public file::OConnection
- {
- private:
- OColumnAlias m_aColumnAlias;
- sal_Bool m_bHeaderLine; // column names in first row
- sal_Unicode m_cFieldDelimiter; // look at the name
- sal_Unicode m_cStringDelimiter; // delimiter for strings m_cStringDelimiter blabla m_cStringDelimiter
- sal_Unicode m_cDecimalDelimiter; // Dezimal-delimiter (Dezimalpoint)
- sal_Unicode m_cThousandDelimiter; //
- rtl::OUString m_aEvoFlatURI;
-
- public:
- OEvoabConnection(OEvoabDriver* _pDriver);
- virtual ~OEvoabConnection();
-
- virtual void construct(const ::rtl::OUString& _rUrl,const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& _rInfo ) throw( ::com::sun::star::sdbc::SQLException);
-
- // own methods
- inline const OEvoabDriver* getDriver() const { return static_cast< const OEvoabDriver* >( m_pDriver ); }
- inline sal_Bool isHeaderLine() const { return m_bHeaderLine; }
- inline sal_Unicode getFieldDelimiter() const { return m_cFieldDelimiter; }
- inline sal_Unicode getStringDelimiter() const { return m_cStringDelimiter; }
- inline sal_Unicode getDecimalDelimiter() const { return m_cDecimalDelimiter; }
- inline sal_Unicode getThousandDelimiter() const { return m_cThousandDelimiter;}
- const OColumnAlias& getColumnAlias() const { return m_aColumnAlias; }
-
- // XServiceInfo
- DECLARE_SERVICE_INFO();
-
- // XConnection
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbcx::XTablesSupplier > createCatalog();
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString& sql ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
-
- };
- }
-}
-#endif // _CONNECTIVITY_EVOAB_LCONNECTION_HXX_
diff --git a/connectivity/source/drivers/evoab/LDatabaseMetaData.cxx b/connectivity/source/drivers/evoab/LDatabaseMetaData.cxx
deleted file mode 100644
index e0cb7b8..0000000
--- a/connectivity/source/drivers/evoab/LDatabaseMetaData.cxx
+++ /dev/null
@@ -1,391 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "LDatabaseMetaData.hxx"
-#include "LConnection.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/beans/XFastPropertySet.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
-#include <com/sun/star/ucb/XContentAccess.hpp>
-#ifndef _COM_SUN_STAR_SQLC_XROW_HPP_
-#include <com/sun/star/sdbc/XRow.hpp>
-#endif
-#include <tools/urlobj.hxx>
-#include "FDatabaseMetaDataResultSet.hxx"
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <comphelper/extract.hxx>
-#include <comphelper/types.hxx>
-#include "LFolderList.hxx"
-#include "connectivity/CommonTools.hxx"
-#include <vos/process.hxx>
-#include <osl/process.h>
-#include <tools/debug.hxx>
-#include <map>
-#include <vector>
-
-#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
-#include "LDebug.hxx"
-#endif
-#include "diagnose_ex.h"
-
-using namespace ::comphelper;
-using namespace connectivity;
-using namespace connectivity::evoab;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
-using namespace ::com::sun::star::ucb;
-using namespace osl;
-using namespace vos;
-
-namespace connectivity
-{
- namespace evoab
- {
- static sal_Int32 const s_nCOLUMN_SIZE = 256;
- static sal_Int32 const s_nDECIMAL_DIGITS = 0;
- static sal_Int32 const s_nNULLABLE = 1;
- static sal_Int32 const s_nCHAR_OCTET_LENGTH = 65535;
- }
-}
-
-OEvoabDatabaseMetaData::OEvoabDatabaseMetaData(::connectivity::file::OConnection* _pCon) :ODatabaseMetaData(_pCon)
-{
-}
-// -------------------------------------------------------------------------
-OEvoabDatabaseMetaData::~OEvoabDatabaseMetaData()
-{
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > OEvoabDatabaseMetaData::impl_getTypeInfo_throw( )
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eTypeInfo);
- Reference< XResultSet > xRef = pResult;
- static ODatabaseMetaDataResultSet::ORows aRows;
- if(aRows.empty())
- {
- ODatabaseMetaDataResultSet::ORow aRow;
-
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator(::rtl::OUString::createFromAscii("CHAR")));
- aRow.push_back(new ORowSetValueDecorator(DataType::CHAR));
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)254));
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getQuoteValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnValue::NULLABLE));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)ColumnSearch::CHAR));
- aRow.push_back(ODatabaseMetaDataResultSet::get1Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::get0Value());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRow.push_back(new ORowSetValueDecorator((sal_Int32)10));
-
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("VARCHAR"));
- aRow[2] = new ORowSetValueDecorator(DataType::VARCHAR);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("LONGVARCHAR"));
- aRow[2] = new ORowSetValueDecorator(DataType::LONGVARCHAR);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)65535);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("DATE"));
- aRow[2] = new ORowSetValueDecorator(DataType::DATE);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)10);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIME"));
- aRow[2] = new ORowSetValueDecorator(DataType::TIME);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)8);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("TIMESTAMP"));
- aRow[2] = new ORowSetValueDecorator(DataType::TIMESTAMP);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)19);
- aRow[4] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRow[5] = ODatabaseMetaDataResultSet::getQuoteValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("BOOL"));
- aRow[2] = new ORowSetValueDecorator(DataType::BIT);
- aRow[3] = ODatabaseMetaDataResultSet::get1Value();
- aRow[9] = ODatabaseMetaDataResultSet::getBasicValue();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("DECIMAL"));
- aRow[2] = new ORowSetValueDecorator(DataType::DECIMAL);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[15] = new ORowSetValueDecorator((sal_Int32)15);
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("DOUBLE"));
- aRow[2] = new ORowSetValueDecorator(DataType::DOUBLE);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[15] = ODatabaseMetaDataResultSet::get0Value();
- aRows.push_back(aRow);
-
- aRow[1] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("NUMERIC"));
- aRow[2] = new ORowSetValueDecorator(DataType::NUMERIC);
- aRow[3] = new ORowSetValueDecorator((sal_Int32)20);
- aRow[15] = new ORowSetValueDecorator((sal_Int32)20);
- aRows.push_back(aRow);
- }
-
- pResult->setRows(aRows);
- return xRef;
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getColumns(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/, const ::rtl::OUString& tableNamePattern,
- const ::rtl::OUString& columnNamePattern ) throw(SQLException, RuntimeException)
-{
- OSL_TRACE("OEvoabDatabaseMetaData::getColumns()::Entered\n");
- EVO_TRACE_STRING("OEvoabDatabaseMetaData::getColumns()::schemaPattern = %s\n", schemaPattern );
- EVO_TRACE_STRING("OEvoabDatabaseMetaData::getColumns()::tableNamePattern = %s\n", tableNamePattern );
- EVO_TRACE_STRING("OEvoabDatabaseMetaData::getColumns()::columnNamePattern = %s\n", columnNamePattern );
-
- ::osl::MutexGuard aGuard( m_aMutex );
-
- Reference< XTablesSupplier > xTables = m_pConnection->createCatalog();
- if(!xTables.is())
- throw SQLException();
-
- Reference< XNameAccess> xNames = xTables->getTables();
- if(!xNames.is())
- throw SQLException();
-
- ODatabaseMetaDataResultSet::ORows aRows;
- ODatabaseMetaDataResultSet::ORow aRow(19);
- aRow[10] = new ORowSetValueDecorator((sal_Int32)10);
- Sequence< ::rtl::OUString> aTabNames(xNames->getElementNames());
- const ::rtl::OUString* pTabBegin = aTabNames.getConstArray();
- const ::rtl::OUString* pTabEnd = pTabBegin + aTabNames.getLength();
- for(;pTabBegin != pTabEnd;++pTabBegin)
- {
- if(match(tableNamePattern,*pTabBegin,'\0'))
- {
- Reference< XColumnsSupplier> xTable;
- ::cppu::extractInterface(xTable,xNames->getByName(*pTabBegin));
- aRow[3] = new ORowSetValueDecorator(*pTabBegin);
-
- Reference< XNameAccess> xColumns = xTable->getColumns();
- if(!xColumns.is())
- throw SQLException();
-
- Sequence< ::rtl::OUString> aColNames(xColumns->getElementNames());
-
- const ::rtl::OUString* pBegin = aColNames.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + aColNames.getLength();
- Reference< XPropertySet> xColumn;
- for(sal_Int32 i=1;pBegin != pEnd;++pBegin,++i)
- {
- if(match(columnNamePattern,*pBegin,'\0'))
- {
- aRow[4] = new ORowSetValueDecorator(*pBegin);
-
- ::cppu::extractInterface(xColumn,xColumns->getByName(*pBegin));
- OSL_ENSURE(xColumn.is(),"Columns contains a column who isn't a fastpropertyset!");
- aRow[5] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE))));
- aRow[6] = new ORowSetValueDecorator(getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPENAME))));
- aRow[7] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_PRECISION))));
- aRow[9] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE))));
- aRow[11] = new ORowSetValueDecorator(getINT32(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_ISNULLABLE))));
- aRow[13] = new ORowSetValueDecorator(getString(xColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_DEFAULTVALUE))));
-
- switch((sal_Int32)aRow[5]->getValue())
- {
- case DataType::CHAR:
- case DataType::VARCHAR:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)254);
- break;
- case DataType::LONGVARCHAR:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)65535);
- break;
- default:
- aRow[16] = new ORowSetValueDecorator((sal_Int32)0);
- }
- aRow[17] = new ORowSetValueDecorator(i);
- switch(sal_Int32(aRow[11]->getValue()))
- {
- case ColumnValue::NO_NULLS:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("NO"));
- break;
- case ColumnValue::NULLABLE:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString::createFromAscii("YES"));
- break;
- default:
- aRow[18] = new ORowSetValueDecorator(::rtl::OUString());
- }
- aRows.push_back(aRow);
- }
- }
- }
- }
-
- ::connectivity::ODatabaseMetaDataResultSet* pResult = new ::connectivity::ODatabaseMetaDataResultSet(::connectivity::ODatabaseMetaDataResultSet::eColumns);
- Reference< XResultSet > xRef = pResult;
- pResult->setRows(aRows);
-
- return xRef;
-}
-// -------------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDatabaseMetaData::getURL( ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:flat:")) + m_pConnection->getURL();
-}
-// -------------------------------------------------------------------------
-Reference< XResultSet > SAL_CALL OEvoabDatabaseMetaData::getTables(
- const Any& /*catalog*/, const ::rtl::OUString& /*schemaPattern*/,
- const ::rtl::OUString& /*tableNamePattern*/, const Sequence< ::rtl::OUString >& types ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
-
-
- ODatabaseMetaDataResultSet* pResult = new ODatabaseMetaDataResultSet(ODatabaseMetaDataResultSet::eTables);
- Reference< XResultSet > xRef = pResult;
-
- // check if any type is given
- // when no types are given then we have to return all tables e.g. TABLE
-
- static const ::rtl::OUString aTable(::rtl::OUString::createFromAscii("TABLE"));
-
- sal_Bool bTableFound = sal_True;
- sal_Int32 nLength = types.getLength();
- if(nLength)
- {
- bTableFound = sal_False;
-
- const ::rtl::OUString* pBegin = types.getConstArray();
- const ::rtl::OUString* pEnd = pBegin + nLength;
- for(;pBegin != pEnd;++pBegin)
- {
- if(*pBegin == aTable)
- {
- bTableFound = sal_True;
- break;
- }
- }
- }
- if(!bTableFound)
- return xRef;
-
- OEvoabConnection* pOEvoabConnection = (OEvoabConnection*)m_pConnection;
- OEvoabFolderList* pFolderList = new OEvoabFolderList( pOEvoabConnection );
-
-
- ODatabaseMetaDataResultSet::ORows aRows;
- sal_Bool bMoreData = sal_True;
- ::rtl::OUString aName, aLocation;
- sal_Int32 nCardsCount;
-
- pFolderList->initializeRow(3);
- bMoreData = pFolderList->first();
- OSL_TRACE("OEvoabDatabaseMetaData::getTables()::first %d\n",bMoreData );
- do
- {
- if(bMoreData)
- bMoreData = pFolderList->getRow();
- if(bMoreData)
- {
- aLocation = pFolderList->getString(1);
- aName = pFolderList->getString(2);
- nCardsCount = pFolderList->getInt(3);
- EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aLocation = %s\n", aLocation );
- EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aName = %s\n", aName );
- OSL_TRACE("OEvoabDatabaseMetaData::getTables()::nCardsCount = %d\n", nCardsCount);
-
- ODatabaseMetaDataResultSet::ORow aRow(3);
- aRow.reserve(6);
- aRow.push_back(new ORowSetValueDecorator(aName));
- aRow.push_back(new ORowSetValueDecorator(aTable));
- aRow.push_back(ODatabaseMetaDataResultSet::getEmptyValue());
- aRows.push_back(aRow);
-
- ::rtl::OUString aWorkingDir = pOEvoabConnection->getDriver()->getWorkingDirPath();
- ::rtl::OUString aCLICommand = pOEvoabConnection->getDriver()->getEvoab_CLI_EffectiveCommand();
- ::rtl::OUString aArg1 = aLocation;
- ::rtl::OUString aArg2 = ::rtl::OUString::createFromAscii(pOEvoabConnection->getDriver()->getEVOAB_CLI_ARG_OUTPUT_FILE_PREFIX());
- aArg2 += aWorkingDir;
- aArg2 += aName;
- aArg2 += ::rtl::OUString::createFromAscii(".");
- aArg2 += ::rtl::OUString(pOEvoabConnection->getExtension());
- ::rtl::OUString aArg3 = ::rtl::OUString::createFromAscii(pOEvoabConnection->getDriver()->getEVOAB_CLI_ARG_OUTPUT_FORMAT());
-
- OArgumentList aArgs(3,&aArg1,&aArg2,&aArg3);
-
- EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aCLICommand = %s\n", aCLICommand );
- EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aWorkingDir = %s\n", aWorkingDir );
- EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aArg1 = %s\n", aArg1 );
- EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aArg2 = %s\n", aArg2 );
- EVO_TRACE_STRING( "OEvoabDatabaseMetaData::getTables()::aArg3 = %s\n", aArg3 );
-
- OProcess aApp( aCLICommand,aWorkingDir);
- OSL_VERIFY_EQUALS(
- aApp.execute( (OProcess::TProcessOption)(OProcess::TOption_Hidden | OProcess::TOption_Wait | OProcess::TOption_SearchPath),aArgs),
- OProcess::E_None,
- "Error at execute evolution-addressbook-exporter to get VCards" );
-
- bMoreData = pFolderList->next();
- }
- }
- while ( bMoreData );
-
- delete pFolderList;
- pFolderList = NULL;
-
- pResult->setRows(aRows);
-
- return xRef;
-}
diff --git a/connectivity/source/drivers/evoab/LDatabaseMetaData.hxx b/connectivity/source/drivers/evoab/LDatabaseMetaData.hxx
deleted file mode 100644
index dc8155d..0000000
--- a/connectivity/source/drivers/evoab/LDatabaseMetaData.hxx
+++ /dev/null
@@ -1,56 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _CONNECTIVITY_EVOAB_LDATABASEMETADATA_HXX_
-#define _CONNECTIVITY_EVOAB_LDATABASEMETADATA_HXX_
-
-#include "file/FDatabaseMetaData.hxx"
-#include "FDatabaseMetaDataResultSet.hxx"
-
-namespace connectivity
-{
- namespace evoab
- {
- //**************************************************************
- //************ Class: java.sql.DatabaseMetaDataDate
- //**************************************************************
-
- class OEvoabDatabaseMetaData : public file::ODatabaseMetaData
- {
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > impl_getTypeInfo_throw();
- virtual ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getColumns( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::rtl::OUString& columnNamePattern ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > SAL_CALL getTables( const ::com::sun::star::uno::Any& catalog, const ::rtl::OUString& schemaPattern, const ::rtl::OUString& tableNamePattern, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& types ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
- protected:
- virtual ~OEvoabDatabaseMetaData();
- public:
- OEvoabDatabaseMetaData(file::OConnection* _pCon);
- };
- }
-}
-#endif // _CONNECTIVITY_EVOAB_LDATABASEMETADATA_HXX_
-
diff --git a/connectivity/source/drivers/evoab/LDebug.cxx b/connectivity/source/drivers/evoab/LDebug.cxx
deleted file mode 100644
index c284deb..0000000
--- a/connectivity/source/drivers/evoab/LDebug.cxx
+++ /dev/null
@@ -1,42 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-
-#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
-#include "LDebug.hxx"
-#endif
-#include <osl/diagnose.h>
-
-void evo_traceStringMessage( const sal_Char* _pFormat, const ::rtl::OUString& _rAsciiString )
-{
- ::rtl::OString sByteStringMessage( _rAsciiString.getStr(), _rAsciiString.getLength(), RTL_TEXTENCODING_ASCII_US );
- if ( !sByteStringMessage.getLength() )
- sByteStringMessage = "<empty>";
- OSL_TRACE( _pFormat, sByteStringMessage.getStr() );
-}
diff --git a/connectivity/source/drivers/evoab/LDebug.hxx b/connectivity/source/drivers/evoab/LDebug.hxx
deleted file mode 100644
index 0cfc8f3..0000000
--- a/connectivity/source/drivers/evoab/LDebug.hxx
+++ /dev/null
@@ -1,42 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
-#define CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
-
-#include <rtl/ustring.hxx>
-
-#ifdef _DEBUG
- void evo_traceStringMessage( const sal_Char* _pFormat, const ::rtl::OUString& _rAsciiString );
-
- #define EVO_TRACE_STRING( pFormat, rAsciiString ) evo_traceStringMessage( pFormat, rAsciiString )
-#else
- #define EVO_TRACE_STRING( pFormat, rAsciiString ) (void)(0)
-#endif
-
-
-#endif // CONNECTIVITY_EVOAB_DEBUG_HELPER_HXX
diff --git a/connectivity/source/drivers/evoab/LDriver.cxx b/connectivity/source/drivers/evoab/LDriver.cxx
deleted file mode 100644
index 192cf9c..0000000
--- a/connectivity/source/drivers/evoab/LDriver.cxx
+++ /dev/null
@@ -1,505 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org 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 version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_connectivity.hxx"
-#include "LDriver.hxx"
-#include "LConnection.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
-#include "connectivity/dbexception.hxx"
-#include "LConfigAccess.hxx"
-#include <osl/file.hxx>
-#include "osl/security.hxx"
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/ucb/XCommandEnvironment.hpp>
-#include <ucbhelper/content.hxx>
-#include <tools/debug.hxx>
-#include "resource/common_res.hrc"
-#include "resource/sharedresources.hxx"
-#include "LDebug.hxx"
-
-using namespace osl;
-using namespace connectivity::evoab;
-using namespace connectivity::file;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::sdbcx;
-using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::ucb;
-
-// --------------------------------------------------------------------------------
-OEvoabDriver::OEvoabDriver(const Reference< XMultiServiceFactory >& _rxFactory) : OFileDriver(_rxFactory)
- ,m_aTempDir(NULL, sal_True)
- ,m_aFolderListName(::rtl::OUString::createFromAscii(getEVOAB_FOLDERLIST_FILE_NAME()))
- ,m_aVersionName(::rtl::OUString::createFromAscii(getEVOAB_VERSION_FILE_NAME()))
- ,m_aFileExt(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(getEVOAB_META_FILE_EXT())))
- ,m_bWorkingDirCreated(sal_False)
- ,m_eSupportedEvoVersion( eUnknown )
-{
- m_aEvoab_CLI_FullPathCommand = getFullPathExportingCommand(_rxFactory);
-
- if ( m_aEvoab_CLI_FullPathCommand.getLength() == 0 )
- m_aEvoab_CLI_FullPathCommand = ::rtl::OUString::createFromAscii(getEVOAB_CLI_FULLPATHCOMMAND());
- if ( m_aEvoab_CLI_FullPathCommand.copy(0,7) != ::rtl::OUString::createFromAscii("file://") && m_aEvoab_CLI_FullPathCommand.copy(0,1) == ::rtl::OUString::createFromAscii("/"))
- m_aEvoab_CLI_FullPathCommand = ::rtl::OUString::createFromAscii("file://") + m_aEvoab_CLI_FullPathCommand;
- m_aEvoab_CLI_EffectiveCommand = m_aEvoab_CLI_FullPathCommand;
- m_aTempDir.EnableKillingFile();
-
- EVO_TRACE_STRING("OEvoabDriver::OEvoabDriver()::m_aEvoab_CLI_FullPathCommand = %s", m_aEvoab_CLI_FullPathCommand );
-}
-// static ServiceInfo
-//------------------------------------------------------------------------------
-rtl::OUString OEvoabDriver::getImplementationName_Static( ) throw(RuntimeException)
-{
- return rtl::OUString::createFromAscii(EVOAB_DRIVER_IMPL_NAME);
-}
-
-//------------------------------------------------------------------
-::rtl::OUString SAL_CALL OEvoabDriver::getImplementationName( ) throw(RuntimeException)
-{
- return getImplementationName_Static();
-}
-
-//------------------------------------------------------------------
-::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL connectivity::evoab::OEvoabDriver_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory) throw( ::com::sun::star::uno::Exception )
-{
- return *(new OEvoabDriver(_rxFactory));
-}
-// --------------------------------------------------------------------------------
-Reference< XConnection > SAL_CALL OEvoabDriver::connect( const ::rtl::OUString& url, const Sequence< PropertyValue >& info ) throw(SQLException, RuntimeException)
-{
- ::osl::MutexGuard aGuard( m_aMutex );
- if (ODriver_BASE::rBHelper.bDisposed)
- throw DisposedException();
-
- if ( ! acceptsURL(url) )
- return NULL;
-
- OEvoabConnection* pCon = new OEvoabConnection(this);
- pCon->construct(url,info);
- Reference< XConnection > xCon = pCon;
- m_xConnections.push_back(WeakReferenceHelper(*pCon));
-
- return xCon;
-}
-// --------------------------------------------------------------------------------
-namespace
-{
- ::rtl::OUString lcl_translateProcessErrorMessage( oslProcessError nProcErr)
- {
- ::rtl::OUString sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" not executed!."));
- switch (nProcErr)
- {
- case osl_Process_E_None:
- sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed sucessful!"));
- break;
- case osl_Process_E_NotFound:
- sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: not found!"));
- break;
- case osl_Process_E_NoPermission:
- sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: has no permission!"));
- break;
- case osl_Process_E_TimedOut:
- sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: time out!"));
- break;
- case osl_Process_E_Unknown:
- sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: unkown reason!"));
- break;
- case osl_Process_E_InvalidError:
- sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: invalid error!"));
- break;
- default:
- sProcErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" executed failed: other reason!"));
- }
- return sProcErr;
- }
- oslProcessError lcl_execute( const ::rtl::OUString& _rCommand, ::rtl::OUString& _rArgument,
- const ::rtl::OUString& _rWorkingDir, oslProcessOption _nOptions, oslFileHandle& /*[out]*/ _hStdOut )
- {
- oslProcessError nError = osl_Process_E_None;
-
- EVO_TRACE_STRING("LDriver.cxx::lcl_execute: command : %s", _rCommand );
- EVO_TRACE_STRING("LDriver.cxx::lcl_execute: argument : %s", _rArgument );
- EVO_TRACE_STRING("LDriver.cxx::lcl_execute: working dir: %s", _rWorkingDir );
-
- oslProcess hProcess( 0 );
-
- nError = osl_executeProcess_WithRedirectedIO(
- _rCommand.pData,
- &_rArgument.pData,
- 1,
- _nOptions,
- 0,
- _rWorkingDir.pData,
- 0,
- 0,
- &hProcess,
- NULL,
- &_hStdOut,
- NULL
- );
- ::rtl::OUString sError = _rCommand + lcl_translateProcessErrorMessage( nError);
- EVO_TRACE_STRING( "%s", sError );
-
- if ( nError == osl_Process_E_None )
- {
- TimeValue aFiveSeconds;
- aFiveSeconds.Seconds = 5;
- aFiveSeconds.Nanosec = 0;
- oslProcessError nWaitForProcessError = osl_joinProcessWithTimeout( hProcess, &aFiveSeconds );
- if ( osl_Process_E_None != nWaitForProcessError )
- {
- nError = nWaitForProcessError;
- // TODO: kill the running process?
- }
- osl_freeProcessHandle( hProcess );
- }
- return nError;
- }
-}
-
-// --------------------------------------------------------------------------------
-sal_Bool SAL_CALL OEvoabDriver::acceptsURL( const ::rtl::OUString& url )
- throw(SQLException, RuntimeException)
-{
- sal_Bool bRet;
- bRet = sal_False;
- // here we have to look if we support this url format
- if(acceptsURL_Stat(url))
- {
- if ( m_eSupportedEvoVersion != eUnknown )
- return m_eSupportedEvoVersion == eTrue ? sal_True : sal_False;
-
- if(!m_bWorkingDirCreated)
- {
- String sTempDirURL = getTempDirURL();
- //EVO_TRACE_STRING("OEvoabDriver::acceptsURL()::sTempDirURL = %s", sTempDirURL );
-
- ::rtl::OUString aTempDirURL(sTempDirURL);
- m_aWorkingDirURL = aTempDirURL;
- m_bWorkingDirCreated = sal_True;
- }
-
- ::rtl::OUString aCLICommand = getEvoab_CLI_EffectiveCommand();
- ::rtl::OUString aWorkingDirURL = getWorkingDirURL();
- ::rtl::OUString aArgVersion = ::rtl::OUString::createFromAscii(getEVOAB_CLI_ARG_VERSION());
-
- oslFileHandle hStdout = NULL;
- oslProcessError nProcErr = lcl_execute( aCLICommand, aArgVersion, aWorkingDirURL, 0, hStdout );
- if(nProcErr != osl_Process_E_None)
- {
- if(doesEvoab_CLI_HavePath())
- aCLICommand = getEvoab_CLI_Command();
- else
- aCLICommand = getEvoab_CLI_Path() + getEvoab_CLI_Command();
- nProcErr = lcl_execute( aCLICommand, aArgVersion, aWorkingDirURL, osl_Process_SEARCHPATH | osl_Process_HIDDEN, hStdout );
- if ( nProcErr == osl_Process_E_None )
- m_aEvoab_CLI_EffectiveCommand = aCLICommand;
- }
-
- if ( hStdout != NULL )
- {
- OSL_ASSERT( hStdout );
- sal_Char pBuffer[256];
- sal_uInt64 nBytesRead;
- oslFileError nFileErr = osl_File_E_None;
- nFileErr = osl_readFile( hStdout, pBuffer, 256, &nBytesRead);
- if ( nFileErr != osl_File_E_None )
- {
- ::rtl::OUString sErr = translateFileErrorMessage( nFileErr);
- OSL_ENSURE(false, ::rtl::OUStringToOString( sErr, RTL_TEXTENCODING_ASCII_US ).getStr());
- }
- ::rtl::OUString aVersionInfo;
- if ( nFileErr == osl_File_E_None && nBytesRead > 0 && nBytesRead <= 256)
- {
- OSL_TRACE("OEvoabDriver::acceptsURL()::osl_readFile(),nBytesRead = %u",nBytesRead);
- aVersionInfo =
- ::rtl::OUString( ( const sal_Char * )pBuffer,
- (sal_Int32)nBytesRead,
- RTL_TEXTENCODING_UTF8 );
- EVO_TRACE_STRING("OEvoabDriver::acceptsURL()::aVersionInfo = %s", aVersionInfo );
- sal_Int32 nIndex = 0;
- sal_Bool bNumRetrieved = sal_False;
- ::rtl::OUString aToken;
- sal_Int32 aVer[4];
- sal_Int32 i;
- for ( i = 0; i < 4; i++ )
- aVer[i] = 0;
- do
- {
- aToken = aVersionInfo.getToken( 0, ' ', nIndex );
- //OSL_TRACE("OEvoabDriver::acceptsURL()::Token:%d", nIndex );
- //EVO_TRACE_STRING("OEvoabDriver::acceptsURL()::aToken = %s", aToken );
- if( aToken.toChar() >= '0' && aToken.toChar() <= '9' )
- {
- bNumRetrieved = sal_True;
- sal_Int32 nIndex1 = 0;
- ::rtl::OUString aNum;
- for(i = 0; i < 4 ; i++)
- {
- if( nIndex1 >= 0 )
- {
- aNum = aToken.getToken( 0, '.', nIndex1);
- aVer[i] = aNum.toInt32();
- OSL_TRACE("OEvoabDriver::acceptsURL()::Ver[%u]=%u", i, aVer[i] );
- }
- }
- }
- }
- while ( nIndex >= 0 && !bNumRetrieved );
-
- if((aVer[0]>1)||(aVer[0]==1 && aVer[1]>3)||(aVer[0]==1 && aVer[1]==3 && aVer[2]>2)||(aVer[0]==1 && aVer[1]==3 && aVer[2]==2 && aVer[3]>=99))
- bRet = sal_True;
- else
- bRet = sal_False;
- }
- else
- bRet = sal_False;
-
- osl_closeFile( hStdout );
- }
- m_eSupportedEvoVersion = bRet ? eTrue : eFalse;
- }
- EVO_TRACE_STRING("OEvoabDriver::acceptsURL()::return, return value = %s", ::rtl::OUString::valueOf(bRet) );
- return bRet;
-}
-
-
-// --------------------------------------------------------------------------------
-sal_Bool OEvoabDriver::acceptsURL_Stat( const ::rtl::OUString& url )
-{
-
- EVO_TRACE_STRING("OEvoabDriver::acceptsURL_Stat()::Scheme = %s", url );
- // Skip 'sdbc:address: part of URL
- //
- sal_Int32 nLen = url.indexOf(':');
- nLen = url.indexOf(':',nLen+1);
- ::rtl::OUString aAddrbookURI(url.copy(nLen+1));
-
- // Get Scheme
- nLen = aAddrbookURI.indexOf(':');
- ::rtl::OUString aAddrbookScheme;
- if ( nLen == -1 )
- {
- // There isn't any subschema: - but could be just subschema
- if ( aAddrbookURI.getLength() > 0 )
- aAddrbookScheme= aAddrbookURI;
- else if(url == ::rtl::OUString::createFromAscii("sdbc:address:") )
- return sal_True; // special case here
- else
- return sal_False;
- }
- else
- aAddrbookScheme = aAddrbookURI.copy(0, nLen);
-
-
- EVO_TRACE_STRING("OEvoabDriver::acceptsURL_Stat()::URI = %s", aAddrbookURI );
- EVO_TRACE_STRING("OEvoabDriver::acceptsURL_Stat()::Scheme = %s", aAddrbookScheme );
-
- return aAddrbookScheme.compareToAscii( getSDBC_SCHEME_EVOLUTION() ) == 0 ;
-}
-// -------------------------------------------------------------------------
-const rtl::OUString OEvoabDriver::getEvoab_CLI_Command() const
-{
- rtl::OUString aEvoab_CLI_Command;
- sal_Int32 nLen = m_aEvoab_CLI_FullPathCommand.lastIndexOf('/');
-
- if ( nLen == -1 )
- aEvoab_CLI_Command = m_aEvoab_CLI_FullPathCommand;
- else
- aEvoab_CLI_Command = m_aEvoab_CLI_FullPathCommand.copy(nLen+1);
-
- EVO_TRACE_STRING( "OEvoabDriver::getEvoab_CLI_Command()::aEvoab_CLI_Command = %s", aEvoab_CLI_Command );
-
- return aEvoab_CLI_Command;
-}
-// -------------------------------------------------------------------------
-const rtl::OUString OEvoabDriver::getEvoab_CLI_Path() const
-{
- rtl::OUString aEvoab_CLI_Path;
- sal_Int32 nLen = m_aEvoab_CLI_FullPathCommand.lastIndexOf('/');
-
- if ( nLen == -1 )
- {
- rtl::OUString aDefault_CLI_FullPathCommand;
- aDefault_CLI_FullPathCommand = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(OEvoabDriver::getEVOAB_CLI_FULLPATHCOMMAND()));
- sal_Int32 nLength = aDefault_CLI_FullPathCommand.lastIndexOf('/');
- aEvoab_CLI_Path = aDefault_CLI_FullPathCommand.copy(0, nLength+1);
- }
- else
- aEvoab_CLI_Path = m_aEvoab_CLI_FullPathCommand.copy(0, nLen+1);
- EVO_TRACE_STRING( "OEvoabDriver::getEvoab_CLI_Path()::aEvoab_CLI_Path = %s", aEvoab_CLI_Path );
-
- return aEvoab_CLI_Path;
-}
-// -------------------------------------------------------------------------
-const rtl::OUString OEvoabDriver::getWorkingDirPath() const
-{
- ::rtl::OUString aWorkingDirPath;
- if(m_bWorkingDirCreated)
- osl::File::getSystemPathFromFileURL( m_aWorkingDirURL, aWorkingDirPath );
- return aWorkingDirPath;
-}
-// -------------------------------------------------------------------------
-const String OEvoabDriver::getEvoFolderListFileURL() const
-{
-
- ::rtl::OUString aEvoFolderListFileURL;
- aEvoFolderListFileURL = getWorkingDirURL() + getEvoFolderListFileName();
-
- EVO_TRACE_STRING("OEvoabDriver::getEvoFolderListFileURL(): aEvoFolderListFileURL = %s", aEvoFolderListFileURL );
- return aEvoFolderListFileURL.getStr();
-}
-
-// -------------------------------------------------------------------------
-String OEvoabDriver::getTempDirURL() const
-{
- ::rtl::OUString aTempDirURL;
- aTempDirURL = m_aTempDir.GetURL();
- if((aTempDirURL.lastIndexOf( '/')) != (aTempDirURL.getLength( ) - 1))
- aTempDirURL += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
-
- EVO_TRACE_STRING("OEvoabDriver::getTempDirURL(): aTempDirURL = %s", aTempDirURL );
- return aTempDirURL.getStr();
-}
-//-------------------------------------------------------------------------
-sal_Bool OEvoabDriver::fileExists(const ::rtl::OUString& _rURL, sal_Bool _bIsDir) const
-{
- ::ucbhelper::Content aCheckExistence;
- sal_Bool bExists = sal_False;
- try
- {
- aCheckExistence = ::ucbhelper::Content(_rURL, Reference< XCommandEnvironment >());
- if(_bIsDir)
- bExists = aCheckExistence.isFolder();
- else
- bExists = aCheckExistence.isDocument();
- }
- catch(const Exception&) { }
- return bExists;
-}
-
-// -----------------------------------------------------------------------------
-const sal_Char* OEvoabDriver::getSDBC_SCHEME_EVOLUTION()
-{
- static const sal_Char* SDBC_SCHEME_EVOLUTION = EVOAB_EVOLUTION_SCHEMA;
- return SDBC_SCHEME_EVOLUTION;
-}
-const sal_Char* OEvoabDriver::getEVOAB_FOLDERLIST_FILE_NAME()
-{
- static const sal_Char* EVOAB_FOLDERLIST_FILE_NAME = "FolderList";
- return EVOAB_FOLDERLIST_FILE_NAME;
-}
-const sal_Char* OEvoabDriver::getEVOAB_VERSION_FILE_NAME()
-{
- static const sal_Char* EVOAB_VERSION_FILE_NAME = "EvoVersion";
- return EVOAB_VERSION_FILE_NAME;
-}
-const sal_Char* OEvoabDriver::getEVOAB_META_FILE_EXT()
-{
- static const sal_Char* EVOAB_META_FILE_EXT = "csv";
- return EVOAB_META_FILE_EXT;
-}
-const sal_Char* OEvoabDriver::getEVOAB_CLI_FULLPATHCOMMAND()
-{
- static const sal_Char* EVOAB_CLI_FULLPATHCOMMAND = "file:///home/evoab/extra/share/evolution/*/tools/evolution-addressbook-export";
- return EVOAB_CLI_FULLPATHCOMMAND;
-}
-const sal_Char* OEvoabDriver::getEVOAB_CLI_ARG_LIST_FOLDERS()
-{
- static const sal_Char* EVOAB_CLI_ARG_LIST_FOLDERS = "-l";
- return EVOAB_CLI_ARG_LIST_FOLDERS;
-}
-const sal_Char* OEvoabDriver::getEVOAB_CLI_ARG_OUTPUT_FILE_PREFIX()
-{
- static const sal_Char* EVOAB_CLI_ARG_OUTPUT_FILE_PREFIX = "--output=";
- return EVOAB_CLI_ARG_OUTPUT_FILE_PREFIX;
-}
-const sal_Char* OEvoabDriver::getEVOAB_CLI_ARG_OUTPUT_FORMAT()
-{
- static const sal_Char* EVOAB_CLI_ARG_OUTPUT_FORMAT = "--format=csv";
- return EVOAB_CLI_ARG_OUTPUT_FORMAT;
-}
-const sal_Char* OEvoabDriver::getEVOAB_CLI_ARG_VERSION()
-{
- static const sal_Char* EVOAB_CLI_ARG_VERSION = "--version";
- return EVOAB_CLI_ARG_VERSION;
-}
-const sal_Char* OEvoabDriver::getEVOAB_CLI_ARG_OUTPUT_REDIRECT()
-{
- static const sal_Char* EVOAB_CLI_ARG_OUTPUT_REDIRECT = ">";
- return EVOAB_CLI_ARG_OUTPUT_REDIRECT;
-}
-rtl::OUString OEvoabDriver::translateFileErrorMessage( oslFileError nFileErr)
-{
- ::rtl::OUString sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" no file operation!."));
- switch (nFileErr)
- {
- case osl_File_E_None:
- sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation succeeded!"));
- break;
- case osl_File_E_INVAL:
- sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: the format of the parameters was not valid!"));
- break;
- case osl_File_E_INTR:
- sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: function call was interrupted!"));
- break;
- case osl_File_E_IO:
- sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: I/O errors!"));
- break;
- case osl_File_E_ISDIR:
- sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: is a directory!"));
- break;
- case osl_File_E_BADF:
- sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: bad file!"));
- break;
- case osl_File_E_FAULT:
- sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: bad address!"));
- break;
- case osl_File_E_AGAIN:
- sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: operation would block!"));
- break;
- case osl_File_E_NOLINK:
- sFileErr = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" File operation failed: link has been severed!"));
- break;
- default:
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list