public static String getEntityHref(AGwtEntity entity) { String page = null; ProjectWorkspaceWidgets workspace = Scope.get().getComponent(ProjectWorkspaceWidgets.class); if (workspace != null) page = workspace.getPageForEntity(entity); String id = entity.getId(); return '#' + getEntityHistoryToken(page, id); }
private void showPageAndEntity(String page, String entityId) { new TouchLastActivityServiceCall().execute(); ProjectWorkspaceWidgets workspace = Scope.get().getComponent(ProjectWorkspaceWidgets.class); if (historyToken.getPage() == null && page == null) page = HistoryToken.START_PAGE; if (page != null) workspace.showPage(page); if (entityId != null) { if (ScrumGwt.isEntityReferenceOrWikiPage(entityId)) { workspace.showEntityByReference(entityId); } else { if ("Forum".equals(historyToken.getPage())) { ForumSupport entity = (ForumSupport) AEntity.getById(entityId); workspace.showForum(entity); } else { workspace.showEntityById(entityId); } } } // if (search != null && // !Page.getPageName(SearchResultsWidget.class).equals(historyToken.getPage())) // { // search.clear(); // } }
public static String getEntityHistoryToken(String page, String entityId) { StringBuilder sb = new StringBuilder(); Project project = Scope.get().getComponent(Project.class); if (project != null) sb.append("project=").append(project.getId()).append(SEPARATOR); Navigator navigator = Scope.get().getComponent(Navigator.class); if (page == null) { ProjectWorkspaceWidgets workspace = Scope.get().getComponent(ProjectWorkspaceWidgets.class); if (workspace != null) page = workspace.getPageForEntity(entityId); if (page == null && navigator != null) page = navigator.historyToken.getPage(); } if (page != null) sb.append("page=").append(page).append(SEPARATOR); sb.append("entity=").append(entityId); return sb.toString(); }