diff options
author | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-03-11 12:09:11 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@oracle.com> | 2011-03-11 12:09:11 +0100 |
commit | d9caca9dd735394857a0b15ddf3c6fc86e243bdd (patch) | |
tree | 5a8eeafb6524e57d984d65de1aeb299c1b9c6323 /wizards/com/sun/star/wizards/db | |
parent | d09682885106abdd7173656b9aeb8a945caafb06 (diff) | |
parent | 6131743ed1bb1af2e3a694efa1ca2b3e5a52d490 (diff) |
Automated merge with file:///cws/so-cwsserv03/dba34c/DEV300/ooo
Diffstat (limited to 'wizards/com/sun/star/wizards/db')
10 files changed, 76 insertions, 70 deletions
diff --git a/wizards/com/sun/star/wizards/db/BlindtextCreator.java b/wizards/com/sun/star/wizards/db/BlindtextCreator.java index b52381def054..308eca03e121 100644 --- a/wizards/com/sun/star/wizards/db/BlindtextCreator.java +++ b/wizards/com/sun/star/wizards/db/BlindtextCreator.java @@ -27,6 +27,7 @@ package com.sun.star.wizards.db; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; /** * @@ -40,7 +41,7 @@ public class BlindtextCreator public static String adjustBlindTextlength(String FieldTitle, int FieldWidth, boolean bIsCurLandscape, boolean bIsGroupTable, String[] _RecordFieldNames) { - String BlindTextString = ""; + String BlindTextString = PropertyNames.EMPTY_STRING; if (bIsGroupTable) { return getBlindTextString(FieldTitle, FieldWidth, FieldWidth); @@ -66,7 +67,7 @@ public class BlindtextCreator public static String getBlindTextString(String FieldTitle, int FieldWidth, int MaxWidth) { - String[] BlindTextArray = JavaTools.ArrayoutofString(BlindText, " "); + String[] BlindTextArray = JavaTools.ArrayoutofString(BlindText, PropertyNames.SPACE); String PartBlindText = BlindTextArray[0]; String NewPartBlindText; int MaxHeaderWidth; @@ -88,7 +89,7 @@ public class BlindtextCreator int i = 1; do { - NewPartBlindText = PartBlindText + " " + BlindTextArray[i]; + NewPartBlindText = PartBlindText + PropertyNames.SPACE + BlindTextArray[i]; if (NewPartBlindText.length() < MaxWidth) { PartBlindText = NewPartBlindText; diff --git a/wizards/com/sun/star/wizards/db/ColumnPropertySet.java b/wizards/com/sun/star/wizards/db/ColumnPropertySet.java index db5ceb257118..18e85fea868e 100644 --- a/wizards/com/sun/star/wizards/db/ColumnPropertySet.java +++ b/wizards/com/sun/star/wizards/db/ColumnPropertySet.java @@ -40,7 +40,7 @@ public class ColumnPropertySet TypeInspector oTypeInspector; public XPropertySet xPropertySet; private int nType; - private String sTypeName = ""; + private String sTypeName = PropertyNames.EMPTY_STRING; public ColumnPropertySet(TypeInspector _oTypeInspector, XPropertySet _xPropertySet) { @@ -149,7 +149,7 @@ public class ColumnPropertySet private void setType(int _nType, String _sTypeName, Integer precision) { - if (_sTypeName.equals("")) + if (_sTypeName.equals(PropertyNames.EMPTY_STRING)) { sTypeName = oTypeInspector.getDefaultTypeName(nType, precision); } @@ -174,7 +174,7 @@ public class ColumnPropertySet else if (_spropname.equals(PropertyNames.PROPERTY_NAME)) { String sName = (String) _oValue; - if (!sName.equals("")) + if (!sName.equals(PropertyNames.EMPTY_STRING)) { xPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, sName); } diff --git a/wizards/com/sun/star/wizards/db/CommandMetaData.java b/wizards/com/sun/star/wizards/db/CommandMetaData.java index 1819d3485994..af4972c52e86 100644 --- a/wizards/com/sun/star/wizards/db/CommandMetaData.java +++ b/wizards/com/sun/star/wizards/db/CommandMetaData.java @@ -41,6 +41,7 @@ import com.sun.star.container.XNameAccess; import com.sun.star.wizards.common.Helper; import com.sun.star.wizards.common.JavaTools; import com.sun.star.wizards.common.NumberFormatter; +import com.sun.star.wizards.common.PropertyNames; import com.sun.star.wizards.common.Resource; import java.util.ArrayList; import java.util.HashMap; @@ -75,8 +76,8 @@ public class CommandMetaData extends DBMetaData private int CommandType; private String Command; boolean bCatalogAtStart = true; - String sCatalogSep = ""; - String sIdentifierQuote = ""; + String sCatalogSep = PropertyNames.EMPTY_STRING; + String sIdentifierQuote = PropertyNames.EMPTY_STRING; boolean bCommandComposerAttributesalreadyRetrieved = false; private XIndexAccess xIndexKeys; @@ -178,7 +179,7 @@ public class CommandMetaData extends DBMetaData } else { - sSortFieldName[1] = "ASC"; + sSortFieldName[1] = PropertyNames.ASC; } aSortFields.add(sSortFieldName); } diff --git a/wizards/com/sun/star/wizards/db/CommandName.java b/wizards/com/sun/star/wizards/db/CommandName.java index 3c6686868ff3..64e3f5cbeae5 100644 --- a/wizards/com/sun/star/wizards/db/CommandName.java +++ b/wizards/com/sun/star/wizards/db/CommandName.java @@ -29,17 +29,18 @@ package com.sun.star.wizards.db; import com.sun.star.sdbc.SQLException; import com.sun.star.uno.Exception; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; public class CommandName { protected CommandMetaData oCommandMetaData; - protected String CatalogName = ""; - protected String SchemaName = ""; - protected String TableName = ""; - protected String DisplayName = ""; - protected String ComposedName = ""; - protected String AliasName = ""; + protected String CatalogName = PropertyNames.EMPTY_STRING; + protected String SchemaName = PropertyNames.EMPTY_STRING; + protected String TableName = PropertyNames.EMPTY_STRING; + protected String DisplayName = PropertyNames.EMPTY_STRING; + protected String ComposedName = PropertyNames.EMPTY_STRING; + protected String AliasName = PropertyNames.EMPTY_STRING; protected boolean bCatalogAtStart; protected String sCatalogSep; protected String sIdentifierQuote; @@ -59,21 +60,21 @@ public class CommandName oCommandMetaData = _CommandMetaData; if ((_CatalogName != null) && (oCommandMetaData.xDBMetaData.supportsCatalogsInTableDefinitions())) { - if (!_CatalogName.equals("")) + if (!_CatalogName.equals(PropertyNames.EMPTY_STRING)) { CatalogName = _CatalogName; } } if ((_SchemaName != null) && (oCommandMetaData.xDBMetaData.supportsSchemasInTableDefinitions())) { - if (!_SchemaName.equals("")) + if (!_SchemaName.equals(PropertyNames.EMPTY_STRING)) { SchemaName = _SchemaName; } } if (_TableName != null) { - if (!_TableName.equals("")) + if (!_TableName.equals(PropertyNames.EMPTY_STRING)) { TableName = _TableName; } @@ -117,7 +118,7 @@ public class CommandName NameList = new String[0]; NameList = JavaTools.ArrayoutofString(_DisplayName, "."); SchemaName = NameList[0]; - TableName = NameList[1]; // TODO Was ist mit diesem Fall: CatalogSep = "." und CatalogName = "" + TableName = NameList[1]; // TODO Was ist mit diesem Fall: CatalogSep = "." und CatalogName = PropertyNames.EMPTY_STRING } else { @@ -138,7 +139,7 @@ public class CommandName { if (CatalogName != null) { - if (!CatalogName.equals("")) + if (!CatalogName.equals(PropertyNames.EMPTY_STRING)) { if (bCatalogAtStart == true) { @@ -148,12 +149,12 @@ public class CommandName } if (SchemaName != null) { - if (!SchemaName.equals("")) + if (!SchemaName.equals(PropertyNames.EMPTY_STRING)) { ComposedName += quoteName(SchemaName) + "."; } } - if (ComposedName.equals("")) + if (ComposedName.equals(PropertyNames.EMPTY_STRING)) { ComposedName = quoteName(TableName); } @@ -163,7 +164,7 @@ public class CommandName } if ((bCatalogAtStart == false) && (CatalogName != null)) { - if (!CatalogName.equals("")) + if (!CatalogName.equals(PropertyNames.EMPTY_STRING)) { ComposedName += sCatalogSep + quoteName(CatalogName); } @@ -203,7 +204,7 @@ public class CommandName { if (sName == null) { - sName = ""; + sName = PropertyNames.EMPTY_STRING; } return new StringBuilder(_sIdentifierQuote).append(sName).append(_sIdentifierQuote).toString(); } diff --git a/wizards/com/sun/star/wizards/db/DBMetaData.java b/wizards/com/sun/star/wizards/db/DBMetaData.java index 5a151937d73f..54a68cad17b4 100644 --- a/wizards/com/sun/star/wizards/db/DBMetaData.java +++ b/wizards/com/sun/star/wizards/db/DBMetaData.java @@ -187,7 +187,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } return oNumberFormatter; @@ -215,9 +215,9 @@ public class DBMetaData xNameAccess = UnoRuntime.queryInterface( XNameAccess.class, xDatabaseContext ); DataSourceNames = xNameAccess.getElementNames(); } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } @@ -326,9 +326,9 @@ public class DBMetaData // TODO: Performance leak getColumns() take very long. xColumns = UnoRuntime.queryInterface( XNameAccess.class, xCommandCols.getColumns() ); } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } public XNameAccess getColumns() @@ -357,7 +357,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return bHasEscapeProcessing; } @@ -453,7 +453,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return - 1; } } @@ -507,7 +507,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } @@ -530,7 +530,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return isSQL92CheckEnabled; } @@ -579,9 +579,9 @@ public class DBMetaData xModel = xDocu.getDatabaseDocument(); } } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } @@ -596,9 +596,9 @@ public class DBMetaData try { XConnection xConnection = null; - if (Properties.hasPropertyValue(curproperties, "ActiveConnection")) + if (Properties.hasPropertyValue(curproperties, PropertyNames.ACTIVE_CONNECTION)) { - xConnection = UnoRuntime.queryInterface( XConnection.class, Properties.getPropertyValue( curproperties, "ActiveConnection" ) ); + xConnection = UnoRuntime.queryInterface( XConnection.class, Properties.getPropertyValue( curproperties, PropertyNames.ACTIVE_CONNECTION ) ); if (xConnection != null) { com.sun.star.container.XChild child = UnoRuntime.queryInterface( com.sun.star.container.XChild.class, xConnection ); @@ -653,15 +653,15 @@ public class DBMetaData } catch (IllegalArgumentException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } catch (UnknownPropertyException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } catch (WrappedTargetException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return false; @@ -684,7 +684,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return false; } } @@ -703,7 +703,7 @@ public class DBMetaData getDataSourceInterfaces(); if (bPasswordIsRequired == false) { - DBConnection = _dataSource.getConnection("", ""); + DBConnection = _dataSource.getConnection(PropertyNames.EMPTY_STRING, PropertyNames.EMPTY_STRING); bgetConnection = true; } else @@ -746,11 +746,11 @@ public class DBMetaData } return bgetConnection; } - catch (Exception exception) + catch (Exception e) { String sMsgConnectionImpossible = oResource.getResText(RID_DB_COMMON + 35); showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sMsgConnectionImpossible); - exception.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return false; } } @@ -767,7 +767,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return 0; } } @@ -784,7 +784,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return 0; } } @@ -816,7 +816,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return false; } } @@ -852,7 +852,7 @@ public class DBMetaData XPropertySet xPSet = UnoRuntime.queryInterface( XPropertySet.class, oQuery ); String s = _oSQLQueryComposer.m_xQueryAnalyzer.getQuery(); - xPSet.setPropertyValue("Command", s); + xPSet.setPropertyValue(PropertyNames.COMMAND, s); XNameContainer xNameCont = UnoRuntime.queryInterface( XNameContainer.class, xQueryDefs ); m_connectionTools.getObjectNames().checkNameForCreate(com.sun.star.sdb.CommandType.QUERY, _QueryName); @@ -877,13 +877,13 @@ public class DBMetaData } exception.printStackTrace(System.out); } - catch (SQLException exception) + catch (SQLException e) { - callSQLErrorMessageDialog(exception, null); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } - catch (Exception exception) + catch (Exception e) { - exception.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return false; } @@ -949,7 +949,7 @@ public class DBMetaData NamedValueCollection creationArgs = new NamedValueCollection(); creationArgs.put( PropertyNames.PROPERTY_NAME, basename ); - creationArgs.put( "URL", documentURL ); + creationArgs.put( PropertyNames.URL, documentURL ); creationArgs.put( "AsTemplate", i_createTemplate ); XMultiServiceFactory xDocMSF = UnoRuntime.queryInterface( XMultiServiceFactory.class, _xDocNameAccess ); Object oDBDocument = xDocMSF.createInstanceWithArguments( "com.sun.star.sdb.DocumentDefinition", creationArgs.getPropertyValues() ); @@ -962,7 +962,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } } @@ -992,7 +992,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); } return sColValues; } @@ -1006,7 +1006,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return null; } } @@ -1020,7 +1020,7 @@ public class DBMetaData } catch (SQLException e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return null; } } @@ -1041,7 +1041,7 @@ public class DBMetaData } catch (Exception e) { - e.printStackTrace(System.out); + Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e ); return false; } } diff --git a/wizards/com/sun/star/wizards/db/QueryMetaData.java b/wizards/com/sun/star/wizards/db/QueryMetaData.java index 5fe6cd55c3a9..f6fe9176086c 100644 --- a/wizards/com/sun/star/wizards/db/QueryMetaData.java +++ b/wizards/com/sun/star/wizards/db/QueryMetaData.java @@ -196,7 +196,7 @@ public class QueryMetaData extends CommandMetaData ArrayList<String> CommandNames = new ArrayList<String>(1); for (int i = 0; i < _FieldNames.length; i++) { - String CurCommandName = ""; + String CurCommandName = PropertyNames.EMPTY_STRING; String[] MetaList = JavaTools.ArrayoutofString(_FieldNames[i], "."); if (MetaList.length > 1) { diff --git a/wizards/com/sun/star/wizards/db/RecordParser.java b/wizards/com/sun/star/wizards/db/RecordParser.java index 6c8ddb5b2c36..f9621fe8420d 100644 --- a/wizards/com/sun/star/wizards/db/RecordParser.java +++ b/wizards/com/sun/star/wizards/db/RecordParser.java @@ -44,6 +44,7 @@ import com.sun.star.wizards.common.JavaTools; import com.sun.star.wizards.common.NumberFormatter; import com.sun.star.sdbc.XResultSet; import com.sun.star.task.XInteractionHandler; +import com.sun.star.wizards.common.PropertyNames; public class RecordParser extends QueryMetaData { @@ -217,9 +218,9 @@ public class RecordParser extends QueryMetaData try { Helper.setUnoPropertyValue(xRowSet, "DataSourceName", DataSourceName); - Helper.setUnoPropertyValue(xRowSet, "ActiveConnection", DBConnection); - Helper.setUnoPropertyValue(xRowSet, "Command", Command); - Helper.setUnoPropertyValue(xRowSet, "CommandType", new Integer(_nCommandType)); // CommandType + Helper.setUnoPropertyValue(xRowSet, PropertyNames.ACTIVE_CONNECTION, DBConnection); + Helper.setUnoPropertyValue(xRowSet, PropertyNames.COMMAND, Command); + Helper.setUnoPropertyValue(xRowSet, PropertyNames.COMMAND_TYPE, new Integer(_nCommandType)); // CommandType xExecute.executeWithCompletion(xInteraction); com.sun.star.sdb.XResultSetAccess xResultAccess = (com.sun.star.sdb.XResultSetAccess) UnoRuntime.queryInterface(com.sun.star.sdb.XResultSetAccess.class, xRowSet); ResultSet = xResultAccess.createResultSet(); diff --git a/wizards/com/sun/star/wizards/db/RelationController.java b/wizards/com/sun/star/wizards/db/RelationController.java index acf47581d3e2..6c8b212f3cfd 100644 --- a/wizards/com/sun/star/wizards/db/RelationController.java +++ b/wizards/com/sun/star/wizards/db/RelationController.java @@ -33,6 +33,7 @@ import com.sun.star.sdbc.XResultSet; import com.sun.star.sdbc.XRow; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; /** * @author bc93774 @@ -94,7 +95,7 @@ public class RelationController extends CommandName private Object getCatalogName(CommandName _oCommandName) { String sLocCatalog = _oCommandName.getCatalogName(); - if (sLocCatalog.equals("")) + if (sLocCatalog.equals(PropertyNames.EMPTY_STRING)) { return null; } diff --git a/wizards/com/sun/star/wizards/db/TableDescriptor.java b/wizards/com/sun/star/wizards/db/TableDescriptor.java index 0330e518b774..80fbfd9ed906 100644 --- a/wizards/com/sun/star/wizards/db/TableDescriptor.java +++ b/wizards/com/sun/star/wizards/db/TableDescriptor.java @@ -81,8 +81,8 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen private XColumnsSupplier xKeyColumnSupplier; private XPropertySet xKey; private boolean bIDFieldisInserted = false; - private String IDFieldName = ""; - private String sColumnAlreadyExistsMessage = ""; + private String IDFieldName = PropertyNames.EMPTY_STRING; + private String sColumnAlreadyExistsMessage = PropertyNames.EMPTY_STRING; // private WizardDialog oUnoDialog; private XWindow xWindow; @@ -319,7 +319,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { try { - xPropTableDataDescriptor.setPropertyValue(PropertyNames.PROPERTY_NAME, ""); + xPropTableDataDescriptor.setPropertyValue(PropertyNames.PROPERTY_NAME, PropertyNames.EMPTY_STRING); if ((xKeyDrop != null) && (xIndexAccessKeys != null)) { int icount = xIndexAccessKeys.getCount(); @@ -374,7 +374,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { if (_svalue != null) { - if (!_svalue.equals("")) + if (!_svalue.equals(PropertyNames.EMPTY_STRING)) { try { @@ -664,7 +664,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen { if (!hasByName(_columnname)) { - if (_columnname.equals("")) + if (_columnname.equals(PropertyNames.EMPTY_STRING)) { return false; } @@ -694,7 +694,7 @@ public class TableDescriptor extends CommandMetaData implements XContainerListen try { XPropertySet xColPropertySet = xColumnDataDescriptorFactory.createDataDescriptor(); - IDFieldName = Desktop.getUniqueName(getColumnNames(), _columnname, ""); + IDFieldName = Desktop.getUniqueName(getColumnNames(), _columnname, PropertyNames.EMPTY_STRING); xColPropertySet.setPropertyValue(PropertyNames.PROPERTY_NAME, IDFieldName); int nDataType = oTypeInspector.convertDataType(com.sun.star.sdbc.DataType.INTEGER); diff --git a/wizards/com/sun/star/wizards/db/TypeInspector.java b/wizards/com/sun/star/wizards/db/TypeInspector.java index 1f22801fd8c5..6e6bc358aaea 100644 --- a/wizards/com/sun/star/wizards/db/TypeInspector.java +++ b/wizards/com/sun/star/wizards/db/TypeInspector.java @@ -38,6 +38,7 @@ import com.sun.star.sdbc.XRow; import com.sun.star.uno.AnyConverter; import com.sun.star.uno.UnoRuntime; import com.sun.star.wizards.common.JavaTools; +import com.sun.star.wizards.common.PropertyNames; public class TypeInspector { @@ -284,7 +285,7 @@ public class TypeInspector */ public String getDefaultTypeName(int _curDataType, Integer precision) { - String ret = ""; + String ret = PropertyNames.EMPTY_STRING; for (int i = 0; i < nDataTypeInfos.length; i++) { if (nDataTypeInfos[i] == _curDataType) |