adapted getEventViewAction to new attribute 'sailorsInfoWebsiteURL'...

adding the locale to the link requires still a special solution
This commit is contained in:
fmittag committed 2015-07-10 17:48:32 +02:00
1 parent 5ffe2a4eca
commit f84b7e8773
3 files changed
+15 -9

No files matched your search

@@ -58,7 +58,7 @@ public class TabletAndDesktopEventView extends Composite implements EventMultire
initBreadCrumbs();
String sailorsInfoURL = currentPresenter.getCtx().getEventDTO().getSailorsInfoURL();
String sailorsInfoURL = currentPresenter.getCtx().getEventDTO().getSailorsInfoWebsiteURL();
if(sailorsInfoURL != null && ! sailorsInfoURL.isEmpty()) {
Label label = new Label();
label.getElement().setInnerHTML(i18n.sailorInfoLongText().replace("\n", "<br />"));
@@ -52,6 +52,7 @@ public class GetEventViewAction implements Action<EventViewDTO> {
ImageDescriptor logoImage = event.findImageWithTag(MediaTagConstants.LOGO);
dto.setLogoImage(logoImage != null ? HomeServiceUtil.convertToImageDTO(logoImage) : null);
dto.setOfficialWebsiteURL(event.getOfficialWebsiteURL() == null ? null : event.getOfficialWebsiteURL().toString());
dto.setSailorsInfoWebsiteURL(event.getSailorsInfoWebsiteURL() == null ? null : event.getSailorsInfoWebsiteURL().toString());
dto.setHasMedia(HomeServiceUtil.hasMedia(event));
dto.setState(HomeServiceUtil.calculateEventState(event));
@@ -118,9 +119,14 @@ public class GetEventViewAction implements Action<EventViewDTO> {
dto.setType(dto.getRegattas().size() == 1 ? EventType.SINGLE_REGATTA: EventType.MULTI_REGATTA);
}
// Special solution for Kieler Woche 2015
if("a9d6c5d5-cac3-47f2-9b5c-506e441819a1".equals(event.getId().toString())) {
dto.setSailorsInfoURL(Locale.GERMAN.equals(context.getClientLocale()) ? "http://sailorsinfo.kieler-woche.de/" : "http://sailorsinfo.kieler-woche.de/en");
// Special solution for localization of SailorsInfo URL
if(dto.getSailorsInfoWebsiteURL() != null && !Locale.GERMAN.equals(context.getClientLocale())) {
String localizedURL = dto.getSailorsInfoWebsiteURL();
if(!localizedURL.endsWith("/")) {
localizedURL += "/";
}
localizedURL += "en";
dto.setSailorsInfoWebsiteURL(localizedURL);
}
return dto;
@@ -23,7 +23,7 @@ public class EventViewDTO extends EventMetadataDTO implements Result {
private String seriesName;
private ImageDTO logoImage;
private String officialWebsiteURL;
private String sailorsInfoURL;
private String sailorsInfoWebsiteURL;
public EventViewDTO() {
}
@@ -105,11 +105,11 @@ public class EventViewDTO extends EventMetadataDTO implements Result {
return officialWebsiteURL;
}
public String getSailorsInfoURL() {
return sailorsInfoURL;
public String getSailorsInfoWebsiteURL() {
return sailorsInfoWebsiteURL;
}
public void setSailorsInfoURL(String sailorsInfoURL) {
this.sailorsInfoURL = sailorsInfoURL;
public void setSailorsInfoWebsiteURL(String sailorsInfoWebsiteURL) {
this.sailorsInfoWebsiteURL = sailorsInfoWebsiteURL;
}
}