summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorCao Cuong Ngo <cao.cuong.ngo@gmail.com>2013-06-17 15:17:00 +0200
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2013-09-02 13:51:48 +0200
commitbeff419a6e9e5ae16e84366d628ca478ab1afdb8 (patch)
tree2bf59c933ab7cecf3c82f631070dde5989a057b0 /ucb
parent5118e421e4d3eef3a1ff7c653d4bf5dd200b440e (diff)
CMIS properties
Create a CmisPropertyValue with additional DisplayName, Updatable and Required properties. Change-Id: Ia20d76a739ac5c51d7c89ef6f1a40a299697cb0e
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/cmis/cmis_content.cxx39
1 files changed, 11 insertions, 28 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx
index 2f8da9ef13a9..ac206e7cb80e 100644
--- a/ucb/source/ucp/cmis/cmis_content.cxx
+++ b/ucb/source/ucp/cmis/cmis_content.cxx
@@ -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