Einführung von cms basetypes für Personen, Adressen, Artikel und Erstellen des neuen Content Typs Member, der auf basetypes aufbaut.
git-svn-id: https://svn.libreccm.org/ccm/trunk@424 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
662289aec0
commit
f7df4efa32
|
|
@ -19,9 +19,9 @@
|
|||
// $DateTime: 2004/08/17 23:15:09 $
|
||||
model com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.*;
|
||||
import com.arsdigita.cms.basetypes.*;
|
||||
|
||||
object type Article extends com.arsdigita.cms.Article {
|
||||
object type Article extends com.arsdigita.cms.basetypes.Article {
|
||||
String [0..1] lead = ct_articles.lead VARCHAR(1000);
|
||||
|
||||
reference key (ct_articles.item_id);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import java.math.BigDecimal;
|
|||
*
|
||||
* @version $Revision: #6 $ $Date: 2004/08/17 $
|
||||
*/
|
||||
public class Article extends com.arsdigita.cms.Article {
|
||||
public class Article extends com.arsdigita.cms.basetypes.Article {
|
||||
|
||||
|
||||
private final static org.apache.log4j.Logger s_log =
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
model com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.basetypes.Address;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
|
||||
// Address object
|
||||
object type BaseAddress extends ContentPage {
|
||||
|
||||
String [0..1] address = ct_baseAddresses.address VARCHAR(1000);
|
||||
String [0..1] postalCode = ct_baseAddresses.postalCode VARCHAR(20);
|
||||
String [0..1] city = ct_baseAddresses.city VARCHAR(200);
|
||||
String [0..1] state = ct_baseAddresses.state VARCHAR(200);
|
||||
String [0..1] isoCountryCode = ct_baseAddresses.isoCountryCode VARCHAR(2);
|
||||
object type BaseAddress extends Address {
|
||||
|
||||
reference key ( ct_baseAddresses.address_id );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ package com.arsdigita.cms.contenttypes;
|
|||
|
||||
import com.arsdigita.globalization.LocaleNegotiator;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.basetypes.Address;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
|
|
@ -42,31 +42,20 @@ import java.util.TreeMap;
|
|||
*
|
||||
* @author Sören Bernstein
|
||||
**/
|
||||
public class BaseAddress extends ContentPage {
|
||||
|
||||
/** PDL property name for address */
|
||||
public static final String ADDRESS = "address";
|
||||
/** PDL property name for postal code */
|
||||
public static final String POSTAL_CODE = "postalCode";
|
||||
/** PDL property name for city */
|
||||
public static final String CITY = "city";
|
||||
/** PDL property name for state */
|
||||
public static final String STATE = "state";
|
||||
/** PDL property name for country iso code */
|
||||
public static final String ISO_COUNTRY_CODE = "isoCountryCode";
|
||||
public class BaseAddress extends Address {
|
||||
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.cms.contenttypes.BaseAddress";
|
||||
|
||||
private static final BaseAddressConfig s_config = new BaseAddressConfig();
|
||||
static {
|
||||
s_config.load();
|
||||
}
|
||||
public static final BaseAddressConfig getConfig()
|
||||
{
|
||||
return s_config;
|
||||
}
|
||||
// static {
|
||||
// s_config.load();
|
||||
// }
|
||||
// public static BaseAddressConfig getConfig()
|
||||
// {
|
||||
// return s_config;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Default constructor. This creates a new (empty) BaseAddress.
|
||||
|
|
@ -133,70 +122,4 @@ public class BaseAddress extends ContentPage {
|
|||
}
|
||||
|
||||
/* accessors *****************************************************/
|
||||
public String getAddress() {
|
||||
return (String) get(ADDRESS);
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
set(ADDRESS, address);
|
||||
}
|
||||
|
||||
public String getIsoCountryCode() {
|
||||
return (String) get(ISO_COUNTRY_CODE);
|
||||
}
|
||||
|
||||
public void setIsoCountryCode(String isoCountryCode) {
|
||||
set(ISO_COUNTRY_CODE, isoCountryCode);
|
||||
}
|
||||
|
||||
public String getPostalCode() {
|
||||
return (String) get(POSTAL_CODE);
|
||||
}
|
||||
|
||||
public void setPostalCode(String postalCode) {
|
||||
set(POSTAL_CODE, postalCode);
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return (String) get(CITY);
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
set(CITY, city);
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return (String) get(STATE);
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
set(STATE, state);
|
||||
}
|
||||
|
||||
// Convert the iso country code to country names using the current locale
|
||||
public static String getCountryNameFromIsoCode(String isoCountryCode) {
|
||||
|
||||
LocaleNegotiator negotiatedLocale = new LocaleNegotiator("", "", "", null);
|
||||
java.util.Locale locale = new java.util.Locale("", isoCountryCode);
|
||||
return locale.getDisplayCountry(negotiatedLocale.getLocale());
|
||||
|
||||
}
|
||||
|
||||
// Get a sorted list auf all countries
|
||||
public static TreeMap getSortedListOfCountries(Locale inLang) {
|
||||
|
||||
LocaleNegotiator negotiatedLocale = new LocaleNegotiator("", "", "", null);
|
||||
String[] countries = Locale.getISOCountries();
|
||||
TreeMap <String,String> countryNames = new TreeMap<String,String>();
|
||||
|
||||
for(String country : countries) {
|
||||
if(inLang != null) {
|
||||
countryNames.put(new java.util.Locale("", country).getDisplayCountry(inLang), country);
|
||||
} else {
|
||||
countryNames.put(new java.util.Locale("", country).getDisplayCountry(negotiatedLocale.getLocale()), country);
|
||||
}
|
||||
}
|
||||
|
||||
return countryNames;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,33 +23,34 @@ import com.arsdigita.util.parameter.Parameter;
|
|||
import com.arsdigita.util.parameter.BooleanParameter;
|
||||
|
||||
public class BaseAddressConfig extends AbstractConfig {
|
||||
|
||||
|
||||
private final Parameter m_hideCountryCodeSelection;
|
||||
private final Parameter m_hidePostalCode;
|
||||
|
||||
public BaseAddressConfig() {
|
||||
m_hideCountryCodeSelection = new BooleanParameter(
|
||||
"com.arsdigita.cms.contenttypes.baseaddress.hide_country_code_selection",
|
||||
Parameter.REQUIRED,
|
||||
new Boolean(false));
|
||||
|
||||
m_hidePostalCode = new BooleanParameter(
|
||||
"com.arsdigita.cms.contenttypes.baseaddress.hide_postal_code",
|
||||
Parameter.REQUIRED,
|
||||
new Boolean(false));
|
||||
|
||||
|
||||
"com.arsdigita.cms.contenttypes.baseaddress.hide_country_code_selection",
|
||||
Parameter.REQUIRED,
|
||||
new Boolean(false));
|
||||
|
||||
m_hidePostalCode = new BooleanParameter(
|
||||
"com.arsdigita.cms.contenttypes.baseaddress.hide_postal_code",
|
||||
Parameter.REQUIRED,
|
||||
new Boolean(false));
|
||||
|
||||
|
||||
register(m_hideCountryCodeSelection);
|
||||
register(m_hidePostalCode);
|
||||
register(m_hidePostalCode);
|
||||
|
||||
loadInfo();
|
||||
}
|
||||
|
||||
|
||||
public final boolean getHideCountryCodeSelection() {
|
||||
return ((Boolean) get(m_hideCountryCodeSelection)).booleanValue();
|
||||
return ((Boolean) get(m_hideCountryCodeSelection)).booleanValue();
|
||||
}
|
||||
|
||||
public final boolean getHidePostalCode() {
|
||||
return ((Boolean) get(m_hidePostalCode)).booleanValue();
|
||||
return ((Boolean) get(m_hidePostalCode)).booleanValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,88 +16,34 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.basetypes.ui.AddressPropertiesStep;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.BaseAddress;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.cms.contenttypes.util.BaseAddressGlobalizationUtil;
|
||||
|
||||
import java.text.DateFormat;
|
||||
|
||||
public class BaseAddressPropertiesStep extends SimpleEditStep {
|
||||
public class BaseAddressPropertiesStep extends AddressPropertiesStep {
|
||||
|
||||
public static final String EDIT_SHEET_NAME = "edit";
|
||||
|
||||
public BaseAddressPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
|
||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||
BasicPageForm editSheet;
|
||||
AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
}
|
||||
|
||||
editSheet = new BaseAddressPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME, "Edit",
|
||||
new WorkflowLockedComponentAccess(editSheet, itemModel),
|
||||
editSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
setDisplayComponent(getBaseAddressPropertySheet(itemModel));
|
||||
@Override
|
||||
protected void createEditSheet(ItemSelectionModel itemModel) {
|
||||
BasicPageForm editSheet;
|
||||
editSheet = new BaseAddressPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
|
||||
}
|
||||
|
||||
public static Component getBaseAddressPropertySheet(ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.name").localize(), BaseAddress.NAME);
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.title").localize(), BaseAddress.TITLE);
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.address").localize(), BaseAddress.ADDRESS);
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.postal_code").localize(), BaseAddress.POSTAL_CODE);
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.city").localize(), BaseAddress.CITY);
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.state").localize(), BaseAddress.STATE);
|
||||
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.iso_country_code").localize(),
|
||||
BaseAddress.ISO_COUNTRY_CODE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
BaseAddress baseAddress = (BaseAddress)item;
|
||||
if(baseAddress != null && baseAddress.getIsoCountryCode() != null) {
|
||||
return BaseAddress.getCountryNameFromIsoCode(baseAddress.getIsoCountryCode());
|
||||
} else {
|
||||
return (String)BaseAddressGlobalizationUtil.globalize
|
||||
("cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
if(!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add((String)BaseAddressGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
ContentPage page = (ContentPage)item;
|
||||
if (page.getLaunchDate() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
|
||||
}
|
||||
else {
|
||||
return (String)BaseAddressGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return sheet;
|
||||
Component sheet = AddressPropertiesStep.getAddressPropertySheet(itemModel);
|
||||
return sheet;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,33 +16,14 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.cms.basetypes.ui.AddressPropertyForm;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.event.ParameterEvent;
|
||||
import com.arsdigita.bebop.event.ParameterListener;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.SingleSelect;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.bebop.parameters.StringInRangeValidationListener;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.bebop.parameters.ParameterData;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.BaseAddress;
|
||||
import com.arsdigita.cms.contenttypes.util.BaseAddressGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
|
@ -51,128 +32,39 @@ import org.apache.log4j.Logger;
|
|||
* @author: Jens Pelzetter
|
||||
* @author: Sören Bernstein
|
||||
*/
|
||||
public class BaseAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
public class BaseAddressPropertyForm extends AddressPropertyForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(BaseAddressPropertyForm.class);
|
||||
|
||||
private BaseAddressPropertiesStep m_step;
|
||||
|
||||
public static final String ADDRESS = BaseAddress.ADDRESS;
|
||||
public static final String POSTAL_CODE = BaseAddress.POSTAL_CODE;
|
||||
public static final String CITY = BaseAddress.CITY;
|
||||
public static final String STATE = BaseAddress.STATE;
|
||||
public static final String ISO_COUNTRY_CODE = BaseAddress.ISO_COUNTRY_CODE;
|
||||
|
||||
public static final String ID = "BaseAddress_edit";
|
||||
|
||||
public BaseAddressPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel,null);
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
|
||||
public BaseAddressPropertyForm(ItemSelectionModel itemModel, BaseAddressPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener (this);
|
||||
super(itemModel, step);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
super.addWidgets ();
|
||||
|
||||
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.address").localize()));
|
||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||
addressParam.addParameterListener( new NotNullValidationListener( ) );
|
||||
addressParam.addParameterListener( new StringInRangeValidationListener(0, 1000) );
|
||||
TextArea address = new TextArea(addressParam);
|
||||
address.setRows(5);
|
||||
address.setCols(30);
|
||||
add(address);
|
||||
|
||||
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.postal_code").localize()));
|
||||
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
||||
TextField postalCode = new TextField(postalCodeParam);
|
||||
/* XXX NumberListener ?*/
|
||||
add(postalCode);
|
||||
|
||||
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.city").localize()));
|
||||
ParameterModel cityParam = new StringParameter(CITY);
|
||||
TextField city = new TextField(cityParam);
|
||||
add(city);
|
||||
|
||||
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.state").localize()));
|
||||
ParameterModel stateParam = new StringParameter(STATE);
|
||||
TextField state = new TextField(stateParam);
|
||||
add(state);
|
||||
|
||||
if (!BaseAddress.getConfig().getHideCountryCodeSelection()) {
|
||||
add(new Label((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.baseAddress.iso_country_code").localize()));
|
||||
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
||||
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
||||
|
||||
SingleSelect country = new SingleSelect(countryParam);
|
||||
|
||||
country.addOption(new Option("", new Label((String)BaseAddressGlobalizationUtil.globalize("cms.ui.select_one" ).localize())));
|
||||
|
||||
Iterator countries = BaseAddress.getSortedListOfCountries(null).entrySet().iterator();
|
||||
while(countries.hasNext()) {
|
||||
Map.Entry<String,String> elem = (Map.Entry<String,String>)countries.next();
|
||||
country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString()));
|
||||
}
|
||||
|
||||
country.addValidationListener(
|
||||
new ParameterListener() {
|
||||
public void validate(ParameterEvent e) throws FormProcessException {
|
||||
ParameterData data = e.getParameterData();
|
||||
String isoCode = (String) data.getValue() ;
|
||||
s_log.debug("ISO code is : " + isoCode);
|
||||
if (isoCode == null || isoCode.length() == 0) {
|
||||
data.addError((String)BaseAddressGlobalizationUtil.globalize("cms.contenttypes.ui.address.error_iso_country").localize());
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
add(country);
|
||||
}
|
||||
|
||||
super.addWidgets();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
BaseAddress baseAddress = (BaseAddress)super.initBasicWidgets(fse);
|
||||
|
||||
data.put(ADDRESS, baseAddress.getAddress());
|
||||
data.put(POSTAL_CODE, baseAddress.getPostalCode());
|
||||
data.put(CITY, baseAddress.getCity());
|
||||
data.put(STATE, baseAddress.getState());
|
||||
if(!BaseAddress.getConfig().getHideCountryCodeSelection()) {
|
||||
data.put(ISO_COUNTRY_CODE, baseAddress.getIsoCountryCode());
|
||||
}
|
||||
}
|
||||
|
||||
public void submitted(FormSectionEvent fse) {
|
||||
if (m_step != null &&
|
||||
getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
|
||||
m_step.cancelStreamlinedCreation(fse.getPageState());
|
||||
}
|
||||
super.init(fse);
|
||||
// FormData data = fse.getFormData();
|
||||
// BaseAddress baseAddress = (BaseAddress) super.initBasicWidgets(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
super.process(fse);
|
||||
// FormData data = fse.getFormData();
|
||||
|
||||
BaseAddress baseAddress = (BaseAddress)super.processBasicWidgets(fse);
|
||||
|
||||
if (baseAddress != null &&
|
||||
getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||
baseAddress.setAddress((String)data.get(ADDRESS));
|
||||
baseAddress.setPostalCode((String)data.get(POSTAL_CODE));
|
||||
baseAddress.setCity((String)data.get(CITY));
|
||||
baseAddress.setState((String)data.get(STATE));
|
||||
baseAddress.setIsoCountryCode((String)data.get(ISO_COUNTRY_CODE));
|
||||
|
||||
baseAddress.save();
|
||||
}
|
||||
|
||||
if (m_step != null) {
|
||||
m_step.maybeForwardToNextStep(fse.getPageState());
|
||||
}
|
||||
// BaseAddress baseAddress = (BaseAddress) super.processBasicWidgets(fse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,12 +93,12 @@ public class BaseContact extends ContentPage {
|
|||
// accessors
|
||||
|
||||
// Get the person for this contact
|
||||
public Person getPerson() {
|
||||
return (Person) DomainObjectFactory.newInstance((DataObject)get(PERSON));
|
||||
public Member getPerson() {
|
||||
return (Member) DomainObjectFactory.newInstance((DataObject)get(PERSON));
|
||||
}
|
||||
|
||||
// Set the person for this contact
|
||||
public void setPerson(Person person) {
|
||||
public void setPerson(Member person) {
|
||||
set(PERSON, person);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import com.arsdigita.bebop.event.PrintListener;
|
|||
import com.arsdigita.bebop.form.Submit;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.cms.contenttypes.BaseContact;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
|
|
@ -101,7 +101,7 @@ public class BaseContactAttachPersonPropertyForm extends BasicPageForm implement
|
|||
BaseContact baseContact = (BaseContact)getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||
baseContact.setPerson((Person)data.get(ITEM_SEARCH));
|
||||
baseContact.setPerson((Member)data.get(ITEM_SEARCH));
|
||||
}
|
||||
init(fse);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ import com.arsdigita.bebop.parameters.StringParameter;
|
|||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.contenttypes.BaseContact;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.util.PersonGlobalizationUtil;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.cms.contenttypes.util.MemberGlobalizationUtil;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
@ -39,10 +39,10 @@ public class BaseContactEditPersonPropertyForm extends BasicPageForm implements
|
|||
|
||||
private BaseContactPersonPropertiesStep m_step;
|
||||
|
||||
public static final String SURNAME = Person.SURNAME;
|
||||
public static final String GIVENNAME = Person.GIVENNAME;
|
||||
public static final String TITLEPRE = Person.TITLEPRE;
|
||||
public static final String TITLEPOST = Person.TITLEPOST;
|
||||
public static final String SURNAME = Member.SURNAME;
|
||||
public static final String GIVENNAME = Member.GIVENNAME;
|
||||
public static final String TITLEPRE = Member.TITLEPRE;
|
||||
public static final String TITLEPOST = Member.TITLEPOST;
|
||||
|
||||
/**
|
||||
* ID of the form
|
||||
|
|
@ -72,27 +72,27 @@ public class BaseContactEditPersonPropertyForm extends BasicPageForm implements
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize()));
|
||||
add(new Label((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize()));
|
||||
ParameterModel surnameParam = new StringParameter(SURNAME);
|
||||
surnameParam.addParameterListener( new NotNullValidationListener( ) );
|
||||
surnameParam.addParameterListener( new StringInRangeValidationListener(0, 1000) );
|
||||
TextField surname = new TextField(surnameParam);
|
||||
add(surname);
|
||||
|
||||
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize()));
|
||||
add(new Label((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize()));
|
||||
ParameterModel givennameParam = new StringParameter(GIVENNAME);
|
||||
givennameParam.addParameterListener( new NotNullValidationListener( ) );
|
||||
givennameParam.addParameterListener( new StringInRangeValidationListener(0, 1000) );
|
||||
TextField givenname = new TextField(givennameParam);
|
||||
add(givenname);
|
||||
|
||||
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize()));
|
||||
add(new Label((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize()));
|
||||
ParameterModel titlepreParam = new StringParameter(TITLEPRE);
|
||||
titlepreParam.addParameterListener( new StringInRangeValidationListener(0, 1000) );
|
||||
TextField titlepre = new TextField(titlepreParam);
|
||||
add(titlepre);
|
||||
|
||||
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize()));
|
||||
add(new Label((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize()));
|
||||
ParameterModel titlepostParam = new StringParameter(TITLEPOST);
|
||||
titlepostParam.addParameterListener( new StringInRangeValidationListener(0, 1000) );
|
||||
TextField titlepost = new TextField(titlepostParam);
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
|||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.util.PersonGlobalizationUtil;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.cms.contenttypes.util.MemberGlobalizationUtil;
|
||||
import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
|
||||
|
||||
/**
|
||||
|
|
@ -71,10 +71,10 @@ public class BaseContactPersonPropertiesStep extends SimpleEditStep {
|
|||
public static Component getPersonPropertySheet(ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize(), "person." + Person.SURNAME);
|
||||
sheet.add((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize(), "person." + Person.GIVENNAME);
|
||||
sheet.add((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize(), "person." + Person.TITLEPRE);
|
||||
sheet.add((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize(), "person." + Person.TITLEPOST);
|
||||
sheet.add((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize(), "person." + Member.SURNAME);
|
||||
sheet.add((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize(), "person." + Member.GIVENNAME);
|
||||
sheet.add((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize(), "person." + Member.TITLEPRE);
|
||||
sheet.add((String)MemberGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize(), "person." + Member.TITLEPOST);
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0"?>
|
||||
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||
name="ccm-cms-types-person"
|
||||
name="ccm-cms-types-member"
|
||||
prettyName="Red Hat CCM Content Types"
|
||||
version="6.6.0"
|
||||
release="1"
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<ccm:contact uri="mailto:ccm@barkhof.uni-bremen.de" type="support"/>
|
||||
</ccm:contacts>
|
||||
<ccm:description>
|
||||
Basic person type for OpenCCM
|
||||
Member type for OpenCCM
|
||||
</ccm:description>
|
||||
</ccm:application>
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
//
|
||||
// Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||
//
|
||||
// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
//
|
||||
//
|
||||
|
||||
model com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.basetypes.*;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
|
||||
object type Member extends Person {
|
||||
|
||||
// Address address [0..1] = join Address ct_members.address_id
|
||||
// to cms_addresses.address_id;
|
||||
|
||||
reference key (ct_members.member_id);
|
||||
}
|
||||
|
|
@ -5,20 +5,20 @@
|
|||
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||
|
||||
<ctd:content-type
|
||||
label="Person"
|
||||
description="A generic, Person type"
|
||||
objectType="com.arsdigita.cms.contenttypes.Person"
|
||||
classname="com.arsdigita.cms.contenttypes.Person">
|
||||
label="Member"
|
||||
description="A generic, Member type"
|
||||
objectType="com.arsdigita.cms.contenttypes.Member"
|
||||
classname="com.arsdigita.cms.contenttypes.Member">
|
||||
|
||||
<ctd:authoring-kit
|
||||
createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="person.authoring.basic_properties.title"
|
||||
labelBundle="com.arsdigita.cms.contenttypes.PersonResources"
|
||||
descriptionKey="person.authoring.basic_properties.description"
|
||||
descriptionBundle="com.arsdigita.cms.contenttypes.PersonResources"
|
||||
component="com.arsdigita.cms.contenttypes.ui.PersonPropertiesStep"
|
||||
labelKey="member.authoring.basic_properties.title"
|
||||
labelBundle="com.arsdigita.cms.contenttypes.MemberResources"
|
||||
descriptionKey="member.authoring.basic_properties.description"
|
||||
descriptionBundle="com.arsdigita.cms.contenttypes.MemberResources"
|
||||
component="com.arsdigita.cms.contenttypes.ui.MemberPropertiesStep"
|
||||
ordering="1"/>
|
||||
|
||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<registry>
|
||||
<config class="com.arsdigita.cms.contenttypes.MemberConfig"
|
||||
storage="ccm-cms-types-member/member.properties"/>
|
||||
</registry>
|
||||
|
|
@ -6,11 +6,11 @@
|
|||
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||
</requires>
|
||||
<provides>
|
||||
<table name="ct_persons"/>
|
||||
<initializer class="com.arsdigita.cms.contenttypes.PersonInitializer"/>
|
||||
<table name="ct_members"/>
|
||||
<initializer class="com.arsdigita.cms.contenttypes.MemberInitializer"/>
|
||||
</provides>
|
||||
<scripts>
|
||||
<schema directory="ccm-cms-types-person"/>
|
||||
<data class="com.arsdigita.cms.contenttypes.PersonLoader"/>
|
||||
<schema directory="ccm-cms-types-member"/>
|
||||
<data class="com.arsdigita.cms.contenttypes.MemberLoader"/>
|
||||
</scripts>
|
||||
</load>
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.basetypes.Person;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Basic Member Contenttype for OpenCCM.
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class Member extends Person {
|
||||
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Member";
|
||||
// private static final MemberConfig s_config = new MemberConfig();
|
||||
|
||||
|
||||
// static {
|
||||
// s_config.load();
|
||||
// }
|
||||
|
||||
// public static final MemberConfig getConfig() {
|
||||
// return s_config;
|
||||
// }
|
||||
|
||||
/**
|
||||
* Default constructor. This creates a new (empty) Member.
|
||||
**/
|
||||
public Member() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
public Member(BigDecimal id) throws DataObjectNotFoundException {
|
||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
public Member(OID id) throws DataObjectNotFoundException {
|
||||
super(id);
|
||||
}
|
||||
|
||||
public Member(DataObject obj) {
|
||||
super(obj);
|
||||
}
|
||||
|
||||
public Member(String type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeSave() {
|
||||
super.beforeSave();
|
||||
|
||||
Assert.exists(getContentType(), ContentType.class);
|
||||
}
|
||||
|
||||
/* accessors *****************************************************/
|
||||
}
|
||||
|
|
@ -20,13 +20,11 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.runtime.AbstractConfig;
|
||||
import com.arsdigita.util.parameter.Parameter;
|
||||
import com.arsdigita.util.parameter.BooleanParameter;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class PersonConfig extends AbstractConfig {
|
||||
public class MemberConfig extends AbstractConfig {
|
||||
|
||||
}
|
||||
|
|
@ -16,7 +16,6 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.contenttypes.ContentTypeInitializer;
|
||||
|
|
@ -31,18 +30,13 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class PersonInitializer extends ContentTypeInitializer {
|
||||
public class MemberInitializer extends ContentTypeInitializer {
|
||||
|
||||
public final static String versionId =
|
||||
"$Id: PersonInitializer.java 1 2009-03-19 08:30:26Z jensp $" +
|
||||
"$Author: jensp $" +
|
||||
"$DateTime: 2009/03/19 09:30:00 $";
|
||||
private static final Logger s_log = Logger.getLogger(MemberInitializer.class);
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(PersonInitializer.class);
|
||||
|
||||
public PersonInitializer() {
|
||||
super("ccm-cms-types-person.pdl.mf",
|
||||
Person.BASE_DATA_OBJECT_TYPE);
|
||||
public MemberInitializer() {
|
||||
super("ccm-cms-types-member.pdl.mf",
|
||||
Member.BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -52,6 +46,6 @@ public class PersonInitializer extends ContentTypeInitializer {
|
|||
|
||||
@Override
|
||||
public String[] getStylesheets() {
|
||||
return new String[] { "/static/content-types/com/arsdigita/cms/contenttypes/Person.xsl" };
|
||||
return new String[]{"/static/content-types/com/arsdigita/cms/contenttypes/Member.xsl"};
|
||||
}
|
||||
}
|
||||
|
|
@ -27,11 +27,11 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class PersonLoader extends AbstractContentTypeLoader {
|
||||
public class MemberLoader extends AbstractContentTypeLoader {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(PersonLoader.class);
|
||||
private static final Logger s_log = Logger.getLogger(MemberLoader.class);
|
||||
private static final String[] TYPES = {
|
||||
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Person.xml"
|
||||
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Member.xml"
|
||||
};
|
||||
|
||||
public String[] getTypes() {
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.basetypes.Person;
|
||||
import com.arsdigita.cms.basetypes.ui.PersonPropertiesStep;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
|
||||
public class MemberPropertiesStep extends PersonPropertiesStep {
|
||||
|
||||
public static final String EDIT_SHEET_NAME = "edit";
|
||||
|
||||
public MemberPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
// createEditSheet(itemModel);
|
||||
|
||||
// setDisplayComponent(getMemberPropertySheet(itemModel));
|
||||
}
|
||||
|
||||
protected void createEditSheet(ItemSelectionModel itemModel) {
|
||||
BasicPageForm editSheet;
|
||||
editSheet = new MemberPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
|
||||
}
|
||||
|
||||
public static Component getMemberPropertySheet(ItemSelectionModel itemModel) {
|
||||
Component sheet = PersonPropertiesStep.getPersonPropertySheet(itemModel);
|
||||
|
||||
return sheet;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.basetypes.ui.PersonPropertyForm;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.cms.contenttypes.util.MemberGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Form to edit the properties of a member.
|
||||
*
|
||||
* @author: Jens Pelzetter
|
||||
*/
|
||||
public class MemberPropertyForm extends PersonPropertyForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(MemberPropertyForm.class);
|
||||
private MemberPropertiesStep m_step;
|
||||
public static final String ID = "Member_edit";
|
||||
|
||||
public MemberPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
public MemberPropertyForm(ItemSelectionModel itemModel, MemberPropertiesStep step) {
|
||||
super(itemModel, step);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent fse) {
|
||||
super.init(fse);
|
||||
FormData data = fse.getFormData();
|
||||
Member member = (Member) super.initBasicWidgets(fse);
|
||||
}
|
||||
|
||||
/*
|
||||
public void submitted(FormSectionEvent fse) {
|
||||
if (m_step != null
|
||||
&& getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
|
||||
m_step.cancelStreamlinedCreation(fse.getPageState());
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
public void process(FormSectionEvent fse) {
|
||||
super.process(fse);
|
||||
FormData data = fse.getFormData();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -21,9 +21,9 @@ package com.arsdigita.cms.contenttypes.util;
|
|||
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
public class PersonGlobalizationUtil {
|
||||
public class MemberGlobalizationUtil {
|
||||
final public static String BUNDLE_NAME =
|
||||
"com.arsdigita.cms.contenttypes.util.PersonResourceBundle";
|
||||
"com.arsdigita.cms.contenttypes.util.MemberResourceBundle";
|
||||
|
||||
public static GlobalizedMessage globalize (String key) {
|
||||
return new GlobalizedMessage(key, BUNDLE_NAME);
|
||||
|
|
@ -23,13 +23,13 @@ import java.util.PropertyResourceBundle;
|
|||
import com.arsdigita.globalization.ChainedResourceBundle;
|
||||
import com.arsdigita.cms.CMSGlobalized;
|
||||
|
||||
public class PersonResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
|
||||
public static final String PERSON_BUNDLE_NAME =
|
||||
"com.arsdigita.cms.contenttypes.PersonResources";
|
||||
public class MemberResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
|
||||
public static final String MEMBER_BUNDLE_NAME =
|
||||
"com.arsdigita.cms.contenttypes.MemberResources";
|
||||
|
||||
public PersonResourceBundle() {
|
||||
public MemberResourceBundle() {
|
||||
super();
|
||||
addBundle((PropertyResourceBundle)getBundle(PERSON_BUNDLE_NAME));
|
||||
addBundle((PropertyResourceBundle)getBundle(MEMBER_BUNDLE_NAME));
|
||||
addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
|
||||
}
|
||||
}
|
||||
|
|
@ -7,9 +7,9 @@
|
|||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
version="1.0">
|
||||
|
||||
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.Person']"
|
||||
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.Member']"
|
||||
mode="cms:CT_graphics"
|
||||
name="cms:CT_graphics_com_arsdigita_cms_contenttypes_Person">
|
||||
name="cms:CT_graphics_com_arsdigita_cms_contenttypes_Member">
|
||||
<!-- <xsl:if test="./surname and ./givenName"> -->
|
||||
<p>
|
||||
<xsl:value-of select="./titlepre"/>
|
||||
|
|
@ -20,9 +20,9 @@
|
|||
<!-- </xsl:if> -->
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.Person']"
|
||||
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.Member']"
|
||||
mode="cms:CT_text"
|
||||
name="cms:CT_text_com_arsdigita_cms_contenttypes_Person">
|
||||
name="cms:CT_text_com_arsdigita_cms_contenttypes_Member">
|
||||
<p>
|
||||
<xsl:value-of select="./titlepre"/>
|
||||
<xsl:value-of select="./givenname"/>
|
||||
|
|
@ -19,11 +19,11 @@
|
|||
// $DateTime: 2004/08/17 23:15:09 $
|
||||
model com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.*;
|
||||
import com.arsdigita.cms.basetypes.*;
|
||||
|
||||
// object type to hold extended attributes of news content type
|
||||
|
||||
object type NewsItem extends com.arsdigita.cms.Article {
|
||||
object type NewsItem extends com.arsdigita.cms.basetypes.Article {
|
||||
// The tease/lead paragraph for the news item
|
||||
String [0..1] lead = ct_news.tease_lead VARCHAR(4000);
|
||||
// The date for the news item
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
|
||||
import com.arsdigita.cms.Article;
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
|
|
|
|||
|
|
@ -120,18 +120,18 @@ public class Membership extends ACSObject {
|
|||
setAssociation(MEMBERSHIP_OWNER, ou);
|
||||
}
|
||||
|
||||
public Person getTargetItem() {
|
||||
public Member getTargetItem() {
|
||||
DataObject obj = (DataObject) get(TARGET_ITEM);
|
||||
return (Person) DomainObjectFactory.newInstance(obj);
|
||||
return (Member) DomainObjectFactory.newInstance(obj);
|
||||
}
|
||||
|
||||
public void setTargetItem(Person person) {
|
||||
Assert.exists(person, Person.class);
|
||||
public void setTargetItem(Member person) {
|
||||
Assert.exists(person, Member.class);
|
||||
setAssociation(TARGET_ITEM, person);
|
||||
}
|
||||
|
||||
public String getURI(PageState state) {
|
||||
Person person = this.getTargetItem();
|
||||
Member person = this.getTargetItem();
|
||||
|
||||
if (person == null) {
|
||||
logger.error(getOID() + " is a link between a OrganizationalUnit and a Person, but the associated Person is null");
|
||||
|
|
@ -145,7 +145,7 @@ public class Membership extends ACSObject {
|
|||
return URL.there(state.getRequest(), url).toString();
|
||||
}
|
||||
|
||||
public static DataCollection getReferingPersons(Person person) {
|
||||
public static DataCollection getReferingPersons(Member person) {
|
||||
Session session = SessionManager.getSession();
|
||||
DataCollection memberships = session.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||
Filter filter = memberships.addInSubqueryFilter("id", "com.arsdigita.cms.contenttypes.getReferingPersons");
|
||||
|
|
|
|||
|
|
@ -83,32 +83,32 @@ public class OrganizationalUnit extends ContentPage{
|
|||
set(ORGANIZATIONALUNIT_DESCRIPTION, description);
|
||||
}
|
||||
|
||||
public Person getDirection() {
|
||||
public Member getDirection() {
|
||||
DataObject dobj = (DataObject) get(DIRECTION);
|
||||
if (dobj != null) {
|
||||
return (Person) DomainObjectFactory.newInstance(dobj);
|
||||
return (Member) DomainObjectFactory.newInstance(dobj);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setDirection(Person person) {
|
||||
public void setDirection(Member person) {
|
||||
logger.debug("Setting direction...");
|
||||
Assert.exists(person, Person.class);
|
||||
Assert.exists(person, Member.class);
|
||||
setAssociation(DIRECTION, person);
|
||||
}
|
||||
|
||||
public Person getAssistentDirection() {
|
||||
public Member getAssistentDirection() {
|
||||
DataObject dobj = (DataObject) get(ASSISTENT_DIRECTION);
|
||||
if (dobj != null) {
|
||||
return (Person) DomainObjectFactory.newInstance(dobj);
|
||||
return (Member) DomainObjectFactory.newInstance(dobj);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setAssistentDirection(Person person) {
|
||||
Assert.exists(person, Person.class);
|
||||
public void setAssistentDirection(Member person) {
|
||||
Assert.exists(person, Member.class);
|
||||
setAssociation(ASSISTENT_DIRECTION, person);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.arsdigita.cms.contenttypes.Membership;
|
|||
import com.arsdigita.cms.contenttypes.MembershipStatus;
|
||||
import com.arsdigita.cms.contenttypes.OrganizationalUnit;
|
||||
import com.arsdigita.cms.contenttypes.OrganizationalUnitGlobalizationUtil;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
|
|
@ -166,7 +166,7 @@ public class MembershipPropertyForm extends FormSection implements FormInitListe
|
|||
PageState state = event.getPageState();
|
||||
FormData data = event.getFormData();
|
||||
|
||||
membership.setTargetItem((Person) data.get(PERSON_SEARCH));
|
||||
membership.setTargetItem((Member) data.get(PERSON_SEARCH));
|
||||
|
||||
MembershipStatus status = new MembershipStatus(new BigDecimal((String) this.m_status.getValue(state)));
|
||||
logger.debug("this.m_status.getValues() = " + this.m_status.getValue(state));
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import com.arsdigita.cms.ItemSelectionModel;
|
|||
import com.arsdigita.cms.contenttypes.Membership;
|
||||
import com.arsdigita.cms.contenttypes.MembershipStatus;
|
||||
import com.arsdigita.cms.contenttypes.OrganizationalUnitGlobalizationUtil;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
|
|
@ -96,7 +96,7 @@ public class MembershipTable extends Table {
|
|||
|
||||
String url = membership.getURI(state);
|
||||
if (column == m_personCol.getModelIndex()) {
|
||||
Person person = membership.getTargetItem();
|
||||
Member person = membership.getTargetItem();
|
||||
StringBuilder fullNameBuilder = new StringBuilder();
|
||||
|
||||
if(person.getTitlePre() != null) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import com.arsdigita.cms.ContentItem;
|
|||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.OrganizationalUnit;
|
||||
import com.arsdigita.cms.contenttypes.OrganizationalUnitGlobalizationUtil;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.OID;
|
||||
|
|
@ -78,7 +78,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem
|
|||
|
||||
public TableModel makeModel(Table t, PageState s) {
|
||||
t.getRowSelectionModel().clearSelection(s);
|
||||
DataCollection m_persons = SessionManager.getSession().retrieve(Person.BASE_DATA_OBJECT_TYPE);
|
||||
DataCollection m_persons = SessionManager.getSession().retrieve(Member.BASE_DATA_OBJECT_TYPE);
|
||||
m_persons.addEqualsFilter(ContentItem.VERSION, ContentItem.DRAFT);
|
||||
return new OrganizationalUnitChooseAssistentDirectorTableModel(t, m_persons);
|
||||
}
|
||||
|
|
@ -88,7 +88,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem
|
|||
|
||||
private Table m_table;
|
||||
private DataCollection m_persons;
|
||||
private Person m_person;
|
||||
private Member m_person;
|
||||
|
||||
private OrganizationalUnitChooseAssistentDirectorTableModel(Table t, DataCollection persons) {
|
||||
m_table = t;
|
||||
|
|
@ -101,7 +101,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem
|
|||
|
||||
public boolean nextRow() {
|
||||
if (m_persons.next()) {
|
||||
m_person = (Person) DomainObjectFactory.newInstance(m_persons.getDataObject());
|
||||
m_person = (Member) DomainObjectFactory.newInstance(m_persons.getDataObject());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
@ -163,7 +163,7 @@ public class OrganizationalUnitChooseAssistentDirectorTable extends Table implem
|
|||
m_parent.showDisplayPane(state);
|
||||
BigDecimal personID = new BigDecimal (e.getRowKey().toString());
|
||||
OrganizationalUnit orgaunit = (OrganizationalUnit) this.m_selOrgaUnit.getSelectedObject(state);
|
||||
Person person = (Person) DomainObjectFactory.newInstance(new OID(Person.BASE_DATA_OBJECT_TYPE, personID));
|
||||
Member person = (Member) DomainObjectFactory.newInstance(new OID(Member.BASE_DATA_OBJECT_TYPE, personID));
|
||||
orgaunit.setAssistentDirection(person);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import com.arsdigita.bebop.table.TableModelBuilder;
|
|||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.OrganizationalUnit;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.OID;
|
||||
|
|
@ -79,7 +79,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl
|
|||
|
||||
public TableModel makeModel(Table t, PageState s) {
|
||||
t.getRowSelectionModel().clearSelection(s);
|
||||
DataCollection m_persons = SessionManager.getSession().retrieve(Person.BASE_DATA_OBJECT_TYPE);
|
||||
DataCollection m_persons = SessionManager.getSession().retrieve(Member.BASE_DATA_OBJECT_TYPE);
|
||||
m_persons.addEqualsFilter(ContentItem.VERSION, ContentItem.DRAFT);
|
||||
return new OrganizationalUnitChooseDirectorTableModel(t, m_persons);
|
||||
}
|
||||
|
|
@ -89,7 +89,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl
|
|||
|
||||
private Table m_table;
|
||||
private DataCollection m_persons;
|
||||
private Person m_person;
|
||||
private Member m_person;
|
||||
|
||||
private OrganizationalUnitChooseDirectorTableModel(Table t, DataCollection persons) {
|
||||
m_table = t;
|
||||
|
|
@ -102,7 +102,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl
|
|||
|
||||
public boolean nextRow() {
|
||||
if (m_persons.next()) {
|
||||
m_person = (Person) DomainObjectFactory.newInstance(m_persons.getDataObject());
|
||||
m_person = (Member) DomainObjectFactory.newInstance(m_persons.getDataObject());
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
|
|
@ -167,7 +167,7 @@ public class OrganizationalUnitChooseDirectorTable extends Table implements Tabl
|
|||
m_parent.showDisplayPane(state);
|
||||
BigDecimal personID = new BigDecimal (e.getRowKey().toString());
|
||||
OrganizationalUnit orgaunit = (OrganizationalUnit) this.m_selOrgaUnit.getSelectedObject(state);
|
||||
Person person = (Person) DomainObjectFactory.newInstance(new OID(Person.BASE_DATA_OBJECT_TYPE, personID));
|
||||
Member person = (Member) DomainObjectFactory.newInstance(new OID(Member.BASE_DATA_OBJECT_TYPE, personID));
|
||||
orgaunit.setDirection(person);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<registry>
|
||||
<config class="com.arsdigita.cms.contenttypes.PersonConfig"
|
||||
storage="ccm-cms-types-event/person.properties"/>
|
||||
</registry>
|
||||
|
|
@ -74,17 +74,17 @@ public class Project2Person extends ACSObject {
|
|||
setAssociation(PROJECT, project);
|
||||
}
|
||||
|
||||
public Person getTargetItem() {
|
||||
public Member getTargetItem() {
|
||||
DataObject obj = (DataObject) get(TARGET_ITEM);
|
||||
if (obj == null) {
|
||||
return null;
|
||||
} else {
|
||||
return (Person) DomainObjectFactory.newInstance(obj);
|
||||
return (Member) DomainObjectFactory.newInstance(obj);
|
||||
}
|
||||
}
|
||||
|
||||
public void setTargetItem(Person person) {
|
||||
Assert.exists(person, Person.class);
|
||||
public void setTargetItem(Member person) {
|
||||
Assert.exists(person, Member.class);
|
||||
setAssociation(TARGET_ITEM, person);
|
||||
}
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ public class Project2Person extends ACSObject {
|
|||
|
||||
|
||||
public String getURI(PageState state) {
|
||||
Person person = this.getTargetItem();
|
||||
Member person = this.getTargetItem();
|
||||
|
||||
if (person == null) {
|
||||
s_log.error(getOID() + " is a link between a Project and a Person, but the associated Person is null");
|
||||
|
|
@ -113,7 +113,7 @@ public class Project2Person extends ACSObject {
|
|||
return URL.there(state.getRequest(), url).toString();
|
||||
}
|
||||
|
||||
public static DataCollection getReferingProject2Persons(Person person) {
|
||||
public static DataCollection getReferingProject2Persons(Member person) {
|
||||
Session session = SessionManager.getSession();
|
||||
DataCollection project2Persons = session.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||
Filter filter = project2Persons.addInSubqueryFilter("id", "com.arsdigita.cms.contenttypes.getReferingProject2Persons");
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import com.arsdigita.bebop.event.PrintListener;
|
|||
import com.arsdigita.bebop.form.Submit;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.cms.contenttypes.Project;
|
||||
import com.arsdigita.cms.contenttypes.Project2Person;
|
||||
import com.arsdigita.cms.contenttypes.ProjectGlobalizationUtil;
|
||||
|
|
@ -128,7 +128,7 @@ public class Project2PersonPropertyForm
|
|||
PageState state = e.getPageState();
|
||||
FormData data = e.getFormData();
|
||||
|
||||
project2Person.setTargetItem((Person) data.get(ITEM_SEARCH));
|
||||
project2Person.setTargetItem((Member) data.get(ITEM_SEARCH));
|
||||
|
||||
project2Person.save();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ import com.arsdigita.bebop.table.TableColumnModel;
|
|||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.SecurityManager;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.cms.contenttypes.Project2Person;
|
||||
import com.arsdigita.cms.contenttypes.ProjectGlobalizationUtil;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
|
|
@ -121,7 +121,7 @@ public class Project2PersonTable extends Table {
|
|||
|
||||
String url = project2Person.getURI(state);
|
||||
if (column == m_personCol.getModelIndex()) {
|
||||
Person person = project2Person.getTargetItem();
|
||||
Member person = project2Person.getTargetItem();
|
||||
StringBuilder fullNameBuilder = new StringBuilder();
|
||||
|
||||
if (person.getTitlePre() != null) {
|
||||
|
|
|
|||
|
|
@ -66,18 +66,18 @@ public class ResearchNetworkMembership extends ACSObject {
|
|||
setAssociation(MEMBER_OWNER, rn);
|
||||
}
|
||||
|
||||
public Person getTargetItem() {
|
||||
public Member getTargetItem() {
|
||||
DataObject obj = (DataObject) get(TARGET_ITEM);
|
||||
return (Person) DomainObjectFactory.newInstance(obj);
|
||||
return (Member) DomainObjectFactory.newInstance(obj);
|
||||
}
|
||||
|
||||
public void setTargetItem(Person person) {
|
||||
Assert.exists(person, Person.class);
|
||||
public void setTargetItem(Member person) {
|
||||
Assert.exists(person, Member.class);
|
||||
setAssociation(TARGET_ITEM, person);
|
||||
}
|
||||
|
||||
public String getURI(PageState state) {
|
||||
Person person = this.getTargetItem();
|
||||
Member person = this.getTargetItem();
|
||||
|
||||
if (person == null) {
|
||||
s_log.error(getOID() + " is a link between a ResearchNetwork and a Person, but the associated person is null");
|
||||
|
|
@ -91,7 +91,7 @@ public class ResearchNetworkMembership extends ACSObject {
|
|||
return URL.there(state.getRequest(), url).toString();
|
||||
}
|
||||
|
||||
public static DataCollection getReferingPersons(Person person) {
|
||||
public static DataCollection getReferingPersons(Member person) {
|
||||
Session session = SessionManager.getSession();
|
||||
DataCollection members = session.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||
Filter filter = members.addInSubqueryFilter("id", "com.arsdigita.cms.contenttypes.getReferingPersons");
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import com.arsdigita.bebop.form.Submit;
|
|||
import com.arsdigita.bebop.util.GlobalizationUtil;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.cms.contenttypes.ResearchNetwork;
|
||||
import com.arsdigita.cms.contenttypes.ResearchNetworkGlobalizationUtil;
|
||||
import com.arsdigita.cms.contenttypes.ResearchNetworkMembership;
|
||||
|
|
@ -124,7 +124,7 @@ public class ResearchNetworkMembershipPropertyForm extends FormSection implemen
|
|||
PageState state = event.getPageState();
|
||||
FormData data = event.getFormData();
|
||||
|
||||
membership.setTargetItem((Person) data.get(PERSON_SEARCH));
|
||||
membership.setTargetItem((Member) data.get(PERSON_SEARCH));
|
||||
|
||||
membership.save();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import com.arsdigita.cms.ContentItem;
|
|||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.cms.SecurityManager;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.Member;
|
||||
import com.arsdigita.cms.contenttypes.ResearchNetworkGlobalizationUtil;
|
||||
import com.arsdigita.cms.contenttypes.ResearchNetworkMembership;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
|
|
@ -92,7 +92,7 @@ public class ResearchNetworkMembershipTable extends Table {
|
|||
|
||||
String url = membership.getURI(state);
|
||||
if (column == m_personCol.getModelIndex()) {
|
||||
Person person = membership.getTargetItem();
|
||||
Member person = membership.getTargetItem();
|
||||
StringBuilder fullNameBuilder = new StringBuilder();
|
||||
|
||||
if (person.getTitlePre() != null) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
model com.arsdigita.cms.basetypes;
|
||||
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
|
||||
// Address object
|
||||
object type Address extends ContentPage {
|
||||
|
||||
String [0..1] address = cms_addresses.address VARCHAR(1000);
|
||||
String [0..1] postalCode = cms_addresses.postalCode VARCHAR(20);
|
||||
String [0..1] city = cms_addresses.city VARCHAR(200);
|
||||
String [0..1] state = cms_addresses.state VARCHAR(200);
|
||||
String [0..1] isoCountryCode = cms_addresses.isoCountryCode VARCHAR(2);
|
||||
|
||||
reference key ( cms_addresses.address_id );
|
||||
}
|
||||
|
||||
|
|
@ -17,8 +17,9 @@
|
|||
//
|
||||
// $Id: Article.pdl 287 2005-02-22 00:29:02Z sskracic $
|
||||
// $DateTime: 2004/08/17 23:15:09 $
|
||||
model com.arsdigita.cms;
|
||||
model com.arsdigita.cms.basetypes;
|
||||
|
||||
import com.arsdigita.cms.*;
|
||||
import com.arsdigita.kernel.*;
|
||||
|
||||
object type Article extends TextPage {
|
||||
|
|
@ -17,16 +17,15 @@
|
|||
//
|
||||
//
|
||||
|
||||
model com.arsdigita.cms.contenttypes;
|
||||
model com.arsdigita.cms.basetypes;
|
||||
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
|
||||
object type Person extends ContentPage {
|
||||
String[0..1] surname = ct_persons.surname VARCHAR(512);
|
||||
String[0..1] givenname = ct_persons.givenname VARCHAR(512);
|
||||
String[0..1] titlepre = ct_persons.titlepre VARCHAR(256);
|
||||
String[0..1] titlepost = ct_persons.titlepost VARCHAR(256);
|
||||
String[0..1] surname = cms_persons.surname VARCHAR(512);
|
||||
String[0..1] givenname = cms_persons.givenname VARCHAR(512);
|
||||
String[0..1] titlepre = cms_persons.titlepre VARCHAR(256);
|
||||
String[0..1] titlepost = cms_persons.titlepost VARCHAR(256);
|
||||
|
||||
reference key (ct_persons.person_id);
|
||||
reference key (cms_persons.person_id);
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@
|
|||
</xrd:adapter>
|
||||
|
||||
<!-- Adds several image assets -->
|
||||
<xrd:adapter objectType="com.arsdigita.cms.Article" extends="com.arsdigita.cms.TextPage" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
|
||||
<xrd:adapter objectType="com.arsdigita.cms.basetypes.Article" extends="com.arsdigita.cms.TextPage" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
|
||||
<xrd:attributes rule="exclude">
|
||||
<xrd:property name="/object/imageCaptions/id"/>
|
||||
<xrd:property name="/object/imageCaptions/defaultDomainClass"/>
|
||||
|
|
@ -166,7 +166,7 @@
|
|||
</xrd:adapter>
|
||||
|
||||
<!-- Adds several image assets -->
|
||||
<xrd:adapter objectType="com.arsdigita.cms.Article" extends="com.arsdigita.cms.TextPage" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
|
||||
<xrd:adapter objectType="com.arsdigita.cms.basetypes.Article" extends="com.arsdigita.cms.TextPage" traversalClass="com.arsdigita.cms.contenttypes.ContentItemTraversalAdapter">
|
||||
<xrd:attributes rule="exclude">
|
||||
<xrd:property name="/object/imageCaptions/id"/>
|
||||
<xrd:property name="/object/imageCaptions/defaultDomainClass"/>
|
||||
|
|
|
|||
|
|
@ -6,4 +6,6 @@
|
|||
storage="ccm-cms/lifecycle.properties"/>
|
||||
<config class="com.arsdigita.cms.publishToFile.PublishToFileConfig"
|
||||
storage="ccm-cms/publishToFile.properties"/>
|
||||
<config class="com.arsdigita.cms.basetypes.AddressConfig"
|
||||
storage="ccm-cms/basetypes.properties"/>
|
||||
</registry>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,202 @@
|
|||
/*
|
||||
* Copyright (C) 2002-2004 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.basetypes;
|
||||
|
||||
|
||||
import com.arsdigita.globalization.LocaleNegotiator;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
import com.arsdigita.persistence.OID;
|
||||
import com.arsdigita.util.Assert;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Locale;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* <p><code>DomainObject</code> class to represent address <code>ContentType</code>
|
||||
* objects.
|
||||
* <br />
|
||||
* This content type represents a generic address which is not country specific.
|
||||
* It provides methods for creating new address objects, retrieving existing
|
||||
* objects from the persistent storage and retrieving and setting is properties.</p>
|
||||
* <p>This class extends {@link com.arsdigita.cms.ContentItem content item} and
|
||||
* adds extended attributes specific for an not country specific address:</p>
|
||||
*
|
||||
* @author Sören Bernstein
|
||||
**/
|
||||
public class Address extends ContentPage {
|
||||
|
||||
/** PDL property name for address */
|
||||
public static final String ADDRESS = "address";
|
||||
/** PDL property name for postal code */
|
||||
public static final String POSTAL_CODE = "postalCode";
|
||||
/** PDL property name for city */
|
||||
public static final String CITY = "city";
|
||||
/** PDL property name for state */
|
||||
public static final String STATE = "state";
|
||||
/** PDL property name for country iso code */
|
||||
public static final String ISO_COUNTRY_CODE = "isoCountryCode";
|
||||
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE
|
||||
= "com.arsdigita.cms.basetypes.Address";
|
||||
|
||||
private static final AddressConfig s_config = new AddressConfig();
|
||||
static {
|
||||
s_config.load();
|
||||
}
|
||||
public static AddressConfig getConfig()
|
||||
{
|
||||
return s_config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default constructor. This creates a new (empty) Address.
|
||||
**/
|
||||
public Address() {
|
||||
this(BASE_DATA_OBJECT_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor. The contained <code>DataObject</code> is retrieved
|
||||
* from the persistent storage mechanism with an <code>OID</code>
|
||||
* specified by <i>id</i> and
|
||||
* <code>Address.BASE_DATA_OBJECT_TYPE</code>.
|
||||
*
|
||||
* @param id The <code>id</code> for the retrieved
|
||||
* <code>DataObject</code>.
|
||||
**/
|
||||
public Address(BigDecimal id) throws DataObjectNotFoundException {
|
||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor. The contained <code>DataObject</code> is retrieved
|
||||
* from the persistent storage mechanism with an <code>OID</code>
|
||||
* specified by <i>id</i>.
|
||||
*
|
||||
* @param id The <code>OID</code> for the retrieved
|
||||
* <code>DataObject</code>.
|
||||
**/
|
||||
public Address(OID id) throws DataObjectNotFoundException {
|
||||
super(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor. Retrieves or creates a content item using the
|
||||
* <code>DataObject</code> argument.
|
||||
*
|
||||
* @param obj The <code>DataObject</code> with which to create or
|
||||
* load a content item
|
||||
*/
|
||||
public Address(DataObject obj) {
|
||||
super(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor. Creates a new content item using the given data
|
||||
* object type. Such items are created as draft versions.
|
||||
*
|
||||
* @param type The <code>String</code> data object type of the
|
||||
* item to create
|
||||
*/
|
||||
public Address(String type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
/**
|
||||
* For new content items, sets the associated content type if it
|
||||
* has not been already set.
|
||||
*/
|
||||
public void beforeSave() {
|
||||
super.beforeSave();
|
||||
|
||||
Assert.exists(getContentType(), ContentType.class);
|
||||
}
|
||||
|
||||
/* accessors *****************************************************/
|
||||
public String getAddress() {
|
||||
return (String) get(ADDRESS);
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
set(ADDRESS, address);
|
||||
}
|
||||
|
||||
public String getIsoCountryCode() {
|
||||
return (String) get(ISO_COUNTRY_CODE);
|
||||
}
|
||||
|
||||
public void setIsoCountryCode(String isoCountryCode) {
|
||||
set(ISO_COUNTRY_CODE, isoCountryCode);
|
||||
}
|
||||
|
||||
public String getPostalCode() {
|
||||
return (String) get(POSTAL_CODE);
|
||||
}
|
||||
|
||||
public void setPostalCode(String postalCode) {
|
||||
set(POSTAL_CODE, postalCode);
|
||||
}
|
||||
|
||||
public String getCity() {
|
||||
return (String) get(CITY);
|
||||
}
|
||||
|
||||
public void setCity(String city) {
|
||||
set(CITY, city);
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return (String) get(STATE);
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
set(STATE, state);
|
||||
}
|
||||
|
||||
// Convert the iso country code to country names using the current locale
|
||||
public static String getCountryNameFromIsoCode(String isoCountryCode) {
|
||||
|
||||
LocaleNegotiator negotiatedLocale = new LocaleNegotiator("", "", "", null);
|
||||
java.util.Locale locale = new java.util.Locale("", isoCountryCode);
|
||||
return locale.getDisplayCountry(negotiatedLocale.getLocale());
|
||||
|
||||
}
|
||||
|
||||
// Get a sorted list auf all countries
|
||||
public static TreeMap getSortedListOfCountries(Locale inLang) {
|
||||
|
||||
LocaleNegotiator negotiatedLocale = new LocaleNegotiator("", "", "", null);
|
||||
String[] countries = Locale.getISOCountries();
|
||||
TreeMap <String,String> countryNames = new TreeMap<String,String>();
|
||||
|
||||
for(String country : countries) {
|
||||
if(inLang != null) {
|
||||
countryNames.put(new java.util.Locale("", country).getDisplayCountry(inLang), country);
|
||||
} else {
|
||||
countryNames.put(new java.util.Locale("", country).getDisplayCountry(negotiatedLocale.getLocale()), country);
|
||||
}
|
||||
}
|
||||
|
||||
return countryNames;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright (C) 2004 Red Hat Inc. All Rights Reserved.
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.basetypes;
|
||||
|
||||
import com.arsdigita.runtime.AbstractConfig;
|
||||
import com.arsdigita.util.parameter.Parameter;
|
||||
import com.arsdigita.util.parameter.BooleanParameter;
|
||||
|
||||
public class AddressConfig extends AbstractConfig {
|
||||
|
||||
private final Parameter m_hideCountryCodeSelection;
|
||||
private final Parameter m_hidePostalCode;
|
||||
|
||||
public AddressConfig() {
|
||||
m_hideCountryCodeSelection = new BooleanParameter(
|
||||
"com.arsdigita.cms.basetypes.ddress.hide_country_code_selection",
|
||||
Parameter.REQUIRED,
|
||||
new Boolean(false));
|
||||
|
||||
m_hidePostalCode = new BooleanParameter(
|
||||
"com.arsdigita.cms.basetypes.address.hide_postal_code",
|
||||
Parameter.REQUIRED,
|
||||
new Boolean(false));
|
||||
|
||||
|
||||
register(m_hideCountryCodeSelection);
|
||||
register(m_hidePostalCode);
|
||||
|
||||
loadInfo();
|
||||
}
|
||||
|
||||
public final boolean getHideCountryCodeSelection() {
|
||||
return ((Boolean) get(m_hideCountryCodeSelection)).booleanValue();
|
||||
}
|
||||
public final boolean getHidePostalCode() {
|
||||
return ((Boolean) get(m_hidePostalCode)).booleanValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
com.arsdigita.cms.basetypes.address.hide_country_code_selection.title=Hide ISO Country Code
|
||||
com.arsdigita.cms.basetypes.address.hide_country_code_selection.purpose=Hide the ISO country code selection box
|
||||
com.arsdigita.cms.basetypes.address.hide_country_code_selection.example=false
|
||||
com.arsdigita.cms.basetypes.address.hide_country_code_selection.format=[boolean]
|
||||
|
||||
com.arsdigita.cms.basetypes.address.hide_postal_code.title=Hide Postal Code
|
||||
com.arsdigita.cms.basetypes.address.hide_postal_code.purpose=Hide the the postal code entry field
|
||||
com.arsdigita.cms.basetypes.address.hide_postal_code.example=false
|
||||
com.arsdigita.cms.basetypes.address.hide_postal_code.format=[boolean]
|
||||
|
|
@ -16,8 +16,11 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms;
|
||||
package com.arsdigita.cms.basetypes;
|
||||
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ImageAssetCollection;
|
||||
import com.arsdigita.cms.TextPage;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.persistence.DataAssociation;
|
||||
import com.arsdigita.persistence.DataAssociationCursor;
|
||||
|
|
@ -38,7 +41,7 @@ import java.math.BigDecimal;
|
|||
public class Article extends TextPage {
|
||||
|
||||
public static final String BASE_DATA_OBJECT_TYPE =
|
||||
"com.arsdigita.cms.Article";
|
||||
"com.arsdigita.cms.basetypes.Article";
|
||||
|
||||
protected static final String IMAGES = "imageAssets";
|
||||
|
||||
|
|
@ -91,6 +94,7 @@ public class Article extends TextPage {
|
|||
* @return the base PDL object type for this item. Child classes should
|
||||
* override this method to return the correct value
|
||||
*/
|
||||
@Override
|
||||
public String getBaseDataObjectType() {
|
||||
return BASE_DATA_OBJECT_TYPE;
|
||||
}
|
||||
|
|
@ -181,6 +185,7 @@ public class Article extends TextPage {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void propagateMaster(com.arsdigita.versioning.VersionedACSObject master) {
|
||||
super.propagateMaster(master);
|
||||
ImageAssetCollection collection = getImages();
|
||||
|
|
@ -16,8 +16,10 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms;
|
||||
package com.arsdigita.cms.basetypes;
|
||||
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ImageAssetCollection;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.Filter;
|
||||
|
|
@ -16,8 +16,14 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms;
|
||||
package com.arsdigita.cms.basetypes;
|
||||
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.CustomCopy;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ItemCollection;
|
||||
import com.arsdigita.cms.ItemCopier;
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
cms.basetypes.ui.address.address=Address
|
||||
cms.basetypes.ui.address.postal_code=Postal Code
|
||||
cms.basetypes.ui.address.city=City
|
||||
cms.basetypes.ui.address.state=State
|
||||
cms.basetypes.ui.address.iso_country_code=Country
|
||||
cms.basetypes.ui.address.error_iso_country=You must select a country
|
||||
address.authoring.basic_properties.title=Basic Properties
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
cms.basetypes.ui.address.address=Anschrift
|
||||
cms.basetypes.ui.address.postal_code=Postleitzahl
|
||||
cms.basetypes.ui.address.city=Stadt
|
||||
cms.basetypes.ui.address.state=Bundesland
|
||||
cms.basetypes.ui.address.iso_country_code=Land
|
||||
cms.basetypes.ui.address.error_iso_country=Bitte w\u00E4hlen Sie ein Land aus
|
||||
address.authoring.basic_properties.title=Eigenschaften von Adresse
|
||||
|
|
@ -17,8 +17,9 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
package com.arsdigita.cms.basetypes;
|
||||
|
||||
import com.arsdigita.cms.contenttypes.*;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
|
|
@ -40,18 +41,9 @@ public class Person extends ContentPage {
|
|||
public static final String TITLEPRE = "titlepre";
|
||||
public static final String TITLEPOST = "titlepost";
|
||||
/** Data object type for this domain object */
|
||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Person";
|
||||
private static final PersonConfig s_config = new PersonConfig();
|
||||
public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.basetypes.Person";
|
||||
|
||||
|
||||
static {
|
||||
s_config.load();
|
||||
}
|
||||
|
||||
public static final PersonConfig getConfig() {
|
||||
return s_config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default constructor. This creates a new (empty) Person.
|
||||
**/
|
||||
|
|
@ -81,7 +73,7 @@ public class Person extends ContentPage {
|
|||
Assert.exists(getContentType(), ContentType.class);
|
||||
}
|
||||
|
||||
/* accessors *****************************************************/
|
||||
/* accessors *****************************************************/
|
||||
public String getSurname() {
|
||||
return (String)get(SURNAME);
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.basetypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.basetypes.Address;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
|
||||
import java.text.DateFormat;
|
||||
|
||||
public class AddressPropertiesStep extends SimpleEditStep {
|
||||
|
||||
public static final String EDIT_SHEET_NAME = "edit";
|
||||
|
||||
public AddressPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
super(itemModel, parent);
|
||||
|
||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||
createEditSheet(itemModel);
|
||||
|
||||
setDisplayComponent(getAddressPropertySheet(itemModel));
|
||||
}
|
||||
|
||||
protected void createEditSheet(ItemSelectionModel itemModel) {
|
||||
BasicPageForm editSheet;
|
||||
editSheet = new AddressPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
|
||||
}
|
||||
|
||||
public static Component getAddressPropertySheet(ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.name").localize(), Address.NAME);
|
||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.title").localize(), Address.TITLE);
|
||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize(), Address.ADDRESS);
|
||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize(), Address.POSTAL_CODE);
|
||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize(), Address.CITY);
|
||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize(), Address.STATE);
|
||||
|
||||
sheet.add((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize(),
|
||||
Address.ISO_COUNTRY_CODE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
Address address = (Address) item;
|
||||
if (address != null && address.getIsoCountryCode() != null) {
|
||||
return Address.getCountryNameFromIsoCode(address.getIsoCountryCode());
|
||||
} else {
|
||||
return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add((String) GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
|
||||
public String format(DomainObject item,
|
||||
String attribute,
|
||||
PageState state) {
|
||||
ContentPage page = (ContentPage) item;
|
||||
if (page.getLaunchDate() != null) {
|
||||
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
|
||||
} else {
|
||||
return (String) GlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return sheet;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
package com.arsdigita.cms.basetypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.event.ParameterEvent;
|
||||
import com.arsdigita.bebop.event.ParameterListener;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.SingleSelect;
|
||||
import com.arsdigita.bebop.form.TextArea;
|
||||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.bebop.parameters.StringInRangeValidationListener;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.bebop.parameters.ParameterData;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.basetypes.Address;
|
||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Form to edit the properties of a address.
|
||||
*
|
||||
* @author: Jens Pelzetter
|
||||
* @author: Sören Bernstein
|
||||
*/
|
||||
public class AddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(AddressPropertyForm.class);
|
||||
private AddressPropertiesStep m_step;
|
||||
public static final String ADDRESS = Address.ADDRESS;
|
||||
public static final String POSTAL_CODE = Address.POSTAL_CODE;
|
||||
public static final String CITY = Address.CITY;
|
||||
public static final String STATE = Address.STATE;
|
||||
public static final String ISO_COUNTRY_CODE = Address.ISO_COUNTRY_CODE;
|
||||
public static final String ID = "Address_edit";
|
||||
|
||||
public AddressPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
public AddressPropertyForm(ItemSelectionModel itemModel, AddressPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
m_step = step;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
super.addWidgets();
|
||||
|
||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.address").localize()));
|
||||
ParameterModel addressParam = new StringParameter(ADDRESS);
|
||||
addressParam.addParameterListener(new NotNullValidationListener());
|
||||
addressParam.addParameterListener(new StringInRangeValidationListener(0, 1000));
|
||||
TextArea address = new TextArea(addressParam);
|
||||
address.setRows(5);
|
||||
address.setCols(30);
|
||||
add(address);
|
||||
|
||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.postal_code").localize()));
|
||||
ParameterModel postalCodeParam = new StringParameter(POSTAL_CODE);
|
||||
TextField postalCode = new TextField(postalCodeParam);
|
||||
/* XXX NumberListener ?*/
|
||||
add(postalCode);
|
||||
|
||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.city").localize()));
|
||||
ParameterModel cityParam = new StringParameter(CITY);
|
||||
TextField city = new TextField(cityParam);
|
||||
add(city);
|
||||
|
||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.state").localize()));
|
||||
ParameterModel stateParam = new StringParameter(STATE);
|
||||
TextField state = new TextField(stateParam);
|
||||
add(state);
|
||||
|
||||
if (!Address.getConfig().getHideCountryCodeSelection()) {
|
||||
add(new Label((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.iso_country_code").localize()));
|
||||
ParameterModel countryParam = new StringParameter(ISO_COUNTRY_CODE);
|
||||
countryParam.addParameterListener(new StringInRangeValidationListener(0, 2));
|
||||
|
||||
SingleSelect country = new SingleSelect(countryParam);
|
||||
|
||||
country.addOption(new Option("", new Label((String) BasetypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||
|
||||
Iterator countries = Address.getSortedListOfCountries(null).entrySet().iterator();
|
||||
while (countries.hasNext()) {
|
||||
Map.Entry<String, String> elem = (Map.Entry<String, String>) countries.next();
|
||||
country.addOption(new Option(elem.getValue().toString(), elem.getKey().toString()));
|
||||
}
|
||||
|
||||
country.addValidationListener(
|
||||
new ParameterListener() {
|
||||
|
||||
public void validate(ParameterEvent e) throws FormProcessException {
|
||||
ParameterData data = e.getParameterData();
|
||||
String isoCode = (String) data.getValue();
|
||||
s_log.debug("ISO code is : " + isoCode);
|
||||
if (isoCode == null || isoCode.length() == 0) {
|
||||
data.addError((String) BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.address.error_iso_country").localize());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
add(country);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
Address address = (Address) super.initBasicWidgets(fse);
|
||||
|
||||
data.put(ADDRESS, address.getAddress());
|
||||
data.put(POSTAL_CODE, address.getPostalCode());
|
||||
data.put(CITY, address.getCity());
|
||||
data.put(STATE, address.getState());
|
||||
if (!Address.getConfig().getHideCountryCodeSelection()) {
|
||||
data.put(ISO_COUNTRY_CODE, address.getIsoCountryCode());
|
||||
}
|
||||
}
|
||||
|
||||
public void submitted(FormSectionEvent fse) {
|
||||
if (m_step != null
|
||||
&& getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
|
||||
m_step.cancelStreamlinedCreation(fse.getPageState());
|
||||
}
|
||||
}
|
||||
|
||||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
|
||||
Address address = (Address) super.processBasicWidgets(fse);
|
||||
|
||||
if (address != null
|
||||
&& getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
|
||||
address.setAddress((String) data.get(ADDRESS));
|
||||
address.setPostalCode((String) data.get(POSTAL_CODE));
|
||||
address.setCity((String) data.get(CITY));
|
||||
address.setState((String) data.get(STATE));
|
||||
address.setIsoCountryCode((String) data.get(ISO_COUNTRY_CODE));
|
||||
|
||||
address.save();
|
||||
}
|
||||
|
||||
if (m_step != null) {
|
||||
m_step.maybeForwardToNextStep(fse.getPageState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -17,23 +17,23 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
package com.arsdigita.cms.basetypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ContentPage;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.basetypes.Person;
|
||||
import com.arsdigita.domain.DomainObject;
|
||||
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.cms.contenttypes.util.PersonGlobalizationUtil;
|
||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
||||
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
||||
import java.text.DateFormat;
|
||||
|
||||
public class PersonPropertiesStep extends SimpleEditStep {
|
||||
|
|
@ -44,26 +44,27 @@ public class PersonPropertiesStep extends SimpleEditStep {
|
|||
super(itemModel, parent);
|
||||
|
||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||
BasicPageForm editSheet;
|
||||
|
||||
editSheet = new PersonPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME, "Edit",
|
||||
new WorkflowLockedComponentAccess(editSheet, itemModel),
|
||||
editSheet.getSaveCancelSection().getCancelButton());
|
||||
createEditSheet(itemModel);
|
||||
|
||||
setDisplayComponent(getPersonPropertySheet(itemModel));
|
||||
}
|
||||
|
||||
protected void createEditSheet(ItemSelectionModel itemModel) {
|
||||
BasicPageForm editSheet;
|
||||
editSheet = new PersonPropertyForm(itemModel, this);
|
||||
add(EDIT_SHEET_NAME, "Edit", new WorkflowLockedComponentAccess(editSheet, itemModel), editSheet.getSaveCancelSection().getCancelButton());
|
||||
}
|
||||
|
||||
public static Component getPersonPropertySheet(ItemSelectionModel itemModel) {
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize(), Person.SURNAME);
|
||||
sheet.add((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize(), Person.GIVENNAME);
|
||||
sheet.add((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize(), Person.TITLEPRE);
|
||||
sheet.add((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize(), Person.TITLEPOST);
|
||||
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize(), Person.SURNAME);
|
||||
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize(), Person.GIVENNAME);
|
||||
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize(), Person.TITLEPRE);
|
||||
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize(), Person.TITLEPOST);
|
||||
|
||||
if(!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add((String)GlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(),
|
||||
sheet.add((String)BasetypesGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||
public String format(DomainObject item,
|
||||
|
|
@ -74,7 +75,7 @@ public class PersonPropertiesStep extends SimpleEditStep {
|
|||
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
|
||||
}
|
||||
else {
|
||||
return (String)GlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
return (String)BasetypesGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
package com.arsdigita.cms.basetypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.Label;
|
||||
|
|
@ -29,8 +29,8 @@ import com.arsdigita.bebop.form.TextField;
|
|||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Person;
|
||||
import com.arsdigita.cms.contenttypes.util.PersonGlobalizationUtil;
|
||||
import com.arsdigita.cms.basetypes.Person;
|
||||
import com.arsdigita.cms.basetypes.util.BasetypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
@ -62,25 +62,26 @@ public class PersonPropertyForm extends BasicPageForm implements FormProcessList
|
|||
addSubmissionListener (this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addWidgets() {
|
||||
super.addWidgets ();
|
||||
|
||||
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize()));
|
||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.surname").localize()));
|
||||
ParameterModel surnameParam = new StringParameter(SURNAME);
|
||||
TextField surname = new TextField (surnameParam);
|
||||
add(surname);
|
||||
|
||||
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize()));
|
||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.givenname").localize()));
|
||||
ParameterModel givennameParam = new StringParameter(GIVENNAME);
|
||||
TextField givenname = new TextField (givennameParam);
|
||||
add(givenname);
|
||||
|
||||
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize()));
|
||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepre").localize()));
|
||||
ParameterModel titlepreParam = new StringParameter(TITLEPRE);
|
||||
TextField titlepre = new TextField (titlepreParam);
|
||||
add(titlepre);
|
||||
|
||||
add(new Label((String)PersonGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize()));
|
||||
add(new Label((String)BasetypesGlobalizationUtil.globalize("cms.basetypes.ui.person.titlepost").localize()));
|
||||
ParameterModel titlepostParam = new StringParameter(TITLEPOST);
|
||||
TextField titlepost = new TextField (titlepostParam);
|
||||
add(titlepost);
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.basetypes.util;
|
||||
|
||||
import com.arsdigita.globalization.GlobalizedMessage;
|
||||
|
||||
public class BasetypesGlobalizationUtil {
|
||||
final public static String BUNDLE_NAME =
|
||||
"com.arsdigita.cms.basetypes.util.BaetypesResourceBundle";
|
||||
|
||||
public static GlobalizedMessage globalize (String key) {
|
||||
return new GlobalizedMessage(key, BUNDLE_NAME);
|
||||
}
|
||||
|
||||
public static GlobalizedMessage globalize (String key, Object[] args) {
|
||||
return new GlobalizedMessage(key, BUNDLE_NAME, args);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.basetypes.util;
|
||||
|
||||
import java.util.PropertyResourceBundle;
|
||||
import com.arsdigita.globalization.ChainedResourceBundle;
|
||||
import com.arsdigita.cms.CMSGlobalized;
|
||||
|
||||
public class BasetypesResourceBundle extends ChainedResourceBundle implements CMSGlobalized {
|
||||
public static final String MEMBER_BUNDLE_NAME =
|
||||
"com.arsdigita.cms.basetypes.BasetypesResources";
|
||||
|
||||
public BasetypesResourceBundle() {
|
||||
super();
|
||||
addBundle((PropertyResourceBundle)getBundle(MEMBER_BUNDLE_NAME));
|
||||
addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME));
|
||||
}
|
||||
}
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
package com.arsdigita.cms.dispatcher;
|
||||
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.cms.Article;
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ImageAssetCollection;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
package com.arsdigita.cms.ui;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.Article;
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.util.Assert;
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import com.arsdigita.bebop.table.DefaultTableCellRenderer;
|
|||
import com.arsdigita.bebop.table.TableCellRenderer;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.cms.ArticleImageAssociation;
|
||||
import com.arsdigita.cms.basetypes.ArticleImageAssociation;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.SecurityManager;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import com.arsdigita.bebop.PageState;
|
|||
import com.arsdigita.bebop.ParameterSingleSelectionModel;
|
||||
import com.arsdigita.bebop.SingleSelectionModel;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.cms.Article;
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ImageAssetCollection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.Article;
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ImageAssetCollection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import com.arsdigita.bebop.event.FormProcessListener;
|
|||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.parameters.BigDecimalParameter;
|
||||
import com.arsdigita.cms.ArticleImageAssociation;
|
||||
import com.arsdigita.cms.basetypes.ArticleImageAssociation;
|
||||
import com.arsdigita.cms.ContentItem;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.bebop.form.TextField;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
import com.arsdigita.cms.Article;
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import com.arsdigita.bebop.FormData;
|
|||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.cms.Article;
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import com.arsdigita.bebop.FormData;
|
|||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.cms.Article;
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ui.ImageDisplay;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import com.arsdigita.bebop.PageState;
|
|||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.cms.Article;
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.cms.ImageAsset;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.ReusableImageAsset;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ ccm-cms-assets-relatedlink
|
|||
# Content types
|
||||
ccm-cms-types-address
|
||||
ccm-cms-types-article
|
||||
ccm-cms-types-baseAddress
|
||||
ccm-cms-types-bookmark
|
||||
ccm-cms-types-contact
|
||||
ccm-cms-types-faqitem
|
||||
|
|
@ -18,6 +19,7 @@ ccm-cms-types-filestorageitem
|
|||
ccm-cms-types-formitem
|
||||
ccm-cms-types-formsectionitem
|
||||
ccm-cms-types-glossaryitem
|
||||
ccm-cms-types-member
|
||||
ccm-cms-types-mparticle
|
||||
ccm-cms-types-newsitem
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
package com.arsdigita.cms;
|
||||
|
||||
import com.arsdigita.cms.basetypes.Article;
|
||||
import com.arsdigita.cms.contenttypes.ContentAssetInitializer;
|
||||
import com.arsdigita.cms.contenttypes.ItemImageAttachment;
|
||||
import com.arsdigita.cms.contenttypes.ui.ImageStep;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
<ccm:application name="ccm-cms-types-address"/>
|
||||
<!-- <ccm:application name="ccm-cms-types-agenda"/> -->
|
||||
<ccm:application name="ccm-cms-types-article"/>
|
||||
<ccm:application name="ccm-cms-types-baseAddress"/>
|
||||
<ccm:application name="ccm-cms-types-bookmark"/>
|
||||
<ccm:application name="ccm-cms-types-contact"/>
|
||||
<!-- <ccm:application name="ccm-cms-types-esdservice"/> -->
|
||||
|
|
@ -45,6 +46,7 @@
|
|||
<!-- <ccm:application name="ccm-cms-types-job"/> -->
|
||||
<!-- <ccm:application name="ccm-cms-types-legalnotice"/> -->
|
||||
<!-- <ccm:application name="ccm-cms-types-minutes"/> -->
|
||||
<ccm:application name="ccm-cms-types-member"/>
|
||||
<!-- <ccm:application name="ccm-cms-types-motditem"/> -->
|
||||
<ccm:application name="ccm-cms-types-mparticle"/>
|
||||
<ccm:application name="ccm-cms-types-newsitem"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue