Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
0398e1e3
Kaydet (Commit)
0398e1e3
authored
Tem 29, 2015
tarafından
Szymon Kłos
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
CMIS: remember new session for each user
Change-Id: I7d0a72e48b8f9056e8761cae8939e2b8f6dbdd24
üst
851d73c4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
10 deletions
+29
-10
cmis_content.cxx
ucb/source/ucp/cmis/cmis_content.cxx
+8
-2
cmis_provider.cxx
ucb/source/ucp/cmis/cmis_provider.cxx
+9
-4
cmis_provider.hxx
ucb/source/ucp/cmis/cmis_provider.hxx
+3
-3
cmis_url.cxx
ucb/source/ucp/cmis/cmis_url.cxx
+8
-1
cmis_url.hxx
ucb/source/ucp/cmis/cmis_url.hxx
+1
-0
No files found.
ucb/source/ucp/cmis/cmis_content.cxx
Dosyayı görüntüle @
0398e1e3
...
@@ -339,7 +339,7 @@ namespace cmis
...
@@ -339,7 +339,7 @@ namespace cmis
// Look for a cached session, key is binding url + repo id
// Look for a cached session, key is binding url + repo id
OUString
sSessionId
=
m_aURL
.
getBindingUrl
(
)
+
m_aURL
.
getRepositoryId
(
);
OUString
sSessionId
=
m_aURL
.
getBindingUrl
(
)
+
m_aURL
.
getRepositoryId
(
);
if
(
NULL
==
m_pSession
)
if
(
NULL
==
m_pSession
)
m_pSession
=
m_pProvider
->
getSession
(
sSessionId
);
m_pSession
=
m_pProvider
->
getSession
(
sSessionId
,
m_aURL
.
getUsername
(
)
);
if
(
NULL
==
m_pSession
)
if
(
NULL
==
m_pSession
)
{
{
...
@@ -411,7 +411,7 @@ namespace cmis
...
@@ -411,7 +411,7 @@ namespace cmis
}
}
else
else
{
{
m_pProvider
->
registerSession
(
sSessionId
,
m_pSession
);
m_pProvider
->
registerSession
(
sSessionId
,
m_
aURL
.
getUsername
(
),
m_
pSession
);
}
}
}
}
else
else
...
@@ -2019,14 +2019,20 @@ namespace cmis
...
@@ -2019,14 +2019,20 @@ namespace cmis
{
{
// TODO Cache the objects
// TODO Cache the objects
INetURLObject
aURL
(
m_sURL
);
OUString
sUser
=
aURL
.
GetUser
(
INetURLObject
::
NO_DECODE
);
URL
aUrl
(
m_sURL
);
URL
aUrl
(
m_sURL
);
OUString
sPath
(
m_sObjectPath
);
OUString
sPath
(
m_sObjectPath
);
if
(
!
sPath
.
endsWith
(
"/"
)
)
if
(
!
sPath
.
endsWith
(
"/"
)
)
sPath
+=
"/"
;
sPath
+=
"/"
;
sPath
+=
STD_TO_OUSTR
(
(
*
it
)
->
getName
(
)
);
sPath
+=
STD_TO_OUSTR
(
(
*
it
)
->
getName
(
)
);
OUString
sId
=
STD_TO_OUSTR
(
(
*
it
)
->
getId
(
)
);
OUString
sId
=
STD_TO_OUSTR
(
(
*
it
)
->
getId
(
)
);
aUrl
.
setObjectId
(
sId
);
aUrl
.
setObjectId
(
sId
);
aUrl
.
setObjectPath
(
sPath
);
aUrl
.
setObjectPath
(
sPath
);
aUrl
.
setUsername
(
sUser
);
uno
::
Reference
<
ucb
::
XContentIdentifier
>
xId
=
new
ucbhelper
::
ContentIdentifier
(
aUrl
.
asString
(
)
);
uno
::
Reference
<
ucb
::
XContentIdentifier
>
xId
=
new
ucbhelper
::
ContentIdentifier
(
aUrl
.
asString
(
)
);
uno
::
Reference
<
ucb
::
XContent
>
xContent
=
new
Content
(
m_xContext
,
m_pProvider
,
xId
,
*
it
);
uno
::
Reference
<
ucb
::
XContent
>
xContent
=
new
Content
(
m_xContext
,
m_pProvider
,
xId
,
*
it
);
...
...
ucb/source/ucp/cmis/cmis_provider.cxx
Dosyayı görüntüle @
0398e1e3
...
@@ -59,10 +59,11 @@ ContentProvider::queryContent(
...
@@ -59,10 +59,11 @@ ContentProvider::queryContent(
return
xContent
;
return
xContent
;
}
}
libcmis
::
Session
*
ContentProvider
::
getSession
(
const
OUString
&
sBindingUrl
)
libcmis
::
Session
*
ContentProvider
::
getSession
(
const
OUString
&
sBindingUrl
,
const
OUString
&
sUsername
)
{
{
libcmis
::
Session
*
pSession
=
NULL
;
libcmis
::
Session
*
pSession
=
NULL
;
std
::
map
<
OUString
,
libcmis
::
Session
*
>::
iterator
it
=
m_aSessionCache
.
find
(
sBindingUrl
);
std
::
map
<
std
::
pair
<
OUString
,
OUString
>
,
libcmis
::
Session
*
>::
iterator
it
=
m_aSessionCache
.
find
(
std
::
pair
<
OUString
,
OUString
>
(
sBindingUrl
,
sUsername
)
);
if
(
it
!=
m_aSessionCache
.
end
(
)
)
if
(
it
!=
m_aSessionCache
.
end
(
)
)
{
{
pSession
=
it
->
second
;
pSession
=
it
->
second
;
...
@@ -70,9 +71,13 @@ libcmis::Session* ContentProvider::getSession( const OUString& sBindingUrl )
...
@@ -70,9 +71,13 @@ libcmis::Session* ContentProvider::getSession( const OUString& sBindingUrl )
return
pSession
;
return
pSession
;
}
}
void
ContentProvider
::
registerSession
(
const
OUString
&
sBindingUrl
,
libcmis
::
Session
*
pSession
)
void
ContentProvider
::
registerSession
(
const
OUString
&
sBindingUrl
,
const
OUString
&
sUsername
,
libcmis
::
Session
*
pSession
)
{
{
m_aSessionCache
.
insert
(
std
::
pair
<
OUString
,
libcmis
::
Session
*
>
(
sBindingUrl
,
pSession
)
);
m_aSessionCache
.
insert
(
std
::
pair
<
std
::
pair
<
OUString
,
OUString
>
,
libcmis
::
Session
*
>
(
std
::
pair
<
OUString
,
OUString
>
(
sBindingUrl
,
sUsername
),
pSession
)
);
}
}
ContentProvider
::
ContentProvider
(
ContentProvider
::
ContentProvider
(
...
...
ucb/source/ucp/cmis/cmis_provider.hxx
Dosyayı görüntüle @
0398e1e3
...
@@ -20,7 +20,7 @@ namespace cmis
...
@@ -20,7 +20,7 @@ namespace cmis
class
ContentProvider
:
public
::
ucbhelper
::
ContentProviderImplHelper
class
ContentProvider
:
public
::
ucbhelper
::
ContentProviderImplHelper
{
{
private
:
private
:
std
::
map
<
OUString
,
libcmis
::
Session
*
>
m_aSessionCache
;
std
::
map
<
std
::
pair
<
OUString
,
OUString
>
,
libcmis
::
Session
*
>
m_aSessionCache
;
public
:
public
:
explicit
ContentProvider
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
explicit
ContentProvider
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
...
@@ -64,8 +64,8 @@ public:
...
@@ -64,8 +64,8 @@ public:
throw
(
::
com
::
sun
::
star
::
ucb
::
IllegalIdentifierException
,
throw
(
::
com
::
sun
::
star
::
ucb
::
IllegalIdentifierException
,
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
::
com
::
sun
::
star
::
uno
::
RuntimeException
,
std
::
exception
)
SAL_OVERRIDE
;
libcmis
::
Session
*
getSession
(
const
OUString
&
sBindingUrl
);
libcmis
::
Session
*
getSession
(
const
OUString
&
sBindingUrl
,
const
OUString
&
sUsername
);
void
registerSession
(
const
OUString
&
sBindingUrl
,
libcmis
::
Session
*
pSession
);
void
registerSession
(
const
OUString
&
sBindingUrl
,
const
OUString
&
sUsername
,
libcmis
::
Session
*
pSession
);
};
};
}
}
...
...
ucb/source/ucp/cmis/cmis_url.cxx
Dosyayı görüntüle @
0398e1e3
...
@@ -53,6 +53,11 @@ namespace cmis
...
@@ -53,6 +53,11 @@ namespace cmis
m_sId
=
sId
;
m_sId
=
sId
;
}
}
void
URL
::
setUsername
(
const
OUString
&
sUser
)
{
m_sUser
=
sUser
;
}
OUString
URL
::
asString
(
)
OUString
URL
::
asString
(
)
{
{
OUString
sUrl
;
OUString
sUrl
;
...
@@ -61,7 +66,9 @@ namespace cmis
...
@@ -61,7 +66,9 @@ namespace cmis
rtl_UriCharClassRelSegment
,
rtl_UriCharClassRelSegment
,
rtl_UriEncodeKeepEscapes
,
rtl_UriEncodeKeepEscapes
,
RTL_TEXTENCODING_UTF8
);
RTL_TEXTENCODING_UTF8
);
sUrl
=
"vnd.libreoffice.cmis://"
+
sEncodedBinding
;
sUrl
=
"vnd.libreoffice.cmis://"
+
(
m_sUser
.
isEmpty
()
?
OUString
(
)
:
(
m_sUser
+
"@"
)
)
+
sEncodedBinding
;
if
(
!
m_sPath
.
isEmpty
(
)
)
if
(
!
m_sPath
.
isEmpty
(
)
)
{
{
...
...
ucb/source/ucp/cmis/cmis_url.hxx
Dosyayı görüntüle @
0398e1e3
...
@@ -38,6 +38,7 @@ namespace cmis
...
@@ -38,6 +38,7 @@ namespace cmis
const
OUString
&
getPassword
()
const
{
return
m_sPass
;
}
const
OUString
&
getPassword
()
const
{
return
m_sPass
;
}
void
setObjectPath
(
const
OUString
&
sPath
);
void
setObjectPath
(
const
OUString
&
sPath
);
void
setObjectId
(
const
OUString
&
sId
);
void
setObjectId
(
const
OUString
&
sId
);
void
setUsername
(
const
OUString
&
sUser
);
OUString
asString
(
);
OUString
asString
(
);
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment