CCM NG: Assets
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@6155 8810af33-2d31-482b-a856-94f89814c4dfccm-docs
parent
33aad81580
commit
bb060424c6
|
|
@ -150,12 +150,7 @@ public abstract class AbstractAssetForm<T extends Asset>
|
||||||
|
|
||||||
target.clearOptions();
|
target.clearOptions();
|
||||||
|
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final List<Locale> availableLocales = getController()
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
final AbstractAssetFormController<T> controller
|
|
||||||
= cdiUtil
|
|
||||||
.findBean(AbstractAssetFormController.class);
|
|
||||||
final List<Locale> availableLocales = controller
|
|
||||||
.availableLocales(selectedAssetId,
|
.availableLocales(selectedAssetId,
|
||||||
getAssetClass());
|
getAssetClass());
|
||||||
availableLocales.sort((locale1, locale2) -> {
|
availableLocales.sort((locale1, locale2) -> {
|
||||||
|
|
@ -213,13 +208,7 @@ public abstract class AbstractAssetForm<T extends Asset>
|
||||||
|
|
||||||
target.clearOptions();
|
target.clearOptions();
|
||||||
|
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final List<Locale> creatableLocales = getController()
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
final AbstractAssetFormController<T> controller
|
|
||||||
= cdiUtil
|
|
||||||
.findBean(AbstractAssetFormController.class);
|
|
||||||
|
|
||||||
final List<Locale> creatableLocales = controller
|
|
||||||
.creatableLocales(selectedAssetId,
|
.creatableLocales(selectedAssetId,
|
||||||
getAssetClass());
|
getAssetClass());
|
||||||
creatableLocales.sort((locale1, locale2) -> {
|
creatableLocales.sort((locale1, locale2) -> {
|
||||||
|
|
@ -302,17 +291,15 @@ public abstract class AbstractAssetForm<T extends Asset>
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
final AbstractAssetFormController<T> controller = cdiUtil
|
|
||||||
.findBean(AbstractAssetFormController.class);
|
|
||||||
showLocaleSelect.setValue(state,
|
showLocaleSelect.setValue(state,
|
||||||
getSelectedLocale(state));
|
getSelectedLocale(state));
|
||||||
|
|
||||||
data = controller.getAssetData(selectedAssetId,
|
data = getController().getAssetData(selectedAssetId,
|
||||||
getAssetClass(),
|
getAssetClass(),
|
||||||
getSelectedLocale(state));
|
getSelectedLocale(state));
|
||||||
|
|
||||||
|
name.setValue(state,
|
||||||
|
data.get(AbstractAssetFormController.DISPLAY_NAME));
|
||||||
title.setValue(state,
|
title.setValue(state,
|
||||||
data.get(AbstractAssetFormController.TITLE));
|
data.get(AbstractAssetFormController.TITLE));
|
||||||
}
|
}
|
||||||
|
|
@ -350,7 +337,6 @@ public abstract class AbstractAssetForm<T extends Asset>
|
||||||
// @SuppressWarnings("unchecked")
|
// @SuppressWarnings("unchecked")
|
||||||
// final AbstractAssetFormController<T> controller = cdiUtil
|
// final AbstractAssetFormController<T> controller = cdiUtil
|
||||||
// .findBean(AbstractAssetFormController.class);
|
// .findBean(AbstractAssetFormController.class);
|
||||||
|
|
||||||
title.setValue(state,
|
title.setValue(state,
|
||||||
data.get(AbstractAssetFormController.TITLE));
|
data.get(AbstractAssetFormController.TITLE));
|
||||||
showLocale(state);
|
showLocale(state);
|
||||||
|
|
@ -385,7 +371,6 @@ public abstract class AbstractAssetForm<T extends Asset>
|
||||||
|
|
||||||
if (saveCancelSection.getSaveButton().isSelected(state)) {
|
if (saveCancelSection.getSaveButton().isSelected(state)) {
|
||||||
|
|
||||||
final Long selectedAssetId = getSelectedAssetId(state);
|
|
||||||
final Map<String, Object> data = new HashMap<>();
|
final Map<String, Object> data = new HashMap<>();
|
||||||
data.put(AbstractAssetFormController.DISPLAY_NAME,
|
data.put(AbstractAssetFormController.DISPLAY_NAME,
|
||||||
name.getValue(state));
|
name.getValue(state));
|
||||||
|
|
@ -393,6 +378,20 @@ public abstract class AbstractAssetForm<T extends Asset>
|
||||||
title.getValue(state));
|
title.getValue(state));
|
||||||
data.putAll(collectData(event));
|
data.putAll(collectData(event));
|
||||||
|
|
||||||
|
final Long selectedAssetId;
|
||||||
|
if (getSelectedAssetId(state) == null) {
|
||||||
|
|
||||||
|
selectedAssetId = getController()
|
||||||
|
.createAsset(assetPane
|
||||||
|
.getFolderSelectionModel()
|
||||||
|
.getSelectedObject(state),
|
||||||
|
getSelectedLocale(state),
|
||||||
|
getAssetClass(),
|
||||||
|
data);
|
||||||
|
} else {
|
||||||
|
selectedAssetId = getSelectedAssetId(state);
|
||||||
|
}
|
||||||
|
|
||||||
getController().updateAsset(selectedAssetId,
|
getController().updateAsset(selectedAssetId,
|
||||||
getSelectedLocale(state),
|
getSelectedLocale(state),
|
||||||
getAssetClass(),
|
getAssetClass(),
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,9 @@ package com.arsdigita.cms.ui.assets;
|
||||||
|
|
||||||
import org.librecms.assets.AssetL10NManager;
|
import org.librecms.assets.AssetL10NManager;
|
||||||
import org.librecms.contentsection.Asset;
|
import org.librecms.contentsection.Asset;
|
||||||
|
import org.librecms.contentsection.AssetManager;
|
||||||
import org.librecms.contentsection.AssetRepository;
|
import org.librecms.contentsection.AssetRepository;
|
||||||
|
import org.librecms.contentsection.Folder;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
@ -44,6 +46,9 @@ public abstract class AbstractAssetFormController<T extends Asset> implements
|
||||||
protected static final String DISPLAY_NAME = "displayName";
|
protected static final String DISPLAY_NAME = "displayName";
|
||||||
protected static final String TITLE = "title";
|
protected static final String TITLE = "title";
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private AssetManager assetManager;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AssetRepository assetRepository;
|
private AssetRepository assetRepository;
|
||||||
|
|
||||||
|
|
@ -86,6 +91,36 @@ public abstract class AbstractAssetFormController<T extends Asset> implements
|
||||||
protected abstract Map<String, Object> getAssetData(
|
protected abstract Map<String, Object> getAssetData(
|
||||||
final T asset, final Locale selectedLocale);
|
final T asset, final Locale selectedLocale);
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
@Override
|
||||||
|
public long createAsset(final Folder infolder,
|
||||||
|
final Locale selectedLocale,
|
||||||
|
final Class<T> assetType,
|
||||||
|
final Map<String, Object> data) {
|
||||||
|
|
||||||
|
if (!data.containsKey(DISPLAY_NAME)) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"data does not contain a value for displayName.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!data.containsKey(TITLE)) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"data does not contain a value for title.");
|
||||||
|
}
|
||||||
|
|
||||||
|
final String name = (String) data.get(DISPLAY_NAME);
|
||||||
|
final String title = (String) data.get(TITLE);
|
||||||
|
|
||||||
|
final T asset = assetManager
|
||||||
|
.createAsset(name,
|
||||||
|
title,
|
||||||
|
selectedLocale,
|
||||||
|
infolder,
|
||||||
|
assetType);
|
||||||
|
|
||||||
|
return asset.getObjectId();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the provided asset with the provided data.
|
* Updates the provided asset with the provided data.
|
||||||
*
|
*
|
||||||
|
|
@ -109,18 +144,11 @@ public abstract class AbstractAssetFormController<T extends Asset> implements
|
||||||
final Class<T> assetType,
|
final Class<T> assetType,
|
||||||
final Map<String, Object> data) {
|
final Map<String, Object> data) {
|
||||||
|
|
||||||
Objects.requireNonNull(assetId, "Can't update asset null.");
|
|
||||||
Objects.requireNonNull(selectedLocale,
|
Objects.requireNonNull(selectedLocale,
|
||||||
"Can't get update asset for locale null.");
|
"Can't get update asset for locale null.");
|
||||||
Objects.requireNonNull(data, "Can't update asset without data.");
|
Objects.requireNonNull(data, "Can't update asset without data.");
|
||||||
|
|
||||||
final T asset;
|
final T asset = loadAsset(assetId, assetType);
|
||||||
if (assetId == null) {
|
|
||||||
asset = createAsset();
|
|
||||||
} else {
|
|
||||||
asset = loadAsset(assetId, assetType);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.containsKey(DISPLAY_NAME)) {
|
if (data.containsKey(DISPLAY_NAME)) {
|
||||||
asset.setDisplayName((String) data.get(DISPLAY_NAME));
|
asset.setDisplayName((String) data.get(DISPLAY_NAME));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
package com.arsdigita.cms.ui.assets;
|
package com.arsdigita.cms.ui.assets;
|
||||||
|
|
||||||
import org.librecms.contentsection.Asset;
|
import org.librecms.contentsection.Asset;
|
||||||
|
import org.librecms.contentsection.Folder;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
@ -70,7 +71,12 @@ public interface AssetFormController<T extends Asset> {
|
||||||
Class<T> assetType,
|
Class<T> assetType,
|
||||||
Map<String, Object> data);
|
Map<String, Object> data);
|
||||||
|
|
||||||
T createAsset();
|
long createAsset(Folder inFolder,
|
||||||
|
Locale selectedLocale,
|
||||||
|
Class<T> assetType,
|
||||||
|
Map<String, Object> data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines in which locales the provided asset is available.
|
* Determines in which locales the provided asset is available.
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import org.librecms.contentsection.Asset;
|
||||||
import org.librecms.contentsection.AssetRepository;
|
import org.librecms.contentsection.AssetRepository;
|
||||||
import org.librecms.contentsection.ContentSection;
|
import org.librecms.contentsection.ContentSection;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -91,33 +92,20 @@ public class AssetSearchWidget extends Widget {
|
||||||
final Long value = (Long) getValue(state);
|
final Long value = (Long) getValue(state);
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
final AssetRepository assetRepo = cdiUtil
|
final AssetSearchWidgetController controller = cdiUtil
|
||||||
.findBean(AssetRepository.class);
|
.findBean(AssetSearchWidgetController.class);
|
||||||
final AssetTypesManager typesManager = cdiUtil
|
|
||||||
.findBean(AssetTypesManager.class);
|
|
||||||
final GlobalizationHelper globalizationHelper = cdiUtil
|
|
||||||
.findBean(GlobalizationHelper.class);
|
|
||||||
|
|
||||||
final Asset asset = assetRepo
|
final Map<String, String> data = controller.getData(value);
|
||||||
.findById(value)
|
|
||||||
.orElseThrow(() -> new IllegalArgumentException(String.format(
|
|
||||||
"No Asset with ID %d in the database.", value)));
|
|
||||||
|
|
||||||
final Element selected = widget
|
final Element selected = widget
|
||||||
.newChildElement("cms:selected-asset", CMS.CMS_XML_NS);
|
.newChildElement("cms:selected-asset", CMS.CMS_XML_NS);
|
||||||
selected.addAttribute("assetId",
|
|
||||||
Long.toString(asset.getObjectId()));
|
|
||||||
selected.addAttribute(
|
selected.addAttribute(
|
||||||
"title",
|
"assetId", data.get(AssetSearchWidgetController.OBJECT_ID)
|
||||||
globalizationHelper
|
);
|
||||||
.getValueFromLocalizedString(asset.getTitle()));
|
selected.addAttribute("title",
|
||||||
final AssetTypeInfo typeInfo = typesManager
|
data.get(AssetSearchWidgetController.TITLE));
|
||||||
.getAssetTypeInfo(asset.getClass().getName());
|
selected.addAttribute("type",
|
||||||
final ResourceBundle bundle = ResourceBundle
|
data.get(AssetSearchWidgetController.TYPE));
|
||||||
.getBundle(typeInfo.getLabelBundle(),
|
|
||||||
globalizationHelper.getNegotiatedLocale());
|
|
||||||
final String typeLabel = bundle.getString(typeInfo.getLabelKey());
|
|
||||||
selected.addAttribute("type", typeLabel);
|
|
||||||
|
|
||||||
exportAttributes(widget);
|
exportAttributes(widget);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2019 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 com.arsdigita.cms.ui.assets;
|
||||||
|
|
||||||
|
import org.libreccm.l10n.GlobalizationHelper;
|
||||||
|
import org.librecms.assets.AssetTypeInfo;
|
||||||
|
import org.librecms.assets.AssetTypesManager;
|
||||||
|
import org.librecms.contentsection.Asset;
|
||||||
|
import org.librecms.contentsection.AssetRepository;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
public class AssetSearchWidgetController {
|
||||||
|
|
||||||
|
protected static final String OBJECT_ID = "objectId";
|
||||||
|
protected static final String TYPE = "type";
|
||||||
|
protected static final String TITLE = "title";
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private AssetRepository assetRepository;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private AssetTypesManager typesManager;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private GlobalizationHelper globalizationHelper;
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
|
public Map<String, String> getData(final long assetId) {
|
||||||
|
|
||||||
|
final Asset asset = assetRepository
|
||||||
|
.findById(assetId)
|
||||||
|
.orElseThrow(() -> new IllegalArgumentException(String.format(
|
||||||
|
"No Asset with ID %d in the database.", assetId)));
|
||||||
|
|
||||||
|
final Map<String, String> data = new HashMap<>();
|
||||||
|
|
||||||
|
data.put(OBJECT_ID, Long.toString(asset.getObjectId()));
|
||||||
|
|
||||||
|
data.put(TITLE,
|
||||||
|
globalizationHelper
|
||||||
|
.getValueFromLocalizedString(asset.getTitle()));
|
||||||
|
final AssetTypeInfo typeInfo = typesManager
|
||||||
|
.getAssetTypeInfo(asset.getClass().getName());
|
||||||
|
final ResourceBundle bundle = ResourceBundle
|
||||||
|
.getBundle(typeInfo.getLabelBundle(),
|
||||||
|
globalizationHelper.getNegotiatedLocale());
|
||||||
|
final String typeLabel = bundle.getString(typeInfo.getLabelKey());
|
||||||
|
|
||||||
|
data.put(TYPE, typeLabel);
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -97,6 +97,8 @@ public abstract class AbstractBookmarkForm<T extends Bookmark>
|
||||||
protected void initForm(final PageState state,
|
protected void initForm(final PageState state,
|
||||||
final Map<String, Object> data) {
|
final Map<String, Object> data) {
|
||||||
|
|
||||||
|
super.initForm(state, data);
|
||||||
|
|
||||||
if (!data.isEmpty()) {
|
if (!data.isEmpty()) {
|
||||||
|
|
||||||
description
|
description
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.ui.assets.forms;
|
package com.arsdigita.cms.ui.assets.forms;
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.BoxPanel;
|
import com.arsdigita.bebop.BoxPanel;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.ControlLink;
|
import com.arsdigita.bebop.ControlLink;
|
||||||
|
|
@ -56,8 +55,10 @@ import org.librecms.assets.ContactEntryKey;
|
||||||
import org.librecms.assets.ContactableEntity;
|
import org.librecms.assets.ContactableEntity;
|
||||||
import org.librecms.assets.PostalAddress;
|
import org.librecms.assets.PostalAddress;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.TooManyListenersException;
|
import java.util.TooManyListenersException;
|
||||||
|
|
||||||
import static org.librecms.CmsConstants.*;
|
import static org.librecms.CmsConstants.*;
|
||||||
|
|
@ -76,8 +77,6 @@ public abstract class AbstractContactableEntityForm<T extends ContactableEntity>
|
||||||
|
|
||||||
private static final int COL_CONTACT_ENTRIES_REMOVE = 2;
|
private static final int COL_CONTACT_ENTRIES_REMOVE = 2;
|
||||||
|
|
||||||
private final AssetPane assetPane;
|
|
||||||
|
|
||||||
private SimpleContainer contactEntriesContainer;
|
private SimpleContainer contactEntriesContainer;
|
||||||
|
|
||||||
private Table contactEntriesTable;
|
private Table contactEntriesTable;
|
||||||
|
|
@ -93,8 +92,6 @@ public abstract class AbstractContactableEntityForm<T extends ContactableEntity>
|
||||||
public AbstractContactableEntityForm(final AssetPane assetPane) {
|
public AbstractContactableEntityForm(final AssetPane assetPane) {
|
||||||
|
|
||||||
super(assetPane);
|
super(assetPane);
|
||||||
|
|
||||||
this.assetPane = assetPane;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -158,27 +155,46 @@ public abstract class AbstractContactableEntityForm<T extends ContactableEntity>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(final FormSectionEvent event) throws FormProcessException {
|
public void initForm(final PageState state,
|
||||||
|
final Map<String, Object> data) {
|
||||||
|
|
||||||
super.init(event);
|
super.initForm(state, data);
|
||||||
|
|
||||||
final PageState state = event.getPageState();
|
|
||||||
|
|
||||||
final Long selectedAssetId = getSelectedAssetId(state);
|
final Long selectedAssetId = getSelectedAssetId(state);
|
||||||
|
|
||||||
if (selectedAssetId != null) {
|
if (selectedAssetId != null) {
|
||||||
// ToDo
|
|
||||||
throw new UnsupportedOperationException();
|
postalAddressSearchWidget.setValue(
|
||||||
|
state,
|
||||||
|
data.get(AbstractContactableEntityFormController.POSTAL_ADDRESS)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Map<String, Object> collectData(
|
||||||
|
final FormSectionEvent event) {
|
||||||
|
|
||||||
|
final PageState state = event.getPageState();
|
||||||
|
|
||||||
|
final Map<String, Object> data = new HashMap<>();
|
||||||
|
|
||||||
|
if (postalAddressSearchWidget.getValue(state) != null) {
|
||||||
|
|
||||||
|
data.put(AbstractContactableEntityFormController.POSTAL_ADDRESS,
|
||||||
|
postalAddressSearchWidget.getValue(state));
|
||||||
|
}
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(final FormSectionEvent event)
|
public void process(final FormSectionEvent event)
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
|
|
||||||
final PageState state = event.getPageState();
|
final PageState state = event.getPageState();
|
||||||
|
|
||||||
if (addContactEntryLink.equals(event.getSource())) {
|
if (addContactEntryLink.isSelected(state)) {
|
||||||
|
|
||||||
final Long selectedAssetId = getSelectedAssetId(state);
|
final Long selectedAssetId = getSelectedAssetId(state);
|
||||||
if (selectedAssetId == null) {
|
if (selectedAssetId == null) {
|
||||||
|
|
@ -197,11 +213,11 @@ public abstract class AbstractContactableEntityForm<T extends ContactableEntity>
|
||||||
final String value = (String) contactEntryValueField.getValue(state);
|
final String value = (String) contactEntryValueField.getValue(state);
|
||||||
|
|
||||||
controller.addContactEntry(key, value, selectedAssetId);
|
controller.addContactEntry(key, value, selectedAssetId);
|
||||||
|
|
||||||
|
contactEntryKeySelect.setValue(state, null);
|
||||||
|
contactEntryValueField.setValue(state, null);
|
||||||
} else {
|
} else {
|
||||||
super.process(event);
|
super.process(event);
|
||||||
|
|
||||||
final Object selectedPostal = postalAddressSearchWidget
|
|
||||||
.getValue(state);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -384,6 +400,7 @@ public abstract class AbstractContactableEntityForm<T extends ContactableEntity>
|
||||||
|
|
||||||
return new ControlLink((Component) value);
|
return new ControlLink((Component) value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ContactEntryKeySelectPrintListener implements PrintListener {
|
private class ContactEntryKeySelectPrintListener implements PrintListener {
|
||||||
|
|
@ -400,21 +417,15 @@ public abstract class AbstractContactableEntityForm<T extends ContactableEntity>
|
||||||
CMS_BUNDLE)))
|
CMS_BUNDLE)))
|
||||||
);
|
);
|
||||||
|
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final AbstractContactableEntityFormController<?> controller = (AbstractContactableEntityFormController<?>) getController();
|
||||||
final AbstractContactableEntityFormController controller = cdiUtil
|
|
||||||
.findBean(AbstractContactableEntityFormController.class);
|
|
||||||
final GlobalizationHelper globalizationHelper = cdiUtil
|
|
||||||
.findBean(GlobalizationHelper.class);
|
|
||||||
final List<ContactEntryKey> keys = controller
|
|
||||||
.findAvailableContactEntryKeys();
|
|
||||||
|
|
||||||
for (final ContactEntryKey key : keys) {
|
final PageState state = event.getPageState();
|
||||||
|
|
||||||
final Text label = new Text(
|
final List<String[]> keys = controller
|
||||||
globalizationHelper
|
.findAvailableContactEntryKeys(getSelectedLocale(state));
|
||||||
.getValueFromLocalizedString(key.getLabel()));
|
|
||||||
|
|
||||||
target.addOption(new Option(key.getEntryKey(), label));
|
for (final String[] key : keys) {
|
||||||
|
target.addOption(new Option(key[0], new Text(key[1])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -121,16 +121,12 @@ public abstract class AbstractContactableEntityFormController<T extends Contacta
|
||||||
.orElseThrow(() -> new IllegalArgumentException(String.format(
|
.orElseThrow(() -> new IllegalArgumentException(String.format(
|
||||||
"No ContactEntity with ID %d found.", contactableId)));
|
"No ContactEntity with ID %d found.", contactableId)));
|
||||||
|
|
||||||
entity
|
return entity
|
||||||
.getContactEntries()
|
.getContactEntries()
|
||||||
.stream()
|
.stream()
|
||||||
.map(contactEntry -> toContactEntryArray(contactEntry,
|
.map(contactEntry -> toContactEntryArray(contactEntry,
|
||||||
selectedLocale))
|
selectedLocale))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
final List<String[]> entries = new ArrayList<>();
|
|
||||||
|
|
||||||
return entries;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] toContactEntryArray(final ContactEntry entry,
|
private String[] toContactEntryArray(final ContactEntry entry,
|
||||||
|
|
@ -189,15 +185,26 @@ public abstract class AbstractContactableEntityFormController<T extends Contacta
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(Transactional.TxType.REQUIRED)
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
public List<ContactEntryKey> findAvailableContactEntryKeys() {
|
public List<String[]> findAvailableContactEntryKeys(
|
||||||
|
final Locale selectedLocale) {
|
||||||
final Locale locale = globalizationHelper.getNegotiatedLocale();
|
|
||||||
|
|
||||||
return keyRepository
|
return keyRepository
|
||||||
.findAll()
|
.findAll()
|
||||||
.stream()
|
.stream()
|
||||||
.sorted(new ContactEntryKeyByLabelComparator(locale))
|
.sorted(new ContactEntryKeyByLabelComparator(selectedLocale))
|
||||||
|
.map(key -> buildContactEntryKeyArray(key,
|
||||||
|
selectedLocale))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String[] buildContactEntryKeyArray(
|
||||||
|
final ContactEntryKey contactEntryKey, final Locale selectedLocale) {
|
||||||
|
|
||||||
|
final String key = contactEntryKey.getEntryKey();
|
||||||
|
final String label = contactEntryKey.getLabel().getValue(selectedLocale);
|
||||||
|
|
||||||
|
return new String[]{key, label};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import com.arsdigita.cms.ui.assets.IsControllerForAssetType;
|
||||||
import org.librecms.assets.AudioAsset;
|
import org.librecms.assets.AudioAsset;
|
||||||
import org.librecms.assets.LegalMetadata;
|
import org.librecms.assets.LegalMetadata;
|
||||||
import org.librecms.contentsection.AssetRepository;
|
import org.librecms.contentsection.AssetRepository;
|
||||||
|
import org.librecms.contentsection.Folder;
|
||||||
|
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -43,11 +44,6 @@ public class AudioFormController extends AbstractBinaryAssetFormController<Audio
|
||||||
@Inject
|
@Inject
|
||||||
private AssetRepository assetRepository;
|
private AssetRepository assetRepository;
|
||||||
|
|
||||||
@Override
|
|
||||||
public AudioAsset createAsset() {
|
|
||||||
return new AudioAsset();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Map<String, Object> getAssetData(final AudioAsset asset,
|
protected Map<String, Object> getAssetData(final AudioAsset asset,
|
||||||
final Locale selectedLocale) {
|
final Locale selectedLocale) {
|
||||||
|
|
|
||||||
|
|
@ -33,9 +33,4 @@ import javax.enterprise.context.RequestScoped;
|
||||||
public class BookmarkFormController
|
public class BookmarkFormController
|
||||||
extends AbstractBookmarkFormController<Bookmark> {
|
extends AbstractBookmarkFormController<Bookmark> {
|
||||||
|
|
||||||
@Override
|
|
||||||
public Bookmark createAsset() {
|
|
||||||
return new Bookmark();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,11 +44,6 @@ public class ExternalAudioAssetFormController
|
||||||
@Inject
|
@Inject
|
||||||
private AssetRepository assetRepository;
|
private AssetRepository assetRepository;
|
||||||
|
|
||||||
@Override
|
|
||||||
public ExternalAudioAsset createAsset() {
|
|
||||||
return new ExternalAudioAsset();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Map<String, Object> getAssetData(final ExternalAudioAsset asset,
|
protected Map<String, Object> getAssetData(final ExternalAudioAsset asset,
|
||||||
final Locale selectedLocale) {
|
final Locale selectedLocale) {
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,6 @@ public class ExternalVideoAssetFormController
|
||||||
@Inject
|
@Inject
|
||||||
private AssetRepository assetRepository;
|
private AssetRepository assetRepository;
|
||||||
|
|
||||||
@Override
|
|
||||||
public ExternalVideoAsset createAsset() {
|
|
||||||
return new ExternalVideoAsset();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(Transactional.TxType.REQUIRED)
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
@Override
|
@Override
|
||||||
protected Map<String, Object> getAssetData(final ExternalVideoAsset asset,
|
protected Map<String, Object> getAssetData(final ExternalVideoAsset asset,
|
||||||
|
|
|
||||||
|
|
@ -32,10 +32,4 @@ import javax.enterprise.context.RequestScoped;
|
||||||
@IsControllerForAssetType(FileAsset.class)
|
@IsControllerForAssetType(FileAsset.class)
|
||||||
public class FileAssetFormController extends AbstractBinaryAssetFormController<FileAsset> {
|
public class FileAssetFormController extends AbstractBinaryAssetFormController<FileAsset> {
|
||||||
|
|
||||||
@Override
|
|
||||||
public FileAsset createAsset() {
|
|
||||||
|
|
||||||
return new FileAsset();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,11 +47,6 @@ public class ImageFormController
|
||||||
@Inject
|
@Inject
|
||||||
private AssetRepository assetRepository;
|
private AssetRepository assetRepository;
|
||||||
|
|
||||||
@Override
|
|
||||||
public Image createAsset() {
|
|
||||||
return new Image();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Map<String, Object> getAssetData(final Image asset,
|
protected Map<String, Object> getAssetData(final Image asset,
|
||||||
final Locale selectedLocale) {
|
final Locale selectedLocale) {
|
||||||
|
|
|
||||||
|
|
@ -30,12 +30,9 @@ import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
import org.librecms.CmsConstants;
|
import org.librecms.CmsConstants;
|
||||||
import org.librecms.assets.LegalMetadata;
|
import org.librecms.assets.LegalMetadata;
|
||||||
import org.librecms.contentsection.Asset;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -88,6 +85,8 @@ public class LegalMetadataForm extends AbstractAssetForm<LegalMetadata> {
|
||||||
protected void initForm(final PageState state,
|
protected void initForm(final PageState state,
|
||||||
final Map<String, Object> data) {
|
final Map<String, Object> data) {
|
||||||
|
|
||||||
|
super.initForm(state, data);
|
||||||
|
|
||||||
if (getSelectedAssetId(state) != null) {
|
if (getSelectedAssetId(state) != null) {
|
||||||
|
|
||||||
rightsHolder.setValue(
|
rightsHolder.setValue(
|
||||||
|
|
|
||||||
|
|
@ -90,10 +90,4 @@ public class LegalMetadataFormController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public LegalMetadata createAsset() {
|
|
||||||
return new LegalMetadata();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -18,7 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.ui.assets.forms;
|
package com.arsdigita.cms.ui.assets.forms;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
|
|
@ -82,12 +81,11 @@ public class OrganizationForm extends AbstractContactableEntityForm<Organization
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Map<String, Object> collectData(final FormSectionEvent event)
|
protected Map<String, Object> collectData(final FormSectionEvent event) {
|
||||||
throws FormProcessException {
|
|
||||||
|
|
||||||
final PageState state = event.getPageState();
|
final PageState state = event.getPageState();
|
||||||
|
|
||||||
final Map<String, Object> data = new HashMap<>();
|
final Map<String, Object> data = super.collectData(event);
|
||||||
data.put(OrganizationFormController.ORGANIZATION_NAME,
|
data.put(OrganizationFormController.ORGANIZATION_NAME,
|
||||||
organizationName.getValue(state));
|
organizationName.getValue(state));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,9 +62,4 @@ public class OrganizationFormController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Organization createAsset() {
|
|
||||||
return new Organization();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,13 +36,11 @@ import com.arsdigita.util.LockableImpl;
|
||||||
|
|
||||||
import org.librecms.assets.Person;
|
import org.librecms.assets.Person;
|
||||||
|
|
||||||
import java.time.Instant;
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
@ -115,6 +113,8 @@ public class PersonForm extends AbstractContactableEntityForm<Person> {
|
||||||
CMS_BUNDLE));
|
CMS_BUNDLE));
|
||||||
add(birthdateLabel);
|
add(birthdateLabel);
|
||||||
birthdateField = new Date("birthdate");
|
birthdateField = new Date("birthdate");
|
||||||
|
final LocalDate today = LocalDate.now(ZoneId.systemDefault());
|
||||||
|
birthdateField.setYearRange(1930, today.getYear());
|
||||||
add(birthdateField);
|
add(birthdateField);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,8 +130,7 @@ public class PersonForm extends AbstractContactableEntityForm<Person> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Map<String, Object> collectData(
|
protected Map<String, Object> collectData(final FormSectionEvent event) {
|
||||||
final FormSectionEvent event) throws FormProcessException {
|
|
||||||
|
|
||||||
final PageState state = event.getPageState();
|
final PageState state = event.getPageState();
|
||||||
|
|
||||||
|
|
@ -150,16 +149,10 @@ public class PersonForm extends AbstractContactableEntityForm<Person> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(final FormSectionEvent event) throws FormProcessException {
|
public void initForm(final PageState state,
|
||||||
|
final Map<String, Object> data) {
|
||||||
|
|
||||||
super.init(event);
|
super.initForm(state, data);
|
||||||
|
|
||||||
final PageState state = event.getPageState();
|
|
||||||
|
|
||||||
final Map<String, Object> data = getController()
|
|
||||||
.getAssetData(getSelectedAssetId(state),
|
|
||||||
getAssetClass(),
|
|
||||||
getSelectedLocale(state));
|
|
||||||
|
|
||||||
if (data.containsKey(PersonFormController.SURNAME)) {
|
if (data.containsKey(PersonFormController.SURNAME)) {
|
||||||
surnameField.setValue(state,
|
surnameField.setValue(state,
|
||||||
|
|
@ -202,7 +195,13 @@ public class PersonForm extends AbstractContactableEntityForm<Person> {
|
||||||
|
|
||||||
private Table buildPersonNamesTable() {
|
private Table buildPersonNamesTable() {
|
||||||
|
|
||||||
final Table table = new Table();
|
final Table table = new Table() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isVisible(final PageState state) {
|
||||||
|
return getSelectedAssetId(state) != null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
final TableColumnModel columnModel = table.getColumnModel();
|
final TableColumnModel columnModel = table.getColumnModel();
|
||||||
columnModel.add(new TableColumn(
|
columnModel.add(new TableColumn(
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import javax.transaction.Transactional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -73,6 +74,7 @@ public class PersonFormController
|
||||||
@Inject
|
@Inject
|
||||||
private PersonManager personManager;
|
private PersonManager personManager;
|
||||||
|
|
||||||
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
protected Map<String, Object> getAssetData(final Person asset,
|
protected Map<String, Object> getAssetData(final Person asset,
|
||||||
final Locale selectedLocale) {
|
final Locale selectedLocale) {
|
||||||
|
|
@ -96,7 +98,10 @@ public class PersonFormController
|
||||||
|
|
||||||
final LocalDate birthdate = asset.getBirthdate();
|
final LocalDate birthdate = asset.getBirthdate();
|
||||||
if (birthdate != null) {
|
if (birthdate != null) {
|
||||||
final Instant instant = Instant.from(birthdate);
|
final Instant instant = birthdate
|
||||||
|
.atStartOfDay()
|
||||||
|
.atZone(ZoneId.systemDefault())
|
||||||
|
.toInstant();
|
||||||
final Date birthdateValue = Date.from(instant);
|
final Date birthdateValue = Date.from(instant);
|
||||||
data.put(BIRTHDATE, birthdateValue);
|
data.put(BIRTHDATE, birthdateValue);
|
||||||
}
|
}
|
||||||
|
|
@ -104,6 +109,7 @@ public class PersonFormController
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
protected List<String[]> getPersonNames(final Long personId) {
|
protected List<String[]> getPersonNames(final Long personId) {
|
||||||
|
|
||||||
final Person person = personRepository
|
final Person person = personRepository
|
||||||
|
|
@ -154,12 +160,18 @@ public class PersonFormController
|
||||||
final String prefix = (String) data.get(PREFIX);
|
final String prefix = (String) data.get(PREFIX);
|
||||||
final String suffix = (String) data.get(SUFFIX);
|
final String suffix = (String) data.get(SUFFIX);
|
||||||
|
|
||||||
|
if (asset.getPersonName() == null) {
|
||||||
|
personManager.addPersonName(asset);
|
||||||
|
}
|
||||||
|
|
||||||
asset.getPersonName().setSurname(surname);
|
asset.getPersonName().setSurname(surname);
|
||||||
asset.getPersonName().setGivenName(givenName);
|
asset.getPersonName().setGivenName(givenName);
|
||||||
asset.getPersonName().setPrefix(prefix);
|
asset.getPersonName().setPrefix(prefix);
|
||||||
asset.getPersonName().setSuffix(suffix);
|
asset.getPersonName().setSuffix(suffix);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(Transactional.TxType.REQUIRED)
|
||||||
public void addPersonName(final long personId) {
|
public void addPersonName(final long personId) {
|
||||||
|
|
||||||
final Person person = personRepository
|
final Person person = personRepository
|
||||||
|
|
@ -170,9 +182,4 @@ public class PersonFormController
|
||||||
personManager.addPersonName(person);
|
personManager.addPersonName(person);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Person createAsset() {
|
|
||||||
return new Person();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,111 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2019 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 com.arsdigita.cms.ui.assets.forms;
|
||||||
|
|
||||||
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
|
import com.arsdigita.bebop.PageState;
|
||||||
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
|
import com.arsdigita.bebop.form.TextArea;
|
||||||
|
import com.arsdigita.bebop.form.TextField;
|
||||||
|
import com.arsdigita.cms.ui.assets.AbstractAssetForm;
|
||||||
|
import com.arsdigita.cms.ui.assets.AssetPane;
|
||||||
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
|
import org.librecms.assets.PostalAddress;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static org.librecms.CmsConstants.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
public class PostalAddressForm extends AbstractAssetForm<PostalAddress> {
|
||||||
|
|
||||||
|
private TextArea addressArea;
|
||||||
|
private TextField postalCodeField;
|
||||||
|
private TextField cityField;
|
||||||
|
private TextField stateField;
|
||||||
|
private TextField isoCountryCodeField;
|
||||||
|
|
||||||
|
public PostalAddressForm(final AssetPane assetPane) {
|
||||||
|
super(assetPane);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addWidgets() {
|
||||||
|
|
||||||
|
super.addWidgets();
|
||||||
|
|
||||||
|
addressArea = new TextArea("address");
|
||||||
|
addressArea.setLabel(new GlobalizedMessage(
|
||||||
|
"cms.ui.authoring.assets.postaladdress.address", CMS_BUNDLE));
|
||||||
|
addressArea.setCols(80);
|
||||||
|
addressArea.setRows(10);
|
||||||
|
add(addressArea);
|
||||||
|
|
||||||
|
postalCodeField = new TextField("postalCode");
|
||||||
|
postalCodeField.setLabel(new GlobalizedMessage(
|
||||||
|
"cms.ui.authoring.assets.postaladdress.postalcode", CMS_BUNDLE));
|
||||||
|
add(postalCodeField);
|
||||||
|
|
||||||
|
cityField = new TextField("city");
|
||||||
|
cityField.setLabel(new GlobalizedMessage(
|
||||||
|
"cms.ui.authoring.assets.postaladdress.city", CMS_BUNDLE));
|
||||||
|
add(cityField);
|
||||||
|
|
||||||
|
stateField = new TextField("state");
|
||||||
|
stateField.setLabel(new GlobalizedMessage(
|
||||||
|
"cms.ui.authoring.assets.postaladdress.state", CMS_BUNDLE));
|
||||||
|
add(stateField);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Class<PostalAddress> getAssetClass() {
|
||||||
|
return PostalAddress.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showLocale(final PageState state) {
|
||||||
|
// Nothing
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Map<String, Object> collectData(final FormSectionEvent event)
|
||||||
|
throws FormProcessException {
|
||||||
|
|
||||||
|
final PageState state = event.getPageState();
|
||||||
|
|
||||||
|
final Map<String, Object> data = new HashMap<>();
|
||||||
|
|
||||||
|
data.put(PostalAddressFormController.ADDRESS,
|
||||||
|
addressArea.getValue(state));
|
||||||
|
data.put(PostalAddressFormController.CITY,
|
||||||
|
cityField.getValue(state));
|
||||||
|
data.put(PostalAddressFormController.POSTAL_CODE,
|
||||||
|
postalCodeField.getValue(state));
|
||||||
|
data.put(PostalAddressFormController.STATE,
|
||||||
|
stateField.getValue(state));
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,82 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2019 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 com.arsdigita.cms.ui.assets.forms;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ui.assets.AbstractAssetFormController;
|
||||||
|
import com.arsdigita.cms.ui.assets.IsControllerForAssetType;
|
||||||
|
|
||||||
|
import org.librecms.assets.PostalAddress;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
@IsControllerForAssetType(PostalAddress.class)
|
||||||
|
public class PostalAddressFormController
|
||||||
|
extends AbstractAssetFormController<PostalAddress> {
|
||||||
|
|
||||||
|
protected static final String STATE = "state";
|
||||||
|
protected static final String CITY = "city";
|
||||||
|
protected static final String POSTAL_CODE = "postalCode";
|
||||||
|
protected static final String ADDRESS = "address";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Map<String, Object> getAssetData(final PostalAddress asset,
|
||||||
|
final Locale selectedLocale) {
|
||||||
|
|
||||||
|
final Map<String, Object> data = new HashMap<>();
|
||||||
|
|
||||||
|
data.put(ADDRESS, asset.getAddress());
|
||||||
|
data.put(POSTAL_CODE, asset.getPostalCode());
|
||||||
|
data.put(CITY, asset.getCity());
|
||||||
|
data.put(STATE, asset.getState());
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateAssetProperties(final PostalAddress asset,
|
||||||
|
final Locale selectedLocale,
|
||||||
|
final Map<String, Object> data) {
|
||||||
|
|
||||||
|
if (data.containsKey(ADDRESS)) {
|
||||||
|
asset.setAddress((String) data.get(ADDRESS));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.containsKey(POSTAL_CODE)) {
|
||||||
|
asset.setPostalCode((String) data.get(POSTAL_CODE));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.containsKey(CITY)) {
|
||||||
|
asset.setCity((String) data.get(CITY));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.containsKey(STATE)) {
|
||||||
|
asset.setState((String) data.get(STATE));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -58,6 +58,8 @@ public class SideNoteForm extends AbstractAssetForm<SideNote> {
|
||||||
protected void initForm(final PageState state,
|
protected void initForm(final PageState state,
|
||||||
final Map<String, Object> data) {
|
final Map<String, Object> data) {
|
||||||
|
|
||||||
|
super.initForm(state, data);
|
||||||
|
|
||||||
if (getSelectedAssetId(state) != null) {
|
if (getSelectedAssetId(state) != null) {
|
||||||
|
|
||||||
text.setValue(state, data.get(SideNoteFormController.TEXT));
|
text.setValue(state, data.get(SideNoteFormController.TEXT));
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,4 @@ public class SideNoteFormController
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SideNote createAsset() {
|
|
||||||
return new SideNote();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,9 @@ import com.arsdigita.cms.ui.assets.AssetPane;
|
||||||
import com.arsdigita.cms.ui.assets.AssetSearchWidget;
|
import com.arsdigita.cms.ui.assets.AssetSearchWidget;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
|
||||||
import org.librecms.CmsConstants;
|
import org.librecms.CmsConstants;
|
||||||
import org.librecms.assets.VideoAsset;
|
import org.librecms.assets.VideoAsset;
|
||||||
import org.librecms.assets.LegalMetadata;
|
import org.librecms.assets.LegalMetadata;
|
||||||
import org.librecms.contentsection.Asset;
|
|
||||||
import org.librecms.contentsection.AssetRepository;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
package com.arsdigita.cms.ui.assets.forms;
|
package com.arsdigita.cms.ui.assets.forms;
|
||||||
|
|
||||||
import com.arsdigita.cms.ui.assets.IsControllerForAssetType;
|
import com.arsdigita.cms.ui.assets.IsControllerForAssetType;
|
||||||
import com.arsdigita.cms.ui.assets.forms.AbstractBinaryAssetFormController;
|
|
||||||
|
|
||||||
import org.librecms.contentsection.AssetRepository;
|
import org.librecms.contentsection.AssetRepository;
|
||||||
|
|
||||||
|
|
@ -96,9 +95,4 @@ public class VideoFormController
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public VideoAsset createAsset() {
|
|
||||||
return new VideoAsset();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2019 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.assets;
|
||||||
|
|
||||||
|
import org.libreccm.core.AbstractEntityRepository;
|
||||||
|
|
||||||
|
import javax.enterprise.context.RequestScoped;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
*/
|
||||||
|
@RequestScoped
|
||||||
|
public class ContactEntryRepository
|
||||||
|
extends AbstractEntityRepository<Long, ContactEntry> {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<ContactEntry> getEntityClass() {
|
||||||
|
return ContactEntry.class;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getIdAttributeName() {
|
||||||
|
return "contactEntryId";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getIdOfEntity(final ContactEntry entity) {
|
||||||
|
|
||||||
|
return entity.getContactEntryId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isNew(final ContactEntry entity) {
|
||||||
|
|
||||||
|
return entity.getContactEntryId() == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -35,6 +35,9 @@ public class ContactableEntityManager {
|
||||||
@Inject
|
@Inject
|
||||||
private AssetRepository assetRepository;
|
private AssetRepository assetRepository;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private ContactEntryRepository entryRepository;
|
||||||
|
|
||||||
public void addContactEntryToContactableEntity(
|
public void addContactEntryToContactableEntity(
|
||||||
final ContactEntry contactEntry,
|
final ContactEntry contactEntry,
|
||||||
final ContactableEntity contactableEntity) {
|
final ContactableEntity contactableEntity) {
|
||||||
|
|
@ -44,6 +47,7 @@ public class ContactableEntityManager {
|
||||||
.setOrder(contactableEntity.getContactEntries().size());
|
.setOrder(contactableEntity.getContactEntries().size());
|
||||||
}
|
}
|
||||||
contactableEntity.addContactEntry(contactEntry);
|
contactableEntity.addContactEntry(contactEntry);
|
||||||
|
entryRepository.save(contactEntry);
|
||||||
assetRepository.save(contactableEntity);
|
assetRepository.save(contactableEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,6 @@ package org.librecms.assets;
|
||||||
|
|
||||||
import com.arsdigita.cms.ui.assets.forms.PersonForm;
|
import com.arsdigita.cms.ui.assets.forms.PersonForm;
|
||||||
|
|
||||||
import static org.libreccm.core.CoreConstants.*;
|
|
||||||
|
|
||||||
import org.hibernate.envers.Audited;
|
import org.hibernate.envers.Audited;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
|
@ -35,10 +33,9 @@ import javax.persistence.ElementCollection;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.JoinColumn;
|
||||||
import javax.persistence.JoinTable;
|
import javax.persistence.JoinTable;
|
||||||
import javax.persistence.NamedQueries;
|
|
||||||
import javax.persistence.NamedQuery;
|
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
import static org.librecms.CmsConstants.*;
|
||||||
import static org.librecms.assets.AssetConstants.*;
|
import static org.librecms.assets.AssetConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ package org.librecms.assets;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
import javax.ejb.TransactionAttribute;
|
|
||||||
import javax.enterprise.context.RequestScoped;
|
import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.transaction.Transactional;
|
import javax.transaction.Transactional;
|
||||||
|
|
@ -42,7 +41,11 @@ public class PersonManager {
|
||||||
.requireNonNull(toPerson, "Can't add a name to Person null.")
|
.requireNonNull(toPerson, "Can't add a name to Person null.")
|
||||||
.getPersonName();
|
.getPersonName();
|
||||||
|
|
||||||
|
if (current == null) {
|
||||||
|
toPerson.addPersonName(new PersonName());
|
||||||
|
} else {
|
||||||
toPerson.addPersonName(current);
|
toPerson.addPersonName(current);
|
||||||
|
}
|
||||||
|
|
||||||
personRepository.save(toPerson);
|
personRepository.save(toPerson);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.assets;
|
package org.librecms.assets;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ui.assets.forms.PostalAddressForm;
|
||||||
|
|
||||||
import org.hibernate.envers.Audited;
|
import org.hibernate.envers.Audited;
|
||||||
import org.librecms.contentsection.Asset;
|
import org.librecms.contentsection.Asset;
|
||||||
|
|
||||||
|
|
@ -28,6 +30,7 @@ import javax.persistence.Entity;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
|
||||||
import static org.librecms.CmsConstants.*;
|
import static org.librecms.CmsConstants.*;
|
||||||
|
import static org.librecms.assets.AssetConstants.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A reuable postal address.
|
* A reuable postal address.
|
||||||
|
|
@ -37,6 +40,11 @@ import static org.librecms.CmsConstants.*;
|
||||||
@Entity
|
@Entity
|
||||||
@Audited
|
@Audited
|
||||||
@Table(name = "POSTAL_ADDRESSES", schema = DB_SCHEMA)
|
@Table(name = "POSTAL_ADDRESSES", schema = DB_SCHEMA)
|
||||||
|
@AssetType(assetForm = PostalAddressForm.class,
|
||||||
|
labelBundle = ASSETS_BUNDLE,
|
||||||
|
labelKey = "postaladdress.label",
|
||||||
|
descriptionBundle = ASSETS_BUNDLE,
|
||||||
|
descriptionKey = "postaladdress.description")
|
||||||
public class PostalAddress extends Asset {
|
public class PostalAddress extends Asset {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
alter table contact_entries drop column entry_key;
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
alter table contact_entries drop column entry_key;
|
||||||
|
|
@ -549,3 +549,15 @@ cms.ui.authoring.assets.contactable.contactentries.none=No contact entries
|
||||||
cms.ui.authoring.assets.contactable.contactentries.key=Type
|
cms.ui.authoring.assets.contactable.contactentries.key=Type
|
||||||
cms.ui.authoring.assets.contactable.contactentries.add=Add
|
cms.ui.authoring.assets.contactable.contactentries.add=Add
|
||||||
cms.ui.authoring.assets.contactable.postaladdress=Postal address
|
cms.ui.authoring.assets.contactable.postaladdress=Postal address
|
||||||
|
cms.ui.authoring.assets.contactable.contactentries.remove=Remove
|
||||||
|
cms.ui.authoring.assets.postaladdress.address=Address
|
||||||
|
cms.ui.authoring.assets.postaladdress.postalcode=Postal code
|
||||||
|
cms.ui.authoring.assets.postaladdress.city=City
|
||||||
|
cms.ui.authoring.assets.postaladdress.state=State
|
||||||
|
cms.ui.authoring.assets.person.surname=Surname
|
||||||
|
cms.ui.authoring.assets.person.given_name=Given name
|
||||||
|
cms.ui.authoring.assets.person.prefix=Prefix
|
||||||
|
cms.ui.authoring.assets.person.suffix=Suffix
|
||||||
|
cms.ui.authoring.assets.person.add_name=Add name
|
||||||
|
cms.ui.authoring.assets.person.birthdate=Birthdate
|
||||||
|
cms.ui.authoring.assets.person.names.none=No records
|
||||||
|
|
|
||||||
|
|
@ -546,3 +546,15 @@ cms.ui.authoring.assets.contactable.contactentries.none=Keine Eintr\u00e4ge
|
||||||
cms.ui.authoring.assets.contactable.contactentries.key=Typ
|
cms.ui.authoring.assets.contactable.contactentries.key=Typ
|
||||||
cms.ui.authoring.assets.contactable.contactentries.add=Hinzuf\u00fcgen
|
cms.ui.authoring.assets.contactable.contactentries.add=Hinzuf\u00fcgen
|
||||||
cms.ui.authoring.assets.contactable.postaladdress=Post Adresse
|
cms.ui.authoring.assets.contactable.postaladdress=Post Adresse
|
||||||
|
cms.ui.authoring.assets.contactable.contactentries.remove=Entfernen
|
||||||
|
cms.ui.authoring.assets.postaladdress.address=Adresse
|
||||||
|
cms.ui.authoring.assets.postaladdress.postalcode=Postleitzahl
|
||||||
|
cms.ui.authoring.assets.postaladdress.city=Ort
|
||||||
|
cms.ui.authoring.assets.postaladdress.state=Staat
|
||||||
|
cms.ui.authoring.assets.person.surname=Familienname
|
||||||
|
cms.ui.authoring.assets.person.given_name=Vorname
|
||||||
|
cms.ui.authoring.assets.person.prefix=Prefix
|
||||||
|
cms.ui.authoring.assets.person.suffix=Suffix
|
||||||
|
cms.ui.authoring.assets.person.add_name=Name hinzuf\u00fcgen
|
||||||
|
cms.ui.authoring.assets.person.birthdate=Geburtsdatum
|
||||||
|
cms.ui.authoring.assets.person.names.none=Keine Eintr\u00e4ge
|
||||||
|
|
|
||||||
|
|
@ -508,3 +508,15 @@ cms.ui.authoring.assets.contactable.contactentries.none=No contact entries
|
||||||
cms.ui.authoring.assets.contactable.contactentries.key=Type
|
cms.ui.authoring.assets.contactable.contactentries.key=Type
|
||||||
cms.ui.authoring.assets.contactable.contactentries.add=Add
|
cms.ui.authoring.assets.contactable.contactentries.add=Add
|
||||||
cms.ui.authoring.assets.contactable.postaladdress=Postal address
|
cms.ui.authoring.assets.contactable.postaladdress=Postal address
|
||||||
|
cms.ui.authoring.assets.contactable.contactentries.remove=Remove
|
||||||
|
cms.ui.authoring.assets.postaladdress.address=Address
|
||||||
|
cms.ui.authoring.assets.postaladdress.postalcode=Postal code
|
||||||
|
cms.ui.authoring.assets.postaladdress.city=City
|
||||||
|
cms.ui.authoring.assets.postaladdress.state=State
|
||||||
|
cms.ui.authoring.assets.person.surname=Surname
|
||||||
|
cms.ui.authoring.assets.person.given_name=Given name
|
||||||
|
cms.ui.authoring.assets.person.prefix=Prefix
|
||||||
|
cms.ui.authoring.assets.person.suffix=Suffix
|
||||||
|
cms.ui.authoring.assets.person.add_name=Add name
|
||||||
|
cms.ui.authoring.assets.person.birthdate=Birthdate
|
||||||
|
cms.ui.authoring.assets.person.names.none=No records
|
||||||
|
|
|
||||||
|
|
@ -21,3 +21,5 @@ organization.label=Organization
|
||||||
organization.desc=Stores data about an organization
|
organization.desc=Stores data about an organization
|
||||||
person.label=Person
|
person.label=Person
|
||||||
person.desc=Data about a person
|
person.desc=Data about a person
|
||||||
|
postaladdress.label=Postal Address
|
||||||
|
postaladdress.desc=A postal address
|
||||||
|
|
|
||||||
|
|
@ -21,3 +21,5 @@ organization.label=Organisation
|
||||||
organization.desc=Kontakt-) Daten einer Organisation
|
organization.desc=Kontakt-) Daten einer Organisation
|
||||||
person.label=Person
|
person.label=Person
|
||||||
person.desc=Daten zu einer Person
|
person.desc=Daten zu einer Person
|
||||||
|
postaladdress.label=Post-Adresse
|
||||||
|
postaladdress.desc=Postalische Addresse
|
||||||
|
|
|
||||||
|
|
@ -223,19 +223,78 @@
|
||||||
|
|
||||||
create table CCM_CMS.CONTACT_ENTRIES (
|
create table CCM_CMS.CONTACT_ENTRIES (
|
||||||
CONTACT_ENTRY_ID bigint not null,
|
CONTACT_ENTRY_ID bigint not null,
|
||||||
ENTRY_KEY varchar(255) not null,
|
|
||||||
ENTRY_ORDER bigint,
|
ENTRY_ORDER bigint,
|
||||||
ENTRY_VALUE varchar(4096),
|
ENTRY_VALUE varchar(4096),
|
||||||
|
CONTACT_ENTRY_KEY_ID bigint,
|
||||||
CONTACTABLE_ID bigint,
|
CONTACTABLE_ID bigint,
|
||||||
primary key (CONTACT_ENTRY_ID)
|
primary key (CONTACT_ENTRY_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACT_ENTRIES_AUD (
|
||||||
|
CONTACT_ENTRY_ID bigint not null,
|
||||||
|
REV integer not null,
|
||||||
|
REVTYPE tinyint,
|
||||||
|
REVEND integer,
|
||||||
|
ENTRY_ORDER bigint,
|
||||||
|
ENTRY_VALUE varchar(4096),
|
||||||
|
CONTACT_ENTRY_KEY_ID bigint,
|
||||||
|
primary key (CONTACT_ENTRY_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACT_ENTRY_KEY_LABELS (
|
||||||
|
KEY_ID bigint not null,
|
||||||
|
LOCALIZED_VALUE varchar(2147483647),
|
||||||
|
LOCALE varchar(255) not null,
|
||||||
|
primary key (KEY_ID, LOCALE)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACT_ENTRY_KEY_LABELS_AUD (
|
||||||
|
REV integer not null,
|
||||||
|
KEY_ID bigint not null,
|
||||||
|
LOCALIZED_VALUE varchar(2147483647) not null,
|
||||||
|
LOCALE varchar(255) not null,
|
||||||
|
REVTYPE tinyint,
|
||||||
|
REVEND integer,
|
||||||
|
primary key (REV, KEY_ID, LOCALIZED_VALUE, LOCALE)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACT_ENTRY_KEYS (
|
||||||
|
KEY_ID bigint not null,
|
||||||
|
ENTRY_KEY varchar(255),
|
||||||
|
primary key (KEY_ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACT_ENTRY_KEYS_AUD (
|
||||||
|
KEY_ID bigint not null,
|
||||||
|
REV integer not null,
|
||||||
|
REVTYPE tinyint,
|
||||||
|
REVEND integer,
|
||||||
|
ENTRY_KEY varchar(255),
|
||||||
|
primary key (KEY_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CMS.CONTACTABLE_ENTITIES (
|
create table CCM_CMS.CONTACTABLE_ENTITIES (
|
||||||
OBJECT_ID bigint not null,
|
OBJECT_ID bigint not null,
|
||||||
POSTAL_ADDRESS_ID bigint,
|
POSTAL_ADDRESS_ID bigint,
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACTABLE_ENTITIES_AUD (
|
||||||
|
OBJECT_ID bigint not null,
|
||||||
|
REV integer not null,
|
||||||
|
POSTAL_ADDRESS_ID bigint,
|
||||||
|
primary key (OBJECT_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.ContactableEntity_ContactEntry_AUD (
|
||||||
|
REV integer not null,
|
||||||
|
CONTACTABLE_ID bigint not null,
|
||||||
|
CONTACT_ENTRY_ID bigint not null,
|
||||||
|
REVTYPE tinyint,
|
||||||
|
REVEND integer,
|
||||||
|
primary key (REV, CONTACTABLE_ID, CONTACT_ENTRY_ID)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CMS.CONTENT_ITEM_COMPONENTS (
|
create table CCM_CMS.CONTENT_ITEM_COMPONENTS (
|
||||||
MODE varchar(255),
|
MODE varchar(255),
|
||||||
COMPONENT_MODEL_ID bigint not null,
|
COMPONENT_MODEL_ID bigint not null,
|
||||||
|
|
@ -826,6 +885,13 @@
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.ORGANIZATIONS_AUD (
|
||||||
|
OBJECT_ID bigint not null,
|
||||||
|
REV integer not null,
|
||||||
|
NAME varchar(1024),
|
||||||
|
primary key (OBJECT_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CMS.PAGE_THEME_CONFIGURATIONS (
|
create table CCM_CMS.PAGE_THEME_CONFIGURATIONS (
|
||||||
PAGE_ID bigint not null,
|
PAGE_ID bigint not null,
|
||||||
INDEX_PAGE_TEMPLATE varchar(255),
|
INDEX_PAGE_TEMPLATE varchar(255),
|
||||||
|
|
@ -848,16 +914,39 @@
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
create table CCM_CMS.PERSONS (
|
create table CCM_CMS.PERSON_NAMES (
|
||||||
BIRTHDATA date,
|
PERSON_ID bigint not null,
|
||||||
GIVEN_NAME varchar(255),
|
GIVEN_NAME varchar(255),
|
||||||
NAME_PREFIX varchar(255),
|
NAME_PREFIX varchar(255),
|
||||||
SUFFIX varchar(255),
|
SUFFIX varchar(255),
|
||||||
|
SURNAME varchar(255)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.PERSON_NAMES_AUD (
|
||||||
|
REV integer not null,
|
||||||
|
REVTYPE tinyint not null,
|
||||||
|
PERSON_ID bigint not null,
|
||||||
|
REVEND integer,
|
||||||
SURNAME varchar(255),
|
SURNAME varchar(255),
|
||||||
|
NAME_PREFIX varchar(255),
|
||||||
|
GIVEN_NAME varchar(255),
|
||||||
|
SUFFIX varchar(255),
|
||||||
|
primary key (REV, REVTYPE, PERSON_ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.PERSONS (
|
||||||
|
BIRTHDATE date,
|
||||||
OBJECT_ID bigint not null,
|
OBJECT_ID bigint not null,
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.PERSONS_AUD (
|
||||||
|
OBJECT_ID bigint not null,
|
||||||
|
REV integer not null,
|
||||||
|
BIRTHDATE date,
|
||||||
|
primary key (OBJECT_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CMS.POSTAL_ADDRESSES (
|
create table CCM_CMS.POSTAL_ADDRESSES (
|
||||||
ADDRESS varchar(2048),
|
ADDRESS varchar(2048),
|
||||||
CITY varchar(512),
|
CITY varchar(512),
|
||||||
|
|
@ -868,6 +957,17 @@
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.POSTAL_ADDRESSES_AUD (
|
||||||
|
OBJECT_ID bigint not null,
|
||||||
|
REV integer not null,
|
||||||
|
ADDRESS varchar(2048),
|
||||||
|
CITY varchar(512),
|
||||||
|
ISO_COUNTRY_CODE varchar(10),
|
||||||
|
POSTAL_CODE varchar(255),
|
||||||
|
ADDRESS_STATE varchar(255),
|
||||||
|
primary key (OBJECT_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CMS.RELATED_LINKS (
|
create table CCM_CMS.RELATED_LINKS (
|
||||||
OBJECT_ID bigint not null,
|
OBJECT_ID bigint not null,
|
||||||
BOOKMARK_ID bigint,
|
BOOKMARK_ID bigint,
|
||||||
|
|
@ -1484,10 +1584,10 @@
|
||||||
SETTING_ID bigint not null,
|
SETTING_ID bigint not null,
|
||||||
CONFIGURATION_CLASS varchar(512) not null,
|
CONFIGURATION_CLASS varchar(512) not null,
|
||||||
NAME varchar(512) not null,
|
NAME varchar(512) not null,
|
||||||
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
|
|
||||||
SETTING_VALUE_STRING varchar(1024),
|
|
||||||
SETTING_VALUE_LONG bigint,
|
SETTING_VALUE_LONG bigint,
|
||||||
|
SETTING_VALUE_BIG_DECIMAL decimal(19,2),
|
||||||
SETTING_VALUE_DOUBLE double,
|
SETTING_VALUE_DOUBLE double,
|
||||||
|
SETTING_VALUE_STRING varchar(1024),
|
||||||
SETTING_VALUE_BOOLEAN boolean,
|
SETTING_VALUE_BOOLEAN boolean,
|
||||||
primary key (SETTING_ID)
|
primary key (SETTING_ID)
|
||||||
);
|
);
|
||||||
|
|
@ -1958,11 +2058,51 @@ create sequence hibernate_sequence start with 1 increment by 1;
|
||||||
foreign key (COMPONENT_MODEL_ID)
|
foreign key (COMPONENT_MODEL_ID)
|
||||||
references CCM_CORE.PAGE_MODEL_COMPONENT_MODELS;
|
references CCM_CORE.PAGE_MODEL_COMPONENT_MODELS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRIES
|
||||||
|
add constraint FKirtfj8sm4y5myworl5hvs1l78
|
||||||
|
foreign key (CONTACT_ENTRY_KEY_ID)
|
||||||
|
references CCM_CMS.CONTACT_ENTRY_KEYS;
|
||||||
|
|
||||||
alter table CCM_CMS.CONTACT_ENTRIES
|
alter table CCM_CMS.CONTACT_ENTRIES
|
||||||
add constraint FKljrrfco44damal9eaqrnfam0m
|
add constraint FKljrrfco44damal9eaqrnfam0m
|
||||||
foreign key (CONTACTABLE_ID)
|
foreign key (CONTACTABLE_ID)
|
||||||
references CCM_CMS.CONTACTABLE_ENTITIES;
|
references CCM_CMS.CONTACTABLE_ENTITIES;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRIES_AUD
|
||||||
|
add constraint FKib8xp3ab8kdkc0six36f99e2g
|
||||||
|
foreign key (REV)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRIES_AUD
|
||||||
|
add constraint FKrse7ibjqsfnny5t1b2tqqs3pt
|
||||||
|
foreign key (REVEND)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRY_KEY_LABELS
|
||||||
|
add constraint FK243nk3buqm0pskkr5ifjqfxn5
|
||||||
|
foreign key (KEY_ID)
|
||||||
|
references CCM_CMS.CONTACT_ENTRY_KEYS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRY_KEY_LABELS_AUD
|
||||||
|
add constraint FK6n995k5gao6v63gfcga3yaxcw
|
||||||
|
foreign key (REV)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRY_KEY_LABELS_AUD
|
||||||
|
add constraint FKdr8ujdpn1ej8l6omlxq8bsxbd
|
||||||
|
foreign key (REVEND)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRY_KEYS_AUD
|
||||||
|
add constraint FKcvn2b1h1d4uvvmtbf4qf81l0y
|
||||||
|
foreign key (REV)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRY_KEYS_AUD
|
||||||
|
add constraint FKkyy4v3tax8w5htnpkmmt8aec1
|
||||||
|
foreign key (REVEND)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
alter table CCM_CMS.CONTACTABLE_ENTITIES
|
alter table CCM_CMS.CONTACTABLE_ENTITIES
|
||||||
add constraint FKqefwowr9adclj3xvpfje9rddr
|
add constraint FKqefwowr9adclj3xvpfje9rddr
|
||||||
foreign key (POSTAL_ADDRESS_ID)
|
foreign key (POSTAL_ADDRESS_ID)
|
||||||
|
|
@ -1973,6 +2113,21 @@ create sequence hibernate_sequence start with 1 increment by 1;
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CMS.ASSETS;
|
references CCM_CMS.ASSETS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACTABLE_ENTITIES_AUD
|
||||||
|
add constraint FKjx8trfvt96fkdn6bafnh839id
|
||||||
|
foreign key (OBJECT_ID, REV)
|
||||||
|
references CCM_CMS.ASSETS_AUD;
|
||||||
|
|
||||||
|
alter table CCM_CMS.ContactableEntity_ContactEntry_AUD
|
||||||
|
add constraint FKs5tfdp1auj9ocgvfa9ivec517
|
||||||
|
foreign key (REV)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.ContactableEntity_ContactEntry_AUD
|
||||||
|
add constraint FKskn2ovg24tnnnwd2o8y0biyje
|
||||||
|
foreign key (REVEND)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
alter table CCM_CMS.CONTENT_ITEM_COMPONENTS
|
alter table CCM_CMS.CONTENT_ITEM_COMPONENTS
|
||||||
add constraint FKp83o82kxo2ipa0xo03wxp4dcr
|
add constraint FKp83o82kxo2ipa0xo03wxp4dcr
|
||||||
foreign key (COMPONENT_MODEL_ID)
|
foreign key (COMPONENT_MODEL_ID)
|
||||||
|
|
@ -2508,6 +2663,11 @@ create sequence hibernate_sequence start with 1 increment by 1;
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CMS.CONTACTABLE_ENTITIES;
|
references CCM_CMS.CONTACTABLE_ENTITIES;
|
||||||
|
|
||||||
|
alter table CCM_CMS.ORGANIZATIONS_AUD
|
||||||
|
add constraint FKp0k3bf008pih96sguio80siql
|
||||||
|
foreign key (OBJECT_ID, REV)
|
||||||
|
references CCM_CMS.CONTACTABLE_ENTITIES_AUD;
|
||||||
|
|
||||||
alter table CCM_CMS.PAGE_THEME_CONFIGURATIONS
|
alter table CCM_CMS.PAGE_THEME_CONFIGURATIONS
|
||||||
add constraint FK6l6xp6ex6sh2uuxfmeekf6ckn
|
add constraint FK6l6xp6ex6sh2uuxfmeekf6ckn
|
||||||
foreign key (PAGE_ID)
|
foreign key (PAGE_ID)
|
||||||
|
|
@ -2538,16 +2698,41 @@ create sequence hibernate_sequence start with 1 increment by 1;
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CORE.SITE_AWARE_APPLICATIONS;
|
references CCM_CORE.SITE_AWARE_APPLICATIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.PERSON_NAMES
|
||||||
|
add constraint FK2yluyhmpuhwxafcbna6u8txrt
|
||||||
|
foreign key (PERSON_ID)
|
||||||
|
references CCM_CMS.PERSONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.PERSON_NAMES_AUD
|
||||||
|
add constraint FKtqtlwx8pa9ydh009sudtpfxie
|
||||||
|
foreign key (REV)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.PERSON_NAMES_AUD
|
||||||
|
add constraint FKs6m8tgbp8agrd5q3klwbtcujg
|
||||||
|
foreign key (REVEND)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
alter table CCM_CMS.PERSONS
|
alter table CCM_CMS.PERSONS
|
||||||
add constraint FKiv4ydysjekfx64pkb5v4vd9yj
|
add constraint FKiv4ydysjekfx64pkb5v4vd9yj
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CMS.CONTACTABLE_ENTITIES;
|
references CCM_CMS.CONTACTABLE_ENTITIES;
|
||||||
|
|
||||||
|
alter table CCM_CMS.PERSONS_AUD
|
||||||
|
add constraint FKpup1q3295qkuovaptq8aj5lxp
|
||||||
|
foreign key (OBJECT_ID, REV)
|
||||||
|
references CCM_CMS.CONTACTABLE_ENTITIES_AUD;
|
||||||
|
|
||||||
alter table CCM_CMS.POSTAL_ADDRESSES
|
alter table CCM_CMS.POSTAL_ADDRESSES
|
||||||
add constraint FK4vajjjjo8ro0wns58t8f3i782
|
add constraint FK4vajjjjo8ro0wns58t8f3i782
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CMS.ASSETS;
|
references CCM_CMS.ASSETS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.POSTAL_ADDRESSES_AUD
|
||||||
|
add constraint FKcrxgaot6kcp9rbxlg8gpp4grg
|
||||||
|
foreign key (OBJECT_ID, REV)
|
||||||
|
references CCM_CMS.ASSETS_AUD;
|
||||||
|
|
||||||
alter table CCM_CMS.RELATED_LINKS
|
alter table CCM_CMS.RELATED_LINKS
|
||||||
add constraint FKb517dnfj56oby2s34jp1omuim
|
add constraint FKb517dnfj56oby2s34jp1omuim
|
||||||
foreign key (BOOKMARK_ID)
|
foreign key (BOOKMARK_ID)
|
||||||
|
|
|
||||||
|
|
@ -223,19 +223,78 @@
|
||||||
|
|
||||||
create table CCM_CMS.CONTACT_ENTRIES (
|
create table CCM_CMS.CONTACT_ENTRIES (
|
||||||
CONTACT_ENTRY_ID int8 not null,
|
CONTACT_ENTRY_ID int8 not null,
|
||||||
ENTRY_KEY varchar(255) not null,
|
|
||||||
ENTRY_ORDER int8,
|
ENTRY_ORDER int8,
|
||||||
ENTRY_VALUE varchar(4096),
|
ENTRY_VALUE varchar(4096),
|
||||||
|
CONTACT_ENTRY_KEY_ID int8,
|
||||||
CONTACTABLE_ID int8,
|
CONTACTABLE_ID int8,
|
||||||
primary key (CONTACT_ENTRY_ID)
|
primary key (CONTACT_ENTRY_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACT_ENTRIES_AUD (
|
||||||
|
CONTACT_ENTRY_ID int8 not null,
|
||||||
|
REV int4 not null,
|
||||||
|
REVTYPE int2,
|
||||||
|
REVEND int4,
|
||||||
|
ENTRY_ORDER int8,
|
||||||
|
ENTRY_VALUE varchar(4096),
|
||||||
|
CONTACT_ENTRY_KEY_ID int8,
|
||||||
|
primary key (CONTACT_ENTRY_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACT_ENTRY_KEY_LABELS (
|
||||||
|
KEY_ID int8 not null,
|
||||||
|
LOCALIZED_VALUE text,
|
||||||
|
LOCALE varchar(255) not null,
|
||||||
|
primary key (KEY_ID, LOCALE)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACT_ENTRY_KEY_LABELS_AUD (
|
||||||
|
REV int4 not null,
|
||||||
|
KEY_ID int8 not null,
|
||||||
|
LOCALIZED_VALUE text not null,
|
||||||
|
LOCALE varchar(255) not null,
|
||||||
|
REVTYPE int2,
|
||||||
|
REVEND int4,
|
||||||
|
primary key (REV, KEY_ID, LOCALIZED_VALUE, LOCALE)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACT_ENTRY_KEYS (
|
||||||
|
KEY_ID int8 not null,
|
||||||
|
ENTRY_KEY varchar(255),
|
||||||
|
primary key (KEY_ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACT_ENTRY_KEYS_AUD (
|
||||||
|
KEY_ID int8 not null,
|
||||||
|
REV int4 not null,
|
||||||
|
REVTYPE int2,
|
||||||
|
REVEND int4,
|
||||||
|
ENTRY_KEY varchar(255),
|
||||||
|
primary key (KEY_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CMS.CONTACTABLE_ENTITIES (
|
create table CCM_CMS.CONTACTABLE_ENTITIES (
|
||||||
OBJECT_ID int8 not null,
|
OBJECT_ID int8 not null,
|
||||||
POSTAL_ADDRESS_ID int8,
|
POSTAL_ADDRESS_ID int8,
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.CONTACTABLE_ENTITIES_AUD (
|
||||||
|
OBJECT_ID int8 not null,
|
||||||
|
REV int4 not null,
|
||||||
|
POSTAL_ADDRESS_ID int8,
|
||||||
|
primary key (OBJECT_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.ContactableEntity_ContactEntry_AUD (
|
||||||
|
REV int4 not null,
|
||||||
|
CONTACTABLE_ID int8 not null,
|
||||||
|
CONTACT_ENTRY_ID int8 not null,
|
||||||
|
REVTYPE int2,
|
||||||
|
REVEND int4,
|
||||||
|
primary key (REV, CONTACTABLE_ID, CONTACT_ENTRY_ID)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CMS.CONTENT_ITEM_COMPONENTS (
|
create table CCM_CMS.CONTENT_ITEM_COMPONENTS (
|
||||||
MODE varchar(255),
|
MODE varchar(255),
|
||||||
COMPONENT_MODEL_ID int8 not null,
|
COMPONENT_MODEL_ID int8 not null,
|
||||||
|
|
@ -826,6 +885,13 @@
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.ORGANIZATIONS_AUD (
|
||||||
|
OBJECT_ID int8 not null,
|
||||||
|
REV int4 not null,
|
||||||
|
NAME varchar(1024),
|
||||||
|
primary key (OBJECT_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CMS.PAGE_THEME_CONFIGURATIONS (
|
create table CCM_CMS.PAGE_THEME_CONFIGURATIONS (
|
||||||
PAGE_ID int8 not null,
|
PAGE_ID int8 not null,
|
||||||
INDEX_PAGE_TEMPLATE varchar(255),
|
INDEX_PAGE_TEMPLATE varchar(255),
|
||||||
|
|
@ -848,16 +914,39 @@
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
create table CCM_CMS.PERSONS (
|
create table CCM_CMS.PERSON_NAMES (
|
||||||
BIRTHDATA date,
|
PERSON_ID int8 not null,
|
||||||
GIVEN_NAME varchar(255),
|
GIVEN_NAME varchar(255),
|
||||||
NAME_PREFIX varchar(255),
|
NAME_PREFIX varchar(255),
|
||||||
SUFFIX varchar(255),
|
SUFFIX varchar(255),
|
||||||
|
SURNAME varchar(255)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.PERSON_NAMES_AUD (
|
||||||
|
REV int4 not null,
|
||||||
|
REVTYPE int2 not null,
|
||||||
|
PERSON_ID int8 not null,
|
||||||
|
REVEND int4,
|
||||||
SURNAME varchar(255),
|
SURNAME varchar(255),
|
||||||
|
NAME_PREFIX varchar(255),
|
||||||
|
GIVEN_NAME varchar(255),
|
||||||
|
SUFFIX varchar(255),
|
||||||
|
primary key (REV, REVTYPE, PERSON_ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.PERSONS (
|
||||||
|
BIRTHDATE date,
|
||||||
OBJECT_ID int8 not null,
|
OBJECT_ID int8 not null,
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.PERSONS_AUD (
|
||||||
|
OBJECT_ID int8 not null,
|
||||||
|
REV int4 not null,
|
||||||
|
BIRTHDATE date,
|
||||||
|
primary key (OBJECT_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CMS.POSTAL_ADDRESSES (
|
create table CCM_CMS.POSTAL_ADDRESSES (
|
||||||
ADDRESS varchar(2048),
|
ADDRESS varchar(2048),
|
||||||
CITY varchar(512),
|
CITY varchar(512),
|
||||||
|
|
@ -868,6 +957,17 @@
|
||||||
primary key (OBJECT_ID)
|
primary key (OBJECT_ID)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
create table CCM_CMS.POSTAL_ADDRESSES_AUD (
|
||||||
|
OBJECT_ID int8 not null,
|
||||||
|
REV int4 not null,
|
||||||
|
ADDRESS varchar(2048),
|
||||||
|
CITY varchar(512),
|
||||||
|
ISO_COUNTRY_CODE varchar(10),
|
||||||
|
POSTAL_CODE varchar(255),
|
||||||
|
ADDRESS_STATE varchar(255),
|
||||||
|
primary key (OBJECT_ID, REV)
|
||||||
|
);
|
||||||
|
|
||||||
create table CCM_CMS.RELATED_LINKS (
|
create table CCM_CMS.RELATED_LINKS (
|
||||||
OBJECT_ID int8 not null,
|
OBJECT_ID int8 not null,
|
||||||
BOOKMARK_ID int8,
|
BOOKMARK_ID int8,
|
||||||
|
|
@ -1484,10 +1584,10 @@
|
||||||
SETTING_ID int8 not null,
|
SETTING_ID int8 not null,
|
||||||
CONFIGURATION_CLASS varchar(512) not null,
|
CONFIGURATION_CLASS varchar(512) not null,
|
||||||
NAME varchar(512) not null,
|
NAME varchar(512) not null,
|
||||||
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
|
|
||||||
SETTING_VALUE_STRING varchar(1024),
|
|
||||||
SETTING_VALUE_LONG int8,
|
SETTING_VALUE_LONG int8,
|
||||||
|
SETTING_VALUE_BIG_DECIMAL numeric(19, 2),
|
||||||
SETTING_VALUE_DOUBLE float8,
|
SETTING_VALUE_DOUBLE float8,
|
||||||
|
SETTING_VALUE_STRING varchar(1024),
|
||||||
SETTING_VALUE_BOOLEAN boolean,
|
SETTING_VALUE_BOOLEAN boolean,
|
||||||
primary key (SETTING_ID)
|
primary key (SETTING_ID)
|
||||||
);
|
);
|
||||||
|
|
@ -1958,11 +2058,51 @@ create sequence hibernate_sequence start 1 increment 1;
|
||||||
foreign key (COMPONENT_MODEL_ID)
|
foreign key (COMPONENT_MODEL_ID)
|
||||||
references CCM_CORE.PAGE_MODEL_COMPONENT_MODELS;
|
references CCM_CORE.PAGE_MODEL_COMPONENT_MODELS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRIES
|
||||||
|
add constraint FKirtfj8sm4y5myworl5hvs1l78
|
||||||
|
foreign key (CONTACT_ENTRY_KEY_ID)
|
||||||
|
references CCM_CMS.CONTACT_ENTRY_KEYS;
|
||||||
|
|
||||||
alter table CCM_CMS.CONTACT_ENTRIES
|
alter table CCM_CMS.CONTACT_ENTRIES
|
||||||
add constraint FKljrrfco44damal9eaqrnfam0m
|
add constraint FKljrrfco44damal9eaqrnfam0m
|
||||||
foreign key (CONTACTABLE_ID)
|
foreign key (CONTACTABLE_ID)
|
||||||
references CCM_CMS.CONTACTABLE_ENTITIES;
|
references CCM_CMS.CONTACTABLE_ENTITIES;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRIES_AUD
|
||||||
|
add constraint FKib8xp3ab8kdkc0six36f99e2g
|
||||||
|
foreign key (REV)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRIES_AUD
|
||||||
|
add constraint FKrse7ibjqsfnny5t1b2tqqs3pt
|
||||||
|
foreign key (REVEND)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRY_KEY_LABELS
|
||||||
|
add constraint FK243nk3buqm0pskkr5ifjqfxn5
|
||||||
|
foreign key (KEY_ID)
|
||||||
|
references CCM_CMS.CONTACT_ENTRY_KEYS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRY_KEY_LABELS_AUD
|
||||||
|
add constraint FK6n995k5gao6v63gfcga3yaxcw
|
||||||
|
foreign key (REV)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRY_KEY_LABELS_AUD
|
||||||
|
add constraint FKdr8ujdpn1ej8l6omlxq8bsxbd
|
||||||
|
foreign key (REVEND)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRY_KEYS_AUD
|
||||||
|
add constraint FKcvn2b1h1d4uvvmtbf4qf81l0y
|
||||||
|
foreign key (REV)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACT_ENTRY_KEYS_AUD
|
||||||
|
add constraint FKkyy4v3tax8w5htnpkmmt8aec1
|
||||||
|
foreign key (REVEND)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
alter table CCM_CMS.CONTACTABLE_ENTITIES
|
alter table CCM_CMS.CONTACTABLE_ENTITIES
|
||||||
add constraint FKqefwowr9adclj3xvpfje9rddr
|
add constraint FKqefwowr9adclj3xvpfje9rddr
|
||||||
foreign key (POSTAL_ADDRESS_ID)
|
foreign key (POSTAL_ADDRESS_ID)
|
||||||
|
|
@ -1973,6 +2113,21 @@ create sequence hibernate_sequence start 1 increment 1;
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CMS.ASSETS;
|
references CCM_CMS.ASSETS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.CONTACTABLE_ENTITIES_AUD
|
||||||
|
add constraint FKjx8trfvt96fkdn6bafnh839id
|
||||||
|
foreign key (OBJECT_ID, REV)
|
||||||
|
references CCM_CMS.ASSETS_AUD;
|
||||||
|
|
||||||
|
alter table CCM_CMS.ContactableEntity_ContactEntry_AUD
|
||||||
|
add constraint FKs5tfdp1auj9ocgvfa9ivec517
|
||||||
|
foreign key (REV)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.ContactableEntity_ContactEntry_AUD
|
||||||
|
add constraint FKskn2ovg24tnnnwd2o8y0biyje
|
||||||
|
foreign key (REVEND)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
alter table CCM_CMS.CONTENT_ITEM_COMPONENTS
|
alter table CCM_CMS.CONTENT_ITEM_COMPONENTS
|
||||||
add constraint FKp83o82kxo2ipa0xo03wxp4dcr
|
add constraint FKp83o82kxo2ipa0xo03wxp4dcr
|
||||||
foreign key (COMPONENT_MODEL_ID)
|
foreign key (COMPONENT_MODEL_ID)
|
||||||
|
|
@ -2508,6 +2663,11 @@ create sequence hibernate_sequence start 1 increment 1;
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CMS.CONTACTABLE_ENTITIES;
|
references CCM_CMS.CONTACTABLE_ENTITIES;
|
||||||
|
|
||||||
|
alter table CCM_CMS.ORGANIZATIONS_AUD
|
||||||
|
add constraint FKp0k3bf008pih96sguio80siql
|
||||||
|
foreign key (OBJECT_ID, REV)
|
||||||
|
references CCM_CMS.CONTACTABLE_ENTITIES_AUD;
|
||||||
|
|
||||||
alter table CCM_CMS.PAGE_THEME_CONFIGURATIONS
|
alter table CCM_CMS.PAGE_THEME_CONFIGURATIONS
|
||||||
add constraint FK6l6xp6ex6sh2uuxfmeekf6ckn
|
add constraint FK6l6xp6ex6sh2uuxfmeekf6ckn
|
||||||
foreign key (PAGE_ID)
|
foreign key (PAGE_ID)
|
||||||
|
|
@ -2538,16 +2698,41 @@ create sequence hibernate_sequence start 1 increment 1;
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CORE.SITE_AWARE_APPLICATIONS;
|
references CCM_CORE.SITE_AWARE_APPLICATIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.PERSON_NAMES
|
||||||
|
add constraint FK2yluyhmpuhwxafcbna6u8txrt
|
||||||
|
foreign key (PERSON_ID)
|
||||||
|
references CCM_CMS.PERSONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.PERSON_NAMES_AUD
|
||||||
|
add constraint FKtqtlwx8pa9ydh009sudtpfxie
|
||||||
|
foreign key (REV)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.PERSON_NAMES_AUD
|
||||||
|
add constraint FKs6m8tgbp8agrd5q3klwbtcujg
|
||||||
|
foreign key (REVEND)
|
||||||
|
references CCM_CORE.CCM_REVISIONS;
|
||||||
|
|
||||||
alter table CCM_CMS.PERSONS
|
alter table CCM_CMS.PERSONS
|
||||||
add constraint FKiv4ydysjekfx64pkb5v4vd9yj
|
add constraint FKiv4ydysjekfx64pkb5v4vd9yj
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CMS.CONTACTABLE_ENTITIES;
|
references CCM_CMS.CONTACTABLE_ENTITIES;
|
||||||
|
|
||||||
|
alter table CCM_CMS.PERSONS_AUD
|
||||||
|
add constraint FKpup1q3295qkuovaptq8aj5lxp
|
||||||
|
foreign key (OBJECT_ID, REV)
|
||||||
|
references CCM_CMS.CONTACTABLE_ENTITIES_AUD;
|
||||||
|
|
||||||
alter table CCM_CMS.POSTAL_ADDRESSES
|
alter table CCM_CMS.POSTAL_ADDRESSES
|
||||||
add constraint FK4vajjjjo8ro0wns58t8f3i782
|
add constraint FK4vajjjjo8ro0wns58t8f3i782
|
||||||
foreign key (OBJECT_ID)
|
foreign key (OBJECT_ID)
|
||||||
references CCM_CMS.ASSETS;
|
references CCM_CMS.ASSETS;
|
||||||
|
|
||||||
|
alter table CCM_CMS.POSTAL_ADDRESSES_AUD
|
||||||
|
add constraint FKcrxgaot6kcp9rbxlg8gpp4grg
|
||||||
|
foreign key (OBJECT_ID, REV)
|
||||||
|
references CCM_CMS.ASSETS_AUD;
|
||||||
|
|
||||||
alter table CCM_CMS.RELATED_LINKS
|
alter table CCM_CMS.RELATED_LINKS
|
||||||
add constraint FKb517dnfj56oby2s34jp1omuim
|
add constraint FKb517dnfj56oby2s34jp1omuim
|
||||||
foreign key (BOOKMARK_ID)
|
foreign key (BOOKMARK_ID)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue