Simplified controller for editing department texts.

pull/1/head
Jens Pelzetter 2022-10-03 08:35:38 +02:00
parent 258d6c614f
commit 0f86a8f540
1 changed files with 33 additions and 33 deletions

View File

@ -352,38 +352,38 @@ public class SciDepartmentDescriptionStep extends AbstractMvcAuthoringStep {
} }
} }
@GET // @GET
@Path("/texts/view/{textKey}") // @Path("/texts/view/{textKey}")
@Transactional(Transactional.TxType.REQUIRED) // @Transactional(Transactional.TxType.REQUIRED)
@AuthorizationRequired // @AuthorizationRequired
public String viewDepartmentText( // public String viewDepartmentText(
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) // @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
final String sectionIdentifier, // final String sectionIdentifier,
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) // @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
final String documentPath, // final String documentPath,
@PathParam("textKey") // @PathParam("textKey")
final String textKey // final String textKey
) { // ) {
try { // try {
init(); // init();
} catch (ContentSectionNotFoundException ex) { // } catch (ContentSectionNotFoundException ex) {
return ex.showErrorMessage(); // return ex.showErrorMessage();
} catch (DocumentNotFoundException ex) { // } catch (DocumentNotFoundException ex) {
return ex.showErrorMessage(); // return ex.showErrorMessage();
} // }
//
if (itemPermissionChecker.canEditItem(getDepartment())) { // if (itemPermissionChecker.canEditItem(getDepartment())) {
textsModel.setSelectedText(textKey); // textsModel.setSelectedText(textKey);
//
return "org/scientificcms/contenttypes/scidepartment/ui/texts/view-values.xhtml"; // return "org/scientificcms/contenttypes/scidepartment/ui/texts/view-values.xhtml";
} else { // } else {
return documentUi.showAccessDenied( // return documentUi.showAccessDenied(
getContentSection(), // getContentSection(),
getDepartment(), // getDepartment(),
messageBundle.getMessage("scidepartment.edit.denied") // messageBundle.getMessage("scidepartment.edit.denied")
); // );
} // }
} // }
@GET @GET
@Path("/texts/view/{textKey}/{locale}") @Path("/texts/view/{textKey}/{locale}")
@ -409,7 +409,7 @@ public class SciDepartmentDescriptionStep extends AbstractMvcAuthoringStep {
textsModel.setSelectedText(textKey); textsModel.setSelectedText(textKey);
textsModel.setSelectedLocale(new Locale(localeParam).toString()); textsModel.setSelectedLocale(new Locale(localeParam).toString());
return "org/scientificcms/contenttypes/scidepartment/ui/texts/view-text.xhtml"; return "org/scientificcms/contenttypes/scidepartment/ui/texts/view.xhtml";
} else { } else {
return documentUi.showAccessDenied( return documentUi.showAccessDenied(
getContentSection(), getContentSection(),