CCM NG: Several bugfixes

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4783 8810af33-2d31-482b-a856-94f89814c4df

Former-commit-id: 29e9cce905
pull/2/head
jensp 2017-06-15 08:38:15 +00:00
parent 7ebd041957
commit 382b1ca920
10 changed files with 81 additions and 41 deletions

View File

@ -20,7 +20,6 @@ package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Component;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.PropertyEditor;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
@ -78,7 +77,7 @@ public class GenericArticlePropertiesStep extends SimpleEditStep {
editSheet.getSaveCancelSection().getCancelButton()); editSheet.getSaveCancelSection().getCancelButton());
} }
protected void setDisplayComponent(ItemSelectionModel itemModel) { protected void setDisplayComponent(final ItemSelectionModel itemModel) {
setDisplayComponent(getGenericArticlePropertySheet(itemModel)); setDisplayComponent(getGenericArticlePropertySheet(itemModel));
} }
@ -97,8 +96,9 @@ public class GenericArticlePropertiesStep extends SimpleEditStep {
* release * release
*/ */
public static Component getGenericArticlePropertySheet( public static Component getGenericArticlePropertySheet(
ItemSelectionModel itemModel) { final ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
final DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
itemModel); itemModel);
sheet.add(new GlobalizedMessage("cms.contenttypes.ui.title", sheet.add(new GlobalizedMessage("cms.contenttypes.ui.title",

View File

@ -57,14 +57,14 @@ import java.util.Optional;
* @see com.arsdigita.cms.contenttypes.NewsItem * @see com.arsdigita.cms.contenttypes.NewsItem
* *
*/ */
public class NewsItemPropertiesStep extends SimpleEditStep { public class NewsPropertiesStep extends SimpleEditStep {
/** /**
* The name of the editing sheet added to this step * The name of the editing sheet added to this step
*/ */
public static String EDIT_SHEET_NAME = "edit"; public static String EDIT_SHEET_NAME = "edit";
public NewsItemPropertiesStep(final ItemSelectionModel itemModel, public NewsPropertiesStep(final ItemSelectionModel itemModel,
final AuthoringKitWizard parent, final AuthoringKitWizard parent,
final StringParameter selectedLanguageParam) { final StringParameter selectedLanguageParam) {
@ -73,7 +73,7 @@ public class NewsItemPropertiesStep extends SimpleEditStep {
setDefaultEditKey(EDIT_SHEET_NAME); setDefaultEditKey(EDIT_SHEET_NAME);
BasicPageForm editSheet; BasicPageForm editSheet;
editSheet = new NewsItemPropertyForm(itemModel, this); editSheet = new NewsPropertyForm(itemModel, this);
add(EDIT_SHEET_NAME, add(EDIT_SHEET_NAME,
new GlobalizedMessage("cms.ui.edit", CmsConstants.CMS_BUNDLE), new GlobalizedMessage("cms.ui.edit", CmsConstants.CMS_BUNDLE),
new WorkflowLockedComponentAccess(editSheet, itemModel), new WorkflowLockedComponentAccess(editSheet, itemModel),

View File

@ -47,16 +47,16 @@ import java.util.GregorianCalendar;
/** /**
* Form to edit the basic properties of a {@link News} item. These are name, * Form to edit the basic properties of a {@link News} item. These are name,
* title, item date and reference code. Used by {@link NewsItemPropertiesStep} * title, item date and reference code. Used by {@link NewsPropertiesStep}
* authoring kit step. * authoring kit step.
* *
* This form can be extended to create forms for NewsItem subclasses. * This form can be extended to create forms for NewsItem subclasses.
* *
*/ */
public class NewsItemPropertyForm extends BasicPageForm public class NewsPropertyForm extends BasicPageForm
implements FormProcessListener, FormInitListener, FormSubmissionListener { implements FormProcessListener, FormInitListener, FormSubmissionListener {
private NewsItemPropertiesStep propertiesStep; private NewsPropertiesStep propertiesStep;
/** /**
* lead parameter name * lead parameter name
*/ */
@ -80,7 +80,7 @@ public class NewsItemPropertyForm extends BasicPageForm
* @param itemSelectionModel The ItemSelectionModel to use to obtain the * @param itemSelectionModel The ItemSelectionModel to use to obtain the
* NewsItem to work on * NewsItem to work on
*/ */
public NewsItemPropertyForm(final ItemSelectionModel itemSelectionModel) { public NewsPropertyForm(final ItemSelectionModel itemSelectionModel) {
this(itemSelectionModel, null); this(itemSelectionModel, null);
} }
@ -90,11 +90,11 @@ public class NewsItemPropertyForm extends BasicPageForm
* *
* @param itemSelectionModel The ItemSelectionModel to use to obtain the * @param itemSelectionModel The ItemSelectionModel to use to obtain the
* NewsItem to work on * NewsItem to work on
* @param propertiesStep The NewsItemPropertiesStep which controls this * @param propertiesStep The NewsPropertiesStep which controls this
* form. form.
*/ */
public NewsItemPropertyForm(final ItemSelectionModel itemSelectionModel, public NewsPropertyForm(final ItemSelectionModel itemSelectionModel,
final NewsItemPropertiesStep propertiesStep) { final NewsPropertiesStep propertiesStep) {
super(ID, itemSelectionModel); super(ID, itemSelectionModel);
this.propertiesStep = propertiesStep; this.propertiesStep = propertiesStep;
addSubmissionListener(this); addSubmissionListener(this);

View File

@ -224,7 +224,9 @@ public class ApplyWorkflowFormSection
final ApplyWorkflowController controller = cdiUtil final ApplyWorkflowController controller = cdiUtil
.findBean(ApplyWorkflowController.class); .findBean(ApplyWorkflowController.class);
controller.applyWorkflow(item, folder, workflowTemplateId); if (workflowTemplateId != null) {
controller.applyWorkflow(item, folder, workflowTemplateId);
}
// final WorkflowTemplate template; // final WorkflowTemplate template;
// //
@ -268,7 +270,6 @@ public class ApplyWorkflowFormSection
// } // }
// } // }
// } // }
} }
private class ApplyWorkflowPrintListener private class ApplyWorkflowPrintListener

View File

@ -124,6 +124,7 @@ public class SimpleEditStep extends SecurityPropertyEditor
* component may use the wizard's methods, such as * component may use the wizard's methods, such as
* stepForward and stepBack, in its process * stepForward and stepBack, in its process
* listener. * listener.
* @param selectedLanguageParam
* *
* @param parameterSuffix Additional global parameter name suffix if * @param parameterSuffix Additional global parameter name suffix if
* there are multiple SimpleEditStep instances in * there are multiple SimpleEditStep instances in

View File

@ -75,9 +75,10 @@ public class ItemTemplates extends SecurityPropertyEditor {
// ToDo // ToDo
// ItemTemplatesListingImpl l = new ItemTemplatesListingImpl(model); // ItemTemplatesListingImpl l = new ItemTemplatesListingImpl(model);
// //
// final LayoutPanel layout = new LayoutPanel(); final LayoutPanel layout = new LayoutPanel();
// setDisplayComponent(layout); setDisplayComponent(layout);
//
// ToDo
// SegmentedPanel st = new SegmentedPanel(); // SegmentedPanel st = new SegmentedPanel();
// layout.setBody(st); // layout.setBody(st);
// //

View File

@ -18,6 +18,7 @@
*/ */
package org.librecms.contenttypes; package org.librecms.contenttypes;
import com.arsdigita.cms.contenttypes.ui.EventPropertiesStep;
import com.arsdigita.cms.ui.contenttypes.EventCreateForm; import com.arsdigita.cms.ui.contenttypes.EventCreateForm;
import java.io.Serializable; import java.io.Serializable;
@ -53,8 +54,18 @@ import static org.librecms.CmsConstants.*;
@Table(name = "EVENTS", schema = DB_SCHEMA) @Table(name = "EVENTS", schema = DB_SCHEMA)
@ContentTypeDescription(labelBundle = "org.librecms.contenttypes.Event", @ContentTypeDescription(labelBundle = "org.librecms.contenttypes.Event",
descriptionBundle = "org.librecms.contenttypes.Event") descriptionBundle = "org.librecms.contenttypes.Event")
@AuthoringKit(createComponent = EventCreateForm.class, @AuthoringKit(
steps = {}) createComponent = EventCreateForm.class,
steps = {
@AuthoringStep(
component = EventPropertiesStep.class,
labelBundle = "org.librecms.CmsResources",
labelKey = "cms.contenttypes.shared.basic_properties.title",
descriptionBundle = "org.librecms.CmsResources",
descriptionKey = "cms.contenttypes.shared.basic_properties"
+ ".description",
order = 1)
})
public class Event extends ContentItem implements Serializable { public class Event extends ContentItem implements Serializable {
private static final long serialVersionUID = -9104886733503414635L; private static final long serialVersionUID = -9104886733503414635L;

View File

@ -19,6 +19,8 @@
package org.librecms.contenttypes; package org.librecms.contenttypes;
import com.arsdigita.cms.contenttypes.ui.mparticle.MultiPartArticleCreateForm; import com.arsdigita.cms.contenttypes.ui.mparticle.MultiPartArticleCreateForm;
import com.arsdigita.cms.contenttypes.ui.mparticle.MultiPartArticleEdit;
import org.hibernate.envers.Audited; import org.hibernate.envers.Audited;
import org.libreccm.l10n.LocalizedString; import org.libreccm.l10n.LocalizedString;
import org.librecms.contentsection.ContentItem; import org.librecms.contentsection.ContentItem;
@ -46,10 +48,22 @@ import static org.librecms.CmsConstants.*;
@Entity @Entity
@Audited @Audited
@Table(name = "MULTIPART_ARTICLES", schema = DB_SCHEMA) @Table(name = "MULTIPART_ARTICLES", schema = DB_SCHEMA)
@ContentTypeDescription(labelBundle = "org.librecms.contenttypes.MultiPartArticle", @ContentTypeDescription(labelBundle
descriptionBundle = "org.librecms.contenttypes.MultiPartArticle") = "org.librecms.contenttypes.MultiPartArticle",
@AuthoringKit(createComponent = MultiPartArticleCreateForm.class, descriptionBundle
steps = {}) = "org.librecms.contenttypes.MultiPartArticle")
@AuthoringKit(
createComponent = MultiPartArticleCreateForm.class,
steps = {
@AuthoringStep(
component = MultiPartArticleEdit.class,
labelBundle = "org.librecms.CmsResources",
labelKey = "cms.contenttypes.shared.basic_properties.title",
descriptionBundle = "org.librecms.CmsResources",
descriptionKey = "cms.contenttypes.shared.basic_properties"
+ ".description",
order = 1)
})
public class MultiPartArticle extends ContentItem implements Serializable { public class MultiPartArticle extends ContentItem implements Serializable {
private static final long serialVersionUID = -587374085831420868L; private static final long serialVersionUID = -587374085831420868L;

View File

@ -18,6 +18,7 @@
*/ */
package org.librecms.contenttypes; package org.librecms.contenttypes;
import com.arsdigita.cms.contenttypes.ui.NewsPropertiesStep;
import com.arsdigita.cms.ui.contenttypes.NewsCreateForm; import com.arsdigita.cms.ui.contenttypes.NewsCreateForm;
import org.hibernate.envers.Audited; import org.hibernate.envers.Audited;
@ -50,8 +51,18 @@ import static org.librecms.CmsConstants.*;
@Table(name = "NEWS", schema = DB_SCHEMA) @Table(name = "NEWS", schema = DB_SCHEMA)
@ContentTypeDescription(labelBundle = "org.librecms.contenttypes.News", @ContentTypeDescription(labelBundle = "org.librecms.contenttypes.News",
descriptionBundle = "org.librecms.contenttypes.News") descriptionBundle = "org.librecms.contenttypes.News")
@AuthoringKit(createComponent = NewsCreateForm.class, @AuthoringKit(
steps = {}) createComponent = NewsCreateForm.class,
steps = {
@AuthoringStep(
component = NewsPropertiesStep.class,
labelBundle = "org.librecms.CmsResources",
labelKey = "cms.contenttypes.shared.basic_properties.title",
descriptionBundle = "org.librecms.CmsResources",
descriptionKey = "cms.contenttypes.shared.basic_properties"
+ ".description",
order = 1)
})
public class News extends ContentItem implements Serializable { public class News extends ContentItem implements Serializable {
private static final long serialVersionUID = -4939565845920227974L; private static final long serialVersionUID = -4939565845920227974L;
@ -61,12 +72,12 @@ public class News extends ContentItem implements Serializable {
*/ */
@Embedded @Embedded
@AssociationOverride( @AssociationOverride(
name = "values", name = "values",
joinTable = @JoinTable(name = "NEWS_TEXTS", joinTable = @JoinTable(name = "NEWS_TEXTS",
schema = DB_SCHEMA, schema = DB_SCHEMA,
joinColumns = { joinColumns = {
@JoinColumn(name = "OBJECT_ID")} @JoinColumn(name = "OBJECT_ID")}
)) ))
private LocalizedString text; private LocalizedString text;
/** /**
@ -152,11 +163,12 @@ public class News extends ContentItem implements Serializable {
@Override @Override
public String toString(final String data) { public String toString(final String data) {
return super.toString(String.format(", text = %s, " return super.toString(String.format(", text = %s, "
+ "releaseDate = %tF %<tT, " + "releaseDate = %tF %<tT, "
+ "homepage = %b%s", + "homepage = %b%s",
Objects.toString(text), Objects.toString(text),
releaseDate, releaseDate,
homepage, homepage,
data)); data));
} }
} }

View File

@ -193,8 +193,8 @@
</plugin> </plugin>
<plugin> <plugin>
<groupId>de.jpdigital</groupId> <groupId>de.jpdigital</groupId>
<artifactId>hibernate5-ddl-maven-plugin</artifactId> <artifactId>hibernate50-ddl-maven-plugin</artifactId>
<version>1.0.1-hibernate-5.2.4.Final</version> <version>2.0.4</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.jacoco</groupId> <groupId>org.jacoco</groupId>