Fixed news navigation

This commit is contained in:
Papick Garcia Taboada committed 2015-06-17 12:33:26 +02:00
1 parent 81802fff20
commit 2adf97702c
4 files changed
+19 -23

No files matched your search

@@ -6,7 +6,7 @@ import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
import com.sap.sailing.gwt.ui.shared.dispatch.news.NewsEntryDTO;
public interface NewsItemLinkProvider {
PlaceNavigation<?> getPlaceNavigation(NewsEntryDTO newsEntry);
void gotoNewsPlace(List<NewsEntryDTO> values);
PlaceNavigation<?> getNewsEntryPlaceNavigation(NewsEntryDTO newsEntry);
}
@@ -56,7 +56,7 @@ public class UpdatesBoxItem extends Widget {
link.setHref(directLink);
link.setTarget("_blank");
} else {
final PlaceNavigation<?> placeNavigation = provider.getPlaceNavigation(entry);
final PlaceNavigation<?> placeNavigation = provider.getNewsEntryPlaceNavigation(entry);
if(placeNavigation != null) {
placeNavigation.configureAnchorElement(link);
} else {
@@ -21,7 +21,6 @@ import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
import com.sap.sailing.gwt.home.shared.dispatch.DispatchSystem;
import com.sap.sailing.gwt.ui.client.StringMessages;
import com.sap.sailing.gwt.ui.shared.dispatch.event.GetEventViewAction;
import com.sap.sailing.gwt.ui.shared.dispatch.news.AbstractRaceNewsEntryDTO;
import com.sap.sailing.gwt.ui.shared.dispatch.news.LeaderboardNewsEntryDTO;
import com.sap.sailing.gwt.ui.shared.dispatch.news.NewsEntryDTO;
import com.sap.sailing.gwt.ui.shared.eventview.EventViewDTO;
@@ -95,11 +94,7 @@ public class EventActivity extends AbstractActivity implements Presenter {
return clientFactory.getDispatch();
}
@Override
public PlaceNavigation<?> getRegattaLeaderboardNavigation(String leaderboardName) {
EventContext ctx = new EventContext(getCtx()).withRegattaId(leaderboardName).withRegattaAnalyticsManager(null);
return clientFactory.getNavigator().getEventNavigation(new RegattaLeaderboardPlace(ctx), null, false);
}
@Override
public PlaceNavigation<?> getMediaPageNavigation() {
@@ -111,26 +106,29 @@ public class EventActivity extends AbstractActivity implements Presenter {
}
@Override
public String getRaceViewerURL(String regattaName, String trackedRaceName) {
// TODO Auto-generated method stub
return null;
}
@Override
public PlaceNavigation<?> getPlaceNavigation(NewsEntryDTO entry) {
public PlaceNavigation<?> getNewsEntryPlaceNavigation(NewsEntryDTO entry) {
if(entry instanceof LeaderboardNewsEntryDTO) {
final LeaderboardNewsEntryDTO dto = (LeaderboardNewsEntryDTO) entry;
return getRegattaLeaderboardNavigation(dto.getLeaderboardName());
} else if(entry instanceof AbstractRaceNewsEntryDTO) {
// TODO
}
return null;
}
@Override
public String getRaceViewerURL(String regattaName, String trackedRaceName) {
return null;
}
@Override
public PlaceNavigation<?> getRegattaLeaderboardNavigation(String leaderboardName) {
EventContext ctx = new EventContext(getCtx()).withRegattaId(leaderboardName).withRegattaAnalyticsManager(null);
return clientFactory.getNavigator().getEventNavigation(new RegattaLeaderboardPlace(ctx), null, false);
}
@Override
public void gotoNewsPlace(List<NewsEntryDTO> values) {
clientFactory.getPlaceController().goTo(new LatestNewsPlace(place.getCtx(), values));
}
}
@@ -14,7 +14,6 @@ import com.sap.sailing.gwt.home.mobile.partials.updatesBox.NewsItemLinkProvider;
import com.sap.sailing.gwt.home.mobile.places.latestnews.LatestNewsView.Presenter;
import com.sap.sailing.gwt.home.shared.app.PlaceNavigation;
import com.sap.sailing.gwt.home.shared.dispatch.DispatchSystem;
import com.sap.sailing.gwt.ui.shared.dispatch.news.AbstractRaceNewsEntryDTO;
import com.sap.sailing.gwt.ui.shared.dispatch.news.LeaderboardNewsEntryDTO;
import com.sap.sailing.gwt.ui.shared.dispatch.news.NewsEntryDTO;
@@ -44,15 +43,14 @@ public class LatestNewsActivity extends AbstractActivity implements Presenter, N
}
@Override
public PlaceNavigation<?> getPlaceNavigation(NewsEntryDTO entry) {
public PlaceNavigation<?> getNewsEntryPlaceNavigation(NewsEntryDTO entry) {
MobilePlacesNavigator navigator = clientFactory.getNavigator();
if (entry instanceof LeaderboardNewsEntryDTO) {
final LeaderboardNewsEntryDTO dto = (LeaderboardNewsEntryDTO) entry;
final String regattaId = dto.getLeaderboardName();
navigator.getEventNavigation(new RegattaLeaderboardPlace(new EventContext().withRegattaId(regattaId)),
null, false);
} else if (entry instanceof AbstractRaceNewsEntryDTO) {
// TODO
}
return null;
}