CMIS urls: remove +atom in the internal URLS as the binding is guessed

Change-Id: I9ae0704f1e5203778e97de5843efe777ba717271
This commit is contained in:
Cédric Bosdonnat 2012-10-16 12:53:31 +02:00
parent c88c9b4ff2
commit 4cc2571e49
10 changed files with 19 additions and 19 deletions

View file

@ -202,7 +202,7 @@
<value>com.sun.star.ucb.CmisContentProvider</value>
</prop>
<prop oor:name="URLTemplate">
<value>vnd.libreoffice.cmis+atom</value>
<value>vnd.libreoffice.cmis</value>
</prop>
<prop oor:name="Arguments">
<value/>

View file

@ -310,7 +310,7 @@ INetURLObject CmisDetailsContainer::getUrl( )
rtl_UriCharClassRelSegment,
rtl_UriEncodeKeepEscapes,
RTL_TEXTENCODING_UTF8 );
sUrl = "vnd.libreoffice.cmis+atom://" + sEncodedBinding;
sUrl = "vnd.libreoffice.cmis://" + sEncodedBinding;
}
return INetURLObject( sUrl );
@ -318,7 +318,7 @@ INetURLObject CmisDetailsContainer::getUrl( )
bool CmisDetailsContainer::setUrl( const INetURLObject& rUrl )
{
bool bSuccess = rUrl.GetProtocol() == INET_PROT_CMIS_ATOM;
bool bSuccess = rUrl.GetProtocol() == INET_PROT_CMIS;
if ( bSuccess )
{
@ -380,7 +380,7 @@ IMPL_LINK( CmisDetailsContainer, RefreshReposHdl, void *, EMPTYARG )
rtl_UriCharClassRelSegment,
rtl_UriEncodeKeepEscapes,
RTL_TEXTENCODING_UTF8 );
sUrl = "vnd.libreoffice.cmis+atom://" + sEncodedBinding;
sUrl = "vnd.libreoffice.cmis://" + sEncodedBinding;
}
// Get the Content

View file

@ -102,7 +102,7 @@ enum INetProtocol
INET_PROT_SMB = 31,
INET_PROT_HID = 32,
INET_PROT_SFTP = 33,
INET_PROT_CMIS_ATOM = 34,
INET_PROT_CMIS = 34,
INET_PROT_END = 35
};

View file

@ -246,25 +246,25 @@ namespace tools_urlobj
// Test with a username part
{
INetURLObject aUrl( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"vnd.libreoffice.cmis+atom://username@http:%2F%2Ffoo.bar.com:8080%2Fmy%2Fcmis%2Fatom%23repo-id-encoded/path/to/content" ) ) );
"vnd.libreoffice.cmis://username@http:%2F%2Ffoo.bar.com:8080%2Fmy%2Fcmis%2Fatom%23repo-id-encoded/path/to/content" ) ) );
CPPUNIT_ASSERT_EQUAL( std::string( "http://foo.bar.com:8080/my/cmis/atom#repo-id-encoded" ),
OUSTR_TO_STDSTR( aUrl.GetHost( INetURLObject::DECODE_WITH_CHARSET ) ) );
CPPUNIT_ASSERT_EQUAL( std::string( "username" ), OUSTR_TO_STDSTR( aUrl.GetUser( ) ) );
CPPUNIT_ASSERT_EQUAL( std::string( "/path/to/content" ),
OUSTR_TO_STDSTR( aUrl.GetURLPath( INetURLObject::NO_DECODE ) ) );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong protocol found", INET_PROT_CMIS_ATOM, aUrl.GetProtocol( ) );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong protocol found", INET_PROT_CMIS, aUrl.GetProtocol( ) );
}
// Test without a username part
{
INetURLObject aUrl( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
"vnd.libreoffice.cmis+atom://http:%2F%2Ffoo.bar.com:8080%2Fmy%2Fcmis%2Fatom%23repo-id-encoded/path/to/content" ) ) );
"vnd.libreoffice.cmis://http:%2F%2Ffoo.bar.com:8080%2Fmy%2Fcmis%2Fatom%23repo-id-encoded/path/to/content" ) ) );
CPPUNIT_ASSERT_EQUAL( std::string( "http://foo.bar.com:8080/my/cmis/atom#repo-id-encoded" ),
OUSTR_TO_STDSTR( aUrl.GetHost( INetURLObject::DECODE_WITH_CHARSET ) ) );
CPPUNIT_ASSERT( !aUrl.HasUserData() );
CPPUNIT_ASSERT_EQUAL( std::string( "/path/to/content" ),
OUSTR_TO_STDSTR( aUrl.GetURLPath( INetURLObject::NO_DECODE ) ) );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong protocol found", INET_PROT_CMIS_ATOM, aUrl.GetProtocol( ) );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "Wrong protocol found", INET_PROT_CMIS, aUrl.GetProtocol( ) );
}
}

View file

@ -403,7 +403,7 @@ static INetURLObject::SchemeInfo const aSchemeInfoMap[INET_PROT_END]
false, true },
{ "sftp", "sftp://", 22, true, true, false, true, true, true, true,
true },
{ "vnd.libreoffice.cmis+atom", "vnd.libreoffice.cmis+atom://", 0, true, true, false,
{ "vnd.libreoffice.cmis", "vnd.libreoffice.cmis://", 0, true, true, false,
false, true, false, true, true } };
// static
@ -916,7 +916,7 @@ bool INetURLObject::setAbsURIRef(rtl::OUString const & rTheAbsURIRef,
}
case INET_PROT_VND_SUN_STAR_PKG:
case INET_PROT_CMIS_ATOM:
case INET_PROT_CMIS:
{
if (pEnd - pPos < 2 || *pPos++ != '/' || *pPos++ != '/')
{
@ -2180,7 +2180,7 @@ INetURLObject::PrefixInfo const * INetURLObject::getPrefix(sal_Unicode const *&
{ "telnet:", 0, INET_PROT_TELNET, PrefixInfo::OFFICIAL },
{ "vim:", "staroffice.vim:", INET_PROT_VIM,
PrefixInfo::INTERNAL },
{ "vnd.libreoffice.cmis+atom:", 0, INET_PROT_CMIS_ATOM, PrefixInfo::INTERNAL },
{ "vnd.libreoffice.cmis:", 0, INET_PROT_CMIS, PrefixInfo::INTERNAL },
{ "vnd.sun.star.cmd:", 0, INET_PROT_VND_SUN_STAR_CMD,
PrefixInfo::OFFICIAL },
{ "vnd.sun.star.expand:", 0, INET_PROT_VND_SUN_STAR_EXPAND,
@ -2966,7 +2966,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
case INET_PROT_VND_SUN_STAR_WEBDAV:
case INET_PROT_HTTPS:
case INET_PROT_SMB:
case INET_PROT_CMIS_ATOM:
case INET_PROT_CMIS:
if (pPos < pEnd && *pPos != '/')
return false;
while (pPos < pEnd && *pPos != nQueryDelimiter

View file

@ -649,7 +649,7 @@ namespace cmis
{
// If the source isn't on the same CMIS repository, then simply copy
INetURLObject aSourceUrl( rTransferInfo.SourceURL );
if ( aSourceUrl.GetProtocol() != INET_PROT_CMIS_ATOM )
if ( aSourceUrl.GetProtocol() != INET_PROT_CMIS )
{
rtl::OUString sSrcBindingUrl = URL( rTransferInfo.SourceURL ).getBindingUrl( );
if ( sSrcBindingUrl != m_aURL.getBindingUrl( ) )

View file

@ -61,8 +61,8 @@ namespace ucbhelper
namespace cmis
{
#define CMIS_FILE_TYPE "application/vnd.sun.staroffice.cmis-file"
#define CMIS_FOLDER_TYPE "application/vnd.sun.staroffice.cmis-folder"
#define CMIS_FILE_TYPE "application/vnd.libreoffice.cmis-file"
#define CMIS_FOLDER_TYPE "application/vnd.libreoffice.cmis-folder"
class ContentProvider;
class Content : public ::ucbhelper::ContentImplHelper,

View file

@ -378,7 +378,7 @@ namespace cmis
rtl_UriCharClassRelSegment,
rtl_UriEncodeKeepEscapes,
RTL_TEXTENCODING_UTF8 );
sUrl = "vnd.libreoffice.cmis+atom://" + sEncodedBinding;
sUrl = "vnd.libreoffice.cmis://" + sEncodedBinding;
uno::Reference< ucb::XContentIdentifier > xId = new ucbhelper::ContentIdentifier( sUrl );
uno::Reference< ucb::XContent > xContent = new Content( m_xSMgr, m_pProvider, xId );

View file

@ -60,7 +60,7 @@ namespace ucbhelper
namespace cmis
{
#define CMIS_REPO_TYPE "application/vnd.sun.staroffice.cmis-repository"
#define CMIS_REPO_TYPE "application/vnd.libreoffice.cmis-repository"
class ContentProvider;
class RepoContent : public ::ucbhelper::ContentImplHelper,

View file

@ -103,7 +103,7 @@ namespace cmis
rtl_UriCharClassRelSegment,
rtl_UriEncodeKeepEscapes,
RTL_TEXTENCODING_UTF8 );
sUrl = "vnd.libreoffice.cmis+atom://" + sEncodedBinding;
sUrl = "vnd.libreoffice.cmis://" + sEncodedBinding;
if ( !m_sPath.isEmpty( ) )
{