From 2b320b61299f6d7babcd43b680130dea600a4e06 Mon Sep 17 00:00:00 2001 From: BodoMinea Date: Tue, 31 Dec 2019 16:05:26 +0200 Subject: [PATCH 1/4] Add some explanations and correct transitime config clocks to transitclock --- transitclock/README.md | 3 ++- transitclock/src/main/resources/testConfig.xml | 4 ++-- .../main/resources/{transiTimeconfig.xml => transitclock.xml} | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) rename transitclock/src/main/resources/{transiTimeconfig.xml => transitclock.xml} (96%) diff --git a/transitclock/README.md b/transitclock/README.md index 77aeb3c79..f7f03f617 100755 --- a/transitclock/README.md +++ b/transitclock/README.md @@ -170,8 +170,9 @@ args: ``` example: - java -Xmx1000M -Dtransitime.core.agencyId=02 -jar processGTFSFile.jar -c d:/transiTime/transiTimeConfig.xml -gtfsDirectoryName d:/transiTime/updated_google_transit_irishrail/ -storeNewRevs -maxTravelTimeSegmentLength 1000 + java -Xmx1000M -Dtransitclock.core.agencyId=02 -jar processGTFSFile.jar -c d:/transitclock/transitclock.xml -gtfsDirectoryName d:/transitclock/updated_google_transit_irishrail/ -storeNewRevs -maxTravelTimeSegmentLength 1000 ``` +Note: example config files can be found in the src/main/resources directory. You also need to correctly set up the Hibernate file for use with your database server. Replace the values for the driver and dialect with the corresponding ones from [here](https://www.tutorialspoint.com/hibernate/hibernate_configuration.htm). WORK IN PROGRESS........................ diff --git a/transitclock/src/main/resources/testConfig.xml b/transitclock/src/main/resources/testConfig.xml index 11fed7a5c..6f5c978d1 100644 --- a/transitclock/src/main/resources/testConfig.xml +++ b/transitclock/src/main/resources/testConfig.xml @@ -1,5 +1,5 @@ - + org.transitclock.avl.GtfsRealtimeModule @@ -22,4 +22,4 @@ hsql_hibernate.cfg.xml - \ No newline at end of file + \ No newline at end of file diff --git a/transitclock/src/main/resources/transiTimeconfig.xml b/transitclock/src/main/resources/transitclock.xml similarity index 96% rename from transitclock/src/main/resources/transiTimeconfig.xml rename to transitclock/src/main/resources/transitclock.xml index 217e7f74e..e20474d16 100644 --- a/transitclock/src/main/resources/transiTimeconfig.xml +++ b/transitclock/src/main/resources/transitclock.xml @@ -1,5 +1,5 @@ - + org.transitclock.avl.GtfsRealtimeModule @@ -21,4 +21,4 @@ src/main/resources/hsql_hibernate.cfg.xml - \ No newline at end of file + \ No newline at end of file From dc71639e4dd66e38015faf803ae729cfcdd417b2 Mon Sep 17 00:00:00 2001 From: BodoMinea Date: Tue, 31 Dec 2019 16:08:43 +0200 Subject: [PATCH 2/4] UTF-8 MySQL structure files --- .../ddl_mysql_org_transitime_db_structs.sql | 559 ------------------ ...ddl_mysql_org_transitime_db_webstructs.sql | 22 - 2 files changed, 581 deletions(-) delete mode 100644 transitclock/src/main/resources/ddl_mysql_org_transitime_db_structs.sql delete mode 100644 transitclock/src/main/resources/ddl_mysql_org_transitime_db_webstructs.sql diff --git a/transitclock/src/main/resources/ddl_mysql_org_transitime_db_structs.sql b/transitclock/src/main/resources/ddl_mysql_org_transitime_db_structs.sql deleted file mode 100644 index 819223bd1..000000000 --- a/transitclock/src/main/resources/ddl_mysql_org_transitime_db_structs.sql +++ /dev/null @@ -1,559 +0,0 @@ - - create table ActiveRevisions ( - id integer not null auto_increment, - configRev integer, - travelTimesRev integer, - primary key (id) - ); - - create table Agencies ( - configRev integer not null, - agencyName varchar(60) not null, - agencyFareUrl varchar(255), - agencyId varchar(60), - agencyLang varchar(15), - agencyPhone varchar(15), - agencyTimezone varchar(40), - agencyUrl varchar(255), - maxLat double precision, - maxLon double precision, - minLat double precision, - minLon double precision, - primary key (configRev, agencyName) - ); - - create table ArrivalsDepartures ( - DTYPE varchar(31) not null, - vehicleId varchar(60) not null, - tripId varchar(60) not null, - time datetime(3) not null, - stopId varchar(60) not null, - isArrival bit not null, - gtfsStopSeq integer not null, - avlTime datetime(3), - blockId varchar(60), - configRev integer, - directionId varchar(60), - freqStartTime datetime(3), - routeId varchar(60), - routeShortName varchar(60), - scheduledTime datetime(3), - serviceId varchar(60), - stopOrder integer, - stopPathIndex integer, - stopPathLength float, - tripIndex integer, - primary key (vehicleId, tripId, time, stopId, isArrival, gtfsStopSeq) - ); - - create table AvlReports ( - vehicleId varchar(60) not null, - time datetime(3) not null, - assignmentId varchar(60), - assignmentType varchar(40), - driverId varchar(60), - field1Name varchar(60), - field1Value varchar(60), - heading float, - licensePlate varchar(10), - lat double precision, - lon double precision, - passengerCount integer, - passengerFullness float, - source varchar(10), - speed float, - timeProcessed datetime(3), - primary key (vehicleId, time) - ); - - create table Block_to_Trip_joinTable ( - Blocks_serviceId varchar(60) not null, - Blocks_configRev integer not null, - Blocks_blockId varchar(60) not null, - trips_tripId varchar(60) not null, - trips_startTime integer not null, - trips_configRev integer not null, - listIndex integer not null, - primary key (Blocks_serviceId, Blocks_configRev, Blocks_blockId, listIndex) - ); - - create table Blocks ( - serviceId varchar(60) not null, - configRev integer not null, - blockId varchar(60) not null, - endTime integer, - routeIds blob, - startTime integer, - primary key (serviceId, configRev, blockId) - ); - - create table CalendarDates ( - serviceId varchar(60) not null, - date date not null, - configRev integer not null, - exceptionType varchar(2), - primary key (serviceId, date, configRev) - ); - - create table Calendars ( - wednesday bit not null, - tuesday bit not null, - thursday bit not null, - sunday bit not null, - startDate date not null, - serviceId varchar(60) not null, - saturday bit not null, - monday bit not null, - friday bit not null, - endDate date not null, - configRev integer not null, - primary key (wednesday, tuesday, thursday, sunday, startDate, serviceId, saturday, monday, friday, endDate, configRev) - ); - - create table ConfigRevision ( - configRev integer not null, - notes longtext, - processedTime datetime(3), - zipFileLastModifiedTime datetime(3), - primary key (configRev) - ); - - create table DbTest ( - id integer not null, - primary key (id) - ); - - create table FareAttributes ( - fareId varchar(60) not null, - configRev integer not null, - currencyType varchar(3), - paymentMethod varchar(255), - price float, - transferDuration integer, - transfers varchar(255), - primary key (fareId, configRev) - ); - - create table FareRules ( - routeId varchar(60) not null, - originId varchar(60) not null, - fareId varchar(60) not null, - destinationId varchar(60) not null, - containsId varchar(60) not null, - configRev integer not null, - primary key (routeId, originId, fareId, destinationId, containsId, configRev) - ); - - create table Frequencies ( - tripId varchar(60) not null, - startTime integer not null, - configRev integer not null, - endTime integer, - exactTimes bit, - headwaySecs integer, - primary key (tripId, startTime, configRev) - ); - - create table Headway ( - id bigint not null auto_increment, - average double precision, - coefficientOfVariation double precision, - configRev integer, - creationTime datetime(3), - firstDeparture datetime(3), - headway double precision, - numVehicles integer, - otherVehicleId varchar(60), - routeId varchar(60), - secondDeparture datetime(3), - stopId varchar(60), - tripId varchar(60), - variance double precision, - vehicleId varchar(60), - primary key (id) - ); - - create table HoldingTimes ( - id bigint not null auto_increment, - arrivalPredictionUsed bit, - arrivalTime datetime(3), - arrivalUsed bit, - configRev integer, - creationTime datetime(3), - hasD1 bit, - holdingTime datetime(3), - numberPredictionsUsed integer, - routeId varchar(60), - stopId varchar(60), - tripId varchar(60), - vehicleId varchar(60), - primary key (id) - ); - - create table Matches ( - vehicleId varchar(60) not null, - avlTime datetime(3) not null, - atStop bit, - blockId varchar(60), - configRev integer, - distanceAlongSegment float, - distanceAlongStopPath float, - segmentIndex integer, - serviceId varchar(255), - stopPathIndex integer, - tripId varchar(60), - primary key (vehicleId, avlTime) - ); - - create table MeasuredArrivalTimes ( - time datetime(3) not null, - stopId varchar(60) not null, - directionId varchar(60), - headsign varchar(60), - routeId varchar(60), - routeShortName varchar(60), - primary key (time, stopId) - ); - - create table MonitoringEvents ( - type varchar(40) not null, - time datetime(3) not null, - message longtext, - triggered bit, - value double precision, - primary key (type, time) - ); - - create table PredictionAccuracy ( - id bigint not null auto_increment, - affectedByWaitStop bit, - arrivalDepartureTime datetime(3), - directionId varchar(60), - predictedTime datetime(3), - predictionAccuracyMsecs integer, - predictionReadTime datetime(3), - predictionSource varchar(60), - routeId varchar(60), - routeShortName varchar(60), - stopId varchar(60), - tripId varchar(60), - vehicleId varchar(60), - primary key (id) - ); - - create table Predictions ( - id bigint not null auto_increment, - affectedByWaitStop bit, - avlTime datetime(3), - configRev integer, - creationTime datetime(3), - gtfsStopSeq integer, - isArrival bit, - predictionTime datetime(3), - routeId varchar(60), - schedBasedPred bit, - stopId varchar(60), - tripId varchar(60), - vehicleId varchar(60), - primary key (id) - ); - - create table Routes ( - id varchar(60) not null, - configRev integer not null, - color varchar(10), - description longtext, - maxLat double precision, - maxLon double precision, - minLat double precision, - minLon double precision, - hidden bit, - longName varchar(255), - maxDistance double precision, - name varchar(255), - routeOrder integer, - shortName varchar(255), - textColor varchar(10), - type varchar(2), - primary key (id, configRev) - ); - - create table StopPathPredictions ( - id bigint not null auto_increment, - algorithm varchar(255), - creationTime datetime(3), - predictionTime double precision, - startTime integer, - stopPathIndex integer, - travelTime bit, - tripId varchar(60), - vehicleId varchar(255), - primary key (id) - ); - - create table StopPath_locations ( - StopPath_tripPatternId varchar(120) not null, - StopPath_stopPathId varchar(120) not null, - StopPath_configRev integer not null, - lat double precision, - lon double precision, - locations_ORDER integer not null, - primary key (StopPath_tripPatternId, StopPath_stopPathId, StopPath_configRev, locations_ORDER) - ); - - create table StopPaths ( - tripPatternId varchar(120) not null, - stopPathId varchar(120) not null, - configRev integer not null, - breakTime integer, - gtfsStopSeq integer, - lastStopInTrip bit, - layoverStop bit, - maxDistance double precision, - maxSpeed double precision, - pathLength double precision, - routeId varchar(60), - scheduleAdherenceStop bit, - stopId varchar(60), - waitStop bit, - primary key (tripPatternId, stopPathId, configRev) - ); - - create table Stops ( - id varchar(60) not null, - configRev integer not null, - code integer, - hidden bit, - layoverStop bit, - lat double precision, - lon double precision, - name varchar(255), - timepointStop bit, - waitStop bit, - primary key (id, configRev) - ); - - create table Transfers ( - toStopId varchar(60) not null, - fromStopId varchar(60) not null, - configRev integer not null, - minTransferTime integer, - transferType varchar(1), - primary key (toStopId, fromStopId, configRev) - ); - - create table TravelTimesForStopPaths ( - id integer not null auto_increment, - configRev integer, - daysOfWeekOverride smallint, - howSet varchar(5), - stopPathId varchar(120), - stopTimeMsec integer, - travelTimeSegmentLength float, - travelTimesMsec mediumblob, - travelTimesRev integer, - primary key (id) - ); - - create table TravelTimesForTrip_to_TravelTimesForPath_joinTable ( - TravelTimesForTrips_id integer not null, - travelTimesForStopPaths_id integer not null, - listIndex integer not null, - primary key (TravelTimesForTrips_id, listIndex) - ); - - create table TravelTimesForTrips ( - id integer not null auto_increment, - configRev integer, - travelTimesRev integer, - tripCreatedForId varchar(60), - tripPatternId varchar(120), - primary key (id) - ); - - create table TripPattern_to_Path_joinTable ( - TripPatterns_id varchar(120) not null, - TripPatterns_configRev integer not null, - stopPaths_tripPatternId varchar(120) not null, - stopPaths_stopPathId varchar(120) not null, - stopPaths_configRev integer not null, - listIndex integer not null, - primary key (TripPatterns_id, TripPatterns_configRev, listIndex) - ); - - create table TripPatterns ( - id varchar(120) not null, - configRev integer not null, - directionId varchar(60), - maxLat double precision, - maxLon double precision, - minLat double precision, - minLon double precision, - headsign varchar(255), - routeId varchar(60), - routeShortName varchar(80), - shapeId varchar(60), - primary key (id, configRev) - ); - - create table Trip_scheduledTimesList ( - Trip_tripId varchar(60) not null, - Trip_startTime integer not null, - Trip_configRev integer not null, - arrivalTime integer, - departureTime integer, - scheduledTimesList_ORDER integer not null, - primary key (Trip_tripId, Trip_startTime, Trip_configRev, scheduledTimesList_ORDER) - ); - - create table Trips ( - tripId varchar(60) not null, - startTime integer not null, - configRev integer not null, - blockId varchar(60), - directionId varchar(60), - endTime integer, - exactTimesHeadway bit, - headsign varchar(255), - noSchedule bit, - routeId varchar(60), - routeShortName varchar(60), - serviceId varchar(60), - shapeId varchar(60), - tripShortName varchar(60), - travelTimes_id integer, - tripPattern_id varchar(120), - tripPattern_configRev integer, - primary key (tripId, startTime, configRev) - ); - - create table VehicleConfigs ( - id varchar(60) not null, - capacity integer, - crushCapacity integer, - description varchar(255), - nonPassengerVehicle bit, - trackerId varchar(60), - type integer, - primary key (id) - ); - - create table VehicleEvents ( - vehicleId varchar(60) not null, - time datetime(3) not null, - eventType varchar(60) not null, - avlTime datetime(3), - becameUnpredictable bit, - blockId varchar(60), - description longtext, - lat double precision, - lon double precision, - predictable bit, - routeId varchar(60), - routeShortName varchar(60), - serviceId varchar(60), - stopId varchar(60), - supervisor varchar(60), - tripId varchar(60), - primary key (vehicleId, time, eventType) - ); - - create table VehicleStates ( - vehicleId varchar(60) not null, - avlTime datetime(3) not null, - blockId varchar(60), - isDelayed bit, - isForSchedBasedPreds bit, - isLayover bit, - isPredictable bit, - isWaitStop bit, - routeId varchar(60), - routeShortName varchar(80), - schedAdh varchar(50), - schedAdhMsec integer, - schedAdhWithinBounds bit, - tripId varchar(60), - tripShortName varchar(60), - primary key (vehicleId, avlTime) - ); - - create index ArrivalsDeparturesTimeIndex on ArrivalsDepartures (time); - - create index ArrivalsDeparturesRouteTimeIndex on ArrivalsDepartures (routeShortName, time); - - create index AvlReportsTimeIndex on AvlReports (time); - - create index HeadwayIndex on Headway (creationTime); - - create index HoldingTimeIndex on HoldingTimes (creationTime); - - create index AvlTimeIndex on Matches (avlTime); - - create index MeasuredArrivalTimesIndex on MeasuredArrivalTimes (time); - - create index MonitoringEventsTimeIndex on MonitoringEvents (time); - - create index PredictionAccuracyTimeIndex on PredictionAccuracy (arrivalDepartureTime); - - create index PredictionTimeIndex on Predictions (creationTime); - - create index StopPathPredictionTimeIndex on StopPathPredictions (tripId, stopPathIndex); - - create index TravelTimesRevIndex on TravelTimesForTrips (travelTimesRev); - - alter table TripPattern_to_Path_joinTable - add constraint UK_s0gaw8iv60vc17a5ltryqwg27 unique (stopPaths_tripPatternId, stopPaths_stopPathId, stopPaths_configRev); - - create index VehicleEventsTimeIndex on VehicleEvents (time); - - create index VehicleStateAvlTimeIndex on VehicleStates (avlTime); - - alter table Block_to_Trip_joinTable - add constraint FK_abaj8ke6oh4imbbgnaercsowo - foreign key (trips_tripId, trips_startTime, trips_configRev) - references Trips (tripId, startTime, configRev); - - alter table Block_to_Trip_joinTable - add constraint FK_1c1e1twdap19vq0xkav0amvm - foreign key (Blocks_serviceId, Blocks_configRev, Blocks_blockId) - references Blocks (serviceId, configRev, blockId); - - alter table StopPath_locations - add constraint FK_sdjt3vtd3w0cl07p0doob6khi - foreign key (StopPath_tripPatternId, StopPath_stopPathId, StopPath_configRev) - references StopPaths (tripPatternId, stopPathId, configRev); - - alter table TravelTimesForTrip_to_TravelTimesForPath_joinTable - add constraint FK_hh5uepurijcqj0pyc6e3h5mqw - foreign key (travelTimesForStopPaths_id) - references TravelTimesForStopPaths (id); - - alter table TravelTimesForTrip_to_TravelTimesForPath_joinTable - add constraint FK_9j1s8ewsmokqg4m35wrr29na7 - foreign key (TravelTimesForTrips_id) - references TravelTimesForTrips (id); - - alter table TripPattern_to_Path_joinTable - add constraint FK_s0gaw8iv60vc17a5ltryqwg27 - foreign key (stopPaths_tripPatternId, stopPaths_stopPathId, stopPaths_configRev) - references StopPaths (tripPatternId, stopPathId, configRev); - - alter table TripPattern_to_Path_joinTable - add constraint FK_qsr8l6u1nelb5pt8rlnei08sy - foreign key (TripPatterns_id, TripPatterns_configRev) - references TripPatterns (id, configRev); - - alter table Trip_scheduledTimesList - add constraint FK_n5et0p70cwe1dwo4m6lq0k4h0 - foreign key (Trip_tripId, Trip_startTime, Trip_configRev) - references Trips (tripId, startTime, configRev); - - alter table Trips - add constraint FK_p1er53449kkfsca6mbnxkdyst - foreign key (travelTimes_id) - references TravelTimesForTrips (id); - - alter table Trips - add constraint FK_676npp7h4bxh8sjcnugnxt5wb - foreign key (tripPattern_id, tripPattern_configRev) - references TripPatterns (id, configRev); diff --git a/transitclock/src/main/resources/ddl_mysql_org_transitime_db_webstructs.sql b/transitclock/src/main/resources/ddl_mysql_org_transitime_db_webstructs.sql deleted file mode 100644 index 21017bae7..000000000 --- a/transitclock/src/main/resources/ddl_mysql_org_transitime_db_webstructs.sql +++ /dev/null @@ -1,22 +0,0 @@ - - create table ApiKeys ( - applicationName varchar(80) not null, - applicationKey varchar(20), - applicationUrl varchar(80), - description longtext, - email varchar(80), - phone varchar(80), - primary key (applicationName) - ); - - create table WebAgencies ( - agencyId varchar(60) not null, - active bit, - dbEncryptedPassword varchar(60), - dbHost varchar(120), - dbName varchar(60), - dbType varchar(60), - dbUserName varchar(60), - hostName varchar(120), - primary key (agencyId) - ); From 93bf765e96e573a217928abb4568409fe199ee1e Mon Sep 17 00:00:00 2001 From: BodoMinea Date: Tue, 31 Dec 2019 16:08:58 +0200 Subject: [PATCH 3/4] UTF-8 MySQL structure files - added --- .../ddl_mysql_org_transitclock_db_structs.sql | 559 ++++++++++++++++++ ...l_mysql_org_transitclock_db_webstructs.sql | 22 + 2 files changed, 581 insertions(+) create mode 100644 transitclock/src/main/resources/ddl_mysql_org_transitclock_db_structs.sql create mode 100644 transitclock/src/main/resources/ddl_mysql_org_transitclock_db_webstructs.sql diff --git a/transitclock/src/main/resources/ddl_mysql_org_transitclock_db_structs.sql b/transitclock/src/main/resources/ddl_mysql_org_transitclock_db_structs.sql new file mode 100644 index 000000000..4269ba969 --- /dev/null +++ b/transitclock/src/main/resources/ddl_mysql_org_transitclock_db_structs.sql @@ -0,0 +1,559 @@ + + create table ActiveRevisions ( + id integer not null auto_increment, + configRev integer, + travelTimesRev integer, + primary key (id) + ) DEFAULT CHARSET=utf8; + + create table Agencies ( + configRev integer not null, + agencyName varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + agencyFareUrl varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + agencyId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + agencyLang varchar(15) CHARACTER SET utf8 COLLATE utf8_bin, + agencyPhone varchar(15) CHARACTER SET utf8 COLLATE utf8_bin, + agencyTimezone varchar(40) CHARACTER SET utf8 COLLATE utf8_bin, + agencyUrl varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + maxLat double precision, + maxLon double precision, + minLat double precision, + minLon double precision, + primary key (configRev, agencyName) + ) DEFAULT CHARSET=utf8; + + create table ArrivalsDepartures ( + DTYPE varchar(31) CHARACTER SET utf8 COLLATE utf8_bin not null, + vehicleId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + time datetime(3) not null, + stopId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + isArrival bit not null, + gtfsStopSeq integer not null, + avlTime datetime(3), + blockId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + configRev integer, + directionId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + freqStartTime datetime(3), + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + routeShortName varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + scheduledTime datetime(3), + serviceId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + stopOrder integer, + stopPathIndex integer, + stopPathLength float, + tripIndex integer, + primary key (vehicleId, tripId, time, stopId, isArrival, gtfsStopSeq) + ) DEFAULT CHARSET=utf8; + + create table AvlReports ( + vehicleId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + time datetime(3) not null, + assignmentId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + assignmentType varchar(40) CHARACTER SET utf8 COLLATE utf8_bin, + driverId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + field1Name varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + field1Value varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + heading float, + licensePlate varchar(10) CHARACTER SET utf8 COLLATE utf8_bin, + lat double precision, + lon double precision, + passengerCount integer, + passengerFullness float, + source varchar(10) CHARACTER SET utf8 COLLATE utf8_bin, + speed float, + timeProcessed datetime(3), + primary key (vehicleId, time) + ) DEFAULT CHARSET=utf8; + + create table Block_to_Trip_joinTable ( + Blocks_serviceId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + Blocks_configRev integer not null, + Blocks_blockId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + trips_tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + trips_startTime integer not null, + trips_configRev integer not null, + listIndex integer not null, + primary key (Blocks_serviceId, Blocks_configRev, Blocks_blockId, listIndex) + ) DEFAULT CHARSET=utf8; + + create table Blocks ( + serviceId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + configRev integer not null, + blockId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + endTime integer, + routeIds blob, + startTime integer, + primary key (serviceId, configRev, blockId) + ) DEFAULT CHARSET=utf8; + + create table CalendarDates ( + serviceId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + date date not null, + configRev integer not null, + exceptionType varchar(2), + primary key (serviceId, date, configRev) + ) DEFAULT CHARSET=utf8; + + create table Calendars ( + wednesday bit not null, + tuesday bit not null, + thursday bit not null, + sunday bit not null, + startDate date not null, + serviceId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + saturday bit not null, + monday bit not null, + friday bit not null, + endDate date not null, + configRev integer not null, + primary key (wednesday, tuesday, thursday, sunday, startDate, serviceId, saturday, monday, friday, endDate, configRev) + ) DEFAULT CHARSET=utf8; + + create table ConfigRevision ( + configRev integer not null, + notes longtext, + processedTime datetime(3), + zipFileLastModifiedTime datetime(3), + primary key (configRev) + ) DEFAULT CHARSET=utf8; + + create table DbTest ( + id integer not null, + primary key (id) + ) DEFAULT CHARSET=utf8; + + create table FareAttributes ( + fareId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + configRev integer not null, + currencyType varchar(3), + paymentMethod varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + price float, + transferDuration integer, + transfers varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (fareId, configRev) + ) DEFAULT CHARSET=utf8; + + create table FareRules ( + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + originId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + fareId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + destinationId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + containsId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + configRev integer not null, + primary key (routeId, originId, fareId, destinationId, containsId, configRev) + ) DEFAULT CHARSET=utf8; + + create table Frequencies ( + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + startTime integer not null, + configRev integer not null, + endTime integer, + exactTimes bit, + headwaySecs integer, + primary key (tripId, startTime, configRev) + ) DEFAULT CHARSET=utf8; + + create table Headway ( + id bigint not null auto_increment, + average double precision, + coefficientOfVariation double precision, + configRev integer, + creationTime datetime(3), + firstDeparture datetime(3), + headway double precision, + numVehicles integer, + otherVehicleId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + secondDeparture datetime(3), + stopId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + variance double precision, + vehicleId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (id) + ) DEFAULT CHARSET=utf8; + + create table HoldingTimes ( + id bigint not null auto_increment, + arrivalPredictionUsed bit, + arrivalTime datetime(3), + arrivalUsed bit, + configRev integer, + creationTime datetime(3), + hasD1 bit, + holdingTime datetime(3), + numberPredictionsUsed integer, + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + stopId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + vehicleId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (id) + ) DEFAULT CHARSET=utf8; + + create table Matches ( + vehicleId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + avlTime datetime(3) not null, + atStop bit, + blockId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + configRev integer, + distanceAlongSegment float, + distanceAlongStopPath float, + segmentIndex integer, + serviceId varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + stopPathIndex integer, + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (vehicleId, avlTime) + ) DEFAULT CHARSET=utf8; + + create table MeasuredArrivalTimes ( + time datetime(3) not null, + stopId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + directionId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + headsign varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + routeShortName varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (time, stopId) + ) DEFAULT CHARSET=utf8; + + create table MonitoringEvents ( + type varchar(40) CHARACTER SET utf8 COLLATE utf8_bin not null, + time datetime(3) not null, + message longtext, + triggered bit, + value double precision, + primary key (type, time) + ) DEFAULT CHARSET=utf8; + + create table PredictionAccuracy ( + id bigint not null auto_increment, + affectedByWaitStop bit, + arrivalDepartureTime datetime(3), + directionId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + predictedTime datetime(3), + predictionAccuracyMsecs integer, + predictionReadTime datetime(3), + predictionSource varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + routeShortName varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + stopId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + vehicleId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (id) + ) DEFAULT CHARSET=utf8; + + create table Predictions ( + id bigint not null auto_increment, + affectedByWaitStop bit, + avlTime datetime(3), + configRev integer, + creationTime datetime(3), + gtfsStopSeq integer, + isArrival bit, + predictionTime datetime(3), + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + schedBasedPred bit, + stopId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + vehicleId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (id) + ) DEFAULT CHARSET=utf8; + + create table Routes ( + id varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + configRev integer not null, + color varchar(10) CHARACTER SET utf8 COLLATE utf8_bin, + description longtext, + maxLat double precision, + maxLon double precision, + minLat double precision, + minLon double precision, + hidden bit, + longName varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + maxDistance double precision, + name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + routeOrder integer, + shortName varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + textColor varchar(10) CHARACTER SET utf8 COLLATE utf8_bin, + type varchar(2), + primary key (id, configRev) + ) DEFAULT CHARSET=utf8; + + create table StopPathPredictions ( + id bigint not null auto_increment, + algorithm varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + creationTime datetime(3), + predictionTime double precision, + startTime integer, + stopPathIndex integer, + travelTime bit, + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + vehicleId varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (id) + ) DEFAULT CHARSET=utf8; + + create table StopPath_locations ( + StopPath_tripPatternId varchar(120) CHARACTER SET utf8 COLLATE utf8_bin not null, + StopPath_stopPathId varchar(120) CHARACTER SET utf8 COLLATE utf8_bin not null, + StopPath_configRev integer not null, + lat double precision, + lon double precision, + locations_ORDER integer not null, + primary key (StopPath_tripPatternId, StopPath_stopPathId, StopPath_configRev, locations_ORDER) + ) DEFAULT CHARSET=utf8; + + create table StopPaths ( + tripPatternId varchar(120) CHARACTER SET utf8 COLLATE utf8_bin not null, + stopPathId varchar(120) CHARACTER SET utf8 COLLATE utf8_bin not null, + configRev integer not null, + breakTime integer, + gtfsStopSeq integer, + lastStopInTrip bit, + layoverStop bit, + maxDistance double precision, + maxSpeed double precision, + pathLength double precision, + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + scheduleAdherenceStop bit, + stopId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + waitStop bit, + primary key (tripPatternId, stopPathId, configRev) + ) DEFAULT CHARSET=utf8; + + create table Stops ( + id varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + configRev integer not null, + code integer, + hidden bit, + layoverStop bit, + lat double precision, + lon double precision, + name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + timepointStop bit, + waitStop bit, + primary key (id, configRev) + ) DEFAULT CHARSET=utf8; + + create table Transfers ( + toStopId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + fromStopId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + configRev integer not null, + minTransferTime integer, + transferType varchar(1), + primary key (toStopId, fromStopId, configRev) + ) DEFAULT CHARSET=utf8; + + create table TravelTimesForStopPaths ( + id integer not null auto_increment, + configRev integer, + daysOfWeekOverride smallint, + howSet varchar(5), + stopPathId varchar(120) CHARACTER SET utf8 COLLATE utf8_bin, + stopTimeMsec integer, + travelTimeSegmentLength float, + travelTimesMsec mediumblob, + travelTimesRev integer, + primary key (id) + ) DEFAULT CHARSET=utf8; + + create table TravelTimesForTrip_to_TravelTimesForPath_joinTable ( + TravelTimesForTrips_id integer not null, + travelTimesForStopPaths_id integer not null, + listIndex integer not null, + primary key (TravelTimesForTrips_id, listIndex) + ) DEFAULT CHARSET=utf8; + + create table TravelTimesForTrips ( + id integer not null auto_increment, + configRev integer, + travelTimesRev integer, + tripCreatedForId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + tripPatternId varchar(120) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (id) + ) DEFAULT CHARSET=utf8; + + create table TripPattern_to_Path_joinTable ( + TripPatterns_id varchar(120) CHARACTER SET utf8 COLLATE utf8_bin not null, + TripPatterns_configRev integer not null, + stopPaths_tripPatternId varchar(120) CHARACTER SET utf8 COLLATE utf8_bin not null, + stopPaths_stopPathId varchar(120) CHARACTER SET utf8 COLLATE utf8_bin not null, + stopPaths_configRev integer not null, + listIndex integer not null, + primary key (TripPatterns_id, TripPatterns_configRev, listIndex) + ) DEFAULT CHARSET=utf8; + + create table TripPatterns ( + id varchar(120) CHARACTER SET utf8 COLLATE utf8_bin not null, + configRev integer not null, + directionId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + maxLat double precision, + maxLon double precision, + minLat double precision, + minLon double precision, + headsign varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + routeShortName varchar(80) CHARACTER SET utf8 COLLATE utf8_bin, + shapeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (id, configRev) + ) DEFAULT CHARSET=utf8; + + create table Trip_scheduledTimesList ( + Trip_tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + Trip_startTime integer not null, + Trip_configRev integer not null, + arrivalTime integer, + departureTime integer, + scheduledTimesList_ORDER integer not null, + primary key (Trip_tripId, Trip_startTime, Trip_configRev, scheduledTimesList_ORDER) + ) DEFAULT CHARSET=utf8; + + create table Trips ( + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + startTime integer not null, + configRev integer not null, + blockId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + directionId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + endTime integer, + exactTimesHeadway bit, + headsign varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + noSchedule bit, + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + routeShortName varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + serviceId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + shapeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + tripShortName varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + travelTimes_id integer, + tripPattern_id varchar(120) CHARACTER SET utf8 COLLATE utf8_bin, + tripPattern_configRev integer, + primary key (tripId, startTime, configRev) + ) DEFAULT CHARSET=utf8; + + create table VehicleConfigs ( + id varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + capacity integer, + crushCapacity integer, + description varchar(255) CHARACTER SET utf8 COLLATE utf8_bin, + nonPassengerVehicle bit, + trackerId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + type integer, + primary key (id) + ) DEFAULT CHARSET=utf8; + + create table VehicleEvents ( + vehicleId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + time datetime(3) not null, + eventType varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + avlTime datetime(3), + becameUnpredictable bit, + blockId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + description longtext, + lat double precision, + lon double precision, + predictable bit, + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + routeShortName varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + serviceId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + stopId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + supervisor varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (vehicleId, time, eventType) + ) DEFAULT CHARSET=utf8; + + create table VehicleStates ( + vehicleId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + avlTime datetime(3) not null, + blockId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + isDelayed bit, + isForSchedBasedPreds bit, + isLayover bit, + isPredictable bit, + isWaitStop bit, + routeId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + routeShortName varchar(80) CHARACTER SET utf8 COLLATE utf8_bin, + schedAdh varchar(50) CHARACTER SET utf8 COLLATE utf8_bin, + schedAdhMsec integer, + schedAdhWithinBounds bit, + tripId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + tripShortName varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (vehicleId, avlTime) + ) DEFAULT CHARSET=utf8; + + create index ArrivalsDeparturesTimeIndex on ArrivalsDepartures (time); + + create index ArrivalsDeparturesRouteTimeIndex on ArrivalsDepartures (routeShortName, time); + + create index AvlReportsTimeIndex on AvlReports (time); + + create index HeadwayIndex on Headway (creationTime); + + create index HoldingTimeIndex on HoldingTimes (creationTime); + + create index AvlTimeIndex on Matches (avlTime); + + create index MeasuredArrivalTimesIndex on MeasuredArrivalTimes (time); + + create index MonitoringEventsTimeIndex on MonitoringEvents (time); + + create index PredictionAccuracyTimeIndex on PredictionAccuracy (arrivalDepartureTime); + + create index PredictionTimeIndex on Predictions (creationTime); + + create index StopPathPredictionTimeIndex on StopPathPredictions (tripId, stopPathIndex); + + create index TravelTimesRevIndex on TravelTimesForTrips (travelTimesRev); + + alter table TripPattern_to_Path_joinTable + add constraint UK_s0gaw8iv60vc17a5ltryqwg27 unique (stopPaths_tripPatternId, stopPaths_stopPathId, stopPaths_configRev); + + create index VehicleEventsTimeIndex on VehicleEvents (time); + + create index VehicleStateAvlTimeIndex on VehicleStates (avlTime); + + alter table Block_to_Trip_joinTable + add constraint FK_abaj8ke6oh4imbbgnaercsowo + foreign key (trips_tripId, trips_startTime, trips_configRev) + references Trips (tripId, startTime, configRev); + + alter table Block_to_Trip_joinTable + add constraint FK_1c1e1twdap19vq0xkav0amvm + foreign key (Blocks_serviceId, Blocks_configRev, Blocks_blockId) + references Blocks (serviceId, configRev, blockId); + + alter table StopPath_locations + add constraint FK_sdjt3vtd3w0cl07p0doob6khi + foreign key (StopPath_tripPatternId, StopPath_stopPathId, StopPath_configRev) + references StopPaths (tripPatternId, stopPathId, configRev); + + alter table TravelTimesForTrip_to_TravelTimesForPath_joinTable + add constraint FK_hh5uepurijcqj0pyc6e3h5mqw + foreign key (travelTimesForStopPaths_id) + references TravelTimesForStopPaths (id); + + alter table TravelTimesForTrip_to_TravelTimesForPath_joinTable + add constraint FK_9j1s8ewsmokqg4m35wrr29na7 + foreign key (TravelTimesForTrips_id) + references TravelTimesForTrips (id); + + alter table TripPattern_to_Path_joinTable + add constraint FK_s0gaw8iv60vc17a5ltryqwg27 + foreign key (stopPaths_tripPatternId, stopPaths_stopPathId, stopPaths_configRev) + references StopPaths (tripPatternId, stopPathId, configRev); + + alter table TripPattern_to_Path_joinTable + add constraint FK_qsr8l6u1nelb5pt8rlnei08sy + foreign key (TripPatterns_id, TripPatterns_configRev) + references TripPatterns (id, configRev); + + alter table Trip_scheduledTimesList + add constraint FK_n5et0p70cwe1dwo4m6lq0k4h0 + foreign key (Trip_tripId, Trip_startTime, Trip_configRev) + references Trips (tripId, startTime, configRev); + + alter table Trips + add constraint FK_p1er53449kkfsca6mbnxkdyst + foreign key (travelTimes_id) + references TravelTimesForTrips (id); + + alter table Trips + add constraint FK_676npp7h4bxh8sjcnugnxt5wb + foreign key (tripPattern_id, tripPattern_configRev) + references TripPatterns (id, configRev); diff --git a/transitclock/src/main/resources/ddl_mysql_org_transitclock_db_webstructs.sql b/transitclock/src/main/resources/ddl_mysql_org_transitclock_db_webstructs.sql new file mode 100644 index 000000000..d9066cb5b --- /dev/null +++ b/transitclock/src/main/resources/ddl_mysql_org_transitclock_db_webstructs.sql @@ -0,0 +1,22 @@ + + create table ApiKeys ( + applicationName varchar(80) CHARACTER SET utf8 COLLATE utf8_bin not null, + applicationKey varchar(20) CHARACTER SET utf8 COLLATE utf8_bin, + applicationUrl varchar(80) CHARACTER SET utf8 COLLATE utf8_bin, + description longtext, + email varchar(80) CHARACTER SET utf8 COLLATE utf8_bin, + phone varchar(80) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (applicationName) + ) DEFAULT CHARSET=utf8; + + create table WebAgencies ( + agencyId varchar(60) CHARACTER SET utf8 COLLATE utf8_bin not null, + active bit, + dbEncryptedPassword varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + dbHost varchar(120) CHARACTER SET utf8 COLLATE utf8_bin, + dbName varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + dbType varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + dbUserName varchar(60) CHARACTER SET utf8 COLLATE utf8_bin, + hostName varchar(120) CHARACTER SET utf8 COLLATE utf8_bin, + primary key (agencyId) + ) DEFAULT CHARSET=utf8; From 690e1d39554beb5b61c20ed33bb7146402b85de0 Mon Sep 17 00:00:00 2001 From: BodoMinea Date: Tue, 31 Dec 2019 16:27:40 +0200 Subject: [PATCH 4/4] Readme clarifications --- transitclockApi/README.md | 18 +++++++++++++++--- transitclockWebapp/README.md | 14 ++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/transitclockApi/README.md b/transitclockApi/README.md index eee13558e..9782f13e4 100644 --- a/transitclockApi/README.md +++ b/transitclockApi/README.md @@ -12,7 +12,19 @@ You will need to configure the location of the transitclockConfig.xml file as a `-Dtransitclock.configFiles=/path/to/your/transitclockConfig.xml` -The exact place to do this depends on how you're running TheTransitClock. In Eclipse, add this as a VM argument in the run configuration for Tomcat. In a bash script, add it to `CATALINA_OPTS` before Tomcat starts up. +The exact place to do this depends on how you're running TheTransitClock. In Eclipse, add this as a VM argument in the run configuration for Tomcat. In a bash script, add it to `CATALINA_OPTS` (ex.: $CATALINA_HOME/bin/setenv.sh) before Tomcat starts up. + +``` +#example script +export CATALINA_OPTS="-Dtransitclock.apikey=8a3273b0 \ +-Dtransitclock.configFiles=/usr/local/transitclock/config/02.xml +-Dtransitclock.hibernate.configFile=/usr/local/transitclock/config/hibernate_cfg.xml" + +export JAVA_OPTS="-Dtransitclock.apikey=8a3273b0 \ +-Dtransitclock.configFiles=/usr/local/transitclock/config/02.xml +-Dtransitclock.hibernate.configFile=/usr/local/transitclock/config/hibernate_cfg.xml" +``` +If you have multiple agencies in your system, only the primary agency which has in its table structure the access data for the other instances should have its configuration file given as command line parameter. Both the Web UI and the API can function in a multi-tenancy model in this way. If you are running on Tomcat, specifying the command line options once is enough for both the API and Web endpoints. This server talks to core using RMI calls to get the information to support the REST service calls. @@ -22,8 +34,8 @@ The tables that store this information are create by running the ddl_xxxx_org_tr ``` Example URLs -http://[server]:[port]/v1/transitime/key/[Key from CreateAPIKey]/agency/[agency id]/command/gtfs-rt/tripUpdates?format=human +http://[server]:[port]/v1/key/[Key from CreateAPIKey]/agency/[agency id]/command/gtfs-rt/tripUpdates?format=human -http://127.0.0.1:8093/v1/transitime/key/8a3273b0/agency/02/command/gtfs-rt/tripUpdates?format=human +http://127.0.0.1:8080/v1/key/8a3273b0/agency/02/command/gtfs-rt/tripUpdates?format=human ``` The comments in the supporting classes are the best source of information for RESTFul calls. diff --git a/transitclockWebapp/README.md b/transitclockWebapp/README.md index db1e2ac33..01e7efc2e 100644 --- a/transitclockWebapp/README.md +++ b/transitclockWebapp/README.md @@ -11,8 +11,22 @@ You will need to configure the location of the transitclockConfig.xml file as a `-Dtransitclock.configFiles=/path/to/your/transitclockConfig.xml` +``` +#example script +export CATALINA_OPTS="-Dtransitclock.apikey=8a3273b0 \ +-Dtransitclock.configFiles=/usr/local/transitclock/config/02.xml +-Dtransitclock.hibernate.configFile=/usr/local/transitclock/config/hibernate_cfg.xml" + +export JAVA_OPTS="-Dtransitclock.apikey=8a3273b0 \ +-Dtransitclock.configFiles=/usr/local/transitclock/config/02.xml +-Dtransitclock.hibernate.configFile=/usr/local/transitclock/config/hibernate_cfg.xml" +``` +If you have multiple agencies in your system, only the primary agency which has in its table structure the access data for the other instances should have its configuration file given as command line parameter. Both the Web UI and the API can function in a multi-tenancy model in this way. If you are running on Tomcat, specifying the command line options once is enough for both the API and Web endpoints. + The exact place to do this depends on how you're running TheTransitClock. In Eclipse, add this as a VM argument in the run configuration for Tomcat. In a bash script, add it to `CATALINA_OPTS` before Tomcat starts up. The transitclockConfig.xml file in turn is used to specify the location of the database and the hibernate file. You will also need to configure the key for accessing the transitclockApi in the template/includes.jsp file. You can use the CreateAPIKey application in TheTransitClock to create a test/demo key. This you may already have done as part of the setup of transitclockApi. + +You first need to have the core instances running, the RMI Registry running and the API setup before Web UI functions will become usable. \ No newline at end of file