diff options
Diffstat (limited to 'ucb/source/ucp/webdav')
52 files changed, 300 insertions, 286 deletions
diff --git a/ucb/source/ucp/webdav/ContentProperties.cxx b/ucb/source/ucp/webdav/ContentProperties.cxx index 24bcaf9e71..5332f23533 100644..100755 --- a/ucb/source/ucp/webdav/ContentProperties.cxx +++ b/ucb/source/ucp/webdav/ContentProperties.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -106,29 +106,29 @@ ContentProperties::ContentProperties( const DAVResource& rResource ) m_aEscapedTitle = aURI.GetPathBaseName(); (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")) ] - = PropertyValue( + = PropertyValue( uno::makeAny( aURI.GetPathBaseNameUnescaped() ), true ); } catch ( DAVException const & ) { (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")) ] - = PropertyValue( - uno::makeAny( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "*** unknown ***" ) ) ), + = PropertyValue( + uno::makeAny( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "*** unknown ***" ) ) ), true ); } std::vector< DAVPropertyValue >::const_iterator it = rResource.properties.begin(); - std::vector< DAVPropertyValue >::const_iterator end + std::vector< DAVPropertyValue >::const_iterator end = rResource.properties.end(); - while ( it != end ) - { + while ( it != end ) + { addProperty( (*it) ); ++it; - } + } if ( rResource.uri.getStr()[ rResource.uri.getLength() - 1 ] == sal_Unicode( '/' ) ) @@ -159,6 +159,13 @@ ContentProperties::ContentProperties( const rtl::OUString & rTitle ) } //========================================================================= +ContentProperties::ContentProperties() +: m_xProps( new PropertyValueMap ), + m_bTrailingSlash( sal_False ) +{ +} + +//========================================================================= ContentProperties::ContentProperties( const ContentProperties & rOther ) : m_aEscapedTitle( rOther.m_aEscapedTitle ), m_xProps( rOther.m_xProps.get() @@ -202,7 +209,7 @@ const PropertyValue * ContentProperties::get( { if ( (*it).first.equalsIgnoreAsciiCase( rName ) ) return &(*it).second; - + ++it; } return 0; @@ -255,7 +262,7 @@ void ContentProperties::UCBNamesToDAVNames( { if ( !bCreationDate ) { - propertyNames.push_back( DAVProperties::CREATIONDATE ); + propertyNames.push_back( DAVProperties::CREATIONDATE ); bCreationDate = sal_True; } } @@ -266,7 +273,7 @@ void ContentProperties::UCBNamesToDAVNames( { if ( !bLastModified ) { - propertyNames.push_back( + propertyNames.push_back( DAVProperties::GETLASTMODIFIED ); bLastModified = sal_True; } @@ -278,7 +285,7 @@ void ContentProperties::UCBNamesToDAVNames( { if ( !bContentType ) { - propertyNames.push_back( + propertyNames.push_back( DAVProperties::GETCONTENTTYPE ); bContentType = sal_True; } @@ -290,7 +297,7 @@ void ContentProperties::UCBNamesToDAVNames( { if ( !bContentLength ) { - propertyNames.push_back( + propertyNames.push_back( DAVProperties::GETCONTENTLENGTH ); bContentLength = sal_True; } @@ -308,7 +315,7 @@ void ContentProperties::UCBNamesToDAVNames( { if ( !bResourceType ) { - propertyNames.push_back( DAVProperties::RESOURCETYPE ); + propertyNames.push_back( DAVProperties::RESOURCETYPE ); bResourceType = sal_True; } } @@ -408,7 +415,7 @@ void ContentProperties::addProperties( { // Add it. addProperty( rName, pProp->value(), pProp->isCaseSensitive() ); - } + } else { addProperty( rName, uno::Any(), false ); @@ -423,27 +430,27 @@ void ContentProperties::addProperties( const ContentProperties & rProps ) { PropertyValueMap::const_iterator it = rProps.m_xProps->begin(); const PropertyValueMap::const_iterator end = rProps.m_xProps->end(); - + while ( it != end ) { - addProperty( + addProperty( (*it).first, (*it).second.value(), (*it).second.isCaseSensitive() ); ++it; } } //========================================================================= -void ContentProperties::addProperties( +void ContentProperties::addProperties( const std::vector< DAVPropertyValue > & rProps ) { std::vector< DAVPropertyValue >::const_iterator it = rProps.begin(); - std::vector< DAVPropertyValue >::const_iterator end = rProps.end(); - + const std::vector< DAVPropertyValue >::const_iterator end = rProps.end(); + while ( it != end ) { addProperty( (*it) ); ++it; - } + } } //========================================================================= @@ -464,7 +471,7 @@ void ContentProperties::addProperty( const rtl::OUString & rName, rValue >>= aValue; util::DateTime aDate; DateTimeHelper::convert( aValue, aDate ); - + (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DateCreated")) ] = PropertyValue( uno::makeAny( aDate ), true ); } @@ -475,11 +482,11 @@ void ContentProperties::addProperty( const rtl::OUString & rName, // { // } else if ( rName.equals( DAVProperties::GETCONTENTLENGTH ) ) - { + { // Map DAV:getcontentlength to UCP:Size rtl::OUString aValue; rValue >>= aValue; - + (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")) ] = PropertyValue( uno::makeAny( aValue.toInt64() ), true ); } @@ -488,11 +495,11 @@ void ContentProperties::addProperty( const rtl::OUString & rName, { // Do NOT map Content-Lenght entity header to DAV:getcontentlength! // Only DAV resources have this property. - + // Map Content-Length entity header to UCP:Size rtl::OUString aValue; rValue >>= aValue; - + (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Size")) ] = PropertyValue( uno::makeAny( aValue.toInt64() ), true ); } @@ -506,7 +513,7 @@ void ContentProperties::addProperty( const rtl::OUString & rName, { // Do NOT map Content-Type entity header to DAV:getcontenttype! // Only DAV resources have this property. - + // Map DAV:getcontenttype to UCP:MediaType (1:1) (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ] = PropertyValue( rValue, true ); @@ -521,7 +528,7 @@ void ContentProperties::addProperty( const rtl::OUString & rName, rValue >>= aValue; util::DateTime aDate; DateTimeHelper::convert( aValue, aDate ); - + (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DateModified")) ] = PropertyValue( uno::makeAny( aDate ), true ); } @@ -530,13 +537,13 @@ void ContentProperties::addProperty( const rtl::OUString & rName, { // Do not map Last-Modified entity header to DAV:getlastmodified! // Only DAV resources have this property. - + // Map the Last-Modified entity header to UCP:DateModified rtl::OUString aValue; rValue >>= aValue; util::DateTime aDate; DateTimeHelper::convert( aValue, aDate ); - + (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DateModified")) ] = PropertyValue( uno::makeAny( aDate ), true ); } @@ -547,12 +554,12 @@ void ContentProperties::addProperty( const rtl::OUString & rName, { rtl::OUString aValue; rValue >>= aValue; - + // Map DAV:resourceype to UCP:IsFolder, UCP:IsDocument, UCP:ContentType sal_Bool bFolder = aValue.equalsIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "collection" ) ); - + (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")) ] = PropertyValue( uno::makeAny( bFolder ), true ); (*m_xProps)[ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsDocument")) ] @@ -568,9 +575,102 @@ void ContentProperties::addProperty( const rtl::OUString & rName, // else if ( rName.equals( DAVProperties::SUPPORTEDLOCK ) ) // { // } - + // Save property. (*m_xProps)[ rName ] = PropertyValue( rValue, bIsCaseSensitive ); } +//========================================================================= +//========================================================================= +// +// CachableContentProperties Implementation. +// +//========================================================================= +//========================================================================= + +namespace +{ + bool isCachable( rtl::OUString const & rName, + bool isCaseSensitive ) + { + static rtl::OUString aNonCachableProps [] = + { + DAVProperties::LOCKDISCOVERY, + + DAVProperties::GETETAG, + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ETag" ) ), + + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateModified" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Last-Modified" ) ), + DAVProperties::GETLASTMODIFIED, + + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Content-Length" ) ), + DAVProperties::GETCONTENTLENGTH, + + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Date" ) ) + }; + + for ( sal_uInt32 n = 0; + n < ( sizeof( aNonCachableProps ) + / sizeof( aNonCachableProps[ 0 ] ) ); + ++n ) + { + if ( isCaseSensitive ) + { + if ( rName.equals( aNonCachableProps[ n ] ) ) + return false; + } + else + if ( rName.equalsIgnoreAsciiCase( aNonCachableProps[ n ] ) ) + return false; + } + return true; + } + +} // namespace + +//========================================================================= +CachableContentProperties::CachableContentProperties( + const ContentProperties & rProps ) +{ + addProperties( rProps ); +} + +//========================================================================= +void CachableContentProperties::addProperties( + const ContentProperties & rProps ) +{ + const std::auto_ptr< PropertyValueMap > & props = rProps.getProperties(); + + PropertyValueMap::const_iterator it = props->begin(); + const PropertyValueMap::const_iterator end = props->end(); + + while ( it != end ) + { + if ( isCachable( (*it).first, (*it).second.isCaseSensitive() ) ) + m_aProps.addProperty( (*it).first, + (*it).second.value(), + (*it).second.isCaseSensitive() ); + + ++it; + } +} + +//========================================================================= +void CachableContentProperties::addProperties( + const std::vector< DAVPropertyValue > & rProps ) +{ + std::vector< DAVPropertyValue >::const_iterator it = rProps.begin(); + const std::vector< DAVPropertyValue >::const_iterator end = rProps.end(); + + while ( it != end ) + { + if ( isCachable( (*it).Name, (*it).IsCaseSensitive ) ) + m_aProps.addProperty( (*it) ); + + ++it; + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/ucb/source/ucp/webdav/ContentProperties.hxx b/ucb/source/ucp/webdav/ContentProperties.hxx index f2137a8abb..bf9af15f6b 100644..100755 --- a/ucb/source/ucp/webdav/ContentProperties.hxx +++ b/ucb/source/ucp/webdav/ContentProperties.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -72,13 +72,13 @@ struct hashString class PropertyValue { private: - ::com::sun::star::uno::Any m_aValue; + ::com::sun::star::uno::Any m_aValue; bool m_bIsCaseSensitive; public: PropertyValue() : m_bIsCaseSensitive( true ) {} - + PropertyValue( const ::com::sun::star::uno::Any & rValue, bool bIsCaseSensitive ) : m_aValue( rValue), @@ -86,7 +86,7 @@ public: bool isCaseSensitive() const { return m_bIsCaseSensitive; } const ::com::sun::star::uno::Any & value() const { return m_aValue; } - + }; typedef boost::unordered_map @@ -103,10 +103,12 @@ struct DAVResource; class ContentProperties { public: - ContentProperties( const DAVResource& rResource ); + ContentProperties(); + + ContentProperties( const DAVResource& rResource ); // Mini props for transient contents. - ContentProperties( const rtl::OUString & rTitle, sal_Bool bFolder ); + ContentProperties( const rtl::OUString & rTitle, sal_Bool bFolder ); // Micro props for non-existing contents. ContentProperties( const rtl::OUString & rTitle ); @@ -168,10 +170,10 @@ public: void addProperty( const rtl::OUString & rName, const com::sun::star::uno::Any & rValue, bool bIsCaseSensitive ); - + // overwrites probably existing entry. void addProperty( const DAVPropertyValue & rProp ); - + bool isTrailingSlash() const { return m_bTrailingSlash; } const rtl::OUString & getEscapedTitle() const { return m_aEscapedTitle; } @@ -182,7 +184,7 @@ public: { return m_xProps; } private: - ::rtl::OUString m_aEscapedTitle; // escaped Title + ::rtl::OUString m_aEscapedTitle; std::auto_ptr< PropertyValueMap > m_xProps; bool m_bTrailingSlash; @@ -193,7 +195,35 @@ private: const PropertyValue * get( const rtl::OUString & rName ) const; }; -} +class CachableContentProperties +{ +private: + ContentProperties m_aProps; + + CachableContentProperties & operator=( const CachableContentProperties & ); // n.i. + CachableContentProperties( const CachableContentProperties & ); // n.i. + +public: + CachableContentProperties( const ContentProperties & rProps ); + + void addProperties( const ContentProperties & rProps ); + + void addProperties( const std::vector< DAVPropertyValue > & rProps ); + + bool containsAllNames( + const com::sun::star::uno::Sequence< + com::sun::star::beans::Property >& rProps, + std::vector< rtl::OUString > & rNamesNotContained ) const + { return m_aProps.containsAllNames( rProps, rNamesNotContained ); } + + const com::sun::star::uno::Any & + getValue( const rtl::OUString & rName ) const + { return m_aProps.getValue( rName ); } + + operator const ContentProperties & () const { return m_aProps; } +}; + +} // namespace webdav_ucp #endif /* !_WEBDAV_UCP_CONTENTPROPERTIES_HXX */ diff --git a/ucb/source/ucp/webdav/DAVAuthListener.hxx b/ucb/source/ucp/webdav/DAVAuthListener.hxx index 7e4a34b565..7e4a34b565 100644..100755 --- a/ucb/source/ucp/webdav/DAVAuthListener.hxx +++ b/ucb/source/ucp/webdav/DAVAuthListener.hxx diff --git a/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx b/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx index db5f446556..db5f446556 100644..100755 --- a/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx +++ b/ucb/source/ucp/webdav/DAVAuthListenerImpl.hxx diff --git a/ucb/source/ucp/webdav/DAVException.hxx b/ucb/source/ucp/webdav/DAVException.hxx index 014f864f1f..014f864f1f 100644..100755 --- a/ucb/source/ucp/webdav/DAVException.hxx +++ b/ucb/source/ucp/webdav/DAVException.hxx diff --git a/ucb/source/ucp/webdav/DAVProperties.cxx b/ucb/source/ucp/webdav/DAVProperties.cxx index aa3d380632..aa3d380632 100644..100755 --- a/ucb/source/ucp/webdav/DAVProperties.cxx +++ b/ucb/source/ucp/webdav/DAVProperties.cxx diff --git a/ucb/source/ucp/webdav/DAVProperties.hxx b/ucb/source/ucp/webdav/DAVProperties.hxx index 153148c16d..153148c16d 100644..100755 --- a/ucb/source/ucp/webdav/DAVProperties.hxx +++ b/ucb/source/ucp/webdav/DAVProperties.hxx diff --git a/ucb/source/ucp/webdav/DAVRequestEnvironment.hxx b/ucb/source/ucp/webdav/DAVRequestEnvironment.hxx index e19c6de2d2..e19c6de2d2 100644..100755 --- a/ucb/source/ucp/webdav/DAVRequestEnvironment.hxx +++ b/ucb/source/ucp/webdav/DAVRequestEnvironment.hxx diff --git a/ucb/source/ucp/webdav/DAVResource.hxx b/ucb/source/ucp/webdav/DAVResource.hxx index 45d9c9698d..45d9c9698d 100644..100755 --- a/ucb/source/ucp/webdav/DAVResource.hxx +++ b/ucb/source/ucp/webdav/DAVResource.hxx diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index 0024eb7340..0024eb7340 100644..100755 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/ucb/source/ucp/webdav/DAVResourceAccess.hxx index 89191971fc..89191971fc 100644..100755 --- a/ucb/source/ucp/webdav/DAVResourceAccess.hxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.hxx diff --git a/ucb/source/ucp/webdav/DAVSession.hxx b/ucb/source/ucp/webdav/DAVSession.hxx index 03cb6a23fe..03cb6a23fe 100644..100755 --- a/ucb/source/ucp/webdav/DAVSession.hxx +++ b/ucb/source/ucp/webdav/DAVSession.hxx diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.cxx b/ucb/source/ucp/webdav/DAVSessionFactory.cxx index 6438c7eca8..6438c7eca8 100644..100755 --- a/ucb/source/ucp/webdav/DAVSessionFactory.cxx +++ b/ucb/source/ucp/webdav/DAVSessionFactory.cxx diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.hxx b/ucb/source/ucp/webdav/DAVSessionFactory.hxx index 4dfd94e4ab..4dfd94e4ab 100644..100755 --- a/ucb/source/ucp/webdav/DAVSessionFactory.hxx +++ b/ucb/source/ucp/webdav/DAVSessionFactory.hxx diff --git a/ucb/source/ucp/webdav/DAVTypes.hxx b/ucb/source/ucp/webdav/DAVTypes.hxx index 647d7b81f1..647d7b81f1 100644..100755 --- a/ucb/source/ucp/webdav/DAVTypes.hxx +++ b/ucb/source/ucp/webdav/DAVTypes.hxx diff --git a/ucb/source/ucp/webdav/DateTimeHelper.cxx b/ucb/source/ucp/webdav/DateTimeHelper.cxx index 7547c01dc0..7547c01dc0 100644..100755 --- a/ucb/source/ucp/webdav/DateTimeHelper.cxx +++ b/ucb/source/ucp/webdav/DateTimeHelper.cxx diff --git a/ucb/source/ucp/webdav/DateTimeHelper.hxx b/ucb/source/ucp/webdav/DateTimeHelper.hxx index 6c598c9931..6c598c9931 100644..100755 --- a/ucb/source/ucp/webdav/DateTimeHelper.hxx +++ b/ucb/source/ucp/webdav/DateTimeHelper.hxx diff --git a/ucb/source/ucp/webdav/LinkSequence.cxx b/ucb/source/ucp/webdav/LinkSequence.cxx index 63faf0c088..f29a8b3a90 100644..100755 --- a/ucb/source/ucp/webdav/LinkSequence.cxx +++ b/ucb/source/ucp/webdav/LinkSequence.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -167,11 +167,7 @@ bool LinkSequence::createFromXML( const rtl::OString & rInData, rInData.getStr() + nStart, nEnd - nStart + TOKEN_LENGTH ); -#if NEON_VERSION >= 0x0250 success = !ne_xml_failed( parser ); -#else - success = !!ne_xml_valid( parser ); -#endif ne_xml_destroy( parser ); diff --git a/ucb/source/ucp/webdav/LinkSequence.hxx b/ucb/source/ucp/webdav/LinkSequence.hxx index d9f82491ee..d9f82491ee 100644..100755 --- a/ucb/source/ucp/webdav/LinkSequence.hxx +++ b/ucb/source/ucp/webdav/LinkSequence.hxx diff --git a/ucb/source/ucp/webdav/LockEntrySequence.cxx b/ucb/source/ucp/webdav/LockEntrySequence.cxx index 28c59326df..8819111ef8 100644..100755 --- a/ucb/source/ucp/webdav/LockEntrySequence.cxx +++ b/ucb/source/ucp/webdav/LockEntrySequence.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -216,11 +216,7 @@ bool LockEntrySequence::createFromXML( const rtl::OString & rInData, rInData.getStr() + nStart, nEnd - nStart + TOKEN_LENGTH ); -#if NEON_VERSION >= 0x0250 success = !ne_xml_failed( parser ); -#else - success = !!ne_xml_valid( parser ); -#endif ne_xml_destroy( parser ); diff --git a/ucb/source/ucp/webdav/LockEntrySequence.hxx b/ucb/source/ucp/webdav/LockEntrySequence.hxx index e28ee31dcd..e28ee31dcd 100644..100755 --- a/ucb/source/ucp/webdav/LockEntrySequence.hxx +++ b/ucb/source/ucp/webdav/LockEntrySequence.hxx diff --git a/ucb/source/ucp/webdav/LockSequence.cxx b/ucb/source/ucp/webdav/LockSequence.cxx index 61c414dfaf..896117152a 100644..100755 --- a/ucb/source/ucp/webdav/LockSequence.cxx +++ b/ucb/source/ucp/webdav/LockSequence.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -36,6 +36,8 @@ using namespace webdav_ucp; using namespace com::sun::star; +#define BEEHIVE_BUGS_WORKAROUND + ////////////////////////////////////////////////////////////////////////// struct LockSequenceParseContext @@ -129,7 +131,11 @@ extern "C" int LockSequence_startelement_callback( extern "C" int LockSequence_chardata_callback( void *userdata, int state, +#ifdef BEEHIVE_BUGS_WORKAROUND + const char *buf1, +#else const char *buf, +#endif size_t len ) { LockSequenceParseContext * pCtx @@ -137,6 +143,15 @@ extern "C" int LockSequence_chardata_callback( if ( !pCtx->pLock ) pCtx->pLock = new ucb::Lock; +#ifdef BEEHIVE_BUGS_WORKAROUND + // Beehive sends XML values containing trailing newlines. + if ( buf1[ len - 1 ] == 0x0a ) + len--; + + char * buf = new char[ len + 1 ](); + strncpy( buf, buf1, len ); +#endif + switch ( state ) { case STATE_DEPTH: @@ -208,7 +223,7 @@ extern "C" int LockSequence_chardata_callback( pCtx->pLock->Timeout = sal_Int64( -1 ); pCtx->hasTimeout = true; OSL_ENSURE( sal_False, - "LockSequence_chardata_callback - Unknown timeout!" ); + "LockSequence_chardata_callback - Unknown timeout!" ); } break; @@ -224,6 +239,11 @@ extern "C" int LockSequence_chardata_callback( } } + +#ifdef BEEHIVE_BUGS_WORKAROUND + delete [] buf; +#endif + return 0; // zero to continue, non-zero to abort parsing } @@ -324,11 +344,7 @@ bool LockSequence::createFromXML( const rtl::OString & rInData, rInData.getStr() + nStart, nEnd - nStart + TOKEN_LENGTH ); -#if NEON_VERSION >= 0x0250 success = !ne_xml_failed( parser ); -#else - success = !!ne_xml_valid( parser ); -#endif ne_xml_destroy( parser ); diff --git a/ucb/source/ucp/webdav/LockSequence.hxx b/ucb/source/ucp/webdav/LockSequence.hxx index c5cff554e1..c5cff554e1 100644..100755 --- a/ucb/source/ucp/webdav/LockSequence.hxx +++ b/ucb/source/ucp/webdav/LockSequence.hxx diff --git a/ucb/source/ucp/webdav/NeonHeadRequest.cxx b/ucb/source/ucp/webdav/NeonHeadRequest.cxx index 877e903959..d33ff2a517 100644..100755 --- a/ucb/source/ucp/webdav/NeonHeadRequest.cxx +++ b/ucb/source/ucp/webdav/NeonHeadRequest.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -38,16 +38,15 @@ using namespace com::sun::star; namespace { -#if NEON_VERSION >= 0x0250 -void process_headers(ne_request *req, - DAVResource &rResource, - const std::vector< ::rtl::OUString > &rHeaderNames) +void process_headers( ne_request * req, + DAVResource & rResource, + const std::vector< ::rtl::OUString > & rHeaderNames ) { - void *cursor = NULL; - const char *name, *value; + void * cursor = NULL; + const char * name, *value; - while ((cursor = ne_response_header_iterate(req, cursor, - &name, &value)) != NULL) { + while ( ( cursor = ne_response_header_iterate( req, cursor, + &name, &value ) ) != NULL ) { rtl::OUString aHeaderName( rtl::OUString::createFromAscii( name ) ); rtl::OUString aHeaderValue( rtl::OUString::createFromAscii( value ) ); @@ -87,69 +86,6 @@ void process_headers(ne_request *req, } } } -#else -struct NeonHeadRequestContext -{ - DAVResource * pResource; - const std::vector< ::rtl::OUString > * pHeaderNames; - - NeonHeadRequestContext( DAVResource * p, - const std::vector< ::rtl::OUString > * pHeaders ) - : pResource( p ), pHeaderNames( pHeaders ) {} -}; - -extern "C" void NHR_ResponseHeaderCatcher( void * userdata, - const char * value ) -{ - rtl::OUString aHeader( rtl::OUString::createFromAscii( value ) ); - sal_Int32 nPos = aHeader.indexOf( ':' ); - - if ( nPos != -1 ) - { - rtl::OUString aHeaderName( aHeader.copy( 0, nPos ) ); - - NeonHeadRequestContext * pCtx - = static_cast< NeonHeadRequestContext * >( userdata ); - - // Note: Empty vector means that all headers are requested. - bool bIncludeIt = ( pCtx->pHeaderNames->size() == 0 ); - - if ( !bIncludeIt ) - { - // Check whether this header was requested. - std::vector< ::rtl::OUString >::const_iterator it( - pCtx->pHeaderNames->begin() ); - const std::vector< ::rtl::OUString >::const_iterator end( - pCtx->pHeaderNames->end() ); - - while ( it != end ) - { - if ( (*it) == aHeaderName ) - break; - - ++it; - } - - if ( it != end ) - bIncludeIt = true; - } - - if ( bIncludeIt ) - { - // Create & set the PropertyValue - DAVPropertyValue thePropertyValue; - thePropertyValue.Name = aHeaderName; - thePropertyValue.IsCaseSensitive = false; - - if ( nPos < aHeader.getLength() ) - thePropertyValue.Value <<= aHeader.copy( nPos + 1 ).trim(); - - // Add the newly created PropertyValue - pCtx->pResource->properties.push_back( thePropertyValue ); - } - } -} -#endif } // namespace @@ -159,7 +95,7 @@ extern "C" void NHR_ResponseHeaderCatcher( void * userdata, extern osl::Mutex aGlobalNeonMutex; -NeonHeadRequest::NeonHeadRequest( HttpSession* inSession, +NeonHeadRequest::NeonHeadRequest( HttpSession * inSession, const rtl::OUString & inPath, const std::vector< ::rtl::OUString > & inHeaderNames, @@ -177,19 +113,12 @@ NeonHeadRequest::NeonHeadRequest( HttpSession* inSession, inPath, RTL_TEXTENCODING_UTF8 ) ); -#if NEON_VERSION < 0x0250 - NeonHeadRequestContext aCtx( &ioResource, &inHeaderNames ); - ne_add_response_header_catcher( req, NHR_ResponseHeaderCatcher, &aCtx ); -#endif - { osl::Guard< osl::Mutex > theGlobalGuard( aGlobalNeonMutex ); nError = ne_request_dispatch( req ); } -#if NEON_VERSION >= 0x0250 - process_headers(req, ioResource, inHeaderNames); -#endif + process_headers( req, ioResource, inHeaderNames ); if ( nError == NE_OK && ne_get_status( req )->klass != 2 ) nError = NE_ERROR; diff --git a/ucb/source/ucp/webdav/NeonHeadRequest.hxx b/ucb/source/ucp/webdav/NeonHeadRequest.hxx index 4f58a3e2cc..4f58a3e2cc 100644..100755 --- a/ucb/source/ucp/webdav/NeonHeadRequest.hxx +++ b/ucb/source/ucp/webdav/NeonHeadRequest.hxx diff --git a/ucb/source/ucp/webdav/NeonInputStream.cxx b/ucb/source/ucp/webdav/NeonInputStream.cxx index 53f816b4a1..53f816b4a1 100644..100755 --- a/ucb/source/ucp/webdav/NeonInputStream.cxx +++ b/ucb/source/ucp/webdav/NeonInputStream.cxx diff --git a/ucb/source/ucp/webdav/NeonInputStream.hxx b/ucb/source/ucp/webdav/NeonInputStream.hxx index 20d0c9c080..20d0c9c080 100644..100755 --- a/ucb/source/ucp/webdav/NeonInputStream.hxx +++ b/ucb/source/ucp/webdav/NeonInputStream.hxx diff --git a/ucb/source/ucp/webdav/NeonLockStore.cxx b/ucb/source/ucp/webdav/NeonLockStore.cxx index 7868a64816..7868a64816 100644..100755 --- a/ucb/source/ucp/webdav/NeonLockStore.cxx +++ b/ucb/source/ucp/webdav/NeonLockStore.cxx diff --git a/ucb/source/ucp/webdav/NeonLockStore.hxx b/ucb/source/ucp/webdav/NeonLockStore.hxx index c36f922c6a..c36f922c6a 100644..100755 --- a/ucb/source/ucp/webdav/NeonLockStore.hxx +++ b/ucb/source/ucp/webdav/NeonLockStore.hxx diff --git a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx index 8256d97d49..7c1e2b07a3 100644..100755 --- a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx +++ b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -195,22 +195,13 @@ extern "C" int NPFR_propfind_iter( void* userdata, // ------------------------------------------------------------------- extern "C" void NPFR_propfind_results( void* userdata, -#if NEON_VERSION >= 0x0260 const ne_uri* uri, -#else - const char* href, -#endif const NeonPropFindResultSet* set ) { // @@@ href is not the uri! DAVResource ctor wants uri! -#if NEON_VERSION >= 0x0260 DAVResource theResource( OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) ); -#else - DAVResource theResource( - OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) ); -#endif ne_propset_iterate( set, NPFR_propfind_iter, &theResource ); @@ -237,22 +228,13 @@ extern "C" int NPFR_propnames_iter( void* userdata, // ------------------------------------------------------------------- extern "C" void NPFR_propnames_results( void* userdata, -#if NEON_VERSION >= 0x0260 const ne_uri* uri, -#else - const char* href, -#endif const NeonPropFindResultSet* results ) { // @@@ href is not the uri! DAVResourceInfo ctor wants uri! // Create entry for the resource. -#if NEON_VERSION >= 0x0260 DAVResourceInfo theResource( OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) ); -#else - DAVResourceInfo theResource( - OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) ); -#endif // Fill entry. ne_propset_iterate( results, NPFR_propnames_iter, &theResource ); diff --git a/ucb/source/ucp/webdav/NeonPropFindRequest.hxx b/ucb/source/ucp/webdav/NeonPropFindRequest.hxx index cd4b5ded17..cd4b5ded17 100644..100755 --- a/ucb/source/ucp/webdav/NeonPropFindRequest.hxx +++ b/ucb/source/ucp/webdav/NeonPropFindRequest.hxx diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx index 9d3232b6e9..7df353ea85 100644..100755 --- a/ucb/source/ucp/webdav/NeonSession.cxx +++ b/ucb/source/ucp/webdav/NeonSession.cxx @@ -185,11 +185,7 @@ struct NeonRequestContext // A simple Neon response_block_reader for use with an XInputStream // ------------------------------------------------------------------- -#if NEON_VERSION >= 0x0250 extern "C" int NeonSession_ResponseBlockReader(void * inUserData, -#else -extern "C" void NeonSession_ResponseBlockReader(void * inUserData, -#endif const char * inBuf, size_t inLen ) { @@ -205,9 +201,7 @@ extern "C" void NeonSession_ResponseBlockReader(void * inUserData, if ( xInputStream.is() ) xInputStream->AddToStream( inBuf, inLen ); } -#if NEON_VERSION >= 0x0250 return 0; -#endif } // ------------------------------------------------------------------- @@ -215,11 +209,7 @@ extern "C" void NeonSession_ResponseBlockReader(void * inUserData, // A simple Neon response_block_reader for use with an XOutputStream // ------------------------------------------------------------------- -#if NEON_VERSION >= 0x0250 extern "C" int NeonSession_ResponseBlockWriter( void * inUserData, -#else -extern "C" void NeonSession_ResponseBlockWriter( void * inUserData, -#endif const char * inBuf, size_t inLen ) { @@ -237,9 +227,7 @@ extern "C" void NeonSession_ResponseBlockWriter( void * inUserData, xOutputStream->writeBytes( aSeq ); } } -#if NEON_VERSION >= 0x0250 return 0; -#endif } // ------------------------------------------------------------------- @@ -1923,11 +1911,6 @@ int NeonSession::GET( ne_session * sess, ne_request * req = ne_request_create( sess, "GET", uri ); int ret; -#if NEON_VERSION < 0x0250 - if ( getheaders ) - ne_add_response_header_catcher( - req, runResponseHeaderHandler, userdata ); -#endif ne_decompress * dc = ne_decompress_reader( req, ne_accept_2xx, reader, userdata ); @@ -1936,7 +1919,6 @@ int NeonSession::GET( ne_session * sess, ret = ne_request_dispatch( req ); } -#if NEON_VERSION >= 0x0250 if ( getheaders ) { void *cursor = NULL; @@ -1950,7 +1932,7 @@ int NeonSession::GET( ne_session * sess, runResponseHeaderHandler(userdata, buffer); } } -#endif + if ( ret == NE_OK && ne_get_status( req )->klass != 2 ) ret = NE_ERROR; diff --git a/ucb/source/ucp/webdav/NeonSession.hxx b/ucb/source/ucp/webdav/NeonSession.hxx index c6586ea4fd..c6586ea4fd 100644..100755 --- a/ucb/source/ucp/webdav/NeonSession.hxx +++ b/ucb/source/ucp/webdav/NeonSession.hxx diff --git a/ucb/source/ucp/webdav/NeonTypes.hxx b/ucb/source/ucp/webdav/NeonTypes.hxx index 5b77368697..5b77368697 100644..100755 --- a/ucb/source/ucp/webdav/NeonTypes.hxx +++ b/ucb/source/ucp/webdav/NeonTypes.hxx diff --git a/ucb/source/ucp/webdav/NeonUri.cxx b/ucb/source/ucp/webdav/NeonUri.cxx index e36965373f..fd88795bef 100644..100755 --- a/ucb/source/ucp/webdav/NeonUri.cxx +++ b/ucb/source/ucp/webdav/NeonUri.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -60,36 +60,24 @@ using namespace webdav_ucp; namespace { const ne_uri g_sUriDefaultsHTTP = { "http", -#if NEON_VERSION >= 0x0260 NULL, -#endif NULL, DEFAULT_HTTP_PORT, -#if NEON_VERSION >= 0x0260 NULL, -#endif NULL, NULL }; const ne_uri g_sUriDefaultsHTTPS = { "https", -#if NEON_VERSION >= 0x0260 NULL, -#endif NULL, DEFAULT_HTTPS_PORT, -#if NEON_VERSION >= 0x0260 NULL, -#endif NULL, NULL }; const ne_uri g_sUriDefaultsFTP = { "ftp", -#if NEON_VERSION >= 0x0260 NULL, -#endif NULL, DEFAULT_FTP_PORT, -#if NEON_VERSION >= 0x0260 NULL, -#endif NULL, NULL }; } // namespace @@ -175,11 +163,7 @@ void NeonUri::init( const rtl::OString & rUri, const ne_uri * pUri ) pUri->scheme ? pUri->scheme : pUriDefs->scheme, RTL_TEXTENCODING_UTF8 ); mUserInfo = rtl::OStringToOUString( -#if NEON_VERSION >= 0x0260 pUri->userinfo ? pUri->userinfo : pUriDefs->userinfo, -#else - pUri->authinfo ? pUri->authinfo : pUriDefs->authinfo, -#endif RTL_TEXTENCODING_UTF8 ); mHostName = rtl::OStringToOUString( pUri->host ? pUri->host : pUriDefs->host, @@ -189,7 +173,6 @@ void NeonUri::init( const rtl::OString & rUri, const ne_uri * pUri ) pUri->path ? pUri->path : pUriDefs->path, RTL_TEXTENCODING_UTF8 ); -#if NEON_VERSION >= 0x0260 if ( pUri->query ) { mPath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("?")); @@ -203,7 +186,6 @@ void NeonUri::init( const rtl::OString & rUri, const ne_uri * pUri ) mPath += rtl::OStringToOUString( pUri->fragment, RTL_TEXTENCODING_UTF8 ); } -#endif } // ------------------------------------------------------------------- diff --git a/ucb/source/ucp/webdav/NeonUri.hxx b/ucb/source/ucp/webdav/NeonUri.hxx index 47dd22a6ea..47dd22a6ea 100644..100755 --- a/ucb/source/ucp/webdav/NeonUri.hxx +++ b/ucb/source/ucp/webdav/NeonUri.hxx diff --git a/ucb/source/ucp/webdav/PropertyMap.hxx b/ucb/source/ucp/webdav/PropertyMap.hxx index 01d5dd0844..01d5dd0844 100644..100755 --- a/ucb/source/ucp/webdav/PropertyMap.hxx +++ b/ucb/source/ucp/webdav/PropertyMap.hxx diff --git a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx index c89158b110..ef76f5784c 100644..100755 --- a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx +++ b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -362,11 +362,7 @@ bool UCBDeadPropertyValue::createFromXML( const rtl::OString & rInData, ne_xml_parse( parser, rInData.getStr(), rInData.getLength() ); -#if NEON_VERSION >= 0x0250 success = !ne_xml_failed( parser ); -#else - success = !!ne_xml_valid( parser ); -#endif ne_xml_destroy( parser ); diff --git a/ucb/source/ucp/webdav/UCBDeadPropertyValue.hxx b/ucb/source/ucp/webdav/UCBDeadPropertyValue.hxx index 5720df28b4..5720df28b4 100644..100755 --- a/ucb/source/ucp/webdav/UCBDeadPropertyValue.hxx +++ b/ucb/source/ucp/webdav/UCBDeadPropertyValue.hxx diff --git a/ucb/source/ucp/webdav/makefile.mk b/ucb/source/ucp/webdav/makefile.mk index 73ee298697..162d582664 100644..100755 --- a/ucb/source/ucp/webdav/makefile.mk +++ b/ucb/source/ucp/webdav/makefile.mk @@ -158,3 +158,11 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ---------------------------------------------------------- .INCLUDE: target.mk + +ALLTAR : $(MISC)/ucpdav1.component + +$(MISC)/ucpdav1.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + ucpdav1.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt ucpdav1.component diff --git a/ucb/source/ucp/webdav/ucpdav.xml b/ucb/source/ucp/webdav/ucpdav.xml index 3a462c21f7..3a462c21f7 100644..100755 --- a/ucb/source/ucp/webdav/ucpdav.xml +++ b/ucb/source/ucp/webdav/ucpdav.xml diff --git a/ucb/source/ucp/webdav/ucpdav1.component b/ucb/source/ucp/webdav/ucpdav1.component new file mode 100755 index 0000000000..4e18b566e1 --- /dev/null +++ b/ucb/source/ucp/webdav/ucpdav1.component @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* 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. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.WebDAVContentProvider"> + <service name="com.sun.star.ucb.WebDAVContentProvider"/> + </implementation> +</component> diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index 69f5a69d37..2f5adff8e2 100644..100755 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -1163,7 +1163,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( std::auto_ptr< ContentProperties > xProps; std::auto_ptr< ContentProperties > xCachedProps; std::auto_ptr< DAVResourceAccess > xResAccess; - rtl::OUString aEscapedTitle; + rtl::OUString aUnescapedTitle; bool bHasAll = false; uno::Reference< lang::XMultiServiceFactory > xSMgr; uno::Reference< ucb::XContentIdentifier > xIdentifier; @@ -1172,7 +1172,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - aEscapedTitle = NeonUri::unescape( m_aEscapedTitle ); + aUnescapedTitle = NeonUri::unescape( m_aEscapedTitle ); xSMgr.set( m_xSMgr ); xIdentifier.set( m_xIdentifier ); xProvider.set( m_xProvider.get() ); @@ -1345,7 +1345,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if ( m_eResourceType == NON_DAV ) xProps->addProperties( aMissingProps, ContentProperties( - aEscapedTitle, + aUnescapedTitle, false ) ); } catch ( DAVException const & e ) @@ -1366,32 +1366,33 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // might trigger HTTP redirect. // Therefore, title must be updated here. NeonUri aUri( xResAccess->getURL() ); - aEscapedTitle = aUri.GetPathBaseName(); + aUnescapedTitle = aUri.GetPathBaseNameUnescaped(); - if ( UNKNOWN == rType ) + if ( rType == UNKNOWN ) { - xProps.reset( new ContentProperties( aEscapedTitle ) ); + xProps.reset( new ContentProperties( aUnescapedTitle ) ); } // For DAV resources we only know the Title, for non-DAV // resources we additionally know that it is a document. - if ( DAV == rType ) + + if ( rType == DAV ) { //xProps.reset( - // new ContentProperties( aEscapedTitle ) ); + // new ContentProperties( aUnescapedTitle ) ); xProps->addProperty( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), - uno::makeAny( aEscapedTitle ), + uno::makeAny( aUnescapedTitle ), true ); } else { if ( !xProps.get() ) - xProps.reset( new ContentProperties( aEscapedTitle, false ) ); + xProps.reset( new ContentProperties( aUnescapedTitle, false ) ); else xProps->addProperty( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), - uno::makeAny( aEscapedTitle ), + uno::makeAny( aUnescapedTitle ), true ); xProps->addProperty( @@ -1409,7 +1410,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // No server access for just created (not yet committed) objects. // Only a minimal set of properties supported at this stage. if (m_bTransient) - xProps.reset( new ContentProperties( aEscapedTitle, + xProps.reset( new ContentProperties( aUnescapedTitle, m_bCollection ) ); } @@ -1455,12 +1456,12 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( osl::Guard< osl::Mutex > aGuard( m_aMutex ); if ( !m_xCachedProps.get() ) - m_xCachedProps.reset( new ContentProperties( *xProps.get() ) ); + m_xCachedProps.reset( new CachableContentProperties( *xProps.get() ) ); else m_xCachedProps->addProperties( *xProps.get() ); m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); - m_aEscapedTitle = aEscapedTitle; + m_aEscapedTitle = NeonUri::escapeSegment( aUnescapedTitle ); } return xResultRow; @@ -1991,7 +1992,7 @@ uno::Any Content::open( // cache headers. if ( !m_xCachedProps.get()) m_xCachedProps.reset( - new ContentProperties( aResource ) ); + new CachableContentProperties( aResource ) ); else m_xCachedProps->addProperties( aResource ); @@ -2037,7 +2038,7 @@ uno::Any Content::open( // cache headers. if ( !m_xCachedProps.get()) m_xCachedProps.reset( - new ContentProperties( aResource ) ); + new CachableContentProperties( aResource ) ); else m_xCachedProps->addProperties( aResource.properties ); @@ -2927,6 +2928,20 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) // Map DAVException... uno::Any aException; + rtl::OUString aURL; + if ( m_bTransient ) + { + aURL = getParentURL(); + if ( aURL.lastIndexOf( '/' ) != ( aURL.getLength() - 1 ) ) + aURL += rtl::OUString::createFromAscii( "/" ); + + aURL += m_aEscapedTitle; + } + else + { + aURL = m_xIdentifier->getContentIdentifier(); + } + switch ( e.getStatus() ) { case SC_NOT_FOUND: @@ -2934,7 +2949,7 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) uno::Sequence< uno::Any > aArgs( 1 ); aArgs[ 0 ] <<= beans::PropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")), -1, - uno::makeAny(m_xIdentifier->getContentIdentifier()), + uno::makeAny(aURL), beans::PropertyState_DIRECT_VALUE); aException <<= @@ -3024,14 +3039,14 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Locked!")), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - m_xIdentifier->getContentIdentifier(), - sal_True ); + aURL, + sal_False ); // not SelfOwned #else { uno::Sequence< uno::Any > aArgs( 1 ); aArgs[ 0 ] <<= beans::PropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Uri")), -1, - uno::makeAny(m_xIdentifier->getContentIdentifier()), + uno::makeAny(aURL), beans::PropertyState_DIRECT_VALUE); aException <<= @@ -3051,8 +3066,8 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Locked (self)!")), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - m_xIdentifier->getContentIdentifier(), - sal_True ); + aURL, + sal_True ); // SelfOwned break; case DAVException::DAV_NOT_LOCKED: @@ -3061,7 +3076,7 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Not locked!")), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - m_xIdentifier->getContentIdentifier() ); + aURL ); break; case DAVException::DAV_LOCK_EXPIRED: @@ -3070,7 +3085,7 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Lock expired!")), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, - m_xIdentifier->getContentIdentifier() ); + aURL ); break; default: @@ -3194,7 +3209,7 @@ const Content::ResourceType & Content::getResourceType( if ( resources.size() == 1 ) { m_xCachedProps.reset( - new ContentProperties( resources[ 0 ] ) ); + new CachableContentProperties( resources[ 0 ] ) ); m_xCachedProps->containsAllNames( aProperties, m_aFailedPropNames ); } diff --git a/ucb/source/ucp/webdav/webdavcontent.hxx b/ucb/source/ucp/webdav/webdavcontent.hxx index b18369866f..051e6382e7 100644..100755 --- a/ucb/source/ucp/webdav/webdavcontent.hxx +++ b/ucb/source/ucp/webdav/webdavcontent.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * 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 @@ -69,6 +69,7 @@ namespace webdav_ucp class ContentProvider; class ContentProperties; +class CachableContentProperties; class Content : public ::ucbhelper::ContentImplHelper, public com::sun::star::ucb::XContentCreator @@ -82,7 +83,8 @@ class Content : public ::ucbhelper::ContentImplHelper, }; std::auto_ptr< DAVResourceAccess > m_xResAccess; - std::auto_ptr< ContentProperties > m_xCachedProps; // locally cached props + std::auto_ptr< CachableContentProperties > + m_xCachedProps; // locally cached props rtl::OUString m_aEscapedTitle; ResourceType m_eResourceType; ContentProvider* m_pProvider; // No need for a ref, base class holds object diff --git a/ucb/source/ucp/webdav/webdavcontentcaps.cxx b/ucb/source/ucp/webdav/webdavcontentcaps.cxx index 412e883a44..412e883a44 100644..100755 --- a/ucb/source/ucp/webdav/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav/webdavcontentcaps.cxx diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.cxx b/ucb/source/ucp/webdav/webdavdatasupplier.cxx index cfafcdbd84..cfafcdbd84 100644..100755 --- a/ucb/source/ucp/webdav/webdavdatasupplier.cxx +++ b/ucb/source/ucp/webdav/webdavdatasupplier.cxx diff --git a/ucb/source/ucp/webdav/webdavdatasupplier.hxx b/ucb/source/ucp/webdav/webdavdatasupplier.hxx index 8b2d9e1a20..8b2d9e1a20 100644..100755 --- a/ucb/source/ucp/webdav/webdavdatasupplier.hxx +++ b/ucb/source/ucp/webdav/webdavdatasupplier.hxx diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx index 000de00c4b..000de00c4b 100644..100755 --- a/ucb/source/ucp/webdav/webdavprovider.cxx +++ b/ucb/source/ucp/webdav/webdavprovider.cxx diff --git a/ucb/source/ucp/webdav/webdavprovider.hxx b/ucb/source/ucp/webdav/webdavprovider.hxx index aeff294269..aeff294269 100644..100755 --- a/ucb/source/ucp/webdav/webdavprovider.hxx +++ b/ucb/source/ucp/webdav/webdavprovider.hxx diff --git a/ucb/source/ucp/webdav/webdavresultset.cxx b/ucb/source/ucp/webdav/webdavresultset.cxx index c60e55a58c..c60e55a58c 100644..100755 --- a/ucb/source/ucp/webdav/webdavresultset.cxx +++ b/ucb/source/ucp/webdav/webdavresultset.cxx diff --git a/ucb/source/ucp/webdav/webdavresultset.hxx b/ucb/source/ucp/webdav/webdavresultset.hxx index 84d9d92d2e..84d9d92d2e 100644..100755 --- a/ucb/source/ucp/webdav/webdavresultset.hxx +++ b/ucb/source/ucp/webdav/webdavresultset.hxx diff --git a/ucb/source/ucp/webdav/webdavservices.cxx b/ucb/source/ucp/webdav/webdavservices.cxx index deaec146fc..a3acc8d3b1 100644..100755 --- a/ucb/source/ucp/webdav/webdavservices.cxx +++ b/ucb/source/ucp/webdav/webdavservices.cxx @@ -36,45 +36,6 @@ using namespace com::sun::star; //========================================================================= -static sal_Bool writeInfo( void * pRegistryKey, - const rtl::OUString & rImplementationName, - uno::Sequence< rtl::OUString > const & rServiceNames ) -{ - rtl::OUString aKeyName( RTL_CONSTASCII_USTRINGPARAM("/") ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); - - uno::Reference< registry::XRegistryKey > xKey; - try - { - xKey = static_cast< registry::XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) - { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) - { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( registry::InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - -//========================================================================= extern "C" void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ ) { @@ -82,21 +43,6 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( } //========================================================================= -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * /*pServiceManager*/, void * pRegistryKey ) -{ - return pRegistryKey && - - ////////////////////////////////////////////////////////////////////// - // WebDAV Content Provider. - ////////////////////////////////////////////////////////////////////// - - writeInfo( pRegistryKey, - ::webdav_ucp::ContentProvider::getImplementationName_Static(), - ::webdav_ucp::ContentProvider::getSupportedServiceNames_Static() ); -} - -//========================================================================= extern "C" void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) { |