From c2618e706e6c40d3281ef3cfcb5fd459cac3e956 Mon Sep 17 00:00:00 2001 From: sjPlot Date: Tue, 13 Oct 2015 11:45:10 +0200 Subject: [PATCH] close #34 --- README.md | 4 +- .../zettelkasten/ZettelkastenView.form | 21 +++++ .../zettelkasten/ZettelkastenView.java | 35 ++++++++- .../zettelkasten/database/Daten.java | 73 +++++++++++++++++- .../SearchResultsFrame_en_GB.properties | 56 +++++++------- .../resources/ZettelkastenView.properties | 4 + .../ZettelkastenView_en_GB.properties | 6 +- .../zettelkasten/tasks/StartSearchTask.java | 64 ++++++++++++++- .../resources/StartSearchTask.properties | 1 + .../StartSearchTask_en_GB.properties | 18 ++--- .../zettelkasten/util/Constants.java | 11 +++ .../resources/HtmlUbbUtil_en_GB.properties | 6 +- test/zkn3_sample.zkn3 | Bin 13 files changed, 251 insertions(+), 48 deletions(-) mode change 100755 => 100644 test/zkn3_sample.zkn3 diff --git a/README.md b/README.md index 0649e5d5..54042379 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,14 @@ Ausführliche Anleitungen zu den verschiedenen Funktionen gibt es [in der Wiki]( * In der Registerkarte _Überschriften_ werden jetzt Zettel als Ausgangsfolgezettel oder Folgezettel markiert ([#96](https://github.com/sjPlot/Zettelkasten/issues/96)). Die Sortierung der Spalte _Folgezettel_ in der Registerkarte _Überschriften_ ist per Voreinstellung deakitiviert, da der erstmalige Aufbau der Tabelle länger dauern kann. Die Sortierung kann in den Einstellungen _Tabellen und Listen_ aktiviert werden. * Der Export von Zetteln ins Markdown-, Text- und LaTex-Format kann jetzt auch jeden Zettel als einzelne Datei exportieren ([#13](https://github.com/sjPlot/Zettelkasten/issues/13) und [#77](https://github.com/sjPlot/Zettelkasten/issues/77)). * Beim Export ins Markdown-, Text- und LaTex-Format werden Fußnoten durch formatierte Autorenangaben ersetzt (sofern die Literatur mit Bibkey verknüpft ist). -* Im englischen Interface wurden _trails_ in _note sequences_ und _entry_ in _note_ umbenannt. * Literaturfußnoten können jetzt auch den Bibkey statt der Nummer des Literatureintrags enthalten (`[fn luhsozsys:123]` würde z.B. umgewandelt in `Luhmann 1984: 123`). * Das automatische Einklammern von Literaturfußnoten kann in den Einstellungen abgestellt werden ([#91](https://github.com/sjPlot/Zettelkasten/issues/91)). +* Über das Menü _Suchen_ (Untermenü _Zettel_) können jetzt Zettel gesucht werden, die Teil einer Folgezettelsequenz sind (entweder Ausgangs- oder Folgezettel). +* Über das Menü _Suchen_ (Untermenü _Zettel_) können jetzt Zettel gesucht werden, die _keine_ Querverweise enthalten (und auf die nicht durch Querverweise verwiesen wird) ([#34](https://github.com/sjPlot/Zettelkasten/issues/34)). * Literatur, die während der Neueingabe oder Bearbeiten eines Zettels als Literaturfußnote im Text referenziert wird, wird beim Beenden der Eingabe automatisch als Autorenangabe zum Zettel hinzugefügt, falls dies noch nicht geschehen ist. * Verbesserte Stabilität aller Lese- und Schreib-Operationen von Daten (Import, Export, Laden, Speichern, Auto-Backup...). * Geschwindigkeitsverbesserungen der Suchfunktionen ([#95](https://github.com/sjPlot/Zettelkasten/issues/95)). +* Im englischen Interface wurden _trails_ in _note sequences_ und _entry_ in _note_ umbenannt. * Neue Einstellung, um Formatierungs-Tags bei einer Suche _nicht_ zu entfernen. Dadurch wird die Suchgeschwindigkeit erhöht, jedoch werden Wörter, die durch Formatierungen unterbrochen werden, nicht gefunden (eine Suche nach `Zettelkasten` findet dann nicht `[f]Zettel[/f]kasten`). #### Behobene Fehler diff --git a/src/de/danielluedecke/zettelkasten/ZettelkastenView.form b/src/de/danielluedecke/zettelkasten/ZettelkastenView.form index e9da2492..6fbdc9d7 100644 --- a/src/de/danielluedecke/zettelkasten/ZettelkastenView.form +++ b/src/de/danielluedecke/zettelkasten/ZettelkastenView.form @@ -1936,11 +1936,32 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/de/danielluedecke/zettelkasten/ZettelkastenView.java b/src/de/danielluedecke/zettelkasten/ZettelkastenView.java index f90a5499..451ab626 100644 --- a/src/de/danielluedecke/zettelkasten/ZettelkastenView.java +++ b/src/de/danielluedecke/zettelkasten/ZettelkastenView.java @@ -9965,12 +9965,28 @@ public void findWithRating() { findEntryWithout(Constants.SEARCH_WITH_RATINGS); } /** - * Starts a search request and finds entries that have notbeen rated. + * Starts a search request and finds entries that have not been rated. */ @Action(enabledProperty = "moreEntriesAvailable") public void findWithoutRating() { findEntryWithout(Constants.SEARCH_WITHOUT_RATINGS); } + /** + * Starts a search request and finds entries that have no + * manual links. + */ + @Action(enabledProperty = "moreEntriesAvailable") + public void findWithoutManualLinks() { + findEntryWithout(Constants.SEARCH_WITHOUT_MANUAL_LINKS); + } + /** + * Starts a search request and finds entries that are part of + * any note sequence. + */ + @Action(enabledProperty = "moreEntriesAvailable") + public void findLuhmannAny() { + findEntryWithout(Constants.SEARCH_IS_ANY_LUHMANN); + } /** * Starts a search request and finds entries that are top-level * trailing entries (follower). @@ -11587,7 +11603,10 @@ public String getToolTipText(MouseEvent evt) { jSeparator75 = new javax.swing.JSeparator(); findEntriesWithoutRemarks = new javax.swing.JMenuItem(); findEntriesWithRemarks = new javax.swing.JMenuItem(); + jSeparator106 = new javax.swing.JPopupMenu.Separator(); + findEntriesWithoutManualLinks = new javax.swing.JMenuItem(); jSeparator65 = new javax.swing.JPopupMenu.Separator(); + findEntriesAnyLuhmann = new javax.swing.JMenuItem(); findEntriesTopLevelLuhmann = new javax.swing.JMenuItem(); jSeparator110 = new javax.swing.JSeparator(); findEntriesWithRatings = new javax.swing.JMenuItem(); @@ -13036,9 +13055,20 @@ public boolean isCellEditable(int rowIndex, int columnIndex) { findEntriesWithRemarks.setName("findEntriesWithRemarks"); // NOI18N findEntryWithout.add(findEntriesWithRemarks); + jSeparator106.setName("jSeparator106"); // NOI18N + findEntryWithout.add(jSeparator106); + + findEntriesWithoutManualLinks.setAction(actionMap.get("findWithoutManualLinks")); // NOI18N + findEntriesWithoutManualLinks.setName("findEntriesWithoutManualLinks"); // NOI18N + findEntryWithout.add(findEntriesWithoutManualLinks); + jSeparator65.setName("jSeparator65"); // NOI18N findEntryWithout.add(jSeparator65); + findEntriesAnyLuhmann.setAction(actionMap.get("findLuhmannAny")); // NOI18N + findEntriesAnyLuhmann.setName("findEntriesAnyLuhmann"); // NOI18N + findEntryWithout.add(findEntriesAnyLuhmann); + findEntriesTopLevelLuhmann.setAction(actionMap.get("findLuhmannParent")); // NOI18N findEntriesTopLevelLuhmann.setName("findEntriesTopLevelLuhmann"); // NOI18N findEntryWithout.add(findEntriesTopLevelLuhmann); @@ -14622,6 +14652,7 @@ private void initViewMenuLinks() { private javax.swing.JMenuItem exportMenuItem; private javax.swing.JMenu fileMenu; private javax.swing.JMenuItem findDoubleEntriesItem; + private javax.swing.JMenuItem findEntriesAnyLuhmann; private javax.swing.JMenuItem findEntriesFromCreatedTimestamp; private javax.swing.JMenuItem findEntriesFromEditedTimestamp; private javax.swing.JMenuItem findEntriesTopLevelLuhmann; @@ -14630,6 +14661,7 @@ private void initViewMenuLinks() { private javax.swing.JMenuItem findEntriesWithRemarks; private javax.swing.JMenuItem findEntriesWithoutAuthors; private javax.swing.JMenuItem findEntriesWithoutKeywords; + private javax.swing.JMenuItem findEntriesWithoutManualLinks; private javax.swing.JMenuItem findEntriesWithoutRatings; private javax.swing.JMenuItem findEntriesWithoutRemarks; private javax.swing.JMenu findEntryKeywordsMenu; @@ -14713,6 +14745,7 @@ private void initViewMenuLinks() { private javax.swing.JSeparator jSeparator103; private javax.swing.JSeparator jSeparator104; private javax.swing.JSeparator jSeparator105; + private javax.swing.JPopupMenu.Separator jSeparator106; private javax.swing.JSeparator jSeparator107; private javax.swing.JPopupMenu.Separator jSeparator108; private javax.swing.JSeparator jSeparator109; diff --git a/src/de/danielluedecke/zettelkasten/database/Daten.java b/src/de/danielluedecke/zettelkasten/database/Daten.java index 06dc8470..977d9b45 100644 --- a/src/de/danielluedecke/zettelkasten/database/Daten.java +++ b/src/de/danielluedecke/zettelkasten/database/Daten.java @@ -3942,7 +3942,7 @@ public int[] getLuhmannNumbersAsInteger(int pos) { * * @param pos the position of the entry which manual links we want to have * @return an integer array containing the entry-numbers where the current - * entry refers to, or null if no entry-numbers exist... + * entry refers to, or {@code null} if no entry-numbers exist... */ public int[] getManualLinks(int pos) { // get Manual Links as String Array @@ -7626,6 +7626,77 @@ public int[] getAllLuhmannNumbers(int zettelpos) { return arr; } + /** + * This method retrieves all notes (resp. their ID) in the Zettelkasten that are part of a + * note sequence, i.e. which are top level notes in a note sequence or + * which have sub-ordinated notes, and returns the index numbers as integer array. + *
Caution! The position {@code zettelpos} is a value from + * 1 to {@link #getCount(int) getCount()} - in contrary to usual + * array handling where the range is from 0 to (size-1). + * + * @return all note-IDs in the Zettelkasten that are part of a note sequence, + * as integer array + */ + public List getAllLuhmannNumbers() { + List luhmannNumbers = new ArrayList<>(); + // iterate data base + for (int cnt = 1; cnt <= getCount(Daten.ZKNCOUNT); cnt++) { + // does entry have any followers / note sequences? + if (hasLuhmannNumbers(cnt)) { + // if yes, get all note sequences + int[] curnum = getLuhmannNumbersAsInteger(cnt); + // iterate all note sequence IDs + for (int cn : curnum) { + // check if we already added that ID + if (!luhmannNumbers.contains(cn)) { + // if not, add it now + luhmannNumbers.add(cn); + } + } + // now add the current "parent" note as well + if (!luhmannNumbers.contains(cnt)) { + // if not, add it now + luhmannNumbers.add(cnt); + } + } + } + // return result + return luhmannNumbers; + } + + /** + * This method retrieves all notes (resp. their ID) in the Zettelkasten that are part of a + * note sequence, i.e. which are top level notes in a note sequence or + * which have sub-ordinated notes, and returns the index numbers as integer array. + *
Caution! The position {@code zettelpos} is a value from + * 1 to {@link #getCount(int) getCount()} - in contrary to usual + * array handling where the range is from 0 to (size-1). + * + * @return all note-IDs in the Zettelkasten that are part of a note sequence, + * as integer array + */ + public List getAllManualLinks() { + List manualLinkNumbers = new ArrayList<>(); + // iterate data base + for (int cnt = 1; cnt <= getCount(Daten.ZKNCOUNT); cnt++) { + // get manual links + int[] curnum = getManualLinks(cnt); + // check if note has any manual links + if (curnum != null) { + // iterate all note sequence IDs + for (int cn : curnum) { + // check if we already added that ID + if (!manualLinkNumbers.contains(cn)) { + // if not, add it now + manualLinkNumbers.add(cn); + } + } + } + } + // return result + return manualLinkNumbers; + } + /** * This method checks whether the entry {@code zettelpos} has follower / * trails / luhmann numbers or not. diff --git a/src/de/danielluedecke/zettelkasten/resources/SearchResultsFrame_en_GB.properties b/src/de/danielluedecke/zettelkasten/resources/SearchResultsFrame_en_GB.properties index 78745e9d..ec32d677 100644 --- a/src/de/danielluedecke/zettelkasten/resources/SearchResultsFrame_en_GB.properties +++ b/src/de/danielluedecke/zettelkasten/resources/SearchResultsFrame_en_GB.properties @@ -12,8 +12,8 @@ paste.Action.shortDescription=Pastes the current clipboard-content toggleHighlightResults.Action.text=Highlight find terms toggleHighlightResults.Action.shortDescription=Highlights the find terms in a different colour -editEntry.Action.text=Edit entry ... -editEntry.Action.shortDescription=Opens a window to edit the displayed entry +editEntry.Action.text=Edit note ... +editEntry.Action.shortDescription=Opens a window to edit the displayed note removeSearchResult.Action.text=Remove search result removeSearchResult.Action.shortDescription=Completely removes the results of an entire search request @@ -25,19 +25,19 @@ closeWindow.Action.text=Close closeWindow.Action.shortDescription=Closes the window addToDesktop.Action.text=Add to outliner ... -addToDesktop.Action.shortDescription=Adds the selected entries to the outliner +addToDesktop.Action.shortDescription=Adds the selected notes to the outliner addToBookmarks.Action.text=Add Bookmarks -addToBookmarks.Action.shortDescription=Adds the selected entries to the bookmark-list +addToBookmarks.Action.shortDescription=Adds the selected notes to the bookmark-list -selectAll.Action.shortDescription=Selects all entries in the search results list +selectAll.Action.shortDescription=Selects all notes in the search results list selectAll.Action.text=Select all addToLuhmann.Action.text=Add note sequences -addToLuhmann.Action.shortDescription=Adds the selected entries as note sequences to the current visible entry in the main window +addToLuhmann.Action.shortDescription=Adds the selected notes as note sequences to the current visible note in the main window addToManLinks.Action.text=Add cross references -addToManLinks.Action.shortDescription=Adds selected entries as cross references to the current visible entry in the main window +addToManLinks.Action.shortDescription=Adds selected notes as cross references to the current visible note in the main window viewFullScreen.Action.text=Fullscreen viewFullScreen.Action.shortDescription=Switches to full screen mode. Press Escape to exit. @@ -48,11 +48,11 @@ showHighlightSettings.Action.shortDescription=Changes the colour, font size and removeAllSearchResults.Action.text=Remove all search results removeAllSearchResults.Action.shortDescription=Removes all search results from all search requests -showEntryImmediately.Action.text=Display entry immediately -showEntryImmediately.Action.shortDescription=Displays the selected entry immediately in the main window +showEntryImmediately.Action.text=Display note immediately +showEntryImmediately.Action.shortDescription=Displays the selected note immediately in the main window -deleteEntryComplete.Action.text=Completely remove entry -deleteEntryComplete.Action.shortDescription=Completely removes the entry not only from the search results list, but also from the Zettelkasten database +deleteEntryComplete.Action.text=Completely remove note +deleteEntryComplete.Action.shortDescription=Completely removes the note not only from the search results list, but also from the Zettelkasten database showLongDesc.Action.text=Detailed search description ... showLongDesc.Action.shortDescription=Shows a detailed description of the search requests and provides information on search characteristics @@ -67,7 +67,7 @@ filterAuthors.Action.text=for authors filterAuthors.Action.shortDescription=Filters the current search results according to certain author-values jTableResults.columnModel.title1=Title -jTableResults.columnModel.title0=Entry +jTableResults.columnModel.title0=Note searchFileMenu.text=File searchEditMenu.text=Edit @@ -108,7 +108,7 @@ errLinkUnsopportedTitle=Opening attachments not supported errLinkSyntaxMsg=The website's URL has no valid syntax.

Therefore, the website could not be opened. errLinkSyntaxTitle=Invalid URL -errNothingFoundMsg=There are no entries that match your search term. +errNothingFoundMsg=There are no notes that match your search term. errNothingFoundTitle=Nothing found addKeywordsToEntriesTitle=Add keywords @@ -119,37 +119,37 @@ fullScreenNotSupported=Full-screen mode is not supported on your system searchSearchMenu.text=Find newSearchFromSelection.Action.text=Textselection -newSearchFromSelection.Action.shortDescription=Starts a new search in all entries for the selected text +newSearchFromSelection.Action.shortDescription=Starts a new search in all notes for the selected text newSearchFromAuthor.Action.text=Authors -newSearchFromAuthor.Action.shortDescription=Starts a new search for entries that contain the current author-value +newSearchFromAuthor.Action.shortDescription=Starts a new search for notes that contain the current author-value newSearchFromKeywordsLogOr.Action.text=Keywords (logical-or) -newSearchFromKeywordsLogOr.Action.shortDescription=Starts a new search for entries with at least one of the selected keywords +newSearchFromKeywordsLogOr.Action.shortDescription=Starts a new search for notes with at least one of the selected keywords newSearchFromKeywordsLogAnd.Action.text=Keywords (logical-and) -newSearchFromKeywordsLogAnd.Action.shortDescription=Starts a new search for entries that contain all of the selected keywords -newSearchFromKeywordsLogNot.Action.shortDescription=Starts a new search for entries that don't contain any of the selected keywords +newSearchFromKeywordsLogAnd.Action.shortDescription=Starts a new search for notes that contain all of the selected keywords +newSearchFromKeywordsLogNot.Action.shortDescription=Starts a new search for notes that don't contain any of the selected keywords newSearchFromKeywordsLogNot.Action.text=Keywords (exclusion) -duplicateEntry.Action.text=Duplicate entry -duplicateEntry.Action.shortDescription=Duplicates the currently displayed entry and adds it to the end of the database +duplicateEntry.Action.text=Duplicate note +duplicateEntry.Action.shortDescription=Duplicates the currently displayed note and adds it to the end of the database exportEntries.Action.text=Export exportEntries.Action.shortDescription=Exports the current search results to a file -addKeywordsToEntries.Action.shortDescription=Adds keywords to all selected entries at once +addKeywordsToEntries.Action.shortDescription=Adds keywords to all selected notes at once addKeywordsToEntries.Action.text=Add keywords -addAuthorsToEntries.Action.shortDescription=Adds author-values to all selected entries at once +addAuthorsToEntries.Action.shortDescription=Adds author-values to all selected notes at once addAuthorsToEntries.Action.text=Add authors findAndReplace.Action.text=Replace -findAndReplace.Action.shortDescription=Finds a search term in the selected entries and replaces them by the replace term +findAndReplace.Action.shortDescription=Finds a search term in the selected notes and replaces them by the replace term duplicateSearch.Action.text=Duplicate search results duplicateSearch.Action.shortDescription=Duplicates the current search result and adds it under a new description to the list of search results -incorrectNestedTagsText=Warning!

This entry contains irregular nested formatting tags!

Usually this happens when the centre-text-alignment or margin-formatting was used incorrectly.

Please edit the entry and fix the wrong format-tags.

In case you are not sure how to do this, please send the error-log (see Zettelkasten-Wiki: Log-Datei anzeigen) and the entry's content (copy content from the textfield from the edit-window!) to the author. +incorrectNestedTagsText=Warning!

This note contains irregular nested formatting tags!

Usually this happens when the centre-text-alignment or margin-formatting was used incorrectly.

Please edit the note and fix the wrong format-tags.

In case you are not sure how to do this, please send the error-log (see Zettelkasten-Wiki: Log-Datei anzeigen) and the note's content (copy content from the textfield from the edit-window!) to the author. jTableResults.columnModel.title2=Created jTableResults.columnModel.title3=Modified @@ -157,10 +157,10 @@ jTableResults.columnModel.title4=Rating jTableResults.columnModel.title5=Outliner filterTopLevelLuhmann.Action.text=Find top level note in sequence -filterTopLevelLuhmann.Action.shortDescription=Finds all top level entries of note sequences that are within the current search results. +filterTopLevelLuhmann.Action.shortDescription=Finds all top level notes of note sequences that are within the current search results. -showEntryInDesktop.Action.shortDescription=Opens the outliner window and shows the related outliner of the selected entry. -showEntryInDesktop.Action.text=Show outliner of selected entry +showEntryInDesktop.Action.shortDescription=Opens the outliner window and shows the related outliner of the selected note. +showEntryInDesktop.Action.text=Show outliner of selected note -switchLayout.Action.shortDescription=Places the search results list either left to or above the entry's detail view. +switchLayout.Action.shortDescription=Places the search results list either left to or above the note's detail view. switchLayout.Action.text=Align window elements diff --git a/src/de/danielluedecke/zettelkasten/resources/ZettelkastenView.properties b/src/de/danielluedecke/zettelkasten/resources/ZettelkastenView.properties index f49592ee..d3527162 100644 --- a/src/de/danielluedecke/zettelkasten/resources/ZettelkastenView.properties +++ b/src/de/danielluedecke/zettelkasten/resources/ZettelkastenView.properties @@ -934,3 +934,7 @@ setLuhmannLevel5.Action.shortDescription=Zeigt alle Folgezettel bis zur f\u00fcn setLuhmannLevel5.Action.text=5 viewMenuLuhmannShowLevel.text=Anzahl der sichtbaren Ebenen +findLuhmannAny.Action.shortDescription=Sucht alle Zettel, die Ausgangs- oder Folgezettel sind. +findLuhmannAny.Action.text=Folgezettel +findWithoutManualLinks.Action.shortDescription=Sucht alle Eintr\u00e4ge, die keine Querverweise enthalten (und auf die nicht verwiesen wird). +findWithoutManualLinks.Action.text=ohne Querverweise diff --git a/src/de/danielluedecke/zettelkasten/resources/ZettelkastenView_en_GB.properties b/src/de/danielluedecke/zettelkasten/resources/ZettelkastenView_en_GB.properties index 3c6e6459..7a36b2da 100644 --- a/src/de/danielluedecke/zettelkasten/resources/ZettelkastenView_en_GB.properties +++ b/src/de/danielluedecke/zettelkasten/resources/ZettelkastenView_en_GB.properties @@ -793,4 +793,8 @@ setLuhmannLevel4.Action.text=4 setLuhmannLevel5.Action.shortDescription=Shows only note sequences down to fifth level setLuhmannLevel5.Action.text=5 -viewMenuLuhmannShowLevel.text=Visible levels \ No newline at end of file +viewMenuLuhmannShowLevel.text=Visible levels +findLuhmannAny.Action.shortDescription=Finds all notes that are part of a note sequence, including top-level notes. +findLuhmannAny.Action.text=Note sequences +findWithoutManualLinks.Action.shortDescription=Finds all notes that have no cross references, nor being referenced by other notes. +findWithoutManualLinks.Action.text=without cross references diff --git a/src/de/danielluedecke/zettelkasten/tasks/StartSearchTask.java b/src/de/danielluedecke/zettelkasten/tasks/StartSearchTask.java index 055f0b59..9b5be89d 100644 --- a/src/de/danielluedecke/zettelkasten/tasks/StartSearchTask.java +++ b/src/de/danielluedecke/zettelkasten/tasks/StartSearchTask.java @@ -861,6 +861,62 @@ else if (Constants.LOG_OR == logical) { break; + // + // here starts a search for follower (luhmann) entries, i.e. + // entries that do have a parent-trail entry + // + case Constants.SEARCH_IS_ANY_LUHMANN: + // retrieve all note sequence IDs + finalresults = dataObj.getAllLuhmannNumbers(); + // finally, check whether we have any searchresults at all... + if (finalresults != null && finalresults.size() > 0) { + // create search results array, create search description and + // add search results to the search-data-class. + prepareExtraSearchResults(finalresults, resourceMap.getString("searchInLuhmann"), Constants.SEARCH_LUHMANN); + } else { + results = null; + } + + break; + + // + // here starts a search for follower (luhmann) entries, i.e. + // entries that do have a parent-trail entry + // + case Constants.SEARCH_WITHOUT_MANUAL_LINKS: + // init result array + finalresults = new ArrayList<>(); + // get all manual link IDs + List alllinksresult = dataObj.getAllManualLinks(); + // check if we have any values + if (alllinksresult != null && alllinksresult.size() > 0) { + // if yes, we need to remove these from all search entries + for (int i : searchEntries) { + // is current note ID a manual link? + if (!alllinksresult.contains(i)) { + // if not, add it + finalresults.add(i); + } + } + } else { + // if we don't have any manual links, all notes are + // part of the search result + for (int i : searchEntries) { + finalresults.add(i); + } + } + + // finally, check whether we have any searchresults at all... + if (finalresults.size() > 0) { + // create search results array, create search description and + // add search results to the search-data-class. + prepareExtraSearchResults(finalresults, resourceMap.getString("searchNoManLinks"), Constants.SEARCH_LUHMANN); + } else { + results = null; + } + + break; + // // here starts a search for entries without remarks // @@ -894,7 +950,7 @@ else if (Constants.LOG_OR == logical) { break; - // + // // here starts a search for entries *with* remarks // case Constants.SEARCH_WITH_REMARKS: @@ -929,7 +985,7 @@ else if (Constants.LOG_OR == logical) { break; - // + // // here starts a search for entries with attachments // case Constants.SEARCH_WITH_ATTACHMENTS: @@ -962,7 +1018,7 @@ else if (Constants.LOG_OR == logical) { break; - // + // // here starts a search for entries with/out ratings // case Constants.SEARCH_WITH_RATINGS: @@ -1015,7 +1071,7 @@ else if (Constants.SEARCH_WITHOUT_RATINGS == typeOfSearch) { break; - // + // // here starts a search for entries with attachments // case Constants.SEARCH_WITH_CREATED_TIME: diff --git a/src/de/danielluedecke/zettelkasten/tasks/resources/StartSearchTask.properties b/src/de/danielluedecke/zettelkasten/tasks/resources/StartSearchTask.properties index 83e45988..7fed8e9c 100644 --- a/src/de/danielluedecke/zettelkasten/tasks/resources/StartSearchTask.properties +++ b/src/de/danielluedecke/zettelkasten/tasks/resources/StartSearchTask.properties @@ -37,3 +37,4 @@ searchWithTimeEdited=bearbeitet wurden #NOI18N searchRatings=Zettel mit Bewertung searchNoRatings=Zettel ohne Bewertung +searchNoManLinks=Zettel ohne Querverweise \ No newline at end of file diff --git a/src/de/danielluedecke/zettelkasten/tasks/resources/StartSearchTask_en_GB.properties b/src/de/danielluedecke/zettelkasten/tasks/resources/StartSearchTask_en_GB.properties index ed51dd63..d0092486 100644 --- a/src/de/danielluedecke/zettelkasten/tasks/resources/StartSearchTask_en_GB.properties +++ b/src/de/danielluedecke/zettelkasten/tasks/resources/StartSearchTask_en_GB.properties @@ -25,15 +25,15 @@ searchInLinksContent=Attachments' content searchInRemarks=Remarks searchInLuhmannParents=Top level note in a sequence searchInLuhmann=Note sequences -searchNoAuthors=Entries without authors -searchNoKeywords=Entries without keywords -searchNoRemarks=Entries without remarks -searchWithRemarks=Entries with remarks -searchWithAttachments=Entries with attachments -searchWithTimeMsg=Entries between the time period from +searchNoAuthors=Notes without authors +searchNoKeywords=Notes without keywords +searchNoRemarks=Notes without remarks +searchWithRemarks=Notes with remarks +searchWithAttachments=Notes with attachments +searchWithTimeMsg=Notes between the time period from searchWithTimeTo=to searchWithTimeCreated=(creation date) searchWithTimeEdited=(changed date) -searchRatings=Rated entries -searchNoRatings=Non-rated entries - +searchRatings=Rated notes +searchNoRatings=Non-rated notes +searchNoManLinks=Notes without cross references \ No newline at end of file diff --git a/src/de/danielluedecke/zettelkasten/util/Constants.java b/src/de/danielluedecke/zettelkasten/util/Constants.java index 36c59efd..4151a27e 100644 --- a/src/de/danielluedecke/zettelkasten/util/Constants.java +++ b/src/de/danielluedecke/zettelkasten/util/Constants.java @@ -472,6 +472,17 @@ public class Constants { * (trailing entries, Folgezettel) */ public static final int SEARCH_IS_LUHMANN_PARENT = 12; + /** + * indicates that user wants to search entries + * that are in a note sequence + * (trailing entries, Folgezettel) + */ + public static final int SEARCH_IS_ANY_LUHMANN = 13; + /** + * indicates that user wants to search entries + * without any manual links + */ + public static final int SEARCH_WITHOUT_MANUAL_LINKS = 14; /** * Indicates a logical-and-combined search */ diff --git a/src/de/danielluedecke/zettelkasten/util/resources/HtmlUbbUtil_en_GB.properties b/src/de/danielluedecke/zettelkasten/util/resources/HtmlUbbUtil_en_GB.properties index 228226c1..66e80cb9 100644 --- a/src/de/danielluedecke/zettelkasten/util/resources/HtmlUbbUtil_en_GB.properties +++ b/src/de/danielluedecke/zettelkasten/util/resources/HtmlUbbUtil_en_GB.properties @@ -4,7 +4,7 @@ HyperlinksHeader=Attachments NoAuthor=(no authors) deletedEntry=(deleted) -entryText=Entry +entryText=Note remarksText=Remarks authorsText=Authors attachmentsText=Attachments @@ -21,10 +21,10 @@ ratedCount=ratings activatedZettelWordCount=Words activatedZettelText=activated -zettelDesc=Entry +zettelDesc=Note crossRefText=Cross references isFollowerText=Parents: -clusterListText=Entries: +clusterListText=Notes: footnotePage=p. \ No newline at end of file diff --git a/test/zkn3_sample.zkn3 b/test/zkn3_sample.zkn3 old mode 100755 new mode 100644