Some code formatting
parent
470b1628e9
commit
26429cfda3
|
|
@ -51,10 +51,10 @@ 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
|
@ContentTypeDescription(
|
||||||
= "org.librecms.contenttypes.MultiPartArticle",
|
labelBundle = "org.librecms.contenttypes.MultiPartArticle",
|
||||||
descriptionBundle
|
descriptionBundle = "org.librecms.contenttypes.MultiPartArticle"
|
||||||
= "org.librecms.contenttypes.MultiPartArticle")
|
)
|
||||||
@AuthoringKit(
|
@AuthoringKit(
|
||||||
createComponent = MultiPartArticleCreateForm.class,
|
createComponent = MultiPartArticleCreateForm.class,
|
||||||
steps = {
|
steps = {
|
||||||
|
|
@ -65,16 +65,18 @@ import static org.librecms.CmsConstants.*;
|
||||||
descriptionBundle = CmsConstants.CMS_BUNDLE,
|
descriptionBundle = CmsConstants.CMS_BUNDLE,
|
||||||
descriptionKey = "cms.contenttypes.shared.basic_properties"
|
descriptionKey = "cms.contenttypes.shared.basic_properties"
|
||||||
+ ".description",
|
+ ".description",
|
||||||
order = 1)
|
order = 1
|
||||||
,
|
),
|
||||||
@AuthoringStep(
|
@AuthoringStep(
|
||||||
component = MultiPartArticleSectionsStep.class,
|
component = MultiPartArticleSectionsStep.class,
|
||||||
labelBundle = CmsConstants.CMS_BUNDLE,
|
labelBundle = CmsConstants.CMS_BUNDLE,
|
||||||
labelKey = "cms.contenttypes.shared.body_text.title",
|
labelKey = "cms.contenttypes.shared.body_text.title",
|
||||||
descriptionBundle = CmsConstants.CMS_BUNDLE,
|
descriptionBundle = CmsConstants.CMS_BUNDLE,
|
||||||
descriptionKey = "mparticle.authoring.body_text.description",
|
descriptionKey = "mparticle.authoring.body_text.description",
|
||||||
order = 2)
|
order = 2
|
||||||
})
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
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;
|
||||||
|
|
@ -82,11 +84,14 @@ public class MultiPartArticle extends ContentItem implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "MPA_SUMMARIES",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "MPA_SUMMARIES",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
joinColumns = {
|
||||||
))
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
private LocalizedString summary = new LocalizedString();
|
private LocalizedString summary = new LocalizedString();
|
||||||
|
|
||||||
@OneToMany
|
@OneToMany
|
||||||
|
|
@ -170,9 +175,13 @@ public class MultiPartArticle extends ContentItem implements Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString(final String data) {
|
public String toString(final String data) {
|
||||||
return super.toString(String.format(", summary = %s%s",
|
return super.toString(
|
||||||
Objects.toString(summary),
|
String.format(
|
||||||
data));
|
", summary = %s%s",
|
||||||
|
Objects.toString(summary),
|
||||||
|
data
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,12 +51,13 @@ import static org.librecms.CmsConstants.*;
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "MultiPartArticleSection.findById",
|
name = "MultiPartArticleSection.findById",
|
||||||
query = "SELECT s FROM MultiPartArticleSection s "
|
query = "SELECT s FROM MultiPartArticleSection s "
|
||||||
+ "WHERE s.sectionId = :sectionId")
|
+ "WHERE s.sectionId = :sectionId"
|
||||||
,
|
),
|
||||||
@NamedQuery(
|
@NamedQuery(
|
||||||
name = "MultiPartArticleSection.findArticleOfSection",
|
name = "MultiPartArticleSection.findArticleOfSection",
|
||||||
query = "SELECT a FROM MultiPartArticle a "
|
query = "SELECT a FROM MultiPartArticle a "
|
||||||
+ "WHERE :section MEMBER OF a.sections")
|
+ "WHERE :section MEMBER OF a.sections"
|
||||||
|
)
|
||||||
})
|
})
|
||||||
public class MultiPartArticleSection implements Serializable {
|
public class MultiPartArticleSection implements Serializable {
|
||||||
|
|
||||||
|
|
@ -70,11 +71,14 @@ public class MultiPartArticleSection implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "MPA_SECTION_TITLES",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "MPA_SECTION_TITLES",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
joinColumns = {
|
||||||
))
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
private LocalizedString title;
|
private LocalizedString title;
|
||||||
|
|
||||||
@Column(name = "RANK")
|
@Column(name = "RANK")
|
||||||
|
|
@ -86,11 +90,14 @@ public class MultiPartArticleSection implements Serializable {
|
||||||
@Embedded
|
@Embedded
|
||||||
@AssociationOverride(
|
@AssociationOverride(
|
||||||
name = "values",
|
name = "values",
|
||||||
joinTable = @JoinTable(name = "MPA_SECTION_TEXTS",
|
joinTable = @JoinTable(
|
||||||
schema = DB_SCHEMA,
|
name = "MPA_SECTION_TEXTS",
|
||||||
joinColumns = {
|
schema = DB_SCHEMA,
|
||||||
@JoinColumn(name = "OBJECT_ID")}
|
joinColumns = {
|
||||||
))
|
@JoinColumn(name = "OBJECT_ID")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
private LocalizedString text;
|
private LocalizedString text;
|
||||||
|
|
||||||
public MultiPartArticleSection() {
|
public MultiPartArticleSection() {
|
||||||
|
|
@ -189,18 +196,19 @@ public class MultiPartArticleSection implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString(final String data) {
|
public String toString(final String data) {
|
||||||
return String.format("%s{ "
|
return String.format(
|
||||||
+ "title = %s, "
|
"%s{ "
|
||||||
+ "rank = %d,"
|
+ "title = %s, "
|
||||||
+ "pageBreak = %b, "
|
+ "rank = %d,"
|
||||||
+ "text = %s%d"
|
+ "pageBreak = %b, "
|
||||||
+ " }",
|
+ "text = %s%d"
|
||||||
super.toString(),
|
+ " }",
|
||||||
title,
|
super.toString(),
|
||||||
rank,
|
title,
|
||||||
pageBreak,
|
rank,
|
||||||
text,
|
pageBreak,
|
||||||
data
|
text,
|
||||||
|
data
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue