CCM NG/ccm-cms: Added an order field for AttachmentList to order multiple AttachmentLists with the same name.
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4390 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
dded522313
commit
98b59e8f1f
|
|
@ -45,11 +45,11 @@ import javax.persistence.Table;
|
||||||
import static org.librecms.CmsConstants.*;
|
import static org.librecms.CmsConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A list of assets attached a {@link ContentItem}. Each {@link ContentItem}
|
* A list of assets attached a {@link ContentItem}. Each {@link ContentItem} may
|
||||||
* may have multiple lists of attachments. Each list can be identified by name
|
* have multiple lists of attachments. Each list can be identified by name which
|
||||||
* which can be used for example by the theme to determine the position where
|
* can be used for example by the theme to determine the position where the list
|
||||||
* the list is printed.
|
* is printed.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
|
@ -58,7 +58,7 @@ import static org.librecms.CmsConstants.*;
|
||||||
public class AttachmentList implements Identifiable, Serializable {
|
public class AttachmentList implements Identifiable, Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7931234562247075541L;
|
private static final long serialVersionUID = -7931234562247075541L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database ID of the list entity.
|
* Database ID of the list entity.
|
||||||
*/
|
*/
|
||||||
|
|
@ -86,6 +86,13 @@ public class AttachmentList implements Identifiable, Serializable {
|
||||||
@Column(name = "NAME")
|
@Column(name = "NAME")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A order index for ordering multiple attachment lists with the same
|
||||||
|
* {@link #name}.
|
||||||
|
*/
|
||||||
|
@Column(name = "LIST_ORDER")
|
||||||
|
private long order;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The localised title of the list.
|
* The localised title of the list.
|
||||||
*/
|
*/
|
||||||
|
|
@ -150,6 +157,14 @@ public class AttachmentList implements Identifiable, Serializable {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getOrder() {
|
||||||
|
return order;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrder(final long order) {
|
||||||
|
this.order = order;
|
||||||
|
}
|
||||||
|
|
||||||
public LocalizedString getTitle() {
|
public LocalizedString getTitle() {
|
||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
@ -192,6 +207,7 @@ public class AttachmentList implements Identifiable, Serializable {
|
||||||
hash = 29 * hash + (int) (listId ^ (listId >>> 32));
|
hash = 29 * hash + (int) (listId ^ (listId >>> 32));
|
||||||
hash = 29 * hash + Objects.hashCode(uuid);
|
hash = 29 * hash + Objects.hashCode(uuid);
|
||||||
hash = 29 * hash + Objects.hashCode(name);
|
hash = 29 * hash + Objects.hashCode(name);
|
||||||
|
hash = 29 * hash + (int) (order ^ (order >>> 32));
|
||||||
hash = 29 * hash + Objects.hashCode(title);
|
hash = 29 * hash + Objects.hashCode(title);
|
||||||
hash = 29 * hash + Objects.hashCode(description);
|
hash = 29 * hash + Objects.hashCode(description);
|
||||||
hash = 29 * hash + Objects.hashCode(attachments);
|
hash = 29 * hash + Objects.hashCode(attachments);
|
||||||
|
|
@ -201,7 +217,7 @@ public class AttachmentList implements Identifiable, Serializable {
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
|
|
@ -224,6 +240,9 @@ public class AttachmentList implements Identifiable, Serializable {
|
||||||
System.out.println("uuid is not equal");
|
System.out.println("uuid is not equal");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (order != other.getOrder()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (!Objects.equals(name, other.getName())) {
|
if (!Objects.equals(name, other.getName())) {
|
||||||
System.out.println("name is not equal");
|
System.out.println("name is not equal");
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -236,7 +255,7 @@ public class AttachmentList implements Identifiable, Serializable {
|
||||||
System.out.println("description is not equal");
|
System.out.println("description is not equal");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
System.out.printf("attachments{%s}.equals({%s}) = %b\n",
|
System.out.printf("attachments{%s}.equals({%s}) = %b\n",
|
||||||
Objects.toString(attachments),
|
Objects.toString(attachments),
|
||||||
Objects.toString(other.getAttachments()),
|
Objects.toString(other.getAttachments()),
|
||||||
Objects.equals(attachments, other.getAttachments()));
|
Objects.equals(attachments, other.getAttachments()));
|
||||||
|
|
@ -257,6 +276,7 @@ public class AttachmentList implements Identifiable, Serializable {
|
||||||
+ "listId = %d, "
|
+ "listId = %d, "
|
||||||
+ "uuid = %s, "
|
+ "uuid = %s, "
|
||||||
+ "name = \"%s\", "
|
+ "name = \"%s\", "
|
||||||
|
+ "order = %d, "
|
||||||
+ "caption = { %s }, "
|
+ "caption = { %s }, "
|
||||||
+ "description = { %s }, "
|
+ "description = { %s }, "
|
||||||
+ "attachments = { %s }%s"
|
+ "attachments = { %s }%s"
|
||||||
|
|
@ -265,6 +285,7 @@ public class AttachmentList implements Identifiable, Serializable {
|
||||||
listId,
|
listId,
|
||||||
uuid,
|
uuid,
|
||||||
name,
|
name,
|
||||||
|
order,
|
||||||
Objects.toString(title),
|
Objects.toString(title),
|
||||||
Objects.toString(description),
|
Objects.toString(description),
|
||||||
Objects.toString(attachments),
|
Objects.toString(attachments),
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,9 @@ alter table CCM_CMS.ATTACHMENT_LISTS
|
||||||
alter table CCM_CMS.ATTACHMENT_LISTS
|
alter table CCM_CMS.ATTACHMENT_LISTS
|
||||||
add column ITEM_ID bigint;
|
add column ITEM_ID bigint;
|
||||||
|
|
||||||
|
alter table CCM_CMS.ATTACHMENT_LISTS
|
||||||
|
add column LIST_ORDER bigint;
|
||||||
|
|
||||||
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
||||||
drop column ASSET_TYPE;
|
drop column ASSET_TYPE;
|
||||||
|
|
||||||
|
|
@ -132,6 +135,9 @@ alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
||||||
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
||||||
add column ITEM_ID bigint;
|
add column ITEM_ID bigint;
|
||||||
|
|
||||||
|
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
||||||
|
add column LIST_ORDER bigint;
|
||||||
|
|
||||||
alter table CCM_CMS.AUDIO_ASSETS
|
alter table CCM_CMS.AUDIO_ASSETS
|
||||||
drop constraint FKa1m18ejmeknjiibvh2dac6tas;
|
drop constraint FKa1m18ejmeknjiibvh2dac6tas;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,9 @@ alter table CCM_CMS.ATTACHMENT_LISTS
|
||||||
alter table CCM_CMS.ATTACHMENT_LISTS
|
alter table CCM_CMS.ATTACHMENT_LISTS
|
||||||
add column ITEM_ID int8;
|
add column ITEM_ID int8;
|
||||||
|
|
||||||
|
alter table CCM_CMS.ATTACHMENT_LISTS
|
||||||
|
add column LIST_ORDER int8;
|
||||||
|
|
||||||
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
||||||
drop column ASSET_TYPE;
|
drop column ASSET_TYPE;
|
||||||
|
|
||||||
|
|
@ -132,6 +135,9 @@ alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
||||||
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
||||||
add column ITEM_ID int8;
|
add column ITEM_ID int8;
|
||||||
|
|
||||||
|
alter table CCM_CMS.ATTACHMENT_LISTS_AUD
|
||||||
|
add column LIST_ORDER int8;
|
||||||
|
|
||||||
alter table CCM_CMS.AUDIO_ASSETS
|
alter table CCM_CMS.AUDIO_ASSETS
|
||||||
drop constraint FKa1m18ejmeknjiibvh2dac6tas;
|
drop constraint FKa1m18ejmeknjiibvh2dac6tas;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ DROP SEQUENCE IF EXISTS hibernate_sequence;
|
||||||
CREATE SCHEMA ccm_core;
|
CREATE SCHEMA ccm_core;
|
||||||
CREATE SCHEMA ccm_cms;
|
CREATE SCHEMA ccm_cms;
|
||||||
|
|
||||||
create table CCM_CMS.ARTICLE_LEADS (
|
create table CCM_CMS.ARTICLE_LEADS (
|
||||||
OBJECT_ID bigint not null,
|
OBJECT_ID bigint not null,
|
||||||
LOCALIZED_VALUE longvarchar,
|
LOCALIZED_VALUE longvarchar,
|
||||||
LOCALE varchar(255) not null,
|
LOCALE varchar(255) not null,
|
||||||
|
|
@ -106,6 +106,7 @@ create table CCM_CMS.ARTICLE_LEADS (
|
||||||
create table CCM_CMS.ATTACHMENT_LISTS (
|
create table CCM_CMS.ATTACHMENT_LISTS (
|
||||||
LIST_ID bigint not null,
|
LIST_ID bigint not null,
|
||||||
NAME varchar(255),
|
NAME varchar(255),
|
||||||
|
LIST_ORDER bigint,
|
||||||
UUID varchar(255),
|
UUID varchar(255),
|
||||||
ITEM_ID bigint,
|
ITEM_ID bigint,
|
||||||
CONTENT_ITEM_ID bigint,
|
CONTENT_ITEM_ID bigint,
|
||||||
|
|
@ -118,6 +119,7 @@ create table CCM_CMS.ARTICLE_LEADS (
|
||||||
REVTYPE tinyint,
|
REVTYPE tinyint,
|
||||||
REVEND integer,
|
REVEND integer,
|
||||||
NAME varchar(255),
|
NAME varchar(255),
|
||||||
|
LIST_ORDER bigint,
|
||||||
UUID varchar(255),
|
UUID varchar(255),
|
||||||
ITEM_ID bigint,
|
ITEM_ID bigint,
|
||||||
primary key (LIST_ID, REV)
|
primary key (LIST_ID, REV)
|
||||||
|
|
@ -1381,10 +1383,10 @@ create table CCM_CMS.ARTICLE_LEADS (
|
||||||
CONFIGURATION_CLASS varchar(512) not null,
|
CONFIGURATION_CLASS varchar(512) not null,
|
||||||
NAME varchar(512) not null,
|
NAME varchar(512) not null,
|
||||||
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
|
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
|
||||||
SETTING_VALUE_LONG bigint,
|
|
||||||
SETTING_VALUE_BOOLEAN boolean,
|
|
||||||
SETTING_VALUE_STRING varchar(1024),
|
SETTING_VALUE_STRING varchar(1024),
|
||||||
SETTING_VALUE_DOUBLE double,
|
SETTING_VALUE_DOUBLE double,
|
||||||
|
SETTING_VALUE_BOOLEAN boolean,
|
||||||
|
SETTING_VALUE_LONG bigint,
|
||||||
primary key (SETTING_ID)
|
primary key (SETTING_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@ DROP SEQUENCE IF EXISTS hibernate_sequence;
|
||||||
CREATE SCHEMA ccm_core;
|
CREATE SCHEMA ccm_core;
|
||||||
CREATE SCHEMA ccm_cms;
|
CREATE SCHEMA ccm_cms;
|
||||||
|
|
||||||
create table CCM_CMS.ARTICLE_LEADS (
|
|
||||||
|
create table CCM_CMS.ARTICLE_LEADS (
|
||||||
OBJECT_ID int8 not null,
|
OBJECT_ID int8 not null,
|
||||||
LOCALIZED_VALUE text,
|
LOCALIZED_VALUE text,
|
||||||
LOCALE varchar(255) not null,
|
LOCALE varchar(255) not null,
|
||||||
|
|
@ -106,6 +107,7 @@ create table CCM_CMS.ARTICLE_LEADS (
|
||||||
create table CCM_CMS.ATTACHMENT_LISTS (
|
create table CCM_CMS.ATTACHMENT_LISTS (
|
||||||
LIST_ID int8 not null,
|
LIST_ID int8 not null,
|
||||||
NAME varchar(255),
|
NAME varchar(255),
|
||||||
|
LIST_ORDER int8,
|
||||||
UUID varchar(255),
|
UUID varchar(255),
|
||||||
ITEM_ID int8,
|
ITEM_ID int8,
|
||||||
CONTENT_ITEM_ID int8,
|
CONTENT_ITEM_ID int8,
|
||||||
|
|
@ -118,6 +120,7 @@ create table CCM_CMS.ARTICLE_LEADS (
|
||||||
REVTYPE int2,
|
REVTYPE int2,
|
||||||
REVEND int4,
|
REVEND int4,
|
||||||
NAME varchar(255),
|
NAME varchar(255),
|
||||||
|
LIST_ORDER int8,
|
||||||
UUID varchar(255),
|
UUID varchar(255),
|
||||||
ITEM_ID int8,
|
ITEM_ID int8,
|
||||||
primary key (LIST_ID, REV)
|
primary key (LIST_ID, REV)
|
||||||
|
|
@ -1381,10 +1384,10 @@ create table CCM_CMS.ARTICLE_LEADS (
|
||||||
CONFIGURATION_CLASS varchar(512) not null,
|
CONFIGURATION_CLASS varchar(512) not null,
|
||||||
NAME varchar(512) not null,
|
NAME varchar(512) not null,
|
||||||
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
|
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
|
||||||
SETTING_VALUE_LONG int8,
|
|
||||||
SETTING_VALUE_BOOLEAN boolean,
|
|
||||||
SETTING_VALUE_STRING varchar(1024),
|
SETTING_VALUE_STRING varchar(1024),
|
||||||
SETTING_VALUE_DOUBLE float8,
|
SETTING_VALUE_DOUBLE float8,
|
||||||
|
SETTING_VALUE_BOOLEAN boolean,
|
||||||
|
SETTING_VALUE_LONG int8,
|
||||||
primary key (SETTING_ID)
|
primary key (SETTING_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ DROP SEQUENCE IF EXISTS hibernate_sequence;
|
||||||
CREATE SCHEMA ccm_core;
|
CREATE SCHEMA ccm_core;
|
||||||
CREATE SCHEMA ccm_cms;
|
CREATE SCHEMA ccm_cms;
|
||||||
|
|
||||||
create table CCM_CMS.ARTICLE_LEADS (
|
create table CCM_CMS.ARTICLE_LEADS (
|
||||||
OBJECT_ID bigint not null,
|
OBJECT_ID bigint not null,
|
||||||
LOCALIZED_VALUE longvarchar,
|
LOCALIZED_VALUE longvarchar,
|
||||||
LOCALE varchar(255) not null,
|
LOCALE varchar(255) not null,
|
||||||
|
|
@ -106,6 +106,7 @@ create table CCM_CMS.ARTICLE_LEADS (
|
||||||
create table CCM_CMS.ATTACHMENT_LISTS (
|
create table CCM_CMS.ATTACHMENT_LISTS (
|
||||||
LIST_ID bigint not null,
|
LIST_ID bigint not null,
|
||||||
NAME varchar(255),
|
NAME varchar(255),
|
||||||
|
LIST_ORDER bigint,
|
||||||
UUID varchar(255),
|
UUID varchar(255),
|
||||||
ITEM_ID bigint,
|
ITEM_ID bigint,
|
||||||
CONTENT_ITEM_ID bigint,
|
CONTENT_ITEM_ID bigint,
|
||||||
|
|
@ -118,6 +119,7 @@ create table CCM_CMS.ARTICLE_LEADS (
|
||||||
REVTYPE tinyint,
|
REVTYPE tinyint,
|
||||||
REVEND integer,
|
REVEND integer,
|
||||||
NAME varchar(255),
|
NAME varchar(255),
|
||||||
|
LIST_ORDER bigint,
|
||||||
UUID varchar(255),
|
UUID varchar(255),
|
||||||
ITEM_ID bigint,
|
ITEM_ID bigint,
|
||||||
primary key (LIST_ID, REV)
|
primary key (LIST_ID, REV)
|
||||||
|
|
@ -1381,10 +1383,10 @@ create table CCM_CMS.ARTICLE_LEADS (
|
||||||
CONFIGURATION_CLASS varchar(512) not null,
|
CONFIGURATION_CLASS varchar(512) not null,
|
||||||
NAME varchar(512) not null,
|
NAME varchar(512) not null,
|
||||||
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
|
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
|
||||||
SETTING_VALUE_LONG bigint,
|
|
||||||
SETTING_VALUE_BOOLEAN boolean,
|
|
||||||
SETTING_VALUE_STRING varchar(1024),
|
SETTING_VALUE_STRING varchar(1024),
|
||||||
SETTING_VALUE_DOUBLE double,
|
SETTING_VALUE_DOUBLE double,
|
||||||
|
SETTING_VALUE_BOOLEAN boolean,
|
||||||
|
SETTING_VALUE_LONG bigint,
|
||||||
primary key (SETTING_ID)
|
primary key (SETTING_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue