diff --git a/README.md b/README.md index 129771f9bdf..41d889cf15b 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,10 @@ We run a speed test (included in the code) to measure the performance for every ## Repository layout -The main Java server code is in `src/main/`. OTP also includes a Javascript client based on the -Leaflet mapping library in `src/client/`. This client is now primarily used for testing, with most -major deployments building custom clients from reusable components. The Maven build produces a -unified ("shaded") JAR file at `target/otp-VERSION.jar` containing all necessary code and -dependencies to run OpenTripPlanner. +The main Java server code is in `application/src/main/`. OTP also includes a Javascript client based on the +MapLibre mapping library in `client/src/`. This client is now used for testing, with most major +deployments building custom clients from reusable components. The Maven build produces a unified ("shaded") +JAR file at `application/target/otp-VERSION.jar` containing all necessary code and dependencies to run OpenTripPlanner. Additional information and instructions are available in the [main documentation](http://docs.opentripplanner.org/en/dev-2.x/), including a diff --git a/client/README.md b/client/README.md index 54971062971..a646cd1170c 100644 --- a/client/README.md +++ b/client/README.md @@ -22,7 +22,7 @@ generated during build and are not checked into the repository. Use latest LTS version of Node/npm (currently v18). Recommend using a version manager such as `nvm`. The dev and production builds require graphql schema to be present at -`../src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql`. +`../application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql`. ## Getting started (development) diff --git a/client/codegen.ts b/client/codegen.ts index b5b68a0650a..60299a21a97 100644 --- a/client/codegen.ts +++ b/client/codegen.ts @@ -2,7 +2,7 @@ import type { CodegenConfig } from '@graphql-codegen/cli'; const config: CodegenConfig = { overwrite: true, - schema: '../src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql', + schema: '../application/src/main/resources/org/opentripplanner/apis/transmodel/schema.graphql', documents: 'src/**/*.{ts,tsx}', generates: { 'src/gql/': { diff --git a/doc/templates/BuildConfiguration.md b/doc/templates/BuildConfiguration.md index 77b03dae500..3d1cd5a1db3 100644 --- a/doc/templates/BuildConfiguration.md +++ b/doc/templates/BuildConfiguration.md @@ -163,7 +163,7 @@ OTP allows you to adjust the elevation values reported in API responses in two w is to store ellipsoid (GPS) elevation values internally, but apply a single geoid difference value in the OTP client where appropriate to display elevations above sea level. This ellipsoid to geoid difference is returned in each trip plan response in the -[ElevationMetadata](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/src/main/java/org/opentripplanner/api/resource/ElevationMetadata.java) +[ElevationMetadata](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/application/src/ext/java/org/opentripplanner/ext/restapi/model/ElevationMetadata.java) field. Using a single value can be sufficient for smaller OTP deployments, but might result in incorrect values at the edges of larger OTP deployments. If your OTP instance uses this, it is recommended to set a default request value in the `router-config.json` file as follows: diff --git a/doc/templates/GraphQL-Tutorial.md b/doc/templates/GraphQL-Tutorial.md index 2a78be65cc2..b3a59b7d19e 100644 --- a/doc/templates/GraphQL-Tutorial.md +++ b/doc/templates/GraphQL-Tutorial.md @@ -51,4 +51,4 @@ Most people want to get routing results out of OTP, so lets see the query for th Again, please use the autocomplete and documentation viewers to figure out what each input parameter and property means. -More examples for a variety of queries can also be found [in the test code](https://github.com/opentripplanner/OpenTripPlanner/tree/dev-2.x/src/test/resources/org/opentripplanner/apis/gtfs/queries). \ No newline at end of file +More examples for a variety of queries can also be found [in the test code](https://github.com/opentripplanner/OpenTripPlanner/tree/dev-2.x/application/src/test/resources/org/opentripplanner/apis/gtfs/queries). \ No newline at end of file diff --git a/doc/templates/RouterConfiguration.md b/doc/templates/RouterConfiguration.md index 87e4c1693cc..42a78cc41ca 100644 --- a/doc/templates/RouterConfiguration.md +++ b/doc/templates/RouterConfiguration.md @@ -14,7 +14,7 @@ These options can be applied by the OTP server without rebuilding the graph. Certain settings can be provided on the command line, when starting OpenTripPlanner. See the `CommandLineParameters` class -for [a full list of arguments](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/src/main/java/org/opentripplanner/standalone/config/CommandLineParameters.java) +for [a full list of arguments](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/application/src/main/java/org/opentripplanner/standalone/config/CommandLineParameters.java) . ## Routing defaults diff --git a/doc/user/BuildConfiguration.md b/doc/user/BuildConfiguration.md index f5281db0f4e..99e98066e73 100644 --- a/doc/user/BuildConfiguration.md +++ b/doc/user/BuildConfiguration.md @@ -264,7 +264,7 @@ OTP allows you to adjust the elevation values reported in API responses in two w is to store ellipsoid (GPS) elevation values internally, but apply a single geoid difference value in the OTP client where appropriate to display elevations above sea level. This ellipsoid to geoid difference is returned in each trip plan response in the -[ElevationMetadata](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/src/main/java/org/opentripplanner/api/resource/ElevationMetadata.java) +[ElevationMetadata](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/application/src/ext/java/org/opentripplanner/ext/restapi/model/ElevationMetadata.java) field. Using a single value can be sufficient for smaller OTP deployments, but might result in incorrect values at the edges of larger OTP deployments. If your OTP instance uses this, it is recommended to set a default request value in the `router-config.json` file as follows: diff --git a/doc/user/Frontends.md b/doc/user/Frontends.md index 8bb32273149..ac793a4fc85 100644 --- a/doc/user/Frontends.md +++ b/doc/user/Frontends.md @@ -19,7 +19,7 @@ On the other hand, **production frontends** are intended to be a component of la The main OpenTripPlanner repository currently contains two debug web frontends: - new one currently under development at [`/client`](https://github.com/opentripplanner/OpenTripPlanner/tree/dev-2.x/client). -- the classic one in [`/src/client/classic-debug/`](https://github.com/opentripplanner/OpenTripPlanner/tree/dev-2.x/src/client/classic-debug) +- the classic one in [`/application/src/client/classic-debug/`](https://github.com/opentripplanner/OpenTripPlanner/tree/dev-2.x/application/src/client/classic-debug) The **new debug client** is a React/TypeScript Single Page App (SPA) that can be served locally or accessed over a content delivery network (CDN). Unlike the original debug client, it connects to the OTP Java backend via the GraphQL API using the Transmodel vocabulary. By default, it is available at the root URL (`http://localhost:8080/` in local operation). @@ -29,7 +29,7 @@ It connects to the OTP Java backend via a REST API using the GTFS vocabulary. Hi It is still available, but has been moved to `http://localhost:8080/classic-debug/` . There is a third piece of software that might qualify as an OTP client: a Java Swing application making use of the Processing visualization library, -located in the [GraphVisualizer class](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/src/main/java/org/opentripplanner/visualizer/GraphVisualizer.java). +located in the [GraphVisualizer class](https://github.com/opentripplanner/OpenTripPlanner/blob/dev-2.x/application/src/main/java/org/opentripplanner/visualizer/GraphVisualizer.java). While it would not be accurate to call this a "native" desktop application (as it's cross-platform Java) it is not a web app. This very developer-centric UI is also over a decade old and has been very sparsely maintained, but continues to exist because it can visualize the progress of searches through the street network, providing some insight into the internals of the routing algorithms that are not otherwise visible. diff --git a/doc/user/Getting-OTP.md b/doc/user/Getting-OTP.md index cfb0102c2a3..92f1e7298fc 100644 --- a/doc/user/Getting-OTP.md +++ b/doc/user/Getting-OTP.md @@ -64,13 +64,13 @@ OTP. If all goes well you should see a success message like the following: [INFO] ------------------------------------------------------------------------ ``` -This build process should produce a JAR file called `otp-x.y.z-shaded.jar` in the `target/` -directory which contains all the compiled OTP classes and their dependencies (the external libraries -they use). The shell script called 'otp' in the root of the cloned repository will start the main -class of that JAR file under a Java virtual machine, so after the Maven build completes you should -be able to run `./otp --help` and see an OTP help message including command line options. Due to the -way Maven works, this script is not executable by default, so you will need to do `chmod u+x ./otp` -before you run it to mark it as executable. +This build process should produce a JAR file called `otp-x.y.z-shaded.jar` in the +`application/target/` directory which contains all the compiled OTP classes and their dependencies +(the external libraries they use). The shell script called 'otp' in the root of the cloned repository +will start the main class of that JAR file under a Java virtual machine, so after the Maven build +completes you should be able to run `./otp --help` and see an OTP help message including command line +options. Due to the way Maven works, this script is not executable by default, so you will need to do +`chmod u+x ./otp` before you run it to mark it as executable. The words "clean package" are the build steps you want to run. You're telling maven to clean up any extraneous junk in the directory, then perform all the build steps, including compilation, up to and diff --git a/doc/user/Localization.md b/doc/user/Localization.md deleted file mode 100644 index 75d21e96ce4..00000000000 --- a/doc/user/Localization.md +++ /dev/null @@ -1,229 +0,0 @@ -# Localization - -NOTE: This documentation pertains to the client included in the main OTP repository. THIS BUILT-IN -OTP CLIENT IS PROVIDED FOR TEST AND DEBUGGING PURPOSES. IT IS NOT MEANT FOR PRODUCTION USE. - -This page contains instructions for both developers and translators on how to make the OTP interface -usable by people who speak different languages. Developers will need to take certain steps to mark -translatable strings within the source code. Translators will need to edit specific files within the -project to create or revise the translation for their language. - -In OTP we use gettext for localization, for the following reasons: - -- [Plural suport](http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html#sec-poplurals) -- [Context support](http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html#sec-poautocmnt) -- Automatic extraction of translatable strings from source code -- [Translator comments](http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html#sec-poautocmnt) - support -- Source references (we can see where each translated string is used in the source code) - -In the Javascript UI the [i18next](http://i18next.com) library is used. - -Three types of files are used in the OTP localization process: - -- The `.pot` file is the message template. It is a starting point for creating new `.po` files. -- `.po` files are created and edited by translators based on the `.pot` file. -- `.json` files are generated from the `.po` files for each language. -- `.js` files are localization configuration files which specify units and time/date formats. - -Only the `.po` and `.js` files are directly edited. The `.pot` file is created from an automated -analysis of annotated source code. The `.json` files are also automatically generated as an easy way -for the Javascript UI to consume the contents of the `.po` files. - -All translation files are in the directory `/src/client/i18n`. - -## For Software Developers: Adding New Strings - -When you add a string to Javascript source that will be seen by the end user, wherever that string -is referenced you should surround it with a call to a special function. The name of the function -depends on what kind of string it is: - -- basic string: `_tr('string', parameters)` -- basic string with context: `ngettext('context', 'string')` -- string with plural: `ngettext('singular', 'plural', quantity)` -- string with plural and context: `npgettext('context', 'singular', 'plural', quantity)` - -For more detail, -see [Sprintf parameters](http://www.diveintojavascript.com/projects/javascript-sprintf). - -A "context" is any string (preferably short and without whitespace) that is used to disambiguate the -translation of the main string. It is used when developers get input from translators that some -string should be translated in different ways in different parts of the program. Each of those -distinct places will be assigned a different context string. - -When you add strings to the source code, if you think that translators might not understand how the -string is used or what parameters it requires, add translator comments like this: - -```javascript -//TRANSLATORS: Start: location at [time date] (Used in print itinerary -//when do you start your trip) -html += '