diff --git a/configurations/default/server.yml.tmp b/configurations/default/server.yml.tmp index 74b0b2338..c91ef7b97 100644 --- a/configurations/default/server.yml.tmp +++ b/configurations/default/server.yml.tmp @@ -1,5 +1,5 @@ application: - title: Data Tools + title: DataHub Editor logo: https://d2tyb7byn1fef9.cloudfront.net/ibi_group-128x128.png logo_large: https://d2tyb7byn1fef9.cloudfront.net/ibi_group_black-512x512.png client_assets_url: https://example.com diff --git a/src/main/java/com/conveyal/datatools/common/status/MonitorableJob.java b/src/main/java/com/conveyal/datatools/common/status/MonitorableJob.java index 50903aab1..e04ee249a 100644 --- a/src/main/java/com/conveyal/datatools/common/status/MonitorableJob.java +++ b/src/main/java/com/conveyal/datatools/common/status/MonitorableJob.java @@ -177,7 +177,7 @@ public void run () { // Calculate completion based on number of sub jobs remaining. double percentComplete = subJobNumber * 100D / subJobsTotal; // Run sub-task if no error has errored during parent job or previous sub-task execution. - status.update(String.format("Waiting on %s...", subJobName), percentComplete); + status.update(String.format("Opération %s en cours", subJobName), percentComplete); subJob.run(); // Record if there has been an error in the execution of the sub-task. (Note: this will not // incorrectly overwrite a 'true' value with 'false' because the sub-task is only run if @@ -199,7 +199,7 @@ public void run () { cancel(cancelMessage); } // Complete the job (as success if no errors encountered, as failure otherwise). - if (!parentJobErrored && !subTaskErrored) status.completeSuccessfully("Job complete!"); + if (!parentJobErrored && !subTaskErrored) status.completeSuccessfully("Opération réussie !"); else status.complete(true); // Run final steps of job pending completion or error. Note: any tasks that depend on job success should // check job status in jobFinished to determine if final step should be executed (e.g., storing feed diff --git a/src/main/java/com/conveyal/datatools/editor/controllers/api/SnapshotController.java b/src/main/java/com/conveyal/datatools/editor/controllers/api/SnapshotController.java index 58d93fee9..06d9dacdd 100644 --- a/src/main/java/com/conveyal/datatools/editor/controllers/api/SnapshotController.java +++ b/src/main/java/com/conveyal/datatools/editor/controllers/api/SnapshotController.java @@ -110,7 +110,7 @@ private static String createSnapshot (Request req, Response res) throws IOExcept } // Begin asynchronous execution. JobUtils.heavyExecutor.execute(createSnapshotJob); - return SparkUtils.formatJobMessage(createSnapshotJob.jobId, "Creating snapshot."); + return SparkUtils.formatJobMessage(createSnapshotJob.jobId, "Opération réussie !"); } /** diff --git a/src/main/java/com/conveyal/datatools/editor/jobs/CreateSnapshotJob.java b/src/main/java/com/conveyal/datatools/editor/jobs/CreateSnapshotJob.java index 2a823ae25..3fd720c83 100644 --- a/src/main/java/com/conveyal/datatools/editor/jobs/CreateSnapshotJob.java +++ b/src/main/java/com/conveyal/datatools/editor/jobs/CreateSnapshotJob.java @@ -73,7 +73,7 @@ public class CreateSnapshotJob extends MonitorableJob { private FeedSource feedSource; public CreateSnapshotJob(Auth0UserProfile owner, Snapshot snapshot, boolean updateBufferNamespace, boolean storeSnapshot, boolean preserveBufferAsSnapshot) { - super(owner, "Creating snapshot for " + snapshot.feedSourceId, JobType.CREATE_SNAPSHOT); + super(owner, "Création d'un instantané pour " + snapshot.feedSourceId, JobType.CREATE_SNAPSHOT); this.namespace = snapshot.snapshotOf; this.snapshot = snapshot; this.updateBuffer = updateBufferNamespace; @@ -83,7 +83,7 @@ public CreateSnapshotJob(Auth0UserProfile owner, Snapshot snapshot, boolean upda } public CreateSnapshotJob(Auth0UserProfile owner, Snapshot snapshot) { - super(owner, "Creating snapshot for " + snapshot.feedSourceId, JobType.CREATE_SNAPSHOT); + super(owner, "Création d'un instantané pour " + snapshot.feedSourceId, JobType.CREATE_SNAPSHOT); this.snapshot = snapshot; this.updateBuffer = false; this.storeSnapshot = true; @@ -108,10 +108,10 @@ public void jobLogic() { // Get count of snapshots to set new version number. feedSource = Persistence.feedSources.getById(snapshot.feedSourceId); // Update job name to use feed source name (rather than ID). - this.name = String.format("Creating snapshot for %s", feedSource.name); + this.name = String.format("Création d'un instantané pour %s", feedSource.name); Collection existingSnapshots = feedSource.retrieveSnapshots(); int version = existingSnapshots.size(); - status.update("Creating snapshot...", 20); + status.update("Création d'un instantané...", 20); FeedLoadResult loadResult = makeSnapshot(namespace, DataManager.GTFS_DATA_SOURCE, !feedSource.preserveStopTimesSequence); snapshot.version = version; snapshot.namespace = loadResult.uniqueIdentifier; diff --git a/src/main/java/com/conveyal/datatools/editor/jobs/ExportSnapshotToGTFSJob.java b/src/main/java/com/conveyal/datatools/editor/jobs/ExportSnapshotToGTFSJob.java index fc76890b5..d51fcb8ab 100644 --- a/src/main/java/com/conveyal/datatools/editor/jobs/ExportSnapshotToGTFSJob.java +++ b/src/main/java/com/conveyal/datatools/editor/jobs/ExportSnapshotToGTFSJob.java @@ -31,11 +31,11 @@ public class ExportSnapshotToGTFSJob extends MonitorableJob { private final boolean publishProprietaryFiles; public ExportSnapshotToGTFSJob(Auth0UserProfile owner, Snapshot snapshot, FeedVersion feedVersion, boolean publishProprietaryFiles) { - super(owner, "Exporting snapshot " + snapshot.name, JobType.EXPORT_SNAPSHOT_TO_GTFS); + super(owner, "Export de l'instantané " + snapshot.name, JobType.EXPORT_SNAPSHOT_TO_GTFS); this.snapshot = snapshot; this.feedVersion = feedVersion; this.publishProprietaryFiles = publishProprietaryFiles; - status.update("Starting database snapshot...", 10); + status.update("Ouverture de l'instantané...", 10); } public ExportSnapshotToGTFSJob(Auth0UserProfile owner, Snapshot snapshot, boolean publishProprietaryFiles) { @@ -56,13 +56,13 @@ public void jobLogic() { tempFile = File.createTempFile("snapshot", "zip"); } catch (IOException e) { e.printStackTrace(); - status.fail("Error creating local file for snapshot.", e); + status.fail("Erreur lors de la création du fichier depuis l'instantané", e); return; } JdbcGtfsExporter exporter = new JdbcGtfsExporter(snapshot.namespace, tempFile.getAbsolutePath(), DataManager.GTFS_DATA_SOURCE, true, publishProprietaryFiles); FeedLoadResult result = exporter.exportTables(); if (result.fatalException != null) { - status.fail(String.format("Error (%s) encountered while exporting database tables.", result.fatalException)); + status.fail(String.format("Erreur (%s) rencontrée lors de l'export.", result.fatalException)); return; } @@ -71,7 +71,7 @@ public void jobLogic() { String bucketPrefix = isNewVersion ? "gtfs" : "snapshots"; // FIXME: replace with use of refactored FeedStore. // Store the GTFS zip locally or on s3. - status.update("Writing snapshot to GTFS file", 90); + status.update("Ecriture de l'instantané dans le GTFS", 90); if (DataManager.useS3) { String s3Key = String.format("%s/%s", bucketPrefix, filename); try { @@ -93,7 +93,7 @@ public void jobLogic() { @Override public void jobFinished () { - if (!status.error) status.completeSuccessfully("Export complete!"); + if (!status.error) status.completeSuccessfully("Export complété !"); // Delete snapshot temp file. if (tempFile != null) { LOG.info("Deleting temporary GTFS file for exported snapshot at {}", tempFile.getAbsolutePath()); diff --git a/src/main/java/com/conveyal/datatools/manager/auth/Auth0UserProfile.java b/src/main/java/com/conveyal/datatools/manager/auth/Auth0UserProfile.java index 029bb8d99..ba0e576d2 100644 --- a/src/main/java/com/conveyal/datatools/manager/auth/Auth0UserProfile.java +++ b/src/main/java/com/conveyal/datatools/manager/auth/Auth0UserProfile.java @@ -40,7 +40,7 @@ public Auth0UserProfile(String email, String user_id) { * Utility method for creating a test admin (with application-admin permissions) user. */ public static Auth0UserProfile createTestAdminUser() { - return createAdminUser("mock@example.com", "user_id:string"); + return createAdminUser("operateur@sibr.fr", "user_id:string"); } /** diff --git a/src/main/java/com/conveyal/datatools/manager/controllers/DumpController.java b/src/main/java/com/conveyal/datatools/manager/controllers/DumpController.java index 28f4fec28..efa6d9afd 100644 --- a/src/main/java/com/conveyal/datatools/manager/controllers/DumpController.java +++ b/src/main/java/com/conveyal/datatools/manager/controllers/DumpController.java @@ -347,7 +347,7 @@ private static void loadLegacyFeedVersion (JsonNode node) { * that needs to be applied to all feeds. */ public static boolean validateAll (boolean load, boolean force, String filterFeedId) throws Exception { - LOG.info("validating all feeds..."); + LOG.info("Validation des flux"); Collection allVersions = Persistence.feedVersions.getAll(); for(FeedVersion version: allVersions) { ValidationResult result = version.validationResult; diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/CreateFeedVersionFromSnapshotJob.java b/src/main/java/com/conveyal/datatools/manager/jobs/CreateFeedVersionFromSnapshotJob.java index c6929a93b..0067a6039 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/CreateFeedVersionFromSnapshotJob.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/CreateFeedVersionFromSnapshotJob.java @@ -25,7 +25,7 @@ public class CreateFeedVersionFromSnapshotJob extends FeedSourceJob { private final boolean publishProprietaryFiles; public CreateFeedVersionFromSnapshotJob(FeedSource feedSource, Snapshot snapshot, Auth0UserProfile owner, boolean publishProprietaryFiles) { - super(owner, "Creating Feed Version from Snapshot for " + feedSource.name, JobType.CREATE_FEEDVERSION_FROM_SNAPSHOT); + super(owner, "Création d'une version depuis un instantané pour " + feedSource.name, JobType.CREATE_FEEDVERSION_FROM_SNAPSHOT); this.feedVersion = new FeedVersion(feedSource, snapshot); this.snapshot = snapshot; this.publishProprietaryFiles = publishProprietaryFiles; @@ -33,7 +33,7 @@ public CreateFeedVersionFromSnapshotJob(FeedSource feedSource, Snapshot snapshot @Override public void jobLogic() { - status.update("Exporting snapshot to GTFS...", 10); + status.update("Export de l’instantané", 10); // Add the jobs to handle this operation in order. addNextJob( // First export the snapshot to GTFS. diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/LoadFeedJob.java b/src/main/java/com/conveyal/datatools/manager/jobs/LoadFeedJob.java index c6a415139..2c788cffa 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/LoadFeedJob.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/LoadFeedJob.java @@ -19,10 +19,10 @@ public class LoadFeedJob extends FeedVersionJob { private final boolean isNewVersion; public LoadFeedJob(FeedVersion version, Auth0UserProfile owner, boolean isNewVersion) { - super(owner, "Loading GTFS", JobType.LOAD_FEED); + super(owner, "Chargement du GTFS", JobType.LOAD_FEED); feedVersion = version; this.isNewVersion = isNewVersion; - status.update("Waiting to load feed...", 0); + status.update("Chargement en cours...", 0); } /** @@ -49,7 +49,7 @@ public void jobLogic () { @Override public void jobFinished () { if (!status.error) { - status.completeSuccessfully("Load stage complete!"); + status.completeSuccessfully("Chargement terminé !"); } } diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/NotifyUsersForSubscriptionJob.java b/src/main/java/com/conveyal/datatools/manager/jobs/NotifyUsersForSubscriptionJob.java index 0cc02cd42..bffe396de 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/NotifyUsersForSubscriptionJob.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/NotifyUsersForSubscriptionJob.java @@ -22,7 +22,7 @@ public class NotifyUsersForSubscriptionJob implements Runnable { private String subscriptionType; private String target; private String message; - private static final String DEFAULT_NAME = "Data Tools"; + private static final String DEFAULT_NAME = "DataHub Editor"; private static final String APPLICATION_NAME = DataManager.getConfigPropertyAsText("application.title"); private static final String APPLICATION_URL = DataManager.getConfigPropertyAsText("application.public_url"); diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/ProcessSingleFeedJob.java b/src/main/java/com/conveyal/datatools/manager/jobs/ProcessSingleFeedJob.java index c267fdd9a..efb352a68 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/ProcessSingleFeedJob.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/ProcessSingleFeedJob.java @@ -39,11 +39,11 @@ public class ProcessSingleFeedJob extends FeedVersionJob { * Create a job for the given feed version. */ public ProcessSingleFeedJob(FeedVersion feedVersion, Auth0UserProfile owner, boolean isNewVersion) { - super(owner, "Processing GTFS for " + (feedVersion.parentFeedSource() != null ? feedVersion.parentFeedSource().name : "unknown feed source"), JobType.PROCESS_FEED); + super(owner, "Traitement GTFS pour " + (feedVersion.parentFeedSource() != null ? feedVersion.parentFeedSource().name : "source inconnue"), JobType.PROCESS_FEED); this.feedVersion = feedVersion; this.feedSource = feedVersion.parentFeedSource(); this.isNewVersion = isNewVersion; - status.update("Waiting...", 0); + status.update("En cours...", 0); status.uploading = true; } @@ -85,7 +85,7 @@ public String getFeedSourceId() { */ @Override public void jobLogic() { - LOG.info("Processing feed for {}", feedVersion.id); + LOG.info("Traitement du flux pour {}", feedVersion.id); FeedTransformRules rules = feedSource.getRulesForRetrievalMethod(feedVersion.retrievalMethod); boolean shouldTransform = rules != null; if (shouldTransform) { @@ -171,9 +171,9 @@ public void jobLogic() { @Override public void jobFinished() { if (!status.error) { - status.completeSuccessfully("New version saved."); + status.completeSuccessfully("Nouvelle version enregistrée."); } else { - LOG.warn("Error processing version {} because of {}.", feedVersion.id, getErrorReasonMessage()); + LOG.warn("Erreur de traitement de la version {} ({}).", feedVersion.id, getErrorReasonMessage()); } // Send notification to those subscribed to feed version updates. NotifyUsersForSubscriptionJob.createNotification( @@ -188,8 +188,8 @@ public void jobFinished() { */ private String getErrorReasonMessage() { return status.exceptionType != null - ? String.format("error due to %s", status.exceptionType) - : "unknown error"; + ? String.format("erreur %s", status.exceptionType) + : "erreur inconnue"; } /** @@ -199,7 +199,7 @@ private String getErrorReasonMessage() { public String getNotificationMessage() { StringBuilder message = new StringBuilder(); if (!status.error) { - message.append(String.format("New feed version created for %s (valid from %s - %s). ", + message.append(String.format("Nouvelle version créée pour %s (valide du %s au %s).", feedSource.name, feedVersion.validationResult.firstCalendarDate, feedVersion.validationResult.lastCalendarDate)); diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/ValidateFeedJob.java b/src/main/java/com/conveyal/datatools/manager/jobs/ValidateFeedJob.java index 6f4c6feb6..89175b03f 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/ValidateFeedJob.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/ValidateFeedJob.java @@ -21,15 +21,15 @@ public class ValidateFeedJob extends FeedVersionJob { private final boolean isNewVersion; public ValidateFeedJob(FeedVersion version, Auth0UserProfile owner, boolean isNewVersion) { - super(owner, "Validating Feed", JobType.VALIDATE_FEED); + super(owner, "Validation du flux", JobType.VALIDATE_FEED); feedVersion = version; this.isNewVersion = isNewVersion; - status.update("Waiting to begin validation...", 0); + status.update("En attente de la validation...", 0); } @Override public void jobLogic () { - LOG.info("Running ValidateFeedJob for {}", feedVersion.id); + LOG.info("Opération ValidateFeedJob en cours pour {}", feedVersion.id); feedVersion.validate(status); } @@ -50,7 +50,7 @@ public void jobFinished () { } // TODO: If ValidateFeedJob is called without a parent job (e.g., to "re-validate" a feed), we should handle // storing the updated ValidationResult in Mongo. - status.completeSuccessfully("Validation finished!"); + status.completeSuccessfully("Validation terminée!"); } else { // If the version was not stored successfully, call FeedVersion#delete to reset things to before the version // was uploaded/fetched. Note: delete calls made to MongoDB on the version ID will not succeed, but that is diff --git a/src/main/java/com/conveyal/datatools/manager/jobs/ValidateMobilityDataFeedJob.java b/src/main/java/com/conveyal/datatools/manager/jobs/ValidateMobilityDataFeedJob.java index c811c10d0..0075a5608 100644 --- a/src/main/java/com/conveyal/datatools/manager/jobs/ValidateMobilityDataFeedJob.java +++ b/src/main/java/com/conveyal/datatools/manager/jobs/ValidateMobilityDataFeedJob.java @@ -18,15 +18,15 @@ public class ValidateMobilityDataFeedJob extends FeedVersionJob { private final boolean isNewVersion; public ValidateMobilityDataFeedJob(FeedVersion version, Auth0UserProfile owner, boolean isNewVersion) { - super(owner, "Validating Feed using MobilityData", JobType.VALIDATE_FEED); + super(owner, "Validation du flux par MobilityData", JobType.VALIDATE_FEED); feedVersion = version; this.isNewVersion = isNewVersion; - status.update("Waiting to begin MobilityData validation...", 0); + status.update("En attente de la validation MobilityData...", 0); } @Override public void jobLogic () { - LOG.info("Running ValidateMobilityDataFeedJob for {}", feedVersion.id); + LOG.info("Opération ValidateMobilityDataFeedJob en cours pour {}", feedVersion.id); feedVersion.validateMobility(status); } @@ -42,7 +42,7 @@ public void jobFinished () { // the version won't get loaded into MongoDB (even though it exists in postgres). feedVersion.persistFeedVersionAfterValidation(isNewVersion); } - status.completeSuccessfully("MobilityData validation finished!"); + status.completeSuccessfully("Validation MobilityData terminée"); } else { // If the version was not stored successfully, call FeedVersion#delete to reset things to before the version // was uploaded/fetched. Note: delete calls made to MongoDB on the version ID will not succeed, but that is diff --git a/src/main/java/com/conveyal/datatools/manager/models/FeedVersion.java b/src/main/java/com/conveyal/datatools/manager/models/FeedVersion.java index bb87c6187..fcc26715a 100644 --- a/src/main/java/com/conveyal/datatools/manager/models/FeedVersion.java +++ b/src/main/java/com/conveyal/datatools/manager/models/FeedVersion.java @@ -109,7 +109,7 @@ public FeedVersion(FeedSource source, Snapshot snapshot) { this(source, snapshot.retrievalMethod); // Set feed version properties. originNamespace = snapshot.namespace; - name = snapshot.name + " Snapshot Export"; + name = snapshot.name; } private String generateFeedVersionId(FeedSource source) { @@ -276,7 +276,7 @@ public void load(MonitorableJob.Status status, boolean isNewVersion) { File gtfsFile; // STEP 1. LOAD GTFS feed into relational database try { - status.update("Unpacking feed...", 15.0); + status.update("Récupération du flux...", 15.0); // Get SQL schema namespace for the feed version. This is needed for reconnecting with feeds // in the database. gtfsFile = retrieveGtfsFile(); @@ -360,10 +360,10 @@ public void validate(MonitorableJob.Status status) { // VALIDATE GTFS feed. try { - LOG.info("Beginning validation..."); + LOG.info("Début de la validation..."); // FIXME: pass status to validate? Or somehow listen to events? - status.update("Validating feed...", 33); + status.update("Validation du flux...", 33); // Validate the feed version. // Certain extensions, if enabled, have extra validators. @@ -402,7 +402,7 @@ public void validate(MonitorableJob.Status status) { ); } } catch (Exception e) { - status.fail(String.format("Unable to validate feed %s", this.id), e); + status.fail(String.format("Impossible de valider le flux %s", this.id), e); // FIXME create validation result with new constructor? validationResult = new ValidationResult(); validationResult.fatalException = "failure!"; @@ -416,8 +416,8 @@ public void validateMobility(MonitorableJob.Status status) { // VALIDATE GTFS feed try { - LOG.info("Beginning MobilityData validation..."); - status.update("MobilityData Analysis...", 11); + LOG.info("Début de la validation MobilityData..."); + status.update("Analyse MobilityData...", 11); // Wait for the file to be entirely copied into the directory. // 5 seconds + ~1 second per 10mb @@ -427,19 +427,19 @@ public void validateMobility(MonitorableJob.Status status) { // TODO: do we know that there will always be a namespace? String validatorOutputDirectory = "/tmp/datatools_gtfs/" + this.namespace + "/"; - status.update("MobilityData Analysis...", 20); + status.update("Analyse MobilityData...", 20); // Set up MobilityData validator. ValidationRunnerConfig.Builder builder = ValidationRunnerConfig.builder(); builder.setGtfsSource(gtfsZip.toURI()); builder.setOutputDirectory(Path.of(validatorOutputDirectory)); ValidationRunnerConfig mbValidatorConfig = builder.build(); - status.update("MobilityData Analysis...", 40); + status.update("Analyse MobilityData...", 40); // Run MobilityData validator ValidationRunner runner = new ValidationRunner(new VersionResolver(ApplicationType.CLI)); runner.run(mbValidatorConfig); - status.update("MobilityData Analysis...", 80); + status.update("Analyse MobilityData...", 80); // Read generated report and save to Mongo. String json; try (FileReader fr = new FileReader(validatorOutputDirectory + "report.json")) { @@ -450,7 +450,7 @@ public void validateMobility(MonitorableJob.Status status) { // This will persist the document to Mongo. this.mobilityDataResult = Document.parse(json); } catch (Exception e) { - status.fail(String.format("Unable to validate feed %s", this.id), e); + status.fail(String.format("Impossible de valider le flux %s", this.id), e); // FIXME create validation result with new constructor? validationResult = new ValidationResult(); validationResult.fatalException = "failure!"; @@ -566,7 +566,7 @@ public int noteCount() { public void delete() { try { // reset lastModified if feed is latest version - LOG.info("Deleting feed version {}", this.id); + LOG.info("Suppression de la version {}", this.id); String id = this.id; // Remove any notes for this feed version retrieveNotes(true).forEach(Note::delete); @@ -595,9 +595,9 @@ public void delete() { // recalculate feed expiration notifications in case the latest version has changed Scheduler.scheduleExpirationNotifications(fs); - LOG.info("Version {} deleted", id); + LOG.info("Version {} supprimée", id); } catch (Exception e) { - LOG.warn("Error deleting version", e); + LOG.warn("Erreur lors de la suppression de la version", e); } } diff --git a/src/main/resources/public/index.html b/src/main/resources/public/index.html index 29620bc72..ac73129e3 100644 --- a/src/main/resources/public/index.html +++ b/src/main/resources/public/index.html @@ -4,7 +4,7 @@ - Data Tools + DataHub Editor