From 2ba30e3e15139456812c28df5ce74f579f7eb7b6 Mon Sep 17 00:00:00 2001 From: Jens Pelzetter Date: Sat, 16 Apr 2022 17:41:17 +0200 Subject: [PATCH] XHTML templates for some authoring steps of SciProject --- .../sciproject/ui/SciProjectContactModel.java | 3 +- .../SciProjectDescriptionContactsModel.java | 5 + .../ui/SciProjectDescriptionMembersModel.java | 21 +- .../ui/SciProjectDescriptionStep.java | 153 +++++++++- .../sciproject/ui/SciProjectFundingStep.java | 72 ++++- .../ui/SciProjectMembershipModel.java | 26 +- .../ui/SciProjectPropertiesStep.java | 6 + .../ui/sciproject-description.xhtml | 280 ++++++++++++++++++ scicms-bundle-devel/pom.xml | 5 - 9 files changed, 557 insertions(+), 14 deletions(-) create mode 100644 sci-types-project/src/main/resources/WEB-INF/views/org/scientificcms/contenttypes/sciproject/ui/sciproject-description.xhtml diff --git a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectContactModel.java b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectContactModel.java index d7e48bc..6e7d5b8 100644 --- a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectContactModel.java +++ b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectContactModel.java @@ -2,11 +2,12 @@ package org.scientificcms.contenttypes.sciproject.ui; import org.librecms.assets.ContactableEntity; import org.scientificcms.contenttypes.sciproject.Contact; +import org.scientificcms.contenttypes.sciproject.SciProject; /** * DTO providing the information about a {@link Contact} of a {@link SciProject} * in an form that easy usable from a MVC template. - * + * * @author Jens Pelzetter */ public class SciProjectContactModel { diff --git a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionContactsModel.java b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionContactsModel.java index 5577bf1..7b218f8 100644 --- a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionContactsModel.java +++ b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionContactsModel.java @@ -1,5 +1,7 @@ package org.scientificcms.contenttypes.sciproject.ui; +import org.librecms.assets.ContactableEntity; + import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -35,4 +37,7 @@ public class SciProjectDescriptionContactsModel { this.contacts = new ArrayList<>(contacts); } + public String getContactableType() { + return ContactableEntity.class.getName(); + } } diff --git a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionMembersModel.java b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionMembersModel.java index 8bd188c..7e38396 100644 --- a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionMembersModel.java +++ b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionMembersModel.java @@ -4,9 +4,13 @@ */ package org.scientificcms.contenttypes.sciproject.ui; +import org.librecms.assets.Person; + import java.util.ArrayList; import java.util.Collections; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; import javax.enterprise.context.RequestScoped; import javax.inject.Named; @@ -18,11 +22,13 @@ import javax.inject.Named; @RequestScoped @Named("SciProjectDescriptionMembers") public class SciProjectDescriptionMembersModel { - + private boolean canEdit; private List members; + private Map statusValues; + public boolean getCanEdit() { return canEdit; } @@ -38,5 +44,16 @@ public class SciProjectDescriptionMembersModel { protected void setCanEdit(final boolean canEdit) { this.canEdit = canEdit; } - + + public String getMemberType() { + return Person.class.getName(); + } + + public Map getStatusValues() { + return Collections.unmodifiableMap(statusValues); + } + + protected void setStatusValues(final Map statusValues) { + this.statusValues = new LinkedHashMap<>(statusValues); + } } diff --git a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionStep.java b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionStep.java index b5a02c9..c495267 100644 --- a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionStep.java +++ b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectDescriptionStep.java @@ -19,8 +19,8 @@ package org.scientificcms.contenttypes.sciproject.ui; import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.security.AuthorizationRequired; import org.librecms.assets.ContactableEntity; -import org.librecms.assets.ContactableEntityRepository; import org.librecms.assets.Person; import org.librecms.contentsection.AssetRepository; import org.librecms.contentsection.ContentItemRepository; @@ -33,11 +33,15 @@ import org.librecms.ui.contentsections.documents.DocumentUi; import org.librecms.ui.contentsections.documents.MvcAuthoringStepDef; import org.librecms.ui.contentsections.documents.MvcAuthoringSteps; import org.scientificcms.contenttypes.sciproject.Contact; +import org.scientificcms.contenttypes.sciproject.ContactRepository; import org.scientificcms.contenttypes.sciproject.Membership; +import org.scientificcms.contenttypes.sciproject.MembershipRepository; import org.scientificcms.contenttypes.sciproject.MembershipStatus; import org.scientificcms.contenttypes.sciproject.SciProject; import org.scientificcms.contenttypes.sciproject.SciProjectMananger; +import java.util.Arrays; +import java.util.LinkedHashMap; import java.util.Locale; import java.util.Map; import java.util.Objects; @@ -80,6 +84,9 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @Inject private ContentItemRepository itemRepo; + @Inject + private ContactRepository contactRepo; + @Inject private DocumentUi documentUi; @@ -89,6 +96,9 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @Inject private ItemPermissionChecker itemPermissionChecker; + @Inject + private MembershipRepository membershipRepo; + @Inject private Models models; @@ -104,6 +114,9 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @Inject private SciProjectDescriptionMembersModel membersModel; + @Inject + private SciProjectMessageBundle messageBundle; + @Override public Class getStepClass() { return SciProjectDescriptionStep.class; @@ -112,6 +125,7 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @GET @Path("/") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String showStep( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -140,6 +154,7 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @GET @Path("/description/view/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String viewDescription( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -172,6 +187,7 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @POST @Path("/description/add") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String addDescriptionValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -214,6 +230,7 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @GET @Path("/description/edit/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String editDescriptionValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -247,6 +264,7 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @POST @Path("/description/edit/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String editDescriptionValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -281,6 +299,7 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @POST @Path("/description/remove/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String removeDescriptionValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -314,6 +333,7 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @POST @Path("/contacts/add") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String addContact( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -354,9 +374,62 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { } } + @POST + @Path("/contacts/edit/{contactId}") + @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired + public String editContact( + @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) + final String sectionIdentifier, + @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) + final String documentPath, + @PathParam("contactId") + final String contactId, + @FormParam("type") + final String type + ) { + try { + init(); + } catch (ContentSectionNotFoundException ex) { + return ex.showErrorMessage(); + } catch (DocumentNotFoundException ex) { + return ex.showErrorMessage(); + } + + if (itemPermissionChecker.canEditItem(getProject())) { + final Optional result = getProject() + .getContacts() + .stream() + .filter( + contact -> Long + .toString(contact.getContactId()) + .equals(contactId) + ) + .findFirst(); + + if (!result.isPresent()) { + models.put("contactNotFound", contactId); + return showStep(sectionIdentifier, documentPath); + } + + final Contact contact = result.get(); + contact.setContactType(type); + contactRepo.save(contact); + + return buildRedirectPathForStep(); + } else { + return documentUi.showAccessDenied( + getContentSection(), + getProject(), + sciProjectMessageBundle.getMessage("event.edit.denied") + ); + } + } + @POST @Path("/contacts/remove") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String removeContact( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -404,7 +477,8 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { @POST @Path("/members/add") @Transactional(Transactional.TxType.REQUIRED) - public String addMember( + @AuthorizationRequired + public String addMembership( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) @@ -456,10 +530,66 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { } } + @POST + @Path("/members/edit/{membershipId") + @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired + public String editMembership( + @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) + final String sectionIdentifier, + @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) + final String documentPath, + @PathParam("membershipId") + final String membershipId, + @FormParam("role") + final String role, + @FormParam("status") + final String statusParam + ) { + try { + init(); + } catch (ContentSectionNotFoundException ex) { + return ex.showErrorMessage(); + } catch (DocumentNotFoundException ex) { + return ex.showErrorMessage(); + } + + if (itemPermissionChecker.canEditItem(getProject())) { + final Optional result = getProject() + .getMembers() + .stream() + .filter( + member -> Long + .toString(member.getMembershipId()) + .equals(membershipId) + ) + .findFirst(); + + if (!result.isPresent()) { + models.put("membershipNotFound", membershipId); + return showStep(sectionIdentifier, documentPath); + } + + final Membership membership = result.get(); + membership.setRole(role); + membership.setStatus(MembershipStatus.valueOf(statusParam)); + membershipRepo.save(membership); + + return buildRedirectPathForStep(); + } else { + return documentUi.showAccessDenied( + getContentSection(), + getProject(), + sciProjectMessageBundle.getMessage("event.edit.denied") + ); + } + } + @POST @Path("/members/remove") @Transactional(Transactional.TxType.REQUIRED) - public String removeMember( + @AuthorizationRequired + public String removeMembership( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) @@ -562,6 +692,23 @@ public class SciProjectDescriptionStep extends AbstractMvcAuthoringStep { .map(this::buildMembershipModel) .collect(Collectors.toList()) ); + membersModel.setStatusValues( + Arrays + .stream(MembershipStatus.values()) + .collect( + Collectors.toMap( + status -> status.toString(), + status -> messageBundle.getMessage( + String.format( + "members.status.%s", + status.toString().toLowerCase() + ) + ), + (value1, value2) -> value1, + LinkedHashMap::new + ) + ) + ); } } diff --git a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectFundingStep.java b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectFundingStep.java index 3ce370f..186b9f0 100644 --- a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectFundingStep.java +++ b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectFundingStep.java @@ -1,6 +1,7 @@ package org.scientificcms.contenttypes.sciproject.ui; import org.libreccm.l10n.GlobalizationHelper; +import org.libreccm.security.AuthorizationRequired; import org.librecms.assets.Organization; import org.librecms.contentsection.AssetRepository; import org.librecms.contentsection.ContentItemRepository; @@ -15,6 +16,7 @@ import org.librecms.ui.contentsections.documents.MvcAuthoringSteps; import org.scientificcms.contenttypes.sciproject.SciProject; import org.scientificcms.contenttypes.sciproject.SciProjectMananger; import org.scientificcms.contenttypes.sciproject.Sponsoring; +import org.scientificcms.contenttypes.sciproject.SponsoringRepository; import java.util.Locale; import java.util.Map; @@ -81,6 +83,9 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @Inject private SciProjectFundingSponsoringModel sponsoringModel; + @Inject + private SponsoringRepository sponsoringRepo; + @Override public Class getStepClass() { return SciProjectFundingStep.class; @@ -89,6 +94,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @GET @Path("/") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String showStep( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -117,6 +123,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @GET @Path("/funding-text/view/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String viewFundingText( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -150,6 +157,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @POST @Path("/funding-text/add") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String addFundingTextValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -191,6 +199,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @GET @Path("/funding-text/edit") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String editFundingTextValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -224,6 +233,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @POST @Path("/funding-text/edit/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String editFundingTextValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -258,6 +268,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @POST @Path("/funding-text/remove/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String removeFundingTextValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -291,6 +302,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @GET @Path("/funding-volume/view/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String viewFundingVolume( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -324,6 +336,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @POST @Path("/funding-volume/add") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String addFundingVolumeValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -365,6 +378,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @GET @Path("/funding-volume/edit") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String editFundingVolumeValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -398,6 +412,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @POST @Path("/funding-volume/edit/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String editFundingVolumeValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -432,6 +447,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @POST @Path("/funding-volume/remove/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String removeFundingVolumeValue( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -465,7 +481,7 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { @POST @Path("/sponsoring/add") @Transactional(Transactional.TxType.REQUIRED) - public String addSponsoring( + public String addSponsoringing( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) @@ -505,10 +521,62 @@ public class SciProjectFundingStep extends AbstractMvcAuthoringStep { } } + @POST + @Path("/sponsoring/edit/{sponsoringId}") + @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired + public String editSponsoring( + final String sectionIdentifier, + @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) + final String documentPath, + @PathParam("sponsoringId") + final String sponsoringId, + @FormParam("fundingCode") + final String fundingCode + ) { + try { + init(); + } catch (ContentSectionNotFoundException ex) { + return ex.showErrorMessage(); + } catch (DocumentNotFoundException ex) { + return ex.showErrorMessage(); + } + + if (itemPermissionChecker.canEditItem(getProject())) { + final Optional result = getProject() + .getSponsoring() + .stream() + .filter( + sponsoring -> Long + .toString(sponsoring.getSponsoringId()) + .equals(sponsoringId) + ) + .findFirst(); + + if (!result.isPresent()) { + models.put("sponsoringNotFound", sponsoringId); + return showStep(sectionIdentifier, documentPath); + } + + final Sponsoring sponsoring = result.get(); + sponsoring.setFundingCode(fundingCode); + sponsoringRepo.save(sponsoring); + + return buildRedirectPathForStep(); + } else { + return documentUi.showAccessDenied( + getContentSection(), + getProject(), + sciProjectMessageBundle.getMessage("event.edit.denied") + ); + } + } + @POST @Path("/sponsoring/remove") @Transactional(Transactional.TxType.REQUIRED) - public String removeSponsor( + @AuthorizationRequired + public String removeSponsoring( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @PathParam(MvcAuthoringSteps.DOCUMENT_PATH_PATH_PARAM_NAME) diff --git a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectMembershipModel.java b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectMembershipModel.java index 00a3032..ffd5465 100644 --- a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectMembershipModel.java +++ b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectMembershipModel.java @@ -26,7 +26,7 @@ public class SciProjectMembershipModel { private String role; /** - * The status of teh membership. + * The status of the membership. * * @see Membership#status */ @@ -83,6 +83,30 @@ public class SciProjectMembershipModel { public void setStatus(final String status) { this.status = status; } + + public String getName() { + final StringBuilder builder = new StringBuilder(); + if (prefix != null && !prefix.isBlank()) { + builder.append(prefix); + builder.append(" "); + } + if (surname != null && !surname.isBlank()) { + builder.append(surname); + } + if (surname != null + && !surname.isBlank() + && givenName != null + && !givenName.isBlank()) { + builder.append(", "); + } + if (givenName != null && !givenName.isBlank()) { + builder.append(givenName); + } + if (suffix != null && !suffix.isBlank()) { + builder.append(" "); + builder.append(suffix); + } + } public String getGivenName() { return givenName; diff --git a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectPropertiesStep.java b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectPropertiesStep.java index 31c7346..45f3255 100644 --- a/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectPropertiesStep.java +++ b/sci-types-project/src/main/java/org/scientificcms/contenttypes/sciproject/ui/SciProjectPropertiesStep.java @@ -461,6 +461,7 @@ public class SciProjectPropertiesStep extends AbstractMvcAuthoringStep { @POST @Path("/short-description/@add") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String addShortDescription( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -507,6 +508,7 @@ public class SciProjectPropertiesStep extends AbstractMvcAuthoringStep { @POST @Path("/short-description/{locale}") @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String editShortDescription( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, @@ -549,6 +551,10 @@ public class SciProjectPropertiesStep extends AbstractMvcAuthoringStep { * * @return A redirect to this authoring step. */ + @POST + @Path("/short-description/remove/{locale}") + @Transactional(Transactional.TxType.REQUIRED) + @AuthorizationRequired public String removeShortDescription( @PathParam(MvcAuthoringSteps.SECTION_IDENTIFIER_PATH_PARAM) final String sectionIdentifier, diff --git a/sci-types-project/src/main/resources/WEB-INF/views/org/scientificcms/contenttypes/sciproject/ui/sciproject-description.xhtml b/sci-types-project/src/main/resources/WEB-INF/views/org/scientificcms/contenttypes/sciproject/ui/sciproject-description.xhtml new file mode 100644 index 0000000..3fc8867 --- /dev/null +++ b/sci-types-project/src/main/resources/WEB-INF/views/org/scientificcms/contenttypes/sciproject/ui/sciproject-description.xhtml @@ -0,0 +1,280 @@ +]> + + + + + + +

#{SciProjectMessageBundle['description_step.header']}

+ + + +

#{SciProjectMessageBundle['contacts.header']}

+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + +
#{SciProjectMessageBundle['contacts.cols.contactable']}#{SciProjectMessageBundle['contacts.cols.type']}#{SciProjectMessageBundle['contacts.cols.actions']}
#{contact.contactable}#{contact.contactType} + + + + +
+ + +

#{SciProjectMessageBundle['memberships.header']}

+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
#{SciProjectMessageBundle['memberships.cols.name']}#{SciProjectMessageBundle['memberships.cols.role']}#{SciProjectMessageBundle['memberships.cols.status']}#{SciProjectMessageBundle['memberships.cols.actions']}
+ #{member.name} + + #{member.role} + + #{member.status} + + + + + +
+ + + +
+ +
+ + diff --git a/scicms-bundle-devel/pom.xml b/scicms-bundle-devel/pom.xml index 54f8973..d59143f 100644 --- a/scicms-bundle-devel/pom.xml +++ b/scicms-bundle-devel/pom.xml @@ -39,11 +39,6 @@ ${project.parent.version} - - net.sf.saxon - Saxon-HE - - org.libreccm