├── .classpath ├── .gitignore ├── .mvn └── wrapper │ ├── MavenWrapperDownloader.java │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .project ├── LICENSE.md ├── README.md ├── bin ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.class │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── .npmrc ├── .prettierrc.js ├── .vscode │ ├── extensions.json │ └── settings.json ├── LICENSE.md ├── README.md ├── frontend │ └── themes │ │ └── atlassearchanalysis │ │ ├── main-layout.css │ │ ├── styles.css │ │ ├── theme.json │ │ └── views │ │ └── analysis-view.css ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom.xml ├── src │ └── main │ │ ├── java │ │ └── com │ │ │ └── mongodb │ │ │ └── application │ │ │ └── search │ │ │ └── analysis │ │ │ ├── Application.class │ │ │ └── views │ │ │ ├── MainLayout$MenuItemInfo$LineAwesomeIcon.class │ │ │ ├── MainLayout$MenuItemInfo.class │ │ │ ├── MainLayout.class │ │ │ ├── about │ │ │ └── AboutView.class │ │ │ └── analysis │ │ │ ├── AnalysisView$ExpirationDateField.class │ │ │ └── AnalysisView.class │ │ └── resources │ │ ├── META-INF │ │ └── resources │ │ │ ├── icons │ │ │ └── icon.png │ │ │ └── images │ │ │ └── empty-plant.png │ │ ├── application.properties │ │ └── banner.txt ├── tsconfig.json ├── types.d.ts └── webpack.config.js ├── frontend ├── generated │ ├── index.ts │ ├── theme-atlassearchanalysis.generated.js │ ├── theme.d.ts │ ├── theme.js │ ├── vaadin-featureflags.ts │ └── vaadin.ts ├── index.html └── themes │ └── atlassearchanalysis │ ├── main-layout.css │ ├── styles.css │ ├── theme.json │ └── views │ └── analysis-view.css ├── index_camel.json ├── index_dms.json ├── index_html.json ├── index_regex.json ├── index_rev.json ├── index_roman.json ├── index_shingle.json ├── mvn ├── MavenWrapperDownloader.java ├── maven-wrapper.jar └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── package-lock.json ├── package.json ├── pom-cli.xml ├── pom.xml ├── src └── main │ ├── java │ ├── com │ │ └── mongodb │ │ │ └── atlas │ │ │ └── search │ │ │ └── analysis │ │ │ ├── Application.java │ │ │ ├── LuceneAnalyzer.java │ │ │ └── views │ │ │ ├── MainLayout.java │ │ │ ├── about │ │ │ └── AboutView.java │ │ │ └── analysis │ │ │ └── AnalysisView.java │ └── org │ │ └── apache │ │ └── lucene │ │ └── analysis │ │ ├── charfilter │ │ ├── AtlasSearchMappingCharFilter.java │ │ └── AtlasSearchMappingCharFilterFactory.java │ │ └── core │ │ └── AtlasSearchStopFilterFactory.java │ └── resources │ ├── META-INF │ └── resources │ │ ├── icons │ │ └── icon.png │ │ └── images │ │ ├── atlas-search.png │ │ ├── empty-plant.png │ │ └── mongodb-atlas.png │ ├── application.properties │ ├── banner.txt │ └── vaadin_app.png ├── tsconfig.json ├── types.d.ts ├── webpack.config.js └── webpack.generated.js /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | french.txt 3 | mappings.json 4 | .settings 5 | .project 6 | .classpath 7 | node_modules 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import java.io.*; 17 | import java.net.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.6"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is 26 | * provided. 27 | */ 28 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 29 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 30 | 31 | /** 32 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl 33 | * property to use instead of the default one. 34 | */ 35 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar"; 41 | 42 | /** 43 | * Name of the property which should be used to override the default download 44 | * url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a 54 | // custom 55 | // wrapperUrl parameter. 56 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 57 | String url = DEFAULT_DOWNLOAD_URL; 58 | if (mavenWrapperPropertyFile.exists()) { 59 | FileInputStream mavenWrapperPropertyFileInputStream = null; 60 | try { 61 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 62 | Properties mavenWrapperProperties = new Properties(); 63 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 64 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 65 | } catch (IOException e) { 66 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 67 | } finally { 68 | try { 69 | if (mavenWrapperPropertyFileInputStream != null) { 70 | mavenWrapperPropertyFileInputStream.close(); 71 | } 72 | } catch (IOException e) { 73 | // Ignore ... 74 | } 75 | } 76 | } 77 | System.out.println("- Downloading from: " + url); 78 | 79 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 80 | if (!outputFile.getParentFile().exists()) { 81 | if (!outputFile.getParentFile().mkdirs()) { 82 | System.out.println( 83 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 84 | } 85 | } 86 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 87 | try { 88 | downloadFileFromURL(url, outputFile); 89 | System.out.println("Done"); 90 | System.exit(0); 91 | } catch (Throwable e) { 92 | System.out.println("- Error downloading"); 93 | e.printStackTrace(); 94 | System.exit(1); 95 | } 96 | } 97 | 98 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 99 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 100 | String username = System.getenv("MVNW_USERNAME"); 101 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 102 | Authenticator.setDefault(new Authenticator() { 103 | @Override 104 | protected PasswordAuthentication getPasswordAuthentication() { 105 | return new PasswordAuthentication(username, password); 106 | } 107 | }); 108 | } 109 | URL website = new URL(urlString); 110 | ReadableByteChannel rbc; 111 | rbc = Channels.newChannel(website.openStream()); 112 | FileOutputStream fos = new FileOutputStream(destination); 113 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 114 | fos.close(); 115 | rbc.close(); 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | atlas.search.analysis 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.m2e.core.maven2Builder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.m2e.core.maven2Nature 22 | 23 | 24 | 25 | 1631303670482 26 | 27 | 30 28 | 29 | org.eclipse.core.resources.regexFilterMatcher 30 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Notice: Repository Deprecation 2 | This repository is deprecated and no longer actively maintained. It contains outdated code examples or practices that do not align with current MongoDB best practices. While the repository remains accessible for reference purposes, we strongly discourage its use in production environments. 3 | Users should be aware that this repository will not receive any further updates, bug fixes, or security patches. This code may expose you to security vulnerabilities, compatibility issues with current MongoDB versions, and potential performance problems. Any implementation based on this repository is at the user's own risk. 4 | For up-to-date resources, please refer to the [MongoDB Developer Center](https://mongodb.com/developer). 5 | 6 | 7 | # Atlas/Lucene Search Analysis 8 | 9 | ## Introduction 10 | 11 | Atlas Search uses [Lucene Analyzers](https://docs.atlas.mongodb.com/reference/atlas-search/analyzers/) to control how the index sets search terms, e.g., where to break up word groupings and whether to consider punctuation. However, without an intimate knowledge of the various Lucene Analyzers, it can be difficult to select the appropriate analyzer for a given field when creating a search index. Inspired by the [Analysis Screen](https://lucene.apache.org/solr/guide/8_6/analysis-screen.html) in Apache Solr, this utility provides two simple ways -- a CLI and a UI -- to test how various analyzers will process a given text. 12 | 13 | **Note:** see this [Atlas feature request](https://feedback.mongodb.com/forums/924868-atlas-search/suggestions/41501065-analzye-endpoint-or-analysis-screen) 14 | 15 | ## Build 16 | 17 | The UI for this tool is implemented as a [Vaadin](https://vaadin.com/) web application. The CLI is implemented as a simple POJO. To build these tools, execute the command `mvn clean package` from the directory containing `pom.xml`. 18 | 19 | ## Run 20 | 21 | Use the command `mvnw -Dspring-boot.run.jvmArguments="-Dspring.devtools.restart.enabled=false"` from the directory containing `pom.xml` to launch the Web UI on port 8080. 22 | 23 | ![Web UI](src/main/resources/vaadin_app.png) 24 | 25 | Use the command `mvn -f pom-cli.xml exec:java -Dexec.args=""` with the appropriate options to run the CLI. Use the `-h` or `--help` options to see usage instructions. 26 | 27 | ```bash 28 | usage: mvn exec:java -Dexec.args="" 29 | -h, --help Prints this message 30 | -a, --analyzer Lucene analyzer to use (defaults to 'Standard'). 31 | Use 'list' for supported analyzer names. 32 | -d, --definition Index definition file containing custom analyzer 33 | -t, --text Input text to analyze 34 | -f, --file Input text file to analyze 35 | -l, --language Language code (used with '--analyzer=Language' 36 | only. Use 'list' for supported language codes. 37 | -n, --name Custom analyzer name 38 | -o, --operator Query operator to use (defaults to 'text'). Use 39 | 'list' for supported operator names. 40 | -k, --tokenizer Tokeniser to use with autocomplete operator 41 | (defaults to 'edgeGram'). Use 'list' for 42 | supported tokenizer names. 43 | -m, --minGrams Minimum number of characters per indexed sequence 44 | to use with autocomplete operator (defaults to 45 | '2'). 46 | -x, --maxGrams Maximum number of characters per indexed sequence 47 | to use with autocomplete operator (defaults to 48 | '3'). 49 | ``` 50 | 51 | You can also use `java -cp lib/ -jar /atlas-search-analysis-0.0.1.jar ` (Java 11 or later) to run the CLI. 52 | 53 | ## Examples 54 | 55 | ### Analyze text using the `lucene.simple` analyzer 56 | 57 | ```bash 58 | mvn -f pom-cli.xml -q exec:java -Dexec.args="-a simple -t 'hello my-name.is Roy/Kiesler'" 59 | Using org.apache.lucene.analysis.core.SimpleAnalyzer 60 | [hello] [my] [name] [is] [roy] [kiesler] 61 | ``` 62 | 63 | ### Analyze text using the `lucene.standard` analyzer 64 | 65 | ```bash 66 | mvn -f pom-cli.xml -q exec:java -Dexec.args="--analyzer standard --text 'hello my-name.is Roy/Kiesler'" 67 | Using org.apache.lucene.analysis.standard.StandardAnalyzer 68 | [hello] [my] [name.is] [roy] [kiesler] 69 | ``` 70 | 71 | ### Analyze text using the `lucene.whitespace` analyzer 72 | 73 | ```bash 74 | mvn -f pom-cli.xml -q exec:java -Dexec.args="--analyzer whitespace -t 'hello my-name.is Roy/Kiesler'" 75 | Using org.apache.lucene.analysis.core.WhitespaceAnalyzer 76 | [hello] [my-name.is] [Roy/Kiesler] 77 | ``` 78 | 79 | ### Analyze text using the `lucene.language` English analyzer 80 | 81 | ```bash 82 | mvn -f pom-cli.xml -q exec:java -Dexec.args="--analyzer language --language en --text 'running a race'" 83 | Using org.apache.lucene.analysis.en.EnglishAnalyzer 84 | [run] [race] 85 | ``` 86 | 87 | ### Analyze a text file using the `lucene.language` French analyzer 88 | 89 | ```bash 90 | cat <> french.txt 91 | bonjour je m'appelle Roy Kiesler 92 | EOF 93 | 94 | mvn -q exec:java -Dexec.args="-a language -l fr -f french.txt" 95 | Using org.apache.lucene.analysis.fr.FrenchAnalyzer 96 | [bonjou] [apel] [roy] [kiesl] 97 | ``` 98 | 99 | ### Analyze text using a custom analyzer 100 | 101 | **Sample 1** 102 | 103 | ```bash 104 | mvn -f pom-cli.xml -q exec:java -Dexec.args="-a custom -t 'ROCKY II is better than Rocky V' -d index_roman.json -n romanAnalyzer" 105 | Using org.apache.lucene.analysis.custom.CustomAnalyzer 106 | [rocki] [2] [better] [rocki] [5] 107 | ``` 108 | 109 | **Sample 2** 110 | 111 | ```bash 112 | mvn -f pom-cli.xml -q exec:java -Dexec.args="-a custom -t '

This is an HTML test

' -d index_html.json -n htmlStrippingAnalyzer" 113 | Using org.apache.lucene.analysis.custom.CustomAnalyzer 114 | [p] [This] [is] [an] [a] [href] [foo.com] [HTML] [a] [test] [p] 115 | ``` 116 | 117 | ### Analyze text using autocomplete 118 | 119 | **Sample 1** 120 | 121 | ```bash 122 | mvn -f pom-cli.xml exec:java -Dexec.args="-t 'Ribeira Charming Duplex' -o autocomplete" 123 | Using org.apache.lucene.analysis.custom.CustomAnalyzer 124 | Autocomplete - nGram, minGram(2), maxGram(3) 125 | [Ri] [Rib] [ib] [ibe] [be] [bei] [ei] [eir] [ir] [ira] [ra] [ra ] [a ] [a C] [ C] [ Ch] [Ch] [Cha] [ha] [har] [ar] [arm] [rm] [rmi] [mi] [min] [in] [ing] [ng] [ng ] [g ] [g D] [ D] [ Du] [Du] [Dup] [up] [upl] [pl] [ple] [le] [lex] [ex] 126 | ``` 127 | 128 | **Sample 2** 129 | 130 | ```bash 131 | mvn -f pom-cli.xml exec:java -Dexec.args="-t 'Ribeira Charming Duplex' -o autocomplete -k edgeGram -m 2 -x 15" 132 | Using org.apache.lucene.analysis.custom.CustomAnalyzer 133 | Autocomplete - edgeNGram, minGram(2), maxGram(15) 134 | [Ri] [Rib] [Ribe] [Ribei] [Ribeir] [Ribeira] [Ribeira ] [Ribeira C] [Ribeira Ch] [Ribeira Cha] [Ribeira Char] [Ribeira Charm] [Ribeira Charmi] [Ribeira Charmin] 135 | ``` 136 | -------------------------------------------------------------------------------- /bin/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | .idea/ 3 | .settings 4 | .project 5 | .classpath 6 | 7 | *.iml 8 | .DS_Store 9 | 10 | # The following files are generated/updated by vaadin-maven-plugin 11 | node_modules/ 12 | frontend/generated/ 13 | pnpmfile.js 14 | vite.generated.ts 15 | 16 | # Browser drivers for local integration tests 17 | drivers/ 18 | # Error screenshots generated by TestBench for failed integration tests 19 | error-screenshots/ 20 | webpack.generated.js 21 | -------------------------------------------------------------------------------- /bin/.mvn/wrapper/MavenWrapperDownloader.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/.mvn/wrapper/MavenWrapperDownloader.class -------------------------------------------------------------------------------- /bin/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /bin/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /bin/.npmrc: -------------------------------------------------------------------------------- 1 | # 2 | # NOTICE: this is an auto-generated file 3 | # 4 | # This file sets the default parameters for manual `pnpm install`. 5 | # 6 | shamefully-hoist=true 7 | -------------------------------------------------------------------------------- /bin/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | singleQuote: true, 3 | printWidth: 120, 4 | }; 5 | -------------------------------------------------------------------------------- /bin/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "runem.lit-plugin", 4 | "vscjava.vscode-java-pack", 5 | "pivotal.vscode-spring-boot" 6 | ], 7 | "unwantedRecommendations": [] 8 | } 9 | -------------------------------------------------------------------------------- /bin/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "lit-plugin.strict": true 3 | } 4 | -------------------------------------------------------------------------------- /bin/LICENSE.md: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /bin/README.md: -------------------------------------------------------------------------------- 1 | # Atlas Search Analysis 2 | 3 | This project can be used as a starting point to create your own Vaadin application with Spring Boot. 4 | It contains all the necessary configuration and some placeholder files to get you started. 5 | 6 | ## Running the application 7 | 8 | The project is a standard Maven project. To run it from the command line, 9 | type `mvnw` (Windows), or `./mvnw` (Mac & Linux), then open 10 | http://localhost:8080 in your browser. 11 | 12 | You can also import the project to your IDE of choice as you would with any 13 | Maven project. Read more on [how to import Vaadin projects to different 14 | IDEs](https://vaadin.com/docs/latest/flow/guide/step-by-step/importing) (Eclipse, IntelliJ IDEA, NetBeans, and VS Code). 15 | 16 | ## Deploying to Production 17 | 18 | To create a production build, call `mvnw clean package -Pproduction` (Windows), 19 | or `./mvnw clean package -Pproduction` (Mac & Linux). 20 | This will build a JAR file with all the dependencies and front-end resources, 21 | ready to be deployed. The file can be found in the `target` folder after the build completes. 22 | 23 | Once the JAR file is built, you can run it using 24 | `java -jar target/atlassearchanalysis-1.0-SNAPSHOT.jar` 25 | 26 | ## Project structure 27 | 28 | - `MainLayout.java` in `src/main/java` contains the navigation setup (i.e., the 29 | side/top bar and the main menu). This setup uses 30 | [App Layout](https://vaadin.com/components/vaadin-app-layout). 31 | - `views` package in `src/main/java` contains the server-side Java views of your application. 32 | - `views` folder in `frontend/` contains the client-side JavaScript views of your application. 33 | - `themes` folder in `frontend/` contains the custom CSS styles. 34 | 35 | ## Useful links 36 | 37 | - Read the documentation at [vaadin.com/docs](https://vaadin.com/docs). 38 | - Follow the tutorials at [vaadin.com/tutorials](https://vaadin.com/tutorials). 39 | - Watch training videos and get certified at [vaadin.com/learn/training](https://vaadin.com/learn/training). 40 | - Create new projects at [start.vaadin.com](https://start.vaadin.com/). 41 | - Search UI components and their usage examples at [vaadin.com/components](https://vaadin.com/components). 42 | - View use case applications that demonstrate Vaadin capabilities at [vaadin.com/examples-and-demos](https://vaadin.com/examples-and-demos). 43 | - Discover Vaadin's set of CSS utility classes that enable building any UI without custom CSS in the [docs](https://vaadin.com/docs/latest/ds/foundation/utility-classes). 44 | - Find a collection of solutions to common use cases in [Vaadin Cookbook](https://cookbook.vaadin.com/). 45 | - Find Add-ons at [vaadin.com/directory](https://vaadin.com/directory). 46 | - Ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/vaadin) or join our [Discord channel](https://discord.gg/MYFq5RTbBn). 47 | - Report issues, create pull requests in [GitHub](https://github.com/vaadin/platform). 48 | -------------------------------------------------------------------------------- /bin/frontend/themes/atlassearchanalysis/main-layout.css: -------------------------------------------------------------------------------- 1 | [slot='drawer'] { 2 | background-image: linear-gradient(0deg, var(--lumo-shade-5pct), var(--lumo-shade-5pct)); 3 | } 4 | 5 | [slot='drawer'] nav a { 6 | text-decoration: none; 7 | transition: color 140ms; 8 | } 9 | 10 | [slot='drawer'] nav a .la { 11 | margin-top: calc(var(--lumo-space-xs) * 0.5); 12 | } 13 | 14 | [slot='drawer'] nav a::before { 15 | border-radius: var(--lumo-border-radius); 16 | bottom: calc(var(--lumo-space-xs) * 0.5); 17 | content: ''; 18 | left: 0; 19 | position: absolute; 20 | right: 0; 21 | top: calc(var(--lumo-space-xs) * 0.5); 22 | transition: background-color 140ms; 23 | } 24 | 25 | [slot='drawer'] nav a[highlight] { 26 | color: var(--lumo-primary-text-color); 27 | } 28 | 29 | [slot='drawer'] nav a[highlight]::before { 30 | background-color: var(--lumo-primary-color-10pct); 31 | } 32 | 33 | [slot='drawer'] footer vaadin-context-menu { 34 | align-items: center; 35 | display: flex; 36 | } 37 | 38 | .menu-item-link { 39 | display: flex; 40 | margin-left: var(--lumo-space-s); 41 | margin-right: var(--lumo-space-s); 42 | padding: var(--lumo-space-s); 43 | position: relative; 44 | color: var(--lumo-secondary-text-color); 45 | } 46 | 47 | .menu-item-text { 48 | font-weight: 500; 49 | font-size: var(--lumo-font-size-s); 50 | } 51 | 52 | .menu-item-icon { 53 | margin-inline-end: var(--lumo-space-s); 54 | font-size: var(--lumo-font-size-l); 55 | } 56 | 57 | .view-title { 58 | margin: 0; 59 | font-size: var(--lumo-font-size-l); 60 | } 61 | 62 | .view-header { 63 | align-items: center; 64 | background-color: var(--lumo-base-color); 65 | border-bottom: 1px solid; 66 | border-color: var(--lumo-contrast-10pct); 67 | box-sizing: border-box; 68 | display: flex; 69 | height: var(--lumo-size-xl); 70 | width: 100%; 71 | } 72 | 73 | .view-toggle { 74 | color: var(--lumo-secondary-text-color); 75 | } 76 | 77 | .app-name { 78 | align-items: center; 79 | display: flex; 80 | height: var(--lumo-size-xl); 81 | margin: 0; 82 | padding-left: var(--lumo-space-m); 83 | padding-right: var(--lumo-space-m); 84 | font-size: var(--lumo-font-size-m); 85 | } 86 | 87 | .drawer-section { 88 | align-items: stretch; 89 | display: flex; 90 | flex-direction: column; 91 | max-height: 100%; 92 | min-height: 100%; 93 | } 94 | 95 | .menu-item-container { 96 | border-bottom: 1px solid; 97 | border-color: var(--lumo-contrast-10pct); 98 | flex-grow: 1; 99 | overflow: auto; 100 | } 101 | 102 | .navigation-list { 103 | list-style-type: none; 104 | margin: 0; 105 | padding: 0; 106 | } 107 | 108 | .footer { 109 | align-items: center; 110 | display: flex; 111 | margin-bottom: var(--lumo-space-s); 112 | margin-top: var(--lumo-space-s); 113 | padding-left: var(--lumo-space-m); 114 | padding-right: var(--lumo-space-m); 115 | padding-bottom: var(--lumo-space-xs); 116 | padding-top: var(--lumo-space-xs); 117 | } 118 | -------------------------------------------------------------------------------- /bin/frontend/themes/atlassearchanalysis/styles.css: -------------------------------------------------------------------------------- 1 | @import url('./main-layout.css'); 2 | @import url('./views/analysis-view.css'); 3 | @import url('line-awesome/dist/line-awesome/css/line-awesome.min.css'); -------------------------------------------------------------------------------- /bin/frontend/themes/atlassearchanalysis/theme.json: -------------------------------------------------------------------------------- 1 | { 2 | "lumoImports" : [ "typography", "color", "spacing", "badge", "utility" ] 3 | } -------------------------------------------------------------------------------- /bin/frontend/themes/atlassearchanalysis/views/analysis-view.css: -------------------------------------------------------------------------------- 1 | .analysis-view { 2 | display: block; 3 | margin: 0 auto; 4 | max-width: 1024px; 5 | padding: 0 var(--lumo-space-l); 6 | } 7 | .analysis-view .button-layout { 8 | margin-bottom: var(--lumo-space-l); 9 | margin-top: var(--lumo-space-m); 10 | } 11 | -------------------------------------------------------------------------------- /bin/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /bin/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /bin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "no-name", 3 | "license": "UNLICENSED", 4 | "dependencies": { 5 | "@polymer/iron-icon": "3.0.1", 6 | "@polymer/iron-iconset-svg": "3.0.1", 7 | "@polymer/iron-list": "3.1.0", 8 | "@polymer/iron-meta": "3.0.1", 9 | "@polymer/iron-resizable-behavior": "3.0.1", 10 | "@polymer/polymer": "3.4.1", 11 | "@vaadin/accordion": "23.0.4", 12 | "@vaadin/app-layout": "23.0.4", 13 | "@vaadin/avatar": "23.0.4", 14 | "@vaadin/avatar-group": "23.0.4", 15 | "@vaadin/board": "23.0.4", 16 | "@vaadin/bundles": "23.0.4", 17 | "@vaadin/button": "23.0.4", 18 | "@vaadin/charts": "23.0.4", 19 | "@vaadin/checkbox": "23.0.4", 20 | "@vaadin/checkbox-group": "23.0.4", 21 | "@vaadin/combo-box": "23.0.4", 22 | "@vaadin/common-frontend": "0.0.17", 23 | "@vaadin/component-base": "23.0.4", 24 | "@vaadin/confirm-dialog": "23.0.4", 25 | "@vaadin/context-menu": "23.0.4", 26 | "@vaadin/cookie-consent": "23.0.4", 27 | "@vaadin/crud": "23.0.4", 28 | "@vaadin/custom-field": "23.0.4", 29 | "@vaadin/date-picker": "23.0.4", 30 | "@vaadin/date-time-picker": "23.0.4", 31 | "@vaadin/details": "23.0.4", 32 | "@vaadin/dialog": "23.0.4", 33 | "@vaadin/email-field": "23.0.4", 34 | "@vaadin/field-base": "23.0.4", 35 | "@vaadin/field-highlighter": "23.0.2", 36 | "@vaadin/flow-frontend": "./target/flow-frontend", 37 | "@vaadin/form-layout": "23.0.4", 38 | "@vaadin/grid": "23.0.4", 39 | "@vaadin/grid-pro": "23.0.4", 40 | "@vaadin/horizontal-layout": "23.0.4", 41 | "@vaadin/icon": "23.0.4", 42 | "@vaadin/icons": "23.0.4", 43 | "@vaadin/input-container": "23.0.4", 44 | "@vaadin/integer-field": "23.0.4", 45 | "@vaadin/item": "23.0.4", 46 | "@vaadin/list-box": "23.0.4", 47 | "@vaadin/login": "23.0.4", 48 | "@vaadin/map": "23.0.4", 49 | "@vaadin/menu-bar": "23.0.4", 50 | "@vaadin/message-input": "23.0.4", 51 | "@vaadin/message-list": "23.0.4", 52 | "@vaadin/notification": "23.0.4", 53 | "@vaadin/number-field": "23.0.4", 54 | "@vaadin/password-field": "23.0.4", 55 | "@vaadin/polymer-legacy-adapter": "23.0.4", 56 | "@vaadin/progress-bar": "23.0.4", 57 | "@vaadin/radio-group": "23.0.4", 58 | "@vaadin/rich-text-editor": "23.0.4", 59 | "@vaadin/router": "1.7.4", 60 | "@vaadin/scroller": "23.0.4", 61 | "@vaadin/select": "23.0.4", 62 | "@vaadin/split-layout": "23.0.4", 63 | "@vaadin/tabs": "23.0.4", 64 | "@vaadin/text-area": "23.0.4", 65 | "@vaadin/text-field": "23.0.4", 66 | "@vaadin/time-picker": "23.0.4", 67 | "@vaadin/upload": "23.0.4", 68 | "@vaadin/vaadin-accordion": "23.0.4", 69 | "@vaadin/vaadin-app-layout": "23.0.4", 70 | "@vaadin/vaadin-avatar": "23.0.4", 71 | "@vaadin/vaadin-board": "23.0.4", 72 | "@vaadin/vaadin-button": "23.0.4", 73 | "@vaadin/vaadin-charts": "23.0.4", 74 | "@vaadin/vaadin-checkbox": "23.0.4", 75 | "@vaadin/vaadin-combo-box": "23.0.4", 76 | "@vaadin/vaadin-confirm-dialog": "23.0.4", 77 | "@vaadin/vaadin-context-menu": "23.0.4", 78 | "@vaadin/vaadin-cookie-consent": "23.0.4", 79 | "@vaadin/vaadin-crud": "23.0.4", 80 | "@vaadin/vaadin-custom-field": "23.0.4", 81 | "@vaadin/vaadin-date-picker": "23.0.4", 82 | "@vaadin/vaadin-date-time-picker": "23.0.4", 83 | "@vaadin/vaadin-details": "23.0.4", 84 | "@vaadin/vaadin-development-mode-detector": "2.0.5", 85 | "@vaadin/vaadin-dialog": "23.0.4", 86 | "@vaadin/vaadin-form-layout": "23.0.4", 87 | "@vaadin/vaadin-grid": "23.0.4", 88 | "@vaadin/vaadin-grid-pro": "23.0.4", 89 | "@vaadin/vaadin-icon": "23.0.4", 90 | "@vaadin/vaadin-icons": "23.0.4", 91 | "@vaadin/vaadin-item": "23.0.4", 92 | "@vaadin/vaadin-list-box": "23.0.4", 93 | "@vaadin/vaadin-list-mixin": "23.0.4", 94 | "@vaadin/vaadin-login": "23.0.4", 95 | "@vaadin/vaadin-lumo-styles": "23.0.4", 96 | "@vaadin/vaadin-material-styles": "23.0.4", 97 | "@vaadin/vaadin-menu-bar": "23.0.4", 98 | "@vaadin/vaadin-messages": "23.0.4", 99 | "@vaadin/vaadin-notification": "23.0.4", 100 | "@vaadin/vaadin-ordered-layout": "23.0.4", 101 | "@vaadin/vaadin-overlay": "23.0.4", 102 | "@vaadin/vaadin-progress-bar": "23.0.4", 103 | "@vaadin/vaadin-radio-button": "23.0.4", 104 | "@vaadin/vaadin-rich-text-editor": "23.0.4", 105 | "@vaadin/vaadin-select": "23.0.4", 106 | "@vaadin/vaadin-split-layout": "23.0.4", 107 | "@vaadin/vaadin-tabs": "23.0.4", 108 | "@vaadin/vaadin-template-renderer": "23.0.4", 109 | "@vaadin/vaadin-text-field": "23.0.4", 110 | "@vaadin/vaadin-themable-mixin": "23.0.4", 111 | "@vaadin/vaadin-time-picker": "23.0.4", 112 | "@vaadin/vaadin-upload": "23.0.4", 113 | "@vaadin/vaadin-usage-statistics": "2.1.2", 114 | "@vaadin/vaadin-virtual-list": "23.0.4", 115 | "@vaadin/vertical-layout": "23.0.4", 116 | "@vaadin/virtual-list": "23.0.4", 117 | "construct-style-sheets-polyfill": "3.0.4", 118 | "date-fns": "2.23.0", 119 | "lit": "2.1.4" 120 | }, 121 | "devDependencies": { 122 | "chokidar": "^3.5.0", 123 | "compression-webpack-plugin": "4.0.1", 124 | "css-loader": "5.2.7", 125 | "esbuild-loader": "2.15.1", 126 | "extra-watch-webpack-plugin": "1.0.3", 127 | "extract-loader": "5.1.0", 128 | "file-loader": "6.2.0", 129 | "fork-ts-checker-webpack-plugin": "6.2.1", 130 | "glob": "7.1.6", 131 | "html-webpack-plugin": "4.5.1", 132 | "lit-css-loader": "0.1.0", 133 | "loader-utils": "2.0.0", 134 | "typescript": "4.5.3", 135 | "webpack": "4.46.0", 136 | "webpack-cli": "4.9.2", 137 | "webpack-dev-server": "4.7.4", 138 | "webpack-merge": "4.2.2", 139 | "workbox-core": "6.5.0", 140 | "workbox-precaching": "6.5.0", 141 | "workbox-webpack-plugin": "6.5.0" 142 | }, 143 | "overrides": { 144 | "@vaadin/accordion": "$@vaadin/accordion", 145 | "@vaadin/app-layout": "$@vaadin/app-layout", 146 | "@vaadin/avatar": "$@vaadin/avatar", 147 | "@vaadin/avatar-group": "$@vaadin/avatar-group", 148 | "@vaadin/button": "$@vaadin/button", 149 | "@vaadin/checkbox": "$@vaadin/checkbox", 150 | "@vaadin/checkbox-group": "$@vaadin/checkbox-group", 151 | "@vaadin/combo-box": "$@vaadin/combo-box", 152 | "@vaadin/component-base": "$@vaadin/component-base", 153 | "@vaadin/context-menu": "$@vaadin/context-menu", 154 | "@vaadin/custom-field": "$@vaadin/custom-field", 155 | "@vaadin/date-picker": "$@vaadin/date-picker", 156 | "@vaadin/date-time-picker": "$@vaadin/date-time-picker", 157 | "@vaadin/details": "$@vaadin/details", 158 | "@vaadin/dialog": "$@vaadin/dialog", 159 | "@vaadin/email-field": "$@vaadin/email-field", 160 | "@vaadin/field-base": "$@vaadin/field-base", 161 | "@vaadin/field-highlighter": "$@vaadin/field-highlighter", 162 | "@vaadin/form-layout": "$@vaadin/form-layout", 163 | "@vaadin/grid": "$@vaadin/grid", 164 | "@vaadin/horizontal-layout": "$@vaadin/horizontal-layout", 165 | "@vaadin/icon": "$@vaadin/icon", 166 | "@vaadin/icons": "$@vaadin/icons", 167 | "@vaadin/input-container": "$@vaadin/input-container", 168 | "@vaadin/integer-field": "$@vaadin/integer-field", 169 | "@polymer/iron-icon": "$@polymer/iron-icon", 170 | "@polymer/iron-iconset-svg": "$@polymer/iron-iconset-svg", 171 | "@polymer/iron-list": "$@polymer/iron-list", 172 | "@polymer/iron-meta": "$@polymer/iron-meta", 173 | "@polymer/iron-resizable-behavior": "$@polymer/iron-resizable-behavior", 174 | "@vaadin/item": "$@vaadin/item", 175 | "@vaadin/list-box": "$@vaadin/list-box", 176 | "@vaadin/login": "$@vaadin/login", 177 | "@vaadin/menu-bar": "$@vaadin/menu-bar", 178 | "@vaadin/message-input": "$@vaadin/message-input", 179 | "@vaadin/message-list": "$@vaadin/message-list", 180 | "@vaadin/notification": "$@vaadin/notification", 181 | "@vaadin/number-field": "$@vaadin/number-field", 182 | "@vaadin/password-field": "$@vaadin/password-field", 183 | "@vaadin/polymer-legacy-adapter": "$@vaadin/polymer-legacy-adapter", 184 | "@vaadin/progress-bar": "$@vaadin/progress-bar", 185 | "@vaadin/radio-group": "$@vaadin/radio-group", 186 | "@vaadin/scroller": "$@vaadin/scroller", 187 | "@vaadin/select": "$@vaadin/select", 188 | "@vaadin/split-layout": "$@vaadin/split-layout", 189 | "@vaadin/tabs": "$@vaadin/tabs", 190 | "@vaadin/text-area": "$@vaadin/text-area", 191 | "@vaadin/text-field": "$@vaadin/text-field", 192 | "@vaadin/time-picker": "$@vaadin/time-picker", 193 | "@vaadin/upload": "$@vaadin/upload", 194 | "@vaadin/vaadin-accordion": "$@vaadin/vaadin-accordion", 195 | "@vaadin/vaadin-app-layout": "$@vaadin/vaadin-app-layout", 196 | "@vaadin/vaadin-avatar": "$@vaadin/vaadin-avatar", 197 | "@vaadin/vaadin-button": "$@vaadin/vaadin-button", 198 | "@vaadin/vaadin-checkbox": "$@vaadin/vaadin-checkbox", 199 | "@vaadin/vaadin-combo-box": "$@vaadin/vaadin-combo-box", 200 | "@vaadin/vaadin-context-menu": "$@vaadin/vaadin-context-menu", 201 | "@vaadin/vaadin-custom-field": "$@vaadin/vaadin-custom-field", 202 | "@vaadin/vaadin-date-picker": "$@vaadin/vaadin-date-picker", 203 | "@vaadin/vaadin-date-time-picker": "$@vaadin/vaadin-date-time-picker", 204 | "@vaadin/vaadin-details": "$@vaadin/vaadin-details", 205 | "@vaadin/vaadin-development-mode-detector": "$@vaadin/vaadin-development-mode-detector", 206 | "@vaadin/vaadin-dialog": "$@vaadin/vaadin-dialog", 207 | "@vaadin/vaadin-form-layout": "$@vaadin/vaadin-form-layout", 208 | "@vaadin/vaadin-grid": "$@vaadin/vaadin-grid", 209 | "@vaadin/vaadin-icon": "$@vaadin/vaadin-icon", 210 | "@vaadin/vaadin-icons": "$@vaadin/vaadin-icons", 211 | "@vaadin/vaadin-item": "$@vaadin/vaadin-item", 212 | "@vaadin/vaadin-list-box": "$@vaadin/vaadin-list-box", 213 | "@vaadin/vaadin-list-mixin": "$@vaadin/vaadin-list-mixin", 214 | "@vaadin/vaadin-login": "$@vaadin/vaadin-login", 215 | "@vaadin/vaadin-lumo-styles": "$@vaadin/vaadin-lumo-styles", 216 | "@vaadin/vaadin-material-styles": "$@vaadin/vaadin-material-styles", 217 | "@vaadin/vaadin-menu-bar": "$@vaadin/vaadin-menu-bar", 218 | "@vaadin/vaadin-messages": "$@vaadin/vaadin-messages", 219 | "@vaadin/vaadin-notification": "$@vaadin/vaadin-notification", 220 | "@vaadin/vaadin-ordered-layout": "$@vaadin/vaadin-ordered-layout", 221 | "@vaadin/vaadin-overlay": "$@vaadin/vaadin-overlay", 222 | "@vaadin/vaadin-progress-bar": "$@vaadin/vaadin-progress-bar", 223 | "@vaadin/vaadin-radio-button": "$@vaadin/vaadin-radio-button", 224 | "@vaadin/router": "$@vaadin/router", 225 | "@vaadin/vaadin-select": "$@vaadin/vaadin-select", 226 | "@vaadin/vaadin-split-layout": "$@vaadin/vaadin-split-layout", 227 | "@vaadin/vaadin-tabs": "$@vaadin/vaadin-tabs", 228 | "@vaadin/vaadin-template-renderer": "$@vaadin/vaadin-template-renderer", 229 | "@vaadin/vaadin-text-field": "$@vaadin/vaadin-text-field", 230 | "@vaadin/vaadin-themable-mixin": "$@vaadin/vaadin-themable-mixin", 231 | "@vaadin/vaadin-time-picker": "$@vaadin/vaadin-time-picker", 232 | "@vaadin/vaadin-upload": "$@vaadin/vaadin-upload", 233 | "@vaadin/vaadin-usage-statistics": "$@vaadin/vaadin-usage-statistics", 234 | "@vaadin/vaadin-virtual-list": "$@vaadin/vaadin-virtual-list", 235 | "@vaadin/vertical-layout": "$@vaadin/vertical-layout", 236 | "@vaadin/virtual-list": "$@vaadin/virtual-list", 237 | "@vaadin/board": "$@vaadin/board", 238 | "@vaadin/charts": "$@vaadin/charts", 239 | "@vaadin/confirm-dialog": "$@vaadin/confirm-dialog", 240 | "@vaadin/cookie-consent": "$@vaadin/cookie-consent", 241 | "@vaadin/crud": "$@vaadin/crud", 242 | "@vaadin/grid-pro": "$@vaadin/grid-pro", 243 | "@vaadin/rich-text-editor": "$@vaadin/rich-text-editor", 244 | "@vaadin/vaadin-board": "$@vaadin/vaadin-board", 245 | "@vaadin/vaadin-charts": "$@vaadin/vaadin-charts", 246 | "@vaadin/vaadin-confirm-dialog": "$@vaadin/vaadin-confirm-dialog", 247 | "@vaadin/vaadin-cookie-consent": "$@vaadin/vaadin-cookie-consent", 248 | "@vaadin/vaadin-crud": "$@vaadin/vaadin-crud", 249 | "@vaadin/vaadin-grid-pro": "$@vaadin/vaadin-grid-pro", 250 | "@vaadin/vaadin-rich-text-editor": "$@vaadin/vaadin-rich-text-editor", 251 | "@vaadin/bundles": "$@vaadin/bundles", 252 | "@vaadin/map": "$@vaadin/map", 253 | "@polymer/polymer": "$@polymer/polymer", 254 | "@vaadin/common-frontend": "$@vaadin/common-frontend", 255 | "construct-style-sheets-polyfill": "$construct-style-sheets-polyfill", 256 | "date-fns": "$date-fns", 257 | "lit": "$lit", 258 | "chokidar": "$chokidar" 259 | }, 260 | "vaadin": { 261 | "dependencies": { 262 | "@polymer/iron-icon": "3.0.1", 263 | "@polymer/iron-iconset-svg": "3.0.1", 264 | "@polymer/iron-list": "3.1.0", 265 | "@polymer/iron-meta": "3.0.1", 266 | "@polymer/iron-resizable-behavior": "3.0.1", 267 | "@polymer/polymer": "3.4.1", 268 | "@vaadin/accordion": "23.0.4", 269 | "@vaadin/app-layout": "23.0.4", 270 | "@vaadin/avatar": "23.0.4", 271 | "@vaadin/avatar-group": "23.0.4", 272 | "@vaadin/board": "23.0.4", 273 | "@vaadin/bundles": "23.0.4", 274 | "@vaadin/button": "23.0.4", 275 | "@vaadin/charts": "23.0.4", 276 | "@vaadin/checkbox": "23.0.4", 277 | "@vaadin/checkbox-group": "23.0.4", 278 | "@vaadin/combo-box": "23.0.4", 279 | "@vaadin/common-frontend": "0.0.17", 280 | "@vaadin/component-base": "23.0.4", 281 | "@vaadin/confirm-dialog": "23.0.4", 282 | "@vaadin/context-menu": "23.0.4", 283 | "@vaadin/cookie-consent": "23.0.4", 284 | "@vaadin/crud": "23.0.4", 285 | "@vaadin/custom-field": "23.0.4", 286 | "@vaadin/date-picker": "23.0.4", 287 | "@vaadin/date-time-picker": "23.0.4", 288 | "@vaadin/details": "23.0.4", 289 | "@vaadin/dialog": "23.0.4", 290 | "@vaadin/email-field": "23.0.4", 291 | "@vaadin/field-base": "23.0.4", 292 | "@vaadin/field-highlighter": "23.0.2", 293 | "@vaadin/form-layout": "23.0.4", 294 | "@vaadin/grid": "23.0.4", 295 | "@vaadin/grid-pro": "23.0.4", 296 | "@vaadin/horizontal-layout": "23.0.4", 297 | "@vaadin/icon": "23.0.4", 298 | "@vaadin/icons": "23.0.4", 299 | "@vaadin/input-container": "23.0.4", 300 | "@vaadin/integer-field": "23.0.4", 301 | "@vaadin/item": "23.0.4", 302 | "@vaadin/list-box": "23.0.4", 303 | "@vaadin/login": "23.0.4", 304 | "@vaadin/map": "23.0.4", 305 | "@vaadin/menu-bar": "23.0.4", 306 | "@vaadin/message-input": "23.0.4", 307 | "@vaadin/message-list": "23.0.4", 308 | "@vaadin/notification": "23.0.4", 309 | "@vaadin/number-field": "23.0.4", 310 | "@vaadin/password-field": "23.0.4", 311 | "@vaadin/polymer-legacy-adapter": "23.0.4", 312 | "@vaadin/progress-bar": "23.0.4", 313 | "@vaadin/radio-group": "23.0.4", 314 | "@vaadin/rich-text-editor": "23.0.4", 315 | "@vaadin/router": "1.7.4", 316 | "@vaadin/scroller": "23.0.4", 317 | "@vaadin/select": "23.0.4", 318 | "@vaadin/split-layout": "23.0.4", 319 | "@vaadin/tabs": "23.0.4", 320 | "@vaadin/text-area": "23.0.4", 321 | "@vaadin/text-field": "23.0.4", 322 | "@vaadin/time-picker": "23.0.4", 323 | "@vaadin/upload": "23.0.4", 324 | "@vaadin/vaadin-accordion": "23.0.4", 325 | "@vaadin/vaadin-app-layout": "23.0.4", 326 | "@vaadin/vaadin-avatar": "23.0.4", 327 | "@vaadin/vaadin-board": "23.0.4", 328 | "@vaadin/vaadin-button": "23.0.4", 329 | "@vaadin/vaadin-charts": "23.0.4", 330 | "@vaadin/vaadin-checkbox": "23.0.4", 331 | "@vaadin/vaadin-combo-box": "23.0.4", 332 | "@vaadin/vaadin-confirm-dialog": "23.0.4", 333 | "@vaadin/vaadin-context-menu": "23.0.4", 334 | "@vaadin/vaadin-cookie-consent": "23.0.4", 335 | "@vaadin/vaadin-crud": "23.0.4", 336 | "@vaadin/vaadin-custom-field": "23.0.4", 337 | "@vaadin/vaadin-date-picker": "23.0.4", 338 | "@vaadin/vaadin-date-time-picker": "23.0.4", 339 | "@vaadin/vaadin-details": "23.0.4", 340 | "@vaadin/vaadin-development-mode-detector": "2.0.5", 341 | "@vaadin/vaadin-dialog": "23.0.4", 342 | "@vaadin/vaadin-form-layout": "23.0.4", 343 | "@vaadin/vaadin-grid": "23.0.4", 344 | "@vaadin/vaadin-grid-pro": "23.0.4", 345 | "@vaadin/vaadin-icon": "23.0.4", 346 | "@vaadin/vaadin-icons": "23.0.4", 347 | "@vaadin/vaadin-item": "23.0.4", 348 | "@vaadin/vaadin-list-box": "23.0.4", 349 | "@vaadin/vaadin-list-mixin": "23.0.4", 350 | "@vaadin/vaadin-login": "23.0.4", 351 | "@vaadin/vaadin-lumo-styles": "23.0.4", 352 | "@vaadin/vaadin-material-styles": "23.0.4", 353 | "@vaadin/vaadin-menu-bar": "23.0.4", 354 | "@vaadin/vaadin-messages": "23.0.4", 355 | "@vaadin/vaadin-notification": "23.0.4", 356 | "@vaadin/vaadin-ordered-layout": "23.0.4", 357 | "@vaadin/vaadin-overlay": "23.0.4", 358 | "@vaadin/vaadin-progress-bar": "23.0.4", 359 | "@vaadin/vaadin-radio-button": "23.0.4", 360 | "@vaadin/vaadin-rich-text-editor": "23.0.4", 361 | "@vaadin/vaadin-select": "23.0.4", 362 | "@vaadin/vaadin-split-layout": "23.0.4", 363 | "@vaadin/vaadin-tabs": "23.0.4", 364 | "@vaadin/vaadin-template-renderer": "23.0.4", 365 | "@vaadin/vaadin-text-field": "23.0.4", 366 | "@vaadin/vaadin-themable-mixin": "23.0.4", 367 | "@vaadin/vaadin-time-picker": "23.0.4", 368 | "@vaadin/vaadin-upload": "23.0.4", 369 | "@vaadin/vaadin-usage-statistics": "2.1.2", 370 | "@vaadin/vaadin-virtual-list": "23.0.4", 371 | "@vaadin/vertical-layout": "23.0.4", 372 | "@vaadin/virtual-list": "23.0.4", 373 | "construct-style-sheets-polyfill": "3.0.4", 374 | "date-fns": "2.23.0", 375 | "lit": "2.1.4" 376 | }, 377 | "devDependencies": { 378 | "chokidar": "^3.5.0", 379 | "compression-webpack-plugin": "4.0.1", 380 | "css-loader": "5.2.7", 381 | "esbuild-loader": "2.15.1", 382 | "extra-watch-webpack-plugin": "1.0.3", 383 | "extract-loader": "5.1.0", 384 | "file-loader": "6.2.0", 385 | "fork-ts-checker-webpack-plugin": "6.2.1", 386 | "glob": "7.1.6", 387 | "html-webpack-plugin": "4.5.1", 388 | "lit-css-loader": "0.1.0", 389 | "loader-utils": "2.0.0", 390 | "typescript": "4.5.3", 391 | "webpack": "4.46.0", 392 | "webpack-cli": "4.9.2", 393 | "webpack-dev-server": "4.7.4", 394 | "webpack-merge": "4.2.2", 395 | "workbox-core": "6.5.0", 396 | "workbox-precaching": "6.5.0", 397 | "workbox-webpack-plugin": "6.5.0" 398 | }, 399 | "hash": "492f418bf39d4c1f7aee5463c8f0fc805b351a832db3a51d1c05d6ec403e8a0b" 400 | } 401 | } 402 | -------------------------------------------------------------------------------- /bin/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | com.mongodb.application.search.analysis 7 | atlassearchanalysis 8 | Atlas Search Analysis 9 | 1.0-SNAPSHOT 10 | jar 11 | 12 | 13 | 11 14 | 23.0.4 15 | 16 | 17 | 18 | org.springframework.boot 19 | spring-boot-starter-parent 20 | 2.6.6 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | central 29 | https://repo.maven.apache.org/maven2 30 | 31 | false 32 | 33 | 34 | 35 | vaadin-prereleases 36 | 37 | https://maven.vaadin.com/vaadin-prereleases/ 38 | 39 | 40 | 41 | 42 | Vaadin Directory 43 | https://maven.vaadin.com/vaadin-addons 44 | 45 | false 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | central 54 | https://repo.maven.apache.org/maven2 55 | 56 | false 57 | 58 | 59 | 60 | vaadin-prereleases 61 | 62 | https://maven.vaadin.com/vaadin-prereleases/ 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | com.vaadin 71 | vaadin-bom 72 | ${vaadin.version} 73 | pom 74 | import 75 | 76 | 77 | 78 | 79 | 80 | 81 | com.vaadin 82 | 83 | vaadin 84 | 85 | 86 | com.vaadin 87 | vaadin-spring-boot-starter 88 | 89 | 90 | org.springframework.boot 91 | spring-boot-starter-validation 92 | 93 | 94 | org.springframework.boot 95 | spring-boot-devtools 96 | true 97 | 98 | 99 | org.springframework.boot 100 | spring-boot-starter-test 101 | test 102 | 103 | 104 | com.vaadin 105 | vaadin-testbench 106 | test 107 | 108 | 109 | 110 | org.junit.vintage 111 | junit-vintage-engine 112 | test 113 | 114 | 115 | org.hamcrest 116 | hamcrest-core 117 | 118 | 119 | 120 | 121 | io.github.bonigarcia 122 | webdrivermanager 123 | 5.0.3 124 | test 125 | 126 | 127 | 128 | 129 | spring-boot:run 130 | 131 | 132 | org.springframework.boot 133 | spring-boot-maven-plugin 134 | 136 | 137 | 500 138 | 240 139 | 140 | 141 | 142 | 147 | 148 | com.vaadin 149 | vaadin-maven-plugin 150 | ${vaadin.version} 151 | 152 | 153 | 154 | prepare-frontend 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | production 166 | 167 | 168 | 169 | com.vaadin 170 | vaadin-maven-plugin 171 | ${vaadin.version} 172 | 173 | 174 | 175 | build-frontend 176 | 177 | compile 178 | 179 | 180 | 181 | true 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | it 190 | 191 | 192 | 193 | org.springframework.boot 194 | spring-boot-maven-plugin 195 | 196 | 197 | start-spring-boot 198 | pre-integration-test 199 | 200 | start 201 | 202 | 203 | 204 | stop-spring-boot 205 | post-integration-test 206 | 207 | stop 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | org.apache.maven.plugins 216 | maven-failsafe-plugin 217 | 218 | 219 | 220 | integration-test 221 | verify 222 | 223 | 224 | 225 | 226 | false 227 | true 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | -------------------------------------------------------------------------------- /bin/src/main/java/com/mongodb/application/search/analysis/Application.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/src/main/java/com/mongodb/application/search/analysis/Application.class -------------------------------------------------------------------------------- /bin/src/main/java/com/mongodb/application/search/analysis/views/MainLayout$MenuItemInfo$LineAwesomeIcon.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/src/main/java/com/mongodb/application/search/analysis/views/MainLayout$MenuItemInfo$LineAwesomeIcon.class -------------------------------------------------------------------------------- /bin/src/main/java/com/mongodb/application/search/analysis/views/MainLayout$MenuItemInfo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/src/main/java/com/mongodb/application/search/analysis/views/MainLayout$MenuItemInfo.class -------------------------------------------------------------------------------- /bin/src/main/java/com/mongodb/application/search/analysis/views/MainLayout.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/src/main/java/com/mongodb/application/search/analysis/views/MainLayout.class -------------------------------------------------------------------------------- /bin/src/main/java/com/mongodb/application/search/analysis/views/about/AboutView.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/src/main/java/com/mongodb/application/search/analysis/views/about/AboutView.class -------------------------------------------------------------------------------- /bin/src/main/java/com/mongodb/application/search/analysis/views/analysis/AnalysisView$ExpirationDateField.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/src/main/java/com/mongodb/application/search/analysis/views/analysis/AnalysisView$ExpirationDateField.class -------------------------------------------------------------------------------- /bin/src/main/java/com/mongodb/application/search/analysis/views/analysis/AnalysisView.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/src/main/java/com/mongodb/application/search/analysis/views/analysis/AnalysisView.class -------------------------------------------------------------------------------- /bin/src/main/resources/META-INF/resources/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/src/main/resources/META-INF/resources/icons/icon.png -------------------------------------------------------------------------------- /bin/src/main/resources/META-INF/resources/images/empty-plant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/bin/src/main/resources/META-INF/resources/images/empty-plant.png -------------------------------------------------------------------------------- /bin/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=${PORT:8080} 2 | logging.level.org.atmosphere = warn 3 | spring.mustache.check-template-location = false 4 | 5 | # Launch the default browser when starting the application in development mode 6 | vaadin.launch-browser=true 7 | # To improve the performance during development. 8 | # For more information https://vaadin.com/docs/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters 9 | vaadin.whitelisted-packages = com.vaadin,org.vaadin,dev.hilla,com.mongodb.application.search.analysis 10 | -------------------------------------------------------------------------------- /bin/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _ _ _ ____ _ _ _ _ 2 | / \ | |_ | | __ _ ___ / ___| ___ __ _ _ __ ___ | |__ / \ _ __ __ _ | | _ _ ___ (_) ___ 3 | / _ \ | __|| | / _` |/ __| \___ \ / _ \ / _` || '__| / __|| '_ \ / _ \ | '_ \ / _` || || | | |/ __|| |/ __| 4 | / ___ \ | |_ | || (_| |\__ \ ___) || __/| (_| || | | (__ | | | | / ___ \ | | | || (_| || || |_| |\__ \| |\__ \ 5 | /_/ \_\ \__||_| \__,_||___/ |____/ \___| \__,_||_| \___||_| |_| /_/ \_\|_| |_| \__,_||_| \__, ||___/|_||___/ 6 | |___/ 7 | -------------------------------------------------------------------------------- /bin/tsconfig.json: -------------------------------------------------------------------------------- 1 | // This TypeScript configuration file is generated by vaadin-maven-plugin. 2 | // This is needed for TypeScript compiler to compile your TypeScript code in the project. 3 | // It is recommended to commit this file to the VCS. 4 | // You might want to change the configurations to fit your preferences 5 | // For more information about the configurations, please refer to http://www.typescriptlang.org/docs/handbook/tsconfig-json.html 6 | { 7 | "compilerOptions": { 8 | "sourceMap": true, 9 | "inlineSources": true, 10 | "module": "esNext", 11 | "target": "es2019", 12 | "moduleResolution": "node", 13 | "strict": true, 14 | "noFallthroughCasesInSwitch": true, 15 | "noImplicitReturns": true, 16 | "noImplicitAny": true, 17 | "noImplicitThis": true, 18 | "noUnusedLocals": false, 19 | "noUnusedParameters": false, 20 | "experimentalDecorators": true, 21 | "baseUrl": "frontend", 22 | "paths": { 23 | "Frontend/*": [ 24 | "*" 25 | ] 26 | } 27 | }, 28 | "include": [ 29 | "frontend/**/*.ts", 30 | "frontend/index.js", 31 | "types.d.ts" 32 | ], 33 | "exclude": [] 34 | } 35 | -------------------------------------------------------------------------------- /bin/types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.css' { 2 | import { CSSResultGroup } from 'lit'; 3 | const content: CSSResultGroup; 4 | export default content; 5 | } 6 | -------------------------------------------------------------------------------- /bin/webpack.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has been autogenerated as it didn't exist or was made for an older incompatible version. 3 | * This file can be used for manual configuration will not be modified if the flowDefaults constant exists. 4 | */ 5 | const merge = require('webpack-merge'); 6 | const flowDefaults = require('./webpack.generated.js'); 7 | 8 | module.exports = merge(flowDefaults, { 9 | 10 | }); 11 | 12 | /** 13 | * This file can be used to configure the flow plugin defaults. 14 | * 15 | * // Add a custom plugin 16 | * flowDefaults.plugins.push(new MyPlugin()); 17 | * 18 | * // Update the rules to also transpile `.mjs` files 19 | * if (!flowDefaults.module.rules[0].test) { 20 | * throw "Unexpected structure in generated webpack config"; 21 | * } 22 | * flowDefaults.module.rules[0].test = /\.m?js$/ 23 | * 24 | * // Include a custom JS in the entry point in addition to generated-flow-imports.js 25 | * if (typeof flowDefaults.entry.index != "string") { 26 | * throw "Unexpected structure in generated webpack config"; 27 | * } 28 | * flowDefaults.entry.index = [flowDefaults.entry.index, "myCustomFile.js"]; 29 | * 30 | * or add new configuration in the merge block. 31 | * 32 | * module.exports = merge(flowDefaults, { 33 | * mode: 'development', 34 | * devtool: 'inline-source-map' 35 | * }); 36 | * 37 | */ 38 | -------------------------------------------------------------------------------- /frontend/generated/index.ts: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * This file is auto-generated by Vaadin. 3 | * If you want to customize the entry point, you can copy this file or create 4 | * your own `index.ts` in your frontend directory. 5 | * By default, the `index.ts` file should be in `./frontend/` folder. 6 | * 7 | * NOTE: 8 | * - You need to restart the dev-server after adding the new `index.ts` file. 9 | * After that, all modifications to `index.ts` are recompiled automatically. 10 | * - `index.js` is also supported if you don't want to use TypeScript. 11 | ******************************************************************************/ 12 | 13 | // import Vaadin client-router to handle client-side and server-side navigation 14 | import { Router } from '@vaadin/router'; 15 | 16 | // import Flow module to enable navigation to Vaadin server-side views 17 | import { Flow } from '@vaadin/flow-frontend/Flow'; 18 | 19 | const { serverSideRoutes } = new Flow({ 20 | imports: () => import('../../target/frontend/generated-flow-imports') 21 | }); 22 | 23 | const routes = [ 24 | // for client-side, place routes below (more info https://vaadin.com/docs/v15/flow/typescript/creating-routes.html) 25 | 26 | // for server-side, the next magic line sends all unmatched routes: 27 | ...serverSideRoutes // IMPORTANT: this must be the last entry in the array 28 | ]; 29 | 30 | // Vaadin router needs an outlet in the index.html page to display views 31 | const router = new Router(document.querySelector('#outlet')); 32 | router.setRoutes(routes); 33 | -------------------------------------------------------------------------------- /frontend/generated/theme-atlassearchanalysis.generated.js: -------------------------------------------------------------------------------- 1 | import 'construct-style-sheets-polyfill'; 2 | 3 | const createLinkReferences = (css, target) => { 4 | // Unresolved urls are written as '@import url(text);' to the css 5 | // [0] is the full match 6 | // [1] matches the media query 7 | // [2] matches the url 8 | const importMatcher = /(?:@media\s(.+?))?(?:\s{)?\@import\surl\((.+?)\);(?:})?/g; 9 | 10 | var match; 11 | var styleCss = css; 12 | 13 | // For each external url import add a link reference 14 | while((match = importMatcher.exec(css)) !== null) { 15 | styleCss = styleCss.replace(match[0], ""); 16 | const link = document.createElement('link'); 17 | link.rel = 'stylesheet'; 18 | link.href = match[2]; 19 | if (match[1]) { 20 | link.media = match[1]; 21 | } 22 | // For target document append to head else append to target 23 | if (target === document) { 24 | document.head.appendChild(link); 25 | } else { 26 | target.appendChild(link); 27 | } 28 | }; 29 | return styleCss; 30 | }; 31 | 32 | // target: Document | ShadowRoot 33 | export const injectGlobalCss = (css, target, first) => { 34 | if(target === document) { 35 | const hash = getHash(css); 36 | if (window.Vaadin.theme.injectedGlobalCss.indexOf(hash) !== -1) { 37 | return; 38 | } 39 | window.Vaadin.theme.injectedGlobalCss.push(hash); 40 | } 41 | const sheet = new CSSStyleSheet(); 42 | sheet.replaceSync(createLinkReferences(css,target)); 43 | if (first) { 44 | target.adoptedStyleSheets = [sheet, ...target.adoptedStyleSheets]; 45 | } else { 46 | target.adoptedStyleSheets = [...target.adoptedStyleSheets, sheet]; 47 | } 48 | }; 49 | import stylesCss from 'themes/atlassearchanalysis/styles.css?inline'; 50 | import { typography } from '@vaadin/vaadin-lumo-styles/typography.js'; 51 | import { color } from '@vaadin/vaadin-lumo-styles/color.js'; 52 | import { spacing } from '@vaadin/vaadin-lumo-styles/spacing.js'; 53 | import { badge } from '@vaadin/vaadin-lumo-styles/badge.js'; 54 | import { utility } from '@vaadin/vaadin-lumo-styles/utility.js'; 55 | 56 | window.Vaadin = window.Vaadin || {}; 57 | window.Vaadin.theme = window.Vaadin.theme || {}; 58 | window.Vaadin.theme.injectedGlobalCss = []; 59 | 60 | /** 61 | * Calculate a 32 bit FNV-1a hash 62 | * Found here: https://gist.github.com/vaiorabbit/5657561 63 | * Ref.: http://isthe.com/chongo/tech/comp/fnv/ 64 | * 65 | * @param {string} str the input value 66 | * @returns {string} 32 bit (as 8 byte hex string) 67 | */ 68 | function hashFnv32a(str) { 69 | /*jshint bitwise:false */ 70 | let i, l, hval = 0x811c9dc5; 71 | 72 | for (i = 0, l = str.length; i < l; i++) { 73 | hval ^= str.charCodeAt(i); 74 | hval += (hval << 1) + (hval << 4) + (hval << 7) + (hval << 8) + (hval << 24); 75 | } 76 | 77 | // Convert to 8 digit hex string 78 | return ("0000000" + (hval >>> 0).toString(16)).substr(-8); 79 | } 80 | 81 | /** 82 | * Calculate a 64 bit hash for the given input. 83 | * Double hash is used to significantly lower the collision probability. 84 | * 85 | * @param {string} input value to get hash for 86 | * @returns {string} 64 bit (as 16 byte hex string) 87 | */ 88 | function getHash(input) { 89 | let h1 = hashFnv32a(input); // returns 32 bit (as 8 byte hex string) 90 | return h1 + hashFnv32a(h1 + input); 91 | } 92 | export const applyTheme = (target) => { 93 | 94 | injectGlobalCss(stylesCss.toString(), target); 95 | 96 | 97 | if (!document['_vaadintheme_atlassearchanalysis_componentCss']) { 98 | 99 | document['_vaadintheme_atlassearchanalysis_componentCss'] = true; 100 | } 101 | injectGlobalCss(typography.cssText, target, true); 102 | injectGlobalCss(color.cssText, target, true); 103 | injectGlobalCss(spacing.cssText, target, true); 104 | injectGlobalCss(badge.cssText, target, true); 105 | injectGlobalCss(utility.cssText, target, true); 106 | 107 | } 108 | -------------------------------------------------------------------------------- /frontend/generated/theme.d.ts: -------------------------------------------------------------------------------- 1 | export declare const applyTheme: (target: Node) => void; -------------------------------------------------------------------------------- /frontend/generated/theme.js: -------------------------------------------------------------------------------- 1 | import {applyTheme as _applyTheme} from './theme-atlassearchanalysis.generated.js'; 2 | export const applyTheme = _applyTheme; 3 | -------------------------------------------------------------------------------- /frontend/generated/vaadin-featureflags.ts: -------------------------------------------------------------------------------- 1 | // @ts-nocheck 2 | window.Vaadin = window.Vaadin || {}; 3 | window.Vaadin.featureFlags = window.Vaadin.featureFlags || {}; 4 | window.Vaadin.featureFlags.exampleFeatureFlag = false; 5 | window.Vaadin.featureFlags.viteForFrontendBuild = false; 6 | window.Vaadin.featureFlags.mapComponent = false; -------------------------------------------------------------------------------- /frontend/generated/vaadin.ts: -------------------------------------------------------------------------------- 1 | import './vaadin-featureflags.ts'; 2 | 3 | import './index'; 4 | 5 | import '@vaadin/flow-frontend/VaadinDevmodeGizmo.js'; 6 | 7 | import { applyTheme } from './theme'; 8 | applyTheme(document); 9 | -------------------------------------------------------------------------------- /frontend/index.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /frontend/themes/atlassearchanalysis/main-layout.css: -------------------------------------------------------------------------------- 1 | [slot='drawer'] { 2 | background-image: linear-gradient(0deg, var(--lumo-shade-5pct), var(--lumo-shade-5pct)); 3 | } 4 | 5 | [slot='drawer'] nav a { 6 | text-decoration: none; 7 | transition: color 140ms; 8 | } 9 | 10 | [slot='drawer'] nav a .la { 11 | margin-top: calc(var(--lumo-space-xs) * 0.5); 12 | } 13 | 14 | [slot='drawer'] nav a::before { 15 | border-radius: var(--lumo-border-radius); 16 | bottom: calc(var(--lumo-space-xs) * 0.5); 17 | content: ''; 18 | left: 0; 19 | position: absolute; 20 | right: 0; 21 | top: calc(var(--lumo-space-xs) * 0.5); 22 | transition: background-color 140ms; 23 | } 24 | 25 | [slot='drawer'] nav a[highlight] { 26 | color: var(--lumo-primary-text-color); 27 | } 28 | 29 | [slot='drawer'] nav a[highlight]::before { 30 | background-color: var(--lumo-primary-color-10pct); 31 | } 32 | 33 | [slot='drawer'] footer vaadin-context-menu { 34 | align-items: center; 35 | display: flex; 36 | } 37 | 38 | .menu-item-link { 39 | display: flex; 40 | margin-left: var(--lumo-space-s); 41 | margin-right: var(--lumo-space-s); 42 | padding: var(--lumo-space-s); 43 | position: relative; 44 | color: var(--lumo-secondary-text-color); 45 | } 46 | 47 | .menu-item-text { 48 | font-weight: 500; 49 | font-size: var(--lumo-font-size-s); 50 | } 51 | 52 | .menu-item-icon { 53 | margin-inline-end: var(--lumo-space-s); 54 | font-size: var(--lumo-font-size-l); 55 | } 56 | 57 | .view-title { 58 | margin: 0; 59 | font-size: var(--lumo-font-size-l); 60 | } 61 | 62 | .view-header { 63 | align-items: center; 64 | background-color: var(--lumo-base-color); 65 | border-bottom: 1px solid; 66 | border-color: var(--lumo-contrast-10pct); 67 | box-sizing: border-box; 68 | display: flex; 69 | height: var(--lumo-size-xl); 70 | width: 100%; 71 | } 72 | 73 | .view-toggle { 74 | color: var(--lumo-secondary-text-color); 75 | } 76 | 77 | .app-name { 78 | align-items: center; 79 | display: flex; 80 | height: var(--lumo-size-xl); 81 | margin: 0; 82 | padding-left: var(--lumo-space-m); 83 | padding-right: var(--lumo-space-m); 84 | font-size: var(--lumo-font-size-m); 85 | } 86 | 87 | .drawer-section { 88 | align-items: stretch; 89 | display: flex; 90 | flex-direction: column; 91 | max-height: 100%; 92 | min-height: 100%; 93 | } 94 | 95 | .menu-item-container { 96 | border-bottom: 1px solid; 97 | border-color: var(--lumo-contrast-10pct); 98 | flex-grow: 1; 99 | overflow: auto; 100 | } 101 | 102 | .navigation-list { 103 | list-style-type: none; 104 | margin: 0; 105 | padding: 0; 106 | } 107 | 108 | .footer { 109 | align-items: center; 110 | display: flex; 111 | margin-bottom: var(--lumo-space-s); 112 | margin-top: var(--lumo-space-s); 113 | padding-left: var(--lumo-space-m); 114 | padding-right: var(--lumo-space-m); 115 | padding-bottom: var(--lumo-space-xs); 116 | padding-top: var(--lumo-space-xs); 117 | } 118 | -------------------------------------------------------------------------------- /frontend/themes/atlassearchanalysis/styles.css: -------------------------------------------------------------------------------- 1 | @import url('./main-layout.css'); 2 | @import url('./views/analysis-view.css'); 3 | @import url('line-awesome/dist/line-awesome/css/line-awesome.min.css'); 4 | 5 | textarea { 6 | font-family: monospace; 7 | } 8 | 9 | ::ng-deep vaadin-devmode-gizmo, .gizmo.error { 10 | display: none !important; 11 | } -------------------------------------------------------------------------------- /frontend/themes/atlassearchanalysis/theme.json: -------------------------------------------------------------------------------- 1 | { 2 | "lumoImports" : [ "typography", "color", "spacing", "badge", "utility" ] 3 | } -------------------------------------------------------------------------------- /frontend/themes/atlassearchanalysis/views/analysis-view.css: -------------------------------------------------------------------------------- 1 | .analysis-view { 2 | display: block; 3 | margin: 0 auto; 4 | max-width: 1024px; 5 | padding: 0 var(--lumo-space-l); 6 | } 7 | .analysis-view .button-layout { 8 | margin-bottom: var(--lumo-space-l); 9 | margin-top: var(--lumo-space-m); 10 | } 11 | -------------------------------------------------------------------------------- /index_camel.json: -------------------------------------------------------------------------------- 1 | { 2 | "analyzer": "camelCase", 3 | "mappings": { 4 | "dynamic": true 5 | }, 6 | "analyzers": [ 7 | { 8 | "name": "camelCase", 9 | "charFilters": [], 10 | "tokenizer": { 11 | "type": "regexCaptureGroup", 12 | "pattern": "^[a-z]+([A-Z][a-z0-9]+)*$", 13 | "group": 1 14 | }, 15 | "tokenFilters": [] 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /index_dms.json: -------------------------------------------------------------------------------- 1 | { 2 | "analyzer": "dmsAnalyzer", 3 | "searchAnalyzer": "dmsAnalyzer", 4 | "mappings": { 5 | "dynamic": true 6 | }, 7 | "analyzers": [ 8 | { 9 | "name": "dmsAnalyzer", 10 | "tokenizer": { 11 | "type": "standard" 12 | }, 13 | "tokenFilters": [ 14 | { 15 | "type": "daitchMokotoffSoundex", 16 | "originalTokens": "include" 17 | } 18 | ] 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /index_html.json: -------------------------------------------------------------------------------- 1 | { 2 | "analyzers": [ 3 | { 4 | "name": "htmlStrippingAnalyzer", 5 | "charFilters": [ 6 | { 7 | "type": "htmlStrip", 8 | "ignoredTags": [ 9 | "a", "p" 10 | ] 11 | } 12 | ], 13 | "tokenizer": { 14 | "type": "standard" 15 | }, 16 | "tokenFilters": [] 17 | }] 18 | } -------------------------------------------------------------------------------- /index_regex.json: -------------------------------------------------------------------------------- 1 | { 2 | "analyzer": "phoneNumberExtractor", 3 | "mappings": { 4 | "dynamic": true 5 | }, 6 | "analyzers": [ 7 | { 8 | "name": "phoneNumberExtractor", 9 | "charFilters": [], 10 | "tokenizer": { 11 | "type": "regexCaptureGroup", 12 | "pattern": "^\\b\\d{3}[-.]?\\d{3}[-.]?\\d{4}\\b$", 13 | "group": 0 14 | }, 15 | "tokenFilters": [] 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /index_rev.json: -------------------------------------------------------------------------------- 1 | { 2 | "analyzers": [ 3 | { 4 | "name": "reverseAnalyzer", 5 | "charFilters": [ 6 | ], 7 | "tokenizer": { 8 | "type": "keyword" 9 | }, 10 | "tokenFilters": [ 11 | { 12 | "type": "reverse" 13 | } 14 | ] 15 | } 16 | ], 17 | "mappings": { 18 | "dynamic": true 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /index_roman.json: -------------------------------------------------------------------------------- 1 | { 2 | "analyzers": [ 3 | { 4 | "name": "romanAnalyzer", 5 | "charFilters": [ 6 | { 7 | "type": "mapping", 8 | "mappings": { 9 | "V": "5", 10 | "ii": "2", 11 | "II": "2" 12 | } 13 | } 14 | ], 15 | "tokenizer": { 16 | "type": "standard" 17 | }, 18 | "tokenFilters": [ 19 | { 20 | "type": "lowercase" 21 | }, 22 | { 23 | "type": "length", 24 | "max": 8 25 | }, 26 | { 27 | "type": "stopword", 28 | "tokens": [ 29 | "IS", 30 | "the", 31 | "than" 32 | ], 33 | "ignoreCase": true 34 | }, 35 | { 36 | "type": "snowballStemming", 37 | "stemmerName": "english" 38 | }, 39 | { 40 | "type": "icuFolding" 41 | }, 42 | { 43 | "matches": "all", 44 | "pattern": "^(roc)(.*\\s+\\d)$", 45 | "replacement": "***", 46 | "type": "regex" 47 | } 48 | ] 49 | } 50 | ], 51 | "mappings": { 52 | "dynamic": true 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /index_shingle.json: -------------------------------------------------------------------------------- 1 | { 2 | "analyzers": [ 3 | { 4 | "name": "shingleAnalyzer", 5 | "tokenizer": { 6 | "maxTokenLength": 15, 7 | "type": "whitespace" 8 | }, 9 | "tokenFilters": [ 10 | { 11 | "maxShingleSize": 3, 12 | "minShingleSize": 2, 13 | "type": "shingle" 14 | }, 15 | { 16 | "maxGram": 7, 17 | "minGram": 3, 18 | "type": "nGram" 19 | } 20 | ] 21 | } 22 | ] 23 | } -------------------------------------------------------------------------------- /mvn/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import java.io.*; 17 | import java.net.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.6"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is 26 | * provided. 27 | */ 28 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 29 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 30 | 31 | /** 32 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl 33 | * property to use instead of the default one. 34 | */ 35 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = ".mvn/wrapper/maven-wrapper.jar"; 41 | 42 | /** 43 | * Name of the property which should be used to override the default download 44 | * url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a 54 | // custom 55 | // wrapperUrl parameter. 56 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 57 | String url = DEFAULT_DOWNLOAD_URL; 58 | if (mavenWrapperPropertyFile.exists()) { 59 | FileInputStream mavenWrapperPropertyFileInputStream = null; 60 | try { 61 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 62 | Properties mavenWrapperProperties = new Properties(); 63 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 64 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 65 | } catch (IOException e) { 66 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 67 | } finally { 68 | try { 69 | if (mavenWrapperPropertyFileInputStream != null) { 70 | mavenWrapperPropertyFileInputStream.close(); 71 | } 72 | } catch (IOException e) { 73 | // Ignore ... 74 | } 75 | } 76 | } 77 | System.out.println("- Downloading from: " + url); 78 | 79 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 80 | if (!outputFile.getParentFile().exists()) { 81 | if (!outputFile.getParentFile().mkdirs()) { 82 | System.out.println( 83 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 84 | } 85 | } 86 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 87 | try { 88 | downloadFileFromURL(url, outputFile); 89 | System.out.println("Done"); 90 | System.exit(0); 91 | } catch (Throwable e) { 92 | System.out.println("- Error downloading"); 93 | e.printStackTrace(); 94 | System.exit(1); 95 | } 96 | } 97 | 98 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 99 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 100 | String username = System.getenv("MVNW_USERNAME"); 101 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 102 | Authenticator.setDefault(new Authenticator() { 103 | @Override 104 | protected PasswordAuthentication getPasswordAuthentication() { 105 | return new PasswordAuthentication(username, password); 106 | } 107 | }); 108 | } 109 | URL website = new URL(urlString); 110 | ReadableByteChannel rbc; 111 | rbc = Channels.newChannel(website.openStream()); 112 | FileOutputStream fos = new FileOutputStream(destination); 113 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 114 | fos.close(); 115 | rbc.close(); 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /mvn/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/mvn/maven-wrapper.jar -------------------------------------------------------------------------------- /mvn/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "no-name", 3 | "license": "UNLICENSED", 4 | "dependencies": { 5 | "@polymer/iron-icon": "3.0.1", 6 | "@polymer/iron-iconset-svg": "3.0.1", 7 | "@polymer/iron-list": "3.1.0", 8 | "@polymer/iron-meta": "3.0.1", 9 | "@polymer/iron-resizable-behavior": "3.0.1", 10 | "@polymer/polymer": "3.4.1", 11 | "@vaadin/accordion": "23.0.4", 12 | "@vaadin/app-layout": "23.0.4", 13 | "@vaadin/avatar": "23.0.4", 14 | "@vaadin/avatar-group": "23.0.4", 15 | "@vaadin/board": "23.0.4", 16 | "@vaadin/bundles": "23.0.4", 17 | "@vaadin/button": "23.0.4", 18 | "@vaadin/charts": "23.0.4", 19 | "@vaadin/checkbox": "23.0.4", 20 | "@vaadin/checkbox-group": "23.0.4", 21 | "@vaadin/combo-box": "23.0.4", 22 | "@vaadin/common-frontend": "0.0.17", 23 | "@vaadin/component-base": "23.0.4", 24 | "@vaadin/confirm-dialog": "23.0.4", 25 | "@vaadin/context-menu": "23.0.4", 26 | "@vaadin/cookie-consent": "23.0.4", 27 | "@vaadin/crud": "23.0.4", 28 | "@vaadin/custom-field": "23.0.4", 29 | "@vaadin/date-picker": "23.0.4", 30 | "@vaadin/date-time-picker": "23.0.4", 31 | "@vaadin/details": "23.0.4", 32 | "@vaadin/dialog": "23.0.4", 33 | "@vaadin/email-field": "23.0.4", 34 | "@vaadin/field-base": "23.0.4", 35 | "@vaadin/field-highlighter": "23.0.2", 36 | "@vaadin/flow-frontend": "./target/flow-frontend", 37 | "@vaadin/form-layout": "23.0.4", 38 | "@vaadin/grid": "23.0.4", 39 | "@vaadin/grid-pro": "23.0.4", 40 | "@vaadin/horizontal-layout": "23.0.4", 41 | "@vaadin/icon": "23.0.4", 42 | "@vaadin/icons": "23.0.4", 43 | "@vaadin/input-container": "23.0.4", 44 | "@vaadin/integer-field": "23.0.4", 45 | "@vaadin/item": "23.0.4", 46 | "@vaadin/list-box": "23.0.4", 47 | "@vaadin/login": "23.0.4", 48 | "@vaadin/map": "23.0.4", 49 | "@vaadin/menu-bar": "23.0.4", 50 | "@vaadin/message-input": "23.0.4", 51 | "@vaadin/message-list": "23.0.4", 52 | "@vaadin/notification": "23.0.4", 53 | "@vaadin/number-field": "23.0.4", 54 | "@vaadin/password-field": "23.0.4", 55 | "@vaadin/polymer-legacy-adapter": "23.0.4", 56 | "@vaadin/progress-bar": "23.0.4", 57 | "@vaadin/radio-group": "23.0.4", 58 | "@vaadin/rich-text-editor": "23.0.4", 59 | "@vaadin/router": "1.7.4", 60 | "@vaadin/scroller": "23.0.4", 61 | "@vaadin/select": "23.0.4", 62 | "@vaadin/split-layout": "23.0.4", 63 | "@vaadin/tabs": "23.0.4", 64 | "@vaadin/text-area": "23.0.4", 65 | "@vaadin/text-field": "23.0.4", 66 | "@vaadin/time-picker": "23.0.4", 67 | "@vaadin/upload": "23.0.4", 68 | "@vaadin/vaadin-accordion": "23.0.4", 69 | "@vaadin/vaadin-app-layout": "23.0.4", 70 | "@vaadin/vaadin-avatar": "23.0.4", 71 | "@vaadin/vaadin-board": "23.0.4", 72 | "@vaadin/vaadin-button": "23.0.4", 73 | "@vaadin/vaadin-charts": "23.0.4", 74 | "@vaadin/vaadin-checkbox": "23.0.4", 75 | "@vaadin/vaadin-combo-box": "23.0.4", 76 | "@vaadin/vaadin-confirm-dialog": "23.0.4", 77 | "@vaadin/vaadin-context-menu": "23.0.4", 78 | "@vaadin/vaadin-cookie-consent": "23.0.4", 79 | "@vaadin/vaadin-crud": "23.0.4", 80 | "@vaadin/vaadin-custom-field": "23.0.4", 81 | "@vaadin/vaadin-date-picker": "23.0.4", 82 | "@vaadin/vaadin-date-time-picker": "23.0.4", 83 | "@vaadin/vaadin-details": "23.0.4", 84 | "@vaadin/vaadin-development-mode-detector": "2.0.5", 85 | "@vaadin/vaadin-dialog": "23.0.4", 86 | "@vaadin/vaadin-form-layout": "23.0.4", 87 | "@vaadin/vaadin-grid": "23.0.4", 88 | "@vaadin/vaadin-grid-pro": "23.0.4", 89 | "@vaadin/vaadin-icon": "23.0.4", 90 | "@vaadin/vaadin-icons": "23.0.4", 91 | "@vaadin/vaadin-item": "23.0.4", 92 | "@vaadin/vaadin-list-box": "23.0.4", 93 | "@vaadin/vaadin-list-mixin": "23.0.4", 94 | "@vaadin/vaadin-login": "23.0.4", 95 | "@vaadin/vaadin-lumo-styles": "23.0.4", 96 | "@vaadin/vaadin-material-styles": "23.0.4", 97 | "@vaadin/vaadin-menu-bar": "23.0.4", 98 | "@vaadin/vaadin-messages": "23.0.4", 99 | "@vaadin/vaadin-notification": "23.0.4", 100 | "@vaadin/vaadin-ordered-layout": "23.0.4", 101 | "@vaadin/vaadin-overlay": "23.0.4", 102 | "@vaadin/vaadin-progress-bar": "23.0.4", 103 | "@vaadin/vaadin-radio-button": "23.0.4", 104 | "@vaadin/vaadin-rich-text-editor": "23.0.4", 105 | "@vaadin/vaadin-select": "23.0.4", 106 | "@vaadin/vaadin-split-layout": "23.0.4", 107 | "@vaadin/vaadin-tabs": "23.0.4", 108 | "@vaadin/vaadin-template-renderer": "23.0.4", 109 | "@vaadin/vaadin-text-field": "23.0.4", 110 | "@vaadin/vaadin-themable-mixin": "23.0.4", 111 | "@vaadin/vaadin-time-picker": "23.0.4", 112 | "@vaadin/vaadin-upload": "23.0.4", 113 | "@vaadin/vaadin-usage-statistics": "2.1.2", 114 | "@vaadin/vaadin-virtual-list": "23.0.4", 115 | "@vaadin/vertical-layout": "23.0.4", 116 | "@vaadin/virtual-list": "23.0.4", 117 | "construct-style-sheets-polyfill": "3.0.4", 118 | "date-fns": "2.23.0", 119 | "line-awesome": "1.3.0", 120 | "lit": "2.1.4" 121 | }, 122 | "devDependencies": { 123 | "chokidar": "^3.5.0", 124 | "compression-webpack-plugin": "4.0.1", 125 | "css-loader": "5.2.7", 126 | "esbuild-loader": "2.15.1", 127 | "extra-watch-webpack-plugin": "1.0.3", 128 | "extract-loader": "5.1.0", 129 | "file-loader": "6.2.0", 130 | "fork-ts-checker-webpack-plugin": "6.2.1", 131 | "glob": "7.1.6", 132 | "html-webpack-plugin": "4.5.1", 133 | "lit-css-loader": "0.1.0", 134 | "loader-utils": "2.0.0", 135 | "typescript": "4.5.3", 136 | "webpack": "4.46.0", 137 | "webpack-cli": "4.9.2", 138 | "webpack-dev-server": "4.7.4", 139 | "webpack-merge": "4.2.2", 140 | "workbox-core": "6.5.0", 141 | "workbox-precaching": "6.5.0", 142 | "workbox-webpack-plugin": "6.5.0" 143 | }, 144 | "overrides": { 145 | "@vaadin/accordion": "$@vaadin/accordion", 146 | "@vaadin/app-layout": "$@vaadin/app-layout", 147 | "@vaadin/avatar": "$@vaadin/avatar", 148 | "@vaadin/avatar-group": "$@vaadin/avatar-group", 149 | "@vaadin/button": "$@vaadin/button", 150 | "@vaadin/checkbox": "$@vaadin/checkbox", 151 | "@vaadin/checkbox-group": "$@vaadin/checkbox-group", 152 | "@vaadin/combo-box": "$@vaadin/combo-box", 153 | "@vaadin/component-base": "$@vaadin/component-base", 154 | "@vaadin/context-menu": "$@vaadin/context-menu", 155 | "@vaadin/custom-field": "$@vaadin/custom-field", 156 | "@vaadin/date-picker": "$@vaadin/date-picker", 157 | "@vaadin/date-time-picker": "$@vaadin/date-time-picker", 158 | "@vaadin/details": "$@vaadin/details", 159 | "@vaadin/dialog": "$@vaadin/dialog", 160 | "@vaadin/email-field": "$@vaadin/email-field", 161 | "@vaadin/field-base": "$@vaadin/field-base", 162 | "@vaadin/field-highlighter": "$@vaadin/field-highlighter", 163 | "@vaadin/form-layout": "$@vaadin/form-layout", 164 | "@vaadin/grid": "$@vaadin/grid", 165 | "@vaadin/horizontal-layout": "$@vaadin/horizontal-layout", 166 | "@vaadin/icon": "$@vaadin/icon", 167 | "@vaadin/icons": "$@vaadin/icons", 168 | "@vaadin/input-container": "$@vaadin/input-container", 169 | "@vaadin/integer-field": "$@vaadin/integer-field", 170 | "@polymer/iron-icon": "$@polymer/iron-icon", 171 | "@polymer/iron-iconset-svg": "$@polymer/iron-iconset-svg", 172 | "@polymer/iron-list": "$@polymer/iron-list", 173 | "@polymer/iron-meta": "$@polymer/iron-meta", 174 | "@polymer/iron-resizable-behavior": "$@polymer/iron-resizable-behavior", 175 | "@vaadin/item": "$@vaadin/item", 176 | "@vaadin/list-box": "$@vaadin/list-box", 177 | "@vaadin/login": "$@vaadin/login", 178 | "@vaadin/menu-bar": "$@vaadin/menu-bar", 179 | "@vaadin/message-input": "$@vaadin/message-input", 180 | "@vaadin/message-list": "$@vaadin/message-list", 181 | "@vaadin/notification": "$@vaadin/notification", 182 | "@vaadin/number-field": "$@vaadin/number-field", 183 | "@vaadin/password-field": "$@vaadin/password-field", 184 | "@vaadin/polymer-legacy-adapter": "$@vaadin/polymer-legacy-adapter", 185 | "@vaadin/progress-bar": "$@vaadin/progress-bar", 186 | "@vaadin/radio-group": "$@vaadin/radio-group", 187 | "@vaadin/scroller": "$@vaadin/scroller", 188 | "@vaadin/select": "$@vaadin/select", 189 | "@vaadin/split-layout": "$@vaadin/split-layout", 190 | "@vaadin/tabs": "$@vaadin/tabs", 191 | "@vaadin/text-area": "$@vaadin/text-area", 192 | "@vaadin/text-field": "$@vaadin/text-field", 193 | "@vaadin/time-picker": "$@vaadin/time-picker", 194 | "@vaadin/upload": "$@vaadin/upload", 195 | "@vaadin/vaadin-accordion": "$@vaadin/vaadin-accordion", 196 | "@vaadin/vaadin-app-layout": "$@vaadin/vaadin-app-layout", 197 | "@vaadin/vaadin-avatar": "$@vaadin/vaadin-avatar", 198 | "@vaadin/vaadin-button": "$@vaadin/vaadin-button", 199 | "@vaadin/vaadin-checkbox": "$@vaadin/vaadin-checkbox", 200 | "@vaadin/vaadin-combo-box": "$@vaadin/vaadin-combo-box", 201 | "@vaadin/vaadin-context-menu": "$@vaadin/vaadin-context-menu", 202 | "@vaadin/vaadin-custom-field": "$@vaadin/vaadin-custom-field", 203 | "@vaadin/vaadin-date-picker": "$@vaadin/vaadin-date-picker", 204 | "@vaadin/vaadin-date-time-picker": "$@vaadin/vaadin-date-time-picker", 205 | "@vaadin/vaadin-details": "$@vaadin/vaadin-details", 206 | "@vaadin/vaadin-development-mode-detector": "$@vaadin/vaadin-development-mode-detector", 207 | "@vaadin/vaadin-dialog": "$@vaadin/vaadin-dialog", 208 | "@vaadin/vaadin-form-layout": "$@vaadin/vaadin-form-layout", 209 | "@vaadin/vaadin-grid": "$@vaadin/vaadin-grid", 210 | "@vaadin/vaadin-icon": "$@vaadin/vaadin-icon", 211 | "@vaadin/vaadin-icons": "$@vaadin/vaadin-icons", 212 | "@vaadin/vaadin-item": "$@vaadin/vaadin-item", 213 | "@vaadin/vaadin-list-box": "$@vaadin/vaadin-list-box", 214 | "@vaadin/vaadin-list-mixin": "$@vaadin/vaadin-list-mixin", 215 | "@vaadin/vaadin-login": "$@vaadin/vaadin-login", 216 | "@vaadin/vaadin-lumo-styles": "$@vaadin/vaadin-lumo-styles", 217 | "@vaadin/vaadin-material-styles": "$@vaadin/vaadin-material-styles", 218 | "@vaadin/vaadin-menu-bar": "$@vaadin/vaadin-menu-bar", 219 | "@vaadin/vaadin-messages": "$@vaadin/vaadin-messages", 220 | "@vaadin/vaadin-notification": "$@vaadin/vaadin-notification", 221 | "@vaadin/vaadin-ordered-layout": "$@vaadin/vaadin-ordered-layout", 222 | "@vaadin/vaadin-overlay": "$@vaadin/vaadin-overlay", 223 | "@vaadin/vaadin-progress-bar": "$@vaadin/vaadin-progress-bar", 224 | "@vaadin/vaadin-radio-button": "$@vaadin/vaadin-radio-button", 225 | "@vaadin/router": "$@vaadin/router", 226 | "@vaadin/vaadin-select": "$@vaadin/vaadin-select", 227 | "@vaadin/vaadin-split-layout": "$@vaadin/vaadin-split-layout", 228 | "@vaadin/vaadin-tabs": "$@vaadin/vaadin-tabs", 229 | "@vaadin/vaadin-template-renderer": "$@vaadin/vaadin-template-renderer", 230 | "@vaadin/vaadin-text-field": "$@vaadin/vaadin-text-field", 231 | "@vaadin/vaadin-themable-mixin": "$@vaadin/vaadin-themable-mixin", 232 | "@vaadin/vaadin-time-picker": "$@vaadin/vaadin-time-picker", 233 | "@vaadin/vaadin-upload": "$@vaadin/vaadin-upload", 234 | "@vaadin/vaadin-usage-statistics": "$@vaadin/vaadin-usage-statistics", 235 | "@vaadin/vaadin-virtual-list": "$@vaadin/vaadin-virtual-list", 236 | "@vaadin/vertical-layout": "$@vaadin/vertical-layout", 237 | "@vaadin/virtual-list": "$@vaadin/virtual-list", 238 | "@vaadin/board": "$@vaadin/board", 239 | "@vaadin/charts": "$@vaadin/charts", 240 | "@vaadin/confirm-dialog": "$@vaadin/confirm-dialog", 241 | "@vaadin/cookie-consent": "$@vaadin/cookie-consent", 242 | "@vaadin/crud": "$@vaadin/crud", 243 | "@vaadin/grid-pro": "$@vaadin/grid-pro", 244 | "@vaadin/rich-text-editor": "$@vaadin/rich-text-editor", 245 | "@vaadin/vaadin-board": "$@vaadin/vaadin-board", 246 | "@vaadin/vaadin-charts": "$@vaadin/vaadin-charts", 247 | "@vaadin/vaadin-confirm-dialog": "$@vaadin/vaadin-confirm-dialog", 248 | "@vaadin/vaadin-cookie-consent": "$@vaadin/vaadin-cookie-consent", 249 | "@vaadin/vaadin-crud": "$@vaadin/vaadin-crud", 250 | "@vaadin/vaadin-grid-pro": "$@vaadin/vaadin-grid-pro", 251 | "@vaadin/vaadin-rich-text-editor": "$@vaadin/vaadin-rich-text-editor", 252 | "@vaadin/bundles": "$@vaadin/bundles", 253 | "@vaadin/map": "$@vaadin/map", 254 | "@polymer/polymer": "$@polymer/polymer", 255 | "@vaadin/common-frontend": "$@vaadin/common-frontend", 256 | "construct-style-sheets-polyfill": "$construct-style-sheets-polyfill", 257 | "date-fns": "$date-fns", 258 | "lit": "$lit", 259 | "chokidar": "$chokidar", 260 | "line-awesome": "$line-awesome" 261 | }, 262 | "vaadin": { 263 | "dependencies": { 264 | "@polymer/iron-icon": "3.0.1", 265 | "@polymer/iron-iconset-svg": "3.0.1", 266 | "@polymer/iron-list": "3.1.0", 267 | "@polymer/iron-meta": "3.0.1", 268 | "@polymer/iron-resizable-behavior": "3.0.1", 269 | "@polymer/polymer": "3.4.1", 270 | "@vaadin/accordion": "23.0.4", 271 | "@vaadin/app-layout": "23.0.4", 272 | "@vaadin/avatar": "23.0.4", 273 | "@vaadin/avatar-group": "23.0.4", 274 | "@vaadin/board": "23.0.4", 275 | "@vaadin/bundles": "23.0.4", 276 | "@vaadin/button": "23.0.4", 277 | "@vaadin/charts": "23.0.4", 278 | "@vaadin/checkbox": "23.0.4", 279 | "@vaadin/checkbox-group": "23.0.4", 280 | "@vaadin/combo-box": "23.0.4", 281 | "@vaadin/common-frontend": "0.0.17", 282 | "@vaadin/component-base": "23.0.4", 283 | "@vaadin/confirm-dialog": "23.0.4", 284 | "@vaadin/context-menu": "23.0.4", 285 | "@vaadin/cookie-consent": "23.0.4", 286 | "@vaadin/crud": "23.0.4", 287 | "@vaadin/custom-field": "23.0.4", 288 | "@vaadin/date-picker": "23.0.4", 289 | "@vaadin/date-time-picker": "23.0.4", 290 | "@vaadin/details": "23.0.4", 291 | "@vaadin/dialog": "23.0.4", 292 | "@vaadin/email-field": "23.0.4", 293 | "@vaadin/field-base": "23.0.4", 294 | "@vaadin/field-highlighter": "23.0.2", 295 | "@vaadin/form-layout": "23.0.4", 296 | "@vaadin/grid": "23.0.4", 297 | "@vaadin/grid-pro": "23.0.4", 298 | "@vaadin/horizontal-layout": "23.0.4", 299 | "@vaadin/icon": "23.0.4", 300 | "@vaadin/icons": "23.0.4", 301 | "@vaadin/input-container": "23.0.4", 302 | "@vaadin/integer-field": "23.0.4", 303 | "@vaadin/item": "23.0.4", 304 | "@vaadin/list-box": "23.0.4", 305 | "@vaadin/login": "23.0.4", 306 | "@vaadin/map": "23.0.4", 307 | "@vaadin/menu-bar": "23.0.4", 308 | "@vaadin/message-input": "23.0.4", 309 | "@vaadin/message-list": "23.0.4", 310 | "@vaadin/notification": "23.0.4", 311 | "@vaadin/number-field": "23.0.4", 312 | "@vaadin/password-field": "23.0.4", 313 | "@vaadin/polymer-legacy-adapter": "23.0.4", 314 | "@vaadin/progress-bar": "23.0.4", 315 | "@vaadin/radio-group": "23.0.4", 316 | "@vaadin/rich-text-editor": "23.0.4", 317 | "@vaadin/router": "1.7.4", 318 | "@vaadin/scroller": "23.0.4", 319 | "@vaadin/select": "23.0.4", 320 | "@vaadin/split-layout": "23.0.4", 321 | "@vaadin/tabs": "23.0.4", 322 | "@vaadin/text-area": "23.0.4", 323 | "@vaadin/text-field": "23.0.4", 324 | "@vaadin/time-picker": "23.0.4", 325 | "@vaadin/upload": "23.0.4", 326 | "@vaadin/vaadin-accordion": "23.0.4", 327 | "@vaadin/vaadin-app-layout": "23.0.4", 328 | "@vaadin/vaadin-avatar": "23.0.4", 329 | "@vaadin/vaadin-board": "23.0.4", 330 | "@vaadin/vaadin-button": "23.0.4", 331 | "@vaadin/vaadin-charts": "23.0.4", 332 | "@vaadin/vaadin-checkbox": "23.0.4", 333 | "@vaadin/vaadin-combo-box": "23.0.4", 334 | "@vaadin/vaadin-confirm-dialog": "23.0.4", 335 | "@vaadin/vaadin-context-menu": "23.0.4", 336 | "@vaadin/vaadin-cookie-consent": "23.0.4", 337 | "@vaadin/vaadin-crud": "23.0.4", 338 | "@vaadin/vaadin-custom-field": "23.0.4", 339 | "@vaadin/vaadin-date-picker": "23.0.4", 340 | "@vaadin/vaadin-date-time-picker": "23.0.4", 341 | "@vaadin/vaadin-details": "23.0.4", 342 | "@vaadin/vaadin-development-mode-detector": "2.0.5", 343 | "@vaadin/vaadin-dialog": "23.0.4", 344 | "@vaadin/vaadin-form-layout": "23.0.4", 345 | "@vaadin/vaadin-grid": "23.0.4", 346 | "@vaadin/vaadin-grid-pro": "23.0.4", 347 | "@vaadin/vaadin-icon": "23.0.4", 348 | "@vaadin/vaadin-icons": "23.0.4", 349 | "@vaadin/vaadin-item": "23.0.4", 350 | "@vaadin/vaadin-list-box": "23.0.4", 351 | "@vaadin/vaadin-list-mixin": "23.0.4", 352 | "@vaadin/vaadin-login": "23.0.4", 353 | "@vaadin/vaadin-lumo-styles": "23.0.4", 354 | "@vaadin/vaadin-material-styles": "23.0.4", 355 | "@vaadin/vaadin-menu-bar": "23.0.4", 356 | "@vaadin/vaadin-messages": "23.0.4", 357 | "@vaadin/vaadin-notification": "23.0.4", 358 | "@vaadin/vaadin-ordered-layout": "23.0.4", 359 | "@vaadin/vaadin-overlay": "23.0.4", 360 | "@vaadin/vaadin-progress-bar": "23.0.4", 361 | "@vaadin/vaadin-radio-button": "23.0.4", 362 | "@vaadin/vaadin-rich-text-editor": "23.0.4", 363 | "@vaadin/vaadin-select": "23.0.4", 364 | "@vaadin/vaadin-split-layout": "23.0.4", 365 | "@vaadin/vaadin-tabs": "23.0.4", 366 | "@vaadin/vaadin-template-renderer": "23.0.4", 367 | "@vaadin/vaadin-text-field": "23.0.4", 368 | "@vaadin/vaadin-themable-mixin": "23.0.4", 369 | "@vaadin/vaadin-time-picker": "23.0.4", 370 | "@vaadin/vaadin-upload": "23.0.4", 371 | "@vaadin/vaadin-usage-statistics": "2.1.2", 372 | "@vaadin/vaadin-virtual-list": "23.0.4", 373 | "@vaadin/vertical-layout": "23.0.4", 374 | "@vaadin/virtual-list": "23.0.4", 375 | "construct-style-sheets-polyfill": "3.0.4", 376 | "date-fns": "2.23.0", 377 | "line-awesome": "1.3.0", 378 | "lit": "2.1.4" 379 | }, 380 | "devDependencies": { 381 | "chokidar": "^3.5.0", 382 | "compression-webpack-plugin": "4.0.1", 383 | "css-loader": "5.2.7", 384 | "esbuild-loader": "2.15.1", 385 | "extra-watch-webpack-plugin": "1.0.3", 386 | "extract-loader": "5.1.0", 387 | "file-loader": "6.2.0", 388 | "fork-ts-checker-webpack-plugin": "6.2.1", 389 | "glob": "7.1.6", 390 | "html-webpack-plugin": "4.5.1", 391 | "lit-css-loader": "0.1.0", 392 | "loader-utils": "2.0.0", 393 | "typescript": "4.5.3", 394 | "webpack": "4.46.0", 395 | "webpack-cli": "4.9.2", 396 | "webpack-dev-server": "4.7.4", 397 | "webpack-merge": "4.2.2", 398 | "workbox-core": "6.5.0", 399 | "workbox-precaching": "6.5.0", 400 | "workbox-webpack-plugin": "6.5.0" 401 | }, 402 | "hash": "89246753588e179493ee25be582b51d3a11fae5b1b8a6777ed56bbbcec51be88" 403 | } 404 | } 405 | -------------------------------------------------------------------------------- /pom-cli.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 4.0.0 7 | 8 | com.mongodb 9 | atlas-search-analysis 10 | 0.0.1 11 | 12 | atlas-search-analysis 13 | 14 | http://www.example.com 15 | 16 | 17 | 23.0.4 18 | UTF-8 19 | 1.8 20 | 1.8 21 | 22 | 23 | 24 | org.springframework.boot 25 | spring-boot-starter-parent 26 | 2.6.6 27 | 28 | 29 | 30 | 31 | org.springframework 32 | spring-web 33 | 3.0.4.RELEASE 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-starter-web 38 | 2.6.6 39 | 40 | 41 | junit 42 | junit 43 | 4.11 44 | test 45 | 46 | 47 | 48 | org.apache.lucene 49 | lucene-core 50 | 9.2.0 51 | 52 | 53 | 54 | org.apache.lucene 55 | lucene-analyzers-common 56 | 9.2.0 57 | 58 | 59 | 60 | org.apache.lucene 61 | lucene-analyzers-icu 62 | 9.2.0 63 | 64 | 65 | 66 | org.apache.lucene 67 | lucene-analyzers-phonetic 68 | 9.2.0 69 | 70 | 71 | org.apache.lucene 72 | lucene-analyzers-kuromoji 73 | 9.2.0 74 | 75 | 76 | org.apache.lucene 77 | lucene-analyzers-smartcn 78 | 9.2.0 79 | 80 | 81 | 82 | org.apache.lucene 83 | lucene-analyzers-nori 84 | 9.2.0 85 | 86 | 87 | org.apache.lucene 88 | lucene-analyzers-morfologik 89 | 9.2.0 90 | 91 | 92 | 93 | commons-cli 94 | commons-cli 95 | 1.4 96 | 97 | 98 | com.vaadin 99 | 100 | vaadin 101 | ${vaadin.version} 102 | 103 | 104 | com.vaadin 105 | vaadin-shared 106 | 8.15.0 107 | 108 | 109 | 110 | 111 | 112 | 114 | 115 | 116 | 117 | 118 | maven-clean-plugin 119 | 3.1.0 120 | 121 | 122 | 123 | maven-resources-plugin 124 | 3.0.2 125 | 126 | 127 | maven-compiler-plugin 128 | 3.8.0 129 | 130 | 131 | maven-surefire-plugin 132 | 2.22.1 133 | 134 | 135 | maven-jar-plugin 136 | 3.0.2 137 | 138 | 139 | maven-install-plugin 140 | 2.5.2 141 | 142 | 143 | maven-deploy-plugin 144 | 2.8.2 145 | 146 | 147 | 148 | maven-site-plugin 149 | 3.7.1 150 | 151 | 152 | maven-project-info-reports-plugin 153 | 3.0.0 154 | 155 | 156 | 157 | 158 | 159 | 160 | org.apache.maven.plugins 161 | maven-jar-plugin 162 | 163 | 164 | 165 | true 166 | lib/ 167 | com.mongodb.atlas.search.analysis.LuceneAnalyzer 168 | 169 | 170 | 171 | 172 | 173 | org.codehaus.mojo 174 | exec-maven-plugin 175 | 1.2.1 176 | 177 | com.mongodb.atlas.search.analysis.LuceneAnalyzer 178 | 179 | 180 | 181 | org.apache.maven.plugins 182 | maven-dependency-plugin 183 | 3.1.2 184 | 185 | 186 | copy-dependencies 187 | package 188 | 189 | copy-dependencies 190 | 191 | 192 | ${project.build.directory}/lib 193 | false 194 | false 195 | true 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | com.mongodb.application.search.analysis 6 | atlas-search-analysis 7 | 0.0.1 8 | Atlas Search Analysis 9 | jar 10 | 11 | 12 | 11 13 | 23.0.4 14 | 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-parent 19 | 2.6.6 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | central 28 | https://repo.maven.apache.org/maven2 29 | 30 | false 31 | 32 | 33 | 34 | vaadin-prereleases 35 | 36 | https://maven.vaadin.com/vaadin-prereleases/ 37 | 38 | 39 | 40 | 41 | Vaadin Directory 42 | https://maven.vaadin.com/vaadin-addons 43 | 44 | false 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | central 53 | https://repo.maven.apache.org/maven2 54 | 55 | false 56 | 57 | 58 | 59 | vaadin-prereleases 60 | 61 | https://maven.vaadin.com/vaadin-prereleases/ 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | com.vaadin 70 | vaadin-bom 71 | ${vaadin.version} 72 | pom 73 | import 74 | 75 | 76 | org.json 77 | json 78 | 79 | 80 | 81 | 82 | 83 | 84 | com.vaadin 85 | 86 | vaadin 87 | 88 | 89 | com.vaadin 90 | vaadin-spring-boot-starter 91 | 92 | 93 | org.springframework.boot 94 | spring-boot-starter-validation 95 | 96 | 97 | org.springframework.boot 98 | spring-boot-devtools 99 | true 100 | 101 | 102 | org.springframework.boot 103 | spring-boot-starter-test 104 | test 105 | 106 | 107 | com.vaadin 108 | vaadin-testbench 109 | test 110 | 111 | 112 | com.vaadin.componentfactory 113 | svg 114 | 1.1.1 115 | 116 | 117 | 118 | org.apache.lucene 119 | lucene-core 120 | 8.11.2 121 | 122 | 123 | 124 | org.apache.lucene 125 | lucene-analyzers-common 126 | 8.11.2 127 | 128 | 129 | 130 | org.apache.lucene 131 | lucene-analyzers-icu 132 | 8.11.2 133 | 134 | 135 | 136 | org.apache.lucene 137 | lucene-analyzers-phonetic 138 | 8.11.2 139 | 140 | 141 | org.apache.lucene 142 | lucene-analyzers-kuromoji 143 | 8.11.2 144 | 145 | 146 | org.apache.lucene 147 | lucene-analyzers-smartcn 148 | 8.11.2 149 | 150 | 151 | 152 | org.apache.lucene 153 | lucene-analyzers-nori 154 | 8.11.2 155 | 156 | 157 | org.apache.lucene 158 | lucene-analyzers-morfologik 159 | 8.11.2 160 | 161 | 162 | 163 | commons-cli 164 | commons-cli 165 | 1.4 166 | 167 | 168 | 169 | 170 | org.junit.vintage 171 | junit-vintage-engine 172 | test 173 | 174 | 175 | org.hamcrest 176 | hamcrest-core 177 | 178 | 179 | 180 | 181 | io.github.bonigarcia 182 | webdrivermanager 183 | 5.0.3 184 | test 185 | 186 | 187 | 188 | 189 | spring-boot:run 190 | 191 | 192 | org.springframework.boot 193 | spring-boot-maven-plugin 194 | 196 | 197 | 500 198 | 240 199 | 200 | 201 | 202 | 207 | 208 | com.vaadin 209 | vaadin-maven-plugin 210 | ${vaadin.version} 211 | 212 | 213 | 214 | prepare-frontend 215 | 216 | 217 | 218 | 219 | 220 | com.google.cloud.tools 221 | jib-maven-plugin 222 | 3.2.1 223 | 224 | 225 | com.mongodb.atlas.search.analysis.Application 226 | 227 | 228 | us-west1-docker.pkg.dev/atlas-search-analysis 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | production 239 | 240 | 241 | 242 | com.vaadin 243 | vaadin-maven-plugin 244 | ${vaadin.version} 245 | 246 | 247 | 248 | build-frontend 249 | 250 | compile 251 | 252 | 253 | 254 | true 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | it 263 | 264 | 265 | 266 | org.springframework.boot 267 | spring-boot-maven-plugin 268 | 269 | 270 | start-spring-boot 271 | pre-integration-test 272 | 273 | start 274 | 275 | 276 | 277 | stop-spring-boot 278 | post-integration-test 279 | 280 | stop 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | org.apache.maven.plugins 289 | maven-failsafe-plugin 290 | 291 | 292 | 293 | integration-test 294 | verify 295 | 296 | 297 | 298 | 299 | false 300 | true 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | -------------------------------------------------------------------------------- /src/main/java/com/mongodb/atlas/search/analysis/Application.java: -------------------------------------------------------------------------------- 1 | package com.mongodb.atlas.search.analysis; 2 | 3 | import com.vaadin.flow.component.dependency.NpmPackage; 4 | import com.vaadin.flow.component.page.AppShellConfigurator; 5 | import com.vaadin.flow.server.PWA; 6 | import com.vaadin.flow.theme.Theme; 7 | import org.springframework.boot.SpringApplication; 8 | import org.springframework.boot.autoconfigure.SpringBootApplication; 9 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 10 | 11 | /** 12 | * The entry point of the Spring Boot application. 13 | * 14 | * Use the @PWA annotation make the application installable on phones, tablets 15 | * and some desktop browsers. 16 | * 17 | */ 18 | @SpringBootApplication 19 | @Theme(value = "atlassearchanalysis") 20 | @PWA(name = "Atlas Search Analysis", shortName = "Atlas Search Analysis", offlineResources = {}) 21 | @NpmPackage(value = "line-awesome", version = "1.3.0") 22 | public class Application extends SpringBootServletInitializer implements AppShellConfigurator { 23 | 24 | /** 25 | * 26 | */ 27 | private static final long serialVersionUID = 1L; 28 | 29 | public static void main(String[] args) { 30 | SpringApplication.run(Application.class, args); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/mongodb/atlas/search/analysis/views/MainLayout.java: -------------------------------------------------------------------------------- 1 | package com.mongodb.atlas.search.analysis.views; 2 | 3 | 4 | import com.mongodb.atlas.search.analysis.views.about.AboutView; 5 | import com.mongodb.atlas.search.analysis.views.analysis.AnalysisView; 6 | import com.vaadin.flow.component.Component; 7 | import com.vaadin.flow.component.applayout.AppLayout; 8 | import com.vaadin.flow.component.applayout.DrawerToggle; 9 | import com.vaadin.flow.component.button.ButtonVariant; 10 | import com.vaadin.flow.component.dependency.NpmPackage; 11 | import com.vaadin.flow.component.html.Footer; 12 | import com.vaadin.flow.component.html.H1; 13 | import com.vaadin.flow.component.html.H2; 14 | import com.vaadin.flow.component.html.Header; 15 | import com.vaadin.flow.component.html.ListItem; 16 | import com.vaadin.flow.component.html.Nav; 17 | import com.vaadin.flow.component.html.Span; 18 | import com.vaadin.flow.component.html.UnorderedList; 19 | import com.vaadin.flow.router.PageTitle; 20 | import com.vaadin.flow.router.RouterLink; 21 | 22 | /** 23 | * The main view is a top-level placeholder for other views. 24 | */ 25 | public class MainLayout extends AppLayout { 26 | 27 | /** 28 | * 29 | */ 30 | private static final long serialVersionUID = 1L; 31 | 32 | /** 33 | * A simple navigation item component, based on ListItem element. 34 | */ 35 | public static class MenuItemInfo extends ListItem { 36 | 37 | /** 38 | * 39 | */ 40 | private static final long serialVersionUID = 1L; 41 | private final Class view; 42 | 43 | public MenuItemInfo(String menuTitle, String iconClass, Class view) { 44 | this.view = view; 45 | RouterLink link = new RouterLink(); 46 | link.addClassNames("menu-item-link"); 47 | link.setRoute(view); 48 | 49 | Span text = new Span(menuTitle); 50 | text.addClassNames("menu-item-text"); 51 | 52 | link.add(new LineAwesomeIcon(iconClass), text); 53 | add(link); 54 | } 55 | 56 | public Class getView() { 57 | return view; 58 | } 59 | 60 | /** 61 | * Simple wrapper to create icons using LineAwesome iconset. See 62 | * https://icons8.com/line-awesome 63 | */ 64 | @NpmPackage(value = "line-awesome", version = "1.3.0") 65 | public static class LineAwesomeIcon extends Span { 66 | /** 67 | * 68 | */ 69 | private static final long serialVersionUID = 1L; 70 | 71 | public LineAwesomeIcon(String lineawesomeClassnames) { 72 | addClassNames("menu-item-icon"); 73 | if (!lineawesomeClassnames.isEmpty()) { 74 | addClassNames(lineawesomeClassnames); 75 | } 76 | } 77 | } 78 | 79 | } 80 | 81 | private H1 viewTitle; 82 | 83 | public MainLayout() { 84 | setPrimarySection(Section.DRAWER); 85 | addToNavbar(true, createHeaderContent()); 86 | addToDrawer(createDrawerContent()); 87 | } 88 | 89 | private Component createHeaderContent() { 90 | DrawerToggle toggle = new DrawerToggle(); 91 | toggle.addClassNames("view-toggle"); 92 | toggle.addThemeVariants(ButtonVariant.LUMO_CONTRAST); 93 | toggle.getElement().setAttribute("aria-label", "Menu toggle"); 94 | 95 | viewTitle = new H1(); 96 | viewTitle.addClassNames("view-title"); 97 | 98 | Header header = new Header(toggle, viewTitle); 99 | header.addClassNames("view-header"); 100 | return header; 101 | } 102 | 103 | private Component createDrawerContent() { 104 | H2 appName = new H2("Atlas Search Analysis"); 105 | appName.addClassNames("app-name"); 106 | 107 | com.vaadin.flow.component.html.Section section = new com.vaadin.flow.component.html.Section(appName, 108 | createNavigation(), createFooter()); 109 | section.addClassNames("drawer-section"); 110 | return section; 111 | } 112 | 113 | private Nav createNavigation() { 114 | Nav nav = new Nav(); 115 | nav.addClassNames("menu-item-container"); 116 | nav.getElement().setAttribute("aria-labelledby", "views"); 117 | 118 | // Wrap the links in a list; improves accessibility 119 | UnorderedList list = new UnorderedList(); 120 | list.addClassNames("navigation-list"); 121 | nav.add(list); 122 | 123 | for (MenuItemInfo menuItem : createMenuItems()) { 124 | list.add(menuItem); 125 | 126 | } 127 | return nav; 128 | } 129 | 130 | private MenuItemInfo[] createMenuItems() { 131 | return new MenuItemInfo[]{ // 132 | new MenuItemInfo("Analysis", "la la-search", AnalysisView.class), // 133 | 134 | new MenuItemInfo("About", "la la-file", AboutView.class), // 135 | 136 | }; 137 | } 138 | 139 | private Footer createFooter() { 140 | Footer layout = new Footer(); 141 | layout.addClassNames("footer"); 142 | 143 | return layout; 144 | } 145 | 146 | @Override 147 | protected void afterNavigation() { 148 | super.afterNavigation(); 149 | viewTitle.setText(getCurrentPageTitle()); 150 | } 151 | 152 | private String getCurrentPageTitle() { 153 | PageTitle title = getContent().getClass().getAnnotation(PageTitle.class); 154 | return title == null ? "" : title.value(); 155 | } 156 | } 157 | -------------------------------------------------------------------------------- /src/main/java/com/mongodb/atlas/search/analysis/views/about/AboutView.java: -------------------------------------------------------------------------------- 1 | package com.mongodb.atlas.search.analysis.views.about; 2 | 3 | import com.mongodb.atlas.search.analysis.views.MainLayout; 4 | import com.vaadin.flow.component.html.Anchor; 5 | import com.vaadin.flow.component.html.Div; 6 | import com.vaadin.flow.component.html.H2; 7 | import com.vaadin.flow.component.html.Image; 8 | import com.vaadin.flow.component.html.Paragraph; 9 | import com.vaadin.flow.component.orderedlayout.VerticalLayout; 10 | import com.vaadin.flow.component.svg.Svg; 11 | import com.vaadin.flow.component.svg.elements.Path; 12 | import com.vaadin.flow.dom.StyleUtil; 13 | import com.vaadin.flow.dom.Style; 14 | import com.vaadin.flow.router.PageTitle; 15 | import com.vaadin.flow.router.Route; 16 | 17 | @PageTitle("About") 18 | @Route(value = "about", layout = MainLayout.class) 19 | public class AboutView extends VerticalLayout { 20 | 21 | /** 22 | * 23 | */ 24 | private static final long serialVersionUID = 1L; 25 | 26 | public AboutView() { 27 | setSpacing(false); 28 | 29 | Image img = new Image("images/atlas-search.png", "MongoDB Atlas Search"); 30 | img.setWidth("200px"); 31 | add(img); 32 | 33 | add(new H2("MongoDB Atlas Search Analysis")); 34 | add(new Paragraph("Built for Ethan Steininger 😁")); 35 | 36 | Svg gitIcon = new Svg(); 37 | gitIcon.viewbox(0, 0, 24, 24); 38 | Path path = new Path("path", 39 | "M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.6-1.4-1.4-1.8-1.4-1.8-1-.7.1-.7.1-.7 1.2 0 1.9 1.2 1.9 1.2 1 1.8 2.8 1.3 3.5 1 0-.8.4-1.3.7-1.6-2.7-.3-5.5-1.3-5.5-6 0-1.2.5-2.3 1.3-3.1-.2-.4-.6-1.6 0-3.2 0 0 1-.3 3.4 1.2a11.5 11.5 0 0 1 6 0c2.3-1.5 3.3-1.2 3.3-1.2.6 1.6.2 2.8 0 3.2.9.8 1.3 1.9 1.3 3.2 0 4.6-2.8 5.6-5.5 5.9.5.4.9 1 .9 2.2v3.3c0 .3.1.7.8.6A12 12 0 0 0 12 .3"); 40 | gitIcon.add(path); 41 | gitIcon.setWidth("100%"); 42 | gitIcon.setHeight("32px"); 43 | gitIcon.getStyle().set("fill","#00684aff"); 44 | Div outerDiv = new Div(); 45 | Div iconDiv = new Div(); 46 | iconDiv.add(gitIcon); 47 | iconDiv.getStyle().set("float", "left").set("padding-right", "10px"); 48 | Div textDiv = new Div(); 49 | Anchor a = new Anchor( 50 | "https://github.com/10gen/lucene-search-analysis", 51 | "Check this out on GitHub"); 52 | textDiv.add(a); 53 | textDiv.getStyle().set("float", "left").set("clear", "none"); 54 | outerDiv.add(iconDiv, textDiv); 55 | add(outerDiv); 56 | 57 | setSizeFull(); 58 | setJustifyContentMode(JustifyContentMode.CENTER); 59 | setDefaultHorizontalComponentAlignment(Alignment.CENTER); 60 | getStyle().set("text-align", "center"); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/mongodb/atlas/search/analysis/views/analysis/AnalysisView.java: -------------------------------------------------------------------------------- 1 | package com.mongodb.atlas.search.analysis.views.analysis; 2 | 3 | import java.io.InputStream; 4 | import java.nio.charset.StandardCharsets; 5 | import java.util.logging.Logger; 6 | 7 | import org.apache.lucene.analysis.Analyzer; 8 | import org.apache.lucene.analysis.core.KeywordAnalyzer; 9 | import org.apache.lucene.analysis.core.SimpleAnalyzer; 10 | import org.apache.lucene.analysis.core.WhitespaceAnalyzer; 11 | import org.apache.lucene.analysis.standard.StandardAnalyzer; 12 | 13 | import com.mongodb.atlas.search.analysis.LuceneAnalyzer; 14 | import com.mongodb.atlas.search.analysis.views.MainLayout; 15 | import com.vaadin.flow.component.Component; 16 | import com.vaadin.flow.component.button.Button; 17 | import com.vaadin.flow.component.button.ButtonVariant; 18 | import com.vaadin.flow.component.combobox.ComboBox; 19 | import com.vaadin.flow.component.formlayout.FormLayout; 20 | import com.vaadin.flow.component.html.Div; 21 | import com.vaadin.flow.component.html.Image; 22 | import com.vaadin.flow.component.html.Span; 23 | import com.vaadin.flow.component.orderedlayout.HorizontalLayout; 24 | import com.vaadin.flow.component.select.Select; 25 | import com.vaadin.flow.component.textfield.IntegerField; 26 | import com.vaadin.flow.component.textfield.TextArea; 27 | import com.vaadin.flow.component.textfield.TextField; 28 | import com.vaadin.flow.component.upload.Upload; 29 | import com.vaadin.flow.component.upload.receivers.MemoryBuffer; 30 | import com.vaadin.flow.router.PageTitle; 31 | import com.vaadin.flow.router.Route; 32 | import com.vaadin.flow.router.RouteAlias; 33 | 34 | import elemental.json.Json; 35 | import elemental.json.JsonObject; 36 | import elemental.json.impl.JsonUtil; 37 | 38 | @PageTitle("Analysis") 39 | @Route(value = "analysis", layout = MainLayout.class) 40 | @RouteAlias(value = "", layout = MainLayout.class) 41 | public class AnalysisView extends Div { 42 | 43 | /** 44 | * 45 | */ 46 | private static final long serialVersionUID = 1L; 47 | private final static Logger logger = Logger.getLogger(AnalysisView.class.getName()); 48 | private Select analyzer = new Select(); 49 | private String selectedAnalyzer = new String("Standard"); 50 | private Select operator = new Select(); 51 | private String selectedOperator = new String("Text"); 52 | private String selectedLanguage = new String(); 53 | private Select tokenizer = new Select(); 54 | private String selectedTokenizer = new String("edgeNGram"); 55 | private IntegerField minGram = new IntegerField(); 56 | private IntegerField maxGram = new IntegerField(); 57 | private ComboBox language = new ComboBox<>("Language"); 58 | private TextField textToAnalyze = new TextField("Text to analyze"); 59 | private TextField customAnalyzer = new TextField("Name of custom analyzer"); 60 | private TextArea indexDefinition = new TextArea("Index definition"); 61 | private Div output = new Div(); 62 | private JsonObject indexDef = null; 63 | MemoryBuffer memoryBuffer = new MemoryBuffer(); 64 | Upload defUpload = new Upload(memoryBuffer); 65 | 66 | private Button clear = new Button("Clear"); 67 | private Button submit = new Button("Analyze"); 68 | 69 | public AnalysisView() { 70 | addClassName("analysis-view"); 71 | 72 | add(createTitle()); 73 | add(createFormLayout()); 74 | add(createButtonLayout()); 75 | 76 | clear.addClickListener(e -> { 77 | clearOutput(); 78 | }); 79 | submit.addClickListener(e -> { 80 | /* 81 | logger.info("Analyzer: " + selectedAnalyzer); 82 | if (selectedAnalyzer.equalsIgnoreCase("language")) { 83 | logger.info("Language: " + selectedLanguage); 84 | } 85 | logger.info("Text: " + textToAnalyze.getValue()); 86 | logger.info("Operator: " + selectedOperator); 87 | logger.info("Tokenizer: " + selectedTokenizer); 88 | logger.info("MinGram: " + minGram.getValue()); 89 | logger.info("MaxGram: " + maxGram.getValue()); 90 | */ 91 | LuceneAnalyzer luceneAnalyzer = new LuceneAnalyzer(); 92 | Analyzer analyzer = null; 93 | String result = null; 94 | 95 | try { 96 | if (null != selectedOperator && selectedOperator.equalsIgnoreCase("autocomplete")) { 97 | analyzer = luceneAnalyzer.buildAutocompleteAnalyzer(selectedTokenizer, minGram.getValue().toString(), maxGram.getValue().toString()); 98 | } else { 99 | switch (selectedAnalyzer.toLowerCase()) { 100 | case "simple": 101 | analyzer = new SimpleAnalyzer(); 102 | break; 103 | 104 | case "standard": 105 | analyzer = new StandardAnalyzer(); 106 | break; 107 | 108 | case "whitespace": 109 | analyzer = new WhitespaceAnalyzer(); 110 | break; 111 | 112 | case "keyword": 113 | analyzer = new KeywordAnalyzer(); 114 | break; 115 | 116 | case "language": 117 | analyzer = luceneAnalyzer.getLanguageAnalyzer(selectedLanguage); 118 | if (null == analyzer) { 119 | setError(null == selectedLanguage || selectedLanguage.trim().length() == 0 ? "Language is required" : "Unsupported language " + selectedLanguage); 120 | } 121 | break; 122 | 123 | case "custom": 124 | analyzer = luceneAnalyzer.buildCustomAnalyzer(indexDef, customAnalyzer.getValue()); 125 | if (null == analyzer) { 126 | setError("Unable to construct the custom analyzer from the index definition"); 127 | } 128 | break; 129 | } // end switch 130 | } // end if selectedOperator.equalsIgnoreCase("autocomplete") 131 | 132 | if (null != analyzer) { 133 | String text = textToAnalyze.getValue(); 134 | if (null == text || text.trim().length() == 0) { 135 | setError("Text to analyze is required"); 136 | } else { 137 | result = luceneAnalyzer.printTokens(analyzer, textToAnalyze.getValue(), selectedOperator, selectedTokenizer, minGram.getValue().toString(), maxGram.getValue().toString()); 138 | if (null != result) { 139 | logger.info(result); 140 | output.getElement().setProperty("innerHTML", result); 141 | } 142 | } 143 | } 144 | } catch (Exception ex) { 145 | setError(ex.getLocalizedMessage()); 146 | } 147 | 148 | }); 149 | } 150 | 151 | private void setError(String error) { 152 | output.getElement().setProperty("innerHTML", "" + error + ""); 153 | } 154 | 155 | private void clearOutput() { 156 | output.getElement().setProperty("innerHTML", ""); 157 | } 158 | 159 | private Component createTitle() { 160 | Image img = new Image("images/mongodb-atlas.png", "MongoDB Atlas Search"); 161 | img.setWidth("200px"); 162 | img.getStyle().set("margin-top", "20px"); 163 | return img; 164 | 165 | //return new H3("Atlas Search Analysis"); 166 | } 167 | 168 | private Component createFormLayout() { 169 | FormLayout formLayout = new FormLayout(); 170 | formLayout.add(operator, tokenizer, minGram, maxGram, analyzer, language, 171 | textToAnalyze, defUpload, indexDefinition, customAnalyzer, output); 172 | return formLayout; 173 | } 174 | 175 | private Component createButtonLayout() { 176 | HorizontalLayout buttonLayout = new HorizontalLayout(); 177 | buttonLayout.addClassName("button-layout"); 178 | 179 | //textToAnalyze.setRequired(true); 180 | textToAnalyze.setRequiredIndicatorVisible(true); 181 | textToAnalyze.setErrorMessage("This field is required"); 182 | textToAnalyze.addValueChangeListener(event -> { 183 | clearOutput(); 184 | }); 185 | 186 | String[] analyzers = {"Standard", "Simple", "Whitespace", "Language", "Keyword", "Custom"}; 187 | analyzer.setItems(analyzers); 188 | analyzer.setLabel("Analyzer"); 189 | analyzer.setPlaceholder("Select an analyzer"); 190 | analyzer.addValueChangeListener(event -> { 191 | clearOutput(); 192 | selectedAnalyzer = event.getValue(); 193 | language.setVisible(selectedAnalyzer.equalsIgnoreCase("language")); 194 | customAnalyzer.setVisible(selectedAnalyzer.equalsIgnoreCase("custom")); 195 | indexDefinition.setVisible(selectedAnalyzer.equalsIgnoreCase("custom")); 196 | defUpload.setVisible(selectedAnalyzer.equalsIgnoreCase("custom")); 197 | }); 198 | 199 | String[] operators = {"Text", "Autocomplete"}; 200 | operator.setItems(operators); 201 | operator.setLabel("Operator"); 202 | operator.setPlaceholder("Select a query operator"); 203 | operator.addValueChangeListener(event -> { 204 | clearOutput(); 205 | selectedOperator = event.getValue(); 206 | tokenizer.setVisible(selectedOperator.equalsIgnoreCase("autocomplete")); 207 | minGram.setVisible(selectedOperator.equalsIgnoreCase("autocomplete")); 208 | maxGram.setVisible(selectedOperator.equalsIgnoreCase("autocomplete")); 209 | analyzer.setVisible(!selectedOperator.equalsIgnoreCase("autocomplete")); 210 | customAnalyzer.setVisible(!selectedOperator.equalsIgnoreCase("autocomplete")); 211 | defUpload.setVisible(!selectedOperator.equalsIgnoreCase("autocomplete")); 212 | indexDefinition.setVisible(!selectedOperator.equalsIgnoreCase("autocomplete")); 213 | if (selectedOperator.equalsIgnoreCase("autocomplete")) { 214 | customAnalyzer.clear(); 215 | } 216 | }); 217 | 218 | String[] tokenizers = {"edgeNGram", "nGram"}; 219 | tokenizer.setItems(tokenizers); 220 | tokenizer.setLabel("Tokenizer"); 221 | tokenizer.setPlaceholder("Select an autocomplete tokenizer"); 222 | tokenizer.addValueChangeListener(event -> { 223 | clearOutput(); 224 | selectedTokenizer = event.getValue(); 225 | }); 226 | 227 | minGram.setLabel("MinGram"); 228 | maxGram.setLabel("MaxGram"); 229 | minGram.setValue(2); 230 | minGram.setMin(1); 231 | minGram.setMax(15); 232 | maxGram.setValue(3); 233 | maxGram.setMin(1); 234 | maxGram.setMax(15); 235 | minGram.setHasControls(true); 236 | maxGram.setHasControls(true); 237 | 238 | String[] languages = { 239 | "lucene.arabic", 240 | "lucene.armenian", 241 | "lucene.basque", 242 | "lucene.bengali", 243 | "lucene.brazilian", 244 | "lucene.bulgarian", 245 | "lucene.catalan", 246 | "lucene.cjk 1", 247 | "lucene.czech", 248 | "lucene.danish", 249 | "lucene.dutch", 250 | "lucene.english", 251 | "lucene.finnish", 252 | "lucene.french", 253 | "lucene.galician", 254 | "lucene.german", 255 | "lucene.greek", 256 | "lucene.hindi", 257 | "lucene.hungarian", 258 | "lucene.indonesian", 259 | "lucene.irish", 260 | "lucene.italian", 261 | "lucene.japanese", 262 | "lucene.korean", 263 | "lucene.latvian", 264 | "lucene.lithuanian", 265 | "lucene.morfologik", 266 | "lucene.norwegian", 267 | "lucene.persian", 268 | "lucene.portuguese", 269 | "lucene.romanian", 270 | "lucene.russian", 271 | "lucene.smartcn 5", 272 | "lucene.sorani", 273 | "lucene.spanish", 274 | "lucene.swedish", 275 | "lucene.thai", 276 | "lucene.turkish", 277 | "lucene.ukrainian"}; 278 | language.setItems(languages); 279 | language.setPlaceholder("Select a language"); 280 | language.setVisible(false); 281 | language.addValueChangeListener(event -> { 282 | clearOutput(); 283 | selectedLanguage = event.getValue(); 284 | }); 285 | 286 | customAnalyzer.setVisible(false); 287 | tokenizer.setVisible(false); 288 | indexDefinition.setVisible(false); 289 | defUpload.setVisible(false); 290 | minGram.setVisible(false); 291 | maxGram.setVisible(false); 292 | output.setVisible(true); 293 | //output.setHeight("200px"); 294 | output.setWidth("100%"); 295 | 296 | defUpload.setDropLabel(new Span("Drop index definition file here")); 297 | defUpload.addSucceededListener(event -> { 298 | clearOutput(); 299 | indexDefinition.clear(); 300 | 301 | // Get information about the uploaded file 302 | InputStream fileData = memoryBuffer.getInputStream(); 303 | long contentLength = event.getContentLength(); 304 | String mimeType = event.getMIMEType(); 305 | if (contentLength <= 0) { 306 | setError("Empty definition file"); 307 | } else if (!mimeType.equals("application/json")) { 308 | setError("Encountered " + mimeType + " file -- expecting JSON"); 309 | } else { 310 | // Do something with the file data 311 | try { 312 | String jsonString = new String(fileData.readAllBytes(), StandardCharsets.UTF_8); 313 | indexDef = Json.parse(jsonString); 314 | indexDefinition.setValue(JsonUtil.stringify(indexDef, 2)); 315 | } catch (Exception ex) { 316 | setError(ex.getLocalizedMessage()); 317 | } 318 | } 319 | }); 320 | 321 | indexDefinition.addValueChangeListener(event -> { 322 | indexDef = Json.parse(event.getValue()); 323 | }); 324 | 325 | submit.addThemeVariants(ButtonVariant.LUMO_PRIMARY); 326 | buttonLayout.add(submit); 327 | buttonLayout.add(clear); 328 | return buttonLayout; 329 | } 330 | } 331 | -------------------------------------------------------------------------------- /src/main/java/org/apache/lucene/analysis/charfilter/AtlasSearchMappingCharFilter.java: -------------------------------------------------------------------------------- 1 | package org.apache.lucene.analysis.charfilter; 2 | 3 | import java.io.Reader; 4 | 5 | public class AtlasSearchMappingCharFilter extends MappingCharFilter { 6 | 7 | public AtlasSearchMappingCharFilter(NormalizeCharMap normMap, Reader input) { 8 | super(normMap, input); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/org/apache/lucene/analysis/charfilter/AtlasSearchMappingCharFilterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.lucene.analysis.charfilter; 18 | 19 | 20 | import java.io.IOException; 21 | import java.io.Reader; 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | import java.util.Map; 25 | import java.util.regex.Matcher; 26 | import java.util.regex.Pattern; 27 | 28 | import org.apache.lucene.analysis.util.CharFilterFactory; 29 | import org.apache.lucene.analysis.util.ResourceLoader; 30 | import org.apache.lucene.analysis.util.ResourceLoaderAware; 31 | 32 | /** 33 | * Alternate factory for {@link MappingCharFilter} that reads mappings as strings 34 | * instead of loading them from files. 35 | * 36 | * @author Roy Kiesler 37 | * @lucene.spi {@value #NAME} 38 | */ 39 | public class AtlasSearchMappingCharFilterFactory extends CharFilterFactory implements 40 | ResourceLoaderAware { 41 | 42 | /** SPI name */ 43 | public static final String NAME = "mapping"; 44 | 45 | protected NormalizeCharMap normMap; 46 | protected String mapping; 47 | 48 | /** Creates a new MappingCharFilterFactory */ 49 | public AtlasSearchMappingCharFilterFactory(Map args) { 50 | super(args); 51 | mapping = get(args, "mapping"); 52 | if (!args.isEmpty()) { 53 | throw new IllegalArgumentException("Unknown parameters: " + args); 54 | } 55 | } 56 | 57 | @Override 58 | public void inform(ResourceLoader loader) throws IOException { 59 | if (mapping != null) { 60 | List wlist = null; 61 | List files = splitFileNames(mapping); 62 | wlist = new ArrayList<>(); 63 | for (String file : files) { 64 | wlist.add(file.trim()); 65 | } 66 | final NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder(); 67 | parseRules(wlist, builder); 68 | normMap = builder.build(); 69 | if (normMap.map == null) { 70 | // if the inner FST is null, it means it accepts nothing (e.g. the file is empty) 71 | // so just set the whole map to null 72 | normMap = null; 73 | } 74 | } 75 | } 76 | 77 | @Override 78 | public Reader create(Reader input) { 79 | // if the map is null, it means there's actually no mappings... just return the original stream 80 | // as there is nothing to do here. 81 | return normMap == null ? input : new AtlasSearchMappingCharFilter(normMap,input); 82 | } 83 | 84 | @Override 85 | public Reader normalize(Reader input) { 86 | return create(input); 87 | } 88 | 89 | // "source" => "target" 90 | static Pattern p = Pattern.compile( "\"(.*)\"\\s*=>\\s*\"(.*)\"\\s*$" ); 91 | 92 | protected void parseRules( List rules, NormalizeCharMap.Builder builder ){ 93 | for( String rule : rules ){ 94 | Matcher m = p.matcher( rule ); 95 | if( !m.find() ) 96 | throw new IllegalArgumentException("Invalid Mapping Rule : [" + rule + "], file = " + mapping); 97 | builder.add( parseString( m.group( 1 ) ), parseString( m.group( 2 ) ) ); 98 | } 99 | } 100 | 101 | char[] out = new char[256]; 102 | 103 | protected String parseString( String s ){ 104 | int readPos = 0; 105 | int len = s.length(); 106 | int writePos = 0; 107 | while( readPos < len ){ 108 | char c = s.charAt( readPos++ ); 109 | if( c == '\\' ){ 110 | if( readPos >= len ) 111 | throw new IllegalArgumentException("Invalid escaped char in [" + s + "]"); 112 | c = s.charAt( readPos++ ); 113 | switch( c ) { 114 | case '\\' : c = '\\'; break; 115 | case '"' : c = '"'; break; 116 | case 'n' : c = '\n'; break; 117 | case 't' : c = '\t'; break; 118 | case 'r' : c = '\r'; break; 119 | case 'b' : c = '\b'; break; 120 | case 'f' : c = '\f'; break; 121 | case 'u' : 122 | if( readPos + 3 >= len ) 123 | throw new IllegalArgumentException("Invalid escaped char in [" + s + "]"); 124 | c = (char)Integer.parseInt( s.substring( readPos, readPos + 4 ), 16 ); 125 | readPos += 4; 126 | break; 127 | } 128 | } 129 | out[writePos++] = c; 130 | } 131 | return new String( out, 0, writePos ); 132 | } 133 | 134 | } 135 | -------------------------------------------------------------------------------- /src/main/java/org/apache/lucene/analysis/core/AtlasSearchStopFilterFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.apache.lucene.analysis.core; 18 | 19 | 20 | import java.io.IOException; 21 | import java.util.Arrays; 22 | import java.util.Collection; 23 | import java.util.Map; 24 | 25 | import org.apache.lucene.analysis.CharArraySet; 26 | import org.apache.lucene.analysis.TokenStream; 27 | import org.apache.lucene.analysis.en.EnglishAnalyzer; 28 | import org.apache.lucene.analysis.util.ResourceLoader; 29 | import org.apache.lucene.analysis.util.ResourceLoaderAware; 30 | import org.apache.lucene.analysis.util.TokenFilterFactory; 31 | 32 | /** 33 | * Alternate factory for {@link StopFilter} that reads tokens as strings 34 | * instead of loading them from files. 35 | * 36 | * @author Roy Kiesler 37 | * @lucene.spi {@value #NAME} 38 | */ 39 | public class AtlasSearchStopFilterFactory extends TokenFilterFactory implements ResourceLoaderAware { 40 | 41 | /** SPI name */ 42 | public static final String NAME = "stop"; 43 | 44 | public static final String FORMAT_WORDSET = "wordset"; 45 | public static final String FORMAT_SNOWBALL = "snowball"; 46 | 47 | private CharArraySet stopWords; 48 | private final String stopWordFiles; 49 | private final String format; 50 | private final boolean ignoreCase; 51 | 52 | /** Creates a new StopFilterFactory */ 53 | public AtlasSearchStopFilterFactory(Map args) { 54 | super(args); 55 | stopWordFiles = get(args, "words"); 56 | format = get(args, "format", (null == stopWordFiles ? null : FORMAT_WORDSET)); 57 | ignoreCase = getBoolean(args, "ignoreCase", false); 58 | if (!args.isEmpty()) { 59 | throw new IllegalArgumentException("Unknown parameters: " + args); 60 | } 61 | } 62 | 63 | @Override 64 | public void inform(ResourceLoader loader) throws IOException { 65 | if (stopWordFiles != null) { 66 | if (FORMAT_WORDSET.equalsIgnoreCase(format)) { 67 | String[] words = stopWordFiles.split(","); 68 | stopWords = new CharArraySet((Collection) Arrays.asList(words), ignoreCase); 69 | } else if (FORMAT_SNOWBALL.equalsIgnoreCase(format)) { 70 | // TODO: Atlas Search doesn't expose `format` at this point 71 | stopWords = getSnowballWordSet(loader, stopWordFiles, ignoreCase); 72 | } else { 73 | throw new IllegalArgumentException("Unknown 'format' specified for 'words' file: " + format); 74 | } 75 | } else { 76 | if (null != format) { 77 | throw new IllegalArgumentException("'format' can not be specified w/o an explicit 'words' file: " + format); 78 | } 79 | stopWords = new CharArraySet(EnglishAnalyzer.ENGLISH_STOP_WORDS_SET, ignoreCase); 80 | } 81 | } 82 | 83 | public boolean isIgnoreCase() { 84 | return ignoreCase; 85 | } 86 | 87 | public CharArraySet getStopWords() { 88 | return stopWords; 89 | } 90 | 91 | @Override 92 | public TokenStream create(TokenStream input) { 93 | StopFilter stopFilter = new StopFilter(input,stopWords); 94 | return stopFilter; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/resources/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/src/main/resources/META-INF/resources/icons/icon.png -------------------------------------------------------------------------------- /src/main/resources/META-INF/resources/images/atlas-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/src/main/resources/META-INF/resources/images/atlas-search.png -------------------------------------------------------------------------------- /src/main/resources/META-INF/resources/images/empty-plant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/src/main/resources/META-INF/resources/images/empty-plant.png -------------------------------------------------------------------------------- /src/main/resources/META-INF/resources/images/mongodb-atlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/src/main/resources/META-INF/resources/images/mongodb-atlas.png -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=${PORT:8080} 2 | logging.level.org.atmosphere = warn 3 | spring.mustache.check-template-location = false 4 | 5 | # Launch the default browser when starting the application in development mode 6 | vaadin.launch-browser=true 7 | # To improve the performance during development. 8 | # For more information https://vaadin.com/docs/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters 9 | vaadin.whitelisted-packages = com.vaadin,org.vaadin,dev.hilla,com.mongodb.application.search.analysis 10 | -------------------------------------------------------------------------------- /src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _ _ _ ____ _ _ _ _ 2 | / \ | |_ | | __ _ ___ / ___| ___ __ _ _ __ ___ | |__ / \ _ __ __ _ | | _ _ ___ (_) ___ 3 | / _ \ | __|| | / _` |/ __| \___ \ / _ \ / _` || '__| / __|| '_ \ / _ \ | '_ \ / _` || || | | |/ __|| |/ __| 4 | / ___ \ | |_ | || (_| |\__ \ ___) || __/| (_| || | | (__ | | | | / ___ \ | | | || (_| || || |_| |\__ \| |\__ \ 5 | /_/ \_\ \__||_| \__,_||___/ |____/ \___| \__,_||_| \___||_| |_| /_/ \_\|_| |_| \__,_||_| \__, ||___/|_||___/ 6 | |___/ 7 | -------------------------------------------------------------------------------- /src/main/resources/vaadin_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mongodb-developer/lucene-search-analysis/2029c40ef803fd9f54debac21928de23317ea298/src/main/resources/vaadin_app.png -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | // This TypeScript configuration file is generated by vaadin-maven-plugin. 2 | // This is needed for TypeScript compiler to compile your TypeScript code in the project. 3 | // It is recommended to commit this file to the VCS. 4 | // You might want to change the configurations to fit your preferences 5 | // For more information about the configurations, please refer to http://www.typescriptlang.org/docs/handbook/tsconfig-json.html 6 | { 7 | "compilerOptions": { 8 | "sourceMap": true, 9 | "inlineSources": true, 10 | "module": "esNext", 11 | "target": "es2019", 12 | "moduleResolution": "node", 13 | "strict": true, 14 | "noFallthroughCasesInSwitch": true, 15 | "noImplicitReturns": true, 16 | "noImplicitAny": true, 17 | "noImplicitThis": true, 18 | "noUnusedLocals": false, 19 | "noUnusedParameters": false, 20 | "experimentalDecorators": true, 21 | "baseUrl": "frontend", 22 | "paths": { 23 | "Frontend/*": [ 24 | "*" 25 | ] 26 | } 27 | }, 28 | "include": [ 29 | "frontend/**/*.ts", 30 | "frontend/index.js", 31 | "types.d.ts" 32 | ], 33 | "exclude": [] 34 | } 35 | -------------------------------------------------------------------------------- /types.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.css' { 2 | import { CSSResultGroup } from 'lit'; 3 | const content: CSSResultGroup; 4 | export default content; 5 | } 6 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has been autogenerated as it didn't exist or was made for an older incompatible version. 3 | * This file can be used for manual configuration will not be modified if the flowDefaults constant exists. 4 | */ 5 | const merge = require('webpack-merge'); 6 | const flowDefaults = require('./webpack.generated.js'); 7 | 8 | module.exports = merge(flowDefaults, { 9 | 10 | }); 11 | 12 | /** 13 | * This file can be used to configure the flow plugin defaults. 14 | * 15 | * // Add a custom plugin 16 | * flowDefaults.plugins.push(new MyPlugin()); 17 | * 18 | * // Update the rules to also transpile `.mjs` files 19 | * if (!flowDefaults.module.rules[0].test) { 20 | * throw "Unexpected structure in generated webpack config"; 21 | * } 22 | * flowDefaults.module.rules[0].test = /\.m?js$/ 23 | * 24 | * // Include a custom JS in the entry point in addition to generated-flow-imports.js 25 | * if (typeof flowDefaults.entry.index != "string") { 26 | * throw "Unexpected structure in generated webpack config"; 27 | * } 28 | * flowDefaults.entry.index = [flowDefaults.entry.index, "myCustomFile.js"]; 29 | * 30 | * or add new configuration in the merge block. 31 | * 32 | * module.exports = merge(flowDefaults, { 33 | * mode: 'development', 34 | * devtool: 'inline-source-map' 35 | * }); 36 | * 37 | */ 38 | -------------------------------------------------------------------------------- /webpack.generated.js: -------------------------------------------------------------------------------- 1 | /** 2 | * NOTICE: this is an auto-generated file 3 | * 4 | * This file has been generated by the `flow:prepare-frontend` maven goal. 5 | * This file will be overwritten on every run. Any custom changes should be made to webpack.config.js 6 | */ 7 | const fs = require('fs'); 8 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 9 | const CompressionPlugin = require('compression-webpack-plugin'); 10 | const { InjectManifest } = require('workbox-webpack-plugin'); 11 | const { DefinePlugin } = require('webpack'); 12 | const ExtraWatchWebpackPlugin = require('extra-watch-webpack-plugin'); 13 | const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); 14 | 15 | const path = require('path'); 16 | 17 | // this matches /themes/my-theme/ and is used to check css url handling and file path build. 18 | const themePartRegex = /(\\|\/)themes\1[\s\S]*?\1/; 19 | 20 | // the folder of app resources: 21 | // - flow templates for classic Flow 22 | // - client code with index.html and index.[ts/js] for CCDM 23 | const frontendFolder = path.resolve(__dirname, 'frontend'); 24 | const frontendGeneratedFolder = path.resolve(__dirname, 'frontend/generated'); 25 | const fileNameOfTheFlowGeneratedMainEntryPoint = path.resolve(__dirname, 'target/frontend/generated-flow-imports.js'); 26 | const mavenOutputFolderForFlowBundledFiles = path.resolve(__dirname, 'target/classes/META-INF/VAADIN/webapp'); 27 | const mavenOutputFolderForResourceFiles = path.resolve(__dirname, 'target/classes/META-INF/VAADIN'); 28 | const useClientSideIndexFileForBootstrapping = true; 29 | const clientSideIndexHTML = './index.html'; 30 | const clientSideIndexEntryPoint = path.resolve(__dirname, 'frontend', 'generated/', 'vaadin.ts');; 31 | const pwaEnabled = true; 32 | const offlinePath = '.'; 33 | const clientServiceWorkerEntryPoint = path.resolve(__dirname, 'target/sw'); 34 | // public path for resources, must match Flow VAADIN_BUILD 35 | const VAADIN = 'VAADIN'; 36 | const build = 'build'; 37 | // public path for resources, must match the request used in flow to get the /build/stats.json file 38 | const config = 'config'; 39 | const outputFolder = mavenOutputFolderForFlowBundledFiles; 40 | const indexHtmlPath = 'index.html'; 41 | // folder for outputting vaadin-bundle and other fragments 42 | const buildFolder = path.resolve(outputFolder, VAADIN, build); 43 | // folder for outputting stats.json 44 | const confFolder = path.resolve(mavenOutputFolderForResourceFiles, config); 45 | const serviceWorkerPath = 'sw.js'; 46 | // file which is used by flow to read templates for server `@Id` binding 47 | const statsFile = `${confFolder}/stats.json`; 48 | 49 | const buildDirectory = path.resolve(__dirname, 'target'); 50 | 51 | // Flow plugins 52 | const BuildStatusPlugin = require(buildDirectory + '/plugins/build-status-plugin'); 53 | const ThemeLiveReloadPlugin = require(buildDirectory + '/plugins/theme-live-reload-plugin'); 54 | const { 55 | ApplicationThemePlugin, 56 | processThemeResources, 57 | extractThemeName, 58 | findParentThemes 59 | } = require(buildDirectory + '/plugins/application-theme-plugin'); 60 | const themeLoader = buildDirectory + '/plugins/theme-loader'; 61 | 62 | // Folders in the project which can contain static assets. 63 | const projectStaticAssetsFolders = [ 64 | path.resolve(__dirname, 'src', 'main', 'resources', 'META-INF', 'resources'), 65 | path.resolve(__dirname, 'src', 'main', 'resources', 'static'), 66 | frontendFolder 67 | ]; 68 | 69 | const projectStaticAssetsOutputFolder = path.resolve(__dirname, 'target/classes/META-INF/VAADIN/webapp/VAADIN/static'); 70 | 71 | // Folders in the project which can contain application themes 72 | const themeProjectFolders = projectStaticAssetsFolders.map((folder) => path.resolve(folder, 'themes')); 73 | 74 | const tsconfigJsonFile = path.resolve(__dirname, 'tsconfig.json'); 75 | const enableTypeScript = fs.existsSync(tsconfigJsonFile); 76 | 77 | // Target flow-fronted auto generated to be the actual target folder 78 | const flowFrontendFolder = path.resolve(__dirname, 'target/flow-frontend'); 79 | 80 | const statsSetViaCLI = process.argv.find((v) => v.indexOf('--stats') >= 0); 81 | const devMode = process.argv.find((v) => v.indexOf('webpack-dev-server') >= 0); 82 | if (!devMode) { 83 | // make sure that build folder exists before outputting anything 84 | const mkdirp = require('mkdirp'); 85 | mkdirp(buildFolder); 86 | mkdirp(confFolder); 87 | } 88 | 89 | let stats; 90 | 91 | // Open a connection with the Java dev-mode handler in order to finish 92 | // webpack-dev-mode when it exits or crashes. 93 | const watchDogPort = devMode && process.env.watchDogPort; 94 | if (watchDogPort) { 95 | const runWatchDog = () => { 96 | const client = new require('net').Socket(); 97 | client.setEncoding('utf8'); 98 | client.on('error', function () { 99 | console.log('Watchdog connection error. Terminating webpack process...'); 100 | client.destroy(); 101 | process.exit(0); 102 | }); 103 | client.on('close', function () { 104 | client.destroy(); 105 | runWatchDog(); 106 | }); 107 | 108 | client.connect(watchDogPort, 'localhost'); 109 | }; 110 | runWatchDog(); 111 | } 112 | 113 | // Compute the entries that webpack have to visit 114 | const webPackEntries = {}; 115 | if (useClientSideIndexFileForBootstrapping) { 116 | webPackEntries.bundle = clientSideIndexEntryPoint; 117 | const dirName = path.dirname(fileNameOfTheFlowGeneratedMainEntryPoint); 118 | const baseName = path.basename(fileNameOfTheFlowGeneratedMainEntryPoint, '.js'); 119 | if ( 120 | fs 121 | .readdirSync(dirName) 122 | .filter((fileName) => !fileName.startsWith(baseName) && fileName.endsWith('.js') && fileName.includes('-')).length 123 | ) { 124 | // if there are vaadin exported views, add a second entry 125 | webPackEntries.export = fileNameOfTheFlowGeneratedMainEntryPoint; 126 | } 127 | } else { 128 | webPackEntries.bundle = fileNameOfTheFlowGeneratedMainEntryPoint; 129 | } 130 | 131 | const appShellUrl = '.'; 132 | let appShellManifestEntry = undefined; 133 | 134 | const swManifestTransform = (manifestEntries) => { 135 | const warnings = []; 136 | const manifest = manifestEntries; 137 | if (useClientSideIndexFileForBootstrapping) { 138 | // `index.html` is a special case: in contrast with the JS bundles produced by webpack 139 | // it's not served as-is directly from the webpack output at `/index.html`. 140 | // It goes through IndexHtmlRequestHandler and is served at `/`. 141 | // 142 | // TODO: calculate the revision based on the IndexHtmlRequestHandler-processed content 143 | // of the index.html file 144 | const indexEntryIdx = manifest.findIndex((entry) => entry.url === 'index.html'); 145 | if (indexEntryIdx !== -1) { 146 | manifest[indexEntryIdx].url = appShellUrl; 147 | appShellManifestEntry = manifest[indexEntryIdx]; 148 | } else { 149 | // Index entry is only emitted on first compilation. Make sure it is cached also for incremental builds 150 | manifest.push(appShellManifestEntry); 151 | } 152 | } 153 | return { manifest, warnings }; 154 | }; 155 | 156 | const createServiceWorkerPlugin = function () { 157 | return new InjectManifest({ 158 | swSrc: clientServiceWorkerEntryPoint, 159 | swDest: serviceWorkerPath, 160 | manifestTransforms: [swManifestTransform], 161 | maximumFileSizeToCacheInBytes: 100 * 1024 * 1024, 162 | dontCacheBustURLsMatching: /.*-[a-z0-9]{20}\.cache\.js/, 163 | include: [ 164 | (chunk) => { 165 | return true; 166 | } 167 | ], 168 | webpackCompilationPlugins: [ 169 | new DefinePlugin({ 170 | OFFLINE_PATH: JSON.stringify(offlinePath) 171 | }) 172 | ] 173 | }); 174 | }; 175 | 176 | const flowFrontendThemesFolder = path.resolve(flowFrontendFolder, 'themes'); 177 | const themeOptions = { 178 | devMode: devMode, 179 | // The following matches folder 'target/flow-frontend/themes/' 180 | // (not 'frontend/themes') for theme in JAR that is copied there 181 | themeResourceFolder: flowFrontendThemesFolder, 182 | themeProjectFolders: themeProjectFolders, 183 | projectStaticAssetsOutputFolder: projectStaticAssetsOutputFolder, 184 | frontendGeneratedFolder: frontendGeneratedFolder 185 | }; 186 | let themeName = undefined; 187 | let themeWatchFolders = undefined; 188 | if (devMode) { 189 | // Current theme name is being extracted from theme.js located in frontend 190 | // generated folder 191 | themeName = extractThemeName(frontendGeneratedFolder); 192 | const parentThemePaths = findParentThemes(themeName, themeOptions); 193 | const currentThemeFolders = [ 194 | ...projectStaticAssetsFolders.map((folder) => path.resolve(folder, 'themes', themeName)), 195 | path.resolve(flowFrontendThemesFolder, themeName) 196 | ]; 197 | // Watch the components folders for component styles update in both 198 | // current theme and parent themes. Other folders or CSS files except 199 | // 'styles.css' should be referenced from `styles.css` anyway, so no need 200 | // to watch them. 201 | themeWatchFolders = [...currentThemeFolders, ...parentThemePaths].map((themeFolder) => 202 | path.resolve(themeFolder, 'components') 203 | ); 204 | } 205 | 206 | const processThemeResourcesCallback = (logger) => processThemeResources(themeOptions, logger); 207 | 208 | exports = { 209 | frontendFolder: `${frontendFolder}`, 210 | buildFolder: `${buildFolder}`, 211 | confFolder: `${confFolder}` 212 | }; 213 | 214 | module.exports = { 215 | mode: 'production', 216 | context: frontendFolder, 217 | entry: webPackEntries, 218 | 219 | output: { 220 | filename: `${VAADIN}/${build}/vaadin-[name]-[contenthash].cache.js`, 221 | path: outputFolder 222 | }, 223 | 224 | resolve: { 225 | // Search for import 'x/y' inside these folders, used at least for importing an application theme 226 | modules: ['node_modules', flowFrontendFolder, ...projectStaticAssetsFolders], 227 | extensions: [enableTypeScript && '.ts', '.js'].filter(Boolean), 228 | alias: { 229 | Frontend: frontendFolder 230 | } 231 | }, 232 | 233 | stats: devMode && !statsSetViaCLI ? 'errors-warnings' : 'normal', // Unclutter output in dev mode 234 | 235 | devServer: { 236 | hot: false, // disable HMR 237 | client: false, // disable wds client as we handle reloads and errors better 238 | // webpack-dev-server serves ./, webpack-generated, and java webapp 239 | static: [outputFolder, path.resolve(__dirname, 'src', 'main', 'webapp')], 240 | setupMiddlewares: function (middlewares, devServer) { 241 | devServer.app.get(`/assetsByChunkName`, function (req, res) { 242 | res.json(stats.assetsByChunkName); 243 | }); 244 | devServer.app.get(`/stop`, function (req, res) { 245 | // eslint-disable-next-line no-console 246 | console.log("Stopped 'webpack-dev-server'"); 247 | process.exit(0); 248 | }); 249 | return middlewares; 250 | } 251 | }, 252 | 253 | module: { 254 | rules: [ 255 | enableTypeScript && { 256 | test: /\.ts$/, 257 | loader: 'esbuild-loader', 258 | options: { 259 | loader: 'ts', 260 | target: 'es2019' 261 | } 262 | }, 263 | { 264 | test: /\.css$/i, 265 | use: [ 266 | { 267 | loader: 'lit-css-loader', 268 | options: { 269 | import: 'lit' 270 | } 271 | }, 272 | { 273 | loader: 'extract-loader' 274 | }, 275 | { 276 | loader: 'css-loader', 277 | options: { 278 | url: (url, resourcePath) => { 279 | // Only translate files from node_modules 280 | const resolve = resourcePath.match(/(\\|\/)node_modules\1/); 281 | const themeResource = resourcePath.match(themePartRegex) && url.match(/^themes\/[\s\S]*?\//); 282 | return resolve || themeResource; 283 | }, 284 | // use theme-loader to also handle any imports in css files 285 | importLoaders: 1 286 | } 287 | }, 288 | { 289 | // theme-loader will change any url starting with './' to start with 'VAADIN/static' instead 290 | // NOTE! this loader should be here so it's run before css-loader as loaders are applied Right-To-Left 291 | loader: themeLoader, 292 | options: { 293 | devMode: devMode 294 | } 295 | } 296 | ] 297 | }, 298 | { 299 | // File-loader only copies files used as imports in .js files or handled by css-loader 300 | test: /\.(png|gif|jpg|jpeg|svg|eot|woff|woff2|otf|ttf)$/, 301 | use: [ 302 | { 303 | loader: 'file-loader', 304 | options: { 305 | outputPath: 'VAADIN/static/', 306 | name(resourcePath, resourceQuery) { 307 | if (resourcePath.match(/(\\|\/)node_modules\1/)) { 308 | return /(\\|\/)node_modules\1(?!.*node_modules)([\S]+)/.exec(resourcePath)[2].replace(/\\/g, '/'); 309 | } 310 | if (resourcePath.match(/(\\|\/)flow-frontend\1/)) { 311 | return /(\\|\/)flow-frontend\1(?!.*flow-frontend)([\S]+)/.exec(resourcePath)[2].replace(/\\/g, '/'); 312 | } 313 | return '[path][name].[ext]'; 314 | } 315 | } 316 | } 317 | ] 318 | } 319 | ].filter(Boolean) 320 | }, 321 | performance: { 322 | maxEntrypointSize: 2097152, // 2MB 323 | maxAssetSize: 2097152 // 2MB 324 | }, 325 | plugins: [ 326 | new ApplicationThemePlugin(themeOptions), 327 | 328 | ...(devMode && themeName 329 | ? [ 330 | new ExtraWatchWebpackPlugin({ 331 | files: [], 332 | dirs: themeWatchFolders 333 | }), 334 | new ThemeLiveReloadPlugin(processThemeResourcesCallback) 335 | ] 336 | : []), 337 | 338 | function (compiler) { 339 | // V14 bootstrapping needs the bundle names 340 | compiler.hooks.afterEmit.tapAsync("FlowStatsHelper", (compilation, done) => { 341 | let miniStats = { 342 | assetsByChunkName: compilation.getStats().toJson().assetsByChunkName 343 | }; 344 | if (!devMode) { 345 | fs.writeFile(statsFile, JSON.stringify(miniStats, null, 1), 346 | () => done()); 347 | } else { 348 | stats = miniStats; 349 | done(); 350 | } 351 | }); 352 | }, 353 | 354 | // Includes JS output bundles into "index.html" 355 | useClientSideIndexFileForBootstrapping && 356 | new HtmlWebpackPlugin({ 357 | template: clientSideIndexHTML, 358 | filename: indexHtmlPath, 359 | inject: 'head', 360 | scriptLoading: 'defer', 361 | chunks: ['bundle'] 362 | }), 363 | 364 | // Service worker for offline 365 | pwaEnabled && createServiceWorkerPlugin(), 366 | 367 | // Generate compressed bundles when not devMode 368 | !devMode && new CompressionPlugin(), 369 | 370 | enableTypeScript && 371 | new ForkTsCheckerWebpackPlugin({ 372 | typescript: { 373 | configFile: tsconfigJsonFile 374 | } 375 | }), 376 | 377 | new BuildStatusPlugin() 378 | ].filter(Boolean) 379 | }; 380 | --------------------------------------------------------------------------------