- More classes for the backport of Pages and Theming from 7.0
- Two classes for ccm-ldn-terms which were missed in a previous commit git-svn-id: https://svn.libreccm.org/ccm/trunk@5801 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
13921534a4
commit
7212f10705
|
|
@ -0,0 +1,113 @@
|
||||||
|
package org.libreccm.categorization;
|
||||||
|
|
||||||
|
import com.arsdigita.domain.DomainCollection;
|
||||||
|
import com.arsdigita.domain.DomainObject;
|
||||||
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
|
import com.arsdigita.london.terms.Domain;
|
||||||
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
import com.arsdigita.web.WebConfig;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonEncoding;
|
||||||
|
import com.fasterxml.jackson.core.JsonFactory;
|
||||||
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
|
import org.libreccm.export.AbstractDomainObjectsExporter;
|
||||||
|
import org.libreccm.export.IdSequence;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.UncheckedIOException;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class DomainOwnershipsExporter
|
||||||
|
extends AbstractDomainObjectsExporter<Domain> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Domain> exportsType() {
|
||||||
|
return Domain.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String exportsBaseDataObjectType() {
|
||||||
|
return Domain.BASE_DATA_OBJECT_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String convertsToType() {
|
||||||
|
return "org.libreccm.categorization.DomainOwnership";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<String> exportDomainObject(final Domain domainObject,
|
||||||
|
final Path targetDir) {
|
||||||
|
|
||||||
|
final DomainCollection useContexts = domainObject.getUseContexts();
|
||||||
|
|
||||||
|
final List<String> uuids = new ArrayList<>();
|
||||||
|
while (useContexts.next()) {
|
||||||
|
|
||||||
|
final String uuid = generateDomainOwnership(useContexts
|
||||||
|
.getDomainObject(),
|
||||||
|
domainObject,
|
||||||
|
targetDir);
|
||||||
|
uuids.add(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
return uuids;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String generateDomainOwnership(final DomainObject useContext,
|
||||||
|
final Domain domain,
|
||||||
|
final Path targetDir) {
|
||||||
|
|
||||||
|
final DomainObject owner = DomainObjectFactory
|
||||||
|
.newInstance((DataObject) useContext.get("categoryOwner"));
|
||||||
|
final String context = (String) useContext.get("useContext");
|
||||||
|
|
||||||
|
final byte[] uuidSource = String.format(
|
||||||
|
"%s/%s-%s-%s",
|
||||||
|
WebConfig.getInstanceOf().getSiteName(),
|
||||||
|
owner.getOID().toString(),
|
||||||
|
useContext.getOID().toString(),
|
||||||
|
domain.getOID().toString())
|
||||||
|
.getBytes(StandardCharsets.UTF_8);
|
||||||
|
final String uuid = UUID.nameUUIDFromBytes(uuidSource).toString();
|
||||||
|
final Path targetFilePath = targetDir
|
||||||
|
.resolve("org.libreccm.categorization.Categorization")
|
||||||
|
.resolve(String.format("%s.json", uuid));
|
||||||
|
final File targetFile = targetFilePath.toFile();
|
||||||
|
|
||||||
|
final JsonFactory jsonFactory = new JsonFactory();
|
||||||
|
try (JsonGenerator jsonGenerator = jsonFactory
|
||||||
|
.createGenerator(targetFile, JsonEncoding.UTF8)) {
|
||||||
|
|
||||||
|
setPrettyPrinter(jsonGenerator);
|
||||||
|
|
||||||
|
jsonGenerator.writeStartObject();
|
||||||
|
|
||||||
|
jsonGenerator.writeNumberField("ownershipId",
|
||||||
|
IdSequence.getInstance().nextId());
|
||||||
|
jsonGenerator.writeStringField("uuid", uuid);
|
||||||
|
|
||||||
|
jsonGenerator.writeStringField("domain",
|
||||||
|
generateUuid(domain));
|
||||||
|
jsonGenerator.writeStringField("owner", generateUuid(owner));
|
||||||
|
jsonGenerator.writeStringField("context", context);
|
||||||
|
|
||||||
|
jsonGenerator.writeEndObject();
|
||||||
|
} catch(IOException ex) {
|
||||||
|
throw new UncheckedIOException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
package org.libreccm.categorization;
|
||||||
|
|
||||||
|
import com.arsdigita.categorization.Category;
|
||||||
|
import com.arsdigita.domain.DomainObjectFactory;
|
||||||
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
|
import com.arsdigita.london.terms.Domain;
|
||||||
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
import com.arsdigita.util.UncheckedWrapperException;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonEncoding;
|
||||||
|
import com.fasterxml.jackson.core.JsonFactory;
|
||||||
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
|
import org.libreccm.export.AbstractDomainObjectsExporter;
|
||||||
|
import org.libreccm.export.IdSequence;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class DomainsExporter extends AbstractDomainObjectsExporter<Domain> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<Domain> exportsType() {
|
||||||
|
return Domain.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String exportsBaseDataObjectType() {
|
||||||
|
return Domain.BASE_DATA_OBJECT_TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String convertsToType() {
|
||||||
|
return "org.libreccm.categorization.Domain";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<String> exportDomainObject(final Domain domainObject,
|
||||||
|
final Path targetDir) {
|
||||||
|
|
||||||
|
final String uuid = generateUuid(domainObject);
|
||||||
|
|
||||||
|
final Path targetFilePath = targetDir
|
||||||
|
.resolve("org.libreccm.categorization.Categorization")
|
||||||
|
.resolve(String.format("%s.json", uuid));
|
||||||
|
final File targetFile = targetFilePath.toFile();
|
||||||
|
|
||||||
|
final JsonFactory jsonFactory = new JsonFactory();
|
||||||
|
try (JsonGenerator jsonGenerator = jsonFactory
|
||||||
|
.createGenerator(targetFile, JsonEncoding.UTF8)) {
|
||||||
|
|
||||||
|
setPrettyPrinter(jsonGenerator);
|
||||||
|
|
||||||
|
jsonGenerator.writeStartObject();
|
||||||
|
|
||||||
|
jsonGenerator.writeNumberField("objectId",
|
||||||
|
IdSequence.getInstance().nextId());
|
||||||
|
jsonGenerator.writeStringField("uuid", uuid);
|
||||||
|
jsonGenerator.writeStringField("domainKey", domainObject.getKey());
|
||||||
|
jsonGenerator.writeStringField("uri",
|
||||||
|
domainObject.getURL().toString());
|
||||||
|
|
||||||
|
jsonGenerator.writeObjectFieldStart("title");
|
||||||
|
jsonGenerator.writeStringField(
|
||||||
|
KernelConfig.getConfig().getDefaultLanguage(),
|
||||||
|
domainObject.getTitle());
|
||||||
|
jsonGenerator.writeEndObject();
|
||||||
|
|
||||||
|
final Category root = (Category) DomainObjectFactory
|
||||||
|
.newInstance((DataObject) domainObject.get("model"));
|
||||||
|
final String rootCategoryUuid = generateUuid(root);
|
||||||
|
jsonGenerator.writeStringField("rootCategory", rootCategoryUuid);
|
||||||
|
|
||||||
|
jsonGenerator.writeEndObject();
|
||||||
|
|
||||||
|
} catch (IOException ex) {
|
||||||
|
throw new UncheckedWrapperException(ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Arrays.asList(new String[]{uuid});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -44,6 +44,9 @@ object type ContainerModel {
|
||||||
|
|
||||||
String[1..1] key = ccm_page_model_container_models.key VARCHAR(256);
|
String[1..1] key = ccm_page_model_container_models.key VARCHAR(256);
|
||||||
|
|
||||||
|
PageModel[1..1] pageModel = join ccm_page_model_container_models.page_model_id
|
||||||
|
to ccm_page_models.page_model_id;
|
||||||
|
|
||||||
ComponentModel[0..n] componentModel = join ccm_page_model_container_models.container_model_id
|
ComponentModel[0..n] componentModel = join ccm_page_model_container_models.container_model_id
|
||||||
to ccm_page_model_component_models.container_model_id;
|
to ccm_page_model_component_models.container_model_id;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package org.libreccm.pagemodel;
|
||||||
|
|
||||||
|
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 CategorizedItemComponent extends ContentItemComponent {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE
|
||||||
|
= "org.libreccm.pagemodel.CategorizedItemComponent";
|
||||||
|
|
||||||
|
public CategorizedItemComponent(final DataObject dataObject) {
|
||||||
|
|
||||||
|
super(dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CategorizedItemComponent(final OID oid) {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CategorizedItemComponent(final BigDecimal componentModelId) {
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, componentModelId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package org.libreccm.pagemodel;
|
||||||
|
|
||||||
|
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 CategoryTreeComponent extends ComponentModel {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE = "org.libreccm.pagemodel.CategoryTreeComponent";
|
||||||
|
|
||||||
|
public static final String SHOW_FULL_TREE = "showFullTree";
|
||||||
|
|
||||||
|
public CategoryTreeComponent(final DataObject dataObject) {
|
||||||
|
|
||||||
|
super(dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CategoryTreeComponent(final OID oid) {
|
||||||
|
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CategoryTreeComponent(final BigDecimal componentModelId) {
|
||||||
|
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, componentModelId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isShowFullTree() {
|
||||||
|
|
||||||
|
return (Boolean) get(SHOW_FULL_TREE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShowFullTree(final Boolean showFullTree) {
|
||||||
|
|
||||||
|
set(SHOW_FULL_TREE, showFullTree);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
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 ComponentModel extends DomainObject {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE = "org.libreccm.pagemodel.ComponentModel";
|
||||||
|
|
||||||
|
public static final String COMPONENT_MODEL_ID = "componentModelId";
|
||||||
|
|
||||||
|
public static final String UUID = "uuid";
|
||||||
|
|
||||||
|
public static final String MODEL_UUID = "modelUuid";
|
||||||
|
|
||||||
|
public static final String ID_ATTRIBUTE = "idAttribute";
|
||||||
|
|
||||||
|
public static final String CLASS_ATTRIBUTE = "classAttribute";
|
||||||
|
|
||||||
|
public static final String STYLE_ATTRIBUTE = "styleAttribute";
|
||||||
|
|
||||||
|
public static final String KEY = "key";
|
||||||
|
|
||||||
|
public ComponentModel(final DataObject dataObject) {
|
||||||
|
super(dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ComponentModel(final OID oid) {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ComponentModel(final BigDecimal componentModelId) {
|
||||||
|
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, componentModelId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getComponentModelId() {
|
||||||
|
return (BigDecimal) get(COMPONENT_MODEL_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setComponentModelId(final BigDecimal componentModelId) {
|
||||||
|
set(COMPONENT_MODEL_ID, componentModelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
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 getIdAttribute() {
|
||||||
|
|
||||||
|
return (String) get(ID_ATTRIBUTE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIdAttribute(final String idAttribute) {
|
||||||
|
|
||||||
|
set(ID_ATTRIBUTE, idAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getClassAttribute() {
|
||||||
|
|
||||||
|
return (String) get(CLASS_ATTRIBUTE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClassAttribute(final String classAttribute) {
|
||||||
|
|
||||||
|
set(CLASS_ATTRIBUTE, classAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStyleAttribute(final String styleAttribute) {
|
||||||
|
|
||||||
|
return (String) get(STYLE_ATTRIBUTE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStyleAttribute(final String styleAttribute) {
|
||||||
|
|
||||||
|
set(STYLE_ATTRIBUTE, styleAttribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKey() {
|
||||||
|
|
||||||
|
return (String) get(KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKey(final String key) {
|
||||||
|
|
||||||
|
set(KEY, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
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 ComponentModelCollection extends DomainCollection {
|
||||||
|
|
||||||
|
public ComponentModelCollection(final DataCollection dataCollection) {
|
||||||
|
|
||||||
|
super(dataCollection);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ComponentModel getComponentModel() {
|
||||||
|
|
||||||
|
return (ComponentModel) DomainObjectFactory
|
||||||
|
.newInstance(m_dataCollection.getDataObject());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
package org.libreccm.pagemodel;
|
package org.libreccm.pagemodel;
|
||||||
|
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
|
import com.arsdigita.persistence.DataCollection;
|
||||||
import com.arsdigita.persistence.DataObject;
|
import com.arsdigita.persistence.DataObject;
|
||||||
import com.arsdigita.persistence.OID;
|
import com.arsdigita.persistence.OID;
|
||||||
|
|
||||||
|
|
@ -19,6 +20,18 @@ public class ContainerModel extends DomainObject {
|
||||||
|
|
||||||
public static final String BASE_DATA_OBJECT_TYPE = "org.libreccm.pagemodel.ContainerModel";
|
public static final String BASE_DATA_OBJECT_TYPE = "org.libreccm.pagemodel.ContainerModel";
|
||||||
|
|
||||||
|
public static final String CONTAINER_ID = "containerId";
|
||||||
|
|
||||||
|
public static final String UUID = "uuid";
|
||||||
|
|
||||||
|
public static final String CONTAINER_UUID = "containerUuid";
|
||||||
|
|
||||||
|
public static final String KEY = "key";
|
||||||
|
|
||||||
|
public static final String PAGE_MODEL = "pageModel";
|
||||||
|
|
||||||
|
public static final String COMPONENT_MODEL = "componentModel";
|
||||||
|
|
||||||
public ContainerModel(final DataObject dataObject) {
|
public ContainerModel(final DataObject dataObject) {
|
||||||
super(dataObject);
|
super(dataObject);
|
||||||
}
|
}
|
||||||
|
|
@ -31,6 +44,70 @@ public class ContainerModel extends DomainObject {
|
||||||
this(new OID(BASE_DATA_OBJECT_TYPE, containerModelId));
|
this(new OID(BASE_DATA_OBJECT_TYPE, containerModelId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getContainerModelId() {
|
||||||
|
return (BigDecimal) get(CONTAINER_ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setContainerModelId(final BigDecimal containerModelId) {
|
||||||
|
|
||||||
|
set(CONTAINER_ID, containerModelId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUuid() {
|
||||||
|
return (String) get(UUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setUuid(final String uuid) {
|
||||||
|
|
||||||
|
set(UUID, uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContainerUuid() {
|
||||||
|
|
||||||
|
return (String) get(CONTAINER_UUID);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setContainerUuid(final String containerUuid) {
|
||||||
|
|
||||||
|
set(CONTAINER_UUID, containerUuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getKey() {
|
||||||
|
|
||||||
|
return (String) get(KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setKey(final String key) {
|
||||||
|
|
||||||
|
set(KEY, key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageModel getPageModel() {
|
||||||
|
|
||||||
|
return (PageModel) get(PAGE_MODEL);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void setPageModel(final PageModel pageModel) {
|
||||||
|
|
||||||
|
setAssociation(PAGE_MODEL, pageModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ComponentModelCollection getComponents() {
|
||||||
|
|
||||||
|
final DataCollection dataCollection = (DataCollection) get(
|
||||||
|
COMPONENT_MODEL);
|
||||||
|
|
||||||
|
return new ComponentModelCollection(dataCollection);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void addComponent(final ComponentModel component) {
|
||||||
|
|
||||||
|
add(COMPONENT_MODEL, component);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void removeComponent(final ComponentModel component) {
|
||||||
|
|
||||||
|
remove(COMPONENT_MODEL, component);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package org.libreccm.pagemodel;
|
||||||
|
|
||||||
|
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 ContentItemComponent extends ComponentModel {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE
|
||||||
|
= "org.libreccm.pagemodel.ContentItemComponent";
|
||||||
|
|
||||||
|
public static final String MODE = "mode";
|
||||||
|
|
||||||
|
public ContentItemComponent(final DataObject dataObject) {
|
||||||
|
|
||||||
|
super(dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentItemComponent(final OID oid) {
|
||||||
|
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentItemComponent(final BigDecimal componentModelId) {
|
||||||
|
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, componentModelId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMode() {
|
||||||
|
return (String) get(MODE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMode(final String mode) {
|
||||||
|
|
||||||
|
set(MODE, mode);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package org.libreccm.pagemodel;
|
||||||
|
|
||||||
|
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 GreetingItemComponent extends ContentItemComponent {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE
|
||||||
|
= "org.libreccm.pagemodel.GreetingItemComponent";
|
||||||
|
|
||||||
|
public GreetingItemComponent(final DataObject dataObject) {
|
||||||
|
|
||||||
|
super(dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GreetingItemComponent(final OID oid) {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GreetingItemComponent(final BigDecimal componentModelId) {
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, componentModelId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
package org.libreccm.pagemodel;
|
||||||
|
|
||||||
|
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 ItemListComponent extends ComponentModel {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE = "org.libreccm.pagemodel.ItemListComponent";
|
||||||
|
|
||||||
|
public static final String DESCENDING = "descending";
|
||||||
|
|
||||||
|
public static final String LIMIT_TO_TYPE = "limitToType";
|
||||||
|
|
||||||
|
public static final String PAGE_SIZE = "pageSize";
|
||||||
|
|
||||||
|
public static final String PROPERTIES = "properties";
|
||||||
|
|
||||||
|
public ItemListComponent(final DataObject dataObject) {
|
||||||
|
super(dataObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemListComponent(final OID oid) {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemListComponent(final BigDecimal componentModelId) {
|
||||||
|
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, componentModelId));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean isDescending() {
|
||||||
|
|
||||||
|
return (Boolean) get(DESCENDING);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescending(final Boolean descending) {
|
||||||
|
|
||||||
|
set(DESCENDING, descending);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLimitToType() {
|
||||||
|
|
||||||
|
return (String) get(LIMIT_TO_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimitToType(final String limitToType) {
|
||||||
|
|
||||||
|
set(LIMIT_TO_TYPE, limitToType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPageSize() {
|
||||||
|
|
||||||
|
return (Integer)get(PAGE_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPageSize(final Integer pageSize) {
|
||||||
|
|
||||||
|
set(PAGE_SIZE, pageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getProperties() {
|
||||||
|
|
||||||
|
return (String) get(PROPERTIES);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProperties(final String properties) {
|
||||||
|
|
||||||
|
set(PROPERTIES, properties);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue