Kaydet (Commit) b61970cf authored tarafından Cao Cuong Ngo's avatar Cao Cuong Ngo Kaydeden (comit) Bosdonnat Cedric

Cmis Versions dialog

Change-Id: Ie863282062a6932a55543143e841917c54223ac9
Reviewed-on: https://gerrit.libreoffice.org/5925Reviewed-by: 's avatarBosdonnat Cedric <cedric.bosdonnat@free.fr>
Tested-by: 's avatarBosdonnat Cedric <cedric.bosdonnat@free.fr>
üst 0618b35e
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <com/sun/star/security/XDocumentDigitalSignatures.hpp> #include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/CmisVersion.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
//________________________________________________________________________________________________________________ //________________________________________________________________________________________________________________
...@@ -714,6 +715,7 @@ public: ...@@ -714,6 +715,7 @@ public:
SAL_DLLPRIVATE void CheckOut( ); SAL_DLLPRIVATE void CheckOut( );
SAL_DLLPRIVATE void CancelCheckOut( ); SAL_DLLPRIVATE void CancelCheckOut( );
SAL_DLLPRIVATE void CheckIn( ); SAL_DLLPRIVATE void CheckIn( );
SAL_DLLPRIVATE ::com::sun::star::uno::Sequence< ::com::sun::star::document::CmisVersion > GetCmisVersions();
}; };
#define SFX_GLOBAL_CLASSID \ #define SFX_GLOBAL_CLASSID \
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <com/sun/star/container/XNameReplace.hpp> #include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/frame/XController2.hpp> #include <com/sun/star/frame/XController2.hpp>
#include <com/sun/star/document/XCmisDocument.hpp> #include <com/sun/star/document/XCmisDocument.hpp>
#include <com/sun/star/document/CmisVersion.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentRecovery.hpp> #include <com/sun/star/document/XDocumentRecovery.hpp>
#include <com/sun/star/document/XUndoManagerSupplier.hpp> #include <com/sun/star/document/XUndoManagerSupplier.hpp>
...@@ -1321,6 +1322,9 @@ public: ...@@ -1321,6 +1322,9 @@ public:
css::document::CmisProperty >& _cmisproperties ) css::document::CmisProperty >& _cmisproperties )
throw (css::uno::RuntimeException); throw (css::uno::RuntimeException);
virtual css::uno::Sequence< css::document::CmisVersion > SAL_CALL getAllVersions ( )
throw (css::uno::RuntimeException );
virtual void SAL_CALL checkOut( ) throw ( css::uno::RuntimeException ); virtual void SAL_CALL checkOut( ) throw ( css::uno::RuntimeException );
virtual void SAL_CALL cancelCheckOut( ) throw ( css::uno::RuntimeException ); virtual void SAL_CALL cancelCheckOut( ) throw ( css::uno::RuntimeException );
virtual void SAL_CALL checkIn( sal_Bool bIsMajor, const OUString & rMessage ) virtual void SAL_CALL checkIn( sal_Bool bIsMajor, const OUString & rMessage )
......
...@@ -2160,6 +2160,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/document,\ ...@@ -2160,6 +2160,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/document,\
BrokenPackageRequest \ BrokenPackageRequest \
ChangedByOthersRequest \ ChangedByOthersRequest \
CmisProperty \ CmisProperty \
CmisVersion \
CorruptedFilterConfigurationException \ CorruptedFilterConfigurationException \
DocumentEvent \ DocumentEvent \
EmptyUndoStackException \ EmptyUndoStackException \
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef __com_sun_star_document_CmisVersion_idl__
#define __com_sun_star_document_CmisVersion_idl__
#include <com/sun/star/util/DateTime.idl>
module com { module sun { module star { module document {
/** specifies a CMIS document version.
*/
struct CmisVersion
{
/** unique ID of the Cmis version
*/
string Id;
/** specifies the time when the revision was created.
*/
util::DateTime TimeStamp;
/** contains the author that created the version.
*/
string Author;
/** contains the comment the author has left.
*/
string Comment;
};
}; }; }; };
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#define __com_sun_star_document_XCmisDocument_idl__ #define __com_sun_star_document_XCmisDocument_idl__
#include <com/sun/star/document/CmisProperty.idl> #include <com/sun/star/document/CmisProperty.idl>
#include <com/sun/star/document/CmisVersion.idl>
#include <com/sun/star/uno/XInterface.idl> #include <com/sun/star/uno/XInterface.idl>
module com { module sun { module star { module document { module com { module sun { module star { module document {
...@@ -46,6 +47,8 @@ interface XCmisDocument : com::sun::star::uno::XInterface ...@@ -46,6 +47,8 @@ interface XCmisDocument : com::sun::star::uno::XInterface
void updateCmisProperties( [in] sequence <com::sun::star::document::CmisProperty> cmisProperties ); void updateCmisProperties( [in] sequence <com::sun::star::document::CmisProperty> cmisProperties );
sequence <com::sun::star::document::CmisVersion> getAllVersions( );
/** Contains the properties values named after their CMIS ID. /** Contains the properties values named after their CMIS ID.
*/ */
[attribute] sequence <com::sun::star::document::CmisProperty> CmisProperties; [attribute] sequence <com::sun::star::document::CmisProperty> CmisProperties;
......
...@@ -27,6 +27,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\ ...@@ -27,6 +27,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/singletabdialog \ sfx2/uiconfig/ui/singletabdialog \
sfx2/uiconfig/ui/versionsofdialog \ sfx2/uiconfig/ui/versionsofdialog \
sfx2/uiconfig/ui/versioncommentdialog \ sfx2/uiconfig/ui/versioncommentdialog \
sfx2/uiconfig/ui/versionscmis \
sfx2/uiconfig/ui/startcenter \ sfx2/uiconfig/ui/startcenter \
sfx2/uiconfig/ui/cmisinfopage \ sfx2/uiconfig/ui/cmisinfopage \
sfx2/uiconfig/ui/cmisline \ sfx2/uiconfig/ui/cmisline \
......
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
{ *this = rCpy; } { *this = rCpy; }
SfxVersionTableDtor( const uno::Sequence < util::RevisionTag >& rInfo ); SfxVersionTableDtor( const uno::Sequence < util::RevisionTag >& rInfo );
SfxVersionTableDtor( const uno::Sequence < document::CmisVersion > & rInfo );
~SfxVersionTableDtor() ~SfxVersionTableDtor()
{ DelDtor(); } { DelDtor(); }
...@@ -114,6 +114,23 @@ SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < util::RevisionTa ...@@ -114,6 +114,23 @@ SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < util::RevisionTa
} }
} }
SfxVersionTableDtor::SfxVersionTableDtor( const uno::Sequence < document::CmisVersion >& rInfo )
{
for ( sal_Int32 n=0; n<(sal_Int32)rInfo.getLength(); n++ )
{
SfxVersionInfo* pInfo = new SfxVersionInfo;
pInfo->aName = rInfo[n].Id;
pInfo->aComment = rInfo[n].Comment;
pInfo->aAuthor = rInfo[n].Author;
Date aDate ( rInfo[n].TimeStamp.Day, rInfo[n].TimeStamp.Month, rInfo[n].TimeStamp.Year );
Time aTime ( rInfo[n].TimeStamp.Hours, rInfo[n].TimeStamp.Minutes, rInfo[n].TimeStamp.Seconds, rInfo[n].TimeStamp.NanoSeconds );
pInfo->aCreationDate = DateTime( aDate, aTime );
aTableList.push_back( pInfo );
}
}
void SfxVersionTableDtor::DelDtor() void SfxVersionTableDtor::DelDtor()
{ {
for ( size_t i = 0, n = aTableList.size(); i < n; ++i ) for ( size_t i = 0, n = aTableList.size(); i < n; ++i )
...@@ -218,6 +235,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer ...@@ -218,6 +235,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer
get(m_pViewButton, "show"); get(m_pViewButton, "show");
get(m_pDeleteButton, "delete"); get(m_pDeleteButton, "delete");
get(m_pCompareButton, "compare"); get(m_pCompareButton, "compare");
get(m_pCmisButton, "cmis");
SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("versions"); SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("versions");
Size aControlSize(260, 114); Size aControlSize(260, 114);
...@@ -234,6 +252,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer ...@@ -234,6 +252,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVer
m_pCompareButton->SetClickHdl ( aClickLink ); m_pCompareButton->SetClickHdl ( aClickLink );
m_pOpenButton->SetClickHdl ( aClickLink ); m_pOpenButton->SetClickHdl ( aClickLink );
m_pSaveCheckBox->SetClickHdl ( aClickLink ); m_pSaveCheckBox->SetClickHdl ( aClickLink );
m_pCmisButton->SetClickHdl ( aClickLink );
m_pVersionBox->SetSelectHdl( LINK( this, SfxVersionDialog, SelectHdl_Impl ) ); m_pVersionBox->SetSelectHdl( LINK( this, SfxVersionDialog, SelectHdl_Impl ) );
m_pVersionBox->SetDoubleClickHdl( LINK( this, SfxVersionDialog, DClickHdl_Impl ) ); m_pVersionBox->SetDoubleClickHdl( LINK( this, SfxVersionDialog, DClickHdl_Impl ) );
...@@ -329,6 +348,7 @@ void SfxVersionDialog::Init_Impl() ...@@ -329,6 +348,7 @@ void SfxVersionDialog::Init_Impl()
m_pViewButton->Disable(); m_pViewButton->Disable();
m_pDeleteButton->Disable(); m_pDeleteButton->Disable();
m_pCompareButton->Disable(); m_pCompareButton->Disable();
m_pCmisButton->Enable();
SelectHdl_Impl(m_pVersionBox); SelectHdl_Impl(m_pVersionBox);
} }
...@@ -456,6 +476,12 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton ) ...@@ -456,6 +476,12 @@ IMPL_LINK( SfxVersionDialog, ButtonHdl_Impl, Button*, pButton )
pViewFrame->GetDispatcher()->Execute( SID_DOCUMENT_COMPARE, SFX_CALLMODE_ASYNCHRON, aSet ); pViewFrame->GetDispatcher()->Execute( SID_DOCUMENT_COMPARE, SFX_CALLMODE_ASYNCHRON, aSet );
Close(); Close();
} }
else if (pButton == m_pCmisButton)
{
SfxCmisVersionsDialog* pDlg = new SfxCmisVersionsDialog(pViewFrame, false);
pDlg->Execute();
delete pDlg;
}
return 0L; return 0L;
} }
...@@ -504,4 +530,87 @@ IMPL_LINK(SfxViewVersionDialog_Impl, ButtonHdl, Button*, pButton) ...@@ -504,4 +530,87 @@ IMPL_LINK(SfxViewVersionDialog_Impl, ButtonHdl, Button*, pButton)
return 0L; return 0L;
} }
SfxCmisVersionsDialog::SfxCmisVersionsDialog ( SfxViewFrame* pVwFrame, sal_Bool bIsSaveVersionOnClose )
: SfxModalDialog(NULL, "VersionsCmisDialog", "sfx/ui/versionscmis.ui")
, pViewFrame(pVwFrame)
, m_pTable(NULL)
, m_bIsSaveVersionOnClose(bIsSaveVersionOnClose)
{
get(m_pSaveButton, "save");
get(m_pSaveCheckBox, "always");
get(m_pOpenButton, "open");
get(m_pViewButton, "show");
get(m_pDeleteButton, "delete");
get(m_pCompareButton, "compare");
SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("versions");
Size aControlSize(260, 114);
aControlSize = pContainer->LogicToPixel(aControlSize, MAP_APPFONT);
pContainer->set_width_request(aControlSize.Width());
pContainer->set_height_request(aControlSize.Height());
m_pVersionBox = new SfxVersionsTabListBox_Impl(*pContainer, WB_TABSTOP);
m_pVersionBox->GrabFocus();
m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN );
m_pVersionBox->SetSelectionMode( SINGLE_SELECTION );
long nTabs_Impl[] = { 3, 0, 0, 0 };
m_pVersionBox->SvSimpleTable::SetTabs(&nTabs_Impl[0]);
OUString sHeader1(get<FixedText>("datetime")->GetText());
OUString sHeader2(get<FixedText>("savedby")->GetText());
OUString sHeader3(get<FixedText>("comments")->GetText());
OUStringBuffer sHeader;
sHeader.append(sHeader1).append("\t").append(sHeader2)
.append("\t ").append(sHeader3);
m_pVersionBox->InsertHeaderEntry(sHeader.makeStringAndClear());
HeaderBar &rBar = m_pVersionBox->GetTheHeaderBar();
HeaderBarItemBits nBits = rBar.GetItemBits(1) | HIB_FIXEDPOS | HIB_FIXED;
nBits &= ~HIB_CLICKABLE;
rBar.SetItemBits(1, nBits);
rBar.SetItemBits(2, nBits);
rBar.SetItemBits(3, nBits);
m_pVersionBox->Resize();
OUString sText = GetText();
sText = sText + " " + pViewFrame->GetObjectShell()->GetTitle();
SetText( sText );
LoadVersions();
m_pVersionBox->setColSizes();
}
SfxCmisVersionsDialog::~SfxCmisVersionsDialog()
{
delete m_pTable;
delete m_pVersionBox;
}
void SfxCmisVersionsDialog::LoadVersions()
{
SfxObjectShell *pObjShell = pViewFrame->GetObjectShell();
uno::Sequence < document::CmisVersion > aVersions = pObjShell->GetCmisVersions( );
delete m_pTable;
m_pTable = new SfxVersionTableDtor( aVersions );
{
for ( size_t n = 0; n < m_pTable->size(); ++n )
{
SfxVersionInfo *pInfo = m_pTable->at( n );
OUString aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper());
aEntry += "\t";
aEntry += pInfo->aAuthor;
aEntry += "\t";
aEntry += ConvertWhiteSpaces_Impl( pInfo->aComment );
SvTreeListEntry *pEntry = m_pVersionBox->InsertEntry( aEntry );
pEntry->SetUserData( pInfo );
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -405,6 +405,21 @@ void SfxObjectShell::CheckIn( ) ...@@ -405,6 +405,21 @@ void SfxObjectShell::CheckIn( )
} }
} }
uno::Sequence< document::CmisVersion > SfxObjectShell::GetCmisVersions( )
{
try
{
uno::Reference< document::XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY_THROW );
return xCmisDoc->getAllVersions( );
}
catch ( const uno::RuntimeException& e )
{
ErrorBox* pErrorBox = new ErrorBox( &GetFrame()->GetWindow(), WB_OK, e.Message );
pErrorBox->Execute( );
delete pErrorBox;
}
return uno::Sequence< document::CmisVersion > ( );
}
//-------------------------------------------------------------------- //--------------------------------------------------------------------
void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
......
...@@ -2604,6 +2604,29 @@ void SAL_CALL SfxBaseModel::checkIn( sal_Bool bIsMajor, const OUString& rMessage ...@@ -2604,6 +2604,29 @@ void SAL_CALL SfxBaseModel::checkIn( sal_Bool bIsMajor, const OUString& rMessage
} }
} }
uno::Sequence< document::CmisVersion > SAL_CALL SfxBaseModel::getAllVersions( ) throw ( RuntimeException )
{
uno::Sequence< document::CmisVersion > aVersions;
SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
if ( pMedium )
{
try
{
::ucbhelper::Content aContent( pMedium->GetName(),
Reference<ucb::XCommandEnvironment>(),
comphelper::getProcessComponentContext() );
Any aResult = aContent.executeCommand( "getAllVersions", Any( ) );
aResult >>= aVersions;
}
catch ( const Exception & e )
{
throw RuntimeException( e.Message, e.Context );
}
}
return aVersions;
}
sal_Bool SfxBaseModel::getBoolPropertyValue( const OUString& rName ) throw ( RuntimeException ) sal_Bool SfxBaseModel::getBoolPropertyValue( const OUString& rName ) throw ( RuntimeException )
{ {
sal_Bool bValue = sal_False; sal_Bool bValue = sal_False;
......
...@@ -52,6 +52,7 @@ class SfxVersionDialog : public SfxModalDialog ...@@ -52,6 +52,7 @@ class SfxVersionDialog : public SfxModalDialog
PushButton* m_pViewButton; PushButton* m_pViewButton;
PushButton* m_pDeleteButton; PushButton* m_pDeleteButton;
PushButton* m_pCompareButton; PushButton* m_pCompareButton;
PushButton* m_pCmisButton;
SfxViewFrame* pViewFrame; SfxViewFrame* pViewFrame;
SfxVersionTableDtor* m_pTable; SfxVersionTableDtor* m_pTable;
bool m_bIsSaveVersionOnClose; bool m_bIsSaveVersionOnClose;
...@@ -84,6 +85,29 @@ public: ...@@ -84,6 +85,29 @@ public:
SfxViewVersionDialog_Impl(Window *pParent, SfxVersionInfo& rInfo, bool bEdit); SfxViewVersionDialog_Impl(Window *pParent, SfxVersionInfo& rInfo, bool bEdit);
}; };
class SfxCmisVersionsDialog : public SfxModalDialog
{
PushButton* m_pSaveButton;
CheckBox* m_pSaveCheckBox;
SfxVersionsTabListBox_Impl* m_pVersionBox;
PushButton* m_pOpenButton;
PushButton* m_pViewButton;
PushButton* m_pDeleteButton;
PushButton* m_pCompareButton;
SfxViewFrame* pViewFrame;
SfxVersionTableDtor* m_pTable;
bool m_bIsSaveVersionOnClose;
DECL_LINK(DClickHdl_Impl, void *);
DECL_LINK(SelectHdl_Impl, void *);
DECL_LINK( ButtonHdl_Impl, Button* );
void LoadVersions();
public:
SfxCmisVersionsDialog ( SfxViewFrame* pFrame, sal_Bool );
virtual ~SfxCmisVersionsDialog ();
};
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
...@@ -86,6 +86,20 @@ ...@@ -86,6 +86,20 @@
<property name="position">4</property> <property name="position">4</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkButton" id="cmis">
<property name="label" translatable="yes">CMIS</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
<child> <child>
<object class="GtkButton" id="help"> <object class="GtkButton" id="help">
<property name="label">gtk-help</property> <property name="label">gtk-help</property>
...@@ -97,7 +111,7 @@ ...@@ -97,7 +111,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">5</property> <property name="position">6</property>
<property name="secondary">True</property> <property name="secondary">True</property>
</packing> </packing>
</child> </child>
......
...@@ -1054,6 +1054,46 @@ namespace cmis ...@@ -1054,6 +1054,46 @@ namespace cmis
return aRet; return aRet;
} }
uno::Sequence< document::CmisVersion> Content::getAllVersions( const uno::Reference< ucb::XCommandEnvironment > & xEnv )
throw( uno::Exception )
{
try
{
// get the document
libcmis::DocumentPtr pDoc = boost::dynamic_pointer_cast< libcmis::Document >( getObject( xEnv ) );
if ( pDoc.get( ) == NULL )
{
ucbhelper::cancelCommandExecution(
ucb::IOErrorCode_GENERAL,
uno::Sequence< uno::Any >( 0 ),
xEnv,
"Can not get the document" );
}
vector< libcmis::DocumentPtr > aCmisVersions = pDoc->getAllVersions( );
uno::Sequence< document::CmisVersion > aVersions( aCmisVersions.size( ) );
int i = 0;
for ( vector< libcmis::DocumentPtr >::iterator it = aCmisVersions.begin();
it != aCmisVersions.end( ); ++it, ++i )
{
libcmis::DocumentPtr pVersion = *it;
aVersions[i].Id = STD_TO_OUSTR( pVersion->getId( ) );
aVersions[i].Author = STD_TO_OUSTR( pVersion->getCreatedBy( ) );
aVersions[i].TimeStamp = lcl_boostToUnoTime( pVersion->getCreationDate( ) );
}
return aVersions;
}
catch ( const libcmis::Exception& e )
{
SAL_INFO( "ucb.ucp.cmis", "Unexpected libcmis exception: " << e.what( ) );
ucbhelper::cancelCommandExecution(
ucb::IOErrorCode_GENERAL,
uno::Sequence< uno::Any >( 0 ),
xEnv,
OUString::createFromAscii( e.what() ) );
}
return uno::Sequence< document::CmisVersion > ( );
}
void Content::transfer( const ucb::TransferInfo& rTransferInfo, void Content::transfer( const ucb::TransferInfo& rTransferInfo,
const uno::Reference< ucb::XCommandEnvironment > & xEnv ) const uno::Reference< ucb::XCommandEnvironment > & xEnv )
throw( uno::Exception ) throw( uno::Exception )
...@@ -1472,6 +1512,9 @@ namespace cmis ...@@ -1472,6 +1512,9 @@ namespace cmis
ucb::CommandInfo ( OUString( "checkIn" ), -1, ucb::CommandInfo ( OUString( "checkIn" ), -1,
getCppuType( static_cast<ucb::TransferInfo * >( 0 ) ) ), getCppuType( static_cast<ucb::TransferInfo * >( 0 ) ) ),
ucb::CommandInfo ( OUString( "updateProperties" ), -1, getCppuVoidType() ), ucb::CommandInfo ( OUString( "updateProperties" ), -1, getCppuVoidType() ),
ucb::CommandInfo
( OUString( "getAllVersions" ),
-1, getCppuType( static_cast<uno::Sequence< document::CmisVersion > * >( 0 ) ) ),
// Folder Only, omitted if not a folder // Folder Only, omitted if not a folder
...@@ -1645,6 +1688,10 @@ namespace cmis ...@@ -1645,6 +1688,10 @@ namespace cmis
} }
aRet <<= checkIn( aArg, xEnv ); aRet <<= checkIn( aArg, xEnv );
} }
else if ( aCommand.Name == "getAllVersions" )
{
aRet <<= getAllVersions( xEnv );
}
else if ( aCommand.Name == "updateProperties" ) else if ( aCommand.Name == "updateProperties" )
{ {
updateProperties( aCommand.Argument, xEnv ); updateProperties( aCommand.Argument, xEnv );
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include <com/sun/star/ucb/OpenCommandArgument2.hpp> #include <com/sun/star/ucb/OpenCommandArgument2.hpp>
#include <com/sun/star/ucb/TransferInfo.hpp> #include <com/sun/star/ucb/TransferInfo.hpp>
#include <com/sun/star/ucb/XContentCreator.hpp> #include <com/sun/star/ucb/XContentCreator.hpp>
#include <com/sun/star/document/CmisVersion.hpp>
#include <ucbhelper/contenthelper.hxx> #include <ucbhelper/contenthelper.hxx>
#include <libcmis/libcmis.hxx> #include <libcmis/libcmis.hxx>
...@@ -118,6 +119,10 @@ private: ...@@ -118,6 +119,10 @@ private:
const com::sun::star::uno::Reference< const com::sun::star::uno::Reference<
com::sun::star::ucb::XCommandEnvironment >& xEnv ); com::sun::star::ucb::XCommandEnvironment >& xEnv );
com::sun::star::uno::Sequence< com::sun::star::document::CmisVersion >
getAllVersions( const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv )
throw( com::sun::star::uno::Exception );
sal_Bool feedSink( com::sun::star::uno::Reference< com::sun::star::uno::XInterface> aSink, sal_Bool feedSink( com::sun::star::uno::Reference< com::sun::star::uno::XInterface> aSink,
const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv ); const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment