diff --git a/src/main/java/org/olat/core/id/context/BusinessControlFactory.java b/src/main/java/org/olat/core/id/context/BusinessControlFactory.java index 8d6323e82c8a9911606485ad6efa9a1424e3c3dc..e8f13d3c50b26f9c1b1d844244f0f7e39ced3fc5 100644 --- a/src/main/java/org/olat/core/id/context/BusinessControlFactory.java +++ b/src/main/java/org/olat/core/id/context/BusinessControlFactory.java @@ -539,7 +539,17 @@ public class BusinessControlFactory { return getURLFromBusinessPathString("url", bPathString); } - public String getAuthenticatedURLFromBusinessPathString(String bPathString){ + public String getAuthenticatedURLFromBusinessPathStrings(String... bPathString) { + StringBuilder sb = new StringBuilder(); + for(String path:bPathString) { + if(path != null) { + sb.append(path); + } + } + return getAuthenticatedURLFromBusinessPathString(sb.toString()); + } + + public String getAuthenticatedURLFromBusinessPathString(String bPathString) { return getURLFromBusinessPathString("auth", bPathString); } diff --git a/src/main/java/org/olat/group/ui/main/BusinessGroupListFlexiTableModel.java b/src/main/java/org/olat/group/ui/main/BusinessGroupListFlexiTableModel.java index 74e94972d2b6eae7c5505c3b1810fffdba98591f..4263e266990b1fe3e3dc601e85653a9338499c58 100644 --- a/src/main/java/org/olat/group/ui/main/BusinessGroupListFlexiTableModel.java +++ b/src/main/java/org/olat/group/ui/main/BusinessGroupListFlexiTableModel.java @@ -43,6 +43,8 @@ import org.olat.group.BusinessGroupMembership; public class BusinessGroupListFlexiTableModel extends DefaultFlexiTableDataModel<BGTableItem> implements SortableFlexiTableDataModel<BGTableItem>, FlexiBusinessPathModel { + private static final Cols[] COLS = Cols.values(); + private final Locale locale; /** @@ -69,7 +71,7 @@ public class BusinessGroupListFlexiTableModel extends DefaultFlexiTableDataModel @Override public Object getValueAt(BGTableItem wrapped, int col) { - switch (Cols.values()[col]) { + switch (COLS[col]) { case createionDate: return wrapped.getCreationDate(); case name: diff --git a/src/main/java/org/olat/repository/ui/author/AuthorListController.java b/src/main/java/org/olat/repository/ui/author/AuthorListController.java index 4087f59c6f85504ed7a045271fe58f5f502a4dbd..bb7b474463c0349ede12c7a9e7c3d864d5cbb2df 100644 --- a/src/main/java/org/olat/repository/ui/author/AuthorListController.java +++ b/src/main/java/org/olat/repository/ui/author/AuthorListController.java @@ -87,6 +87,7 @@ import org.olat.core.gui.translator.Translator; import org.olat.core.id.Identity; import org.olat.core.id.OLATResourceable; import org.olat.core.id.Roles; +import org.olat.core.id.context.BusinessControlFactory; import org.olat.core.id.context.ContextEntry; import org.olat.core.id.context.StateEntry; import org.olat.core.logging.activity.ThreadLocalUserActivityLogger; @@ -1188,7 +1189,7 @@ public class AuthorListController extends FormBasicController implements Activat } private void launchCatalog(UserRequest ureq, RepositoryEntryRef ref) { - String businessPath = "[RepositoryEntry:" + ref.getKey() + "][Catalog:0]"; + String businessPath = "[RepositoryEntry:" + ref.getKey() + "][Settings:0][Catalog:0]"; NewControllerFactory.getInstance().launch(businessPath, ureq, getWindowControl()); } @@ -1296,6 +1297,11 @@ public class AuthorListController extends FormBasicController implements Activat refLink.setCustomDisplayText(StringHelper.escapeHtml(ref.getDisplayname())); refLink.setUserObject(ref); refLink.setIconLeftCSS("o_icon o_icon-fw " + RepositoyUIFactory.getIconCssClass(ref)); + + String businessPath = "[RepositoryEntry:" + ref.getKey() + "]"; + String url = BusinessControlFactory.getInstance().getAuthenticatedURLFromBusinessPathString(businessPath); + refLink.setUrl(url); + refLinks.add(name); } mainVC.contextPut("referenceLinks", refLinks); @@ -1360,11 +1366,11 @@ public class AuthorListController extends FormBasicController implements Activat List<String> links = new ArrayList<>(); if(isOwner) { - addLink("tools.edit.description", "description", "o_icon o_icon-fw o_icon_details", links); + addLink("tools.edit.description", "description", "o_icon o_icon-fw o_icon_details", "/Settings/0/Info/0", links); if(repositoryModule.isCatalogEnabled()) { - addLink("tools.edit.catalog", "catalog", "o_icon o_icon-fw o_icon_catalog", links); + addLink("tools.edit.catalog", "catalog", "o_icon o_icon-fw o_icon_catalog", "/Settings/0/Catalog/0", links); } - addLink("details.members", "members", "o_icon o_icon-fw o_icon_membersmanagement", links); + addLink("details.members", "members", "o_icon o_icon-fw o_icon_membersmanagement", "/MembersMgmt/0", links); } boolean copyManaged = RepositoryEntryManagedFlag.isManaged(entry, RepositoryEntryManagedFlag.copy); @@ -1394,13 +1400,13 @@ public class AuthorListController extends FormBasicController implements Activat if(canCopy || canDownload) { links.add("-"); if (canCopy) { - addLink("details.copy", "copy", "o_icon o_icon-fw o_icon_copy", links); + addLink("details.copy", "copy", "o_icon o_icon-fw o_icon_copy", "/Infos/0", links); } if (canConvertLearningPath) { - addLink("details.convert.learning.path", "convertLearningPath", "o_icon o_icon-fw o_icon_learning_path", links); + addLink("details.convert.learning.path", "convertLearningPath", "o_icon o_icon-fw o_icon_learning_path", null, links); } if(canDownload) { - addLink("details.download", "download", "o_icon o_icon-fw o_icon_download", links); + addLink("details.download", "download", "o_icon o_icon-fw o_icon_download", null, links); } } @@ -1416,12 +1422,12 @@ public class AuthorListController extends FormBasicController implements Activat boolean closed = entry.getEntryStatus() == RepositoryEntryStatusEnum.closed; if(closed && "CourseModule".equals(entry.getOlatResource().getResourceableTypeName())) { - addLink("details.override.close", "override-close", "o_icon o_icon-fw o_icon_close_resource", links); + addLink("details.override.close", "override-close", "o_icon o_icon-fw o_icon_close_resource", null, links); } else if(canClose) { - addLink("details.close.ressoure", "close", "o_icon o_icon-fw o_icon_close_resource", links); + addLink("details.close.ressoure", "close", "o_icon o_icon-fw o_icon_close_resource", null, links); } if(!deleteManaged) { - addLink("details.delete", "delete", "o_icon o_icon-fw o_icon_delete_item", links); + addLink("details.delete", "delete", "o_icon o_icon-fw o_icon_delete_item", null, links); } } @@ -1429,11 +1435,15 @@ public class AuthorListController extends FormBasicController implements Activat putInitialPanel(mainVC); } - private void addLink(String name, String cmd, String iconCSS, List<String> links) { + private void addLink(String name, String cmd, String iconCSS, String path, List<String> links) { Link link = LinkFactory.createLink(name, cmd, getTranslator(), mainVC, this, Link.LINK); if(iconCSS != null) { link.setIconLeftCSS(iconCSS); } + if(path != null) { + String url = row.getUrl().concat(path); + link.setUrl(url); + } mainVC.put(name, link); links.add(name); } diff --git a/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataModel.java b/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataModel.java index bec13cae45fbeb09e4b48b9447c1d74dc3a705d3..cd4bd8a9b1349249c08f4b9213426e1b175ca0e6 100644 --- a/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataModel.java +++ b/src/main/java/org/olat/repository/ui/author/AuthoringEntryDataModel.java @@ -89,11 +89,20 @@ class AuthoringEntryDataModel extends DefaultFlexiTableDataSourceModel<Authoring super.clear(); getSourceDelegate().resetCount(); } - + @Override public String getUrl(Component source, Object object, String action) { - if("select".equals(action) && object instanceof AuthoringEntryRow) { - return ((AuthoringEntryRow)object).getUrl(); + if(action == null) return null; + + AuthoringEntryRow row = (AuthoringEntryRow)object; + if("select".equals(action)) { + return row.getUrl(); + } + if("details".equals(action)) { + return row.getUrl().concat("/Infos/0"); + } + if("edit".equals(action)) { + return row.getUrl().concat("/Editor/0"); } return null; } diff --git a/src/main/java/org/olat/repository/ui/author/OverviewAuthoringController.java b/src/main/java/org/olat/repository/ui/author/OverviewAuthoringController.java index 4df6d5881eaebafcb8f8809d822d20e997472c36..d4bfc15148b136e3b84e2f015652fa13190c2c9d 100644 --- a/src/main/java/org/olat/repository/ui/author/OverviewAuthoringController.java +++ b/src/main/java/org/olat/repository/ui/author/OverviewAuthoringController.java @@ -60,6 +60,8 @@ import org.olat.util.logging.activity.LoggingResourceable; */ public class OverviewAuthoringController extends BasicController implements Activateable2, GenericEventListener { + private static final String REPOSITORY_PATH = "[RepositorySite:0]"; + private MainPanel mainPanel; private final VelocityContainer mainVC; private final SegmentViewComponent segmentView; @@ -96,16 +98,21 @@ public class OverviewAuthoringController extends BasicController implements Acti segmentView = SegmentViewFactory.createSegmentView("segments", mainVC, this); segmentView.setReselect(true); + BusinessControlFactory bFactory = BusinessControlFactory.getInstance(); if(!isGuestOnly) { favoriteLink = LinkFactory.createLink("search.mark", mainVC, this); + favoriteLink.setUrl(bFactory.getAuthenticatedURLFromBusinessPathStrings(REPOSITORY_PATH, "[Favorits:0]")); segmentView.addSegment(favoriteLink, false); } myEntriesLink = LinkFactory.createLink("search.my", mainVC, this); + myEntriesLink.setUrl(bFactory.getAuthenticatedURLFromBusinessPathStrings(REPOSITORY_PATH, "[My:0]")); segmentView.addSegment(myEntriesLink, false); searchLink = LinkFactory.createLink("search.generic", mainVC, this); + searchLink.setUrl(bFactory.getAuthenticatedURLFromBusinessPathStrings(REPOSITORY_PATH, "[Search:0]")); segmentView.addSegment(searchLink, false); if(roles.isAuthor() || isAdministrator) { deletedLink = LinkFactory.createLink("search.deleted", mainVC, this); + deletedLink.setUrl(bFactory.getAuthenticatedURLFromBusinessPathStrings(REPOSITORY_PATH, "[Deleted:0]")); segmentView.addSegment(deletedLink, false); }