Difference between revisions of "Documentation/DevGuide/Database/Extending Database Drivers"
(3 intermediate revisions by 2 users not shown) | |||
Line 2: | Line 2: | ||
|Database2f=block | |Database2f=block | ||
|ShowPrevNext=block | |ShowPrevNext=block | ||
− | |PrevPage=Documentation/DevGuide/Database/ | + | |PrevPage=Documentation/DevGuide/Database/Handling Unsupported Functionality |
− | |NextPage=Documentation/DevGuide/ | + | |NextPage=Documentation/DevGuide/Forms/Forms |
}} | }} | ||
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Database/{{SUBPAGENAME}}}} | {{Documentation/DevGuideLanguages|Documentation/DevGuide/Database/{{SUBPAGENAME}}}} | ||
{{DISPLAYTITLE:Extending Database Drivers}} | {{DISPLAYTITLE:Extending Database Drivers}} | ||
In the following section, extending existing SDBC drivers by [[Documentation/DevGuide/Extensions/Extensions | extensions]] is described. | In the following section, extending existing SDBC drivers by [[Documentation/DevGuide/Extensions/Extensions | extensions]] is described. | ||
− | These section is valid from since: | + | These section is valid from since: OpenOffice.org 3.3 |
− | Most drivers miss to support special features like to alter view definitions or to add or drop key of a table. | + | Most drivers miss to support special features like to alter view definitions or to add or drop key of a table. Therefore these interfaces |
− | * <idl>com.sun.star.sdb.tools. | + | * <idl>com.sun.star.sdb.tools.XViewAccess</idl> |
* <idl>com.sun.star.sdb.tools.XTableRename</idl> | * <idl>com.sun.star.sdb.tools.XTableRename</idl> | ||
* <idl>com.sun.star.sdb.tools.XTableAlteration</idl> | * <idl>com.sun.star.sdb.tools.XTableAlteration</idl> | ||
Line 24: | Line 24: | ||
|Interface name which has to to be implemented | |Interface name which has to to be implemented | ||
|- | |- | ||
− | | | + | | ViewAccessServiceName |
− | | <idl>com.sun.star.sdb.tools. | + | | <idl>com.sun.star.sdb.tools.XViewAccess</idl> |
|- | |- | ||
| TableAlterationServiceName | | TableAlterationServiceName | ||
Line 40: | Line 40: | ||
|} | |} | ||
− | In favor to allow to get the definition of queries, forms and reports from other locations as the default file format specification, an extension may | + | In favor to allow to get the definition of queries, forms and reports from other locations as the default file format specification, an extension may implement the <idl>com.sun.star.sdb.DocumentContainer</idl> service. The configuration entries are named |
− | + | * Forms | |
− | + | * Reports | |
− | + | additionally to the interfaces defined in the service <idl>com.sun.star.sdb.DocumentContainer</idl> the interface <idl>com.sun.star.lang.XInitialization</idl> has to be implemented which will be called with a argument called "DatabaseDocument" containing the database document. | |
− | + | ||
− | + | To allow to support command definitions from other locations, an extension may implement the <idl>com.sun.star.sdb.DefinitionContainer</idl> service. The configuration entry is named | |
− | * | + | * CommandDefinitions |
− | * <idl>com.sun.star. | + | A difference is that the interface <idl>com.sun.star.lang.XInitialization</idl> will be called with a "DataSource" argument. |
− | + | ||
− | + | ||
− | * | + | |
− | + | ||
The configuration fragment below shows how to define which service should be created to extend the view support and to extend the table alteration support. | The configuration fragment below shows how to define which service should be created to extend the view support and to extend the table alteration support. | ||
− | < | + | <syntaxhighlight lang="xml"> |
<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema"> | <oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema"> | ||
<node oor:name="Installed"> | <node oor:name="Installed"> | ||
Line 65: | Line 61: | ||
</prop> | </prop> | ||
<node oor:name="Properties"> | <node oor:name="Properties"> | ||
− | <node oor:name=" | + | <node oor:name="ViewAccessServiceName" oor:op="replace"> |
<prop oor:name="Value" oor:type="xs:string"> | <prop oor:name="Value" oor:type="xs:string"> | ||
− | <value>com.sun.star.sdb.comp.SQL2008. | + | <value>com.sun.star.sdb.comp.SQL2008.ViewAccess</value> |
</prop> | </prop> | ||
</node> | </node> | ||
Line 79: | Line 75: | ||
</node> | </node> | ||
</oor:component-data> | </oor:component-data> | ||
− | </ | + | </syntaxhighlight> |
{{PDL1}} | {{PDL1}} | ||
[[Category:Documentation/Developer's Guide/Database Access]] | [[Category:Documentation/Developer's Guide/Database Access]] |
Latest revision as of 15:27, 21 December 2020
In the following section, extending existing SDBC drivers by extensions is described.
These section is valid from since: OpenOffice.org 3.3
Most drivers miss to support special features like to alter view definitions or to add or drop key of a table. Therefore these interfaces
- com.sun.star.sdb.tools.XViewAccess
- com.sun.star.sdb.tools.XTableRename
- com.sun.star.sdb.tools.XTableAlteration
- com.sun.star.sdb.tools.XKeyAlteration
- com.sun.star.sdb.tools.XIndexAlteration
can be implemented by an extension.
To enable the needed feature the extension has to extend the properties entry of the configuration of the driver. The configuration entry below the properties entry will be checked and if the service name can be instantiated it will be used to do the job. Below you'll see a table of mapping from configuration entry to service name.
Configuration name | Interface name which has to to be implemented |
ViewAccessServiceName | com.sun.star.sdb.tools.XViewAccess |
TableAlterationServiceName | com.sun.star.sdb.tools.XTableAlteration |
TableRenameServiceName | com.sun.star.sdb.tools.XTableRename |
IndexAlterationServiceName | com.sun.star.sdb.tools.XIndexAlteration |
KeyAlterationServiceName | com.sun.star.sdb.tools.XKeyAlteration |
In favor to allow to get the definition of queries, forms and reports from other locations as the default file format specification, an extension may implement the com.sun.star.sdb.DocumentContainer service. The configuration entries are named
- Forms
- Reports
additionally to the interfaces defined in the service com.sun.star.sdb.DocumentContainer the interface com.sun.star.lang.XInitialization has to be implemented which will be called with a argument called "DatabaseDocument" containing the database document.
To allow to support command definitions from other locations, an extension may implement the com.sun.star.sdb.DefinitionContainer service. The configuration entry is named
- CommandDefinitions
A difference is that the interface com.sun.star.lang.XInitialization will be called with a "DataSource" argument.
The configuration fragment below shows how to define which service should be created to extend the view support and to extend the table alteration support.
<oor:component-data oor:name="Drivers" oor:package="org.openoffice.Office.DataAccess" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <node oor:name="Installed"> <node oor:name="jdbc:" oor:op="replace"> <prop oor:name="ParentURLPattern"> <value>jdbc:*</value> </prop> <prop oor:name="DriverTypeDisplayName" oor:type="xs:string"> <value xml:lang="en-US">SQL 2008 JDBC</value> </prop> <node oor:name="Properties"> <node oor:name="ViewAccessServiceName" oor:op="replace"> <prop oor:name="Value" oor:type="xs:string"> <value>com.sun.star.sdb.comp.SQL2008.ViewAccess</value> </prop> </node> <node oor:name="TableAlterationServiceName" oor:op="replace"> <prop oor:name="Value" oor:type="xs:string"> <value>com.sun.star.sdb.comp.SQL2008.TableAlterService</value> </prop> </node> </node> </node> </node> </oor:component-data>
Content on this page is licensed under the Public Documentation License (PDL). |