Simplified controller for editing department texts.
parent
258d6c614f
commit
0f86a8f540
|
|
@ -352,38 +352,38 @@ public class SciDepartmentDescriptionStep extends AbstractMvcAuthoringStep {
|
|||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/texts/view/{textKey}")
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
@AuthorizationRequired
|
||||
public String viewDepartmentText(
|
||||
@PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
final String sectionIdentifier,
|
||||
@PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
final String documentPath,
|
||||
@PathParam("textKey")
|
||||
final String textKey
|
||||
) {
|
||||
try {
|
||||
init();
|
||||
} catch (ContentSectionNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
} catch (DocumentNotFoundException ex) {
|
||||
return ex.showErrorMessage();
|
||||
}
|
||||
|
||||
if (itemPermissionChecker.canEditItem(getDepartment())) {
|
||||
textsModel.setSelectedText(textKey);
|
||||
|
||||
return "org/scientificcms/contenttypes/scidepartment/ui/texts/view-values.xhtml";
|
||||
} else {
|
||||
return documentUi.showAccessDenied(
|
||||
getContentSection(),
|
||||
getDepartment(),
|
||||
messageBundle.getMessage("scidepartment.edit.denied")
|
||||
);
|
||||
}
|
||||
}
|
||||
// @GET
|
||||
// @Path("/texts/view/{textKey}")
|
||||
// @Transactional(Transactional.TxType.REQUIRED)
|
||||
// @AuthorizationRequired
|
||||
// public String viewDepartmentText(
|
||||
// @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM)
|
||||
// final String sectionIdentifier,
|
||||
// @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME)
|
||||
// final String documentPath,
|
||||
// @PathParam("textKey")
|
||||
// final String textKey
|
||||
// ) {
|
||||
// try {
|
||||
// init();
|
||||
// } catch (ContentSectionNotFoundException ex) {
|
||||
// return ex.showErrorMessage();
|
||||
// } catch (DocumentNotFoundException ex) {
|
||||
// return ex.showErrorMessage();
|
||||
// }
|
||||
//
|
||||
// if (itemPermissionChecker.canEditItem(getDepartment())) {
|
||||
// textsModel.setSelectedText(textKey);
|
||||
//
|
||||
// return "org/scientificcms/contenttypes/scidepartment/ui/texts/view-values.xhtml";
|
||||
// } else {
|
||||
// return documentUi.showAccessDenied(
|
||||
// getContentSection(),
|
||||
// getDepartment(),
|
||||
// messageBundle.getMessage("scidepartment.edit.denied")
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
@GET
|
||||
@Path("/texts/view/{textKey}/{locale}")
|
||||
|
|
@ -409,7 +409,7 @@ public class SciDepartmentDescriptionStep extends AbstractMvcAuthoringStep {
|
|||
textsModel.setSelectedText(textKey);
|
||||
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 {
|
||||
return documentUi.showAccessDenied(
|
||||
getContentSection(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue