CMIS properties
Create a CmisPropertyValue with additional DisplayName, Updatable and Required properties. Change-Id: Ia20d76a739ac5c51d7c89ef6f1a40a299697cb0e
This commit is contained in:
parent
5118e421e4
commit
beff419a6e
@ -26,6 +26,7 @@
|
||||
|
||||
#include <com/sun/star/util/DateTime.hpp>
|
||||
#include <com/sun/star/util/Duration.hpp>
|
||||
#include <com/sun/star/document/CmisPropertyValue.hpp>
|
||||
|
||||
#include <svl/stritem.hxx>
|
||||
#include <svl/zforlist.hxx>
|
||||
@ -51,6 +52,7 @@ namespace com { namespace sun { namespace star {
|
||||
} } }
|
||||
|
||||
struct CustomProperty;
|
||||
struct CmisProperty;
|
||||
|
||||
|
||||
// class SfxDocumentInfoItem ---------------------------------------------
|
||||
@ -78,8 +80,8 @@ private:
|
||||
sal_Bool m_bHasTemplate;
|
||||
sal_Bool m_bDeleteUserData;
|
||||
sal_Bool m_bUseUserData;
|
||||
std::vector< CustomProperty* > m_aCustomProperties;
|
||||
std::vector< CustomProperty* > m_aCmisProperties;
|
||||
std::vector< CustomProperty* > m_aCustomProperties;
|
||||
std::vector< CmisProperty* > m_aCmisProperties;
|
||||
|
||||
public:
|
||||
TYPEINFO();
|
||||
@ -88,7 +90,7 @@ public:
|
||||
const ::com::sun::star::uno::Reference<
|
||||
::com::sun::star::document::XDocumentProperties> & i_xDocProps,
|
||||
const ::com::sun::star::uno::Sequence<
|
||||
::com::sun::star::beans::PropertyValue> & i_cmisProps,
|
||||
::com::sun::star::document::CmisPropertyValue> & i_cmisProps,
|
||||
sal_Bool bUseUserData );
|
||||
SfxDocumentInfoItem( const SfxDocumentInfoItem& );
|
||||
virtual ~SfxDocumentInfoItem();
|
||||
@ -161,10 +163,11 @@ public:
|
||||
void AddCustomProperty( const OUString& sName,
|
||||
const com::sun::star::uno::Any& rValue );
|
||||
|
||||
std::vector< CustomProperty* > GetCmisProperties() const;
|
||||
std::vector< CmisProperty* > GetCmisProperties() const;
|
||||
void ClearCmisProperties();
|
||||
void AddCmisProperty( const OUString& sName,
|
||||
const com::sun::star::uno::Any& rValue );
|
||||
void AddCmisProperty( const OUString& sId, const OUString& sName,
|
||||
const bool bUpdatable, const bool bRequired,
|
||||
const com::sun::star::uno::Any& rValue );
|
||||
|
||||
virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
|
||||
virtual int operator==( const SfxPoolItem& ) const;
|
||||
@ -630,12 +633,14 @@ public:
|
||||
void InitControls( HeaderBar* pHeaderBar, const ScrollBar* pScrollBar );
|
||||
sal_uInt16 GetLineCount() const;
|
||||
inline sal_Int32 GetLineHeight() const { return m_nLineHeight; }
|
||||
void AddLine( const OUString& sName, com::sun::star::uno::Any& rAny );
|
||||
void AddLine( const OUString& sId, const OUString& sName,
|
||||
const bool bUpdatable, const bool bRequired,
|
||||
com::sun::star::uno::Any& rAny );
|
||||
bool AreAllLinesValid() const;
|
||||
void ClearAllLines();
|
||||
void DoScroll( sal_Int32 nNewPos );
|
||||
|
||||
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
|
||||
::com::sun::star::uno::Sequence< ::com::sun::star::document::CmisPropertyValue >
|
||||
GetCmisProperties() const;
|
||||
void updateLineWidth();
|
||||
};
|
||||
@ -657,11 +662,13 @@ public:
|
||||
CmisPropertiesControl(Window* pParent);
|
||||
~CmisPropertiesControl();
|
||||
|
||||
void AddLine( const OUString& sName, com::sun::star::uno::Any& rAny, bool bInteractive );
|
||||
void AddLine( const OUString& sId, const OUString& sName,
|
||||
const bool bUpdatable, const bool bRequired,
|
||||
com::sun::star::uno::Any& rAny, bool bInteractive );
|
||||
|
||||
inline bool AreAllLinesValid() const { return m_pPropertiesWin->AreAllLinesValid(); }
|
||||
inline void ClearAllLines() { m_pPropertiesWin->ClearAllLines(); }
|
||||
inline ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
|
||||
inline ::com::sun::star::uno::Sequence< ::com::sun::star::document::CmisPropertyValue >
|
||||
GetCmisProperties() const
|
||||
{ return m_pPropertiesWin->GetCmisProperties(); }
|
||||
void Init(VclBuilderContainer& rParent);
|
||||
|
@ -63,6 +63,7 @@
|
||||
#include <com/sun/star/frame/XStorable2.hpp>
|
||||
#include <com/sun/star/frame/XLoadable.hpp>
|
||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||
#include <com/sun/star/document/CmisPropertyValue.hpp>
|
||||
#include <com/sun/star/lang/EventObject.hpp>
|
||||
#include <com/sun/star/datatransfer/XTransferable.hpp>
|
||||
#include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
|
||||
@ -1307,19 +1308,12 @@ public:
|
||||
|
||||
// XCmisDocument
|
||||
|
||||
virtual css::uno::Sequence< css::beans::PropertyValue >
|
||||
virtual css::uno::Sequence< css::document::CmisPropertyValue >
|
||||
SAL_CALL getCmisPropertiesValues()
|
||||
throw (css::uno::RuntimeException);
|
||||
virtual void SAL_CALL setCmisPropertiesValues(
|
||||
const css::uno::Sequence<
|
||||
css::beans::PropertyValue >& _cmispropertiesvalues )
|
||||
throw (css::uno::RuntimeException);
|
||||
virtual css::uno::Sequence< css::beans::PropertyValue >
|
||||
SAL_CALL getCmisPropertiesDisplayNames()
|
||||
throw (css::uno::RuntimeException);
|
||||
virtual void SAL_CALL setCmisPropertiesDisplayNames(
|
||||
const css::uno::Sequence<
|
||||
css::beans::PropertyValue >& _cmispropertiesdisplaynames )
|
||||
css::document::CmisPropertyValue >& _cmispropertiesvalues )
|
||||
throw (css::uno::RuntimeException);
|
||||
|
||||
virtual void SAL_CALL checkOut( ) throw ( css::uno::RuntimeException );
|
||||
|
@ -2171,6 +2171,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/document,\
|
||||
AmbigousFilterRequest \
|
||||
BrokenPackageRequest \
|
||||
ChangedByOthersRequest \
|
||||
CmisPropertyValue \
|
||||
CorruptedFilterConfigurationException \
|
||||
DocumentEvent \
|
||||
EmptyUndoStackException \
|
||||
|
57
offapi/com/sun/star/document/CmisPropertyValue.idl
Normal file
57
offapi/com/sun/star/document/CmisPropertyValue.idl
Normal file
@ -0,0 +1,57 @@
|
||||
/* -*- 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_CmisPropertyValue_idl__
|
||||
#define __com_sun_star_document_CmisPropertyValue_idl__
|
||||
|
||||
#include <com/sun/star/beans/PropertyValue.idl>
|
||||
|
||||
module com { module sun { module star { module document {
|
||||
|
||||
/** specifies a CMIS property value.
|
||||
*/
|
||||
struct CmisPropertyValue
|
||||
{
|
||||
/** unique ID of the Cmis property
|
||||
*/
|
||||
string Id;
|
||||
|
||||
/** specifies the display name of the CMIS property.
|
||||
*/
|
||||
string Name;
|
||||
|
||||
/** specifies if the property is updatable.
|
||||
*/
|
||||
boolean Updatable;
|
||||
|
||||
/** specifies if the property is required and
|
||||
can not be empty.
|
||||
*/
|
||||
boolean Required;
|
||||
|
||||
/** specifies value of the property
|
||||
*/
|
||||
any Value;
|
||||
};
|
||||
|
||||
|
||||
}; }; }; };
|
||||
|
||||
#endif
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -9,7 +9,7 @@
|
||||
#ifndef __com_sun_star_document_XCmisDocument_idl__
|
||||
#define __com_sun_star_document_XCmisDocument_idl__
|
||||
|
||||
#include <com/sun/star/beans/PropertyValues.idl>
|
||||
#include <com/sun/star/document/CmisPropertyValue.idl>
|
||||
#include <com/sun/star/uno/XInterface.idl>
|
||||
|
||||
module com { module sun { module star { module document {
|
||||
@ -46,11 +46,7 @@ interface XCmisDocument : com::sun::star::uno::XInterface
|
||||
|
||||
/** Contains the properties values named after their CMIS ID.
|
||||
*/
|
||||
[attribute] com::sun::star::beans::PropertyValues CmisPropertiesValues;
|
||||
|
||||
/** Contains the property names to show to the user from their CMIS id.
|
||||
*/
|
||||
[attribute] com::sun::star::beans::PropertyValues CmisPropertiesDisplayNames;
|
||||
[attribute] sequence <com::sun::star::document::CmisPropertyValue> CmisPropertiesValues;
|
||||
};
|
||||
|
||||
}; }; }; };
|
||||
|
@ -45,6 +45,7 @@
|
||||
#include <com/sun/star/util/DateWithTimezone.hpp>
|
||||
#include <com/sun/star/util/Duration.hpp>
|
||||
#include <com/sun/star/document/XDocumentProperties.hpp>
|
||||
#include <com/sun/star/document/CmisPropertyValue.hpp>
|
||||
|
||||
#include <vcl/timer.hxx>
|
||||
#include "sfx2/dinfdlg.hxx"
|
||||
@ -91,6 +92,35 @@ struct CustomProperty
|
||||
{ return m_sName.equals( rProp.m_sName ) && m_aValue == rProp.m_aValue; }
|
||||
};
|
||||
|
||||
struct CmisProperty
|
||||
{
|
||||
OUString m_sId;
|
||||
OUString m_sName;
|
||||
bool m_bUpdatable;
|
||||
bool m_bRequired;
|
||||
com::sun::star::uno::Any m_aValue;
|
||||
|
||||
CmisProperty( const OUString& sId,
|
||||
const OUString& sName,
|
||||
const bool bUpdatable,
|
||||
const bool bRequired,
|
||||
const com::sun::star::uno::Any& rValue ) :
|
||||
m_sId( sId ),
|
||||
m_sName( sName ),
|
||||
m_bUpdatable( bUpdatable ),
|
||||
m_bRequired( bRequired ),
|
||||
m_aValue( rValue )
|
||||
{}
|
||||
|
||||
inline bool operator==( const CmisProperty& rProp )
|
||||
{ return m_sId.equals( rProp.m_sId )
|
||||
&& m_sName == rProp.m_sName
|
||||
&& m_bUpdatable == rProp.m_bUpdatable
|
||||
&& m_bRequired == rProp.m_bRequired
|
||||
&& m_aValue == rProp.m_aValue;
|
||||
}
|
||||
};
|
||||
|
||||
static
|
||||
bool operator==(const util::DateTime &i_rLeft, const util::DateTime &i_rRight)
|
||||
{
|
||||
@ -222,7 +252,7 @@ SfxDocumentInfoItem::SfxDocumentInfoItem()
|
||||
|
||||
SfxDocumentInfoItem::SfxDocumentInfoItem( const OUString& rFile,
|
||||
const uno::Reference<document::XDocumentProperties>& i_xDocProps,
|
||||
const uno::Sequence<beans::PropertyValue>& i_cmisProps,
|
||||
const uno::Sequence<document::CmisPropertyValue>& i_cmisProps,
|
||||
sal_Bool bIs )
|
||||
: SfxStringItem( SID_DOCINFO, rFile )
|
||||
, m_AutoloadDelay( i_xDocProps->getAutoloadSecs() )
|
||||
@ -274,7 +304,11 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const OUString& rFile,
|
||||
|
||||
for ( sal_Int32 i = 0; i < i_cmisProps.getLength(); ++i )
|
||||
{
|
||||
CustomProperty* pProp = new CustomProperty( i_cmisProps[i].Name, i_cmisProps[i].Value );
|
||||
CmisProperty* pProp = new CmisProperty( i_cmisProps[i].Id,
|
||||
i_cmisProps[i].Name,
|
||||
i_cmisProps[i].Updatable,
|
||||
i_cmisProps[i].Required,
|
||||
i_cmisProps[i].Value );
|
||||
m_aCmisProperties.push_back( pProp );
|
||||
}
|
||||
}
|
||||
@ -314,8 +348,11 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const SfxDocumentInfoItem& rItem )
|
||||
}
|
||||
for ( sal_uInt32 i = 0; i < rItem.m_aCmisProperties.size(); i++ )
|
||||
{
|
||||
CustomProperty* pProp = new CustomProperty( rItem.m_aCmisProperties[i]->m_sName,
|
||||
rItem.m_aCmisProperties[i]->m_aValue );
|
||||
CmisProperty* pProp = new CmisProperty( rItem.m_aCmisProperties[i]->m_sId,
|
||||
rItem.m_aCmisProperties[i]->m_sName,
|
||||
rItem.m_aCmisProperties[i]->m_bUpdatable,
|
||||
rItem.m_aCmisProperties[i]->m_bRequired,
|
||||
rItem.m_aCmisProperties[i]->m_aValue );
|
||||
m_aCmisProperties.push_back( pProp );
|
||||
}
|
||||
}
|
||||
@ -502,13 +539,16 @@ void SfxDocumentInfoItem::AddCustomProperty( const OUString& sName, const Any& r
|
||||
}
|
||||
|
||||
|
||||
std::vector< CustomProperty* > SfxDocumentInfoItem::GetCmisProperties() const
|
||||
std::vector< CmisProperty* > SfxDocumentInfoItem::GetCmisProperties() const
|
||||
{
|
||||
std::vector< CustomProperty* > aRet;
|
||||
std::vector< CmisProperty* > aRet;
|
||||
for ( sal_uInt32 i = 0; i < m_aCmisProperties.size(); i++ )
|
||||
{
|
||||
CustomProperty* pProp = new CustomProperty( m_aCmisProperties[i]->m_sName,
|
||||
m_aCmisProperties[i]->m_aValue );
|
||||
CmisProperty* pProp = new CmisProperty( m_aCmisProperties[i]->m_sId,
|
||||
m_aCmisProperties[i]->m_sName,
|
||||
m_aCmisProperties[i]->m_bUpdatable,
|
||||
m_aCmisProperties[i]->m_bRequired,
|
||||
m_aCmisProperties[i]->m_aValue );
|
||||
aRet.push_back( pProp );
|
||||
}
|
||||
|
||||
@ -522,9 +562,14 @@ void SfxDocumentInfoItem::ClearCmisProperties()
|
||||
m_aCmisProperties.clear();
|
||||
}
|
||||
|
||||
void SfxDocumentInfoItem::AddCmisProperty( const OUString& sName, const Any& rValue )
|
||||
void SfxDocumentInfoItem::AddCmisProperty( const OUString& sId,
|
||||
const OUString& sName,
|
||||
const bool bUpdatable,
|
||||
const bool bRequired,
|
||||
const Any& rValue )
|
||||
{
|
||||
CustomProperty* pProp = new CustomProperty( sName, rValue );
|
||||
CmisProperty* pProp = new CmisProperty( sId, sName, bUpdatable,
|
||||
bRequired, rValue );
|
||||
m_aCmisProperties.push_back( pProp );
|
||||
}
|
||||
|
||||
@ -2409,7 +2454,9 @@ void CmisPropertiesWindow::updateLineWidth()
|
||||
}
|
||||
}
|
||||
|
||||
void CmisPropertiesWindow::AddLine( const OUString& sName, Any& rAny )
|
||||
void CmisPropertiesWindow::AddLine( const OUString& /*sId*/, const OUString& sName,
|
||||
const bool /*bUpdatable*/, const bool /*bRequired*/,
|
||||
Any& rAny )
|
||||
{
|
||||
CmisPropertyLine* pNewLine = new CmisPropertyLine( this );
|
||||
pNewLine->m_aValueEdit.SetLoseFocusHdl( LINK( this, CmisPropertiesWindow, EditLoseFocusHdl ) );
|
||||
@ -2561,9 +2608,9 @@ void CmisPropertiesWindow::DoScroll( sal_Int32 nNewPos )
|
||||
}
|
||||
}
|
||||
|
||||
Sequence< beans::PropertyValue > CmisPropertiesWindow::GetCmisProperties() const
|
||||
Sequence< document::CmisPropertyValue > CmisPropertiesWindow::GetCmisProperties() const
|
||||
{
|
||||
Sequence< beans::PropertyValue > aPropertiesSeq( m_aCmisPropertiesLines.size() );
|
||||
Sequence< document::CmisPropertyValue > aPropertiesSeq( m_aCmisPropertiesLines.size() );
|
||||
sal_Int32 i = 0;
|
||||
std::vector< CmisPropertyLine* >::const_iterator pIter;
|
||||
for ( pIter = m_aCmisPropertiesLines.begin();
|
||||
@ -2701,11 +2748,14 @@ IMPL_LINK( CmisPropertiesControl, ScrollHdl, ScrollBar*, pScrollBar )
|
||||
}
|
||||
|
||||
|
||||
void CmisPropertiesControl::AddLine( const OUString& sName, Any& rAny, bool bInteractive )
|
||||
void CmisPropertiesControl::AddLine( const OUString& sId, const OUString& sName,
|
||||
const bool bUpdatable, const bool bRequired,
|
||||
Any& rAny, bool bInteractive )
|
||||
{
|
||||
m_pPropertiesWin->AddLine( sName, rAny );
|
||||
m_pPropertiesWin->AddLine( sId, sName, bUpdatable, bRequired, rAny );
|
||||
m_pVertScroll->SetRangeMax( m_pPropertiesWin->GetLineCount() + 1 );
|
||||
if ( bInteractive && m_pPropertiesWin->GetOutputSizePixel().Height() < m_pPropertiesWin->GetLineCount() * m_pPropertiesWin->GetLineHeight() )
|
||||
if ( bInteractive && m_pPropertiesWin->GetOutputSizePixel().Height() <
|
||||
m_pPropertiesWin->GetLineCount() * m_pPropertiesWin->GetLineHeight() )
|
||||
m_pVertScroll->DoScroll( m_pPropertiesWin->GetLineCount() + 1 );
|
||||
}
|
||||
|
||||
@ -2739,12 +2789,16 @@ sal_Bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet& rSet )
|
||||
if ( pInfo )
|
||||
{
|
||||
pInfo->ClearCmisProperties();
|
||||
Sequence< beans::PropertyValue > aPropertySeq = m_pPropertiesCtrl->GetCmisProperties();
|
||||
Sequence< document::CmisPropertyValue > aPropertySeq = m_pPropertiesCtrl->GetCmisProperties();
|
||||
sal_Int32 i = 0, nCount = aPropertySeq.getLength();
|
||||
for ( ; i < nCount; ++i )
|
||||
{
|
||||
if ( !aPropertySeq[i].Name.isEmpty() )
|
||||
pInfo->AddCmisProperty( aPropertySeq[i].Name, aPropertySeq[i].Value );
|
||||
pInfo->AddCmisProperty( aPropertySeq[i].Id,
|
||||
aPropertySeq[i].Name,
|
||||
aPropertySeq[i].Updatable,
|
||||
aPropertySeq[i].Required,
|
||||
aPropertySeq[i].Value );
|
||||
}
|
||||
}
|
||||
|
||||
@ -2758,10 +2812,14 @@ void SfxCmisPropertiesPage::Reset( const SfxItemSet& rItemSet )
|
||||
{
|
||||
m_pPropertiesCtrl->ClearAllLines();
|
||||
const SfxDocumentInfoItem* m_pInfoItem = &(const SfxDocumentInfoItem &)rItemSet.Get(SID_DOCINFO);
|
||||
std::vector< CustomProperty* > aCmisProps = m_pInfoItem->GetCmisProperties();
|
||||
std::vector< CmisProperty* > aCmisProps = m_pInfoItem->GetCmisProperties();
|
||||
for ( sal_uInt32 i = 0; i < aCmisProps.size(); i++ )
|
||||
{
|
||||
m_pPropertiesCtrl->AddLine( aCmisProps[i]->m_sName, aCmisProps[i]->m_aValue, false );
|
||||
m_pPropertiesCtrl->AddLine( aCmisProps[i]->m_sId,
|
||||
aCmisProps[i]->m_sName,
|
||||
aCmisProps[i]->m_bUpdatable,
|
||||
aCmisProps[i]->m_bRequired,
|
||||
aCmisProps[i]->m_aValue, false );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -492,7 +492,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
|
||||
}
|
||||
|
||||
Reference< XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY );
|
||||
beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues();
|
||||
uno::Sequence< document::CmisPropertyValue> aCmisProperties = xCmisDoc->getCmisPropertiesValues();
|
||||
|
||||
SfxDocumentInfoItem aDocInfoItem( aURL, getDocProperties(), aCmisProperties,
|
||||
IsUseUserData() );
|
||||
@ -923,7 +923,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
|
||||
{
|
||||
bool bShow = false;
|
||||
Reference< XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY );
|
||||
beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues();
|
||||
uno::Sequence< document::CmisPropertyValue> aCmisProperties = xCmisDoc->getCmisPropertiesValues();
|
||||
|
||||
if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) )
|
||||
{
|
||||
@ -954,7 +954,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
|
||||
{
|
||||
bool bShow = false;
|
||||
Reference< XCmisDocument > xCmisDoc( GetModel(), uno::UNO_QUERY );
|
||||
beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( );
|
||||
uno::Sequence< document::CmisPropertyValue> aCmisProperties = xCmisDoc->getCmisPropertiesValues( );
|
||||
|
||||
if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) )
|
||||
{
|
||||
|
@ -120,6 +120,7 @@
|
||||
using namespace ::com::sun::star;
|
||||
using namespace ::com::sun::star::uno;
|
||||
using ::com::sun::star::beans::PropertyValue;
|
||||
using ::com::sun::star::document::CmisPropertyValue;
|
||||
using ::com::sun::star::frame::XFrame;
|
||||
using ::com::sun::star::frame::XController;
|
||||
using ::com::sun::star::frame::XController2;
|
||||
@ -211,9 +212,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
|
||||
Reference< frame::XUntitledNumbers > m_xNumberedControllers;
|
||||
Reference< rdf::XDocumentMetadataAccess> m_xDocumentMetadata;
|
||||
::rtl::Reference< ::sfx2::DocumentUndoManager > m_pDocumentUndoManager;
|
||||
Sequence< beans::PropertyValue> m_cmisPropertiesValues;
|
||||
Sequence< beans::PropertyValue> m_cmisPropertiesDisplayNames;
|
||||
|
||||
Sequence< document::CmisPropertyValue> m_cmisPropertiesValues;
|
||||
|
||||
IMPL_SfxBaseModel_DataContainer( ::osl::Mutex& rMutex, SfxObjectShell* pObjectShell )
|
||||
: m_pObjectShell ( pObjectShell )
|
||||
@ -232,7 +231,6 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
|
||||
, m_xDocumentMetadata () // lazy
|
||||
, m_pDocumentUndoManager ()
|
||||
, m_cmisPropertiesValues ()
|
||||
, m_cmisPropertiesDisplayNames ()
|
||||
{
|
||||
// increase global instance counter.
|
||||
++g_nInstanceCounter;
|
||||
@ -2464,30 +2462,18 @@ void SAL_CALL SfxBaseModel::notifyDocumentEvent( const OUString&, const Referenc
|
||||
throw lang::NoSupportException("SfxBaseModel controlls all the sent notifications itself!", Reference< XInterface >() );
|
||||
}
|
||||
|
||||
Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getCmisPropertiesValues()
|
||||
Sequence< document::CmisPropertyValue > SAL_CALL SfxBaseModel::getCmisPropertiesValues()
|
||||
throw ( RuntimeException )
|
||||
{
|
||||
return m_pData->m_cmisPropertiesValues;
|
||||
}
|
||||
|
||||
void SAL_CALL SfxBaseModel::setCmisPropertiesValues( const Sequence< beans::PropertyValue >& _cmispropertiesvalues )
|
||||
void SAL_CALL SfxBaseModel::setCmisPropertiesValues( const Sequence< document::CmisPropertyValue >& _cmispropertiesvalues )
|
||||
throw ( RuntimeException )
|
||||
{
|
||||
m_pData->m_cmisPropertiesValues = _cmispropertiesvalues;
|
||||
}
|
||||
|
||||
Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getCmisPropertiesDisplayNames()
|
||||
throw ( RuntimeException )
|
||||
{
|
||||
return m_pData->m_cmisPropertiesDisplayNames;
|
||||
}
|
||||
|
||||
void SAL_CALL SfxBaseModel::setCmisPropertiesDisplayNames( const Sequence< beans::PropertyValue >& _cmispropertiesdisplaynames )
|
||||
throw ( RuntimeException )
|
||||
{
|
||||
m_pData->m_cmisPropertiesDisplayNames = _cmispropertiesdisplaynames;
|
||||
}
|
||||
|
||||
void SAL_CALL SfxBaseModel::checkOut( ) throw ( RuntimeException )
|
||||
{
|
||||
SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
|
||||
@ -2652,19 +2638,12 @@ void SfxBaseModel::loadCmisProperties( )
|
||||
comphelper::getProcessComponentContext() );
|
||||
Reference < beans::XPropertySetInfo > xProps = aContent.getProperties();
|
||||
OUString aCmisPropsValues( "CmisPropertiesValues" );
|
||||
OUString aCmisPropsNames( "CmisPropertiesDisplayNames" );
|
||||
if ( xProps->hasPropertyByName( aCmisPropsValues ) )
|
||||
{
|
||||
beans::PropertyValues aCmisValues;
|
||||
Sequence< document::CmisPropertyValue> aCmisValues;
|
||||
aContent.getPropertyValue( aCmisPropsValues ) >>= aCmisValues;
|
||||
setCmisPropertiesValues( aCmisValues );
|
||||
}
|
||||
if ( xProps->hasPropertyByName( aCmisPropsNames ) )
|
||||
{
|
||||
beans::PropertyValues aPropNames;
|
||||
aContent.getPropertyValue( aCmisPropsNames ) >>= aPropNames;
|
||||
setCmisPropertiesDisplayNames( aPropNames );
|
||||
}
|
||||
}
|
||||
catch (const ucb::ContentCreationException &)
|
||||
{
|
||||
|
@ -1429,7 +1429,7 @@ void SfxBaseController::ShowInfoBars( )
|
||||
Reference< document::XCmisDocument > xCmisDoc( m_pData->m_pViewShell->GetObjectShell()->GetModel(), uno::UNO_QUERY );
|
||||
if ( xCmisDoc.is( ) && xCmisDoc->canCheckOut( ) )
|
||||
{
|
||||
beans::PropertyValues aCmisProperties = xCmisDoc->getCmisPropertiesValues( );
|
||||
uno::Sequence< document::CmisPropertyValue> aCmisProperties = xCmisDoc->getCmisPropertiesValues( );
|
||||
|
||||
if ( xCmisDoc->isVersionable( ) && aCmisProperties.hasElements( ) )
|
||||
{
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <com/sun/star/beans/PropertyValue.hpp>
|
||||
#include <com/sun/star/beans/PropertyValues.hpp>
|
||||
#include <com/sun/star/beans/XPropertySetInfo.hpp>
|
||||
#include <com/sun/star/document/CmisPropertyValue.hpp>
|
||||
#include <com/sun/star/io/XActiveDataSink.hpp>
|
||||
#include <com/sun/star/io/XActiveDataStreamer.hpp>
|
||||
#include <com/sun/star/lang/IllegalAccessException.hpp>
|
||||
@ -577,14 +578,20 @@ namespace cmis
|
||||
{
|
||||
libcmis::ObjectPtr object = getObject( xEnv );
|
||||
map< string, libcmis::PropertyPtr >& aProperties = object->getProperties( );
|
||||
beans::PropertyValues aCmisProperties( aProperties.size( ) );
|
||||
beans::PropertyValue* pCmisProps = aCmisProperties.getArray( );
|
||||
uno::Sequence< document::CmisPropertyValue > aCmisProperties( aProperties.size( ) );
|
||||
document::CmisPropertyValue* pCmisProps = aCmisProperties.getArray( );
|
||||
sal_Int32 i = 0;
|
||||
for ( map< string, libcmis::PropertyPtr >::iterator it = aProperties.begin();
|
||||
it != aProperties.end( ); ++it, ++i )
|
||||
{
|
||||
string name = it->first;
|
||||
pCmisProps[i].Name = STD_TO_OUSTR( name );
|
||||
string sId = it->first;
|
||||
string sDisplayName = it->second->getPropertyType()->getDisplayName( );
|
||||
bool isUpdatable = it->second->getPropertyType()->isUpdatable( );
|
||||
bool isRequired = it->second->getPropertyType()->isRequired( );
|
||||
pCmisProps[i].Id = STD_TO_OUSTR( sId );
|
||||
pCmisProps[i].Name = STD_TO_OUSTR( sDisplayName );
|
||||
pCmisProps[i].Updatable = isUpdatable;
|
||||
pCmisProps[i].Required = isRequired;
|
||||
pCmisProps[i].Value = lcl_cmisPropertyToUno( it->second );
|
||||
}
|
||||
xRow->appendObject( rProp.Name, uno::makeAny( aCmisProperties ) );
|
||||
@ -594,30 +601,6 @@ namespace cmis
|
||||
xRow->appendVoid( rProp );
|
||||
}
|
||||
}
|
||||
else if ( rProp.Name == "CmisPropertiesDisplayNames" )
|
||||
{
|
||||
try
|
||||
{
|
||||
libcmis::ObjectPtr object = getObject( xEnv );
|
||||
map< string, libcmis::PropertyPtr >& aProperties = object->getProperties( );
|
||||
beans::PropertyValues aCmisProperties( aProperties.size( ) );
|
||||
beans::PropertyValue* pCmisProps = aCmisProperties.getArray( );
|
||||
sal_Int32 i = 0;
|
||||
for ( map< string, libcmis::PropertyPtr >::iterator it = aProperties.begin();
|
||||
it != aProperties.end( ); ++it, ++i )
|
||||
{
|
||||
string name = it->first;
|
||||
string displayName = it->second->getPropertyType()->getDisplayName( );
|
||||
pCmisProps[i].Name = STD_TO_OUSTR( name );
|
||||
pCmisProps[i].Value = uno::makeAny( STD_TO_OUSTR( displayName ) );
|
||||
}
|
||||
xRow->appendObject( rProp.Name, uno::makeAny( aCmisProperties ) );
|
||||
}
|
||||
catch ( const libcmis::Exception& )
|
||||
{
|
||||
xRow->appendVoid( rProp );
|
||||
}
|
||||
}
|
||||
else if ( rProp.Name == "IsVersionable" )
|
||||
{
|
||||
try
|
||||
|
Loading…
x
Reference in New Issue
Block a user