summaryrefslogtreecommitdiff
path: root/ucbhelper/source
diff options
context:
space:
mode:
Diffstat (limited to 'ucbhelper/source')
-rw-r--r--ucbhelper/source/client/makefile.mk60
-rw-r--r--ucbhelper/source/provider/configureucb.cxx242
-rw-r--r--ucbhelper/source/provider/makefile.mk70
-rw-r--r--ucbhelper/source/provider/provconf.cxx256
-rw-r--r--ucbhelper/source/provider/provconf.hxx55
5 files changed, 0 insertions, 683 deletions
diff --git a/ucbhelper/source/client/makefile.mk b/ucbhelper/source/client/makefile.mk
deleted file mode 100644
index b8a535ba429c..000000000000
--- a/ucbhelper/source/client/makefile.mk
+++ /dev/null
@@ -1,60 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME= ucbhelper
-TARGET= client
-AUTOSEG= TRUE
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(header)" == ""
-
-SLOFILES=\
- $(SLO)$/content.obj \
- $(SLO)$/contentbroker.obj \
- $(SLO)$/commandenvironment.obj \
- $(SLO)$/fileidentifierconverter.obj \
- $(SLO)$/activedatasink.obj \
- $(SLO)$/activedatastreamer.obj \
- $(SLO)$/proxydecider.obj \
- $(SLO)$/interceptedinteraction.obj
-
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/ucbhelper/source/provider/configureucb.cxx b/ucbhelper/source/provider/configureucb.cxx
deleted file mode 100644
index ae30c6b5b350..000000000000
--- a/ucbhelper/source/provider/configureucb.cxx
+++ /dev/null
@@ -1,242 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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_ucbhelper.hxx"
-#include <ucbhelper/configureucb.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ucb/XContentProvider.hpp>
-#include <com/sun/star/ucb/XContentProviderManager.hpp>
-#include <com/sun/star/uno/Any.hxx>
-#include <com/sun/star/uno/RuntimeException.hpp>
-#include <rtl/ustrbuf.hxx>
-
-#include "osl/diagnose.h"
-
-#include <provconf.hxx>
-#include <registerucb.hxx>
-
-using namespace com::sun::star;
-
-namespace {
-
-bool fillPlaceholders(rtl::OUString const & rInput,
- uno::Sequence< uno::Any > const & rReplacements,
- rtl::OUString * pOutput)
-{
- sal_Unicode const * p = rInput.getStr();
- sal_Unicode const * pEnd = p + rInput.getLength();
- sal_Unicode const * pCopy = p;
- rtl::OUStringBuffer aBuffer;
- while (p != pEnd)
- switch (*p++)
- {
- case '&':
- if (pEnd - p >= 4
- && p[0] == 'a' && p[1] == 'm' && p[2] == 'p'
- && p[3] == ';')
- {
- aBuffer.append(pCopy, p - 1 - pCopy);
- aBuffer.append(sal_Unicode('&'));
- p += 4;
- pCopy = p;
- }
- else if (pEnd - p >= 3
- && p[0] == 'l' && p[1] == 't' && p[2] == ';')
- {
- aBuffer.append(pCopy, p - 1 - pCopy);
- aBuffer.append(sal_Unicode('<'));
- p += 3;
- pCopy = p;
- }
- else if (pEnd - p >= 3
- && p[0] == 'g' && p[1] == 't' && p[2] == ';')
- {
- aBuffer.append(pCopy, p - 1 - pCopy);
- aBuffer.append(sal_Unicode('>'));
- p += 3;
- pCopy = p;
- }
- break;
-
- case '<':
- sal_Unicode const * q = p;
- while (q != pEnd && *q != '>')
- ++q;
- if (q == pEnd)
- break;
- rtl::OUString aKey(p, q - p);
- rtl::OUString aValue;
- bool bFound = false;
- for (sal_Int32 i = 2; i + 1 < rReplacements.getLength();
- i += 2)
- {
- rtl::OUString aReplaceKey;
- if ((rReplacements[i] >>= aReplaceKey)
- && aReplaceKey == aKey
- && (rReplacements[i + 1] >>= aValue))
- {
- bFound = true;
- break;
- }
- }
- if (!bFound)
- return false;
- aBuffer.append(pCopy, p - 1 - pCopy);
- aBuffer.append(aValue);
- p = q + 1;
- pCopy = p;
- break;
- }
- aBuffer.append(pCopy, pEnd - pCopy);
- *pOutput = aBuffer.makeStringAndClear();
- return true;
-}
-
-}
-
-namespace ucbhelper {
-
-//============================================================================
-//
-// configureUcb
-//
-//============================================================================
-
-bool
-configureUcb(
- uno::Reference< ucb::XContentProviderManager > const & rManager,
- uno::Reference< lang::XMultiServiceFactory > const & rServiceFactory,
- ContentProviderDataList const & rData,
- ContentProviderRegistrationInfoList * pInfos)
- throw (uno::RuntimeException)
-{
- ContentProviderDataList::const_iterator aEnd(rData.end());
- for (ContentProviderDataList::const_iterator aIt(rData.begin());
- aIt != aEnd; ++aIt)
- {
- ContentProviderRegistrationInfo aInfo;
- bool bSuccess = registerAtUcb(rManager,
- rServiceFactory,
- aIt->ServiceName,
- aIt->Arguments,
- aIt->URLTemplate,
- &aInfo);
-
- if (bSuccess && pInfos)
- pInfos->push_back(aInfo);
- }
-
- return true;
-}
-
-//============================================================================
-//
-// configureUcb
-//
-//============================================================================
-
-bool
-configureUcb(
- uno::Reference< ucb::XContentProviderManager > const & rManager,
- uno::Reference< lang::XMultiServiceFactory > const & rServiceFactory,
- uno::Sequence< uno::Any > const & rArguments,
- std::vector< ContentProviderRegistrationInfo > * pInfos)
- throw (uno::RuntimeException)
-{
- rtl::OUString aKey1;
- rtl::OUString aKey2;
- if (rArguments.getLength() < 2
- || !(rArguments[0] >>= aKey1) || !(rArguments[1] >>= aKey2))
- {
- OSL_FAIL("ucb::configureUcb(): Bad arguments");
- return false;
- }
-
- ContentProviderDataList aData;
- if (!getContentProviderData(rServiceFactory, aKey1, aKey2, aData))
- {
- OSL_FAIL("ucb::configureUcb(): No configuration");
- return false;
- }
-
- ContentProviderDataList::const_iterator aEnd(aData.end());
- for (ContentProviderDataList::const_iterator aIt(aData.begin());
- aIt != aEnd; ++aIt)
- {
- rtl::OUString aProviderArguments;
- if (fillPlaceholders(aIt->Arguments,
- rArguments,
- &aProviderArguments))
- {
- ContentProviderRegistrationInfo aInfo;
- bool bSuccess = registerAtUcb(rManager,
- rServiceFactory,
- aIt->ServiceName,
- aProviderArguments,
- aIt->URLTemplate,
- &aInfo);
- OSL_ENSURE(bSuccess, "ucb::configureUcb(): Bad content provider");
-
- if (bSuccess && pInfos)
- pInfos->push_back(aInfo);
- }
- else
- OSL_FAIL("ucb::configureUcb(): Bad argument placeholders");
- }
-
- return true;
-}
-
-}
-
-//============================================================================
-//
-// unconfigureUcb
-//
-//============================================================================
-
-namespace ucbhelper {
-
-void
-unconfigureUcb(
- uno::Reference< ucb::XContentProviderManager > const & rManager,
- std::vector< ContentProviderRegistrationInfo > const & rInfos)
- throw (uno::RuntimeException)
-{
- std::vector< ContentProviderRegistrationInfo >::const_iterator
- aEnd(rInfos.end());
- for (std::vector< ContentProviderRegistrationInfo >::const_iterator
- aIt(rInfos.begin());
- aIt != aEnd; ++aIt)
- deregisterFromUcb(rManager, *aIt);
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucbhelper/source/provider/makefile.mk b/ucbhelper/source/provider/makefile.mk
deleted file mode 100644
index 5999192f7bdb..000000000000
--- a/ucbhelper/source/provider/makefile.mk
+++ /dev/null
@@ -1,70 +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.
-#
-#*************************************************************************
-
-PRJ=..$/..
-
-PRJNAME= ucbhelper
-TARGET= provider
-AUTOSEG= TRUE
-
-ENABLE_EXCEPTIONS=TRUE
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Files --------------------------------------------------------
-
-.IF "$(header)" == ""
-
-SLOFILES=\
- $(SLO)$/contentidentifier.obj \
- $(SLO)$/providerhelper.obj \
- $(SLO)$/contenthelper.obj \
- $(SLO)$/contentinfo.obj \
- $(SLO)$/propertyvalueset.obj \
- $(SLO)$/registerucb.obj \
- $(SLO)$/resultsetmetadata.obj \
- $(SLO)$/resultset.obj \
- $(SLO)$/resultsethelper.obj \
- $(SLO)$/commandenvironmentproxy.obj \
- $(SLO)$/interactionrequest.obj \
- $(SLO)$/simpleinteractionrequest.obj \
- $(SLO)$/simpleauthenticationrequest.obj \
- $(SLO)$/simplenameclashresolverequest.obj \
- $(SLO)$/simpleioerrorrequest.obj \
- $(SLO)$/cancelcommandexecution.obj \
- $(SLO)$/handleinteractionrequest.obj \
- $(SLO)$/simplecertificatevalidationrequest.obj
-
-.ENDIF
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
diff --git a/ucbhelper/source/provider/provconf.cxx b/ucbhelper/source/provider/provconf.cxx
deleted file mode 100644
index 3e89f9f70b4b..000000000000
--- a/ucbhelper/source/provider/provconf.cxx
+++ /dev/null
@@ -1,256 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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_ucbhelper.hxx"
-
-/**************************************************************************
- TODO
- **************************************************************************
-
- *************************************************************************/
-
-#include <provconf.hxx>
-#include <osl/diagnose.h>
-#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-using namespace com::sun::star;
-
-//=========================================================================
-
-#define CONFIG_CONTENTPROVIDERS_KEY \
- "/org.openoffice.ucb.Configuration/ContentProviders"
-
-//=========================================================================
-
-namespace ucbhelper {
-
-void makeAndAppendXMLName(
- rtl::OUStringBuffer & rBuffer, const rtl::OUString & rIn )
-{
- sal_Int32 nCount = rIn.getLength();
- for ( sal_Int32 n = 0; n < nCount; ++n )
- {
- const sal_Unicode c = rIn.getStr()[ n ];
- switch ( c )
- {
- case '&':
- rBuffer.appendAscii( "&amp;" );
- break;
-
- case '"':
- rBuffer.appendAscii( "&quot;" );
- break;
-
- case '\'':
- rBuffer.appendAscii( "&apos;" );
- break;
-
- case '<':
- rBuffer.appendAscii( "&lt;" );
- break;
-
- case '>':
- rBuffer.appendAscii( "&gt;" );
- break;
-
- default:
- rBuffer.append( c );
- break;
- }
- }
-}
-
-//=========================================================================
-bool getContentProviderData(
- const uno::Reference< lang::XMultiServiceFactory > & rServiceMgr,
- const rtl::OUString & rKey1,
- const rtl::OUString & rKey2,
- ContentProviderDataList & rListToFill )
-{
- if ( !rServiceMgr.is() || !rKey1.getLength() || !rKey2.getLength() )
- {
- OSL_FAIL( "getContentProviderData - Invalid argument!" );
- return false;
- }
-
- try
- {
- uno::Reference< lang::XMultiServiceFactory > xConfigProv(
- rServiceMgr->createInstance(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" )) ),
- uno::UNO_QUERY );
-
- if ( !xConfigProv.is() )
- {
- OSL_FAIL( "getContentProviderData - No config provider!" );
- return false;
- }
-
- rtl::OUStringBuffer aFullPath;
- aFullPath.appendAscii( CONFIG_CONTENTPROVIDERS_KEY "/['" );
- makeAndAppendXMLName( aFullPath, rKey1 );
- aFullPath.appendAscii( "']/SecondaryKeys/['" );
- makeAndAppendXMLName( aFullPath, rKey2 );
- aFullPath.appendAscii( "']/ProviderData" );
-
- uno::Sequence< uno::Any > aArguments( 1 );
- beans::PropertyValue aProperty;
- aProperty.Name
- = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "nodepath" ) );
- aProperty.Value <<= aFullPath.makeStringAndClear();
- aArguments[ 0 ] <<= aProperty;
-
- uno::Reference< uno::XInterface > xInterface(
- xConfigProv->createInstanceWithArguments(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationAccess" ) ),
- aArguments ) );
-
- if ( !xInterface.is() )
- {
- OSL_FAIL( "getContentProviderData - No config access!" );
- return false;
- }
-
- uno::Reference< container::XNameAccess > xNameAccess(
- xInterface, uno::UNO_QUERY );
-
- if ( !xNameAccess.is() )
- {
- OSL_FAIL( "getContentProviderData - No XNameAccess!" );
- return false;
- }
-
- uno::Sequence< rtl::OUString > aElems = xNameAccess->getElementNames();
- const rtl::OUString* pElems = aElems.getConstArray();
- sal_Int32 nCount = aElems.getLength();
-
- if ( nCount > 0 )
- {
- uno::Reference< container::XHierarchicalNameAccess >
- xHierNameAccess( xInterface, uno::UNO_QUERY );
-
- if ( !xHierNameAccess.is() )
- {
- OSL_FAIL( "getContentProviderData - "
- "No XHierarchicalNameAccess!" );
- return false;
- }
-
- // Iterate over children.
- for ( sal_Int32 n = 0; n < nCount; ++n )
- {
- rtl::OUStringBuffer aElemBuffer;
- aElemBuffer.appendAscii( "['" );
- makeAndAppendXMLName( aElemBuffer, pElems[ n ] );
-
- try
- {
- ContentProviderData aInfo;
-
- // Obtain service name.
- rtl::OUStringBuffer aKeyBuffer = aElemBuffer;
- aKeyBuffer.appendAscii( "']/ServiceName" );
-
- rtl::OUString aValue;
- if ( !( xHierNameAccess->getByHierarchicalName(
- aKeyBuffer.makeStringAndClear() ) >>= aValue ) )
- {
- OSL_FAIL( "getContentProviderData - "
- "Error getting item value!" );
- continue;
- }
-
- aInfo.ServiceName = aValue;
-
- // Obtain URL Template.
- aKeyBuffer = aElemBuffer;
- aKeyBuffer.appendAscii( "']/URLTemplate" );
-
- if ( !( xHierNameAccess->getByHierarchicalName(
- aKeyBuffer.makeStringAndClear() ) >>= aValue ) )
- {
- OSL_FAIL( "getContentProviderData - "
- "Error getting item value!" );
- continue;
- }
-
- aInfo.URLTemplate = aValue;
-
- // Obtain Arguments.
- aKeyBuffer = aElemBuffer;
- aKeyBuffer.appendAscii( "']/Arguments" );
-
- if ( !( xHierNameAccess->getByHierarchicalName(
- aKeyBuffer.makeStringAndClear() ) >>= aValue ) )
- {
- OSL_FAIL( "getContentProviderData - "
- "Error getting item value!" );
- continue;
- }
-
- aInfo.Arguments = aValue;
-
- // Append info to list.
- rListToFill.push_back( aInfo );
- }
- catch ( container::NoSuchElementException& )
- {
- // getByHierarchicalName
-
- OSL_FAIL( "getContentProviderData - "
- "caught NoSuchElementException!" );
- }
- }
- }
- }
- catch ( uno::RuntimeException& )
- {
- OSL_FAIL( "getContentProviderData - caught RuntimeException!" );
- return false;
- }
- catch ( uno::Exception& )
- {
- // createInstance, createInstanceWithArguments
-
- OSL_FAIL( "getContentProviderData - caught Exception!" );
- return false;
- }
-
- return true;
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucbhelper/source/provider/provconf.hxx b/ucbhelper/source/provider/provconf.hxx
deleted file mode 100644
index e21a619114ce..000000000000
--- a/ucbhelper/source/provider/provconf.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * 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 _UCBHELPER_PROVCONF_HXX_
-#define _UCBHELPER_PROFCONF_HXX_
-
-#include <rtl/ustring.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <ucbhelper/configureucb.hxx>
-
-namespace com { namespace sun { namespace star { namespace lang {
- class XMultiServiceFactory;
-} } } }
-
-//=========================================================================
-
-namespace ucbhelper {
-
-bool getContentProviderData( const com::sun::star::uno::Reference<
- com::sun::star::lang::XMultiServiceFactory >
- & rServiceMgr,
- const rtl::OUString & rKey1,
- const rtl::OUString & rKey2,
- ContentProviderDataList & rListToFill );
-
-}
-
-#endif /* !_UCBHELPER_PROVCONF_HXX_ */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */