Phones for the Contact object
- * which is retrieved from the ItemSelectionModel.
- *
- *
- * @author Shashin Shinde sshinde@redhat.com
- * @version $Id: PhoBaseContactEntriesPropertiesStepva 287 2005-02-22 00:29:02Z sskracic $
- */
-public class BaseContactEntriesPropertiesStep extends SimpleEditStep {
-
- /** The name of the editing sheet added to this step */
- private static String ADD_CONTACT_ENTRY_SHEET_NAME = "addContactEntry";
-
- public BaseContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
- this(itemModel, parent, null);
- }
-
- public BaseContactEntriesPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
- super(itemModel, parent, prefix);
-
- BasicItemForm addContactEntrySheet = new BaseContactEntryAddForm(itemModel);
- add(ADD_CONTACT_ENTRY_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.add_contactEntry").localize(), new WorkflowLockedComponentAccess(addContactEntrySheet, itemModel), addContactEntrySheet.getSaveCancelSection().getCancelButton());
-
- BaseContactEntriesTable contactEntriesTable = new BaseContactEntriesTable(itemModel);
- setDisplayComponent(contactEntriesTable);
-
- }
-
-}
\ No newline at end of file
diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntriesTable.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntriesTable.java.old
deleted file mode 100644
index dad4aa864..000000000
--- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntriesTable.java.old
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Copyright (C) 2008 Sören Bernstein 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.contenttypes.ui;
-
-import com.arsdigita.bebop.Component;
-import com.arsdigita.bebop.ControlLink;
-import com.arsdigita.bebop.Label;
-import com.arsdigita.bebop.PageState;
-import com.arsdigita.bebop.Table;
-import com.arsdigita.bebop.event.TableActionEvent;
-import com.arsdigita.bebop.event.TableActionListener;
-import com.arsdigita.bebop.table.TableCellRenderer;
-import com.arsdigita.bebop.table.TableColumn;
-import com.arsdigita.bebop.table.TableColumnModel;
-import com.arsdigita.bebop.table.TableModel;
-import com.arsdigita.bebop.table.TableModelBuilder;
-import com.arsdigita.cms.ItemSelectionModel;
-import com.arsdigita.cms.SecurityManager;
-import com.arsdigita.cms.contenttypes.BaseContact;
-import com.arsdigita.cms.contenttypes.BaseContactEntry;
-import com.arsdigita.cms.contenttypes.BaseContactEntryCollection;
-import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
-import com.arsdigita.cms.dispatcher.Utilities;
-import com.arsdigita.cms.util.GlobalizationUtil;
-import com.arsdigita.util.LockableImpl;
-import java.math.BigDecimal;
-
-/**
- * Lists all existing contact entries for a selected contact.
- *
- * @author Sören Bernstein (quasimodo) quasi@barkhof.uni-bremen.de
- */
-public class BaseContactEntriesTable extends Table implements TableActionListener{
-
-
- private final String TABLE_COL_EDIT = "table_col_edit";
- private final String TABLE_COL_DEL = "table_col_del";
-
- private ItemSelectionModel m_itemModel;
-
- /**
- * Creates a new instance of BaseContactEntriesTable
- */
- public BaseContactEntriesTable(final ItemSelectionModel itemModel) {
-
- super();
- this.m_itemModel = itemModel;
-
- // if table is empty:
- setEmptyView(new Label(BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.none")));
- TableColumnModel tab_model = getColumnModel();
-
- // define columns
- tab_model.add(new TableColumn(0, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key").localize(), TABLE_COL_EDIT));
- tab_model.add(new TableColumn(1, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.value").localize()));
- tab_model.add(new TableColumn(2, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.description").localize()));
- tab_model.add(new TableColumn(3, BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.action").localize(), TABLE_COL_DEL));
-
- setModelBuilder(new BaseContactTableModelBuilder(itemModel));
-
- tab_model.get(0).setCellRenderer(new EditCellRenderer());
- tab_model.get(3).setCellRenderer(new DeleteCellRenderer());
-
- addTableActionListener(this);
-
- }
-
- /**
- * XXXX
- *
- */
- private class BaseContactTableModelBuilder extends LockableImpl implements TableModelBuilder {
-
- private ItemSelectionModel m_itemModel;
-
- public BaseContactTableModelBuilder(ItemSelectionModel itemModel) {
- m_itemModel = itemModel;
- }
-
- public TableModel makeModel(Table table, PageState state) {
-
- table.getRowSelectionModel().clearSelection(state);
-
- BaseContact baseContact = (BaseContact) m_itemModel.getSelectedObject(state);
-
-// if (baseContact != null && baseContact.hasContactEntries()) {
- return new BaseContactTableModel(table, state, baseContact);
-// } else {
-// return Table.EMPTY_MODEL;
-// }
- }
- }
-
- /**
- * XXX
- *
- */
- private class BaseContactTableModel implements TableModel {
-
- final private int MAX_DESC_LENGTH = 25;
-
- private Table m_table;
- private BaseContactEntryCollection m_baseContactEntryCollection;
- private BaseContactEntry m_baseContactEntry;
-
- private BaseContactTableModel(Table t, PageState ps, BaseContact baseContact) {
- m_table = t;
- m_baseContactEntryCollection = baseContact.getContactEntries();
- }
-
- public int getColumnCount() {
- return m_table.getColumnModel().size();
- }
-
- /**
- * Check collection for the existence of another row.
- *
- * If exists, fetch the value of current BaseContactEntryCollection object
- * into m_baseContactEntry class variable.
- */
- public boolean nextRow() {
-
- if(m_baseContactEntryCollection != null && m_baseContactEntryCollection.next()){
- m_baseContactEntry = m_baseContactEntryCollection.getBaseContactEntry();
- return true;
-
- } else {
-
- return false;
-
- }
- }
-
- /**
- * Return the
- * @see com.arsdigita.bebop.table.TableModel#getElementAt(int)
- */
- public Object getElementAt(int columnIndex) {
- switch (columnIndex){
- case 0:
- return (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key." + m_baseContactEntry.getKey()).localize();
- case 1:
- return m_baseContactEntry.getValue();
- case 2:
- return (m_baseContactEntry.getDescription() != null && m_baseContactEntry.getDescription().length() > MAX_DESC_LENGTH)
- ? m_baseContactEntry.getDescription().substring(0, MAX_DESC_LENGTH)
- : m_baseContactEntry.getDescription();
- case 3:
- return GlobalizationUtil.globalize("cms.ui.delete").localize();
- default:
- return null;
- }
- }
-
- /**
- *
- * @see com.arsdigita.bebop.table.TableModel#getKeyAt(int)
- */
- public Object getKeyAt(int columnIndex) {
- return m_baseContactEntry.getID();
- }
-
- }
-
- /**
- * Check for the permissions to edit item and put either a Label or
- * a ControlLink accordingly.
- */
- private class EditCellRenderer extends LockableImpl implements TableCellRenderer {
-
- public Component getComponent(Table table, PageState state, Object value,
- boolean isSelected, Object key,
- int row, int column) {
-
- SecurityManager sm = Utilities.getSecurityManager(state);
- BaseContact baseContact = (BaseContact) m_itemModel.getSelectedObject(state);
-
- boolean canEdit = sm.canAccess(state.getRequest(),
- SecurityManager.EDIT_ITEM,
- baseContact);
- if(canEdit) {
- ControlLink link = new ControlLink(value.toString());
- return link;
- } else {
- return new Label(value.toString());
- }
- }
- }
-
- /**
- * Check for the permissions to delete item and put either a Label or
- * a ControlLink accordingly.
- */
- private class DeleteCellRenderer extends LockableImpl implements TableCellRenderer {
-
- public Component getComponent(Table table, PageState state, Object value,
- boolean isSelected, Object key,
- int row, int column) {
-
- SecurityManager sm = Utilities.getSecurityManager(state);
- BaseContact baseContact = (BaseContact) m_itemModel.getSelectedObject(state);
-
- boolean canDelete = sm.canAccess(state.getRequest(),
- SecurityManager.DELETE_ITEM,
- baseContact);
- if(canDelete) {
- ControlLink link = new ControlLink(value.toString());
- link.setConfirmation((String) BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.confirm_delete").localize());
- return link;
- } else {
- return new Label(value.toString());
- }
- }
- }
-
- /**
- * Provide implementation to TableActionListener method.
- * Code that comes into picture when a link on the table is clicked.
- * Handles edit and delete event.
- */
- public void cellSelected(TableActionEvent evt) {
-
- PageState state = evt.getPageState();
-
- // Get selected BaseContactEntry
- BaseContactEntry baseContactEntry =
- new BaseContactEntry(new BigDecimal(evt.getRowKey().toString()));
-
- // Get BaseContact
- BaseContact baseContact = (BaseContact) m_itemModel.getSelectedObject(state);
-
- // Get selected column
- TableColumn col = getColumnModel().get(evt.getColumn().intValue());
-
- // Edit
- if(col.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
-
- }
-
- // Delete
- if(col.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
- baseContact.removeContactEntry(baseContactEntry);
- }
-
- }
-
- /**
- * provide Implementation to TableActionListener method.
- * Does nothing in our case.
- */
- public void headSelected(TableActionEvent e) {
- throw new UnsupportedOperationException("Not Implemented");
- }
-
-
-}
diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntryAddForm.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntryAddForm.java.old
deleted file mode 100644
index 7f1986af6..000000000
--- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactEntryAddForm.java.old
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2008 Sören Bernstein 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.contenttypes.ui;
-
-import com.arsdigita.bebop.FormData;
-import com.arsdigita.bebop.Label;
-import com.arsdigita.bebop.event.FormSectionEvent;
-import com.arsdigita.bebop.form.Option;
-import com.arsdigita.bebop.form.SingleSelect;
-import com.arsdigita.bebop.form.TextField;
-import com.arsdigita.bebop.parameters.NotNullValidationListener;
-import com.arsdigita.bebop.parameters.ParameterModel;
-import com.arsdigita.cms.ItemSelectionModel;
-import com.arsdigita.cms.contenttypes.BaseContact;
-import com.arsdigita.cms.contenttypes.BaseContactEntry;
-import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
-import com.arsdigita.cms.ui.authoring.BasicItemForm;
-import com.arsdigita.bebop.parameters.StringParameter;
-import java.util.StringTokenizer;
-
-import org.apache.log4j.Logger;
-
-/**
- * Generates a form for creating new localisations for the given category.
- *
- * This class is part of the admin GUI of CCM and extends the standard form
- * in order to present forms for managing the multi-language categories.
- *
- * @author Sören Bernstein (quasimodo) quasi@zes.uni-bremen.de
- */
-public class BaseContactEntryAddForm extends BasicItemForm {
- private static final Logger s_log = Logger.getLogger(BaseContactEntryAddForm.class);
-
- private ItemSelectionModel m_itemModel;
-
- /** Creates a new instance of CategoryLocalizationAddForm */
- public BaseContactEntryAddForm(ItemSelectionModel itemModel) {
-
- super("BaseContactEntryAddForm",itemModel);
- m_itemModel = itemModel;
-
- }
-
- protected void addWidgets() {
-
- // Key field
- add(new Label(BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key")));
- ParameterModel contactEntryKeyParam = new StringParameter(BaseContactEntry.KEY);
- SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam);
- contactEntryKey.addValidationListener(new NotNullValidationListener());
- contactEntryKey.addOption(new Option("", new Label((String)BaseContactGlobalizationUtil.globalize("cms.ui.select_one").localize())));
-
- // Add the Options to the SingleSelect widget
- StringTokenizer keyList = BaseContact.getConfig().getContactEntryKeys();
- while(keyList.hasMoreElements()) {
- String currentKey = keyList.nextToken();
- contactEntryKey.addOption(new Option(currentKey, ((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.key." + currentKey).localize())));
- }
-
- add(contactEntryKey);
-
- // Value field
- add(new Label(BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.value")));
- ParameterModel contactEntryValueParam = new StringParameter(BaseContactEntry.VALUE);
- TextField contactEntryValue = new TextField(contactEntryValueParam);
- contactEntryValue.addValidationListener(new NotNullValidationListener());
- add(contactEntryValue);
-
- // Description field, only for internal usage
- add(new Label(BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.contactEntry.description")));
- ParameterModel contactEntryDescriptionParam = new StringParameter(BaseContactEntry.DESCRIPTION);
- TextField contactEntryDescription = new TextField(contactEntryDescriptionParam);
- add(contactEntryDescription);
-
- }
-
- public void init(FormSectionEvent fse) {
-
- }
-
- public void process(FormSectionEvent fse) {
- FormData data = fse.getFormData();
- BaseContact baseContact = (BaseContact)m_itemModel.getSelectedObject(fse.getPageState());
-
- // save only if save button was pressed
- if (baseContact != null
- && getSaveCancelSection().getSaveButton().isSelected(fse.getPageState())) {
-
- BaseContactEntry contactEntry = new BaseContactEntry(baseContact,
- (String)data.get(BaseContactEntry.KEY),
- (String)data.get(BaseContactEntry.VALUE),
- (String)data.get(BaseContactEntry.DESCRIPTION));
-
- baseContact.addContactEntry(contactEntry);
- }
- }
-}
diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPersonPropertiesStep.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPersonPropertiesStep.java.old
deleted file mode 100644
index 8801ed9e4..000000000
--- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPersonPropertiesStep.java.old
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * BaseContactPersonPropertiesStep.java
- *
- * Created on 4. Juli 2009, 15:12
- *
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
- */
-
-package com.arsdigita.cms.contenttypes.ui;
-
-import com.arsdigita.cms.ItemSelectionModel;
-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.toolbox.ui.DomainObjectPropertySheet;
-import com.arsdigita.bebop.Component;
-import com.arsdigita.bebop.Label;
-import com.arsdigita.cms.contenttypes.Member;
-import com.arsdigita.cms.contenttypes.util.MemberGlobalizationUtil;
-import com.arsdigita.cms.contenttypes.util.BaseContactGlobalizationUtil;
-
-/**
- *
- * @author quasi
- */
-public class BaseContactPersonPropertiesStep extends SimpleEditStep {
-
- public static final String ADD_PERSON_SHEET_NAME = "addPerson";
- public static final String EDIT_PERSON_SHEET_NAME = "editPerson";
- public static final String CHANGE_PERSON_SHEET_NAME = "changePerson";
- public static final String DELETE_PERSON_SHEET_NAME = "deletePerson";
-
- /**
- * Creates a new instance of BaseContactPersonPropertiesStep
- */
- public BaseContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
- this(itemModel, parent, "");
- }
-
- public BaseContactPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) {
- super(itemModel, parent, prefix);
-
-//XXX
-// if(false/*EMPTY*/) {
-
- BasicPageForm addPersonSheet = new BaseContactAttachPersonPropertyForm(itemModel, this);
- add(ADD_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.attach_person").localize(), new WorkflowLockedComponentAccess(addPersonSheet, itemModel), addPersonSheet.getSaveCancelSection().getCancelButton());
-
- /* Set the displayComponent for this step */
-// setDisplayComponent(getEmptyPersonPropertySheet(itemModel));
-
-// } else {
-
- BasicPageForm editPersonSheet = new BaseContactEditPersonPropertyForm(itemModel, this);
- add(EDIT_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.edit_person").localize(), new WorkflowLockedComponentAccess(editPersonSheet, itemModel), editPersonSheet.getSaveCancelSection().getCancelButton());
-
-// BasicPageForm changePersonSheet = new BaseContactEditPersonPropertyForm(itemModel, this);
-// add(CHANGE_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.reattach_person").localize(), new WorkflowLockedComponentAccess(changePersonSheet, itemModel), changePersonSheet.getSaveCancelSection().getCancelButton());
-
- BasicPageForm deletePersonSheet = new BaseContactDeletePersonForm(itemModel, this);
- add(DELETE_PERSON_SHEET_NAME, (String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.delete_person").localize(), new WorkflowLockedComponentAccess(deletePersonSheet, itemModel), deletePersonSheet.getSaveCancelSection().getCancelButton());
-
- /* Set the displayComponent for this step */
- setDisplayComponent(getPersonPropertySheet(itemModel));
-// }
-
- }
-
- public static Component getPersonPropertySheet(ItemSelectionModel itemModel) {
- DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
-
- 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;
- }
-
- public static Component getEmptyPersonPropertySheet(ItemSelectionModel itemModel) {
- return new Label(((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.emptyPerson").localize()));
- }
-}
diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertiesStep.java b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertiesStep.java
deleted file mode 100644
index 791a989ab..000000000
--- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertiesStep.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.arsdigita.cms.contenttypes.ui;
-
-import com.arsdigita.cms.ItemSelectionModel;
-import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
-import com.arsdigita.bebop.Component;
-
-import org.apache.log4j.Logger;
-
-/**
- * AuthoringStep for the basic properties of a basic contact
- */
-public class BaseContactPropertiesStep extends com.arsdigita.cms.basetypes.ui.ContactPropertiesStep {
-
- private static final Logger logger = Logger.getLogger(BaseContactPropertiesStep.class);
-
- /**
- * Name of the this edit sheet (Don't know if this this really needed.
- * It has the same value in almost all PropertiesStep classes)
- */
- public static final String EDIT_BASIC_SHEET_NAME = "editBasic";
-
- /**
- * Constructor for the PropertiesStep.
- *
- * @param itemModel
- * @param parent
- */
- public BaseContactPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) {
- super(itemModel, parent);
- }
-
- /**
- * Creates and returns the sheet for editing the basic properties
- * of an organization. (@see BaseContactPropertyForm).
- *
- * @param itemModel
- * @return The sheet for editing the properties of the organization.
- */
- public static Component getBaseContactPropertySheet(ItemSelectionModel itemModel) {
- return com.arsdigita.cms.basetypes.ui.ContactPropertiesStep.getContactPropertySheet(itemModel);
- }
-
-}
diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertyForm.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertyForm.java.old
deleted file mode 100644
index f5d9d53d3..000000000
--- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/ui/BaseContactPropertyForm.java.old
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.arsdigita.cms.contenttypes.ui;
-
-import com.arsdigita.bebop.FormProcessException;
-import com.arsdigita.cms.ui.authoring.BasicPageForm;
-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.cms.ItemSelectionModel;
-import com.arsdigita.bebop.FormData;
-import com.arsdigita.cms.contenttypes.BaseContact;
-
-import org.apache.log4j.Logger;
-
-/**
- * Form for editing the basic properties of a basic contact.
- */
-public class BaseContactPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
-
- private static final Logger logger = Logger.getLogger(BaseContactPropertyForm.class);
-
- private BaseContactPropertiesStep m_step;
-
- public static final String PERSON = BaseContact.PERSON;
- public static final String ADRESS = BaseContact.ADDRESS;
- public static final String CONTACT_ENTRIES= BaseContact.CONTACT_ENTRIES;
-
- /**
- * ID of the form
- */
- public static final String ID = "BaseContact_edit";
-
- /**
- * Constrctor taking an ItemSelectionModel
- *
- * @param itemModel
- */
- public BaseContactPropertyForm(ItemSelectionModel itemModel) {
- this(itemModel, null);
- }
-
- /**
- * Constrctor taking an ItemSelectionModel and an instance of BaseContactPropertiesStep.
- *
- * @param itemModel
- * @param step
- */
- public BaseContactPropertyForm(ItemSelectionModel itemModel, BaseContactPropertiesStep step) {
- super(ID, itemModel);
- m_step = step;
- addSubmissionListener(this);
- }
-
- @Override
- public void addWidgets() {
- super.addWidgets();
-
-/*
- add(new Label((String)BaseContactGlobalizationUtil.globalize("cms.contenttypes.ui.baseContact.basic_properties.description").localize())));
- TextArea description = new TextArea(DESCRIPTION);
- description.setRows(5);
- description.setCols(30);
- add(description);
-*/
- }
-
- @Override
- public void init(FormSectionEvent e) throws FormProcessException {
- FormData data = e.getFormData();
- BaseContact baseContact = (BaseContact)super.initBasicWidgets(e);
-
-// data.put(DESCRIPTION, baseContact.getDescription());
- }
-
- @Override
- public void process(FormSectionEvent e) throws FormProcessException {
- FormData data = e.getFormData();
-
- BaseContact baseContact = (BaseContact)super.processBasicWidgets(e);
-
- if((baseContact != null) && (getSaveCancelSection().getSaveButton().isSelected(e.getPageState()))) {
-// baseContact.setDescription((String)data.get(DESCRIPTION));
-
- baseContact.save();
- }
-
- if(m_step != null) {
- m_step.maybeForwardToNextStep(e.getPageState());
- }
- }
-
- public void submitted(FormSectionEvent e) throws FormProcessException {
- if((m_step != null) && (getSaveCancelSection().getCancelButton().isSelected(e.getPageState()))) {
- m_step.cancelStreamlinedCreation(e.getPageState());
- }
- }
-}
\ No newline at end of file
diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactGlobalizationUtil.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactGlobalizationUtil.java.old
deleted file mode 100755
index 7efceffb3..000000000
--- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactGlobalizationUtil.java.old
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.contenttypes.util;
-
-import com.arsdigita.globalization.GlobalizedMessage;
-
-/**
- * - * . - * Contains methods to simplify globalizing keys - *
- * - * @author randyg@arsdigita.com - * @version $Revision: #4 $ $Date: 2004/08/17 $ - */ - -public class BaseContactGlobalizationUtil { - - final public static String BUNDLE_NAME = - "com.arsdigita.cms.contenttypes.util.BaseContactResourceBundle"; - - /** - * This returns a globalized message using the type specific bundle, - * BUNDLE_NAME - */ - public static GlobalizedMessage globalize(String key) { - return new GlobalizedMessage(key, BUNDLE_NAME); - } - - /** - * This returns a globalized message using the type specific bundle, - * BUNDLE_NAME - */ - public static GlobalizedMessage globalize(String key, Object[] args) { - return new GlobalizedMessage(key, BUNDLE_NAME, args); - } -} diff --git a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactResourceBundle.java.old b/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactResourceBundle.java.old deleted file mode 100755 index 3fbd9962a..000000000 --- a/ccm-cms-types-baseContact/src/com/arsdigita/cms/contenttypes/util/BaseContactResourceBundle.java.old +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.contenttypes.util; - -import java.util.PropertyResourceBundle; -import com.arsdigita.globalization.ChainedResourceBundle; -import com.arsdigita.cms.CMSGlobalized; - -/** - * Form to edit the basic properties of an event. This form can be extended to - * create forms for Event subclasses. - **/ -public class BaseContactResourceBundle extends ChainedResourceBundle implements CMSGlobalized { - - public final static String BASE_CONTACT_BUNDLE_NAME = - "com.arsdigita.cms.contenttypes.BaseContactResources"; - - public BaseContactResourceBundle() { - super(); - addBundle((PropertyResourceBundle)getBundle(BASE_CONTACT_BUNDLE_NAME)); - addBundle((PropertyResourceBundle)getBundle(BUNDLE_NAME)); - } -} diff --git a/ccm-cms-types-baseContact/application.xml b/ccm-cms-types-contact/application.xml similarity index 88% rename from ccm-cms-types-baseContact/application.xml rename to ccm-cms-types-contact/application.xml index 9555c5c79..167200261 100755 --- a/ccm-cms-types-baseContact/application.xml +++ b/ccm-cms-types-contact/application.xml @@ -1,6 +1,6 @@| @@ -29,8 +29,8 @@ |