CCM NG/ccm-cms: Repository for ContentType objects and accompanying test
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4365 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
8e4d572331
commit
93ae630f41
|
|
@ -232,7 +232,7 @@ public class ContentItemRepository
|
|||
}
|
||||
|
||||
/**
|
||||
* Counts a items in a specfic folder whose {@link CcmObject#displayName}
|
||||
* Counts a items in a specific folder whose {@link CcmObject#displayName}
|
||||
* starts with the provided pattern.
|
||||
*
|
||||
* @param folder The folder/category to use.
|
||||
|
|
|
|||
|
|
@ -313,7 +313,8 @@ public class ContentSectionManager {
|
|||
* {@link CmsConstants#PRIVILEGE_ADMINISTER_CONTENT_TYPES} for the provided
|
||||
* content section.
|
||||
*
|
||||
* @param type The {@link ContentItem} class representing the type to add.
|
||||
* @param type The {@link ContentItem} class representing the type to
|
||||
* add.
|
||||
* @param section The section to which to type is added.
|
||||
*/
|
||||
@AuthorizationRequired
|
||||
|
|
@ -427,19 +428,84 @@ public class ContentSectionManager {
|
|||
*
|
||||
* @param section The section for which the {@link ItemResolver} is
|
||||
* retrieved.
|
||||
*
|
||||
* @return The {@link ItemResolver} for the provided content section.
|
||||
*/
|
||||
public ItemResolver getItemResolver(final ContentSection section) {
|
||||
try {
|
||||
@SuppressWarnings("unchecked")
|
||||
final Class<ItemResolver> itemResolverClazz
|
||||
= (Class<ItemResolver>) Class.
|
||||
forName(section.getItemResolverClass());
|
||||
return itemResolverClazz.newInstance();
|
||||
} catch (ClassNotFoundException |
|
||||
IllegalAccessException |
|
||||
InstantiationException ex) {
|
||||
} catch (ClassNotFoundException
|
||||
| IllegalAccessException
|
||||
| InstantiationException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a new {@link ContentType} to a content section, making items of that
|
||||
* type available in the content section.
|
||||
*
|
||||
* @param type The type to add (a subclass of
|
||||
* {@link ContentItem}.
|
||||
* @param section The section to which the type is added.
|
||||
* @param defaultLifecycle The default lifecycle for items of the provided
|
||||
* type in the provided content section. The
|
||||
* lifecycle must be part of the provided section.
|
||||
* Otherwise an {@link IllegalArgumentException} is
|
||||
* thrown.
|
||||
* @param defaultWorkflow The default workflow for items of the provided
|
||||
* type in the provided content section. The
|
||||
* workflow must be part of the provided section.
|
||||
* Otherwise an {@link IllegalArgumentException} is
|
||||
* thrown.
|
||||
*
|
||||
* @return The new {@link ContentType} instance.
|
||||
*/
|
||||
public ContentType addContentTypeToSection(
|
||||
final Class<? extends ContentItem> type,
|
||||
final ContentSection section,
|
||||
final LifecycleDefinition defaultLifecycle,
|
||||
final WorkflowTemplate defaultWorkflow) {
|
||||
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a content section has a {@link ContentType} for a specific
|
||||
* subclass {@link ContentItem}.
|
||||
*
|
||||
* @param type The type to check for.
|
||||
* @param section The section to check for the {@link ContentType}.
|
||||
*
|
||||
* @return {@code true} if the section has a {@link ContentType} for
|
||||
* {@code type}, {@code false} if not.
|
||||
*/
|
||||
public boolean hasContentType(final Class<? extends ContentItem> type,
|
||||
final ContentSection section) {
|
||||
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes an <em>unused</em> {@link ContentType} from a
|
||||
* {@link ContentSection}.
|
||||
*
|
||||
* @param type The type to remove from the section.
|
||||
* @param section The section from which the type is removed.
|
||||
*
|
||||
* @throws IllegalArgumentException if the provided {@link ContentType} is
|
||||
* in use or the parameters or otherwise
|
||||
* illegal.
|
||||
*/
|
||||
public void removeContentTypeFromSection(
|
||||
final Class<? extends ContentItem> type,
|
||||
final ContentSection section) {
|
||||
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,12 +54,20 @@ import javax.persistence.Table;
|
|||
@NamedQuery(
|
||||
name = "ContentType.findByContentSection",
|
||||
query = "SELECT c FROM ContentType c "
|
||||
+ "WHERE c.contentSection = :contentSection"),
|
||||
+ "WHERE c.contentSection = :contentSection "
|
||||
+ "ORDER BY c.contentItemClass")
|
||||
,
|
||||
@NamedQuery(
|
||||
name = "ContentType.findByContentSectionAndClass",
|
||||
query = "SELECT c FROM ContentType c "
|
||||
+ "WHERE c.contentSection = :contentSection "
|
||||
+ "AND c.contentItemClass = :clazz")
|
||||
,
|
||||
@NamedQuery(
|
||||
name = "ContentType.isInUse",
|
||||
query = "SELECT COUNT(i) FROM ContentItem i "
|
||||
+ "WHERE i.contentType = :type"
|
||||
)
|
||||
})
|
||||
public class ContentType extends CcmObject implements Serializable {
|
||||
|
||||
|
|
|
|||
|
|
@ -19,12 +19,17 @@
|
|||
package org.librecms.contentsection;
|
||||
|
||||
import org.libreccm.core.AbstractEntityRepository;
|
||||
import org.libreccm.security.AuthorizationRequired;
|
||||
import org.libreccm.security.RequiresPrivilege;
|
||||
import org.librecms.CmsConstants;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.inject.Inject;
|
||||
import javax.persistence.TypedQuery;
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -34,6 +39,9 @@ import javax.persistence.TypedQuery;
|
|||
public class ContentTypeRepository
|
||||
extends AbstractEntityRepository<Long, ContentType> {
|
||||
|
||||
@Inject
|
||||
private ContentItemRepository itemRepo;
|
||||
|
||||
@Override
|
||||
public Class<ContentType> getEntityClass() {
|
||||
return ContentType.class;
|
||||
|
|
@ -50,7 +58,8 @@ public class ContentTypeRepository
|
|||
* @param section The section whose {@link ContentTyp}s are retrieved. Can't
|
||||
* be {@code null}.
|
||||
*
|
||||
* @return A list of all {@link ContentType}s of the provided section.
|
||||
* @return A list of all {@link ContentType}s of the provided section
|
||||
* ordered alphabetically.
|
||||
*/
|
||||
public List<ContentType> findByContentSection(final ContentSection section) {
|
||||
if (section == null) {
|
||||
|
|
@ -167,4 +176,50 @@ public class ContentTypeRepository
|
|||
}
|
||||
}
|
||||
|
||||
@AuthorizationRequired
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
@Override
|
||||
public void save(
|
||||
@RequiresPrivilege(CmsConstants.PRIVILEGE_ADMINISTER_CONTENT_TYPES)
|
||||
final ContentType type) {
|
||||
|
||||
super.save(type);
|
||||
}
|
||||
|
||||
@AuthorizationRequired
|
||||
@Transactional(Transactional.TxType.REQUIRED)
|
||||
@Override
|
||||
public void delete(
|
||||
@RequiresPrivilege(CmsConstants.PRIVILEGE_ADMINISTER_CONTENT_TYPES)
|
||||
final ContentType type) {
|
||||
|
||||
if (isContentTypeInUse(type)) {
|
||||
throw new IllegalArgumentException(String.format(
|
||||
"Contenttype \"%s\" in section \"%s\" is in use and can't be"
|
||||
+ "deleted.",
|
||||
type.getContentItemClass(),
|
||||
type.getContentSection().getDisplayName()));
|
||||
} else {
|
||||
super.delete(type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if there is any item of the provided content type and the content
|
||||
* section to which the type belongs.
|
||||
*
|
||||
* @param type The type to check for usage.
|
||||
*
|
||||
* @return {@code true} if the type is in use, {@code false} if not.
|
||||
*/
|
||||
public boolean isContentTypeInUse(final ContentType type) {
|
||||
final TypedQuery<Long> query = getEntityManager().createNamedQuery(
|
||||
"ContentType.isInUse", Long.class);
|
||||
query.setParameter("type", type);
|
||||
|
||||
final long result = query.getSingleResult();
|
||||
|
||||
return result > 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,10 +30,6 @@ 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;
|
||||
|
|
@ -46,17 +42,15 @@ 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.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import static org.libreccm.testutils.DependenciesHelpers.*;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,395 @@
|
|||
/*
|
||||
* 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 static org.libreccm.testutils.DependenciesHelpers.*;
|
||||
|
||||
import org.jboss.arquillian.container.test.api.Deployment;
|
||||
import org.jboss.arquillian.container.test.api.ShouldThrowException;
|
||||
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.ShouldMatchDataSet;
|
||||
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.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.tests.categories.IntegrationTest;
|
||||
import org.librecms.contenttypes.Article;
|
||||
import org.librecms.contenttypes.News;
|
||||
import org.librecms.contenttypes.Event;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
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 ContentTypeRepositoryTest {
|
||||
|
||||
@Inject
|
||||
private ContentTypeRepository contentTypeRepo;
|
||||
|
||||
@Inject
|
||||
private ContentSectionRepository contentSectionRepo;
|
||||
|
||||
public ContentTypeRepositoryTest() {
|
||||
}
|
||||
|
||||
@BeforeClass
|
||||
public static void setUpClass() {
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public static void tearDownClass() {
|
||||
}
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
}
|
||||
|
||||
@After
|
||||
public void tearDown() {
|
||||
}
|
||||
|
||||
@Deployment
|
||||
public static WebArchive createDeployment() {
|
||||
return ShrinkWrap
|
||||
.create(WebArchive.class,
|
||||
"LibreCCM-org.librecms.contentsection.ContentTypeRepositoryTest.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)
|
||||
.addClass(com.arsdigita.cms.dispatcher.ItemResolver.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())
|
||||
.addPackage(org.libreccm.tests.categories.IntegrationTest.class
|
||||
.getPackage())
|
||||
// .addAsLibraries(getModuleDependencies())
|
||||
.addAsLibraries(getCcmCoreDependencies())
|
||||
.addAsResource("test-persistence.xml",
|
||||
"META-INF/persistence.xml")
|
||||
.addAsWebInfResource("test-web.xml", "WEB-INF/web.xml")
|
||||
.addAsWebInfResource(EmptyAsset.INSTANCE, "WEB-INF/beans.xml");
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all injected beans are available.
|
||||
*/
|
||||
@Test
|
||||
@InSequence(1)
|
||||
public void checkInjection() {
|
||||
assertThat(contentTypeRepo, is(not(nullValue())));
|
||||
assertThat(contentSectionRepo, is(not(nullValue())));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if
|
||||
* {@link ContentTypeRepository#findByContentSection(org.librecms.contentsection.ContentSection)}
|
||||
* returns all content types of the given content section.
|
||||
*/
|
||||
@Test
|
||||
@InSequence(1100)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
public void findByContentSection() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L);
|
||||
final List<ContentType> types = contentTypeRepo.findByContentSection(
|
||||
section);
|
||||
|
||||
assertThat(types, is(not(nullValue())));
|
||||
assertThat(types.isEmpty(), is(false));
|
||||
assertThat(types.size(), is(2));
|
||||
|
||||
assertThat(types.get(0).getContentItemClass(),
|
||||
is(equalTo(Article.class.getName())));
|
||||
assertThat(types.get(0).getContentSection().getDisplayName(),
|
||||
is(equalTo("info")));
|
||||
|
||||
assertThat(types.get(1).getContentItemClass(),
|
||||
is(equalTo(News.class.getName())));
|
||||
assertThat(types.get(1).getContentSection().getDisplayName(),
|
||||
is(equalTo("info")));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if
|
||||
* {@link ContentTypeRepository#findByContentSection(org.librecms.contentsection.ContentSection)}
|
||||
* throws all {@link IllegalArgumentException} if called with {@code null}
|
||||
* for the content section.
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@InSequence(1110)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldThrowException(IllegalArgumentException.class)
|
||||
public void findByContentSectionNull() {
|
||||
contentTypeRepo.findByContentSection(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.Class)
|
||||
* returns the expected values.
|
||||
*/
|
||||
@Test
|
||||
@InSequence(1200)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
public void findByContentSectionAndClass() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L);
|
||||
final Optional<ContentType> articleType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, Article.class);
|
||||
final Optional<ContentType> newsType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, News.class);
|
||||
final Optional<ContentType> eventType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, Event.class);
|
||||
|
||||
assertThat(articleType.isPresent(), is(true));
|
||||
assertThat(articleType.get().getContentItemClass(),
|
||||
is(equalTo(Article.class.getName())));
|
||||
assertThat(articleType.get().getContentSection().getDisplayName(),
|
||||
is(equalTo("info")));
|
||||
|
||||
assertThat(newsType.isPresent(), is(true));
|
||||
assertThat(newsType.get().getContentItemClass(),
|
||||
is(equalTo(News.class.getName())));
|
||||
assertThat(newsType.get().getContentSection().getDisplayName(),
|
||||
is(equalTo("info")));
|
||||
|
||||
assertThat(eventType.isPresent(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if
|
||||
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.Class)}
|
||||
* throws a {@link IllegalArgumentException} when called with {@code null}
|
||||
* for the content section.
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@InSequence(1210)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldThrowException(IllegalArgumentException.class)
|
||||
public void findByContentSectionNullAndClass() {
|
||||
|
||||
contentTypeRepo.findByContentSectionAndClass(null, Article.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if
|
||||
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.Class)}
|
||||
* throws a {@link IllegalArgumentException} when called with {@code null}
|
||||
* for the class.
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@InSequence(1220)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldThrowException(IllegalArgumentException.class)
|
||||
public void findByContentSectionAndClassNull() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L);
|
||||
final Class<? extends ContentItem> type = null;
|
||||
contentTypeRepo.findByContentSectionAndClass(section, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if
|
||||
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.String)}
|
||||
* returns the expected values.
|
||||
*/
|
||||
@Test
|
||||
@InSequence(1300)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
public void findByContentSectionAndClassName() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L);
|
||||
final Optional<ContentType> articleType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, Article.class.getName());
|
||||
final Optional<ContentType> newsType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, News.class.getName());
|
||||
final Optional<ContentType> eventType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, Event.class.getName());
|
||||
|
||||
assertThat(articleType.isPresent(), is(true));
|
||||
assertThat(articleType.get().getContentItemClass(),
|
||||
is(equalTo(Article.class.getName())));
|
||||
assertThat(articleType.get().getContentSection().getDisplayName(),
|
||||
is(equalTo("info")));
|
||||
|
||||
assertThat(newsType.isPresent(), is(true));
|
||||
assertThat(newsType.get().getContentItemClass(),
|
||||
is(equalTo(News.class.getName())));
|
||||
assertThat(newsType.get().getContentSection().getDisplayName(),
|
||||
is(equalTo("info")));
|
||||
|
||||
assertThat(eventType.isPresent(), is(false));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if
|
||||
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.String) }
|
||||
* throws a {@link IllegalArgumentException} when called with {@code null}
|
||||
* for the content section.
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@InSequence(1210)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldThrowException(IllegalArgumentException.class)
|
||||
public void findByContentSectionNullAndClassName() {
|
||||
|
||||
contentTypeRepo.findByContentSectionAndClass(null, Article.class
|
||||
.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if
|
||||
* {@link ContentTypeRepository#findByContentSectionAndClass(org.librecms.contentsection.ContentSection, java.lang.String) }
|
||||
* throws a {@link IllegalArgumentException} when called with {@code null}
|
||||
* for the class.
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@InSequence(1220)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldThrowException(IllegalArgumentException.class)
|
||||
public void findByContentSectionAndClassNameNull() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L);
|
||||
final String type = null;
|
||||
contentTypeRepo.findByContentSectionAndClass(section, type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies the return value of
|
||||
* {@link ContentTypeRepository#isContentTypeInUse(org.librecms.contentsection.ContentType)}.
|
||||
*/
|
||||
@Test
|
||||
@InSequence(2000)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
public void verifyIsContentTypeInUse() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L);
|
||||
final Optional<ContentType> articleType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, Article.class);
|
||||
final Optional<ContentType> newsType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, News.class);
|
||||
|
||||
assertThat(articleType.isPresent(), is(true));
|
||||
assertThat(newsType.isPresent(), is(true));
|
||||
|
||||
assertThat(contentTypeRepo.isContentTypeInUse(articleType.get()),
|
||||
is(true));
|
||||
assertThat(contentTypeRepo.isContentTypeInUse(newsType.get()),
|
||||
is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies that an unused content type can be deleted.
|
||||
*/
|
||||
@Test
|
||||
@InSequence(2000)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldMatchDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/after-delete.xml")
|
||||
public void deleteUnusedContentType() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L);
|
||||
final Optional<ContentType> newsType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, News.class);
|
||||
assertThat(newsType.isPresent(), is(true));
|
||||
|
||||
contentTypeRepo.delete(newsType.get());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies that content types which are in use can't be deleted.
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@InSequence(2000)
|
||||
@UsingDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldMatchDataSet("datasets/org/librecms/contentsection/"
|
||||
+ "ContentTypeRepositoryTest/data.xml")
|
||||
@ShouldThrowException(IllegalArgumentException.class)
|
||||
public void deleteContentTypeInUse() {
|
||||
final ContentSection section = contentSectionRepo.findById(-1001L);
|
||||
final Optional<ContentType> articleType = contentTypeRepo
|
||||
.findByContentSectionAndClass(section, Article.class);
|
||||
assertThat(articleType.isPresent(), is(true));
|
||||
|
||||
contentTypeRepo.delete(articleType.get());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -62,6 +62,9 @@ public class DatasetsTest extends DatasetsVerifier {
|
|||
"/datasets/org/librecms/contentsection/ContentItemManagerTest/after-republish.xml",
|
||||
"/datasets/org/librecms/contentsection/ContentItemManagerTest/after-unpublish.xml",
|
||||
|
||||
"/datasets/org/librecms/contentsection/ContentTypeRepositoryTest/data.xml",
|
||||
"/datasets/org/librecms/contentsection/ContentTypeRepositoryTest/after-delete.xml",
|
||||
|
||||
"/datasets/org/librecms/contentsection/FolderManagerTest/data.xml",
|
||||
"/datasets/org/librecms/contentsection/FolderManagerTest/after-create-docs-folder.xml",
|
||||
"/datasets/org/librecms/contentsection/FolderManagerTest/after-create-assets-folder.xml",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,338 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dataset>
|
||||
|
||||
<ccm_core.ccm_revisions id="0"
|
||||
timestamp="1451602800" />
|
||||
|
||||
<ccm_core.ccm_objects object_id="-1001"
|
||||
display_name="info"
|
||||
uuid="963bcae7-3aeb-4b62-891c-e16c4defa1f2" />
|
||||
<ccm_core.ccm_objects object_id="-2001"
|
||||
display_name="info_root"
|
||||
uuid="82014239-9c06-486d-ae8c-4ae47f52a699" />
|
||||
<ccm_core.ccm_objects object_id="-2002"
|
||||
display_name="info_assets"
|
||||
uuid="b163f73c-9ac2-44d7-a037-de621f5ca828" />
|
||||
<ccm_core.ccm_objects object_id="-3001"
|
||||
display_name="article1"
|
||||
uuid="aed4b402-1180-46c6-b42d-7245f4dca248" />
|
||||
<ccm_core.ccm_objects object_id="-4001"
|
||||
display_name="org.libreccm.contenttypes.Article"
|
||||
uuid="2c8ec2fb-319d-4d44-9698-697c08b2b941" />
|
||||
|
||||
<ccm_core.ccm_objects_aud object_id="-3001"
|
||||
rev="0"
|
||||
revtype="0"
|
||||
display_name="article1" />
|
||||
|
||||
<ccm_core.resources object_id="-1001"
|
||||
created="2016-07-15" />
|
||||
<ccm_core.resource_titles object_id="-1001"
|
||||
locale="en"
|
||||
localized_value="info" />
|
||||
|
||||
<ccm_core.applications object_id="-1001"
|
||||
application_type="org.librecms.contentsection.ContentSection"
|
||||
primary_url="info" />
|
||||
|
||||
<ccm_core.categories object_id="-2001"
|
||||
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="-2002"
|
||||
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="-2001"
|
||||
locale="en"
|
||||
localized_value="info_root" />
|
||||
<ccm_core.category_titles object_id="-2002"
|
||||
locale="en"
|
||||
localized_value="info_assets" />
|
||||
|
||||
<ccm_cms.folders object_id="-2001"
|
||||
type="DOCUMENTS_FOLDER" />
|
||||
<ccm_cms.folders object_id="-2002"
|
||||
type="ASSETS_FOLDER" />
|
||||
|
||||
<ccm_cms.content_sections object_id="-1001"
|
||||
label="info"
|
||||
root_documents_folder_id="-2001"
|
||||
root_assets_folder_id="-2002" />
|
||||
|
||||
<ccm_cms.folder_content_section_map folder_id="-2001"
|
||||
content_section_id="-1001" />
|
||||
<ccm_cms.folder_content_section_map folder_id="-2002"
|
||||
content_section_id="-1001" />
|
||||
|
||||
<ccm_cms.content_types object_id="-4001"
|
||||
content_item_class="org.librecms.contenttypes.Article"
|
||||
content_section_id="-1001" />
|
||||
|
||||
<ccm_cms.content_type_labels object_id="-4001"
|
||||
locale="en"
|
||||
localized_value="Article" />
|
||||
|
||||
<ccm_cms.content_items object_id="-3001"
|
||||
item_uuid="aed4b402-1180-46c6-b42d-7245f4dca248"
|
||||
version="DRAFT"
|
||||
content_type_id="-4001" />
|
||||
|
||||
<ccm_cms.content_items_aud object_id="-3001"
|
||||
rev="0"
|
||||
item_uuid="aed4b402-1180-46c6-b42d-7245f4dca248"
|
||||
version="DRAFT"
|
||||
content_type_id="-4001" />
|
||||
|
||||
<ccm_cms.content_item_names object_id="-3001"
|
||||
locale="en"
|
||||
localized_value="article1" />
|
||||
|
||||
<ccm_cms.content_item_names_aud rev="0"
|
||||
object_id="-3001"
|
||||
localized_value="article1"
|
||||
locale="en"
|
||||
revtype="0" />
|
||||
|
||||
<ccm_cms.content_item_titles object_id="-3001"
|
||||
locale="en"
|
||||
localized_value="Article 1" />
|
||||
|
||||
<ccm_cms.content_item_titles_aud rev="0"
|
||||
object_id="-3001"
|
||||
localized_value="Article 1"
|
||||
locale="en"
|
||||
revtype="0" />
|
||||
|
||||
<ccm_cms.articles object_id="-3001" />
|
||||
|
||||
<ccm_cms.articles_aud object_id="-3001"
|
||||
rev="0" />
|
||||
|
||||
<ccm_cms.article_texts
|
||||
object_id="-3001"
|
||||
locale="en"
|
||||
localized_value="Quisque varius turpis et nibh rhoncus consequat. In sapien metus, fermentum quis." />
|
||||
|
||||
<ccm_cms.article_texts_aud
|
||||
rev="0"
|
||||
object_id="-3001"
|
||||
localized_value="Quisque varius turpis et nibh rhoncus consequat. In sapien metus, fermentum quis."
|
||||
locale="en"
|
||||
revtype="0" />
|
||||
|
||||
<ccm_core.categorizations categorization_id="-5001"
|
||||
category_id="-2001"
|
||||
object_id="-3001"
|
||||
category_order="1"
|
||||
object_order="1"
|
||||
category_index="false"
|
||||
type="folder" />
|
||||
|
||||
<ccm_core.ccm_roles role_id="-6001"
|
||||
name="info_alert_recipient" />
|
||||
<ccm_core.ccm_roles role_id="-6002"
|
||||
name="info_author" />
|
||||
<ccm_core.ccm_roles role_id="-6003"
|
||||
name="info_editor" />
|
||||
<ccm_core.ccm_roles role_id="-6004"
|
||||
name="info_manager" />
|
||||
<ccm_core.ccm_roles role_id="-6005"
|
||||
name="info_publisher" />
|
||||
<ccm_core.ccm_roles role_id="-6006"
|
||||
name="info_content_reader" />
|
||||
|
||||
<ccm_cms.content_section_roles role_id="-6001"
|
||||
section_id="-1001" />
|
||||
<ccm_cms.content_section_roles role_id="-6002"
|
||||
section_id="-1001" />
|
||||
<ccm_cms.content_section_roles role_id="-6003"
|
||||
section_id="-1001" />
|
||||
<ccm_cms.content_section_roles role_id="-6004"
|
||||
section_id="-1001" />
|
||||
<ccm_cms.content_section_roles role_id="-6005"
|
||||
section_id="-1001" />
|
||||
<ccm_cms.content_section_roles role_id="-6006"
|
||||
section_id="-1001" />
|
||||
|
||||
<ccm_core.permissions permission_id="-7001"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6002"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7002"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6002"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7003"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6002"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7004"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6002"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7005"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6002"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7006"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7007"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7008"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7009"
|
||||
granted_privilege="approve_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7010"
|
||||
granted_privilege="delete_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7011"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7012"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7013"
|
||||
granted_privilege="administer_roles"
|
||||
object_id="-1001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7014"
|
||||
granted_privilege="administer_workflow"
|
||||
object_id="-1001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7015"
|
||||
granted_privilege="administer_lifecyles"
|
||||
object_id="-1001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7016"
|
||||
granted_privilege="administer_categories"
|
||||
object_id="-1001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7017"
|
||||
granted_privilege="administer_content_types"
|
||||
object_id="-1001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7018"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7019"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7020"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7021"
|
||||
granted_privilege="approve_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7022"
|
||||
granted_privilege="publish_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7023"
|
||||
granted_privilege="delete_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7024"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7025"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7026"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7027"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7028"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7029"
|
||||
granted_privilege="approve_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7030"
|
||||
granted_privilege="publish_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7031"
|
||||
granted_privilege="delete_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7032"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7033"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7034"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6006"
|
||||
creation_date="2016-07-15"/>
|
||||
|
||||
|
||||
</dataset>
|
||||
|
||||
|
|
@ -0,0 +1,347 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dataset>
|
||||
|
||||
<ccm_core.ccm_revisions id="0"
|
||||
timestamp="1451602800" />
|
||||
|
||||
<ccm_core.ccm_objects object_id="-1001"
|
||||
display_name="info"
|
||||
uuid="963bcae7-3aeb-4b62-891c-e16c4defa1f2" />
|
||||
<ccm_core.ccm_objects object_id="-2001"
|
||||
display_name="info_root"
|
||||
uuid="82014239-9c06-486d-ae8c-4ae47f52a699" />
|
||||
<ccm_core.ccm_objects object_id="-2002"
|
||||
display_name="info_assets"
|
||||
uuid="b163f73c-9ac2-44d7-a037-de621f5ca828" />
|
||||
<ccm_core.ccm_objects object_id="-3001"
|
||||
display_name="article1"
|
||||
uuid="aed4b402-1180-46c6-b42d-7245f4dca248" />
|
||||
<ccm_core.ccm_objects object_id="-4001"
|
||||
display_name="org.libreccm.contenttypes.Article"
|
||||
uuid="2c8ec2fb-319d-4d44-9698-697c08b2b941" />
|
||||
<ccm_core.ccm_objects object_id="-4002"
|
||||
display_name="org.librecms.contenttypes.News"
|
||||
uuid="47740f22-f89f-4ec3-90cf-d62859e53c7e" />
|
||||
|
||||
|
||||
<ccm_core.ccm_objects_aud object_id="-3001"
|
||||
rev="0"
|
||||
revtype="0"
|
||||
display_name="article1" />
|
||||
|
||||
<ccm_core.resources object_id="-1001"
|
||||
created="2016-07-15" />
|
||||
<ccm_core.resource_titles object_id="-1001"
|
||||
locale="en"
|
||||
localized_value="info" />
|
||||
|
||||
<ccm_core.applications object_id="-1001"
|
||||
application_type="org.librecms.contentsection.ContentSection"
|
||||
primary_url="info" />
|
||||
|
||||
<ccm_core.categories object_id="-2001"
|
||||
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="-2002"
|
||||
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="-2001"
|
||||
locale="en"
|
||||
localized_value="info_root" />
|
||||
<ccm_core.category_titles object_id="-2002"
|
||||
locale="en"
|
||||
localized_value="info_assets" />
|
||||
|
||||
<ccm_cms.folders object_id="-2001"
|
||||
type="DOCUMENTS_FOLDER" />
|
||||
<ccm_cms.folders object_id="-2002"
|
||||
type="ASSETS_FOLDER" />
|
||||
|
||||
<ccm_cms.content_sections object_id="-1001"
|
||||
label="info"
|
||||
root_documents_folder_id="-2001"
|
||||
root_assets_folder_id="-2002" />
|
||||
|
||||
<ccm_cms.folder_content_section_map folder_id="-2001"
|
||||
content_section_id="-1001" />
|
||||
<ccm_cms.folder_content_section_map folder_id="-2002"
|
||||
content_section_id="-1001" />
|
||||
|
||||
<ccm_cms.content_types object_id="-4001"
|
||||
content_item_class="org.librecms.contenttypes.Article"
|
||||
content_section_id="-1001" />
|
||||
<ccm_cms.content_types object_id="-4002"
|
||||
content_item_class="org.librecms.contenttypes.News"
|
||||
content_section_id="-1001" />
|
||||
|
||||
<ccm_cms.content_type_labels object_id="-4001"
|
||||
locale="en"
|
||||
localized_value="Article" />
|
||||
<ccm_cms.content_type_labels object_id="-4002"
|
||||
locale="en"
|
||||
localized_value="News" />
|
||||
|
||||
<ccm_cms.content_items object_id="-3001"
|
||||
item_uuid="aed4b402-1180-46c6-b42d-7245f4dca248"
|
||||
version="DRAFT"
|
||||
content_type_id="-4001" />
|
||||
|
||||
<ccm_cms.content_items_aud object_id="-3001"
|
||||
rev="0"
|
||||
item_uuid="aed4b402-1180-46c6-b42d-7245f4dca248"
|
||||
version="DRAFT"
|
||||
content_type_id="-4001" />
|
||||
|
||||
<ccm_cms.content_item_names object_id="-3001"
|
||||
locale="en"
|
||||
localized_value="article1" />
|
||||
|
||||
<ccm_cms.content_item_names_aud rev="0"
|
||||
object_id="-3001"
|
||||
localized_value="article1"
|
||||
locale="en"
|
||||
revtype="0" />
|
||||
|
||||
<ccm_cms.content_item_titles object_id="-3001"
|
||||
locale="en"
|
||||
localized_value="Article 1" />
|
||||
|
||||
<ccm_cms.content_item_titles_aud rev="0"
|
||||
object_id="-3001"
|
||||
localized_value="Article 1"
|
||||
locale="en"
|
||||
revtype="0" />
|
||||
|
||||
<ccm_cms.articles object_id="-3001" />
|
||||
|
||||
<ccm_cms.articles_aud object_id="-3001"
|
||||
rev="0" />
|
||||
|
||||
<ccm_cms.article_texts
|
||||
object_id="-3001"
|
||||
locale="en"
|
||||
localized_value="Quisque varius turpis et nibh rhoncus consequat. In sapien metus, fermentum quis." />
|
||||
|
||||
<ccm_cms.article_texts_aud
|
||||
rev="0"
|
||||
object_id="-3001"
|
||||
localized_value="Quisque varius turpis et nibh rhoncus consequat. In sapien metus, fermentum quis."
|
||||
locale="en"
|
||||
revtype="0" />
|
||||
|
||||
<ccm_core.categorizations categorization_id="-5001"
|
||||
category_id="-2001"
|
||||
object_id="-3001"
|
||||
category_order="1"
|
||||
object_order="1"
|
||||
category_index="false"
|
||||
type="folder" />
|
||||
|
||||
<ccm_core.ccm_roles role_id="-6001"
|
||||
name="info_alert_recipient" />
|
||||
<ccm_core.ccm_roles role_id="-6002"
|
||||
name="info_author" />
|
||||
<ccm_core.ccm_roles role_id="-6003"
|
||||
name="info_editor" />
|
||||
<ccm_core.ccm_roles role_id="-6004"
|
||||
name="info_manager" />
|
||||
<ccm_core.ccm_roles role_id="-6005"
|
||||
name="info_publisher" />
|
||||
<ccm_core.ccm_roles role_id="-6006"
|
||||
name="info_content_reader" />
|
||||
|
||||
<ccm_cms.content_section_roles role_id="-6001"
|
||||
section_id="-1001" />
|
||||
<ccm_cms.content_section_roles role_id="-6002"
|
||||
section_id="-1001" />
|
||||
<ccm_cms.content_section_roles role_id="-6003"
|
||||
section_id="-1001" />
|
||||
<ccm_cms.content_section_roles role_id="-6004"
|
||||
section_id="-1001" />
|
||||
<ccm_cms.content_section_roles role_id="-6005"
|
||||
section_id="-1001" />
|
||||
<ccm_cms.content_section_roles role_id="-6006"
|
||||
section_id="-1001" />
|
||||
|
||||
<ccm_core.permissions permission_id="-7001"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6002"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7002"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6002"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7003"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6002"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7004"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6002"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7005"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6002"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7006"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7007"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7008"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7009"
|
||||
granted_privilege="approve_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7010"
|
||||
granted_privilege="delete_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7011"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7012"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6003"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7013"
|
||||
granted_privilege="administer_roles"
|
||||
object_id="-1001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7014"
|
||||
granted_privilege="administer_workflow"
|
||||
object_id="-1001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7015"
|
||||
granted_privilege="administer_lifecyles"
|
||||
object_id="-1001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7016"
|
||||
granted_privilege="administer_categories"
|
||||
object_id="-1001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7017"
|
||||
granted_privilege="administer_content_types"
|
||||
object_id="-1001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7018"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7019"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7020"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7021"
|
||||
granted_privilege="approve_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7022"
|
||||
granted_privilege="publish_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7023"
|
||||
granted_privilege="delete_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7024"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7025"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6004"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7026"
|
||||
granted_privilege="categorize_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7027"
|
||||
granted_privilege="create_new_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7028"
|
||||
granted_privilege="edit_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7029"
|
||||
granted_privilege="approve_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7030"
|
||||
granted_privilege="publish_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7031"
|
||||
granted_privilege="delete_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7032"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7033"
|
||||
granted_privilege="preview_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6005"
|
||||
creation_date="2016-07-15"/>
|
||||
<ccm_core.permissions permission_id="-7034"
|
||||
granted_privilege="view_published_items"
|
||||
object_id="-2001"
|
||||
grantee_id="-6006"
|
||||
creation_date="2016-07-15"/>
|
||||
|
||||
|
||||
</dataset>
|
||||
|
|
@ -176,7 +176,7 @@
|
|||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<!--<execution>
|
||||
<id>default-check</id>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
|
|
@ -195,7 +195,7 @@
|
|||
</rule>
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
</execution>-->
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@
|
|||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<!--<execution>
|
||||
<id>default-check</id>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
|
|
@ -212,7 +212,7 @@
|
|||
</rule>
|
||||
</rules>
|
||||
</configuration>
|
||||
</execution>
|
||||
</execution>-->
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
|||
Loading…
Reference in New Issue