Skip to content

Commit 88116a9

Browse files
committed
refactor: remove some references to learnweb url
Signed-off-by: Oleh Astappiev <4512729+astappiev@users.noreply.github.com>
1 parent 11206d7 commit 88116a9

File tree

10 files changed

+28
-23
lines changed

10 files changed

+28
-23
lines changed

src/main/java/de/l3s/learnweb/app/ConfigProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ public String getCaptchaPrivateKey() {
379379
* If started in development (also when no servlet context) or other test instance, do not schedule any jobs.
380380
*/
381381
public boolean isRunScheduler() {
382-
return isServlet() && !isDevelopment() && "https://learnweb.l3s.uni-hannover.de".equals(getServerUrl());
382+
return isServlet() && !isDevelopment();
383383
}
384384

385385
public boolean isCollectSearchHistory() {

src/main/java/de/l3s/learnweb/app/JobScheduler.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,18 @@ public JobScheduler(final ConfigProvider configProvider) {
3434
scheduler.schedule("0 3 * * Sun", new ExpiredBansCleaner());
3535
// Cleans up requests once an hour
3636
scheduler.schedule("0 * * * *", new RequestsTaskHandler());
37-
38-
// Runs the TED crawler at 23:00 once a month to check for new/update TED videos
39-
scheduler.schedule("0 23 1 * *", new TedCrawlerSimple());
40-
// Runs the speech repository crawler at 22:00 once a month to check for new/update of videos
41-
scheduler.schedule("0 22 2 * *", new SpeechRepositoryCrawler());
42-
4337
// Checks bounced mail every 5 minutes
4438
scheduler.schedule("0/5 * * * *", new BounceFetcher());
45-
4639
// Runs the Forum Notificator at 8:00AM once a day to send summary emails
4740
scheduler.schedule("0 8 * * *", new ForumNotificator());
41+
42+
// FIXME: this have to be moved separately
43+
if ("https://learnweb.l3s.uni-hannover.de".equals(configProvider.getServerUrl())) {
44+
// Runs the TED crawler at 23:00 once a month to check for new/update TED videos
45+
scheduler.schedule("0 23 1 * *", new TedCrawlerSimple());
46+
// Runs the speech repository crawler at 22:00 once a month to check for new/update of videos
47+
scheduler.schedule("0 22 2 * *", new SpeechRepositoryCrawler());
48+
}
4849
}
4950

5051
@PostConstruct

src/main/java/de/l3s/learnweb/beans/admin/AdminNotificationBean.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.apache.logging.log4j.Logger;
1717
import org.primefaces.model.TreeNode;
1818

19+
import de.l3s.learnweb.app.ConfigProvider;
1920
import de.l3s.learnweb.beans.ApplicationBean;
2021
import de.l3s.learnweb.beans.BeanAssert;
2122
import de.l3s.learnweb.user.Message;
@@ -52,6 +53,9 @@ public class AdminNotificationBean extends ApplicationBean {
5253
@Inject
5354
private MailService mailService;
5455

56+
@Inject
57+
private ConfigProvider config;
58+
5559
@PostConstruct
5660
public void init() {
5761
user = getUser();
@@ -110,7 +114,7 @@ public void send() {
110114
private void sendMail(final ArrayList<String> recipients) {
111115
Mail mail = null;
112116
try {
113-
mail = MailFactory.buildNotificationEmail(title, text, user.getUsername()).build(user.getLocale());
117+
mail = MailFactory.buildNotificationEmail(title, text, user.getUsername(), config.getServerUrl(), config.getAppName()).build(user.getLocale());
114118
mail.setReplyTo(user.getEmail());
115119
mail.setRecipientsBcc(recipients);
116120
mailService.send(mail);

src/main/java/de/l3s/mail/MailFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ public static MessageBuilder buildContactFormEmail(String name, String email, St
119119
.append(new Text("Message")).append(": ").append(message));
120120
}
121121

122-
public static MessageBuilder buildNotificationEmail(String title, String text, String username) {
122+
public static MessageBuilder buildNotificationEmail(String title, String text, String username, String serverUrl, String appName) {
123123
return new MessageBuilder("Learnweb: " + title)
124124
.add(new Text(text))
125-
.footer(new Text("mail_notification_footer", username));
125+
.footer(new Text("mail_notification_footer", username, serverUrl, appName));
126126
}
127127

128128
public static MessageBuilder buildSuspiciousAlertEmail(List<Request> suspiciousRequests) {

src/main/resources/de/l3s/learnweb/lang/messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ logs = Logs
838838
839839
long_summary = Write a slightly longer summary
840840
841-
mail_notification_footer = {0} has sent you this message through <a href="https://learnweb.l3s.uni-hannover.de/">Learnweb</a>.
841+
mail_notification_footer = {0} has sent you this message through <a href="{1}">{2}</a>.
842842
843843
mandatory_field = Mandatory field
844844

src/main/resources/de/l3s/learnweb/lang/messages_de.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ logoutLabel = Abmelden
608608

609609
logout_success = Sie haben sich erfolgreich abgemeldet.
610610

611-
mail_notification_footer = {0} hat dir diese Nachricht auf <a href="https://learnweb.l3s.uni-hannover.de/">Learnweb</a> geschrieben.
611+
mail_notification_footer = {0} hat dir diese Nachricht auf <a href="{1}">{2}</a> geschrieben.
612612

613613
mandatory_field = Pflichtfeld
614614

src/main/resources/de/l3s/learnweb/lang/messages_es.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ logoutLabel = Cierre de sesión
541541

542542
logout_success = Has cerrado la sesión con éxito.
543543

544-
mail_notification_footer = {0} te ha enviado este mensaje a través de <a href="https://learnweb.l3s.uni-hannover.de/">Learnweb</a>.
544+
mail_notification_footer = {0} te ha enviado este mensaje a través de <a href="{1}">{2}</a>.
545545

546546
mandatory_field = Campo obligatorio
547547

src/main/resources/de/l3s/learnweb/lang/messages_it.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ logs = Log
759759

760760
long_summary = Inserire un riassunto di media lunghezza
761761

762-
mail_notification_footer = {0} ti ha inviato questo messaggio tramite <a href="https://learnweb.l3s.uni-hannover.de/">Learnweb</a>.
762+
mail_notification_footer = {0} ti ha inviato questo messaggio tramite <a href="{1}">{2}</a>.
763763

764764
mandatory_field = Campo obbligatorio
765765

src/main/resources/de/l3s/learnweb/lang/messages_uk.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ logs = Повідомлення
757757

758758
long_summary = Напишіть трохи довший підсумок
759759

760-
mail_notification_footer = {0} надіслав вам це повідомлення через <a href="https://learnweb.l3s.uni-hannover.de/"> Learnweb </a>.
760+
mail_notification_footer = {0} надіслав вам це повідомлення через <a href="{1}">{2}</a>.
761761

762762
mandatory_field = Обов'язкове поле
763763

src/main/resources/de/l3s/learnweb/lang/messages_xy.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -488,9 +488,9 @@ forum_thread = TODO
488488

489489
forum_topics = Lable for forums topics
490490

491-
from_source = example: has added resource x "from" source Youtube https://learnweb.l3s.uni-hannover.de/lw/myhome/activity.jsf
491+
from_source = example: has added resource X "from" source Youtube
492492

493-
from_user = example: received a message "from" user x https://learnweb.l3s.uni-hannover.de/lw/myhome/notification.jsf
493+
from_user = example: received a message "from" user X
494494

495495
frontpage.about_platform = used as link and title on the Frontpage to a paragraph that describes platform
496496
frontpage.course_description_yell = Description of the YELL project
@@ -665,7 +665,7 @@ index_footer_text = Main text in the footer
665665

666666
info = Column header in admin system tools
667667

668-
instructions = Registration wizard page: https://learnweb.l3s.uni-hannover.de/lw/user/register.jsf?wizard=yell Added text 'Instructions' to provide help with this page.
668+
instructions = Registration page with wizard, text header after the registration form explaining differences between learnweb and wizard accounts
669669

670670
interactions = Title in glossary dashboard
671671

@@ -825,7 +825,7 @@ logs = Column in admin page
825825
826826
long_summary = THis msg says that summary should be longer
827827
828-
mail_notification_footer = This sentence is attached to all emails send from a moderator to his users. The parameter {0} is replaced with the username
828+
mail_notification_footer = This sentence is attached to all emails send from a moderator to his users. The parameter {0} is replaced with the username, {1} with server url and {2} with app name
829829
830830
mandatory_field = Used for different fields
831831
@@ -1352,7 +1352,7 @@ show_folders_tree = TODO
13521352

13531353
show_summary = Menu item on transcript page
13541354

1355-
show_tags = https://learnweb.l3s.uni-hannover.de/lw/ted_transcript.jsf. Used to display annotations added by user.
1355+
show_tags = Used to display annotations added by user.
13561356

13571357
show_transcript_del_res = unused
13581358

@@ -1390,7 +1390,7 @@ statistics_show = Button text for showing the statistics
13901390

13911391
statistics_show_detailed = Button text for showing the detailed statistics
13921392

1393-
step = https://learnweb.l3s.uni-hannover.de/lw/myhome/resources.jsf. Used in the title of the add resource dialog. Usage example "Step 1", "Step 2", "Step 3"
1393+
step = Used in the title of the add resource dialog. Usage example "Step 1", "Step 2", "Step 3"
13941394

13951395
stored_in = used on the seach page. Text is followed by a group or folder name in which the resource is stored
13961396

@@ -1515,7 +1515,7 @@ transcript.gather_logs = TODO
15151515

15161516
transcript_logs = TItle on admin transcript pages
15171517

1518-
transcript_note = Modified text to make it clearer for users to understand what to expect from the interaction with the transcript. https://learnweb.l3s.uni-hannover.de/lw/ted_transcript.jsf
1518+
transcript_note = Modified text to make it clearer for users to understand what to expect from the interaction with the transcript.
15191519

15201520
transcript_submit_message = Text to make it clear that once users submit a transcript they can no longer highlight or annotate it.
15211521

0 commit comments

Comments
 (0)