CCM NG: ContentItemRepository
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4214 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
613205fe39
commit
6876f4f1be
|
|
@ -38,6 +38,8 @@ import javax.persistence.EnumType;
|
|||
import javax.persistence.Enumerated;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
|
|
@ -54,6 +56,16 @@ import static org.librecms.CmsConstants.*;
|
|||
@Entity
|
||||
@Audited
|
||||
@Table(name = "CONTENT_ITEMS", schema = DB_SCHEMA)
|
||||
@NamedQueries({
|
||||
@NamedQuery(
|
||||
name = "ContentItem.findByType",
|
||||
query = "SELECT i FROM ContentItem i WHERE TYPE(I) = :type"),
|
||||
@NamedQuery(
|
||||
name = "ContentItem.findByFolder",
|
||||
query = "SELECT i FROM ContentItem i "
|
||||
+ "WHERE :folder MEMBER OF i.categories"
|
||||
)
|
||||
})
|
||||
public class ContentItem extends CcmObject implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5897287630227129653L;
|
||||
|
|
@ -80,6 +92,7 @@ public class ContentItem extends CcmObject implements Serializable {
|
|||
* The content type associated with the content item.
|
||||
*/
|
||||
@OneToOne
|
||||
@JoinColumn(name = "CONTENT_TYPE_ID")
|
||||
@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
|
||||
private ContentType contentType;
|
||||
|
||||
|
|
@ -114,12 +127,14 @@ public class ContentItem extends CcmObject implements Serializable {
|
|||
/**
|
||||
* The version/publishing state of the content item.
|
||||
*/
|
||||
@Column(name = "VERSION")
|
||||
@Enumerated(EnumType.STRING)
|
||||
private ContentItemVersion version;
|
||||
|
||||
/**
|
||||
* The launch date of the content item (date when the item is made public)
|
||||
*/
|
||||
@Column(name = "LAUNCH_DATE")
|
||||
@Temporal(TemporalType.DATE)
|
||||
private Date launchDate;
|
||||
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ import org.libreccm.auditing.AbstractAuditedEntityRepository;
|
|||
import org.libreccm.categorization.Category;
|
||||
import org.libreccm.core.CcmObject;
|
||||
import org.libreccm.core.CcmObjectRepository;
|
||||
import org.librecms.contenttypes.Article;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.persistence.TypedQuery;
|
||||
|
||||
/**
|
||||
* Repository for content items.
|
||||
|
|
@ -108,36 +108,49 @@ public class ContentItemRepository
|
|||
}
|
||||
|
||||
/**
|
||||
* Finds a content item by its UUID and ensures that is a the requested type.
|
||||
* Finds a content item by its UUID and ensures that is a the requested
|
||||
* type.
|
||||
*
|
||||
* @param <T> The type of the content item.
|
||||
* @param <T> The type of the content item.
|
||||
* @param uuid The UUID of item to retrieve.
|
||||
* @param type The type of the content item.
|
||||
* @param type The type of the content item.
|
||||
*
|
||||
* @return The content item identified by the provided UUID or an empty
|
||||
* {@link Optional} if there is no such item or if it is not of the
|
||||
* requested type.
|
||||
*/
|
||||
public <T extends ContentItem> T findByUuid(final String uuid,
|
||||
final Class<T> type) {
|
||||
throw new UnsupportedOperationException();
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends ContentItem> Optional<T> findByUuid(final String uuid,
|
||||
final Class<T> type) {
|
||||
final CcmObject result = ccmObjectRepo.findObjectByUuid(uuid);
|
||||
|
||||
if (result.getClass().isAssignableFrom(type)) {
|
||||
return Optional.of((T)result);
|
||||
} else {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all content items of a specific type.
|
||||
*
|
||||
* @param <T> The type of the items.
|
||||
*
|
||||
* @param <T> The type of the items.
|
||||
* @param type The type of the items.
|
||||
*
|
||||
* @return A list of all content items of the requested type.
|
||||
*/
|
||||
public <T extends ContentItem> List<T> findByType(final Class<T> type) {
|
||||
throw new UnsupportedOperationException();
|
||||
final TypedQuery<T> query = getEntityManager().createNamedQuery(
|
||||
"ContentItem.findByType", type);
|
||||
query.setParameter("type", type);
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all content items in the provided folder.
|
||||
*
|
||||
*
|
||||
* @param folder The folder.
|
||||
*
|
||||
* @return A list of all items in the provided folder.
|
||||
*/
|
||||
public List<ContentItem> findByFolder(final Category folder) {
|
||||
|
|
|
|||
|
|
@ -93,8 +93,9 @@ public class ContentType extends CcmObject implements Serializable {
|
|||
@Column(name = "DESCENDANTS", length = 1024)
|
||||
private String descendants;
|
||||
|
||||
@Column(name = "TYPE_MODE")
|
||||
@Enumerated(EnumType.STRING)
|
||||
private ContentItemMode mode;
|
||||
private ContentTypeMode mode;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "DEFAULT_LIFECYCLE_ID")
|
||||
|
|
@ -152,11 +153,11 @@ public class ContentType extends CcmObject implements Serializable {
|
|||
this.descendants = descendants;
|
||||
}
|
||||
|
||||
public ContentItemMode getMode() {
|
||||
public ContentTypeMode getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
public void setMode(final ContentItemMode mode) {
|
||||
public void setMode(final ContentTypeMode mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ package org.librecms.contentsection;
|
|||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
public enum ContentItemMode {
|
||||
public enum ContentTypeMode {
|
||||
|
||||
DEFAULT,
|
||||
INTERNAL,
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
alter column launchDate rename to LAUNCH_DATE;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
alter column version rename to VERSION;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
alter column contentType_OBJECT_ID rename to CONTENT_TYPE_ID;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS_AUD
|
||||
alter column launchDate rename to LAUNCH_DATE;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
alter column version rename to VERSION;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
alter column contentType_OBJECT_ID rename to CONTENT_TYPE_ID;
|
||||
|
||||
alter table CCM_CMS.CONTENT_TYPES
|
||||
alter column mode rename to TYPE_MODE;
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
rename column launchDate to LAUNCH_DATE;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
rename column version to VERSION;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
rename column contentType_OBJECT_ID to CONTENT_TYPE_ID;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS_AUD
|
||||
rename column launchDate to LAUNCH_DATE;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
rename column version to VERSION;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
rename column contentType_OBJECT_ID to CONTENT_TYPE_ID;
|
||||
|
||||
alter table CCM_CMS.CONTENT_TYPES
|
||||
rename column mode to TYPE_MODE;
|
||||
|
||||
|
|
@ -0,0 +1,244 @@
|
|||
/*
|
||||
* Copyright (C) 2016 LibreCCM Foundation.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
package org.librecms.contentsection;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.Deployment;
|
||||
import org.jboss.arquillian.junit.Arquillian;
|
||||
import org.jboss.arquillian.junit.InSequence;
|
||||
import org.jboss.arquillian.persistence.CreateSchema;
|
||||
import org.jboss.arquillian.persistence.PersistenceTest;
|
||||
import org.jboss.arquillian.persistence.UsingDataSet;
|
||||
import org.jboss.arquillian.transaction.api.annotation.TransactionMode;
|
||||
import org.jboss.arquillian.transaction.api.annotation.Transactional;
|
||||
import org.jboss.shrinkwrap.api.ShrinkWrap;
|
||||
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
|
||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
||||
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
||||
import org.jboss.shrinkwrap.resolver.api.maven.ScopeType;
|
||||
import org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenDependencies;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.libreccm.categorization.Category;
|
||||
import org.libreccm.categorization.CategoryRepository;
|
||||
import org.libreccm.tests.categories.IntegrationTest;
|
||||
import org.librecms.contenttypes.Article;
|
||||
import org.librecms.contenttypes.News;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||
*/
|
||||
@org.junit.experimental.categories.Category(IntegrationTest.class)
|
||||
@RunWith(Arquillian.class)
|
||||
@PersistenceTest
|
||||
@Transactional(TransactionMode.COMMIT)
|
||||
@CreateSchema({"create_ccm_cms_schema.sql"})
|
||||
public class ContentItemRepositoryTest {
|
||||
|
||||
@Inject
|
||||
private ContentItemRepository itemRepo;
|
||||
|
||||
@Inject
|
||||
private CategoryRepository categoryRepo;
|
||||
|
||||
public ContentItemRepositoryTest() {
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass() {
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() {
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
}
|
||||
|
||||
@Deployment
|
||||
public static WebArchive createDeployment() {
|
||||
final PomEquippedResolveStage pom = Maven
|
||||
.resolver()
|
||||
.loadPomFromFile("pom.xml");
|
||||
final PomEquippedResolveStage dependencies = pom
|
||||
.importCompileAndRuntimeDependencies();
|
||||
dependencies.addDependency(MavenDependencies.createDependency(
|
||||
"org.libreccm:ccm-core", ScopeType.RUNTIME, false));
|
||||
dependencies.addDependency(MavenDependencies.createDependency(
|
||||
"org.libreccm:ccm-testutils", ScopeType.RUNTIME, false));
|
||||
dependencies.addDependency(MavenDependencies.createDependency(
|
||||
"net.sf.saxon:Saxon-HE", ScopeType.RUNTIME, false));
|
||||
dependencies.addDependency(MavenDependencies.createDependency(
|
||||
"org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-impl-maven",
|
||||
ScopeType.RUNTIME, false));
|
||||
final File[] libsWithCcmCore = dependencies.resolve().withTransitivity()
|
||||
.asFile();
|
||||
|
||||
final List<File> libsList = new ArrayList<>(libsWithCcmCore.length - 1);
|
||||
IntStream.range(0, libsWithCcmCore.length).forEach(i -> {
|
||||
final File lib = libsWithCcmCore[i];
|
||||
if (!lib.getName().startsWith("ccm-core")) {
|
||||
libsList.add(lib);
|
||||
}
|
||||
});
|
||||
final File[] libs = libsList.toArray(new File[libsList.size()]);
|
||||
|
||||
for (File lib : libs) {
|
||||
System.err.printf("Adding file '%s' to test archive...%n",
|
||||
lib.getName());
|
||||
}
|
||||
|
||||
return ShrinkWrap
|
||||
.create(WebArchive.class,
|
||||
"LibreCCM-org.libreccm.cms.contentsection.ContentItemRepositoryTest.war")
|
||||
.addPackage(org.libreccm.auditing.CcmRevision.class.getPackage())
|
||||
.addPackage(org.libreccm.categorization.Categorization.class
|
||||
.getPackage())
|
||||
.addPackage(org.libreccm.cdi.utils.CdiUtil.class.getPackage())
|
||||
.addPackage(org.libreccm.configuration.Configuration.class
|
||||
.getPackage())
|
||||
.addPackage(org.libreccm.core.CcmCore.class.getPackage())
|
||||
.addPackage(org.libreccm.jpa.EntityManagerProducer.class
|
||||
.getPackage())
|
||||
.addPackage(org.libreccm.jpa.utils.MimeTypeConverter.class
|
||||
.getPackage())
|
||||
.addPackage(org.libreccm.l10n.LocalizedString.class
|
||||
.getPackage())
|
||||
.addPackage(org.libreccm.security.Permission.class.getPackage())
|
||||
.addPackage(org.libreccm.web.CcmApplication.class.getPackage())
|
||||
.addPackage(org.libreccm.workflow.Workflow.class.getPackage())
|
||||
.addPackage(com.arsdigita.bebop.Component.class.getPackage())
|
||||
.addPackage(com.arsdigita.bebop.util.BebopConstants.class
|
||||
.getPackage())
|
||||
.addClass(com.arsdigita.kernel.KernelConfig.class)
|
||||
.addClass(com.arsdigita.runtime.CCMResourceManager.class)
|
||||
.addClass(
|
||||
com.arsdigita.ui.admin.applications.AbstractAppInstanceForm.class)
|
||||
.addClass(
|
||||
com.arsdigita.ui.admin.applications.AbstractAppSettingsPane.class)
|
||||
.addClass(
|
||||
com.arsdigita.ui.admin.applications.DefaultApplicationInstanceForm.class)
|
||||
.addClass(
|
||||
com.arsdigita.ui.admin.applications.DefaultApplicationSettingsPane.class)
|
||||
.addPackage(com.arsdigita.util.Lockable.class.getPackage())
|
||||
.addPackage(com.arsdigita.web.BaseServlet.class.getPackage())
|
||||
.addPackage(org.librecms.Cms.class.getPackage())
|
||||
.addPackage(org.librecms.assets.Asset.class.getPackage())
|
||||
.addPackage(org.librecms.attachments.AttachmentList.class
|
||||
.getPackage())
|
||||
.addPackage(org.librecms.lifecycle.Lifecycle.class.getPackage())
|
||||
.addPackage(org.librecms.contentsection.ContentSection.class
|
||||
.getPackage())
|
||||
.addPackage(org.librecms.contenttypes.Article.class.getPackage())
|
||||
.addAsLibraries(libs)
|
||||
.addAsResource("test-persistence.xml",
|
||||
"META-INF/persistence.xml")
|
||||
.addAsWebInfResource("test-web.xml", "WEB-INF/web.xml")
|
||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "WEB-INF/beans.xml");
|
||||
}
|
||||
|
||||
@Test
|
||||
@InSequence(10)
|
||||
public void isRepositoryInjected() {
|
||||
assertThat(itemRepo, is(not(nullValue())));
|
||||
assertThat(categoryRepo, is(not(nullValue())));
|
||||
}
|
||||
|
||||
@Test
|
||||
@InSequence(100)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentItemRepositoryTest/data.xml")
|
||||
public void findByUuidAndType() {
|
||||
final Optional<Article> article1 = itemRepo.findByUuid(
|
||||
"aed4b402-1180-46c6-b42d-7245f4dca248", Article.class);
|
||||
final Optional<Article> article2 = itemRepo.findByUuid(
|
||||
"acae860f-2ffa-450d-b486-054292f0dae6", Article.class);
|
||||
final Optional<Article> article3 = itemRepo.findByUuid(
|
||||
"f4b38abb-234b-4354-bc92-e36c068a1ebd", Article.class);
|
||||
final Optional<News> news1 = itemRepo.findByUuid(
|
||||
"d9ea527d-c6e3-4bdd-962d-c0a1a80c6c72", News.class);
|
||||
|
||||
final Optional<Article> newsAsArticle = itemRepo.findByUuid(
|
||||
"f4b38abb-234b-4354-bc92-e36c068a1ebd", Article.class);
|
||||
final Optional<News> articleAsNews = itemRepo.findByUuid(
|
||||
"acae860f-2ffa-450d-b486-054292f0dae6", News.class);
|
||||
|
||||
assertThat(article1.isPresent(), is(true));
|
||||
assertThat(article1.get().getDisplayName(), is(equalTo("article1")));
|
||||
assertThat(article2.isPresent(), is(true));
|
||||
assertThat(article2.get().getDisplayName(), is(equalTo("article2")));
|
||||
assertThat(article3.isPresent(), is(true));
|
||||
assertThat(article3.get().getDisplayName(), is(equalTo("article3")));
|
||||
assertThat(news1.isPresent(), is(true));
|
||||
assertThat(news1.get().getDisplayName(), is(equalTo("news1")));
|
||||
|
||||
assertThat(newsAsArticle.isPresent(), is(false));
|
||||
assertThat(articleAsNews.isPresent(), is(false));
|
||||
}
|
||||
|
||||
@Test
|
||||
@InSequence(200)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentItemRepositoryTest/data.xml")
|
||||
public void findByType() {
|
||||
final List<Article> articles = itemRepo.findByType(Article.class);
|
||||
assertThat(articles, is(not(nullValue())));
|
||||
assertThat(articles.size(), is(3));
|
||||
|
||||
final List<News> news = itemRepo.findByType(News.class);
|
||||
assertThat(news, is(not(nullValue())));
|
||||
assertThat(news.size(), is(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
@InSequence(300)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentItemRepositoryTest/data.xml")
|
||||
public void findByFolder() {
|
||||
final Category folder = categoryRepo.findById(-2100L);
|
||||
|
||||
final List<ContentItem> items = itemRepo.findByFolder(folder);
|
||||
|
||||
assertThat(items, is(not(nullValue())));
|
||||
assertThat(items.size(), is(4));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -181,7 +181,6 @@ public class ContentSectionManagerTest {
|
|||
"META-INF/persistence.xml")
|
||||
.addAsWebInfResource("test-web.xml", "WEB-INF/web.xml")
|
||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "WEB-INF/beans.xml");
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -47,7 +47,8 @@ public class DatasetsTest extends DatasetsVerifier {
|
|||
"/datasets/org/librecms/contentsection/ContentSectionManagerTest/after-add-role.xml",
|
||||
"/datasets/org/librecms/contentsection/ContentSectionManagerTest/after-create.xml",
|
||||
"/datasets/org/librecms/contentsection/ContentSectionManagerTest/after-remove-role.xml",
|
||||
"/datasets/org/librecms/contentsection/ContentSectionManagerTest/after-rename.xml" });
|
||||
"/datasets/org/librecms/contentsection/ContentSectionManagerTest/after-rename.xml",
|
||||
"/datasets/org/librecms/contentsection/ContentItemRepositoryTest/data.xml"});
|
||||
}
|
||||
|
||||
public DatasetsTest(final String datasetPath) {
|
||||
|
|
|
|||
|
|
@ -269,10 +269,10 @@ CREATE SCHEMA ccm_cms;
|
|||
|
||||
create table CCM_CMS.CONTENT_ITEMS (
|
||||
ANCESTORS varchar(1024),
|
||||
launchDate date,
|
||||
version varchar(255),
|
||||
LAUNCH_DATE date,
|
||||
VERSION varchar(255),
|
||||
OBJECT_ID bigint not null,
|
||||
contentType_OBJECT_ID bigint,
|
||||
CONTENT_TYPE_ID bigint,
|
||||
primary key (OBJECT_ID)
|
||||
);
|
||||
|
||||
|
|
@ -280,9 +280,9 @@ CREATE SCHEMA ccm_cms;
|
|||
OBJECT_ID bigint not null,
|
||||
REV integer not null,
|
||||
ANCESTORS varchar(1024),
|
||||
launchDate date,
|
||||
version varchar(255),
|
||||
contentType_OBJECT_ID bigint,
|
||||
LAUNCH_DATE date,
|
||||
VERSION varchar(255),
|
||||
CONTENT_TYPE_ID bigint,
|
||||
primary key (OBJECT_ID, REV)
|
||||
);
|
||||
|
||||
|
|
@ -322,8 +322,11 @@ CREATE SCHEMA ccm_cms;
|
|||
ANCESTORS varchar(1024),
|
||||
CONTENT_ITEM_CLASS varchar(1024),
|
||||
DESCENDANTS varchar(1024),
|
||||
mode varchar(255),
|
||||
TYPE_MODE varchar(255),
|
||||
OBJECT_ID bigint not null,
|
||||
CONTENT_SECTION_ID bigint,
|
||||
DEFAULT_LIFECYCLE_ID bigint,
|
||||
DEFAULT_WORKFLOW bigint,
|
||||
primary key (OBJECT_ID)
|
||||
);
|
||||
|
||||
|
|
@ -1697,8 +1700,8 @@ create sequence hibernate_sequence start with 1 increment by 1;
|
|||
references CCM_CORE.CCM_REVISIONS;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
add constraint FKi1ce005bvnavqy8xlyim60yav
|
||||
foreign key (contentType_OBJECT_ID)
|
||||
add constraint FKg83y3asxi1jr7larwven7ueu0
|
||||
foreign key (CONTENT_TYPE_ID)
|
||||
references CCM_CMS.CONTENT_TYPES;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
|
|
|
|||
|
|
@ -269,10 +269,10 @@ CREATE SCHEMA ccm_cms;
|
|||
|
||||
create table CCM_CMS.CONTENT_ITEMS (
|
||||
ANCESTORS varchar(1024),
|
||||
launchDate date,
|
||||
version varchar(255),
|
||||
LAUNCH_DATE date,
|
||||
VERSION varchar(255),
|
||||
OBJECT_ID int8 not null,
|
||||
contentType_OBJECT_ID int8,
|
||||
CONTENT_TYPE_ID int8,
|
||||
primary key (OBJECT_ID)
|
||||
);
|
||||
|
||||
|
|
@ -280,9 +280,9 @@ CREATE SCHEMA ccm_cms;
|
|||
OBJECT_ID int8 not null,
|
||||
REV int4 not null,
|
||||
ANCESTORS varchar(1024),
|
||||
launchDate date,
|
||||
version varchar(255),
|
||||
contentType_OBJECT_ID int8,
|
||||
LAUNCH_DATE date,
|
||||
VERSION varchar(255),
|
||||
CONTENT_TYPE_ID int8,
|
||||
primary key (OBJECT_ID, REV)
|
||||
);
|
||||
|
||||
|
|
@ -322,8 +322,11 @@ CREATE SCHEMA ccm_cms;
|
|||
ANCESTORS varchar(1024),
|
||||
CONTENT_ITEM_CLASS varchar(1024),
|
||||
DESCENDANTS varchar(1024),
|
||||
mode varchar(255),
|
||||
TYPE_MODE varchar(255),
|
||||
OBJECT_ID int8 not null,
|
||||
CONTENT_SECTION_ID int8,
|
||||
DEFAULT_LIFECYCLE_ID int8,
|
||||
DEFAULT_WORKFLOW int8,
|
||||
primary key (OBJECT_ID)
|
||||
);
|
||||
|
||||
|
|
@ -1697,8 +1700,8 @@ create sequence hibernate_sequence start 1 increment 1;
|
|||
references CCM_CORE.CCM_REVISIONS;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
add constraint FKi1ce005bvnavqy8xlyim60yav
|
||||
foreign key (contentType_OBJECT_ID)
|
||||
add constraint FKg83y3asxi1jr7larwven7ueu0
|
||||
foreign key (CONTENT_TYPE_ID)
|
||||
references CCM_CMS.CONTENT_TYPES;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
|
|
|
|||
|
|
@ -269,10 +269,10 @@ CREATE SCHEMA ccm_cms;
|
|||
|
||||
create table CCM_CMS.CONTENT_ITEMS (
|
||||
ANCESTORS varchar(1024),
|
||||
launchDate date,
|
||||
version varchar(255),
|
||||
LAUNCH_DATE date,
|
||||
VERSION varchar(255),
|
||||
OBJECT_ID bigint not null,
|
||||
contentType_OBJECT_ID bigint,
|
||||
CONTENT_TYPE_ID bigint,
|
||||
primary key (OBJECT_ID)
|
||||
);
|
||||
|
||||
|
|
@ -280,9 +280,9 @@ CREATE SCHEMA ccm_cms;
|
|||
OBJECT_ID bigint not null,
|
||||
REV integer not null,
|
||||
ANCESTORS varchar(1024),
|
||||
launchDate date,
|
||||
version varchar(255),
|
||||
contentType_OBJECT_ID bigint,
|
||||
LAUNCH_DATE date,
|
||||
VERSION varchar(255),
|
||||
CONTENT_TYPE_ID bigint,
|
||||
primary key (OBJECT_ID, REV)
|
||||
);
|
||||
|
||||
|
|
@ -322,8 +322,11 @@ CREATE SCHEMA ccm_cms;
|
|||
ANCESTORS varchar(1024),
|
||||
CONTENT_ITEM_CLASS varchar(1024),
|
||||
DESCENDANTS varchar(1024),
|
||||
mode varchar(255),
|
||||
TYPE_MODE varchar(255),
|
||||
OBJECT_ID bigint not null,
|
||||
CONTENT_SECTION_ID bigint,
|
||||
DEFAULT_LIFECYCLE_ID bigint,
|
||||
DEFAULT_WORKFLOW bigint,
|
||||
primary key (OBJECT_ID)
|
||||
);
|
||||
|
||||
|
|
@ -1696,9 +1699,14 @@ create sequence hibernate_sequence start with 1 increment by 1;
|
|||
foreign key (REVEND)
|
||||
references CCM_CORE.CCM_REVISIONS;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
add constraint FKg83y3asxi1jr7larwven7ueu0
|
||||
foreign key (CONTENT_TYPE_ID)
|
||||
references CCM_CMS.CONTENT_TYPES;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
add constraint FKi1ce005bvnavqy8xlyim60yav
|
||||
foreign key (contentType_OBJECT_ID)
|
||||
foreign key (CONTENT_TYPE_ID)
|
||||
references CCM_CMS.CONTENT_TYPES;
|
||||
|
||||
alter table CCM_CMS.CONTENT_ITEMS
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,358 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dataset>
|
||||
|
||||
<ccm_core.ccm_objects object_id="-1100"
|
||||
display_name="info"
|
||||
uuid="963bcae7-3aeb-4b62-891c-e16c4defa1f2" />
|
||||
<ccm_core.ccm_objects object_id="-2100"
|
||||
display_name="info_root"
|
||||
uuid="82014239-9c06-486d-ae8c-4ae47f52a699" />
|
||||
<ccm_core.ccm_objects object_id="-2200"
|
||||
display_name="info_assets"
|
||||
uuid="b163f73c-9ac2-44d7-a037-de621f5ca828" />
|
||||
<ccm_core.ccm_objects object_id="-10100"
|
||||
display_name="article1"
|
||||
uuid="aed4b402-1180-46c6-b42d-7245f4dca248" />
|
||||
<ccm_core.ccm_objects object_id="-10200"
|
||||
display_name="article2"
|
||||
uuid="acae860f-2ffa-450d-b486-054292f0dae6" />
|
||||
<ccm_core.ccm_objects object_id="-10300"
|
||||
display_name="article3"
|
||||
uuid="f4b38abb-234b-4354-bc92-e36c068a1ebd" />
|
||||
<ccm_core.ccm_objects object_id="-10400"
|
||||
display_name="news1"
|
||||
uuid="d9ea527d-c6e3-4bdd-962d-c0a1a80c6c72" />
|
||||
<ccm_core.ccm_objects object_id="-20100"
|
||||
display_name="org.librecms.contenttypes.Article"
|
||||
uuid="2c8ec2fb-319d-4d44-9698-697c08b2b941" />
|
||||
<ccm_core.ccm_objects object_id="-20200"
|
||||
display_name="org.librecms.contenttypes.News"
|
||||
uuid="47740f22-f89f-4ec3-90cf-d62859e53c7e" />
|
||||
|
||||
<ccm_core.categories object_id="-2100"
|
||||
unique_id="82014239-9c06-486d-ae8c-4ae47f52a699"
|
||||
name="info_root"
|
||||
enabled="true"
|
||||
visible="true"
|
||||
abstract_category="false"
|
||||
category_order="1" />
|
||||
<ccm_core.categories object_id="-2200"
|
||||
unique_id="b163f73c-9ac2-44d7-a037-de621f5ca828"
|
||||
name="info_assets"
|
||||
enabled="true"
|
||||
visible="true"
|
||||
abstract_category="false"
|
||||
category_order="1" />
|
||||
|
||||
<ccm_core.category_titles object_id="-2100"
|
||||
locale="en"
|
||||
localized_value="info_root" />
|
||||
<ccm_core.category_titles object_id="-2200"
|
||||
locale="en"
|
||||
localized_value="info_assets" />
|
||||
|
||||
<ccm_core.resources object_id="-1100"
|
||||
created="2016-07-15" />
|
||||
<ccm_core.resource_titles object_id="-1100"
|
||||
locale="en"
|
||||
localized_value="info" />
|
||||
|
||||
<ccm_core.applications object_id="-1100"
|
||||
application_type="org.librecms.contentsection.ContentSection"
|
||||
primary_url="info" />
|
||||
|
||||
<ccm_cms.content_sections object_id="-1100"
|
||||
label="info"
|
||||
root_documents_folder_id="-2100"
|
||||
root_assets_folder_id="-2200" />
|
||||
|
||||
<ccm_cms.content_types object_id="-20100"
|
||||
content_item_class="org.librecms.contenttypes.Article"
|
||||
content_section_id="-1100" />
|
||||
<ccm_cms.content_types object_id="-20200"
|
||||
content_item_class="org.librecms.contenttypes.News"
|
||||
content_section_id="-1100" />
|
||||
|
||||
<ccm_cms.content_items object_id="-10100"
|
||||
version="DRAFT"
|
||||
content_type_id="-20100" />
|
||||
<ccm_cms.content_items object_id="-10200"
|
||||
version="DRAFT"
|
||||
content_type_id="-20100" />
|
||||
<ccm_cms.content_items object_id="-10300"
|
||||
version="DRAFT"
|
||||
content_type_id="-20100" />
|
||||
<ccm_cms.content_items object_id="-10400"
|
||||
version="DRAFT"
|
||||
content_type_id="-20200" />
|
||||
|
||||
<ccm_cms.content_item_names object_id="-10100"
|
||||
locale="en"
|
||||
localized_value="article1" />
|
||||
<ccm_cms.content_item_names object_id="-10200"
|
||||
locale="en"
|
||||
localized_value="article2" />
|
||||
<ccm_cms.content_item_names object_id="-10300"
|
||||
locale="en"
|
||||
localized_value="article3" />
|
||||
<ccm_cms.content_item_names object_id="-10400"
|
||||
locale="en"
|
||||
localized_value="news1" />
|
||||
|
||||
<ccm_cms.content_item_titles object_id="-10100"
|
||||
locale="en"
|
||||
localized_value="Article 1" />
|
||||
<ccm_cms.content_item_titles object_id="-10200"
|
||||
locale="en"
|
||||
localized_value="Article 2" />
|
||||
<ccm_cms.content_item_titles object_id="-10300"
|
||||
locale="en"
|
||||
localized_value="Article 3" />
|
||||
<ccm_cms.content_item_titles object_id="-10400"
|
||||
locale="en"
|
||||
localized_value="News 1" />
|
||||
|
||||
<ccm_cms.content_type_labels object_id="-20100"
|
||||
locale="en"
|
||||
localized_value="Article" />
|
||||
<ccm_cms.content_type_labels object_id="-20200"
|
||||
locale="en"
|
||||
localized_value="News" />
|
||||
|
||||
<ccm_cms.articles object_id="-10100" />
|
||||
<ccm_cms.articles object_id="-10200" />
|
||||
<ccm_cms.articles object_id="-10300" />
|
||||
|
||||
<ccm_cms.article_texts
|
||||
object_id="-10100"
|
||||
locale="en"
|
||||
localized_value="Quisque varius turpis et nibh rhoncus consequat. In sapien metus, fermentum quis." />
|
||||
<ccm_cms.article_texts
|
||||
object_id="-10200"
|
||||
locale="en"
|
||||
localized_value="Duis quis tincidunt elit. In pharetra justo sit amet ipsum dictum, at." />
|
||||
<ccm_cms.article_texts
|
||||
object_id="-10300"
|
||||
locale="en"
|
||||
localized_value="Etiam euismod lacus laoreet sodales ultricies. Pellentesque non elit vitae purus sagittis." />
|
||||
|
||||
<ccm_cms.news object_id="-10400"
|
||||
news_date="2016-08-08" />
|
||||
|
||||
<ccm_cms.news_texts
|
||||
object_id="-10400"
|
||||
locale="en"
|
||||
localized_value="Curabitur vel sapien eu eros gravida bibendum vitae." />
|
||||
|
||||
<ccm_core.categorizations categorization_id="-30100"
|
||||
category_id="-2100"
|
||||
object_id="-10100" />
|
||||
<ccm_core.categorizations categorization_id="-30200"
|
||||
category_id="-2100"
|
||||
object_id="-10200" />
|
||||
<ccm_core.categorizations categorization_id="-30300"
|
||||
category_id="-2100"
|
||||
object_id="-10300" />
|
||||
<ccm_core.categorizations categorization_id="-30400"
|
||||
category_id="-2100"
|
||||
object_id="-10400" />
|
||||
|
||||
<ccm_core.ccm_roles role_id="-3100"
|
||||
name="info_alert_recipient" />
|
||||
<ccm_core.ccm_roles role_id="-3200"
|
||||
name="info_author" />
|
||||
<ccm_core.ccm_roles role_id="-3300"
|
||||
name="info_editor" />
|
||||
<ccm_core.ccm_roles role_id="-3400"
|
||||
name="info_manager" />
|
||||
<ccm_core.ccm_roles role_id="-3500"
|
||||
name="info_publisher" />
|
||||
<ccm_core.ccm_roles role_id="-3600"
|
||||
name="info_content_reader" />
|
||||
|
||||
<ccm_cms.content_section_roles role_id="-3100"
|
||||
section_id="-1100" />
|
||||
<ccm_cms.content_section_roles role_id="-3200"
|
||||
section_id="-1100" />
|
||||
<ccm_cms.content_section_roles role_id="-3300"
|
||||
section_id="-1100" />
|
||||
<ccm_cms.content_section_roles role_id="-3400"
|
||||
section_id="-1100" />
|
||||
<ccm_cms.content_section_roles role_id="-3500"
|
||||
section_id="-1100" />
|
||||
<ccm_cms.content_section_roles role_id="-3600"
|
||||
section_id="-1100" />
|
||||
|
||||
<ccm_core.permissions permission_id="-4110"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3200"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4120"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3200"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4130"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3200"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4140"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3200"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4150"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3200"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4210"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3300"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4220"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3300"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4230"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3300"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4240"
|
||||
granted_privilege="approve_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3300"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4250"
|
||||
granted_privilege="delete_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3300"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4260"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3300"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4270"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3300"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4310"
|
||||
granted_privilege="administer_roles"
|
||||
object_id="-1100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4320"
|
||||
granted_privilege="administer_workflow"
|
||||
object_id="-1100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4330"
|
||||
granted_privilege="administer_lifecyles"
|
||||
object_id="-1100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4340"
|
||||
granted_privilege="administer_categories"
|
||||
object_id="-1100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4350"
|
||||
granted_privilege="administer_content_types"
|
||||
object_id="-1100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4360"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4370"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4380"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4390"
|
||||
granted_privilege="approve_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4400"
|
||||
granted_privilege="publish_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4410"
|
||||
granted_privilege="delete_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4420"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4430"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3400"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4510"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3500"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4520"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3500"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4530"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3500"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4540"
|
||||
granted_privilege="approve_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3500"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4550"
|
||||
granted_privilege="publish_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3500"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4560"
|
||||
granted_privilege="delete_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3500"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4570"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3500"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4580"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3500"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-4610"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2100"
|
||||
grantee_id="-3600"
|
||||
creation_date="2016-07-15"/>
|
||||
|
||||
|
||||
</dataset>
|
||||
Loading…
Reference in New Issue