openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1813122 - in /openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql: ./ sdbcx/ sdbcx/descriptors/
Date Tue, 24 Oct 2017 04:34:26 GMT
Author: damjan
Date: Tue Oct 24 04:34:26 2017
New Revision: 1813122

URL: http://svn.apache.org/viewvc?rev=1813122&view=rev
Log:
Implement views in the PostgreSQL driver.

Patch by: me


Added:
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlViews.java
  (with props)
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OView.java
  (with props)
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxViewDescriptor.java
  (with props)
Modified:
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
    openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OContainer.java

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java?rev=1813122&r1=1813121&r2=1813122&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
(original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlCatalog.java
Tue Oct 24 04:34:26 2017
@@ -71,7 +71,7 @@ public class PostgresqlCatalog extends O
                 String name = buildName(row);
                 names.add(name);
             }
-            return new PostgresqlTables(this, metadata, this, names);
+            return new PostgresqlViews(this, metadata, this, names);
         } catch (ElementExistException | SQLException exception) {
             throw new com.sun.star.uno.RuntimeException("Error", exception);
         } finally {
@@ -88,4 +88,8 @@ public class PostgresqlCatalog extends O
     public OContainer refreshUsers() {
         return null;
     }
+    
+    synchronized OContainer getTablesInternal() {
+        return tables;
+    }
 }

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java?rev=1813122&r1=1813121&r2=1813122&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
(original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlTables.java
Tue Oct 24 04:34:26 2017
@@ -26,6 +26,7 @@ import java.util.List;
 import com.sun.star.beans.UnknownPropertyException;
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.container.ElementExistException;
+import com.sun.star.container.NoSuchElementException;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.WrappedTargetException;
 import com.sun.star.sdbc.SQLException;
@@ -33,6 +34,7 @@ import com.sun.star.sdbc.XDatabaseMetaDa
 import com.sun.star.sdbc.XResultSet;
 import com.sun.star.sdbc.XRow;
 import com.sun.star.sdbc.XStatement;
+import com.sun.star.sdbcx.XDrop;
 import com.sun.star.sdbcx.comp.postgresql.comphelper.CompHelper;
 import com.sun.star.sdbcx.comp.postgresql.sdbcx.OContainer;
 import com.sun.star.sdbcx.comp.postgresql.sdbcx.descriptors.SdbcxTableDescriptor;
@@ -95,7 +97,15 @@ public class PostgresqlTables extends OC
             
             String composedName = DbTools.composeTableName(metadata, nameComponents.getCatalog(),
nameComponents.getSchema(), nameComponents.getTable(),
                     true, ComposeRule.InDataManipulation);
-            String sql = String.format("DROP %s %s", isView ? "VIEW" : "TABLE", composedName);
+            if (isView) {
+                XDrop dropView = UnoRuntime.queryInterface(XDrop.class, catalog.getViews());
+                String unquotedName = DbTools.composeTableName(metadata, nameComponents.getCatalog(),
nameComponents.getSchema(), nameComponents.getTable(),
+                        false, ComposeRule.InDataManipulation);
+                dropView.dropByName(unquotedName);
+                return;
+            }
+            
+            String sql = "DROP TABLE " + composedName;
             
             XStatement statement = null;
             try {
@@ -104,8 +114,7 @@ public class PostgresqlTables extends OC
             } finally {
                 CompHelper.disposeComponent(statement);
             }
-            // FIXME: delete it from our views
-        } catch (IllegalArgumentException | UnknownPropertyException | WrappedTargetException
wrappedTargetException) {
+        } catch (IllegalArgumentException | UnknownPropertyException | WrappedTargetException
| NoSuchElementException wrappedTargetException) {
             throw new SQLException("Error", this, StandardSQLState.SQL_GENERAL_ERROR.text(),
0, wrappedTargetException);
         }
     }

Added: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlViews.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlViews.java?rev=1813122&view=auto
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlViews.java
(added)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlViews.java
Tue Oct 24 04:34:26 2017
@@ -0,0 +1,163 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+package com.sun.star.sdbcx.comp.postgresql;
+
+import java.util.List;
+
+import com.sun.star.beans.UnknownPropertyException;
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.ElementExistException;
+import com.sun.star.lang.WrappedTargetException;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XDatabaseMetaData;
+import com.sun.star.sdbc.XParameters;
+import com.sun.star.sdbc.XPreparedStatement;
+import com.sun.star.sdbc.XResultSet;
+import com.sun.star.sdbc.XRow;
+import com.sun.star.sdbc.XStatement;
+import com.sun.star.sdbcx.CheckOption;
+import com.sun.star.sdbcx.comp.postgresql.comphelper.CompHelper;
+import com.sun.star.sdbcx.comp.postgresql.sdbcx.OContainer;
+import com.sun.star.sdbcx.comp.postgresql.sdbcx.OView;
+import com.sun.star.sdbcx.comp.postgresql.sdbcx.descriptors.SdbcxViewDescriptor;
+import com.sun.star.sdbcx.comp.postgresql.util.ComposeRule;
+import com.sun.star.sdbcx.comp.postgresql.util.DbTools;
+import com.sun.star.sdbcx.comp.postgresql.util.DbTools.NameComponents;
+import com.sun.star.sdbcx.comp.postgresql.util.Osl;
+import com.sun.star.sdbcx.comp.postgresql.util.PropertyIds;
+import com.sun.star.sdbcx.comp.postgresql.util.StandardSQLState;
+import com.sun.star.uno.UnoRuntime;
+
+public class PostgresqlViews extends OContainer {
+    private PostgresqlCatalog catalog;
+    private XDatabaseMetaData metadata;
+    
+    public PostgresqlViews(Object lock, XDatabaseMetaData metadata, PostgresqlCatalog catalog,
List<String> names) throws ElementExistException {
+        super(lock, true, names);
+        this.metadata = metadata;
+        this.catalog = catalog;
+    }
+    
+    @Override
+    protected XPropertySet createObject(String name) throws SQLException {
+        NameComponents nameComponents = DbTools.qualifiedNameComponents(metadata, name, ComposeRule.InDataManipulation);
+        
+        String sql = "SELECT view_definition,check_option FROM INFORMATION_SCHEMA.views WHERE
";
+        if (!nameComponents.getCatalog().isEmpty()) {
+            sql += "table_catalog=? AND ";
+        }
+        if (!nameComponents.getSchema().isEmpty()) {
+            sql += "table_schema=? AND ";
+        }
+        sql += "table_name=?";
+        
+        final String command;
+        final String checkOption;
+        XPreparedStatement statement = null;
+        XResultSet results = null;
+        try {
+            statement = metadata.getConnection().prepareStatement(sql);
+            XParameters parameters = UnoRuntime.queryInterface(XParameters.class, statement);
+            int next = 1;
+            if (!nameComponents.getCatalog().isEmpty()) {
+                parameters.setString(next++, nameComponents.getCatalog());
+            }
+            if (!nameComponents.getSchema().isEmpty()) {
+                parameters.setString(next++, nameComponents.getSchema());
+            }
+            parameters.setString(next, nameComponents.getTable());
+            results = statement.executeQuery();
+            if (results.next()) {
+                XRow row = UnoRuntime.queryInterface(XRow.class, results);
+                command = row.getString(1);
+                checkOption = row.getString(2);
+            } else {
+                throw new SQLException("View not found", this, StandardSQLState.SQL_TABLE_OR_VIEW_NOT_FOUND.text(),
0, null);
+            }
+        } finally {
+            CompHelper.disposeComponent(results);
+            CompHelper.disposeComponent(statement);
+        }
+        
+        final int checkOptionInt;
+        if (checkOption.equals("NONE")) {
+            checkOptionInt = CheckOption.NONE;
+        } else if (checkOption.equals("LOCAL")) {
+            checkOptionInt = CheckOption.LOCAL;
+        } else if (checkOption.equals("CASCADED")) {
+            checkOptionInt = CheckOption.CASCADE;
+        } else {
+            throw new SQLException("Unsupported check option '" + checkOption + "'", this,
+                    StandardSQLState.SQL_FEATURE_NOT_IMPLEMENTED.text(), 0, null);
+        }
+        
+        return new OView(nameComponents.getCatalog(), nameComponents.getSchema(), nameComponents.getTable(),
isCaseSensitive(),
+                command, checkOptionInt);
+    }
+    
+    @Override
+    protected void dropObject(int index, String name) throws SQLException {
+        XStatement statement = null;
+        try {
+            Object object = getObject(index);
+            XPropertySet propertySet = UnoRuntime.queryInterface(XPropertySet.class, object);
+            Osl.ensure(propertySet != null, "Object returned from view collection isn't an
XPropertySet");
+            String sql = String.format("DROP VIEW %s", DbTools.composeTableName(metadata,
propertySet, ComposeRule.InTableDefinitions,
+                    false, false, true));
+            
+            statement = metadata.getConnection().createStatement();
+            statement.execute(sql);
+        } catch (WrappedTargetException exception) {
+            throw new SQLException("Error", this, StandardSQLState.SQL_GENERAL_ERROR.text(),
0, exception);
+        } finally {
+            CompHelper.disposeComponent(statement);
+        }
+    }
+
+    @Override
+    protected XPropertySet createDescriptor() {
+        return new SdbcxViewDescriptor(isCaseSensitive());
+    }
+    
+    @Override
+    protected XPropertySet appendObject(String _rForName, XPropertySet descriptor) throws
SQLException {
+        XStatement statement = null;
+        try {
+            String sql = String.format("CREATE VIEW %s AS %s",
+                    DbTools.composeTableName(metadata, descriptor, ComposeRule.InTableDefinitions,
false, false, true),
+                    descriptor.getPropertyValue(PropertyIds.COMMAND.name));
+            statement = metadata.getConnection().createStatement();
+            statement.execute(sql);
+        } catch (WrappedTargetException | UnknownPropertyException exception) {
+            throw new SQLException("Error", this, StandardSQLState.SQL_GENERAL_ERROR.text(),
0, exception);
+        } finally {
+            CompHelper.disposeComponent(statement);
+        }
+        // Append it to the tables container too:
+        catalog.getTablesInternal().insertElement(_rForName, null);
+        return createObject(_rForName);
+    }
+    
+    @Override
+    protected void impl_refresh() {
+        catalog.refreshObjects();
+    }
+}

Propchange: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlViews.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OContainer.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OContainer.java?rev=1813122&r1=1813121&r2=1813122&view=diff
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OContainer.java
(original)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OContainer.java
Tue Oct 24 04:34:26 2017
@@ -280,6 +280,15 @@ public abstract class OContainer extends
         
     }
     
+    public void insertElement(String name, XPropertySet element) {
+        synchronized (lock) {
+            if (!entriesByName.containsKey(name)) {
+                entriesByName.put(name, element);
+                namesByIndex.add(name);
+            }
+        }
+    }
+    
     // XDrop
     
     @Override

Added: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OView.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OView.java?rev=1813122&view=auto
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OView.java
(added)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OView.java
Tue Oct 24 04:34:26 2017
@@ -0,0 +1,131 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+package com.sun.star.sdbcx.comp.postgresql.sdbcx;
+
+import com.sun.star.beans.PropertyAttribute;
+import com.sun.star.container.XNamed;
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.sdbcx.comp.postgresql.comphelper.PropertySetAdapter.PropertyGetter;
+import com.sun.star.sdbcx.comp.postgresql.comphelper.PropertySetAdapter.PropertySetter;
+import com.sun.star.sdbcx.comp.postgresql.util.PropertyIds;
+import com.sun.star.uno.Type;
+
+public class OView extends ODescriptor
+        implements XNamed, XServiceInfo {
+    
+    private static String[] services = {
+            "com.sun.star.sdbcx.View"
+    };
+
+    protected String catalogName;
+    protected String schemaName;
+    protected String command;
+    protected int checkOption;
+
+    public OView(String catalog, String schema, String name, boolean isCaseSensitive, String
command, int checkOption) {
+        super(name, isCaseSensitive, true);
+        this.catalogName = catalog;
+        this.schemaName = schema;
+        this.command = command;
+        this.checkOption = checkOption;
+        registerProperties();
+    }
+    
+    private void registerProperties() {
+        registerProperty(PropertyIds.CATALOGNAME.name, PropertyIds.CATALOGNAME.id, Type.STRING,
PropertyAttribute.READONLY,
+                new PropertyGetter() {
+                    @Override
+                    public Object getValue() {
+                        return catalogName;
+                        
+                    }
+                },
+                new PropertySetter() {
+                    @Override
+                    public void setValue(Object value) {
+                        catalogName = (String) value;
+                    }
+                });
+        registerProperty(PropertyIds.SCHEMANAME.name, PropertyIds.SCHEMANAME.id, Type.STRING,
PropertyAttribute.READONLY,
+                new PropertyGetter() {
+                    @Override
+                    public Object getValue() {
+                        return schemaName;
+                        
+                    }
+                },
+                new PropertySetter() {
+                    @Override
+                    public void setValue(Object value) {
+                        schemaName = (String) value;
+                    }
+                });
+        registerProperty(PropertyIds.COMMAND.name, PropertyIds.COMMAND.id, Type.STRING, PropertyAttribute.READONLY,
+                new PropertyGetter() {
+                    @Override
+                    public Object getValue() {
+                        return command;
+                        
+                    }
+                },
+                new PropertySetter() {
+                    @Override
+                    public void setValue(Object value) {
+                        command = (String) value;
+                    }
+                });
+        registerProperty(PropertyIds.CHECKOPTION.name, PropertyIds.CHECKOPTION.id, Type.LONG,
PropertyAttribute.READONLY,
+                new PropertyGetter() {
+                    @Override
+                    public Object getValue() {
+                        return checkOption;
+                        
+                    }
+                },
+                new PropertySetter() {
+                    @Override
+                    public void setValue(Object value) {
+                        checkOption = (int) value;
+                    }
+                });
+    }
+    
+    // XServiceInfo
+    
+    public String getImplementationName() {
+        return getClass().getName();
+    }
+    
+    @Override
+    public String[] getSupportedServiceNames() {
+        return services.clone();
+    }
+    
+    @Override
+    public boolean supportsService(String serviceName) {
+        for (String service : getSupportedServiceNames()) {
+            if (service.equals(serviceName)) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

Propchange: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/OView.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxViewDescriptor.java
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxViewDescriptor.java?rev=1813122&view=auto
==============================================================================
--- openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxViewDescriptor.java
(added)
+++ openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxViewDescriptor.java
Tue Oct 24 04:34:26 2017
@@ -0,0 +1,125 @@
+/**************************************************************
+ * 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ *************************************************************/
+package com.sun.star.sdbcx.comp.postgresql.sdbcx.descriptors;
+
+import com.sun.star.lang.XServiceInfo;
+import com.sun.star.sdbcx.comp.postgresql.comphelper.PropertySetAdapter.PropertyGetter;
+import com.sun.star.sdbcx.comp.postgresql.comphelper.PropertySetAdapter.PropertySetter;
+import com.sun.star.sdbcx.comp.postgresql.sdbcx.ODescriptor;
+import com.sun.star.sdbcx.comp.postgresql.util.PropertyIds;
+import com.sun.star.uno.Type;
+
+public class SdbcxViewDescriptor extends ODescriptor implements XServiceInfo {
+    
+    private static final String[] services = {
+            "com.sun.star.sdbcx.ViewDescriptor"
+    };
+
+    protected String catalogName;
+    protected String schemaName;
+    protected String command;
+    protected int checkOption;
+
+    public SdbcxViewDescriptor(boolean isCaseSensitive) {
+        super("", isCaseSensitive, false);
+        registerProperties();
+    }
+    
+    private void registerProperties() {
+        registerProperty(PropertyIds.CATALOGNAME.name, PropertyIds.CATALOGNAME.id, Type.STRING,
(short)0,
+                new PropertyGetter() {
+                    @Override
+                    public Object getValue() {
+                        return catalogName;
+                        
+                    }
+                },
+                new PropertySetter() {
+                    @Override
+                    public void setValue(Object value) {
+                        catalogName = (String) value;
+                    }
+                });
+        registerProperty(PropertyIds.SCHEMANAME.name, PropertyIds.SCHEMANAME.id, Type.STRING,
(short)0,
+                new PropertyGetter() {
+                    @Override
+                    public Object getValue() {
+                        return schemaName;
+                        
+                    }
+                },
+                new PropertySetter() {
+                    @Override
+                    public void setValue(Object value) {
+                        schemaName = (String) value;
+                    }
+                });
+        registerProperty(PropertyIds.COMMAND.name, PropertyIds.COMMAND.id, Type.STRING, (short)0,
+                new PropertyGetter() {
+                    @Override
+                    public Object getValue() {
+                        return command;
+                        
+                    }
+                },
+                new PropertySetter() {
+                    @Override
+                    public void setValue(Object value) {
+                        command = (String) value;
+                    }
+                });
+        registerProperty(PropertyIds.CHECKOPTION.name, PropertyIds.CHECKOPTION.id, Type.LONG,
(short)0,
+                new PropertyGetter() {
+                    @Override
+                    public Object getValue() {
+                        return checkOption;
+                        
+                    }
+                },
+                new PropertySetter() {
+                    @Override
+                    public void setValue(Object value) {
+                        checkOption = (int) value;
+                    }
+                });
+    }
+    
+    // XServiceInfo
+    
+    public String getImplementationName() {
+        return getClass().getName();
+    }
+    
+    @Override
+    public String[] getSupportedServiceNames() {
+        return services.clone();
+    }
+    
+    @Override
+    public boolean supportsService(String serviceName) {
+        for (String service : getSupportedServiceNames()) {
+            if (service.equals(serviceName)) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

Propchange: openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/sdbcx/descriptors/SdbcxViewDescriptor.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message