From 45fcb1c0f9fa88fdcfbcd4358e31e10958bcd787 Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 16 Feb 2017 18:07:31 +0000 Subject: [PATCH] CCM NG/ccm-cms: More work for the FolderBrowser git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4579 8810af33-2d31-482b-a856-94f89814c4df --- .../cms/ui/authoring/NewItemForm.java | 55 ++++++++++--------- ccm-cms/src/main/java/org/librecms/Cms.java | 5 ++ .../contentsection/ContentTypeManager.java | 52 +++++++++++++++++- .../org/librecms/contenttypes/Article.java | 2 + .../contenttypes/ContentTypesManager.java | 26 +++++---- .../java/org/librecms/contenttypes/Event.java | 2 + .../contenttypes/MultiPartArticle.java | 2 + .../java/org/librecms/contenttypes/News.java | 2 + .../org/librecms/CmsResources.properties | 2 + .../org/librecms/CmsResources_de.properties | 2 + .../org/librecms/CmsResources_fr.properties | 2 + .../librecms/contenttypes/Article.properties | 2 + .../contenttypes/Article_de.properties | 2 + .../librecms/contenttypes/Event.properties | 2 + .../librecms/contenttypes/Event_de.properties | 2 + .../librecms/contenttypes/Event_fr.properties | 2 + ...properties => MultiPartArticle.properties} | 3 +- .../MultiPartArticle_de.properties | 3 +- .../MultiPartArticle_fr.properties | 3 +- .../org/librecms/contenttypes/News.properties | 3 +- .../librecms/contenttypes/News_de.properties | 3 +- .../librecms/contenttypes/News_fr.properties | 3 +- .../globalization/GlobalizedMessage.java | 6 +- .../security/RoleMembershipMarshaller.java | 7 +++ 24 files changed, 144 insertions(+), 49 deletions(-) create mode 100644 ccm-cms/src/main/resources/org/librecms/contenttypes/Article.properties create mode 100644 ccm-cms/src/main/resources/org/librecms/contenttypes/Article_de.properties rename ccm-cms/src/main/resources/org/librecms/contenttypes/{MultiPartArticle.properties.properties => MultiPartArticle.properties} (96%) diff --git a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/NewItemForm.java b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/NewItemForm.java index 70273c77b..10dba3735 100755 --- a/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/NewItemForm.java +++ b/ccm-cms/src/main/java/com/arsdigita/cms/ui/authoring/NewItemForm.java @@ -49,7 +49,11 @@ import org.librecms.contentsection.privileges.TypePrivileges; import java.util.List; import java.util.TooManyListenersException; import java.util.stream.Collectors; + import org.libreccm.l10n.GlobalizationHelper; +import org.librecms.contentsection.ContentTypeManager; +import org.librecms.contenttypes.ContentTypeInfo; +import org.librecms.contenttypes.ContentTypesManager; /** * A form element which displays a select box of all content types available @@ -76,7 +80,7 @@ public abstract class NewItemForm extends Form { * Construct a new NewItemForm. It sets a vertical BoxPanel as the component * container. * - * @param name the name attribute of the form. + * @param name the name attribute of the form. * @param orientation */ public NewItemForm(final String name, final int orientation) { @@ -90,16 +94,16 @@ public abstract class NewItemForm extends Form { // create and add an "empty" component emptyLabel = new Label( - new GlobalizedMessage("cms.ui.authoring.no_types_registered", - CmsConstants.CMS_BUNDLE), - false); + new GlobalizedMessage("cms.ui.authoring.no_types_registered", + CmsConstants.CMS_BUNDLE), + false); emptyLabel.setIdAttr("empty_label"); panel.add(emptyLabel); createLabel = new Label( - new GlobalizedMessage("cms.ui.authoring.create_new", - CmsConstants.CMS_BUNDLE), - false); + new GlobalizedMessage("cms.ui.authoring.create_new", + CmsConstants.CMS_BUNDLE), + false); createLabel.setIdAttr("create_label"); panel.add(createLabel); @@ -112,7 +116,7 @@ public abstract class NewItemForm extends Form { @Override public void prepare(final PrintEvent event) { final OptionGroup target = (OptionGroup) event - .getTarget(); + .getTarget(); target.clearOptions(); final PageState state = event.getPageState(); @@ -121,31 +125,30 @@ public abstract class NewItemForm extends Form { // final ContentType parentType; final List typesCollection; final Long singleTypeID = (Long) state.getValue( - new LongParameter(ItemSearch.SINGLE_TYPE_PARAM)); + new LongParameter(ItemSearch.SINGLE_TYPE_PARAM)); final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); final NewItemFormController controller = cdiUtil.findBean( - NewItemFormController.class); + NewItemFormController.class); final ContentTypeRepository typeRepo = cdiUtil.findBean( - ContentTypeRepository.class); + ContentTypeRepository.class); + final ContentTypesManager typesManager = cdiUtil.findBean( + ContentTypesManager.class); final PermissionChecker permissionChecker = cdiUtil - .findBean(PermissionChecker.class); + .findBean(PermissionChecker.class); -// if (singleTypeID == null) { -// parentType = null; -// } else { -// parentType = typeRepo.findById(singleTypeID).get(); -// } -// typesCollection = section.getContentTypes().stream() -// .filter(type -> permissionChecker.isPermitted( -// TypePrivileges.USE_TYPE, -// type)) -// .collect(Collectors.toList()); typesCollection = controller.getContentTypes(section); - typesCollection.forEach(type -> target.addOption( - new Option(Long.toString(type.getObjectId()), - new Text(type.getContentItemClass())))); + for (final ContentType type : typesCollection) { + final ContentTypeInfo typeInfo = typesManager + .getContentTypeInfo(type.getContentItemClass()); + final String value = Long.toString(type.getObjectId()); + final Label label = new Label( + new GlobalizedMessage(typeInfo.getLabelKey(), + typeInfo.getLabelBundle())); + target.addOption( + new Option(value, label)); + } } }); @@ -197,7 +200,7 @@ public abstract class NewItemForm extends Form { final CdiUtil cdiUtil = CdiUtil.createCdiUtil(); final NewItemFormController controller = cdiUtil.findBean( - NewItemFormController.class); + NewItemFormController.class); boolean isEmpty = !controller.hasContentTypes(section); createLabel.setVisible(state, !isEmpty); diff --git a/ccm-cms/src/main/java/org/librecms/Cms.java b/ccm-cms/src/main/java/org/librecms/Cms.java index 3ac2e9384..c04bc3fb3 100644 --- a/ccm-cms/src/main/java/org/librecms/Cms.java +++ b/ccm-cms/src/main/java/org/librecms/Cms.java @@ -24,6 +24,10 @@ import org.librecms.contentsection.ContentSectionCreator; import org.librecms.contentsection.ContentSectionSetup; import org.librecms.contentsection.ui.admin.ApplicationInstanceForm; import org.librecms.contentsection.ui.admin.SettingsPane; +import org.librecms.contenttypes.Article; +import org.librecms.contenttypes.Event; +import org.librecms.contenttypes.MultiPartArticle; +import org.librecms.contenttypes.News; import java.io.IOException; import java.io.InputStream; @@ -52,6 +56,7 @@ import java.util.Properties; ) } ) +@ContentTypes({Article.class, Event.class, MultiPartArticle.class, News.class}) public class Cms implements CcmModule { private static final Logger LOGGER = LogManager.getLogger(Cms.class); diff --git a/ccm-cms/src/main/java/org/librecms/contentsection/ContentTypeManager.java b/ccm-cms/src/main/java/org/librecms/contentsection/ContentTypeManager.java index bb7333643..8ebfed155 100644 --- a/ccm-cms/src/main/java/org/librecms/contentsection/ContentTypeManager.java +++ b/ccm-cms/src/main/java/org/librecms/contentsection/ContentTypeManager.java @@ -18,6 +18,9 @@ */ package org.librecms.contentsection; +import com.arsdigita.globalization.GlobalizedMessage; + +import org.libreccm.l10n.GlobalizationHelper; import org.librecms.contentsection.privileges.TypePrivileges; import org.libreccm.security.AuthorizationRequired; @@ -26,8 +29,12 @@ import org.libreccm.security.RequiresPrivilege; import org.libreccm.security.Role; import org.libreccm.workflow.WorkflowTemplate; import org.librecms.contentsection.privileges.AdminPrivileges; +import org.librecms.contenttypes.Article; import org.librecms.lifecycle.LifecycleDefinition; +import java.util.Objects; +import java.util.ResourceBundle; + import javax.enterprise.context.RequestScoped; import javax.inject.Inject; import javax.transaction.Transactional; @@ -42,10 +49,20 @@ public class ContentTypeManager { @Inject private ContentTypeRepository typeRepo; - + @Inject private PermissionManager permissionManager; + /** + * Converts the class name of a content type to {@link Class} object. + * + * @param className The class name of the content type. + * + * @return The class for the content type. + * + * @throws IllegalArgumentException If the provided class is not a sub class + * of {@link ContentItem}. + */ @SuppressWarnings("unchecked") public Class classNameToClass(final String className) { final Class clazz; @@ -57,7 +74,7 @@ public class ContentTypeManager { ex); } - if (clazz.isAssignableFrom(ContentItem.class)) { + if (ContentItem.class.isAssignableFrom(clazz)) { return (Class) clazz; } else { throw new IllegalArgumentException(String.format( @@ -65,6 +82,13 @@ public class ContentTypeManager { } } + /** + * Sets the default lifecycle to use for new items of a content type. + * + * @param type + * @param definition The {@link LifecycleDefinition} for the lifecycle to + * use for new items of the provided {@code type}. + */ @Transactional(Transactional.TxType.REQUIRED) @AuthorizationRequired public void setDefaultLifecycle( @@ -77,6 +101,13 @@ public class ContentTypeManager { typeRepo.save(type); } + /** + * Sets the default workflow to use for new items of a content type. + * + * @param type + * @param template The {@link WorkflowTemplate} for the workflow to use for + * new items of the provided {@code type}. + */ @Transactional(Transactional.TxType.REQUIRED) @AuthorizationRequired public void setDefaultWorkflow( @@ -89,6 +120,13 @@ public class ContentTypeManager { typeRepo.save(type); } + /** + * Creates a permission granting the {@link TypePrivileges#USE_TYPE} + * privilege to a role. + * + * @param type The type on which the privilege is granted. + * @param role The role to which the privilege is granted. + */ @Transactional(Transactional.TxType.REQUIRED) @AuthorizationRequired public void grantUsageOfType( @@ -98,7 +136,15 @@ public class ContentTypeManager { permissionManager.grantPrivilege(TypePrivileges.USE_TYPE, role, type); } - + + /** + * Denies usages of the provided content type by revoking any existing + * permissions granting the {@link TypePrivileges#USE_TYPE} privilege to the + * provided role. + * + * @param type The type for which the permission is revoked. + * @param role The role from which the permission is removed. + */ @Transactional(Transactional.TxType.REQUIRED) @AuthorizationRequired public void denyUsageOnType( diff --git a/ccm-cms/src/main/java/org/librecms/contenttypes/Article.java b/ccm-cms/src/main/java/org/librecms/contenttypes/Article.java index 1258483bf..13d805269 100644 --- a/ccm-cms/src/main/java/org/librecms/contenttypes/Article.java +++ b/ccm-cms/src/main/java/org/librecms/contenttypes/Article.java @@ -42,6 +42,8 @@ import org.librecms.contentsection.ContentItem; @Entity @Audited @Table(name = "ARTICLES", schema = DB_SCHEMA) +@ContentTypeDescription(labelBundle = "org.librecms.contenttypes.Article", + descriptionBundle = "org.librecms.contenttypes.Article") public class Article extends ContentItem implements Serializable { private static final long serialVersionUID = 3832010184748095822L; diff --git a/ccm-cms/src/main/java/org/librecms/contenttypes/ContentTypesManager.java b/ccm-cms/src/main/java/org/librecms/contenttypes/ContentTypesManager.java index f71c172a7..b0a7ad31b 100644 --- a/ccm-cms/src/main/java/org/librecms/contenttypes/ContentTypesManager.java +++ b/ccm-cms/src/main/java/org/librecms/contenttypes/ContentTypesManager.java @@ -18,7 +18,6 @@ */ package org.librecms.contenttypes; - import org.libreccm.modules.CcmModule; import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentType; @@ -72,7 +71,8 @@ public class ContentTypesManager { } final List> moduleTypes = Arrays - .stream(annotation.value()).collect(Collectors.toList()); + .stream(annotation.value()) + .collect(Collectors.toList()); types.addAll(moduleTypes); } @@ -137,16 +137,18 @@ public class ContentTypesManager { final AuthoringKit authoringKit = contentTypeClass.getAnnotation( AuthoringKit.class); - final AuthoringKitInfo authoringKitInfo = new AuthoringKitInfo(); - authoringKitInfo.setCreateComponent(authoringKit.createComponent()); + if (authoringKit != null) { + final AuthoringKitInfo authoringKitInfo = new AuthoringKitInfo(); + authoringKitInfo.setCreateComponent(authoringKit.createComponent()); - final List steps = Arrays.stream(authoringKit - .steps()) - .map(step -> createAuthoringStepInfo(contentTypeClass, step)) - .collect(Collectors.toList()); - authoringKitInfo.setAuthoringSteps(steps); - steps.sort((step1, step2) -> Integer.compare(step1.getOrder(), - step2.getOrder())); + final List steps = Arrays.stream(authoringKit + .steps()) + .map(step -> createAuthoringStepInfo(contentTypeClass, step)) + .collect(Collectors.toList()); + authoringKitInfo.setAuthoringSteps(steps); + steps.sort((step1, step2) -> Integer.compare(step1.getOrder(), + step2.getOrder())); + } return contentTypeInfo; } @@ -252,7 +254,7 @@ public class ContentTypesManager { ex); } - if (!clazz.isAssignableFrom(ContentItem.class)) { + if (!ContentItem.class.isAssignableFrom(clazz)) { throw new IllegalArgumentException(String.format( "Class \"%s\" is not a subclass of \"%s\".", contentTypeClass, diff --git a/ccm-cms/src/main/java/org/librecms/contenttypes/Event.java b/ccm-cms/src/main/java/org/librecms/contenttypes/Event.java index 0c05f4158..d5b6e7db1 100644 --- a/ccm-cms/src/main/java/org/librecms/contenttypes/Event.java +++ b/ccm-cms/src/main/java/org/librecms/contenttypes/Event.java @@ -48,6 +48,8 @@ import static org.librecms.CmsConstants.*; @Entity @Audited @Table(name = "EVENTS", schema = DB_SCHEMA) +@ContentTypeDescription(labelBundle = "org.librecms.contenttypes.Event", + descriptionBundle = "org.librecms.contenttypes.Event") public class Event extends ContentItem implements Serializable { private static final long serialVersionUID = -9104886733503414635L; diff --git a/ccm-cms/src/main/java/org/librecms/contenttypes/MultiPartArticle.java b/ccm-cms/src/main/java/org/librecms/contenttypes/MultiPartArticle.java index 0d3a190da..5b1b5caf9 100644 --- a/ccm-cms/src/main/java/org/librecms/contenttypes/MultiPartArticle.java +++ b/ccm-cms/src/main/java/org/librecms/contenttypes/MultiPartArticle.java @@ -45,6 +45,8 @@ import static org.librecms.CmsConstants.*; @Entity @Audited @Table(name = "MULTIPART_ARTICLES", schema = DB_SCHEMA) +@ContentTypeDescription(labelBundle = "org.librecms.contenttypes.MultiPartArticle", + descriptionBundle = "org.librecms.contenttypes.MultiPartArticle") public class MultiPartArticle extends ContentItem implements Serializable { private static final long serialVersionUID = -587374085831420868L; diff --git a/ccm-cms/src/main/java/org/librecms/contenttypes/News.java b/ccm-cms/src/main/java/org/librecms/contenttypes/News.java index f88e798c3..4438dcfd0 100644 --- a/ccm-cms/src/main/java/org/librecms/contenttypes/News.java +++ b/ccm-cms/src/main/java/org/librecms/contenttypes/News.java @@ -46,6 +46,8 @@ import static org.librecms.CmsConstants.*; @Entity @Audited @Table(name = "NEWS", schema = DB_SCHEMA) +@ContentTypeDescription(labelBundle = "org.librecms.contenttypes.News", + descriptionBundle = "org.librecms.contenttypes.News") public class News extends ContentItem implements Serializable { private static final long serialVersionUID = -4939565845920227974L; diff --git a/ccm-cms/src/main/resources/org/librecms/CmsResources.properties b/ccm-cms/src/main/resources/org/librecms/CmsResources.properties index 8a65ceaf2..14bdfb568 100644 --- a/ccm-cms/src/main/resources/org/librecms/CmsResources.properties +++ b/ccm-cms/src/main/resources/org/librecms/CmsResources.properties @@ -115,3 +115,5 @@ cms.ui.authoring.no_types_registered=No types registered cms.ui.contents_of=Contents of cms.ui.new_folder=Create new folder cms.ui.edit_folder=Rename the current folder +cms.ui.authoring.create_new=Create new +cms.ui.authoring.go=Go diff --git a/ccm-cms/src/main/resources/org/librecms/CmsResources_de.properties b/ccm-cms/src/main/resources/org/librecms/CmsResources_de.properties index 4b190b1cd..3a4b0f0e8 100644 --- a/ccm-cms/src/main/resources/org/librecms/CmsResources_de.properties +++ b/ccm-cms/src/main/resources/org/librecms/CmsResources_de.properties @@ -114,3 +114,5 @@ cms.ui.authoring.no_types_registered=Keine Typen registiert cms.ui.contents_of=Inhalt von cms.ui.new_folder=Neuen Ordner erstellen cms.ui.edit_folder=Aktuellen Ordner umbenennen +cms.ui.authoring.create_new=Neuer Inhalt +cms.ui.authoring.go=Anlegen diff --git a/ccm-cms/src/main/resources/org/librecms/CmsResources_fr.properties b/ccm-cms/src/main/resources/org/librecms/CmsResources_fr.properties index c0c16d0c4..03d9ebc0b 100644 --- a/ccm-cms/src/main/resources/org/librecms/CmsResources_fr.properties +++ b/ccm-cms/src/main/resources/org/librecms/CmsResources_fr.properties @@ -83,3 +83,5 @@ cms.ui.authoring.no_types_registered=No types registered cms.ui.contents_of=Contents of cms.ui.new_folder=Create new folder cms.ui.edit_folder=Rename the current folder +cms.ui.authoring.create_new=Create new +cms.ui.authoring.go=Go diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/Article.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/Article.properties new file mode 100644 index 000000000..78124e737 --- /dev/null +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/Article.properties @@ -0,0 +1,2 @@ +label = Article +description = An simple Article diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/Article_de.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/Article_de.properties new file mode 100644 index 000000000..6d5742125 --- /dev/null +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/Article_de.properties @@ -0,0 +1,2 @@ +label = Artikel +description = Ein einfacher Artikel diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/Event.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/Event.properties index 804f24326..2d1dedb57 100755 --- a/ccm-cms/src/main/resources/org/librecms/contenttypes/Event.properties +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/Event.properties @@ -24,3 +24,5 @@ cms.contenttypes.event.type_label=Event cms.contenttypes.event_type_not_registered=Type not registered cms.contenttypes.ui.event.lead_hint=A short description of the focus of the event and its main topic. Should be no longer than 2-3 sentences. The lead text will be displayed in the detail view of the event as well as in listings of events. cms.contenttypes.ui.event.end_date_hint=Optionally enter an end date. It is displayed on the detail view as well as in listings of other short references. +label=Event +description=An event diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/Event_de.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/Event_de.properties index a07f25f24..f9963b021 100755 --- a/ccm-cms/src/main/resources/org/librecms/contenttypes/Event_de.properties +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/Event_de.properties @@ -25,3 +25,5 @@ cms.contenttypes.event.type_label=Veranstaltung cms.contenttypes.event_type_not_registered=Typ nicht registriert cms.contenttypes.ui.event.lead_hint=Kurze Beschreibung der Veranstaltung und ihres zentralen Themas. Die L\u00e4nge sollte maximal 2-3 S\u00e4tze betragen. Die Zusammenfassung wird sowohl in der Vollansicht der Veranstaltung als auch in allen Teilsichten und Listen angezeigt. cms.contenttypes.ui.event.end_date_hint=Ein optionales Enddatum; es wird sowohl in der Vollansicht als auch in allen Listen und sonstigen Referencen angezeigt. +label=Veranstaltung +description=Veranstaltung diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/Event_fr.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/Event_fr.properties index 170ccdbb1..016f9b84c 100755 --- a/ccm-cms/src/main/resources/org/librecms/contenttypes/Event_fr.properties +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/Event_fr.properties @@ -25,3 +25,5 @@ cms.contenttypes.ui.event.there_are_no_events=Il n'y a aucun \u00e9venement cms.contenttypes.event.type_label=Event cms.contenttypes.ui.event.lead_hint=A short description of the focus of the event and its main topic. Should be no longer than 2-3 sentences. The lead text will be displayed in the detail view of the event as well as in listings of events. cms.contenttypes.ui.event.end_date_hint=Optionally enter an end date. It is displayed on the detail view as well as in listings of other short references. +label=Event +description=An event diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle.properties.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle.properties similarity index 96% rename from ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle.properties.properties rename to ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle.properties index 0de8d33ae..54a77b8f8 100755 --- a/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle.properties.properties +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle.properties @@ -32,4 +32,5 @@ cms.contenttypes.ui.mparticle.section.create_break=Create page break after this cms.contenttypes.ui.mparticle.image.delete_button=Delete Image cms.contenttypes.ui.mparticle.section_table.link_move_below=move belowe here cms.contenttypes.ui.mparticle.section_table.link_not_defined=(No action possible) -cms.contenttypes.multipartarticle.type_label=Multipart Article +label=Multipart Article +description=A long article which is divided in several sections diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle_de.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle_de.properties index 2394f91cf..f27fedf2b 100755 --- a/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle_de.properties +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle_de.properties @@ -32,4 +32,5 @@ cms.contenttypes.ui.mparticle.section.create_break=Seitenumbruch nach diesem Abs cms.contenttypes.ui.mparticle.image.delete_button=Bild Entfernen cms.contenttypes.ui.mparticle.section_table.link_move_below=unterhalb verschieben cms.contenttypes.ui.mparticle.section_table.link_not_defined=(Keine Aktion m\u00f6glich) -cms.contenttypes.multipartarticle.type_label=Mehrteiliger Artikel +label=Mehrteiliger Artikel +description=Ein l\u00e4ngerer Artikel, der in mehrere Abschnitte unterteilt ist. diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle_fr.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle_fr.properties index d2ba1a04c..740738e0f 100755 --- a/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle_fr.properties +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/MultiPartArticle_fr.properties @@ -32,4 +32,5 @@ cms.contenttypes.ui.mparticle.section.create_break=Create page break cms.contenttypes.ui.mparticle.image.delete_button=Delete Image cms.contenttypes.ui.mparticle.section_table.link_move_below=move belowe here cms.contenttypes.ui.mparticle.section_table.link_not_defined=(No action possible) -cms.contenttypes.multipartarticle.type_label=Multipart Article +label=Multipart Article +description=A long article which is divided in several sections diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/News.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/News.properties index 10f74cce9..1581a264e 100644 --- a/ccm-cms/src/main/resources/org/librecms/contenttypes/News.properties +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/News.properties @@ -8,4 +8,5 @@ cms.contenttypes.ui.newsitem.news_date=Date cms.contenttypes.ui.newsitem.unknown=unknown cms.contenttypes.ui.newsitem.yes=Yes cms.contenttypes.ui.newsitem.no=No -cms.contenttypes.newsitem.type_label=News Item +label=News Item +description=News Item diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/News_de.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/News_de.properties index a84281706..223e94127 100644 --- a/ccm-cms/src/main/resources/org/librecms/contenttypes/News_de.properties +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/News_de.properties @@ -16,4 +16,5 @@ cms.contenttypes.ui.newsitem.news_date=Erscheinungsdatum: cms.contenttypes.ui.newsitem.unknown=unbekannt cms.contenttypes.ui.newsitem.yes=Ja cms.contenttypes.ui.newsitem.no=Nein -cms.contenttypes.newsitem.type_label=Neuigkeiten +label=Neuigkeiten +description=Was gibt es neues? diff --git a/ccm-cms/src/main/resources/org/librecms/contenttypes/News_fr.properties b/ccm-cms/src/main/resources/org/librecms/contenttypes/News_fr.properties index 5accfed29..74d45ea98 100644 --- a/ccm-cms/src/main/resources/org/librecms/contenttypes/News_fr.properties +++ b/ccm-cms/src/main/resources/org/librecms/contenttypes/News_fr.properties @@ -14,4 +14,5 @@ cms.contenttypes.ui.newsitem.news_date=Erscheinungsdatum: cms.contenttypes.ui.newsitem.unknown=unknown cms.contenttypes.ui.newsitem.yes=Yes cms.contenttypes.ui.newsitem.no=No -cms.contenttypes.newsitem.type_label=News Item +label=News Item +description=News Item diff --git a/ccm-core/src/main/java/com/arsdigita/globalization/GlobalizedMessage.java b/ccm-core/src/main/java/com/arsdigita/globalization/GlobalizedMessage.java index 434d5112b..aacf4642b 100644 --- a/ccm-core/src/main/java/com/arsdigita/globalization/GlobalizedMessage.java +++ b/ccm-core/src/main/java/com/arsdigita/globalization/GlobalizedMessage.java @@ -292,10 +292,12 @@ public class GlobalizedMessage { getBundleName(), locale, rbControl); - } catch (MissingResourceException e) { + } catch (MissingResourceException ex) { if (LOGGER.isDebugEnabled()) { LOGGER.debug( - "ResourceBundle " + getBundleName() + " was not found."); + "ResourceBundle {} was not found.", + getBundleName()); + LOGGER.debug(ex); } } diff --git a/ccm-core/src/main/java/org/libreccm/security/RoleMembershipMarshaller.java b/ccm-core/src/main/java/org/libreccm/security/RoleMembershipMarshaller.java index f3e80f44f..a4bcf549b 100644 --- a/ccm-core/src/main/java/org/libreccm/security/RoleMembershipMarshaller.java +++ b/ccm-core/src/main/java/org/libreccm/security/RoleMembershipMarshaller.java @@ -18,6 +18,8 @@ */ package org.libreccm.security; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.libreccm.portation.AbstractMarshaller; import org.libreccm.portation.Marshals; @@ -34,6 +36,8 @@ import javax.transaction.Transactional; @Marshals(RoleMembership.class) public class RoleMembershipMarshaller extends AbstractMarshaller { + private static final Logger LOGGER = LogManager.getLogger(RoleMembershipMarshaller.class); + @Inject private EntityManager entityManager; @@ -51,6 +55,9 @@ public class RoleMembershipMarshaller extends AbstractMarshaller portableObject.setMembershipId(portableObject.getMembershipId() * -1); // entityManager.persist(portableObject); entityManager.merge(portableObject); + entityManager.flush(); + LOGGER.debug("Saved RoleMembership with id {}.", + portableObject.getMembershipId()); // } else { // entityManager.merge(portableObject); // }