{"action":"created","issue":{"url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2060","labels_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2060/labels{/name}","comments_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2060/comments","events_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2060/events","html_url":"https://github.com/opentripplanner/OpenTripPlanner/pull/2060","id":97677049,"number":2060,"title":"Dynamic list of supported travel by modes","user":{"login":"buma","id":1055967,"avatar_url":"https://avatars.githubusercontent.com/u/1055967?v=3","gravatar_id":"","url":"https://api.github.com/users/buma","html_url":"https://github.com/buma","followers_url":"https://api.github.com/users/buma/followers","following_url":"https://api.github.com/users/buma/following{/other_user}","gists_url":"https://api.github.com/users/buma/gists{/gist_id}","starred_url":"https://api.github.com/users/buma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buma/subscriptions","organizations_url":"https://api.github.com/users/buma/orgs","repos_url":"https://api.github.com/users/buma/repos","events_url":"https://api.github.com/users/buma/events{/privacy}","received_events_url":"https://api.github.com/users/buma/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-28T11:00:10Z","updated_at":"2015-07-28T14:21:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/pulls/2060","html_url":"https://github.com/opentripplanner/OpenTripPlanner/pull/2060","diff_url":"https://github.com/opentripplanner/OpenTripPlanner/pull/2060.diff","patch_url":"https://github.com/opentripplanner/OpenTripPlanner/pull/2060.patch"},"body":"This is server part of automatic list of travel by modes. The goal is for the client to only show supported travel by modes and extra options (bike sharing, park & ride, bike & ride) on specific server.\r\n\r\nSome examples of transit travelBy options are: `\"TRANSIT,WALK\"`, Park & Ride `\"CAR_PARK,WALK,TRANSIT\"` which is quite complex, but bicycle needs only `\"BICYCLE\"`.\r\n\r\nThis can be solved in 2 ways.\r\nOne is to send to client which transit modes are supported and if P & R, B & R or bike sharing are supported and is up to the client to create correct list of those and to name them.\r\n\r\nAnother is to create a list of values to be send (\"TRANSIT,WALK\", \"BICYCLE\") and names for them on the server itself. This would be better kept in since with the rest of server code than combining it on client.\r\n\r\nCurrently there are 3 well known clients. OTP default, OTP.js, and android app.\r\n\r\nI currently implemented second option. I added a method on a server which creates list of travel By options with correct values and short names. Client then uses those names to show correct description (which can be translated).\r\n\r\nI added travelOptions list to RouterInfo which consists of list of values and names. Values are items which are send to the server and names are names to be used for naming.\r\n\r\nI also added hasBikeSharing, hasBikePark and hasParkRide variables to routerInfo which can be used in the future to enable or disable specific modes.\r\n\r\nI also added tests."},"comment":{"url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/comments/125625035","html_url":"https://github.com/opentripplanner/OpenTripPlanner/pull/2060#issuecomment-125625035","issue_url":"https://api.github.com/repos/opentripplanner/OpenTripPlanner/issues/2060","id":125625035,"user":{"login":"buma","id":1055967,"avatar_url":"https://avatars.githubusercontent.com/u/1055967?v=3","gravatar_id":"","url":"https://api.github.com/users/buma","html_url":"https://github.com/buma","followers_url":"https://api.github.com/users/buma/followers","following_url":"https://api.github.com/users/buma/following{/other_user}","gists_url":"https://api.github.com/users/buma/gists{/gist_id}","starred_url":"https://api.github.com/users/buma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buma/subscriptions","organizations_url":"https://api.github.com/users/buma/orgs","repos_url":"https://api.github.com/users/buma/repos","events_url":"https://api.github.com/users/buma/events{/privacy}","received_events_url":"https://api.github.com/users/buma/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T14:21:19Z","updated_at":"2015-07-28T14:21:19Z","body":"Currently it is kinda Engrish: Park and ride is  \"PARKRIDE\" for example. You can look into java test which is in diff in this PR. I'll see how it would be. If I'll use English or something like that. My plan is to have a list of this names and mappings in English and other languages in a client. In opentripplanner client this would be similar to [directions](https://github.com/opentripplanner/OpenTripPlanner/blob/master/src/client/js/otp/util/Itin.js#L108). Here is a list of keys, values are given through translator function which gets correct language.\r\n\r\nNumber of different values is static. It just depends on the server what it supports.\r\n\r\nI could use English values as names also if this makes Android client easier. It just feels nicer that those kind of values are keys."}}