diff --git a/src/main/java/org/olat/repository/ui/list/RepositoryEntryDetailsController.java b/src/main/java/org/olat/repository/ui/list/RepositoryEntryDetailsController.java index 358cbbdfbd3d2d14d6e413883f5262a7eb61b0e1..057d6030dbddda5f2464a2d1bf823557f374a060 100644 --- a/src/main/java/org/olat/repository/ui/list/RepositoryEntryDetailsController.java +++ b/src/main/java/org/olat/repository/ui/list/RepositoryEntryDetailsController.java @@ -25,6 +25,7 @@ import java.util.List; import java.util.Map; import org.olat.NewControllerFactory; +import org.olat.admin.restapi.RestapiAdminController; import org.olat.catalog.CatalogEntry; import org.olat.catalog.CatalogManager; import org.olat.core.commons.services.commentAndRating.CommentAndRatingDefaultSecurityCallback; @@ -139,31 +140,29 @@ public class RepositoryEntryDetailsController extends FormBasicController { private final boolean guestOnly; public RepositoryEntryDetailsController(UserRequest ureq, WindowControl wControl, RepositoryEntryRow row) { - super(ureq, wControl, Util.getPackageVelocityRoot(RepositoryEntryDetailsController.class) + "/details.html"); - setTranslator(Util.createPackageTranslator(RepositoryService.class, getLocale(), getTranslator())); - + this(ureq, wControl); this.row = row; entry = repositoryService.loadByKey(row.getKey()); - guestOnly = ureq.getUserSession().getRoles().isGuestOnly(); initForm(ureq); } public RepositoryEntryDetailsController(UserRequest ureq, WindowControl wControl, RepositoryEntryRef ref) { - super(ureq, wControl, Util.getPackageVelocityRoot(RepositoryEntryDetailsController.class) + "/details.html"); - setTranslator(Util.createPackageTranslator(RepositoryService.class, getLocale(), getTranslator())); - + this(ureq, wControl); entry = repositoryService.loadByKey(ref.getKey()); - guestOnly = ureq.getUserSession().getRoles().isGuestOnly(); initForm(ureq); } public RepositoryEntryDetailsController(UserRequest ureq, WindowControl wControl, RepositoryEntry entry) { + this(ureq, wControl); + this.entry = entry; + initForm(ureq); + } + + private RepositoryEntryDetailsController(UserRequest ureq, WindowControl wControl) { super(ureq, wControl, Util.getPackageVelocityRoot(RepositoryEntryDetailsController.class) + "/details.html"); setTranslator(Util.createPackageTranslator(RepositoryService.class, getLocale(), getTranslator())); - - this.entry = entry; + setTranslator(Util.createPackageTranslator(RestapiAdminController.class, getLocale(), getTranslator())); guestOnly = ureq.getUserSession().getRoles().isGuestOnly(); - initForm(ureq); } public Integer getIndex() {