summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCao Cuong Ngo <cao.cuong.ngo@gmail.com>2013-06-18 15:10:26 +0200
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2013-09-02 13:51:48 +0200
commit969807901d9dae91be7fc6ba9aa518f4d25b5034 (patch)
tree463e4584618060517fb705b1c563c19ff9e63692
parent91d9430d68434cd267b481f73d4bc522a902eeda (diff)
Cmis Property
Add MultiValued, OpenChoice and Choices to CMIS Property Change-Id: Iade033c86878368b39a0264ad0a56d0286e6bffb
-rw-r--r--include/sfx2/dinfdlg.hxx6
-rw-r--r--offapi/com/sun/star/document/CmisProperty.idl15
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx53
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx13
4 files changed, 72 insertions, 15 deletions
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 6f0d57a2ede9..6577cb12f855 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -167,6 +167,8 @@ public:
void ClearCmisProperties();
void AddCmisProperty( const OUString& sId, const OUString& sName,
const bool bUpdatable, const bool bRequired,
+ const bool bMultiValued, const bool bOpenChoice,
+ const com::sun::star::uno::Any& Choices,
const com::sun::star::uno::Any& rValue );
virtual SfxPoolItem* Clone( SfxItemPool* pPool = NULL ) const;
@@ -635,6 +637,8 @@ public:
inline sal_Int32 GetLineHeight() const { return m_nLineHeight; }
void AddLine( const OUString& sId, const OUString& sName,
const bool bUpdatable, const bool bRequired,
+ const bool bMultiValued, const bool bOpenChoice,
+ com::sun::star::uno::Any& aChoices,
com::sun::star::uno::Any& rAny );
bool AreAllLinesValid() const;
void ClearAllLines();
@@ -664,6 +668,8 @@ public:
void AddLine( const OUString& sId, const OUString& sName,
const bool bUpdatable, const bool bRequired,
+ const bool bMultiValude, const bool bOpenChoice,
+ com::sun::star::uno::Any& aChoices,
com::sun::star::uno::Any& rAny, bool bInteractive );
inline bool AreAllLinesValid() const { return m_pPropertiesWin->AreAllLinesValid(); }
diff --git a/offapi/com/sun/star/document/CmisProperty.idl b/offapi/com/sun/star/document/CmisProperty.idl
index f6009a0f3685..65caab11ead1 100644
--- a/offapi/com/sun/star/document/CmisProperty.idl
+++ b/offapi/com/sun/star/document/CmisProperty.idl
@@ -21,7 +21,7 @@
module com { module sun { module star { module document {
-/** specifies a CMIS property value.
+/** specifies a CMIS property.
*/
struct CmisProperty
{
@@ -42,6 +42,19 @@ struct CmisProperty
*/
boolean Required;
+ /** specifies if the property has multiple value
+ */
+ boolean MultiValued;
+
+ /** specifies if the property value can be freely set
+ or is restricted from a list of choices.
+ */
+ boolean OpenChoice;
+
+ /** specifies the possible choices of the values.
+ */
+ any Choices;
+
/** specifies value of the property
*/
any Value;
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 111c359f87d9..d5a68c8c6621 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -98,26 +98,38 @@ struct CmisProperty
OUString m_sName;
bool m_bUpdatable;
bool m_bRequired;
+ bool m_bMultiValued;
+ bool m_bOpenChoice;
+ com::sun::star::uno::Any m_aChoices;
com::sun::star::uno::Any m_aValue;
CmisProperty( const OUString& sId,
const OUString& sName,
const bool bUpdatable,
const bool bRequired,
+ const bool bMultiValued,
+ const bool bOpenChoice,
+ const com::sun::star::uno::Any& aChoices,
const com::sun::star::uno::Any& rValue ) :
m_sId( sId ),
m_sName( sName ),
m_bUpdatable( bUpdatable ),
m_bRequired( bRequired ),
+ m_bMultiValued( bMultiValued ),
+ m_bOpenChoice( bOpenChoice ),
+ m_aChoices( aChoices),
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;
+ && m_sName == rProp.m_sName
+ && m_bUpdatable == rProp.m_bUpdatable
+ && m_bRequired == rProp.m_bRequired
+ && m_bMultiValued == rProp.m_bMultiValued
+ && m_bOpenChoice == rProp.m_bOpenChoice
+ && m_aChoices == rProp.m_aChoices
+ && m_aValue == rProp.m_aValue;
}
};
@@ -308,6 +320,9 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const OUString& rFile,
i_cmisProps[i].Name,
i_cmisProps[i].Updatable,
i_cmisProps[i].Required,
+ i_cmisProps[i].MultiValued,
+ i_cmisProps[i].OpenChoice,
+ i_cmisProps[i].Choices,
i_cmisProps[i].Value );
m_aCmisProperties.push_back( pProp );
}
@@ -352,6 +367,9 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const SfxDocumentInfoItem& rItem )
rItem.m_aCmisProperties[i]->m_sName,
rItem.m_aCmisProperties[i]->m_bUpdatable,
rItem.m_aCmisProperties[i]->m_bRequired,
+ rItem.m_aCmisProperties[i]->m_bMultiValued,
+ rItem.m_aCmisProperties[i]->m_bOpenChoice,
+ rItem.m_aCmisProperties[i]->m_aChoices,
rItem.m_aCmisProperties[i]->m_aValue );
m_aCmisProperties.push_back( pProp );
}
@@ -548,6 +566,9 @@ std::vector< CmisProperty* > SfxDocumentInfoItem::GetCmisProperties() const
m_aCmisProperties[i]->m_sName,
m_aCmisProperties[i]->m_bUpdatable,
m_aCmisProperties[i]->m_bRequired,
+ m_aCmisProperties[i]->m_bMultiValued,
+ m_aCmisProperties[i]->m_bOpenChoice,
+ m_aCmisProperties[i]->m_aChoices,
m_aCmisProperties[i]->m_aValue );
aRet.push_back( pProp );
}
@@ -566,10 +587,14 @@ void SfxDocumentInfoItem::AddCmisProperty( const OUString& sId,
const OUString& sName,
const bool bUpdatable,
const bool bRequired,
- const Any& rValue )
+ const bool bMultiValued,
+ const bool bOpenChoice,
+ const Any& aChoices,
+ const Any& aValue )
{
CmisProperty* pProp = new CmisProperty( sId, sName, bUpdatable,
- bRequired, rValue );
+ bRequired, bMultiValued,
+ bOpenChoice, aChoices, aValue );
m_aCmisProperties.push_back( pProp );
}
@@ -2456,7 +2481,8 @@ void CmisPropertiesWindow::updateLineWidth()
void CmisPropertiesWindow::AddLine( const OUString& /*sId*/, const OUString& sName,
const bool bUpdatable, const bool /*bRequired*/,
- Any& rAny )
+ const bool /*bMultiValued*/, const bool /*bOpenChoice*/,
+ Any& /*aChoices*/, Any& rAny )
{
CmisPropertyLine* pNewLine = new CmisPropertyLine( this );
pNewLine->m_aValueEdit.SetLoseFocusHdl( LINK( this, CmisPropertiesWindow, EditLoseFocusHdl ) );
@@ -2750,12 +2776,13 @@ IMPL_LINK( CmisPropertiesControl, ScrollHdl, ScrollBar*, pScrollBar )
return 0;
}
-
void CmisPropertiesControl::AddLine( const OUString& sId, const OUString& sName,
const bool bUpdatable, const bool bRequired,
- Any& rAny, bool bInteractive )
+ const bool bMultiValued, const bool bOpenChoice,
+ Any& aChoices, Any& rAny, bool bInteractive )
{
- m_pPropertiesWin->AddLine( sId, sName, bUpdatable, bRequired, rAny );
+ m_pPropertiesWin->AddLine( sId, sName, bUpdatable, bRequired, bMultiValued,
+ bOpenChoice, aChoices, rAny );
m_pVertScroll->SetRangeMax( m_pPropertiesWin->GetLineCount() + 1 );
if ( bInteractive && m_pPropertiesWin->GetOutputSizePixel().Height() <
m_pPropertiesWin->GetLineCount() * m_pPropertiesWin->GetLineHeight() )
@@ -2801,6 +2828,9 @@ sal_Bool SfxCmisPropertiesPage::FillItemSet( SfxItemSet& rSet )
aPropertySeq[i].Name,
aPropertySeq[i].Updatable,
aPropertySeq[i].Required,
+ aPropertySeq[i].MultiValued,
+ aPropertySeq[i].OpenChoice,
+ aPropertySeq[i].Choices,
aPropertySeq[i].Value );
}
}
@@ -2822,6 +2852,9 @@ void SfxCmisPropertiesPage::Reset( const SfxItemSet& rItemSet )
aCmisProps[i]->m_sName,
aCmisProps[i]->m_bUpdatable,
aCmisProps[i]->m_bRequired,
+ aCmisProps[i]->m_bMultiValued,
+ aCmisProps[i]->m_bOpenChoice,
+ aCmisProps[i]->m_aChoices,
aCmisProps[i]->m_aValue, false );
}
}
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index c7dd64079e83..7c1355dce462 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -586,12 +586,17 @@ namespace cmis
{
string sId = it->first;
string sDisplayName = it->second->getPropertyType()->getDisplayName( );
- bool isUpdatable = it->second->getPropertyType()->isUpdatable( );
- bool isRequired = it->second->getPropertyType()->isRequired( );
+ bool bUpdatable = it->second->getPropertyType()->isUpdatable( );
+ bool bRequired = it->second->getPropertyType()->isRequired( );
+ bool bMultiValued = it->second->getPropertyType()->isMultiValued();
+ bool bOpenChoice = it->second->getPropertyType()->isOpenChoice();
+
pCmisProps[i].Id = STD_TO_OUSTR( sId );
pCmisProps[i].Name = STD_TO_OUSTR( sDisplayName );
- pCmisProps[i].Updatable = isUpdatable;
- pCmisProps[i].Required = isRequired;
+ pCmisProps[i].Updatable = bUpdatable;
+ pCmisProps[i].Required = bRequired;
+ pCmisProps[i].MultiValued = bMultiValued;
+ pCmisProps[i].OpenChoice = bOpenChoice;
pCmisProps[i].Value = lcl_cmisPropertyToUno( it->second );
}
xRow->appendObject( rProp.Name, uno::makeAny( aCmisProperties ) );