Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: embed ::

interface XEmbedPersist
Base Interfaces
XEmbedPersistXCommonEmbedPersist

XCommonEmbedPersist
(referenced interface's summary:)
specifies common implementation for embedded objects and links persistence.
Description
specifies an implementation for embedded object persistence.

The idea is that any usable embedded object should be initialized with an entry in the parent storage that will be used as persistent representation.


Methods' Summary
setPersistentEntry provides object with a parent storage and a name for object's entry.  
storeToEntry lets the object store itself to an entry in destination storage, the own persistence entry is not changed.  
storeAsEntry lets the object store itself to an entry in destination storage and prepare to use the new entry for own persistence.  
saveCompleted specifies whether the object should use an old storage or a new one after "save as" operation.  
hasEntry allows to detect if the object has entry.  
getEntryName allows to retrieve the current object entry name.  
Methods' Details
setPersistentEntry
void
setPersistentEntry( [in] XStorage  xStorage,
[in] string  sEntName,
[in] long  nEntryConnectionMode,
[in] sequence< ::com::sun::star::beans::PropertyValue >  aMediaArgs,
[in] sequence< ::com::sun::star::beans::PropertyValue >  aObjectArgs )
raises( ::com::sun::star::lang::IllegalArgumentException,
WrongStateException,
::com::sun::star::io::IOException,
::com::sun::star::uno::Exception );

Description
provides object with a parent storage and a name for object's entry.

An entry with the specified name should be created/opened inside provided storage. It can be a storage or a stream. For example, OOo API will refer to ole storages only by streams, but the object implementation will use storage based on this stream.

Factory does this call to initialize the embedded object. The linked object can be initialized by factory in different way ( internally ).

It is also possible to switch object persistent representation through this call. Actually this is the way, this call can be used by user ( since initialization is done by factory ).

Parameter xStorage
a parent storage the entry should be created in
Parameter sEntName
a name for the entry
Parameter nEntryConnectionMode
a mode in which the object should be initialized from entry can take values from EntryInitModes constant set
Parameter aMediaArgs
optional parameters for the embedded document persistence initialization, see also ::com::sun::star::document::MediaDescriptor
Parameter aObjectArgs
optional parameters for the object persistence initialization, see also EmbeddedObjectDescriptor @thrown ::com::sun::star::lang::IllegalArgumentException one of arguments is illegal
Throws
com::sun::star::embed::WrongStateException the object is in wrong state
Throws
com::sun::star::io::IOException in case of io problems during opening\creation
Throws
com::sun::star::uno::Exception in case of other problems
storeToEntry
void
storeToEntry( [in] XStorage  xStorage,
[in] string  sEntName,
[in] sequence< ::com::sun::star::beans::PropertyValue >  aMediaArgs,
[in] sequence< ::com::sun::star::beans::PropertyValue >  aObjectArgs )
raises( ::com::sun::star::lang::IllegalArgumentException,
WrongStateException,
::com::sun::star::io::IOException,
::com::sun::star::uno::Exception );

Description
lets the object store itself to an entry in destination storage, the own persistence entry is not changed.
Parameter xStorage
a parent storage the entry should be created inside
Parameter sEntName
a name for the entry
Parameter aMediaArgs
optional parameters for document saving, see also ::com::sun::star::document::MediaDescriptor
Parameter aObjectArgs
optional parameters for the object saving, see also EmbeddedObjectDescriptor @thrown ::com::sun::star::lang::IllegalArgumentException one of arguments is illegal
Throws
com::sun::star::embed::WrongStateException the object is in wrong state
Throws
com::sun::star::io::IOException in case of io problems during storing
Throws
com::sun::star::uno::Exception in case of other problems
storeAsEntry
void
storeAsEntry( [in] XStorage  xStorage,
[in] string  sEntName,
[in] sequence< ::com::sun::star::beans::PropertyValue >  aMediaArgs,
[in] sequence< ::com::sun::star::beans::PropertyValue >  aObjectArgs )
raises( ::com::sun::star::lang::IllegalArgumentException,
WrongStateException,
::com::sun::star::io::IOException,
::com::sun::star::uno::Exception );

Description
lets the object store itself to an entry in destination storage and prepare to use the new entry for own persistence.

The object should be stored to the new entry, after that the entry should be remembered by the object. After the storing process is finished the XEmbedPersist::saveCompleted method can be used to specify whether the object should use the new entry or the old one. The object persistence can not be used until XEmbedPersist::saveCompleted is called. So this state can be treated as "HandsOff" state.

Parameter xStorage
a parent storage the entry should be created in
Parameter sEntName
a name for the entry
Parameter aMediaArgs
optional parameters for document saving, see also ::com::sun::star::document::MediaDescriptor
Parameter aObjectArgs
optional parameters for the object saving, see also EmbeddedObjectDescriptor @thrown ::com::sun::star::lang::IllegalArgumentException one of arguments is illegal
Throws
com::sun::star::embed::WrongStateException the object is in wrong state
Throws
com::sun::star::io::IOException in case of io problems during storing
Throws
com::sun::star::uno::Exception in case of other problems
saveCompleted
void
saveCompleted( [in] boolean  bUseNew )
raises( WrongStateException,
::com::sun::star::uno::Exception );

Description
specifies whether the object should use an old storage or a new one after "save as" operation.
Parameter bUseNew
true the new storage should be used false the old one
Throws
com::sun::star::embed::WrongStateException the object is in wrong state
Throws
com::sun::star::uno::Exception in case of other problems
hasEntry
boolean
hasEntry()
raises( WrongStateException );

Description
allows to detect if the object has entry.
Returns
true if the object has own entry set false otherwise
getEntryName
string
getEntryName()
raises( WrongStateException );

Description
allows to retrieve the current object entry name.
Returns
the object entry name if any
Throws
com::sun::star::embed::WrongStateException the object is in wrong state ( has no entry )
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.