1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_ucb.hxx"
26 
27 /**************************************************************************
28                                 TODO
29  **************************************************************************
30 
31  **************************************************************************
32 
33     Props/Commands:
34 
35                         root  document folder  folder  stream  stream
36                                                 (new)          (new)
37     ----------------------------------------------------------------
38     ContentType         r       r       r       r       r       r
39     IsDocument          r       r       r       r       r       r
40     IsFolder            r       r       r       r       r       r
41     Title               r       r       w       w       w       w
42     CreatableContentsInfo r     r       r       r       r       r
43     Storage             -       -       r       r       -       -
44     DocumentModel       -       r       -       -       -       -
45 
46     getCommandInfo      x       x       x       x       x       x
47     getPropertySetInfo  x       x       x       x       x       x
48     getPropertyValues   x       x       x       x       x       x
49     setPropertyValues   x       x       x       x       x       x
50     insert              -       -       x       x       x(*)    x(*)
51     delete              -       -       x       -       x       -
52     open                x       x       x       -       x       -
53     transfer            -       x       x       -       -       -
54     createNewContent    -       x       x       -       -       -
55 
56 #ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
57  (*) not supported by streams that are direct children of document
58 #endif
59 
60  *************************************************************************/
61 
62 #include "com/sun/star/beans/Property.hpp"
63 #include "com/sun/star/beans/PropertyAttribute.hpp"
64 #include "com/sun/star/beans/PropertyValue.hpp"
65 #include "com/sun/star/embed/XStorage.hpp"
66 #include "com/sun/star/frame/XModel.hpp"
67 #include "com/sun/star/ucb/CommandInfo.hpp"
68 #include "com/sun/star/ucb/OpenCommandArgument2.hpp"
69 #include "com/sun/star/ucb/TransferInfo.hpp"
70 
71 #include "tdoc_content.hxx"
72 
73 namespace com { namespace sun { namespace star { namespace embed {
74     class XStorage;
75 } } } }
76 
77 using namespace com::sun::star;
78 using namespace tdoc_ucp;
79 
80 //=========================================================================
81 //
82 // Content implementation.
83 //
84 //=========================================================================
85 
86 #define MAKEPROPSEQUENCE( a ) \
87     uno::Sequence< beans::Property >( a, sizeof( a )  / sizeof( a[ 0 ] ) )
88 
89 #define MAKECMDSEQUENCE( a ) \
90     uno::Sequence< ucb::CommandInfo >( a, sizeof( a )  / sizeof( a[ 0 ] ) )
91 
92 //=========================================================================
93 //
94 // IMPORTENT: If any property data ( name / type / ... ) are changed, then
95 //            Content::getPropertyValues(...) must be adapted too!
96 //
97 //=========================================================================
98 
99 // virtual
getProperties(const uno::Reference<ucb::XCommandEnvironment> &)100 uno::Sequence< beans::Property > Content::getProperties(
101             const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
102 {
103     osl::Guard< osl::Mutex > aGuard( m_aMutex );
104 
105     if ( m_aProps.getType() == STREAM )
106     {
107         //=================================================================
108         //
109         // Stream: Supported properties
110         //
111         //=================================================================
112 
113         static const beans::Property aStreamPropertyInfoTable[] =
114         {
115             ///////////////////////////////////////////////////////////
116             // Mandatory properties
117             ///////////////////////////////////////////////////////////
118             beans::Property(
119                 rtl::OUString(
120                     RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
121                 -1,
122                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
123                 beans::PropertyAttribute::BOUND
124                     | beans::PropertyAttribute::READONLY
125             ),
126             beans::Property(
127                 rtl::OUString(
128                     RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
129                 -1,
130                 getCppuBooleanType(),
131                 beans::PropertyAttribute::BOUND
132                     | beans::PropertyAttribute::READONLY
133             ),
134             beans::Property(
135                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
136                 -1,
137                 getCppuBooleanType(),
138                 beans::PropertyAttribute::BOUND
139                     | beans::PropertyAttribute::READONLY
140             ),
141             beans::Property(
142                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
143                 -1,
144                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
145                 beans::PropertyAttribute::BOUND
146             ),
147             ///////////////////////////////////////////////////////////
148             // Optional standard properties
149             ///////////////////////////////////////////////////////////
150             beans::Property(
151                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
152                     "CreatableContentsInfo" ) ),
153                 -1,
154                 getCppuType( static_cast<
155                     const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
156                 beans::PropertyAttribute::BOUND
157                     | beans::PropertyAttribute::READONLY
158             )
159             ///////////////////////////////////////////////////////////
160             // New properties
161             ///////////////////////////////////////////////////////////
162         };
163         return MAKEPROPSEQUENCE( aStreamPropertyInfoTable );
164     }
165     else if ( m_aProps.getType() == FOLDER )
166     {
167         //=================================================================
168         //
169         // Folder: Supported properties
170         //
171         //=================================================================
172 
173         static const beans::Property aFolderPropertyInfoTable[] =
174         {
175             ///////////////////////////////////////////////////////////
176             // Mandatory properties
177             ///////////////////////////////////////////////////////////
178             beans::Property(
179                 rtl::OUString(
180                     RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
181                 -1,
182                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
183                 beans::PropertyAttribute::BOUND
184                     | beans::PropertyAttribute::READONLY
185             ),
186             beans::Property(
187                 rtl::OUString(
188                     RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
189                 -1,
190                 getCppuBooleanType(),
191                 beans::PropertyAttribute::BOUND
192                     | beans::PropertyAttribute::READONLY
193             ),
194             beans::Property(
195                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
196                 -1,
197                 getCppuBooleanType(),
198                 beans::PropertyAttribute::BOUND
199                     | beans::PropertyAttribute::READONLY
200             ),
201             beans::Property(
202                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
203                 -1,
204                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
205                 beans::PropertyAttribute::BOUND
206             ),
207             ///////////////////////////////////////////////////////////
208             // Optional standard properties
209             ///////////////////////////////////////////////////////////
210             beans::Property(
211                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
212                     "CreatableContentsInfo" ) ),
213                 -1,
214                 getCppuType( static_cast<
215                     const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
216                 beans::PropertyAttribute::BOUND
217                     | beans::PropertyAttribute::READONLY
218             ),
219             ///////////////////////////////////////////////////////////
220             // New properties
221             ///////////////////////////////////////////////////////////
222             beans::Property(
223                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Storage" ) ),
224                 -1,
225                 getCppuType( static_cast<
226                     const uno::Reference< embed::XStorage > * >( 0 ) ),
227                 beans::PropertyAttribute::BOUND
228                     | beans::PropertyAttribute::READONLY
229             )
230         };
231         return MAKEPROPSEQUENCE( aFolderPropertyInfoTable );
232     }
233     else if ( m_aProps.getType() == DOCUMENT )
234     {
235         //=================================================================
236         //
237         // Document: Supported properties
238         //
239         //=================================================================
240 
241         static const beans::Property aDocPropertyInfoTable[] =
242         {
243             ///////////////////////////////////////////////////////////
244             // Mandatory properties
245             ///////////////////////////////////////////////////////////
246             beans::Property(
247                 rtl::OUString(
248                     RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
249                 -1,
250                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
251                 beans::PropertyAttribute::BOUND
252                     | beans::PropertyAttribute::READONLY
253             ),
254             beans::Property(
255                 rtl::OUString(
256                     RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
257                 -1,
258                 getCppuBooleanType(),
259                 beans::PropertyAttribute::BOUND
260                     | beans::PropertyAttribute::READONLY
261             ),
262             beans::Property(
263                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
264                 -1,
265                 getCppuBooleanType(),
266                 beans::PropertyAttribute::BOUND
267                     | beans::PropertyAttribute::READONLY
268             ),
269             beans::Property(
270                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
271                 -1,
272                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
273                 beans::PropertyAttribute::BOUND
274                     | beans::PropertyAttribute::READONLY
275             ),
276             ///////////////////////////////////////////////////////////
277             // Optional standard properties
278             ///////////////////////////////////////////////////////////
279             beans::Property(
280                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
281                     "CreatableContentsInfo" ) ),
282                 -1,
283                 getCppuType( static_cast<
284                     const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
285                 beans::PropertyAttribute::BOUND
286                     | beans::PropertyAttribute::READONLY
287             ),
288             ///////////////////////////////////////////////////////////
289             // New properties
290             ///////////////////////////////////////////////////////////
291             beans::Property(
292                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DocumentModel" ) ),
293                 -1,
294                 getCppuType( static_cast<
295                     const uno::Reference< frame::XModel > * >( 0 ) ),
296                 beans::PropertyAttribute::BOUND
297                     | beans::PropertyAttribute::READONLY
298             )
299         };
300         return MAKEPROPSEQUENCE( aDocPropertyInfoTable );
301     }
302     else
303     {
304         //=================================================================
305         //
306         // Root: Supported properties
307         //
308         //=================================================================
309 
310         OSL_ENSURE( m_aProps.getType() == ROOT, "Wrong content type!" );
311 
312         static const beans::Property aRootPropertyInfoTable[] =
313         {
314             ///////////////////////////////////////////////////////////////
315             // Mandatory properties
316             ///////////////////////////////////////////////////////////////
317             beans::Property(
318                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ),
319                 -1,
320                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
321                 beans::PropertyAttribute::BOUND
322                     | beans::PropertyAttribute::READONLY
323             ),
324             beans::Property(
325                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ),
326                 -1,
327                 getCppuBooleanType(),
328                 beans::PropertyAttribute::BOUND
329                     | beans::PropertyAttribute::READONLY
330             ),
331             beans::Property(
332                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ),
333                 -1,
334                 getCppuBooleanType(),
335                 beans::PropertyAttribute::BOUND
336                     | beans::PropertyAttribute::READONLY
337             ),
338             beans::Property(
339                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ),
340                 -1,
341                 getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
342                 beans::PropertyAttribute::BOUND
343                     | beans::PropertyAttribute::READONLY
344             ),
345             ///////////////////////////////////////////////////////////////
346             // Optional standard properties
347             ///////////////////////////////////////////////////////////////
348             beans::Property(
349                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
350                     "CreatableContentsInfo" ) ),
351                 -1,
352                 getCppuType( static_cast<
353                     const uno::Sequence< ucb::ContentInfo > * >( 0 ) ),
354                 beans::PropertyAttribute::BOUND
355                     | beans::PropertyAttribute::READONLY
356             )
357             ///////////////////////////////////////////////////////////////
358             // New properties
359             ///////////////////////////////////////////////////////////////
360         };
361         return MAKEPROPSEQUENCE( aRootPropertyInfoTable );
362     }
363 }
364 
365 //=========================================================================
366 // virtual
getCommands(const uno::Reference<ucb::XCommandEnvironment> &)367 uno::Sequence< ucb::CommandInfo > Content::getCommands(
368             const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ )
369 {
370     osl::Guard< osl::Mutex > aGuard( m_aMutex );
371 
372     if ( m_aProps.getType() == STREAM )
373     {
374 #ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT
375         Uri aUri( m_xIdentifier->getContentIdentifier() );
376         Uri aParentUri( aUri.getParentUri() );
377 
378         if ( aParentUri.isDocument() )
379         {
380             //=================================================================
381             //
382             // Stream, that is a child of a document: Supported commands
383             //
384             //=================================================================
385 
386             static const ucb::CommandInfo aStreamCommandInfoTable1[] =
387             {
388                 ///////////////////////////////////////////////////////////
389                 // Mandatory commands
390                 ///////////////////////////////////////////////////////////
391                 ucb::CommandInfo(
392                     rtl::OUString(
393                         RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
394                     -1,
395                     getCppuVoidType()
396                 ),
397                 ucb::CommandInfo(
398                     rtl::OUString(
399                         RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
400                     -1,
401                     getCppuVoidType()
402                 ),
403                 ucb::CommandInfo(
404                     rtl::OUString(
405                         RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
406                     -1,
407                     getCppuType(
408                         static_cast< uno::Sequence< beans::Property > * >( 0 ) )
409                 ),
410                 ucb::CommandInfo(
411                     rtl::OUString(
412                         RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
413                     -1,
414                     getCppuType(
415                         static_cast<
416                             uno::Sequence< beans::PropertyValue > * >( 0 ) )
417                 ),
418                 ///////////////////////////////////////////////////////////
419                 // Optional standard commands
420                 ///////////////////////////////////////////////////////////
421                 ucb::CommandInfo(
422                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
423                     -1,
424                     getCppuBooleanType()
425                 ),
426                 ucb::CommandInfo(
427                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
428                     -1,
429                     getCppuType(
430                         static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
431                 )
432                 ///////////////////////////////////////////////////////////
433                 // New commands
434                 ///////////////////////////////////////////////////////////
435             };
436             return MAKECMDSEQUENCE( aStreamCommandInfoTable1 );
437         }
438 #endif
439         //=================================================================
440         //
441         // Stream: Supported commands
442         //
443         //=================================================================
444 
445         static const ucb::CommandInfo aStreamCommandInfoTable[] =
446         {
447             ///////////////////////////////////////////////////////////
448             // Mandatory commands
449             ///////////////////////////////////////////////////////////
450             ucb::CommandInfo(
451                 rtl::OUString(
452                     RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
453                 -1,
454                 getCppuVoidType()
455             ),
456             ucb::CommandInfo(
457                 rtl::OUString(
458                     RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
459                 -1,
460                 getCppuVoidType()
461             ),
462             ucb::CommandInfo(
463                 rtl::OUString(
464                     RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
465                 -1,
466                 getCppuType(
467                     static_cast< uno::Sequence< beans::Property > * >( 0 ) )
468             ),
469             ucb::CommandInfo(
470                 rtl::OUString(
471                     RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
472                 -1,
473                 getCppuType(
474                     static_cast<
475                         uno::Sequence< beans::PropertyValue > * >( 0 ) )
476             ),
477             ///////////////////////////////////////////////////////////
478             // Optional standard commands
479             ///////////////////////////////////////////////////////////
480             ucb::CommandInfo(
481                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
482                 -1,
483                 getCppuBooleanType()
484             ),
485             ucb::CommandInfo(
486                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
487                 -1,
488                 getCppuVoidType()
489             ),
490             ucb::CommandInfo(
491                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
492                 -1,
493                 getCppuType(
494                     static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
495             )
496             ///////////////////////////////////////////////////////////
497             // New commands
498             ///////////////////////////////////////////////////////////
499         };
500         return MAKECMDSEQUENCE( aStreamCommandInfoTable );
501     }
502     else if ( m_aProps.getType() == FOLDER )
503     {
504         //=================================================================
505         //
506         // Folder: Supported commands
507         //
508         //=================================================================
509 
510         static const ucb::CommandInfo aFolderCommandInfoTable[] =
511         {
512             ///////////////////////////////////////////////////////////
513             // Mandatory commands
514             ///////////////////////////////////////////////////////////
515             ucb::CommandInfo(
516                 rtl::OUString(
517                     RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
518                 -1,
519                 getCppuVoidType()
520             ),
521             ucb::CommandInfo(
522                 rtl::OUString(
523                     RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
524                 -1,
525                 getCppuVoidType()
526             ),
527             ucb::CommandInfo(
528                 rtl::OUString(
529                     RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
530                 -1,
531                 getCppuType(
532                     static_cast< uno::Sequence< beans::Property > * >( 0 ) )
533             ),
534             ucb::CommandInfo(
535                 rtl::OUString(
536                     RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
537                 -1,
538                 getCppuType(
539                     static_cast<
540                         uno::Sequence< beans::PropertyValue > * >( 0 ) )
541             ),
542             ///////////////////////////////////////////////////////////
543             // Optional standard commands
544             ///////////////////////////////////////////////////////////
545             ucb::CommandInfo(
546                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ),
547                 -1,
548                 getCppuBooleanType()
549             ),
550             ucb::CommandInfo(
551                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ),
552                 -1,
553                 getCppuVoidType()
554             ),
555             ucb::CommandInfo(
556                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
557                 -1,
558                 getCppuType(
559                     static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
560             ),
561             ucb::CommandInfo(
562                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ),
563                 -1,
564                 getCppuType( static_cast< ucb::TransferInfo * >( 0 ) )
565             ),
566             ucb::CommandInfo(
567                 rtl::OUString(
568                     RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ),
569                 -1,
570                 getCppuType( static_cast< ucb::ContentInfo * >( 0 ) )
571             )
572             ///////////////////////////////////////////////////////////
573             // New commands
574             ///////////////////////////////////////////////////////////
575         };
576         return MAKECMDSEQUENCE( aFolderCommandInfoTable );
577     }
578     else if ( m_aProps.getType() == DOCUMENT )
579     {
580         //=================================================================
581         //
582         // Document: Supported commands
583         //
584         //=================================================================
585 
586         static const ucb::CommandInfo aDocCommandInfoTable[] =
587         {
588             ///////////////////////////////////////////////////////////
589             // Mandatory commands
590             ///////////////////////////////////////////////////////////
591             ucb::CommandInfo(
592                 rtl::OUString(
593                     RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
594                 -1,
595                 getCppuVoidType()
596             ),
597             ucb::CommandInfo(
598                 rtl::OUString(
599                     RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
600                 -1,
601                 getCppuVoidType()
602             ),
603             ucb::CommandInfo(
604                 rtl::OUString(
605                     RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
606                 -1,
607                 getCppuType(
608                     static_cast< uno::Sequence< beans::Property > * >( 0 ) )
609             ),
610             ucb::CommandInfo(
611                 rtl::OUString(
612                     RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
613                 -1,
614                 getCppuType(
615                     static_cast<
616                         uno::Sequence< beans::PropertyValue > * >( 0 ) )
617             ),
618             ///////////////////////////////////////////////////////////
619             // Optional standard commands
620             ///////////////////////////////////////////////////////////
621             ucb::CommandInfo(
622                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
623                 -1,
624                 getCppuType(
625                     static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
626             ),
627             ucb::CommandInfo(
628                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ),
629                 -1,
630                 getCppuType( static_cast< ucb::TransferInfo * >( 0 ) )
631             ),
632             ucb::CommandInfo(
633                 rtl::OUString(
634                     RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ),
635                 -1,
636                 getCppuType( static_cast< ucb::ContentInfo * >( 0 ) )
637             )
638             ///////////////////////////////////////////////////////////
639             // New commands
640             ///////////////////////////////////////////////////////////
641         };
642         return MAKECMDSEQUENCE( aDocCommandInfoTable );
643     }
644     else
645     {
646         //=================================================================
647         //
648         // Root: Supported commands
649         //
650         //=================================================================
651 
652         OSL_ENSURE( m_aProps.getType() == ROOT, "Wrong content type!" );
653 
654         static const ucb::CommandInfo aRootCommandInfoTable[] =
655         {
656             ///////////////////////////////////////////////////////////
657             // Mandatory commands
658             ///////////////////////////////////////////////////////////
659             ucb::CommandInfo(
660                 rtl::OUString(
661                     RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ),
662                 -1,
663                 getCppuVoidType()
664             ),
665             ucb::CommandInfo(
666                 rtl::OUString(
667                     RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ),
668                 -1,
669                 getCppuVoidType()
670             ),
671             ucb::CommandInfo(
672                 rtl::OUString(
673                     RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ),
674                 -1,
675                 getCppuType(
676                     static_cast< uno::Sequence< beans::Property > * >( 0 ) )
677             ),
678             ucb::CommandInfo(
679                 rtl::OUString(
680                     RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ),
681                 -1,
682                 getCppuType(
683                     static_cast<
684                         uno::Sequence< beans::PropertyValue > * >( 0 ) )
685             ),
686             ///////////////////////////////////////////////////////////
687             // Optional standard commands
688             ///////////////////////////////////////////////////////////
689             ucb::CommandInfo(
690                 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ),
691                 -1,
692                 getCppuType(
693                     static_cast< ucb::OpenCommandArgument2 * >( 0 ) )
694             )
695             ///////////////////////////////////////////////////////////
696             // New commands
697             ///////////////////////////////////////////////////////////
698         };
699         return MAKECMDSEQUENCE( aRootCommandInfoTable );
700     }
701 }
702