LibreOffice5(103)ファイルシステムストレージのサービスとインターフェイスの一覧

2017-12-06

旧ブログ

t f B! P L
StorageFactoryサービスのときと違って、FileSystemStorageFactoryサービスのcreateInstanceWithArguments()メソッドでストレージを取得するときのURLはフォルダ(ドキュメント内のフォルダは不可)のものでないといけません。逆にファイル外のフォルダはStorageFactoryサービスではuno.Exceptionが発生しました。

前の関連記事:LibreOffice5(102)ストレージのサービスとインターフェイスの一覧


ファイルシステムストレージのサービスとインターフェイスの一覧

from com.sun.star.embed import ElementModes  # 定数
def macro():
 ctx = XSCRIPTCONTEXT.getComponentContext()  # コンポーネントコンテクストの取得。
 smgr = ctx.getServiceManager()  # サービスマネージャーの取得。 
 tcu = smgr.createInstanceWithContext("pq.Tcu", ctx)  # サービス名か実装名でインスタンス化。
 filesystemstoragefactory = smgr.createInstanceWithContext('com.sun.star.embed.FileSystemStorageFactory', ctx)
 storage = filesystemstoragefactory.createInstanceWithArguments(("file:///home/pq", ElementModes.READ))
 tcu.wtree(storage) 
Linuxのホームフォルダのストレージを取得しています。

存在しないフォルダのfileurlを渡すとInteractiveAugmentedIOExceptionが発生します。

XHierarchicalStorageAccessインターフェイスが使えます。

ストレージと違ってXTransactedObjectインターフェイスがなく、commit()しなくても変更が反映されるようです。


├─.beans.XPropertySet
│                        void  addPropertyChangeListener( [in]                         string aPropertyName,
│                                                         [in] .beans.XPropertyChangeListener xListener
│                                              ) raises ( .lang.WrappedTargetException,
│                                                         .beans.UnknownPropertyException)
│                        void  addVetoableChangeListener( [in]                         string PropertyName,
│                                                         [in] .beans.XVetoableChangeListener aListener
│                                              ) raises ( .lang.WrappedTargetException,
│                                                         .beans.UnknownPropertyException)
│     .beans.XPropertySetInfo  getPropertySetInfo()
│                         any  getPropertyValue( [in] string PropertyName
│                                     ) raises ( .lang.WrappedTargetException,
│                                                .beans.UnknownPropertyException)
│                        void  removePropertyChangeListener( [in]                         string aPropertyName,
│                                                            [in] .beans.XPropertyChangeListener aListener
│                                                 ) raises ( .lang.WrappedTargetException,
│                                                            .beans.UnknownPropertyException)
│                        void  removeVetoableChangeListener( [in]                         string PropertyName,
│                                                            [in] .beans.XVetoableChangeListener aListener
│                                                 ) raises ( .lang.WrappedTargetException,
│                                                            .beans.UnknownPropertyException)
│                        void  setPropertyValue( [in] string aPropertyName,
│                                                [in]    any aValue
│                                     ) raises ( .lang.WrappedTargetException,
│                                                .lang.IllegalArgumentException,
│                                                .beans.PropertyVetoException,
│                                                .beans.UnknownPropertyException)
├─.embed.XHierarchicalStorageAccess
│     .embed.XExtendedStorageStream  openEncryptedStreamElementByHierarchicalName( [in] string sStreamName,
│                                                                                  [in]   long nOpenMode,
│                                                                                  [in] string sPassword
│                                                                       ) raises ( .embed.StorageWrappedTargetException,
│                                                                                  .io.IOException,
│                                                                                  .packages.WrongPasswordException,
│                                                                                  .packages.NoEncryptionException,
│                                                                                  .lang.IllegalArgumentException,
│                                                                                  .embed.InvalidStorageException)
│     .embed.XExtendedStorageStream  openStreamElementByHierarchicalName( [in] string sStreamPath,
│                                                                         [in]   long nOpenMode
│                                                              ) raises ( .embed.StorageWrappedTargetException,
│                                                                         .io.IOException,
│                                                                         .packages.WrongPasswordException,
│                                                                         .lang.IllegalArgumentException,
│                                                                         .embed.InvalidStorageException)
│                              void  removeStreamElementByHierarchicalName( [in] string sElementPath
│                                                                ) raises ( .embed.StorageWrappedTargetException,
│                                                                           .io.IOException,
│                                                                           .container.NoSuchElementException,
│                                                                           .lang.IllegalArgumentException,
│                                                                           .embed.InvalidStorageException)
└─.embed.XStorage
  │       .io.XStream  cloneEncryptedStreamElement( [in] string sStreamName,
  │                                                 [in] string sPassword
  │                                      ) raises ( .embed.StorageWrappedTargetException,
  │                                                 .io.IOException,
  │                                                 .packages.WrongPasswordException,
  │                                                 .packages.NoEncryptionException,
  │                                                 .lang.IllegalArgumentException,
  │                                                 .embed.InvalidStorageException)
  │       .io.XStream  cloneStreamElement( [in] string sStreamName
  │                             ) raises ( .embed.StorageWrappedTargetException,
  │                                        .io.IOException,
  │                                        .packages.WrongPasswordException,
  │                                        .lang.IllegalArgumentException,
  │                                        .embed.InvalidStorageException)
  │              void  copyElementTo( [in]          string sElementName,
  │                                   [in] .embed.XStorage xDest,
  │                                   [in]          string sNewName
  │                        ) raises ( .embed.StorageWrappedTargetException,
  │                                   .io.IOException,
  │                                   .container.ElementExistException,
  │                                   .container.NoSuchElementException,
  │                                   .lang.IllegalArgumentException,
  │                                   .embed.InvalidStorageException)
  │              void  copyLastCommitTo( [in] .embed.XStorage xTargetStorage
  │                           ) raises ( .embed.StorageWrappedTargetException,
  │                                      .io.IOException,
  │                                      .lang.IllegalArgumentException,
  │                                      .embed.InvalidStorageException)
  │              void  copyStorageElementLastCommitTo( [in]          string sStorName,
  │                                                    [in] .embed.XStorage xTargetStorage
  │                                         ) raises ( .embed.StorageWrappedTargetException,
  │                                                    .io.IOException,
  │                                                    .lang.IllegalArgumentException,
  │                                                    .embed.InvalidStorageException)
  │              void  copyToStorage( [in] .embed.XStorage xDest
  │                        ) raises ( .embed.StorageWrappedTargetException,
  │                                   .io.IOException,
  │                                   .lang.IllegalArgumentException,
  │                                   .embed.InvalidStorageException)
  │           boolean  isStorageElement( [in] string sElementName
  │                           ) raises ( .embed.InvalidStorageException,
  │                                      .lang.IllegalArgumentException,
  │                                      .container.NoSuchElementException)
  │           boolean  isStreamElement( [in] string sElementName
  │                          ) raises ( .embed.InvalidStorageException,
  │                                     .lang.IllegalArgumentException,
  │                                     .container.NoSuchElementException)
  │              void  moveElementTo( [in]          string sElementName,
  │                                   [in] .embed.XStorage xDest,
  │                                   [in]          string sNewName
  │                        ) raises ( .embed.StorageWrappedTargetException,
  │                                   .io.IOException,
  │                                   .container.ElementExistException,
  │                                   .container.NoSuchElementException,
  │                                   .lang.IllegalArgumentException,
  │                                   .embed.InvalidStorageException)
  │       .io.XStream  openEncryptedStreamElement( [in] string sStreamName,
  │                                                [in]   long nOpenMode,
  │                                                [in] string sPassword
  │                                     ) raises ( .embed.StorageWrappedTargetException,
  │                                                .io.IOException,
  │                                                .packages.WrongPasswordException,
  │                                                .packages.NoEncryptionException,
  │                                                .lang.IllegalArgumentException,
  │                                                .embed.InvalidStorageException)
  │   .embed.XStorage  openStorageElement( [in] string sStorName,
  │                                        [in]   long nOpenMode
  │                             ) raises ( .embed.StorageWrappedTargetException,
  │                                        .io.IOException,
  │                                        .lang.IllegalArgumentException,
  │                                        .embed.InvalidStorageException)
  │       .io.XStream  openStreamElement( [in] string sStreamName,
  │                                       [in]   long nOpenMode
  │                            ) raises ( .embed.StorageWrappedTargetException,
  │                                       .io.IOException,
  │                                       .packages.WrongPasswordException,
  │                                       .lang.IllegalArgumentException,
  │                                       .embed.InvalidStorageException)
  │              void  removeElement( [in] string sElementName
  │                        ) raises ( .embed.StorageWrappedTargetException,
  │                                   .io.IOException,
  │                                   .container.NoSuchElementException,
  │                                   .lang.IllegalArgumentException,
  │                                   .embed.InvalidStorageException)
  │              void  renameElement( [in] string sElementName,
  │                                   [in] string sNewName
  │                        ) raises ( .embed.StorageWrappedTargetException,
  │                                   .io.IOException,
  │                                   .container.ElementExistException,
  │                                   .container.NoSuchElementException,
  │                                   .lang.IllegalArgumentException,
  │                                   .embed.InvalidStorageException)
  ├─.container.XNameAccess
  │   │        any  getByName( [in] string aName
  │   │             ) raises ( .lang.WrappedTargetException,
  │   │                        .container.NoSuchElementException)
  │   │   [string]  getElementNames()
  │   │    boolean  hasByName( [in] string aName)
  │   └─.container.XElementAccess
  │           type  getElementType()
  │        boolean  hasElements()
  └─.lang.XComponent
        void  addEventListener( [in] .lang.XEventListener xListener)
        void  dispose()
        void  removeEventListener( [in] .lang.XEventListener aListener)

次の関連記事:LibreOffice5(104)Packageのサービスとインターフェイスの一覧

ブログ検索 by Blogger

Translate

最近のコメント

Created by Calendar Gadget

QooQ