OneDrive binding settings

Change-Id: I72c97931098c1a029d39532e3433c0aeaba73e3f
This commit is contained in:
Mihai Varga
2014-06-23 19:14:08 +03:00
committed by Miklos Vajna
parent a7b86c0e64
commit fc1bfd9e6d
6 changed files with 60 additions and 1 deletions

View File

@@ -33,6 +33,16 @@
#define ALFRESCO_CLOUD_REDIRECT_URI "http://127.0.0.1/Callback"
#define ALFRESCO_CLOUD_SCOPE "public_api"
/* OneDrive */
#define ONEDRIVE_BASE_URL "https://apis.live.net/v5.0"
#define ONEDRIVE_CLIENT_ID ""
#define ONEDRIVE_CLIENT_SECRET ""
#define ONEDRIVE_AUTH_URL "https://login.live.com/oauth20_authorize.srf"
#define ONEDRIVE_TOKEN_URL "https://login.live.com/oauth20_token.srf"
#define ONEDRIVE_REDIRECT_URI "https://login.live.com/oauth20_desktop.srf"
#define ONEDRIVE_SCOPE "wl.offline_access"
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -2225,6 +2225,19 @@ AC_ARG_WITH(alfresco-cloud-client-secret,
--with-alfresco-cloud-client-id is empty, the feature will be disabled]),
)
AC_ARG_WITH(onedrive-client-id,
AS_HELP_STRING([--with-onedrive-client-id],
[Provides the client id of the application for OAuth2 authentication
on OneDrive. If either this or --with-onedrive-client-secret is
empty, the feature will be disabled]),
)
AC_ARG_WITH(onedrive-client-secret,
AS_HELP_STRING([--with-onedrive-client-secret],
[Provides the client secret of the application for OAuth2
authentication on OneDrive. If either this or
--with-onedrive-client-id is empty, the feature will be disabled]),
)
dnl ===================================================================
dnl Do we want to use pre-build binary tarball for recompile
dnl ===================================================================
@@ -12361,6 +12374,26 @@ fi
AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_ID, $ALFRESCO_CLOUD_CLIENT_ID)
AC_DEFINE_UNQUOTED(ALFRESCO_CLOUD_CLIENT_SECRET, $ALFRESCO_CLOUD_CLIENT_SECRET)
AC_MSG_CHECKING([for OneDrive client id and secret])
ONEDRIVE_CLIENT_ID="\"$with_onedrive_client_id\""
ONEDRIVE_CLIENT_SECRET="\"$with_onedrive_client_secret\""
if test "$with_onedrive_client_id" = "no" -o -z "$with_onedrive_client_id"; then
ONEDRIVE_CLIENT_ID="\"\""
fi
if test "$with_onedrive_client_secret" = "no" -o -z "$with_onedrive_client_secret"; then
ONEDRIVE_CLIENT_SECRET="\"\""
fi
if test -z "$ONEDRIVE_CLIENT_ID" -o -z "$ONEDRIVE_CLIENT_SECRET"; then
AC_MSG_RESULT([not set])
else
AC_MSG_RESULT([set])
fi
AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_ID, $ONEDRIVE_CLIENT_ID)
AC_DEFINE_UNQUOTED(ONEDRIVE_CLIENT_SECRET, $ONEDRIVE_CLIENT_SECRET)
# ===================================================================
# De- or increase default verbosity of build process
# ===================================================================

View File

@@ -580,6 +580,7 @@
<it>http://ec2-184-72-233-127.compute-1.amazonaws.com/ot-cmis/services/RepositoryService?wsdl</it>
<it>http://&lt;host&gt;/_vti_bin/CMISSoapwsdl.aspx</it>
<it>https://www.googleapis.com/drive/v2</it>
<it>https://apis.live.net/v5.0</it>
</value>
</prop>
<prop oor:name="CmisServersNames">
@@ -594,6 +595,7 @@
<it>OpenText ELS 10.2.0</it>
<it>SharePoint 2010</it>
<it>Google Drive</it>
<it>OneDrive</it>
</value>
</prop>
</node>

View File

@@ -283,6 +283,9 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
OUString( GDRIVE_CLIENT_SECRET ).isEmpty();
bool bSkipAlfresco = OUString( ALFRESCO_CLOUD_CLIENT_ID ).isEmpty() ||
OUString( ALFRESCO_CLOUD_CLIENT_SECRET ).isEmpty();
bool bSkipOneDrive= OUString( ONEDRIVE_CLIENT_ID ).isEmpty() ||
OUString( ONEDRIVE_CLIENT_SECRET ).isEmpty();
Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) );
Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) );
@@ -290,7 +293,8 @@ CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder ) :
{
OUString sUrl = aTypesUrlsList[i];
if ( !( sUrl == GDRIVE_BASE_URL && bSkipGDrive ) &&
!( sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL ) && bSkipAlfresco ) )
!( sUrl.startsWith( ALFRESCO_CLOUD_BASE_URL ) && bSkipAlfresco ) &&
!( sUrl == ONEDRIVE_BASE_URL && bSkipOneDrive ) )
{
m_pLBServerType->InsertEntry( aTypesNamesList[i] );
m_aServerTypesURLs.push_back( sUrl );

View File

@@ -353,6 +353,11 @@ namespace cmis
ALFRESCO_CLOUD_AUTH_URL, ALFRESCO_CLOUD_TOKEN_URL,
ALFRESCO_CLOUD_SCOPE, ALFRESCO_CLOUD_REDIRECT_URI,
ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) );
if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL )
oauth2Data.reset( new libcmis::OAuth2Data(
ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL,
ONEDRIVE_SCOPE, ONEDRIVE_REDIRECT_URI,
ONEDRIVE_CLIENT_ID, ONEDRIVE_CLIENT_SECRET ) );
m_pSession = libcmis::SessionFactory::createSession(
OUSTR_TO_STDSTR( m_aURL.getBindingUrl( ) ),

View File

@@ -178,6 +178,11 @@ namespace cmis
ALFRESCO_CLOUD_AUTH_URL, ALFRESCO_CLOUD_TOKEN_URL,
ALFRESCO_CLOUD_SCOPE, ALFRESCO_CLOUD_REDIRECT_URI,
ALFRESCO_CLOUD_CLIENT_ID, ALFRESCO_CLOUD_CLIENT_SECRET ) );
if ( m_aURL.getBindingUrl( ) == ONEDRIVE_BASE_URL )
oauth2Data.reset( new libcmis::OAuth2Data(
ONEDRIVE_AUTH_URL, ONEDRIVE_TOKEN_URL,
ONEDRIVE_SCOPE, ONEDRIVE_REDIRECT_URI,
ONEDRIVE_CLIENT_ID, ONEDRIVE_CLIENT_SECRET ) );
boost::scoped_ptr<libcmis::Session> session(libcmis::SessionFactory::createSession(
OUSTR_TO_STDSTR( m_aURL.getBindingUrl( ) ),