First part of backporting new themeing system from 7.0
git-svn-id: https://svn.libreccm.org/ccm/trunk@5800 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
965ee740de
commit
13921534a4
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||||
|
name="ccm-pages"
|
||||||
|
prettyName="Pages"
|
||||||
|
version="6.0.0"
|
||||||
|
release="2"
|
||||||
|
webapp="ROOT">
|
||||||
|
|
||||||
|
<ccm:dependencies>
|
||||||
|
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||||
|
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
|
||||||
|
<ccm:requires name="ccm-subsite" version="6.6.0" relation="ge"/>
|
||||||
|
<ccm:requires name="ccm-ldn-terms" version="6.6.0" relation="ge"/>
|
||||||
|
</ccm:dependencies>
|
||||||
|
|
||||||
|
<ccm:contacts>
|
||||||
|
<ccm:contact uri="https://www.scientificcms.org" type="website"/>
|
||||||
|
<ccm:contact uri="mailto:info@scentificcms.org" type="support"/>
|
||||||
|
</ccm:contacts>
|
||||||
|
|
||||||
|
<ccm:description>
|
||||||
|
A backport of the new Pages application from 7.0.0. The Pages
|
||||||
|
application replaces ccm-navigation and the current JSP templates 7.0.0.
|
||||||
|
Pages has been backported to ease the migration to 7.0.0. This
|
||||||
|
application only if the ccm-theming application (another backport
|
||||||
|
from 7.0.0) is also installed.
|
||||||
|
</ccm:description>
|
||||||
|
|
||||||
|
</ccm:application>
|
||||||
|
|
@ -0,0 +1,116 @@
|
||||||
|
model org.libreccm.pagemodel;
|
||||||
|
|
||||||
|
import com.arsdigita.web.Application;
|
||||||
|
import com.arsdigita.kernel.ACSObject;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
|
||||||
|
object type PageModel {
|
||||||
|
|
||||||
|
BigDecimal[1..1] pageModelId = ccm_page_models.page_model_id INTEGER;
|
||||||
|
|
||||||
|
String[1..1] uuid = ccm_page_models.uuid VARCHAR(38);
|
||||||
|
|
||||||
|
String[1..1] modelUuid = ccm_page_models.model_uuid VARCHAR(38);
|
||||||
|
|
||||||
|
String[1..1] name = ccm_page_models.name VARCHAR(512);
|
||||||
|
|
||||||
|
String[1..1] pageModelVersion = ccm_page_models.page_model_version VARCHAR(256);
|
||||||
|
|
||||||
|
Date[0..1] lastModified = ccm_page_models.last_modified TIMESTAMP;
|
||||||
|
|
||||||
|
String[0..1] title = ccm_page_models.title VARCHAR(1024);
|
||||||
|
|
||||||
|
String[0..1] description = ccm_page_models.description VARCHAR(4096);
|
||||||
|
|
||||||
|
String[0..1] type = ccm_page_models.type VARCHAR(256);
|
||||||
|
|
||||||
|
Application[1..1] application = join ccm_page_models.application_id
|
||||||
|
to applications.application_id;
|
||||||
|
|
||||||
|
ContainerModel[0..n] containerModels = join ccm_page_models.page_model_id
|
||||||
|
to ccm_page_model_container_models.page_model_id;
|
||||||
|
|
||||||
|
object key(pageModelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
object type ContainerModel {
|
||||||
|
|
||||||
|
BigDecimal[1..1] containerModelId = ccm_page_model_container_models.container_model_id INTEGER;
|
||||||
|
|
||||||
|
String[1..1] uuid = ccm_page_model_container_models.uuid VARCHAR(38);
|
||||||
|
|
||||||
|
String[1..1] containerUuid = ccm_page_model_container_models.container_uuid VARCHAR(38);
|
||||||
|
|
||||||
|
String[1..1] key = ccm_page_model_container_models.key VARCHAR(256);
|
||||||
|
|
||||||
|
ComponentModel[0..n] componentModel = join ccm_page_model_container_models.container_model_id
|
||||||
|
to ccm_page_model_component_models.container_model_id;
|
||||||
|
|
||||||
|
object key(containerModelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
object type ComponentModel {
|
||||||
|
|
||||||
|
BigDecimal[1..1] componentModelId = ccm_page_model_component_models.component_model_id;
|
||||||
|
|
||||||
|
String[1..1] uuid = ccm_page_model_component_models.uuid VARCHAR(38);
|
||||||
|
|
||||||
|
String[1..1] componentModelUuid = ccm_page_model_component_models.component_model_uuid VARCHAR(38);
|
||||||
|
|
||||||
|
String[0..1] idAttribute = ccm_page_model_component_models.id_attribute VARCHAR(255);
|
||||||
|
|
||||||
|
String[0..1] classAttribute = ccm_page_model_component_models.class_attribute VARCHAR(512);
|
||||||
|
|
||||||
|
String[0..1] styleAttribute = ccm_page_model_component_models.style_attribute VARCHAR(1024);
|
||||||
|
|
||||||
|
String[0..1] key = ccm_page_model_component_models.component_key VARCHAR(255);
|
||||||
|
|
||||||
|
object key(componentModelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
object type CategoryTreeComponent extends ComponentModel {
|
||||||
|
|
||||||
|
Boolean[0..1] showFullTree = ccm_page_model_category_tree_components.show_full_tree BIT;
|
||||||
|
|
||||||
|
reference key(ccm_page_model_category_tree_components.component_model_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
object type ContentItemComponent extends ComponentModel {
|
||||||
|
|
||||||
|
String[0..1] mode = ccm_page_model_content_item_components.mode VARCHAR(255);
|
||||||
|
|
||||||
|
reference key(ccm_page_model_item_list_components.component_model_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
object type ItemListComponent extends ComponentModel {
|
||||||
|
|
||||||
|
Boolean[0..1] descending = ccm_page_model_item_list_components.descending BIT;
|
||||||
|
|
||||||
|
String[0..1] limitToType = ccm_page_model_item_list_components.limit_to_type VARCHAR(255);
|
||||||
|
|
||||||
|
Integer[0..1] pageSize = ccm_page_model_item_list_components.page_size INTEGER;
|
||||||
|
|
||||||
|
String[0..1] listOrder = ccm_page_model_item_list_components.list_order VARCHAR(255);
|
||||||
|
|
||||||
|
reference key(ccm_page_model_item_list_components.component_model_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
object type CategorizedItemComponent extends ContentItemComponent {
|
||||||
|
|
||||||
|
reference key(ccm_page_model_categorized_item_components.component_model_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
object type GreetingItemComponent extends ContentItemComponent {
|
||||||
|
|
||||||
|
reference key(ccm_page_model_greeting_item_components.component_model_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
object type FixedContentItemComponent extends ContentItemComponent {
|
||||||
|
|
||||||
|
ContentItem[0..1] contentItem = join ccm_page_model_fixed_content_item_components.content_item_id
|
||||||
|
to cms_items.item_id;
|
||||||
|
|
||||||
|
reference key(ccm_page_model_fixed_content_item_components.component_model_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
model org.librecms.pages.Pages;
|
||||||
|
|
||||||
|
import com.arsdigita.web.Application;
|
||||||
|
import com.arsdigita.kernel.ACSObject;
|
||||||
|
|
||||||
|
import com.arsdigita.subsite.Site;
|
||||||
|
|
||||||
|
import com.arsdigita.london.terms.Domain;
|
||||||
|
|
||||||
|
import org.libreccm.pagemodel.PageModel;
|
||||||
|
|
||||||
|
object type Pages extends Application {
|
||||||
|
|
||||||
|
Site[1..1] site = join ccm_pages.site_id
|
||||||
|
to subsite_sites.site_id;
|
||||||
|
|
||||||
|
Domain[1..1] domainCategory = join ccm_pages.domain_category_id
|
||||||
|
to cat_categories.category_id;
|
||||||
|
|
||||||
|
reference key(ccm_pages.page_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
object type Page extends ACSObject {
|
||||||
|
|
||||||
|
reference key(ccm_pages_pages.page_id);
|
||||||
|
|
||||||
|
PageModel[1..1] indexPageModel = join ccm_pages_pages.index_page_model_id
|
||||||
|
to ccm_page_models.page_model_id;
|
||||||
|
|
||||||
|
PageModel[1..1] itemPageModel = join ccm_pages_pages.item_page_model_id
|
||||||
|
to ccm_page_models.page_model_id;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
@ ddl/oracle-se/create.sql
|
||||||
|
|
||||||
|
@ ddl/oracle-se/deferred.sql
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
begin;
|
||||||
|
\i ddl/postgres/create.sql
|
||||||
|
\i ddl/postgres/deferred.sql
|
||||||
|
end;
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<registry>
|
||||||
|
</registry>
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
<load>
|
||||||
|
<requires>
|
||||||
|
<table name="inits"/>
|
||||||
|
<table name="acs_objects"/>
|
||||||
|
<initializer class="com.arsdigita.core.Initializer" />
|
||||||
|
</requires>
|
||||||
|
<provides>
|
||||||
|
<initializer class="org.librecms.pages.Initializer" />
|
||||||
|
</provides>
|
||||||
|
<scripts>
|
||||||
|
<schema directory="ccm-pages" />
|
||||||
|
<data class="org.librecms.pages.Loader" />
|
||||||
|
</scripts>
|
||||||
|
</load>
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package org.libreccm.pagemodel;
|
||||||
|
|
||||||
|
import com.arsdigita.domain.DomainObject;
|
||||||
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
import com.arsdigita.persistence.OID;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class ContainerModel extends DomainObject {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE = "org.libreccm.pagemodel.ContainerModel";
|
||||||
|
|
||||||
|
public ContainerModel(final DataObject dataObject) {
|
||||||
|
super(dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerModel(final OID oid) {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerModel(final BigDecimal containerModelId) {
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, containerModelId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package org.libreccm.pagemodel;
|
||||||
|
|
||||||
|
import com.arsdigita.domain.DomainCollection;
|
||||||
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
|
import com.arsdigita.persistence.DataCollection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class ContainerModelCollection extends DomainCollection {
|
||||||
|
|
||||||
|
public ContainerModelCollection(final DataCollection dataCollection) {
|
||||||
|
super(dataCollection);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerModel getContainerModel() {
|
||||||
|
return (ContainerModel) DomainObjectFactory
|
||||||
|
.newInstance(m_dataCollection.getDataObject());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,151 @@
|
||||||
|
package org.libreccm.pagemodel;
|
||||||
|
|
||||||
|
import com.arsdigita.domain.DomainObject;
|
||||||
|
import com.arsdigita.persistence.DataCollection;
|
||||||
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
import com.arsdigita.persistence.OID;
|
||||||
|
import com.arsdigita.web.Application;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class PageModel extends DomainObject {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE = "org.libreccm.pagemodel.PageModel";
|
||||||
|
|
||||||
|
public static final String PAGE_MODEL_ID = "pageModelId";
|
||||||
|
|
||||||
|
public static final String UUID = "uuid";
|
||||||
|
|
||||||
|
public static final String MODEL_UUID = "modelUuid";
|
||||||
|
|
||||||
|
public static final String NAME = "name";
|
||||||
|
|
||||||
|
public static final String PAGE_MODEL_VERSION = "pageModelVersion";
|
||||||
|
|
||||||
|
public static final String LAST_MODIFIED = "lastModified";
|
||||||
|
|
||||||
|
public static final String TITLE = "title";
|
||||||
|
|
||||||
|
public static final String DESCRIPTION = "description";
|
||||||
|
|
||||||
|
public static final String TYPE = "type";
|
||||||
|
|
||||||
|
public static final String APPLICATION = "application";
|
||||||
|
|
||||||
|
public static final String CONTAINER_MODELS = "containerModels";
|
||||||
|
|
||||||
|
public PageModel(final OID oid) {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageModel(final BigDecimal pageModelId) {
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, pageModelId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageModel(final DataObject dataObject) {
|
||||||
|
super(dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPageModelId() {
|
||||||
|
return (BigDecimal) get(PAGE_MODEL_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setPageModelId(final BigDecimal pageModelId) {
|
||||||
|
set(PAGE_MODEL_ID, pageModelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUuid() {
|
||||||
|
return (String) get(UUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setUuid(final String uuid) {
|
||||||
|
set(UUID, uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModelUuid() {
|
||||||
|
return (String) get(MODEL_UUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setModelUuid(final String modelUuid) {
|
||||||
|
set(MODEL_UUID, modelUuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return (String) get(NAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(final String name) {
|
||||||
|
set(NAME, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVersion() {
|
||||||
|
return (String) get(PAGE_MODEL_VERSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setVersion(final String pageModelVersion) {
|
||||||
|
|
||||||
|
set(PAGE_MODEL_VERSION, pageModelVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getLastModified() {
|
||||||
|
return (Date) get(LAST_MODIFIED);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setLastModified(final Date lastModified) {
|
||||||
|
set(LAST_MODIFIED, lastModified);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return (String) get(TITLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setTitle(final String title) {
|
||||||
|
set(TITLE, title);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return (String) get(DESCRIPTION);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(final String description) {
|
||||||
|
set(DESCRIPTION, description);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Application getApplication() {
|
||||||
|
return (Application) get(APPLICATION);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApplication(final Application application) {
|
||||||
|
setAssociation(APPLICATION, application);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return (String) get(TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(final String type) {
|
||||||
|
set(TYPE, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContainerModelCollection getContainerModels() {
|
||||||
|
final DataCollection dataCollection = (DataCollection) get(
|
||||||
|
CONTAINER_MODELS);
|
||||||
|
|
||||||
|
return new ContainerModelCollection(dataCollection);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addContainerModel(final ContainerModel containerModel) {
|
||||||
|
|
||||||
|
add(CONTAINER_MODELS, containerModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void removeContainerModel(final ContainerModel containerModel) {
|
||||||
|
|
||||||
|
remove(CONTAINER_MODELS, containerModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,80 @@
|
||||||
|
package org.librecms.pages;
|
||||||
|
|
||||||
|
import com.arsdigita.categorization.Category;
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
|
import com.arsdigita.london.terms.Domain;
|
||||||
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
import com.arsdigita.persistence.OID;
|
||||||
|
import com.arsdigita.subsite.Site;
|
||||||
|
import com.arsdigita.web.Application;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
public class Pages extends Application {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE = "org.librecms.cms.Pages";
|
||||||
|
|
||||||
|
public static final String SITE = "site";
|
||||||
|
public static final String DOMAIN_CATEGORY = "domainCategory";
|
||||||
|
|
||||||
|
public Pages(final OID oid) {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pages(final DataObject dataObject) {
|
||||||
|
super(dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Pages(final BigDecimal pagesId) throws DataObjectNotFoundException {
|
||||||
|
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, pagesId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Site getSite() {
|
||||||
|
|
||||||
|
final Object obj = get(SITE);
|
||||||
|
|
||||||
|
if (obj == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return (Site) obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSite(final Site site) {
|
||||||
|
|
||||||
|
setAssociation(SITE, site);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Domain getCategoryDomain() {
|
||||||
|
|
||||||
|
final Object dataObject = get(DOMAIN_CATEGORY);
|
||||||
|
|
||||||
|
if (dataObject == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
final Category domainCategory = (Category) dataObject;
|
||||||
|
|
||||||
|
return Domain.findByModel(domainCategory);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setCategoryDomain(final Domain domain) {
|
||||||
|
|
||||||
|
final Category domainCategory;
|
||||||
|
if (domain == null) {
|
||||||
|
domainCategory = null;
|
||||||
|
} else {
|
||||||
|
domainCategory = domain.getModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
setAssociation(DOMAIN_CATEGORY, domainCategory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getServletPath() {
|
||||||
|
return "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue