Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
5d2c7c7d
Kaydet (Commit)
5d2c7c7d
authored
Eki 08, 2010
tarafından
obo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
CWS-TOOLING: integrate CWS dba33j
üst
b6b8f0c4
0336bdb7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
44 deletions
+83
-44
optimprove.src
cui/source/options/optimprove.src
+5
-5
DBMetaData.java
wizards/com/sun/star/wizards/db/DBMetaData.java
+7
-25
DatabaseObjectWizard.java
wizards/com/sun/star/wizards/db/DatabaseObjectWizard.java
+2
-1
SQLQueryComposer.java
wizards/com/sun/star/wizards/db/SQLQueryComposer.java
+69
-13
QueryWizard.java
wizards/com/sun/star/wizards/query/QueryWizard.java
+0
-0
FilterComponent.java
wizards/com/sun/star/wizards/ui/FilterComponent.java
+0
-0
No files found.
cui/source/options/optimprove.src
Dosyayı görüntüle @
5d2c7c7d
...
@@ -84,29 +84,29 @@ TabPage RID_SVXPAGE_IMPROVEMENT
...
@@ -84,29 +84,29 @@ TabPage RID_SVXPAGE_IMPROVEMENT
FixedText FT_NR_REPORTS
FixedText FT_NR_REPORTS
{
{
Pos = MAP_APPFONT ( 12 , 132 ) ;
Pos = MAP_APPFONT ( 12 , 132 ) ;
Size = MAP_APPFONT (
80
, 8 ) ;
Size = MAP_APPFONT (
96
, 8 ) ;
Text [ en-US ] = "Number of reports sent:" ;
Text [ en-US ] = "Number of reports sent:" ;
};
};
FixedText FT_NR_REPORTS_VALUE
FixedText FT_NR_REPORTS_VALUE
{
{
Pos = MAP_APPFONT (
95
, 132 ) ;
Pos = MAP_APPFONT (
111
, 132 ) ;
Size = MAP_APPFONT ( 100 , 10 ) ;
Size = MAP_APPFONT ( 100 , 10 ) ;
};
};
FixedText FT_NR_ACTIONS
FixedText FT_NR_ACTIONS
{
{
Pos = MAP_APPFONT ( 12 , 145 ) ;
Pos = MAP_APPFONT ( 12 , 145 ) ;
Size = MAP_APPFONT (
80
, 8 ) ;
Size = MAP_APPFONT (
96
, 8 ) ;
Text [ en-US ] = "Number of tracked actions:" ;
Text [ en-US ] = "Number of tracked actions:" ;
};
};
FixedText FT_NR_ACTIONS_VALUE
FixedText FT_NR_ACTIONS_VALUE
{
{
Pos = MAP_APPFONT (
95
, 145 ) ;
Pos = MAP_APPFONT (
111
, 145 ) ;
Size = MAP_APPFONT ( 100 , 10 ) ;
Size = MAP_APPFONT ( 100 , 10 ) ;
};
};
PushButton PB_SHOWDATA
PushButton PB_SHOWDATA
{
{
Pos = MAP_APPFONT ( 12 , 161 ) ;
Pos = MAP_APPFONT ( 12 , 161 ) ;
Size = MAP_APPFONT (
5
0 , 14 ) ;
Size = MAP_APPFONT (
6
0 , 14 ) ;
Text [ en-US ] = "~Show Data" ;
Text [ en-US ] = "~Show Data" ;
};
};
String STR_INFO
String STR_INFO
...
...
wizards/com/sun/star/wizards/db/DBMetaData.java
Dosyayı görüntüle @
5d2c7c7d
...
@@ -38,12 +38,10 @@ import com.sun.star.awt.XWindowPeer;
...
@@ -38,12 +38,10 @@ import com.sun.star.awt.XWindowPeer;
import
com.sun.star.beans.PropertyValue
;
import
com.sun.star.beans.PropertyValue
;
import
com.sun.star.beans.UnknownPropertyException
;
import
com.sun.star.beans.UnknownPropertyException
;
import
com.sun.star.beans.XPropertySet
;
import
com.sun.star.beans.XPropertySet
;
import
com.sun.star.container.XChild
;
import
com.sun.star.container.XHierarchicalNameAccess
;
import
com.sun.star.container.XHierarchicalNameAccess
;
import
com.sun.star.container.XHierarchicalNameContainer
;
import
com.sun.star.container.XHierarchicalNameContainer
;
import
com.sun.star.container.XNameAccess
;
import
com.sun.star.container.XNameAccess
;
import
com.sun.star.container.XNameContainer
;
import
com.sun.star.container.XNameContainer
;
import
com.sun.star.frame.XComponentLoader
;
import
com.sun.star.frame.XModel
;
import
com.sun.star.frame.XModel
;
import
com.sun.star.frame.XStorable
;
import
com.sun.star.frame.XStorable
;
import
com.sun.star.lang.XComponent
;
import
com.sun.star.lang.XComponent
;
...
@@ -91,7 +89,6 @@ import java.util.logging.Logger;
...
@@ -91,7 +89,6 @@ import java.util.logging.Logger;
public
class
DBMetaData
public
class
DBMetaData
{
{
private
XNameAccess
xQueryNames
;
private
XNameAccess
xQueryNames
;
public
XDatabaseMetaData
xDBMetaData
;
public
XDatabaseMetaData
xDBMetaData
;
private
XDataSource
m_dataSource
;
private
XDataSource
m_dataSource
;
...
@@ -109,12 +106,8 @@ public class DBMetaData
...
@@ -109,12 +106,8 @@ public class DBMetaData
public
com
.
sun
.
star
.
lang
.
XMultiServiceFactory
xMSF
;
public
com
.
sun
.
star
.
lang
.
XMultiServiceFactory
xMSF
;
public
XComponent
xConnectionComponent
;
public
XComponent
xConnectionComponent
;
private
XNameAccess
m_xTableNames
;
private
XInteractionHandler
oInteractionHandler
;
private
XNameAccess
xNameAccess
;
private
XNameAccess
xNameAccess
;
private
XInterface
xDatabaseContext
;
private
XInterface
xDatabaseContext
;
private
XCompletedConnection
xCompleted
;
// private int[] nDataTypes = null;
private
XWindowPeer
xWindowPeer
;
private
XWindowPeer
xWindowPeer
;
private
String
[]
TableNames
=
new
String
[]
{};
private
String
[]
TableNames
=
new
String
[]
{};
private
String
[]
QueryNames
=
new
String
[]
{};
private
String
[]
QueryNames
=
new
String
[]
{};
...
@@ -212,15 +205,13 @@ public class DBMetaData
...
@@ -212,15 +205,13 @@ public class DBMetaData
return
lDateCorrection
;
return
lDateCorrection
;
}
}
void
getInterfaces
(
XMultiServiceFactory
xMSF
)
private
void
getInterfaces
(
XMultiServiceFactory
xMSF
)
{
{
try
try
{
{
this
.
xMSF
=
xMSF
;
this
.
xMSF
=
xMSF
;
xDatabaseContext
=
(
XInterface
)
xMSF
.
createInstance
(
"com.sun.star.sdb.DatabaseContext"
);
xDatabaseContext
=
(
XInterface
)
xMSF
.
createInstance
(
"com.sun.star.sdb.DatabaseContext"
);
xNameAccess
=
UnoRuntime
.
queryInterface
(
XNameAccess
.
class
,
xDatabaseContext
);
xNameAccess
=
UnoRuntime
.
queryInterface
(
XNameAccess
.
class
,
xDatabaseContext
);
XInterface
xInteractionHandler
=
(
XInterface
)
xMSF
.
createInstance
(
"com.sun.star.task.InteractionHandler"
);
oInteractionHandler
=
UnoRuntime
.
queryInterface
(
XInteractionHandler
.
class
,
xInteractionHandler
);
DataSourceNames
=
xNameAccess
.
getElementNames
();
DataSourceNames
=
xNameAccess
.
getElementNames
();
}
}
catch
(
Exception
exception
)
catch
(
Exception
exception
)
...
@@ -257,7 +248,6 @@ public class DBMetaData
...
@@ -257,7 +248,6 @@ public class DBMetaData
public
boolean
hasTableByName
(
String
_stablename
)
public
boolean
hasTableByName
(
String
_stablename
)
{
{
// getTableNames();
return
getTableNamesAsNameAccess
().
hasByName
(
_stablename
);
return
getTableNamesAsNameAccess
().
hasByName
(
_stablename
);
}
}
...
@@ -371,11 +361,6 @@ public class DBMetaData
...
@@ -371,11 +361,6 @@ public class DBMetaData
return
bHasEscapeProcessing
;
return
bHasEscapeProcessing
;
}
}
// public void initCommandNames()
// {
// getTableNames();
// }
public
XNameAccess
getQueryNamesAsNameAccess
()
public
XNameAccess
getQueryNamesAsNameAccess
()
{
{
XQueriesSupplier
xDBQueries
=
UnoRuntime
.
queryInterface
(
XQueriesSupplier
.
class
,
DBConnection
);
XQueriesSupplier
xDBQueries
=
UnoRuntime
.
queryInterface
(
XQueriesSupplier
.
class
,
DBConnection
);
...
@@ -416,7 +401,7 @@ public class DBMetaData
...
@@ -416,7 +401,7 @@ public class DBMetaData
return
TableNames
;
return
TableNames
;
}
}
void
InitializeWidthList
()
private
void
InitializeWidthList
()
{
{
WidthList
=
new
int
[
17
][
2
];
WidthList
=
new
int
[
17
][
2
];
WidthList
[
0
][
0
]
=
DataType
.
BIT
;
// == -7;
WidthList
[
0
][
0
]
=
DataType
.
BIT
;
// == -7;
...
@@ -581,7 +566,7 @@ public class DBMetaData
...
@@ -581,7 +566,7 @@ public class DBMetaData
return
m_dataSource
;
return
m_dataSource
;
}
}
private
void
setDataSourceByName
(
String
_DataSourceName
,
boolean
bgetInterfaces
)
private
void
setDataSourceByName
(
String
_DataSourceName
)
{
{
try
try
{
{
...
@@ -601,7 +586,6 @@ public class DBMetaData
...
@@ -601,7 +586,6 @@ public class DBMetaData
public
void
getDataSourceInterfaces
()
throws
Exception
public
void
getDataSourceInterfaces
()
throws
Exception
{
{
xCompleted
=
UnoRuntime
.
queryInterface
(
XCompletedConnection
.
class
,
getDataSource
()
);
xDataSourcePropertySet
=
UnoRuntime
.
queryInterface
(
XPropertySet
.
class
,
getDataSource
()
);
xDataSourcePropertySet
=
UnoRuntime
.
queryInterface
(
XPropertySet
.
class
,
getDataSource
()
);
bPasswordIsRequired
=
((
Boolean
)
xDataSourcePropertySet
.
getPropertyValue
(
"IsPasswordRequired"
)).
booleanValue
();
bPasswordIsRequired
=
((
Boolean
)
xDataSourcePropertySet
.
getPropertyValue
(
"IsPasswordRequired"
)).
booleanValue
();
}
}
...
@@ -684,8 +668,8 @@ public class DBMetaData
...
@@ -684,8 +668,8 @@ public class DBMetaData
private
boolean
getConnection
(
String
_DataSourceName
)
private
boolean
getConnection
(
String
_DataSourceName
)
{
{
setDataSourceByName
(
_DataSourceName
,
true
);
setDataSourceByName
(
_DataSourceName
);
return
getConnection
(
getDataSource
()
);
return
getConnection
(
getDataSource
()
);
}
}
private
boolean
getConnection
(
com
.
sun
.
star
.
sdbc
.
XConnection
_DBConnection
)
private
boolean
getConnection
(
com
.
sun
.
star
.
sdbc
.
XConnection
_DBConnection
)
...
@@ -955,7 +939,7 @@ public class DBMetaData
...
@@ -955,7 +939,7 @@ public class DBMetaData
NamedValueCollection
creationArgs
=
new
NamedValueCollection
();
NamedValueCollection
creationArgs
=
new
NamedValueCollection
();
creationArgs
.
put
(
"Name"
,
basename
);
creationArgs
.
put
(
"Name"
,
basename
);
creationArgs
.
put
(
"URL"
,
documentURL
);
creationArgs
.
put
(
"URL"
,
documentURL
);
creationArgs
.
put
(
"AsTemplate"
,
new
Boolean
(
i_createTemplate
)
);
creationArgs
.
put
(
"AsTemplate"
,
i_createTemplate
);
XMultiServiceFactory
xDocMSF
=
UnoRuntime
.
queryInterface
(
XMultiServiceFactory
.
class
,
_xDocNameAccess
);
XMultiServiceFactory
xDocMSF
=
UnoRuntime
.
queryInterface
(
XMultiServiceFactory
.
class
,
_xDocNameAccess
);
Object
oDBDocument
=
xDocMSF
.
createInstanceWithArguments
(
"com.sun.star.sdb.DocumentDefinition"
,
creationArgs
.
getPropertyValues
()
);
Object
oDBDocument
=
xDocMSF
.
createInstanceWithArguments
(
"com.sun.star.sdb.DocumentDefinition"
,
creationArgs
.
getPropertyValues
()
);
XHierarchicalNameContainer
xHier
=
UnoRuntime
.
queryInterface
(
XHierarchicalNameContainer
.
class
,
_xDocNameAccess
);
XHierarchicalNameContainer
xHier
=
UnoRuntime
.
queryInterface
(
XHierarchicalNameContainer
.
class
,
_xDocNameAccess
);
...
@@ -967,7 +951,7 @@ public class DBMetaData
...
@@ -967,7 +951,7 @@ public class DBMetaData
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
e
.
printStackTrace
(
System
.
out
);
e
.
printStackTrace
();
}
}
}
}
...
@@ -1103,13 +1087,11 @@ public class DBMetaData
...
@@ -1103,13 +1087,11 @@ public class DBMetaData
public
void
finish
()
public
void
finish
()
{
{
xQueryNames
=
null
;
xQueryNames
=
null
;
oInteractionHandler
=
null
;
xNameAccess
=
null
;
xNameAccess
=
null
;
xDatabaseContext
=
null
;
xDatabaseContext
=
null
;
xDBMetaData
=
null
;
xDBMetaData
=
null
;
m_dataSource
=
null
;
m_dataSource
=
null
;
xModel
=
null
;
xModel
=
null
;
xCompleted
=
null
;
xDataSourcePropertySet
=
null
;
xDataSourcePropertySet
=
null
;
xWindowPeer
=
null
;
xWindowPeer
=
null
;
DBConnection
=
null
;
DBConnection
=
null
;
...
...
wizards/com/sun/star/wizards/db/DatabaseObjectWizard.java
Dosyayı görüntüle @
5d2c7c7d
...
@@ -57,7 +57,8 @@ public abstract class DatabaseObjectWizard extends WizardDialog
...
@@ -57,7 +57,8 @@ public abstract class DatabaseObjectWizard extends WizardDialog
{
{
try
try
{
{
m_docUI
.
loadComponent
(
i_type
,
i_name
,
i_forEditing
);
if
(
m_docUI
!=
null
)
m_docUI
.
loadComponent
(
i_type
,
i_name
,
i_forEditing
);
}
}
catch
(
IllegalArgumentException
ex
)
catch
(
IllegalArgumentException
ex
)
{
{
...
...
wizards/com/sun/star/wizards/db/SQLQueryComposer.java
Dosyayı görüntüle @
5d2c7c7d
...
@@ -47,6 +47,7 @@ import com.sun.star.uno.UnoRuntime;
...
@@ -47,6 +47,7 @@ import com.sun.star.uno.UnoRuntime;
import
com.sun.star.sdbc.SQLException
;
import
com.sun.star.sdbc.SQLException
;
import
com.sun.star.lang.XInitialization
;
import
com.sun.star.lang.XInitialization
;
import
com.sun.star.awt.XWindow
;
import
com.sun.star.awt.XWindow
;
import
com.sun.star.sdb.SQLFilterOperator
;
import
com.sun.star.wizards.common.*
;
import
com.sun.star.wizards.common.*
;
...
@@ -60,7 +61,7 @@ public class SQLQueryComposer
...
@@ -60,7 +61,7 @@ public class SQLQueryComposer
// String m_sFromClause;
// String m_sFromClause;
public
XSingleSelectQueryAnalyzer
m_xQueryAnalyzer
;
public
XSingleSelectQueryAnalyzer
m_xQueryAnalyzer
;
Vector
composedCommandNames
=
new
Vector
(
1
);
Vector
composedCommandNames
=
new
Vector
(
1
);
private
XSingleSelectQueryComposer
m_
xQ
ueryComposer
;
private
XSingleSelectQueryComposer
m_
q
ueryComposer
;
XMultiServiceFactory
xMSF
;
XMultiServiceFactory
xMSF
;
boolean
bincludeGrouping
=
true
;
boolean
bincludeGrouping
=
true
;
...
@@ -72,7 +73,7 @@ public class SQLQueryComposer
...
@@ -72,7 +73,7 @@ public class SQLQueryComposer
xMSF
=
(
XMultiServiceFactory
)
UnoRuntime
.
queryInterface
(
XMultiServiceFactory
.
class
,
CurDBMetaData
.
DBConnection
);
xMSF
=
(
XMultiServiceFactory
)
UnoRuntime
.
queryInterface
(
XMultiServiceFactory
.
class
,
CurDBMetaData
.
DBConnection
);
final
Object
oQueryComposer
=
xMSF
.
createInstance
(
"com.sun.star.sdb.SingleSelectQueryComposer"
);
final
Object
oQueryComposer
=
xMSF
.
createInstance
(
"com.sun.star.sdb.SingleSelectQueryComposer"
);
m_xQueryAnalyzer
=
(
XSingleSelectQueryAnalyzer
)
UnoRuntime
.
queryInterface
(
XSingleSelectQueryAnalyzer
.
class
,
oQueryComposer
);
m_xQueryAnalyzer
=
(
XSingleSelectQueryAnalyzer
)
UnoRuntime
.
queryInterface
(
XSingleSelectQueryAnalyzer
.
class
,
oQueryComposer
);
m_
xQ
ueryComposer
=
(
XSingleSelectQueryComposer
)
UnoRuntime
.
queryInterface
(
XSingleSelectQueryComposer
.
class
,
m_xQueryAnalyzer
);
m_
q
ueryComposer
=
(
XSingleSelectQueryComposer
)
UnoRuntime
.
queryInterface
(
XSingleSelectQueryComposer
.
class
,
m_xQueryAnalyzer
);
XSQLQueryComposerFactory
xSQLComposerFactory
;
XSQLQueryComposerFactory
xSQLComposerFactory
;
xSQLComposerFactory
=
(
XSQLQueryComposerFactory
)
UnoRuntime
.
queryInterface
(
XSQLQueryComposerFactory
.
class
,
CurDBMetaData
.
DBConnection
);
xSQLComposerFactory
=
(
XSQLQueryComposerFactory
)
UnoRuntime
.
queryInterface
(
XSQLQueryComposerFactory
.
class
,
CurDBMetaData
.
DBConnection
);
// /* XSQLQueryComposer */ xSQLQueryComposer = xSQLComposerFactory.createQueryComposer();
// /* XSQLQueryComposer */ xSQLQueryComposer = xSQLComposerFactory.createQueryComposer();
...
@@ -160,7 +161,7 @@ public class SQLQueryComposer
...
@@ -160,7 +161,7 @@ public class SQLQueryComposer
{
{
for
(
int
i
=
0
;
i
<
CurDBMetaData
.
getFilterConditions
().
length
;
i
++)
for
(
int
i
=
0
;
i
<
CurDBMetaData
.
getFilterConditions
().
length
;
i
++)
{
{
m_
xQ
ueryComposer
.
setStructuredFilter
(
CurDBMetaData
.
getFilterConditions
());
m_
q
ueryComposer
.
setStructuredFilter
(
CurDBMetaData
.
getFilterConditions
());
}
}
}
}
catch
(
Exception
exception
)
catch
(
Exception
exception
)
...
@@ -172,7 +173,7 @@ public class SQLQueryComposer
...
@@ -172,7 +173,7 @@ public class SQLQueryComposer
public
void
prependSortingCriteria
()
throws
SQLException
public
void
prependSortingCriteria
()
throws
SQLException
{
{
XIndexAccess
xColumnIndexAccess
=
m_xQueryAnalyzer
.
getOrderColumns
();
XIndexAccess
xColumnIndexAccess
=
m_xQueryAnalyzer
.
getOrderColumns
();
m_
xQ
ueryComposer
.
setOrder
(
""
);
m_
q
ueryComposer
.
setOrder
(
""
);
for
(
int
i
=
0
;
i
<
CurDBMetaData
.
getSortFieldNames
().
length
;
i
++)
for
(
int
i
=
0
;
i
<
CurDBMetaData
.
getSortFieldNames
().
length
;
i
++)
{
{
appendSortingCriterion
(
i
,
false
);
appendSortingCriterion
(
i
,
false
);
...
@@ -186,7 +187,7 @@ public class SQLQueryComposer
...
@@ -186,7 +187,7 @@ public class SQLQueryComposer
if
(
JavaTools
.
FieldInTable
(
CurDBMetaData
.
getSortFieldNames
(),
sName
)
==
-
1
)
if
(
JavaTools
.
FieldInTable
(
CurDBMetaData
.
getSortFieldNames
(),
sName
)
==
-
1
)
{
{
boolean
bascend
=
AnyConverter
.
toBoolean
(
xColumnPropertySet
.
getPropertyValue
(
"IsAscending"
));
boolean
bascend
=
AnyConverter
.
toBoolean
(
xColumnPropertySet
.
getPropertyValue
(
"IsAscending"
));
m_
xQ
ueryComposer
.
appendOrderByColumn
(
xColumnPropertySet
,
bascend
);
m_
q
ueryComposer
.
appendOrderByColumn
(
xColumnPropertySet
,
bascend
);
}
}
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
...
@@ -203,13 +204,13 @@ public class SQLQueryComposer
...
@@ -203,13 +204,13 @@ public class SQLQueryComposer
String
sSort
=
CurDBMetaData
.
getSortFieldNames
()[
_SortIndex
][
1
];
String
sSort
=
CurDBMetaData
.
getSortFieldNames
()[
_SortIndex
][
1
];
boolean
bascend
=
(
sSort
.
equals
(
"ASC"
));
boolean
bascend
=
(
sSort
.
equals
(
"ASC"
));
m_
xQ
ueryComposer
.
appendOrderByColumn
(
xColumn
,
bascend
);
m_
q
ueryComposer
.
appendOrderByColumn
(
xColumn
,
bascend
);
}
}
public
void
appendSortingcriteria
(
boolean
_baddAliasFieldNames
)
throws
SQLException
public
void
appendSortingcriteria
(
boolean
_baddAliasFieldNames
)
throws
SQLException
{
{
String
sOrder
=
""
;
String
sOrder
=
""
;
m_
xQ
ueryComposer
.
setOrder
(
""
);
m_
q
ueryComposer
.
setOrder
(
""
);
for
(
int
i
=
0
;
i
<
CurDBMetaData
.
getSortFieldNames
().
length
;
i
++)
for
(
int
i
=
0
;
i
<
CurDBMetaData
.
getSortFieldNames
().
length
;
i
++)
{
{
String
sSortValue
=
CurDBMetaData
.
getSortFieldNames
()[
i
][
0
];
String
sSortValue
=
CurDBMetaData
.
getSortFieldNames
()[
i
][
0
];
...
@@ -223,7 +224,7 @@ public class SQLQueryComposer
...
@@ -223,7 +224,7 @@ public class SQLQueryComposer
}
}
sOrder
+=
CurDBMetaData
.
AggregateFieldNames
[
iAggregate
][
1
]
+
"("
+
CurDBMetaData
.
AggregateFieldNames
[
iAggregate
][
0
]
+
")"
;
sOrder
+=
CurDBMetaData
.
AggregateFieldNames
[
iAggregate
][
1
]
+
"("
+
CurDBMetaData
.
AggregateFieldNames
[
iAggregate
][
0
]
+
")"
;
sOrder
+=
" "
+
CurDBMetaData
.
getSortFieldNames
()[
i
][
1
];
sOrder
+=
" "
+
CurDBMetaData
.
getSortFieldNames
()[
i
][
1
];
m_
xQ
ueryComposer
.
setOrder
(
sOrder
);
m_
q
ueryComposer
.
setOrder
(
sOrder
);
}
}
else
else
{
{
...
@@ -232,7 +233,7 @@ public class SQLQueryComposer
...
@@ -232,7 +233,7 @@ public class SQLQueryComposer
sOrder
=
m_xQueryAnalyzer
.
getOrder
();
sOrder
=
m_xQueryAnalyzer
.
getOrder
();
}
}
// just for debug!
// just for debug!
sOrder
=
m_
xQ
ueryComposer
.
getOrder
();
sOrder
=
m_
q
ueryComposer
.
getOrder
();
int
dummy
=
0
;
int
dummy
=
0
;
}
}
...
@@ -241,7 +242,7 @@ public class SQLQueryComposer
...
@@ -241,7 +242,7 @@ public class SQLQueryComposer
for
(
int
i
=
0
;
i
<
CurDBMetaData
.
GroupFieldNames
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
CurDBMetaData
.
GroupFieldNames
.
length
;
i
++)
{
{
XPropertySet
xColumn
=
CurDBMetaData
.
getColumnObjectByFieldName
(
CurDBMetaData
.
GroupFieldNames
[
i
],
_baddAliasFieldNames
);
XPropertySet
xColumn
=
CurDBMetaData
.
getColumnObjectByFieldName
(
CurDBMetaData
.
GroupFieldNames
[
i
],
_baddAliasFieldNames
);
m_
xQ
ueryComposer
.
appendGroupByColumn
(
xColumn
);
m_
q
ueryComposer
.
appendGroupByColumn
(
xColumn
);
}
}
String
s
=
m_xQueryAnalyzer
.
getQuery
();
String
s
=
m_xQueryAnalyzer
.
getQuery
();
}
}
...
@@ -309,7 +310,7 @@ public class SQLQueryComposer
...
@@ -309,7 +310,7 @@ public class SQLQueryComposer
if
(
CurDBMetaData
.
getFilterConditions
().
length
>
0
)
if
(
CurDBMetaData
.
getFilterConditions
().
length
>
0
)
{
{
CurDBMetaData
.
setFilterConditions
(
replaceConditionsByAlias
(
CurDBMetaData
.
getFilterConditions
()));
CurDBMetaData
.
setFilterConditions
(
replaceConditionsByAlias
(
CurDBMetaData
.
getFilterConditions
()));
m_
xQ
ueryComposer
.
setStructuredFilter
(
CurDBMetaData
.
getFilterConditions
());
m_
q
ueryComposer
.
setStructuredFilter
(
CurDBMetaData
.
getFilterConditions
());
}
}
}
}
}
}
...
@@ -319,7 +320,7 @@ public class SQLQueryComposer
...
@@ -319,7 +320,7 @@ public class SQLQueryComposer
appendGroupByColumns
(
_baddAliasFieldNames
);
appendGroupByColumns
(
_baddAliasFieldNames
);
if
(
CurDBMetaData
.
GroupByFilterConditions
.
length
>
0
)
if
(
CurDBMetaData
.
GroupByFilterConditions
.
length
>
0
)
{
{
m_
xQ
ueryComposer
.
setStructuredHavingClause
(
CurDBMetaData
.
GroupByFilterConditions
);
m_
q
ueryComposer
.
setStructuredHavingClause
(
CurDBMetaData
.
GroupByFilterConditions
);
}
}
}
}
appendSortingcriteria
(
_baddAliasFieldNames
);
appendSortingcriteria
(
_baddAliasFieldNames
);
...
@@ -426,8 +427,63 @@ public class SQLQueryComposer
...
@@ -426,8 +427,63 @@ public class SQLQueryComposer
typeexception
.
printStackTrace
(
System
.
out
);
typeexception
.
printStackTrace
(
System
.
out
);
}
}
}
}
/**
* retrieves a normalized structured filter
*
* <p>XSingleSelectQueryComposer.getStructuredFilter has a strange habit of returning the predicate (equal, not equal, etc)
* effectively twice: Once as SQLFilterOperator, and once in the value. That is, if you have a term "column <> 3", then
* you'll get an SQLFilterOperator.NOT_EQUAL (which is fine), <strong>and</strong> the textual value of the condition
* will read "<> 3". The latter is strange enough, but even more strange is that this behavior is not even consistent:
* for SQLFilterOperator.EQUAL, the "=" sign is not include in the textual value.</p>
*
* <p>To abstract from this weirdness, use this function here, which strips the unwanted tokens from the textual value
* representation.</p>
*/
public
PropertyValue
[][]
getNormalizedStructuredFilter
()
{
final
PropertyValue
[][]
structuredFilter
=
m_queryComposer
.
getStructuredFilter
();
for
(
int
i
=
0
;
i
<
structuredFilter
.
length
;
++
i
)
{
for
(
int
j
=
0
;
j
<
structuredFilter
[
i
].
length
;
++
j
)
{
if
(
!(
structuredFilter
[
i
][
j
].
Value
instanceof
String
)
)
continue
;
final
StringBuffer
textualValue
=
new
StringBuffer
(
(
String
)
structuredFilter
[
i
][
j
].
Value
);
switch
(
structuredFilter
[
i
][
j
].
Handle
)
{
case
SQLFilterOperator
.
EQUAL
:
break
;
case
SQLFilterOperator
.
NOT_EQUAL
:
case
SQLFilterOperator
.
LESS_EQUAL
:
case
SQLFilterOperator
.
GREATER_EQUAL
:
textualValue
.
delete
(
0
,
2
);
break
;
case
SQLFilterOperator
.
LESS
:
case
SQLFilterOperator
.
GREATER
:
textualValue
.
delete
(
0
,
1
);
break
;
case
SQLFilterOperator
.
NOT_LIKE
:
textualValue
.
delete
(
0
,
8
);
break
;
case
SQLFilterOperator
.
LIKE
:
textualValue
.
delete
(
0
,
4
);
break
;
case
SQLFilterOperator
.
SQLNULL
:
textualValue
.
delete
(
0
,
7
);
break
;
case
SQLFilterOperator
.
NOT_SQLNULL
:
textualValue
.
delete
(
0
,
11
);
break
;
}
structuredFilter
[
i
][
j
].
Value
=
textualValue
.
toString
().
trim
();
}
}
return
structuredFilter
;
}
public
XSingleSelectQueryComposer
getQueryComposer
()
public
XSingleSelectQueryComposer
getQueryComposer
()
{
{
return
m_
xQ
ueryComposer
;
return
m_
q
ueryComposer
;
}
}
}
}
wizards/com/sun/star/wizards/query/QueryWizard.java
Dosyayı görüntüle @
5d2c7c7d
This diff is collapsed.
Click to expand it.
wizards/com/sun/star/wizards/ui/FilterComponent.java
Dosyayı görüntüle @
5d2c7c7d
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment