-
Notifications
You must be signed in to change notification settings - Fork 43
Main #435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ketan3108
wants to merge
1
commit into
LibreOffice:main
Choose a base branch
from
ketan3108:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Main #435
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,29 +40,34 @@ | |
| import de.muenchen.allg.itd51.wollmux.util.L; | ||
|
|
||
| /** | ||
| * Eine Datenquelle, die eine andere Datenquelle um Spalten ergänzt. Zur Erstellung der Menge der | ||
| * Ergebnisdatensätze wird jeder Datensatz aus SOURCE1 genau einmal verwendet und jeder Datensatz | ||
| * aus SOURCE2 beliebig oft (auch keinmal). Unterschiede zu einem richtigen Join:<br> | ||
| * | ||
| * A data source that adds columns to another data source. To create the set of result data records, | ||
| * each record from SOURCE1 is used exactly once, and each record from SOURCE2 is used any number of | ||
| * times (including zero times). Differences from a proper join:<br> | ||
| * | ||
| * <br> | ||
| * a) Verhindert, dass eine Person 2 mal auftaucht, nur weil es 2 Einträge mit Verkehrsverbindungen | ||
| * für ihre Adresse gibt<br> | ||
| * b) Verhindert, dass eine Person rausfliegt, weil es zu ihrer Adresse keine Verkehrsverbindung | ||
| * gibt<br> | ||
| * c) Die Schlüssel der Ergebnisdatensätze bleiben die aus SOURCE1 und werden nicht kombiniert aus | ||
| * SOURCE1 und SOURCE2. Das verhindert, dass ein Datensatz bei einer Änderung der Adresse aus der | ||
| * lokalen Absenderliste fliegt, weil er beim Cache-Refresh nicht mehr gefunden wird. <br> | ||
| * a) Prevents a person from appearing twice just because there are 2 entries for transport | ||
| * connections to their address.<br> | ||
| * b) Prevents a person from being excluded because there is no transport connection to their | ||
| * address.<br> | ||
| * c) The keys of the result data records remain those from SOURCE1 and are not combined from | ||
| * SOURCE1 and SOURCE2. This prevents a record from being removed from the local sender list due to | ||
| * a change in address, because it cannot be found during cache refresh.<br> | ||
| * | ||
| * <br> | ||
| * In der Ergebnisdatenquelle sind alle Spalten von SOURCE1 unter ihrem ursprünglichen Namen, alle | ||
| * Spalten von SOURCE2 unter dem Namen von SOURCE2 konkateniert mit "." konkateniert mit dem | ||
| * Spaltennamen zu finden. <br> | ||
| * In the result data source, all columns from SOURCE1 can be found under their original name, and | ||
| * all columns from SOURCE2 can be found under the name of SOURCE2 concatenated with "." | ||
| * concatenated with the column name.<br> | ||
| * | ||
| * <br> | ||
| * Argument gegen automatische Umbenennung/Aliase für Spalten aus SOURCE2, deren Name sich nicht mit | ||
| * einer Spalte aus SOURCE1 stört:<br> | ||
| * Argument against automatic renaming/aliasing of columns from SOURCE2 whose name does not conflict | ||
| * with a column from SOURCE1:<br> | ||
| * | ||
| * <br> | ||
| * - Der Alias würde verschwinden, wenn die Quelle SOURCE1 später einmal um eine Spalte mit dem | ||
| * entsprechenden Namen erweitert wird. Definitionen, die den Alias verwendet haben verwenden ab da | ||
| * stillschweigend die Spalte aus SOURCE1, was schwierig zu findende Fehler nach sich ziehen kann. | ||
| * | ||
| * The alias would disappear if the SOURCE1 source is later extended with a column with the | ||
| * corresponding name. Definitions that used the alias would then silently use the column from | ||
| * SOURCE1, which can lead to difficult-to-find errors. | ||
| * | ||
| * @author Matthias Benkmann (D-III-ITD 5.1) | ||
| */ | ||
| public class AttachDatasource extends Datasource | ||
|
|
@@ -91,24 +96,23 @@ public class AttachDatasource extends Datasource | |
| private String source2Prefix; | ||
|
|
||
| /** | ||
| * Erzeugt eine neue AttachDatasource. | ||
| * | ||
| * Creates a new AttachDatasource. | ||
| * | ||
| * @param nameToDatasource | ||
| * enthält alle bis zum Zeitpunkt der Definition dieser AttachDatasource bereits | ||
| * vollständig instanziierten Datenquellen. | ||
| * contains all data sources that have already been fully instantiated up to the point of | ||
| * defining this AttachDatasource. | ||
| * @param sourceDesc | ||
| * der "Datenquelle"-Knoten, der die Beschreibung dieser AttachDatasource enthält. | ||
| * the "data source" node that contains the description of this AttachDatasource. | ||
| * @param context | ||
| * der Kontext relativ zu dem URLs aufgelöst werden sollen (zur Zeit nicht verwendet). | ||
| * the context in which URLs should be resolved (not currently used). | ||
| */ | ||
| public AttachDatasource(Map<String, Datasource> nameToDatasource, ConfigThingy sourceDesc, | ||
| URL context) | ||
|
|
||
| public AttachDatasource(Map<String, Datasource> nameToDatasource, ConfigThingy sourceDesc, URL context) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are code changes included here? |
||
| { | ||
| name = sourceDesc | ||
| .get("NAME", ConfigurationErrorException.class, L.m("NAME of data source is missing")) | ||
| name = sourceDesc.get("NAME", ConfigurationErrorException.class, L.m("NAME of data source is missing")).toString(); | ||
| source1Name = sourceDesc | ||
| .get("SOURCE", ConfigurationErrorException.class, L.m("SOURCE1 of data source \"{0}\" is missing", name)) | ||
| .toString(); | ||
| source1Name = sourceDesc.get("SOURCE", ConfigurationErrorException.class, | ||
| L.m("SOURCE1 of data source \"{0}\" is missing", name)).toString(); | ||
| source2Name = sourceDesc.get("ATTACH", ConfigurationErrorException.class, | ||
| L.m("ATTACH specification of data source {0} is missing", name)).toString(); | ||
| source1 = nameToDatasource.get(source1Name); | ||
|
|
@@ -152,8 +156,7 @@ public AttachDatasource(Map<String, Datasource> nameToDatasource, ConfigThingy s | |
| { | ||
| ConfigThingy matchDesc = iter.next(); | ||
| if (matchDesc.count() != 2) | ||
| throw new ConfigurationErrorException( | ||
| L.m("Incorrect MATCH specification in data source \"{0}\"", name)); | ||
| throw new ConfigurationErrorException(L.m("Incorrect MATCH specification in data source \"{0}\"", name)); | ||
|
|
||
| String spalte1 = ""; | ||
| String spalte2 = ""; | ||
|
|
@@ -179,7 +182,7 @@ public AttachDatasource(Map<String, Datasource> nameToDatasource, ConfigThingy s | |
|
|
||
| /* | ||
| * (non-Javadoc) | ||
| * | ||
| * | ||
| * @see de.muenchen.allg.itd51.wollmux.db.Datasource#getSchema() | ||
| */ | ||
| @Override | ||
|
|
@@ -190,9 +193,10 @@ public List<String> getSchema() | |
|
|
||
| /* | ||
| * (non-Javadoc) | ||
| * | ||
| * | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please no whitespace changes |
||
| * @see de.muenchen.allg.itd51.wollmux.db.Datasource#getDatasetsByKey(java.util. Collection, long) | ||
| */ | ||
|
|
||
| @Override | ||
| public QueryResults getDatasetsByKey(Collection<String> keys) | ||
| { | ||
|
|
@@ -207,9 +211,10 @@ public QueryResults getContents() | |
|
|
||
| /* | ||
| * (non-Javadoc) | ||
| * | ||
| * | ||
| * @see de.muenchen.allg.itd51.wollmux.db.Datasource#find(java.util.List, long) | ||
| */ | ||
|
|
||
| @Override | ||
| public QueryResults find(List<QueryPart> query) | ||
| { | ||
|
|
@@ -220,8 +225,7 @@ public QueryResults find(List<QueryPart> query) | |
| { | ||
| if (p.getColumnName().startsWith(source2Prefix)) | ||
| { | ||
| query2.add(new QueryPart(p.getColumnName().substring(source2Prefix.length()), | ||
| p.getSearchString())); | ||
| query2.add(new QueryPart(p.getColumnName().substring(source2Prefix.length()), p.getSearchString())); | ||
| query2WithPrefix.add(p); | ||
| } else | ||
| { | ||
|
|
@@ -230,10 +234,11 @@ public QueryResults find(List<QueryPart> query) | |
| } | ||
|
|
||
| /* | ||
| * Die ATTACH-Datenquelle ist normalerweise nur untergeordnet und Spaltenbedingungen dafür | ||
| * schränken die Suchergebnisse wenig ein. Deshalb werten wir falls wir mindestens eine | ||
| * Bedingung an die Hauptdatenquelle haben, die Anfrage auf dieser Datenquelle aus. | ||
| * The ATTACH data source is usually only subordinate, and column conditions for it only | ||
| * minimally restrict the search results. Therefore, if we have at least one condition on the | ||
| * main data source, we evaluate the request on this data source. | ||
| */ | ||
|
|
||
| if (!query1.isEmpty()) | ||
| { | ||
| QueryResults results = source1.find(query1); | ||
|
|
@@ -247,9 +252,10 @@ public QueryResults find(List<QueryPart> query) | |
|
|
||
| /* | ||
| * (non-Javadoc) | ||
| * | ||
| * | ||
| * @see de.muenchen.allg.itd51.wollmux.db.Datasource#getName() | ||
| */ | ||
|
|
||
| @Override | ||
| public String getName() | ||
| { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert changes in this file.