summaryrefslogtreecommitdiff
path: root/ucb/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'ucb/source/core')
-rw-r--r--ucb/source/core/cmdenv.cxx191
-rw-r--r--ucb/source/core/cmdenv.hxx102
-rw-r--r--ucb/source/core/identify.cxx5
-rw-r--r--ucb/source/core/identify.hxx5
-rw-r--r--ucb/source/core/makefile.mk11
-rw-r--r--ucb/source/core/providermap.hxx5
-rw-r--r--ucb/source/core/provprox.cxx5
-rw-r--r--ucb/source/core/provprox.hxx5
-rw-r--r--ucb/source/core/ucb.cxx5
-rw-r--r--ucb/source/core/ucb.hxx5
-rw-r--r--ucb/source/core/ucbcmds.cxx236
-rw-r--r--ucb/source/core/ucbcmds.hxx5
-rw-r--r--ucb/source/core/ucbprops.cxx5
-rw-r--r--ucb/source/core/ucbprops.hxx5
-rw-r--r--ucb/source/core/ucbserv.cxx29
-rw-r--r--ucb/source/core/ucbstore.cxx17
-rw-r--r--ucb/source/core/ucbstore.hxx5
17 files changed, 475 insertions, 166 deletions
diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx
new file mode 100644
index 000000000000..0f425e814400
--- /dev/null
+++ b/ucb/source/core/cmdenv.cxx
@@ -0,0 +1,191 @@
+/*************************************************************************
+ *
+ * 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_ucb.hxx"
+
+#include "cppuhelper/factory.hxx"
+#include "com/sun/star/lang/IllegalArgumentException.hpp"
+
+#include "cmdenv.hxx"
+
+/**************************************************************************
+ TODO
+ **************************************************************************
+
+ *************************************************************************/
+using namespace com::sun::star;
+using namespace ucb_cmdenv;
+
+//=========================================================================
+//=========================================================================
+//
+// UcbCommandEnvironment Implementation.
+//
+//=========================================================================
+//=========================================================================
+
+UcbCommandEnvironment::UcbCommandEnvironment(
+ const uno::Reference< lang::XMultiServiceFactory >& /*xSMgr*/ )
+//: m_xSMgr( xSMgr )
+{
+}
+
+//=========================================================================
+// virtual
+UcbCommandEnvironment::~UcbCommandEnvironment()
+{
+}
+
+//=========================================================================
+//
+// XInitialization methods.
+//
+//=========================================================================
+
+// virtual
+void SAL_CALL UcbCommandEnvironment::initialize(
+ const uno::Sequence< uno::Any >& aArguments )
+ throw( uno::Exception,
+ uno::RuntimeException )
+{
+ if ( ( aArguments.getLength() < 2 ) ||
+ !( aArguments[ 0 ] >>= m_xIH ) ||
+ !( aArguments[ 1 ] >>= m_xPH ))
+ throw lang::IllegalArgumentException();
+}
+
+//=========================================================================
+//
+// XServiceInfo methods.
+//
+//=========================================================================
+
+// virtual
+::rtl::OUString SAL_CALL UcbCommandEnvironment::getImplementationName()
+ throw ( uno::RuntimeException )
+{
+ return getImplementationName_Static();
+}
+
+//=========================================================================
+// virtual
+sal_Bool SAL_CALL
+UcbCommandEnvironment::supportsService( const ::rtl::OUString& ServiceName )
+ throw ( uno::RuntimeException )
+{
+ uno::Sequence< rtl::OUString > aSNL = getSupportedServiceNames();
+ const rtl::OUString * pArray = aSNL.getConstArray();
+ for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ )
+ {
+ if ( pArray[ i ] == ServiceName )
+ return sal_True;
+ }
+ return sal_False;
+}
+
+//=========================================================================
+// virtual
+uno::Sequence< ::rtl::OUString > SAL_CALL
+UcbCommandEnvironment::getSupportedServiceNames()
+ throw ( uno::RuntimeException )
+{
+ return getSupportedServiceNames_Static();
+}
+
+//=========================================================================
+// static
+rtl::OUString UcbCommandEnvironment::getImplementationName_Static()
+{
+ return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.comp.ucb.CommandEnvironment" ) );
+}
+
+//=========================================================================
+// static
+uno::Sequence< rtl::OUString >
+UcbCommandEnvironment::getSupportedServiceNames_Static()
+{
+ uno::Sequence< rtl::OUString > aSNS( 1 );
+ aSNS.getArray()[ 0 ]
+ = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ucb.CommandEnvironment" ) );
+ return aSNS;
+}
+
+//=========================================================================
+//
+// XCommandInfo methods.
+//
+//=========================================================================
+
+// virtual
+uno::Reference< task::XInteractionHandler > SAL_CALL
+UcbCommandEnvironment::getInteractionHandler()
+ throw ( uno::RuntimeException )
+{
+ return m_xIH;
+}
+
+//=========================================================================
+// virtual
+uno::Reference< ucb::XProgressHandler > SAL_CALL
+UcbCommandEnvironment::getProgressHandler()
+ throw ( uno::RuntimeException )
+{
+ return m_xPH;
+}
+
+//=========================================================================
+//
+// Service factory implementation.
+//
+//=========================================================================
+
+static uno::Reference< uno::XInterface > SAL_CALL
+UcbCommandEnvironment_CreateInstance(
+ const uno::Reference< lang::XMultiServiceFactory> & rSMgr )
+ throw( uno::Exception )
+{
+ lang::XServiceInfo * pX = static_cast< lang::XServiceInfo * >(
+ new UcbCommandEnvironment( rSMgr ) );
+ return uno::Reference< uno::XInterface >::query( pX );
+}
+
+//=========================================================================
+// static
+uno::Reference< lang::XSingleServiceFactory >
+UcbCommandEnvironment::createServiceFactory(
+ const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr )
+{
+ return uno::Reference< lang::XSingleServiceFactory >(
+ cppu::createOneInstanceFactory(
+ rxServiceMgr,
+ UcbCommandEnvironment::getImplementationName_Static(),
+ UcbCommandEnvironment_CreateInstance,
+ UcbCommandEnvironment::getSupportedServiceNames_Static() ) );
+}
diff --git a/ucb/source/core/cmdenv.hxx b/ucb/source/core/cmdenv.hxx
new file mode 100644
index 000000000000..419ce6afb560
--- /dev/null
+++ b/ucb/source/core/cmdenv.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * 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 INCLUDED_CMDENV_HXX
+#define INCLUDED_CMDENV_HXX
+
+#include "cppuhelper/implbase3.hxx"
+
+#include "com/sun/star/lang/XInitialization.hpp"
+#include "com/sun/star/lang/XServiceInfo.hpp"
+#include "com/sun/star/lang/XSingleServiceFactory.hpp"
+#include "com/sun/star/ucb/XCommandEnvironment.hpp"
+
+namespace ucb_cmdenv {
+
+class UcbCommandEnvironment :
+ public cppu::WeakImplHelper3< com::sun::star::lang::XInitialization,
+ com::sun::star::lang::XServiceInfo,
+ com::sun::star::ucb::XCommandEnvironment >
+{
+ com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler > m_xIH;
+ com::sun::star::uno::Reference<
+ com::sun::star::ucb::XProgressHandler > m_xPH;
+
+public:
+ UcbCommandEnvironment(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory >& rXSMgr );
+ virtual ~UcbCommandEnvironment();
+
+ // XInitialization
+ virtual void SAL_CALL
+ initialize( const com::sun::star::uno::Sequence<
+ com::sun::star::uno::Any >& aArguments )
+ throw( com::sun::star::uno::Exception,
+ com::sun::star::uno::RuntimeException );
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName()
+ throw ( com::sun::star::uno::RuntimeException );
+
+ virtual sal_Bool SAL_CALL
+ supportsService( const ::rtl::OUString& ServiceName )
+ throw ( com::sun::star::uno::RuntimeException );
+
+ virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
+ getSupportedServiceNames()
+ throw ( com::sun::star::uno::RuntimeException );
+
+ // XCommandEnvironment
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::task::XInteractionHandler > SAL_CALL
+ getInteractionHandler()
+ throw ( com::sun::star::uno::RuntimeException );
+ virtual com::sun::star::uno::Reference<
+ com::sun::star::ucb::XProgressHandler > SAL_CALL
+ getProgressHandler()
+ throw ( com::sun::star::uno::RuntimeException );
+
+ // Non-UNO interfaces
+ static rtl::OUString
+ getImplementationName_Static();
+ static com::sun::star::uno::Sequence< rtl::OUString >
+ getSupportedServiceNames_Static();
+
+ static com::sun::star::uno::Reference<
+ com::sun::star::lang::XSingleServiceFactory >
+ createServiceFactory( const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > & rxServiceMgr );
+private:
+ //com::sun::star::uno::Reference<
+ // com::sun::star::lang::XMultiServiceFactory > m_xSMgr;
+};
+
+} // namespace ucb_cmdenv
+
+#endif // INCLUDED_CMDENV_HXX
diff --git a/ucb/source/core/identify.cxx b/ucb/source/core/identify.cxx
index 956f5c2f582d..ece9211c1ac3 100644
--- a/ucb/source/core/identify.cxx
+++ b/ucb/source/core/identify.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: identify.cxx,v $
- * $Revision: 1.6 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/ucb/source/core/identify.hxx b/ucb/source/core/identify.hxx
index 0cd59aedeaf1..d8ea23b1eee5 100644
--- a/ucb/source/core/identify.hxx
+++ b/ucb/source/core/identify.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: identify.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/ucb/source/core/makefile.mk b/ucb/source/core/makefile.mk
index e70b5ca879ef..5095dbef947d 100644
--- a/ucb/source/core/makefile.mk
+++ b/ucb/source/core/makefile.mk
@@ -2,14 +2,10 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2008 by Sun Microsystems, Inc.
+# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
-# $RCSfile: makefile.mk,v $
-#
-# $Revision: 1.22 $
-#
# This file is part of OpenOffice.org.
#
# OpenOffice.org is free software: you can redistribute it and/or modify
@@ -48,7 +44,8 @@ SLOFILES=\
$(SLO)$/ucbstore.obj \
$(SLO)$/ucbprops.obj \
$(SLO)$/provprox.obj \
- $(SLO)$/ucbcmds.obj
+ $(SLO)$/ucbcmds.obj \
+ $(SLO)$/cmdenv.obj
LIB1TARGET=$(SLB)$/_$(TARGET).lib
LIB1OBJFILES=$(SLOFILES)
@@ -59,7 +56,7 @@ SHL1STDLIBS=\
$(CPPUHELPERLIB) \
$(CPPULIB) \
$(SALLIB) \
- $(UCBHELPERLIB)
+ $(UCBHELPERLIB)
SHL1LIBS=\
$(LIB1TARGET) \
$(SLB)$/regexp.lib
diff --git a/ucb/source/core/providermap.hxx b/ucb/source/core/providermap.hxx
index 8a464cd1d2bf..a7fec30a42bf 100644
--- a/ucb/source/core/providermap.hxx
+++ b/ucb/source/core/providermap.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: providermap.hxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/ucb/source/core/provprox.cxx b/ucb/source/core/provprox.cxx
index 64011230bd37..feab9ce4f95e 100644
--- a/ucb/source/core/provprox.cxx
+++ b/ucb/source/core/provprox.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: provprox.cxx,v $
- * $Revision: 1.10 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/ucb/source/core/provprox.hxx b/ucb/source/core/provprox.hxx
index 9dda8a247ac4..cdc85251e96e 100644
--- a/ucb/source/core/provprox.hxx
+++ b/ucb/source/core/provprox.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: provprox.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx
index fe20f6e5b23a..094507a56c24 100644
--- a/ucb/source/core/ucb.cxx
+++ b/ucb/source/core/ucb.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ucb.cxx,v $
- * $Revision: 1.12 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/ucb/source/core/ucb.hxx b/ucb/source/core/ucb.hxx
index e03e6f3c6ab5..0e44c5bc99b5 100644
--- a/ucb/source/core/ucb.hxx
+++ b/ucb/source/core/ucb.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ucb.hxx,v $
- * $Revision: 1.5 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx
index 7caabc7f783d..fd3f0f73c772 100644
--- a/ucb/source/core/ucbcmds.cxx
+++ b/ucb/source/core/ucbcmds.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ucbcmds.cxx,v $
- * $Revision: 1.20 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -41,11 +38,10 @@
#include <cppuhelper/exc_hlp.hxx>
#include <rtl/ustring.h>
#include <rtl/ustring.hxx>
-#ifndef __COM_SUN_STAR_LANG_XINTERFACE_HPP_
#include <com/sun/star/uno/XInterface.hpp>
-#endif
#include <com/sun/star/beans/PropertyState.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/io/XActiveDataSink.hpp>
@@ -53,13 +49,12 @@
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
+#include <com/sun/star/ucb/CommandEnvironment.hpp>
#include <com/sun/star/ucb/CommandFailedException.hpp>
#include <com/sun/star/ucb/ContentInfoAttribute.hpp>
#include <com/sun/star/ucb/GlobalTransferCommandArgument.hpp>
#include <com/sun/star/ucb/InsertCommandArgument.hpp>
-#ifndef _COM_SUN_STAR_UCB_INTERACTIVEBADTRANSFRERURLEXCEPTION_HPP_
#include <com/sun/star/ucb/InteractiveBadTransferURLException.hpp>
-#endif
#include <com/sun/star/ucb/NameClash.hpp>
#include <com/sun/star/ucb/NameClashException.hpp>
#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
@@ -79,7 +74,7 @@
using namespace com::sun::star;
-namespace ucb_commands
+namespace
{
//=========================================================================
@@ -182,51 +177,6 @@ void SAL_CALL InteractionHandlerProxy::handle(
//=========================================================================
//
-// class CommandEnvironment.
-//
-//=========================================================================
-
-class CommandEnvironment :
- public cppu::WeakImplHelper1< ucb::XCommandEnvironment >
-{
- uno::Reference< task::XInteractionHandler > m_xIH;
- uno::Reference< ucb::XProgressHandler > m_xPH;
-
-public:
- CommandEnvironment(
- const uno::Reference< task::XInteractionHandler > & xIH,
- const uno::Reference< ucb::XProgressHandler > & xPH )
- : m_xIH( xIH ), m_xPH( xPH ) {}
-
- // XCommandEnvironment methods.
- virtual uno::Reference< task::XInteractionHandler > SAL_CALL
- getInteractionHandler()
- throw ( uno::RuntimeException );
- virtual uno::Reference< ucb::XProgressHandler > SAL_CALL
- getProgressHandler()
- throw ( uno::RuntimeException );
-};
-
-//=========================================================================
-// virtual
-uno::Reference< task::XInteractionHandler > SAL_CALL
-CommandEnvironment::getInteractionHandler()
- throw ( uno::RuntimeException )
-{
- return m_xIH;
-}
-
-//=========================================================================
-// virtual
-uno::Reference< ucb::XProgressHandler > SAL_CALL
-CommandEnvironment::getProgressHandler()
- throw ( uno::RuntimeException )
-{
- return m_xPH;
-}
-
-//=========================================================================
-//
// class ActiveDataSink.
//
//=========================================================================
@@ -389,7 +339,7 @@ sal_Bool SAL_CALL CommandProcessorInfo::hasCommandByHandle( sal_Int32 Handle )
//=========================================================================
//=========================================================================
-static rtl::OUString createDesiredName(
+rtl::OUString createDesiredName(
const rtl::OUString & rSourceURL, const rtl::OUString & rNewTitle )
{
rtl::OUString aName( rNewTitle );
@@ -438,13 +388,13 @@ static rtl::OUString createDesiredName(
return rtl::OUString( aName );
}
-static rtl::OUString createDesiredName(
+rtl::OUString createDesiredName(
const ucb::GlobalTransferCommandArgument & rArg )
{
return createDesiredName( rArg.SourceURL, rArg.NewTitle );
}
-static rtl::OUString createDesiredName(
+rtl::OUString createDesiredName(
const ucb::TransferInfo & rArg )
{
return createDesiredName( rArg.SourceURL, rArg.NewTitle );
@@ -453,7 +403,7 @@ static rtl::OUString createDesiredName(
//=========================================================================
enum NameClashContinuation { NOT_HANDLED, ABORT, OVERWRITE, NEW_NAME, UNKNOWN };
-static NameClashContinuation interactiveNameClashResolve(
+NameClashContinuation interactiveNameClashResolve(
const uno::Reference< ucb::XCommandEnvironment > & xEnv,
const rtl::OUString & rTargetURL,
const rtl::OUString & rClashingName,
@@ -528,7 +478,7 @@ static NameClashContinuation interactiveNameClashResolve(
}
//=========================================================================
-static bool setTitle(
+bool setTitle(
const uno::Reference< ucb::XCommandProcessor > & xCommandProcessor,
const uno::Reference< ucb::XCommandEnvironment > & xEnv,
const rtl::OUString & rNewTitle )
@@ -576,7 +526,7 @@ static bool setTitle(
}
//=========================================================================
-static uno::Reference< ucb::XContent > createNew(
+uno::Reference< ucb::XContent > createNew(
const TransferCommandContext & rContext,
const uno::Reference< ucb::XContent > & xTarget,
sal_Bool bSourceIsFolder,
@@ -590,10 +540,12 @@ static uno::Reference< ucb::XContent > createNew(
//
//////////////////////////////////////////////////////////////////////
- uno::Reference< ucb::XContentCreator > xCreator(
- xTarget, uno::UNO_QUERY );
+ // First, try it using "CreatabeleContentsInfo" property and
+ // "createNewContent" command -> the "new" way.
- if ( !xCreator.is() )
+ uno::Reference< ucb::XCommandProcessor > xCommandProcessorT(
+ xTarget, uno::UNO_QUERY );
+ if ( !xCommandProcessorT.is() )
{
uno::Any aProps
= uno::makeAny(beans::PropertyValue(
@@ -606,24 +558,77 @@ static uno::Reference< ucb::XContent > createNew(
ucb::IOErrorCode_CANT_CREATE,
uno::Sequence< uno::Any >(&aProps, 1),
rContext.xOrigEnv,
- rtl::OUString::createFromAscii( "Target is no XContentCreator!" ),
+ rtl::OUString::createFromAscii( "Target is no XCommandProcessor!" ),
rContext.xProcessor );
// Unreachable
}
- uno::Sequence< ucb::ContentInfo > aTypesInfo
- = xCreator->queryCreatableContentsInfo();
+ uno::Sequence< beans::Property > aPropsToObtain( 1 );
+ aPropsToObtain[ 0 ].Name
+ = rtl::OUString::createFromAscii( "CreatableContentsInfo" );
+ aPropsToObtain[ 0 ].Handle
+ = -1;
- sal_Int32 nCount = aTypesInfo.getLength();
- if ( !nCount )
+ ucb::Command aGetPropsCommand(
+ rtl::OUString::createFromAscii( "getPropertyValues" ),
+ -1,
+ uno::makeAny( aPropsToObtain ) );
+
+ uno::Reference< sdbc::XRow > xRow;
+ xCommandProcessorT->execute( aGetPropsCommand, 0, rContext.xEnv ) >>= xRow;
+
+ uno::Sequence< ucb::ContentInfo > aTypesInfo;
+ bool bGotTypesInfo = false;
+
+ if ( xRow.is() )
{
- uno::Any aProps
- = uno::makeAny(beans::PropertyValue(
+ uno::Any aValue = xRow->getObject(
+ 1, uno::Reference< container::XNameAccess >() );
+ if ( aValue.hasValue() && ( aValue >>= aTypesInfo ) )
+ {
+ bGotTypesInfo = true;
+ }
+ }
+
+ uno::Reference< ucb::XContentCreator > xCreator;
+
+ if ( !bGotTypesInfo )
+ {
+ // Second, try it using XContentCreator interface -> the "old" way (not
+ // providing the chance to supply an XCommandEnvironment.
+
+ xCreator.set( xTarget, uno::UNO_QUERY );
+
+ if ( !xCreator.is() )
+ {
+ uno::Any aProps
+ = uno::makeAny(beans::PropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"Folder")),
-1,
uno::makeAny(rContext.aArg.TargetURL),
beans::PropertyState_DIRECT_VALUE));
+ ucbhelper::cancelCommandExecution(
+ ucb::IOErrorCode_CANT_CREATE,
+ uno::Sequence< uno::Any >(&aProps, 1),
+ rContext.xOrigEnv,
+ rtl::OUString::createFromAscii( "Target is no XContentCreator!" ),
+ rContext.xProcessor );
+ // Unreachable
+ }
+
+ aTypesInfo = xCreator->queryCreatableContentsInfo();
+ }
+
+ sal_Int32 nCount = aTypesInfo.getLength();
+ if ( !nCount )
+ {
+ uno::Any aProps
+ = uno::makeAny(beans::PropertyValue(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Folder")),
+ -1,
+ uno::makeAny(rContext.aArg.TargetURL),
+ beans::PropertyState_DIRECT_VALUE));
ucbhelper::cancelCommandExecution(
ucb::IOErrorCode_CANT_CREATE,
uno::Sequence< uno::Any >(&aProps, 1),
@@ -680,7 +685,7 @@ static uno::Reference< ucb::XContent > createNew(
!!( nAttribs
& ucb::ContentInfoAttribute::KIND_FOLDER ) )
&&
- ( !!bSourceIsDocument ==
+ ( !!bSourceIsDocument ==
!!( nAttribs
& ucb::ContentInfoAttribute::KIND_DOCUMENT ) )
)
@@ -710,7 +715,25 @@ static uno::Reference< ucb::XContent > createNew(
//
//////////////////////////////////////////////////////////////
- xNew = xCreator->createNewContent( aTypesInfo[ n ] );
+ if ( !xCreator.is() )
+ {
+ // First, try it using "CreatabeleContentsInfo" property and
+ // "createNewContent" command -> the "new" way.
+ ucb::Command aCreateNewCommand(
+ rtl::OUString::createFromAscii( "createNewContent" ),
+ -1,
+ uno::makeAny( aTypesInfo[ n ] ) );
+
+ xCommandProcessorT->execute( aCreateNewCommand, 0, rContext.xEnv )
+ >>= xNew;
+ }
+ else
+ {
+ // Second, try it using XContentCreator interface -> the "old"
+ // way (not providing the chance to supply an XCommandEnvironment.
+
+ xNew = xCreator->createNewContent( aTypesInfo[ n ] );
+ }
if ( !xNew.is() )
{
@@ -739,7 +762,7 @@ static uno::Reference< ucb::XContent > createNew(
}
//=========================================================================
-static void transferProperties(
+void transferProperties(
const TransferCommandContext & rContext,
const uno::Reference< ucb::XCommandProcessor > & xCommandProcessorS,
const uno::Reference< ucb::XCommandProcessor > & xCommandProcessorN )
@@ -904,7 +927,7 @@ static void transferProperties(
}
//=========================================================================
-static uno::Reference< io::XInputStream > getInputStream(
+uno::Reference< io::XInputStream > getInputStream(
const TransferCommandContext & rContext,
const uno::Reference< ucb::XCommandProcessor > & xCommandProcessorS )
throw( uno::Exception )
@@ -992,7 +1015,7 @@ static uno::Reference< io::XInputStream > getInputStream(
}
//=========================================================================
-static uno::Reference< sdbc::XResultSet > getResultSet(
+uno::Reference< sdbc::XResultSet > getResultSet(
const TransferCommandContext & rContext,
const uno::Reference< ucb::XCommandProcessor > & xCommandProcessorS )
throw( uno::Exception )
@@ -1038,7 +1061,7 @@ static uno::Reference< sdbc::XResultSet > getResultSet(
}
//=========================================================================
-static void handleNameClashRename(
+void handleNameClashRename(
const TransferCommandContext & rContext,
const uno::Reference< ucb::XContent > & xNew,
const uno::Reference<
@@ -1217,7 +1240,7 @@ static void handleNameClashRename(
}
//=========================================================================
-static void globalTransfer(
+void globalTransfer_(
const TransferCommandContext & rContext,
const uno::Reference< ucb::XContent > & xSource,
const uno::Reference< ucb::XContent > & xTarget,
@@ -1632,7 +1655,7 @@ static void globalTransfer(
rtl::OUString(), // NewTitle;
rContext.aArg.NameClash ); // NameClash
- ucb_commands::TransferCommandContext aSubCtx(
+ TransferCommandContext aSubCtx(
rContext.xSMgr,
rContext.xProcessor,
rContext.xEnv,
@@ -1649,10 +1672,10 @@ static void globalTransfer(
aSubCtx.aArg.SourceURL
= xChild->getIdentifier()->getContentIdentifier();
- ucb_commands::globalTransfer( aSubCtx,
- xChild,
- xNew,
- xChildRow );
+ globalTransfer_( aSubCtx,
+ xChild,
+ xNew,
+ xChildRow );
}
}
while ( xResultSet->next() );
@@ -1695,7 +1718,7 @@ static void globalTransfer(
}
}
-} /* namescpace ucb_commands */
+} /* namescpace */
//=========================================================================
//
@@ -1706,8 +1729,7 @@ static void globalTransfer(
uno::Reference< ucb::XCommandInfo >
UniversalContentBroker::getCommandInfo()
{
- return uno::Reference< ucb::XCommandInfo >(
- new ucb_commands::CommandProcessorInfo() );
+ return uno::Reference< ucb::XCommandInfo >( new CommandProcessorInfo() );
}
//=========================================================================
@@ -1717,14 +1739,24 @@ void UniversalContentBroker::globalTransfer(
throw( uno::Exception )
{
// Use own command environment with own interaction handler intercepting
- // some interaction requests that shell not be handled by the user-supplied
+ // some interaction requests that shall not be handled by the user-supplied
// interaction handler.
uno::Reference< ucb::XCommandEnvironment > xLocalEnv;
if (xEnv.is())
- xLocalEnv.set( new ucb_commands::CommandEnvironment(
- new ucb_commands::InteractionHandlerProxy(
- xEnv->getInteractionHandler() ),
- xEnv->getProgressHandler() ) );
+ {
+ uno::Reference< beans::XPropertySet > const xProps(
+ m_xSMgr, uno::UNO_QUERY_THROW );
+ uno::Reference< uno::XComponentContext > xCtx;
+ xCtx.set( xProps->getPropertyValue(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ),
+ uno::UNO_QUERY_THROW );
+
+ xLocalEnv.set( ucb::CommandEnvironment::create(
+ xCtx,
+ new InteractionHandlerProxy( xEnv->getInteractionHandler() ),
+ xEnv->getProgressHandler() ) );
+ }
//////////////////////////////////////////////////////////////////////
//
@@ -1862,27 +1894,27 @@ void UniversalContentBroker::globalTransfer(
uno::Any aExc;
rtl::OUString aNewTitle;
- ucb_commands::NameClashContinuation eCont
- = ucb_commands::interactiveNameClashResolve(
+ NameClashContinuation eCont
+ = interactiveNameClashResolve(
xEnv, // always use original environment!
rArg.TargetURL, // target folder URL
- ucb_commands::createDesiredName(
- aTransferArg ), // clashing name
+ createDesiredName(
+ aTransferArg ), // clashing name
aExc,
aNewTitle );
switch ( eCont )
{
- case ucb_commands::NOT_HANDLED:
+ case NOT_HANDLED:
// Not handled.
cppu::throwException( aExc );
// break;
- case ucb_commands::UNKNOWN:
+ case UNKNOWN:
// Handled, but not clear, how...
// fall-thru intended.
- case ucb_commands::ABORT:
+ case ABORT:
throw ucb::CommandFailedException(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
@@ -1892,13 +1924,13 @@ void UniversalContentBroker::globalTransfer(
aExc );
// break;
- case ucb_commands::OVERWRITE:
+ case OVERWRITE:
aTransferArg.NameClash
= ucb::NameClash::OVERWRITE;
bRetry = true;
break;
- case ucb_commands::NEW_NAME:
+ case NEW_NAME:
aTransferArg.NewTitle = aNewTitle;
bRetry = true;
break;
@@ -2015,7 +2047,7 @@ void UniversalContentBroker::globalTransfer(
// Unreachable
}
- ucb_commands::TransferCommandContext aTransferCtx(
+ TransferCommandContext aTransferCtx(
m_xSMgr, this, xLocalEnv, xEnv, rArg );
if ( rArg.NewTitle.getLength() == 0 )
@@ -2025,12 +2057,12 @@ void UniversalContentBroker::globalTransfer(
if ( aBaseURI.getLength() )
{
aTransferCtx.aArg.NewTitle
- = ucb_commands::createDesiredName( aBaseURI, rtl::OUString() );
+ = createDesiredName( aBaseURI, rtl::OUString() );
}
}
// Do it!
- ucb_commands::globalTransfer( aTransferCtx, xSource, xTarget, xRow );
+ globalTransfer_( aTransferCtx, xSource, xTarget, xRow );
//////////////////////////////////////////////////////////////////////
//
diff --git a/ucb/source/core/ucbcmds.hxx b/ucb/source/core/ucbcmds.hxx
index 5e13ea1b41ff..7e50bcceef93 100644
--- a/ucb/source/core/ucbcmds.hxx
+++ b/ucb/source/core/ucbcmds.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ucbcmds.hxx,v $
- * $Revision: 1.3 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/ucb/source/core/ucbprops.cxx b/ucb/source/core/ucbprops.cxx
index 9bfb3de558a3..564383fd528a 100644
--- a/ucb/source/core/ucbprops.cxx
+++ b/ucb/source/core/ucbprops.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ucbprops.cxx,v $
- * $Revision: 1.6 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/ucb/source/core/ucbprops.hxx b/ucb/source/core/ucbprops.hxx
index a0f71b6818ca..7908fa6af90c 100644
--- a/ucb/source/core/ucbprops.hxx
+++ b/ucb/source/core/ucbprops.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ucbprops.hxx,v $
- * $Revision: 1.4 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
diff --git a/ucb/source/core/ucbserv.cxx b/ucb/source/core/ucbserv.cxx
index 17630a8ef210..340fa5db0c0f 100644
--- a/ucb/source/core/ucbserv.cxx
+++ b/ucb/source/core/ucbserv.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ucbserv.cxx,v $
- * $Revision: 1.11 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -37,6 +34,7 @@
#include "ucbstore.hxx"
#include "ucbprops.hxx"
#include "provprox.hxx"
+#include "cmdenv.hxx"
using namespace rtl;
using namespace com::sun::star::uno;
@@ -46,7 +44,7 @@ using namespace com::sun::star::registry;
//=========================================================================
static sal_Bool writeInfo( void * pRegistryKey,
const OUString & rImplementationName,
- Sequence< OUString > const & rServiceNames )
+ Sequence< OUString > const & rServiceNames )
{
OUString aKeyName( OUString::createFromAscii( "/" ) );
aKeyName += rImplementationName;
@@ -124,7 +122,15 @@ extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey )
writeInfo( pRegistryKey,
UcbContentProviderProxyFactory::getImplementationName_Static(),
- UcbContentProviderProxyFactory::getSupportedServiceNames_Static() );
+ UcbContentProviderProxyFactory::getSupportedServiceNames_Static() ) &&
+
+ //////////////////////////////////////////////////////////////////////
+ // Command Environment.
+ //////////////////////////////////////////////////////////////////////
+
+ writeInfo( pRegistryKey,
+ ucb_cmdenv::UcbCommandEnvironment::getImplementationName_Static(),
+ ucb_cmdenv::UcbCommandEnvironment::getSupportedServiceNames_Static() );
}
//=========================================================================
@@ -179,6 +185,17 @@ extern "C" void * SAL_CALL component_getFactory(
}
//////////////////////////////////////////////////////////////////////
+ // Command Environment.
+ //////////////////////////////////////////////////////////////////////
+
+ else if ( ucb_cmdenv::UcbCommandEnvironment::getImplementationName_Static().
+ compareToAscii( pImplName ) == 0 )
+ {
+ xFactory
+ = ucb_cmdenv::UcbCommandEnvironment::createServiceFactory( xSMgr );
+ }
+
+ //////////////////////////////////////////////////////////////////////
if ( xFactory.is() )
{
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 40c8984d080f..9500db4f45b6 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ucbstore.cxx,v $
- * $Revision: 1.17 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -1570,7 +1567,9 @@ void SAL_CALL PersistentPropertySet::setPropertyValue(
// Write state ( Now it is a directly set value )
xNameReplace->replaceByName(
OUString::createFromAscii( "State" ),
- makeAny( PropertyState_DIRECT_VALUE ) );
+ makeAny(
+ sal_Int32(
+ PropertyState_DIRECT_VALUE ) ) );
// Commit changes.
xBatch->commitChanges();
@@ -1854,7 +1853,9 @@ void SAL_CALL PersistentPropertySet::addProperty(
// Set state ( always "default" )
xNameReplace->replaceByName(
OUString::createFromAscii( "State" ),
- makeAny( PropertyState_DEFAULT_VALUE ) );
+ makeAny(
+ sal_Int32(
+ PropertyState_DEFAULT_VALUE ) ) );
// Set attributes
xNameReplace->replaceByName(
@@ -2330,7 +2331,9 @@ void SAL_CALL PersistentPropertySet::setPropertyValues(
// Write state ( Now it is a directly set value )
xNameReplace->replaceByName(
OUString::createFromAscii( "State" ),
- makeAny( PropertyState_DIRECT_VALUE ) );
+ makeAny(
+ sal_Int32(
+ PropertyState_DIRECT_VALUE ) ) );
// Commit changes.
xBatch->commitChanges();
diff --git a/ucb/source/core/ucbstore.hxx b/ucb/source/core/ucbstore.hxx
index ac420708f904..8c339337f890 100644
--- a/ucb/source/core/ucbstore.hxx
+++ b/ucb/source/core/ucbstore.hxx
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: ucbstore.hxx,v $
- * $Revision: 1.7 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify