Diverses kleine Korrekturen.
git-svn-id: https://svn.libreccm.org/ccm/trunk@2249 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
a7bd1acb14
commit
cc6b96d27f
|
|
@ -68,6 +68,7 @@ public class RelatedLinkTable extends LinkTable {
|
|||
/**
|
||||
* @see com.arsdigita.cms.contenttypes.ui.LinkTable#addColumns()
|
||||
*/
|
||||
@Override
|
||||
protected void addColumns() {
|
||||
|
||||
super.addColumns();
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@
|
|||
objectType="com.arsdigita.cms.contenttypes.Contact"
|
||||
classname="com.arsdigita.cms.contenttypes.Contact">
|
||||
|
||||
<!-- Contact type's authoring step is completely based on genericcontact! -->
|
||||
<ctd:authoring-kit
|
||||
createComponent="com.arsdigita.cms.contenttypes.ui.GenericContactCreate">
|
||||
createComponent="com.arsdigita.cms.contenttypes.ui.GenericContactCreate">
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
||||
|
|
|
|||
|
|
@ -1057,3 +1057,5 @@ cms.contenttypes.ui.description_hint=A short characterization of this item. You
|
|||
cms.contenttypes.ui.summary_hint=Propably 3-4 sentences to characterize the most important and interesting aspects of the item. By default it will be displayed along with the title in all item list, making up an rich information site.
|
||||
cms.contenttypes.ui.title_hint=The title of the item readable by the user. Besides special circumstances, should not exceed 2 text lines.
|
||||
cms.contenttypes.ui.name_hint=Nicht Teil des Dokumentes wie es Besuchern angezeigt wird. Es handelt sich um den letzten Teil der URL (nach dem letzten "/") und ist somit Teil der Internet Addresse dieses Dokumentes. Es wird oben im Adressfeld des Browsers angezeigt. Es wird automatisch aus dem Titel generiert, wobei unzul\u00e4ssige Zeichen ersetzt werden. Bei einem sehr langen Titel kann eine manuelle K\u00fcrzung sinnvoll sein, um \u00fcberlange Adresszeilen zu vermeiden.
|
||||
#used for tabs in content section
|
||||
cms.ui.images=Images
|
||||
|
|
|
|||
|
|
@ -1052,3 +1052,5 @@ cms.contenttypes.ui.description_hint=Eine kurze Charakterisierung des Dokumentes
|
|||
cms.contenttypes.ui.summary_hint=Nach M\u00f6glichkeit maximal 3-4 S\u00e4tze zur Charakterisierung der wichtigsten und f\u00fcr Leser interessantesten Aspekte des Dokuments. Standardm\u00e4\u00dfig wird die Beschreibung zusammen mit dem Titel in allen Dokumentenliste angezeigt, um so Seiten mit hohem Informationsgehalt zu erzeugen.
|
||||
cms.contenttypes.ui.title_hint=Titel des Dokuments wie ihn Besucher lesen sollen. Abgesehen von Sonderf\u00e4llen sollten 2 Zeilen auf keinen Fall \u00fcberschritten werden. Eine Beschr\u00e4nkung auf eine Zeile ist vorzuziehen. Der Titel wird jedesmal zusammen mit dem Dokument angezeigt.
|
||||
cms.contenttypes.ui.name_hint=Not part of the item as displayed to the user. It is the last part of the URL (after the last "/") and is part of the internet address of this item. It is displayed in the browsers address field. Made up automatically using the title, illegal characters replaced. With a long title you may choose to shorten it to avoid overly long internet addresses.
|
||||
#used for tabs in content section
|
||||
cms.ui.images=Bilder
|
||||
|
|
|
|||
|
|
@ -105,3 +105,5 @@ cms.contenttypes.ui.description_hint=A short characterization of this item. You
|
|||
cms.contenttypes.ui.summary_hint=Propably 3-4 sentences to characterize the most important and interesting aspects of the item. By default it will be displayed along with the title in all item list, making up an rich information site.
|
||||
cms.contenttypes.ui.title_hint=The title of the item readable by the user. Besides special circumstances, should not exceed 2 text lines.
|
||||
cms.contenttypes.ui.name_hint=Not part of the item as displayed to the user. It is the last part of the URL (after the last "/") and is part of the internet address of this item. It is displayed in the browsers address field. Made up automatically using the title, illegal characters replaced. With a long title you may choose to shorten it to avoid overly long internet addresses.
|
||||
#used for tabs in content section
|
||||
cms.ui.images=Images
|
||||
|
|
|
|||
|
|
@ -579,3 +579,5 @@ cms.contenttypes.ui.description_hint=A short characterization of this item. You
|
|||
cms.contenttypes.ui.summary_hint=Propably 3-4 sentences to characterize the most important and interesting aspects of the item. By default it will be displayed along with the title in all item list, making up an rich information site.
|
||||
cms.contenttypes.ui.title_hint=The title of the item readable by the user. Besides special circumstances, should not exceed 2 text lines.
|
||||
cms.contenttypes.ui.name_hint=Not part of the item as displayed to the user. It is the last part of the URL (after the last "/") and is part of the internet address of this item. It is displayed in the browsers address field. Made up automatically using the title, illegal characters replaced. With a long title you may choose to shorten it to avoid overly long internet addresses.
|
||||
#used for tabs in content section
|
||||
cms.ui.images=Images
|
||||
|
|
|
|||
|
|
@ -27,19 +27,19 @@ cms.contenttypes.ui.person.contact=Contacts
|
|||
cms.contenttypes.ui.person.contacts.none=No contacts
|
||||
cms.contenttypes.ui.genericperson.add_contact=Add contact
|
||||
|
||||
cms.contenttypes.ui.contact.basic_properties=Basic Properties
|
||||
cms.contenttypes.ui.contact.edit_basic_properties=Edit Basic Properties
|
||||
cms.contenttypes.ui.genericcontact.basic_properties=Contact's Basic Properties
|
||||
cms.contenttypes.ui.genericcontact.edit_basic_properties=Edit
|
||||
cms.contenttypes.ui.contact.edit_basic_properties.description=Description
|
||||
cms.contenttypes.ui.contact.confirm_delete=Sure?
|
||||
cms.contenttypes.ui.contact.person=Person
|
||||
cms.contenttypes.ui.contact.address=Address
|
||||
cms.contenttypes.ui.genericcontact.person=Attacvh a person
|
||||
cms.contenttypes.ui.genericcontact.address=Attach an address
|
||||
|
||||
cms.contenttypes.ui.contact.attach_address=Attach Address
|
||||
cms.contenttypes.ui.contact.edit_address=Edit Address
|
||||
cms.contenttypes.ui.contact.reattach_address=Reattach Address
|
||||
cms.contenttypes.ui.contact.delete_address=Delete Address
|
||||
cms.contenttypes.ui.contact.emptyAddress=There is no Address attached
|
||||
cms.contenttypes.ui.contact.select_address=Please select a contact content type
|
||||
cms.contenttypes.ui.contact.select_address=Please select a BaseAddres type entry
|
||||
cms.contenttypes.ui.contact.select_address.add=Add
|
||||
cms.contenttypes.ui.contact.select_address.change=Change
|
||||
cms.contenttypes.ui.contact.select_address.wrong_type=BaseAddress selection is required
|
||||
|
|
@ -50,8 +50,8 @@ cms.contenttypes.ui.contact.delete_address.button_label=Delete
|
|||
cms.contenttypes.ui.contact.attach_person=Attach Person
|
||||
cms.contenttypes.ui.contact.edit_person=Edit Person
|
||||
cms.contenttypes.ui.contact.reattach_person=Reattach Person
|
||||
cms.contenttypes.ui.contact.delete_person=Delete Person
|
||||
cms.contenttypes.ui.contact.emptyPerson=There is no Person attached
|
||||
cms.contenttypes.ui.genericcontact.delete_person=Delete Person
|
||||
cms.contenttypes.ui.genericcontact.emptyPerson=There is no Person attached
|
||||
cms.contenttypes.ui.contact.select_person=Please select a Person content type
|
||||
cms.contenttypes.ui.contact.select_person.add=Add
|
||||
cms.contenttypes.ui.contact.select_person.change=Change
|
||||
|
|
@ -61,10 +61,10 @@ cms.contenttypes.ui.contact.delete_person.label=Do you want to delete the link t
|
|||
cms.contenttypes.ui.contact.delete_person.button_label=Delete
|
||||
|
||||
cms.contenttypes.ui.contact.add_contactEntry=Add Contact Entry
|
||||
cms.contenttypes.ui.contact.contactEntry=Contact Entries
|
||||
cms.contenttypes.ui.contact.contactEntry.key=Type
|
||||
cms.contenttypes.ui.contact.contactEntry.value=Value
|
||||
cms.contenttypes.ui.contact.contactEntry.description=Description (internal use only)
|
||||
cms.contenttypes.ui.genericcontact.contactEntry=Contact Entries
|
||||
cms.contenttypes.ui.genericcontact.contactEntry.key=Type
|
||||
cms.contenttypes.ui.genericcontact.contactEntry.value=Value
|
||||
cms.contenttypes.ui.genericcontact.contactEntry.description=Description (internal use only)
|
||||
cms.contenttypes.ui.contact.contactEntry.action=Action
|
||||
|
||||
cms.contenttypes.ui.contact.contactEntry.key.contact_type=Type of Contact
|
||||
|
|
|
|||
|
|
@ -27,12 +27,12 @@ cms.contenttypes.ui.person.contact=Kontakte
|
|||
cms.contenttypes.ui.person.contacts.none=Zur Zeit sind keine Kontakte vorhanden
|
||||
cms.contenttypes.ui.genericperson.add_contact=Kontakt hinzuf\u00fcgen
|
||||
|
||||
cms.contenttypes.ui.contact.basic_properties=Eigenschaften von Contact
|
||||
cms.contenttypes.ui.contact.edit_basic_properties=Bearbeiten
|
||||
cms.contenttypes.ui.genericcontact.basic_properties=Basiseigenschaften von Kontakt
|
||||
cms.contenttypes.ui.genericcontact.edit_basic_properties=Bearbeiten
|
||||
cms.contenttypes.ui.contact.edit_basic_properties.description=Description
|
||||
cms.contenttypes.ui.contact.confirm_delete=Sind Sie sicher?
|
||||
cms.contenttypes.ui.contact.person=Person
|
||||
cms.contenttypes.ui.contact.address=Adresse
|
||||
cms.contenttypes.ui.genericcontact.person=Person verkn\u00fcpfen
|
||||
cms.contenttypes.ui.genericcontact.address=Adresse verkn\u00fcpfen
|
||||
|
||||
cms.contenttypes.ui.contact.attach_address=Adresse verkn\u00fcpfen
|
||||
cms.contenttypes.ui.contact.edit_address=Adresse bearbeiten
|
||||
|
|
@ -50,8 +50,8 @@ cms.contenttypes.ui.contact.delete_address.button_label=L\u00f6schen
|
|||
cms.contenttypes.ui.contact.attach_person=Person verkn\u00fcpfen
|
||||
cms.contenttypes.ui.contact.edit_person=Person bearbeiten
|
||||
cms.contenttypes.ui.contact.reattach_person=Person neu verkn\u00fcpfen
|
||||
cms.contenttypes.ui.contact.delete_person=Person l\u00f6schen
|
||||
cms.contenttypes.ui.contact.emptyPerson=Zur Zeit ist keine Person verkn\u00fcft
|
||||
cms.contenttypes.ui.genericcontact.delete_person=Person l\u00f6schen
|
||||
cms.contenttypes.ui.genericcontact.emptyPerson=Zur Zeit ist keine Person verkn\u00fcft
|
||||
cms.contenttypes.ui.contact.select_person=Bitte w\u00e4hlen Sie einen Eintrag vom Typ Person
|
||||
cms.contenttypes.ui.contact.select_person.add=Verkn\u00fcpfen
|
||||
cms.contenttypes.ui.contact.select_person.change=Ver\u00e4ndern
|
||||
|
|
@ -61,10 +61,10 @@ cms.contenttypes.ui.contact.delete_person.label=WollenSie die Verkn\u00fcfung zu
|
|||
cms.contenttypes.ui.contact.delete_person.button_label=L\u00f6schen
|
||||
|
||||
cms.contenttypes.ui.contact.add_contactEntry=Kontaktinformation hinzuf\u00fcgen
|
||||
cms.contenttypes.ui.contact.contactEntry=Kontaktinformationen
|
||||
cms.contenttypes.ui.contact.contactEntry.key=Art der Information
|
||||
cms.contenttypes.ui.contact.contactEntry.value=Inhalt
|
||||
cms.contenttypes.ui.contact.contactEntry.description=Beschreibung (wird nicht \u00f6ffentlich angezeigt)
|
||||
cms.contenttypes.ui.genericcontact.contactEntry=Kontaktinformationen
|
||||
cms.contenttypes.ui.genericcontact.contactEntry.key=Art der Information
|
||||
cms.contenttypes.ui.genericcontact.contactEntry.value=Inhalt
|
||||
cms.contenttypes.ui.genericcontact.contactEntry.description=Beschreibung (wird nicht \u00f6ffentlich angezeigt)
|
||||
cms.contenttypes.ui.contact.contactEntry.action=Aktionen
|
||||
|
||||
#cms.contenttypes.ui.contact.contactEntry.key.contact_type=Kontaktart
|
||||
|
|
|
|||
|
|
@ -40,9 +40,8 @@ import org.apache.log4j.Logger;
|
|||
public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
||||
implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(
|
||||
GenericContactPropertyForm.class);
|
||||
private static final Logger logger = Logger.getLogger(
|
||||
GenericContactPropertyForm.class);
|
||||
private GenericContactPersonPropertiesStep m_step;
|
||||
private ItemSearchWidget m_itemSearch;
|
||||
private SaveCancelSection m_saveCancelSection;
|
||||
|
|
@ -64,7 +63,8 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
|||
}
|
||||
|
||||
/**
|
||||
* Constrctor taking an ItemSelectionModel and an instance of ContactPropertiesStep.
|
||||
* Constructor taking an ItemSelectionModel and an instance of
|
||||
* ContactPropertiesStep.
|
||||
*
|
||||
* @param itemModel
|
||||
* @param step
|
||||
|
|
@ -94,7 +94,7 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
|||
|
||||
// GenericContact type field
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.contact.type")));
|
||||
"cms.contenttypes.ui.genericperson.contact.type")));
|
||||
ParameterModel contactTypeParam = new StringParameter(CONTACTS_KEY);
|
||||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
contactType.addValidationListener(new NotNullValidationListener());
|
||||
|
|
|
|||
|
|
@ -59,9 +59,10 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
|||
protected void addWidgets() {
|
||||
|
||||
// Key field
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.contactEntry.key")));
|
||||
ParameterModel contactEntryKeyParam = new StringParameter(GenericContactEntry.KEY);
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericcontact.contactEntry.key")));
|
||||
ParameterModel contactEntryKeyParam = new
|
||||
StringParameter(GenericContactEntry.KEY);
|
||||
SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam);
|
||||
contactEntryKey.addValidationListener(new NotNullValidationListener());
|
||||
contactEntryKey.addOption(new
|
||||
|
|
@ -70,7 +71,8 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
|||
|
||||
// Add the Options to the SingleSelect widget
|
||||
GenericContactEntryKeys keyList = new GenericContactEntryKeys();
|
||||
keyList.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
||||
keyList.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale()
|
||||
.getLanguage());
|
||||
while(keyList.next()) {
|
||||
String currentKey = keyList.getKey();
|
||||
contactEntryKey.addOption(new Option(currentKey, keyList.getName()));
|
||||
|
|
@ -79,36 +81,48 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
|||
add(contactEntryKey);
|
||||
|
||||
// Value field
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.contactEntry.value")));
|
||||
ParameterModel contactEntryValueParam = new StringParameter(GenericContactEntry.VALUE);
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericcontact.contactEntry.value")));
|
||||
ParameterModel contactEntryValueParam = new
|
||||
StringParameter(GenericContactEntry.VALUE);
|
||||
TextField contactEntryValue = new TextField(contactEntryValueParam);
|
||||
contactEntryValue.addValidationListener(new NotNullValidationListener());
|
||||
add(contactEntryValue);
|
||||
|
||||
// Description field, only for internal usage
|
||||
add(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.contactEntry.description")));
|
||||
ParameterModel contactEntryDescriptionParam = new StringParameter(GenericContactEntry.DESCRIPTION);
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericcontact.contactEntry.description")));
|
||||
ParameterModel contactEntryDescriptionParam = new
|
||||
StringParameter(GenericContactEntry.DESCRIPTION);
|
||||
TextField contactEntryDescription = new TextField(contactEntryDescriptionParam);
|
||||
add(contactEntryDescription);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Does nothing here.
|
||||
* @param fse
|
||||
*/
|
||||
public void init(FormSectionEvent fse) {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param fse
|
||||
*/
|
||||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
GenericContact contact = (GenericContact)m_itemModel.getSelectedObject(fse.getPageState());
|
||||
GenericContact contact = (GenericContact)
|
||||
m_itemModel.getSelectedObject(fse.getPageState());
|
||||
|
||||
// save only if save button was pressed
|
||||
if (contact != null
|
||||
&& getSaveCancelSection().getSaveButton()
|
||||
.isSelected(fse.getPageState())) {
|
||||
|
||||
GenericContactEntry contactEntry = new GenericContactEntry(contact,
|
||||
GenericContactEntry contactEntry = new GenericContactEntry(
|
||||
contact,
|
||||
(String)data.get(GenericContactEntry.KEY),
|
||||
(String)data.get(GenericContactEntry.VALUE),
|
||||
(String)data.get(GenericContactEntry.DESCRIPTION));
|
||||
|
|
|
|||
|
|
@ -1,23 +1,41 @@
|
|||
/*
|
||||
* GenericContactPersonPropertiesStep.java
|
||||
* Copyright (C) 2009-2013 Sören Bernstein, University of Bremen. All Rights Reserved.
|
||||
*
|
||||
* Created on 4. Juli 2009, 15:12
|
||||
* 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
|
||||
*
|
||||
* To change this template, choose Tools | Template Manager
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
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.bebop.Component;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
|
||||
/**
|
||||
* Property step provides the UI to display a {@link GenericPerson Person}
|
||||
* attached to a Contact.
|
||||
* It is part of the central entry point of contact's authoring step
|
||||
* {@link GenericContactPropertiesStep}
|
||||
*
|
||||
* Class builds the display component, delegates the edit component to
|
||||
* {@link GenericContactAttachPersonPropertyForm}
|
||||
*
|
||||
* @author quasi
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ 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.CMS;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.SecurityManager;
|
||||
|
|
@ -38,7 +39,7 @@ import com.arsdigita.cms.contenttypes.GenericContact;
|
|||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
//import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -55,35 +56,45 @@ public class GenericContactPersonSheet
|
|||
private final String TABLE_COL_DEL = "table_col_del";
|
||||
private ItemSelectionModel m_itemModel;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param itemModel
|
||||
*/
|
||||
public GenericContactPersonSheet(ItemSelectionModel itemModel) {
|
||||
|
||||
super();
|
||||
m_itemModel = itemModel;
|
||||
|
||||
setEmptyView(
|
||||
new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.emptyPerson")));
|
||||
"cms.contenttypes.ui.genericcontact.emptyPerson")));
|
||||
|
||||
TableColumnModel colModel = getColumnModel();
|
||||
colModel.add(new TableColumn(
|
||||
0,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
// "cms.contenttypes.ui.contact.person").localize(),
|
||||
"cms.contenttypes.ui.contact.person"),
|
||||
"cms.contenttypes.ui.genericcontact.person"),
|
||||
TABLE_COL_EDIT));
|
||||
colModel.add(new TableColumn(
|
||||
1,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.delete_person").localize(),
|
||||
"cms.contenttypes.ui.genericcontact.delete_person")
|
||||
// .localize()
|
||||
,
|
||||
TABLE_COL_DEL));
|
||||
|
||||
setModelBuilder(
|
||||
new GenericContactPersonSheetModelBuilder(itemModel));
|
||||
setModelBuilder(new GenericContactPersonSheetModelBuilder(itemModel));
|
||||
|
||||
colModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||
colModel.get(1).setCellRenderer(new DeleteCellRenderer());
|
||||
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private class GenericContactPersonSheetModelBuilder
|
||||
extends LockableImpl
|
||||
implements TableModelBuilder {
|
||||
|
|
@ -147,7 +158,7 @@ public class GenericContactPersonSheet
|
|||
return m_person.getFullName();
|
||||
case 1:
|
||||
return ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.delete_person")
|
||||
"cms.contenttypes.ui.genericcontact.delete_person")
|
||||
// .localize();
|
||||
;
|
||||
default:
|
||||
|
|
@ -174,7 +185,7 @@ public class GenericContactPersonSheet
|
|||
int column) {
|
||||
|
||||
com.arsdigita.cms.SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
CMS.getSecurityManager(state);
|
||||
GenericContact contact = (GenericContact)
|
||||
m_itemModel.getSelectedObject(state);
|
||||
|
||||
|
|
@ -221,8 +232,7 @@ public class GenericContactPersonSheet
|
|||
Object key,
|
||||
int row,
|
||||
int col) {
|
||||
SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
SecurityManager securityManager = CMS.getSecurityManager(state);
|
||||
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(
|
||||
state);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2013 Sören Bernstein, University of Bremen. 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.cms.ContentPage;
|
||||
|
|
@ -18,16 +36,26 @@ import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* AuthoringStep for the basic properties of a basic contact
|
||||
* Central entry point into the AuthoringStep for the basic properties of a
|
||||
* basic contact (GenericContact). This class has to be specified in the
|
||||
* content type's definition XML.
|
||||
*
|
||||
* It uses a segmented Panel to provide several components in one editing step.
|
||||
* Handles the basic contentpage properties (title, name) and additional
|
||||
* basic properties
|
||||
* - Person
|
||||
* - Address
|
||||
* - Various contact entries.
|
||||
*
|
||||
* @author quasi <quasi@barkhof.uni-bremen.de>
|
||||
*/
|
||||
public class GenericContactPropertiesStep extends SimpleEditStep {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(
|
||||
GenericContactPropertiesStep.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)
|
||||
*/
|
||||
|
||||
/** 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";
|
||||
|
||||
/**
|
||||
|
|
@ -38,9 +66,12 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
|||
*/
|
||||
public GenericContactPropertiesStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
|
||||
// Construct a new SimpleEditComponent with basic funtionality
|
||||
super(itemModel, parent);
|
||||
|
||||
setDefaultEditKey(EDIT_BASIC_SHEET_NAME);
|
||||
/* Create a SegmentPanel containing all the various editing steps */
|
||||
SegmentedPanel segmentedPanel = createEditSheet(itemModel, parent);
|
||||
|
||||
/* Sets the composed segmentedPanel as display component */
|
||||
|
|
@ -48,6 +79,11 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
|||
}
|
||||
|
||||
/**
|
||||
* Build the segmented panel. It contains 4 components:
|
||||
* - basic contentPage properties (title/name)
|
||||
* - attached person
|
||||
* - attached address
|
||||
* - contact entries for this contact
|
||||
*
|
||||
* @param itemModel
|
||||
* @param parent
|
||||
|
|
@ -55,23 +91,27 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
|||
*/
|
||||
protected SegmentedPanel createEditSheet(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
|
||||
/* Use a Segmented Panel for the multiple parts of data */
|
||||
SegmentedPanel segmentedPanel = new SegmentedPanel();
|
||||
|
||||
/* The different parts of information are displayed in seperated
|
||||
* segments each containing a SimpleEditStep */
|
||||
/* Well, not so simple anymore... */
|
||||
/* A new SimpleEditStep */
|
||||
|
||||
/* A new SimpleEditStep for basic properties */
|
||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
|
||||
parent,
|
||||
EDIT_BASIC_SHEET_NAME);
|
||||
|
||||
/* Create the edit component for this SimpleEditStep and the corresponding link */
|
||||
BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel, this);
|
||||
/* Create the edit component for this SimpleEditStep and the
|
||||
* corresponding link */
|
||||
BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel,
|
||||
this);
|
||||
basicProperties.add(
|
||||
EDIT_BASIC_SHEET_NAME,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.edit_basic_properties"),
|
||||
"cms.contenttypes.ui.genericcontact.edit_basic_properties"),
|
||||
new WorkflowLockedComponentAccess(
|
||||
editBasicSheet,
|
||||
itemModel),
|
||||
|
|
@ -80,41 +120,49 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
|||
/* Set the displayComponent for this step */
|
||||
basicProperties.setDisplayComponent(getContactPropertySheet(itemModel));
|
||||
|
||||
/* Add the SimpleEditStep to the segmented panel */
|
||||
segmentedPanel
|
||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.basic_properties")),
|
||||
basicProperties);
|
||||
/* Add the basic properties SimpleEditStep to the segmented panel with
|
||||
* provided title */
|
||||
segmentedPanel.addSegment(new
|
||||
Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericcontact.basic_properties")),
|
||||
basicProperties);
|
||||
|
||||
|
||||
// If not disabled via registry, add the ui for attaching a person
|
||||
if (!GenericContact.getConfig().getHidePerson()) {
|
||||
|
||||
GenericContactPersonPropertiesStep personProperties = new
|
||||
GenericContactPersonPropertiesStep(itemModel, parent);
|
||||
segmentedPanel
|
||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.person")),
|
||||
personProperties);
|
||||
// Add step to segmented panel with the provided title
|
||||
segmentedPanel.addSegment(new
|
||||
Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericcontact.person")),
|
||||
personProperties);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// If not disabled via registry, add the ui for attaching an address
|
||||
if (!GenericContact.getConfig().getHideAddress()) {
|
||||
|
||||
GenericContactAddressPropertiesStep addressProperties = new
|
||||
GenericContactAddressPropertiesStep(itemModel, parent);
|
||||
segmentedPanel
|
||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.address")),
|
||||
addressProperties);
|
||||
// Add step to segmented panel with the provided title
|
||||
segmentedPanel.addSegment(new
|
||||
Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericcontact.address")),
|
||||
addressProperties);
|
||||
|
||||
}
|
||||
|
||||
// Add UI for adding several contact entries.
|
||||
GenericContactEntriesPropertiesStep contactEntries = new
|
||||
GenericContactEntriesPropertiesStep(itemModel, parent);
|
||||
segmentedPanel
|
||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.contact.contactEntry")),
|
||||
contactEntries);
|
||||
// Add step to segmented panel with the provided title
|
||||
segmentedPanel.addSegment(new
|
||||
Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericcontact.contactEntry")),
|
||||
contactEntries);
|
||||
|
||||
return segmentedPanel;
|
||||
}
|
||||
|
|
@ -132,12 +180,14 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
|||
/* The DisplayComponent for the Basic Properties */
|
||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), "title");
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), "name");
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"),
|
||||
"title");
|
||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"),
|
||||
"name");
|
||||
|
||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||
sheet.add(GlobalizationUtil
|
||||
.globalize("cms.contenttypes.ui.launch_date"),
|
||||
sheet.add(GlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.launch_date"),
|
||||
ContentPage.LAUNCH_DATE,
|
||||
new LaunchDateAttributeFormatter() );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,21 @@
|
|||
/*
|
||||
* Copyright (C) 2009-2013 Sören Bernstein, University of Bremen. 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.FormProcessException;
|
||||
|
|
@ -13,7 +31,12 @@ import com.arsdigita.cms.contenttypes.GenericContact;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Form for editing the basic properties of a basic contact.
|
||||
* The editing step for contact's basic properties.
|
||||
* It is part of the central entry point of contact's authoring step
|
||||
* {@link GenericContactPropertiesStep}
|
||||
*
|
||||
* The Form enables editing the basic properties of a basic contact as
|
||||
* required by parent class ContentPage (i.e. title / name).
|
||||
*/
|
||||
public class GenericContactPropertyForm extends BasicPageForm
|
||||
implements FormProcessListener,
|
||||
|
|
@ -29,13 +52,11 @@ public class GenericContactPropertyForm extends BasicPageForm
|
|||
public static final String ADRESS = GenericContact.ADDRESS;
|
||||
public static final String CONTACT_ENTRIES= GenericContact.CONTACT_ENTRIES;
|
||||
|
||||
/**
|
||||
* ID of the form
|
||||
*/
|
||||
/** ID of the form */
|
||||
public static final String ID = "Contact_edit";
|
||||
|
||||
/**
|
||||
* Constrctor taking an ItemSelectionModel
|
||||
* Constructor taking an ItemSelectionModel.
|
||||
*
|
||||
* @param itemModel
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -77,25 +77,22 @@ public class Link extends BaseLink {
|
|||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* Constructor, creates a link with a globalized label or an image as label.
|
||||
*
|
||||
* <p>The <tt>Component</tt> parameter in this constructor is usually a
|
||||
* {@link Label} or {@link Image}.</p>
|
||||
* @param child The <tt>Component</tt> parameter in this constructor is
|
||||
* usually a {@link Label} or {@link Image}.
|
||||
* @param url Starting with release 5.2, this method prefixes the passed-in
|
||||
* url with the path to the CCM dispatcher. Code using this
|
||||
* constructor should not prefix <code>url</code> with the
|
||||
* webapp context path or the dispatcher servlet path.
|
||||
*
|
||||
* <p>Starting with release 5.2, this method prefixes the passed-in url with
|
||||
* the path to the CCM dispatcher. Code using this constructor should not
|
||||
* prefix <code>url</code> with the webapp context path or the dispatcher
|
||||
* servlet path.</p>
|
||||
*
|
||||
* <p>The vast majority of CCM UI code expects to link through the dispatcher.
|
||||
* Code that does not should use the <code>Link</code> constructor taking
|
||||
* a <code>URL</code>.</p>
|
||||
*
|
||||
* @see #Link(String,URL)
|
||||
* The vast majority of CCM UI code expects to link through
|
||||
* the dispatcher. Code that does not should use the
|
||||
* <code>Link</code> constructor taking a <code>URL</code>.
|
||||
* @see #Link(String,URL)
|
||||
*/
|
||||
public Link(Component child, String url) {
|
||||
super(child, url);
|
||||
|
||||
init();
|
||||
}
|
||||
|
||||
|
|
@ -120,6 +117,8 @@ public class Link extends BaseLink {
|
|||
* separate call to the <tt>addPrintListener</tt> method. PrintListeners
|
||||
* are a convenient way to alter underlying Link attributes such as Link
|
||||
* text or target URL within a locked page on a per request basis.
|
||||
* @deprecated refactor to use Link(Component,PrintListener) to provide a
|
||||
* globalized label for the link.
|
||||
*/
|
||||
public Link(String label, PrintListener l) {
|
||||
super(label,l);
|
||||
|
|
@ -129,13 +128,11 @@ public class Link extends BaseLink {
|
|||
|
||||
|
||||
/**
|
||||
* Constructors with <tt>PrintListener</tt> parameters
|
||||
* allow for a {@link PrintListener} to be set for
|
||||
* the Link, without the need to make a separate call to
|
||||
* the <tt>addPrintListener</tt> method. PrintListeners
|
||||
* are a convenient way to alter underlying Link attributes
|
||||
* such as Link text or target URL within a locked page
|
||||
* on a per request basis.
|
||||
* Constructors with <tt>PrintListener</tt> parameters allow for a
|
||||
* {@link PrintListener} to be set for the Link, without the need to make a
|
||||
* separate call to the <tt>addPrintListener</tt> method. PrintListeners
|
||||
* are a convenient way to alter underlying Link attributes such as Link
|
||||
* text or target URL within a locked page on a per request basis.
|
||||
*/
|
||||
public Link(PrintListener l) {
|
||||
super(l);
|
||||
|
|
@ -159,6 +156,8 @@ public class Link extends BaseLink {
|
|||
* <code>Link</code> constructor taking a <code>URL</code>.</p>
|
||||
*
|
||||
* @see #Link(String,URL)
|
||||
* @deprecated refactor to use Link(Component,PrintListener) to provide a
|
||||
* globalized label for the link.
|
||||
*/
|
||||
public Link(String label, String url) {
|
||||
super(label, url);
|
||||
|
|
@ -219,6 +218,11 @@ public class Link extends BaseLink {
|
|||
// setVar(name, value);
|
||||
// }
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
* may be this method should be deprecated as well as addURLVars?
|
||||
*/
|
||||
public String getURLVarString() {
|
||||
return m_params.toString();
|
||||
}
|
||||
|
|
@ -241,6 +245,11 @@ public class Link extends BaseLink {
|
|||
setAttribute(FRAME_TARGET_ATTR, frameName);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @param parent
|
||||
*/
|
||||
protected void generateURL(PageState state, Element parent) {
|
||||
parent.addAttribute("href", prepareURL(state, getTarget()));
|
||||
|
||||
|
|
@ -255,6 +264,7 @@ public class Link extends BaseLink {
|
|||
* @return the URL appended with ACS-specific URL parameters.
|
||||
*/
|
||||
protected String prepareURL(final PageState state, String location) {
|
||||
|
||||
final HttpServletRequest req = state.getRequest();
|
||||
final HttpServletResponse resp = state.getResponse();
|
||||
|
||||
|
|
|
|||
|
|
@ -85,8 +85,7 @@ public class TableColumn extends SimpleComponent
|
|||
|
||||
/**
|
||||
* The renderer used for ordinary cells in this column. Null by default,
|
||||
* which instructs the <code>Table</code> to use its default
|
||||
* renderer.
|
||||
* which instructs the <code>Table</code> to use its default renderer.
|
||||
*/
|
||||
private TableCellRenderer m_cellRenderer;
|
||||
|
||||
|
|
@ -105,6 +104,10 @@ public class TableColumn extends SimpleComponent
|
|||
/**
|
||||
* The display value for identifying the header. Will be passed to the
|
||||
* header cell renderer.
|
||||
* Usually this will be a {@link Label} passed in by a pattern like
|
||||
* {@code new Label(GlobalizedMessage)}. But it could be any object,
|
||||
* e.g.an image as well. The use of a string is possible but strongly
|
||||
* discouraged because it results in non-localizable UI.
|
||||
*/
|
||||
private Object m_headerValue;
|
||||
|
||||
|
|
@ -138,8 +141,8 @@ public class TableColumn extends SimpleComponent
|
|||
* header value. The header key is equal to <code>null</code>.
|
||||
*
|
||||
* @param modelIndex the index of the column in the table model from
|
||||
* which to retrieve values.
|
||||
* @param value the value for the column header.
|
||||
* which to retrieve values.
|
||||
* @param value the value for the column header.
|
||||
* @pre modelIndex >= 0
|
||||
*/
|
||||
public TableColumn(int modelIndex, Object value) {
|
||||
|
|
@ -151,9 +154,9 @@ public class TableColumn extends SimpleComponent
|
|||
* header value and key.
|
||||
*
|
||||
* @param modelIndex the index of the column in the table model from
|
||||
* which to retrieve values.
|
||||
* @param value the value for the column header.
|
||||
* @param key the key for the column header.
|
||||
* which to retrieve values.
|
||||
* @param value the value for the column header.
|
||||
* @param key the key for the column header.
|
||||
* @pre modelIndex >= 0
|
||||
*/
|
||||
public TableColumn(int modelIndex, Object value, Object key) {
|
||||
|
|
@ -217,7 +220,9 @@ public class TableColumn extends SimpleComponent
|
|||
|
||||
/**
|
||||
* Get the display value used for the header. This is the object that is
|
||||
* passed to the renderer, often a string.
|
||||
* passed to the renderer. Usually this will be a {@link Label} previously
|
||||
* passed in by a pattern like {@code new Label(GlobalizedMessage)}.
|
||||
* The use of a string is possible but strongly discouraged.
|
||||
*
|
||||
* @return the display value for the header.
|
||||
*/
|
||||
|
|
@ -228,6 +233,9 @@ public class TableColumn extends SimpleComponent
|
|||
/**
|
||||
* Set the display value for the header. This object is passed through to
|
||||
* the header renderer without any modifications.
|
||||
* Usually this will be a {@link Label} passed in by a pattern like
|
||||
* {@code new Label(GlobalizedMessage)}. The use of a string is possible
|
||||
* but strongly discouraged because it results in non-localizable UI.
|
||||
*
|
||||
* @param value the new display value for the header.
|
||||
* @see #getHeaderValue
|
||||
|
|
|
|||
|
|
@ -120,6 +120,11 @@ public class BaseQueryComponent extends QueryComponent {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param state
|
||||
* @param parent
|
||||
*/
|
||||
@Override
|
||||
public void generateXML(PageState state,
|
||||
Element parent) {
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@
|
|||
package com.arsdigita.toolbox.ui;
|
||||
|
||||
|
||||
import com.arsdigita.toolbox.util.GlobalizationUtil ;
|
||||
|
||||
import com.arsdigita.bebop.Page;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.PaginationModelBuilder;
|
||||
|
|
@ -63,34 +61,32 @@ import org.apache.log4j.Logger;
|
|||
* <h4>General</h4>
|
||||
*
|
||||
* Wraps any {@link DataQuery} in a sortable Bebop {@link Table}.
|
||||
*
|
||||
* The {@link DataQuery} is supplied by the {@link DataQueryBuilder} class,
|
||||
* which the user must implement. The <code>DataQueryBuilder</code> may
|
||||
* dynamically construct the query during each request, or return the
|
||||
* same named query for each request; the <code>DataTable</code> does
|
||||
* not care where the query comes from.
|
||||
* dynamically construct the query during each request, or return the same
|
||||
* named query for each request; the <code>DataTable</code> does not care
|
||||
* where the query comes from.
|
||||
* <p>
|
||||
*
|
||||
* This class may contain multiple {@link QueryListener}s. These
|
||||
* listeners will be fired whenever the query is about to
|
||||
* be performed, thus giving the user a chance to set
|
||||
* additional filters on the query.
|
||||
* This class may contain multiple {@link QueryListener}s. These listeners will
|
||||
* be fired whenever the query is about to be performed, thus giving the user
|
||||
* a chance to set additional filters on the query.
|
||||
* <p>
|
||||
*
|
||||
* Columns may be added to the <code>DataTable</code> by calling the
|
||||
* {@link #addColumn} method. The user may choose to make the column
|
||||
* sortable or non-sortable; sortable columns will appear as links
|
||||
* on the Web page which, when clicked, will sort the table by the
|
||||
* specified column. See the documentation on the various
|
||||
* <code>addColumn</code> methods for more information.
|
||||
* {@link #addColumn} method. The user may choose to make the column sortable
|
||||
* or non-sortable; sortable columns will appear as links on the Web page which,
|
||||
* when clicked, will sort the table by the specified column. See the
|
||||
* documentation on the various <code>addColumn</code> methods for more
|
||||
* information.
|
||||
* <p>
|
||||
*
|
||||
* Note that any {@link com.arsdigita.domain.DomainCollection}
|
||||
* can be used with <code>DataTable</code>, since the
|
||||
* <code>DomainCollection</code> is merely a wrapper for a {@link
|
||||
* com.arsdigita.persistence.DataCollection}, which extends
|
||||
* <code>DataQuery</code>. The {@link
|
||||
* com.arsdigita.domain.DomainService} class may be used to retieve
|
||||
* the <code>DataCollection</code> for any given
|
||||
* Note that any {@link com.arsdigita.domain.DomainCollection} can be used with
|
||||
* <code>DataTable</code>, since the <code>DomainCollection</code> is merely
|
||||
* a wrapper for a {@link com.arsdigita.persistence.DataCollection}, which
|
||||
* extends <code>DataQuery</code>. The {@link com.arsdigita.domain.DomainService}
|
||||
* class may be used to retieve the <code>DataCollection</code> for any given
|
||||
* <code>DomainCollection</code>. <p>
|
||||
*
|
||||
* This class sets the XSL "class" attribute to "dataTable"
|
||||
|
|
@ -98,35 +94,34 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* <h4>Pagination</h4>
|
||||
*
|
||||
* <code>DataTable</code> also
|
||||
* implements {@link PaginationModelBuilder}. This means that
|
||||
* it could serve as the model builder for any {@link Paginator}
|
||||
* component. Pagination of the query occurs after all the sorting
|
||||
* and query events have finished. Consider a query which returns
|
||||
* the rows "A B C D E F". If the paginator displays 3 rows per page,
|
||||
* page 1 will contain "A B C" and page 2 will contain "D E F".
|
||||
* If the user then clicks on the header in the <code>DataTable</code>,
|
||||
* causing the query to be sorted in reverse order, page 1 will
|
||||
* contain "F E D" and page 2 will contain "C B A". In order for
|
||||
* pagination to work properly, the following pattern must
|
||||
* be used:
|
||||
* <code>DataTable</code> also implements {@link PaginationModelBuilder}.
|
||||
* This means that it could serve as the model builder for any {@link Paginator}
|
||||
* component. Pagination of the query occurs after all the sorting and query
|
||||
* events have finished. Consider a query which returns the rows "A B C D E F".
|
||||
* If the paginator displays 3 rows per page, page 1 will contain "A B C" and
|
||||
* page 2 will contain "D E F".
|
||||
* If the user then clicks on the header in the <code>DataTable</code>, causing
|
||||
* the query to be sorted in reverse order, page 1 will contain "F E D" and
|
||||
* page 2 will contain "C B A". In order for pagination to work properly, the
|
||||
* following pattern must be used:
|
||||
*
|
||||
* <blockquote><pre><code>DataTable table = new DataTable(...);
|
||||
* <blockquote><pre><code>
|
||||
* DataTable table = new DataTable(...);
|
||||
* Paginator paginator = new Paginator(table, ...);
|
||||
* table.setPaginator(paginator);</code></pre></blockquote>
|
||||
* table.setPaginator(paginator);
|
||||
* </code></pre></blockquote>
|
||||
*
|
||||
* The <code>setPaginator</code> call is required due to a
|
||||
* design flaw in the <code>Paginator</code> component.
|
||||
* The <code>setPaginator</code> call is required due to a design flaw in the
|
||||
* <code>Paginator</code> component.
|
||||
* <p>
|
||||
*
|
||||
* <h4>Globalization</h4>
|
||||
*
|
||||
* The <code>DataTable</code> will ordinarily interpret the labels
|
||||
* of its column headers as plain text, and spit them out on
|
||||
* the screen verbatim. However, if <code>setResouceBundle</code>
|
||||
* is called, <code>DataTable</code> will instead interpret the
|
||||
* column header labels as keys into the specified resource bundle,
|
||||
* thus attempting to globalize the column headers at runtime.
|
||||
* The <code>DataTable</code> will ordinarily interpret the labels of its
|
||||
* column headers as plain text, and spit them out on the screen verbatim.
|
||||
* However, if <code>setResouceBundle</code> is called, <code>DataTable</code>
|
||||
* will instead interpret the column header labels as keys into the specified
|
||||
* resource bundle, thus attempting to globalize the column headers at runtime.
|
||||
* <p>
|
||||
*
|
||||
* @author Stanislav Freidin
|
||||
|
|
@ -196,9 +191,8 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
* used to globalize the column labels. If null, column labels will
|
||||
* be printed verbatim to the screen.
|
||||
*/
|
||||
public DataTable (
|
||||
DataQueryBuilder builder, SingleSelectionModel orderModel
|
||||
) {
|
||||
public DataTable (DataQueryBuilder builder,
|
||||
SingleSelectionModel orderModel ) {
|
||||
this(builder, orderModel, null);
|
||||
}
|
||||
|
||||
|
|
@ -217,6 +211,7 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
/**
|
||||
* Register the ordering parameter
|
||||
*/
|
||||
@Override
|
||||
public void register(Page p) {
|
||||
super.register(p);
|
||||
p.addComponentStateParam(this,
|
||||
|
|
@ -252,16 +247,20 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
/**
|
||||
* Add a column to this table.
|
||||
*
|
||||
* @param label The user-readable label for the column
|
||||
* @param label The user-readable label for the column
|
||||
* NOTE: depending on setResourceBundle() it is treated
|
||||
* as plain text for output or key into bundle
|
||||
* resulting in globalized Labels!
|
||||
* @param attribute The name of the attribute in the <code>DataQuery</code>
|
||||
* which will be used as the value for this column.
|
||||
* which will be used as the value for this column.
|
||||
* @param isSortable true if it is possible to sort using this column, false
|
||||
* otherwise
|
||||
* @param renderer a {@link TableCellRenderer} that will be used to
|
||||
* format the attribute as a string.
|
||||
* otherwise
|
||||
* @param renderer a {@link TableCellRenderer} that will be used to
|
||||
* format the attribute as a string.
|
||||
* @return the newly added column
|
||||
*/
|
||||
public TableColumn addColumn(String label, String attribute,
|
||||
public TableColumn addColumn(String label,
|
||||
String attribute,
|
||||
boolean isSortable,
|
||||
TableCellRenderer renderer) {
|
||||
return addColumn(label, attribute, isSortable, renderer, null);
|
||||
|
|
@ -272,6 +271,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
* Add a column to this table.
|
||||
*
|
||||
* @param label The user-readable label for the column
|
||||
* NOTE: depending on setResourceBundle() it is treated
|
||||
* as plain text for output or key into bundle
|
||||
* resulting in globalized Labels!
|
||||
* @param attribute The name of the attribute in the <code>DataQuery</code>
|
||||
* which will be used as the value for this column.
|
||||
* @param isSortable true if it is possible to sort using this column, false
|
||||
|
|
@ -284,10 +286,14 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
* @return the newly added column
|
||||
*/
|
||||
public TableColumn addColumn(String label, String attribute,
|
||||
boolean isSortable, TableCellRenderer renderer, String orderAttribute) {
|
||||
boolean isSortable, TableCellRenderer renderer,
|
||||
String orderAttribute) {
|
||||
DataTableColumnModel model = (DataTableColumnModel)getColumnModel();
|
||||
TableColumn column = new SortableTableColumn (
|
||||
model.size(), label, attribute, isSortable, renderer
|
||||
TableColumn column = new SortableTableColumn(model.size(),
|
||||
label,
|
||||
attribute,
|
||||
isSortable,
|
||||
renderer
|
||||
);
|
||||
|
||||
model.add(column, orderAttribute);
|
||||
|
|
@ -305,6 +311,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
* Add a column to this table.
|
||||
*
|
||||
* @param label The user-readable label for the column
|
||||
* NOTE: depending on setResourceBundle() it is treated
|
||||
* as plain text for output or key into bundle
|
||||
* resulting in globalized Labels!
|
||||
* @param attribute The name of the attribute in the <code>DataQuery</code>
|
||||
* which will be used as the value for this column.
|
||||
* @param isSortable true if it is possible to sort using this column, false
|
||||
|
|
@ -321,6 +330,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
* Add a column to this table.
|
||||
*
|
||||
* @param label The user-readable label for the column
|
||||
* NOTE: depending on setResourceBundle() it is treated
|
||||
* as plain text for output or key into bundle
|
||||
* resulting in globalized Labels!
|
||||
* @param attribute The name of the attribute in the <code>DataQuery</code>
|
||||
* which will be used as the value for this column.
|
||||
* @return the newly added column
|
||||
|
|
@ -338,6 +350,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
* will be used to add {@link ControlLink}s to the table.
|
||||
*
|
||||
* @param label The user-readable label for the column
|
||||
* NOTE: depending on setResourceBundle() it is treated
|
||||
* as plain text for output or key into bundle
|
||||
* resulting in globalized Labels!
|
||||
* @param renderer The cell renderer for the given column
|
||||
* @return the newly added column
|
||||
*/
|
||||
|
|
@ -351,8 +366,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return the {@link DataQueryBuilder} that creates
|
||||
* a {@link DataQuery} for this table during each request
|
||||
*
|
||||
* @return the {@link DataQueryBuilder} that creates a {@link DataQuery}
|
||||
* for this table during each request
|
||||
*/
|
||||
public DataQueryBuilder getDataQueryBuilder() {
|
||||
return m_builder;
|
||||
|
|
@ -367,8 +383,8 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the {@link SingleSelectionModel} that will determine the order
|
||||
* for the items in the tabke
|
||||
* Set the {@link SingleSelectionModel} that will determine the order for
|
||||
* the items in the table.
|
||||
*
|
||||
* @param orderModel The new model
|
||||
*/
|
||||
|
|
@ -385,8 +401,8 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
}
|
||||
|
||||
/**
|
||||
* Add a {@link QueryListener} to this table. The listener
|
||||
* will be fired whenever the query is about to be performed.
|
||||
* Add a {@link QueryListener} to this table. The listener will be fired
|
||||
* whenever the query is about to be performed.
|
||||
*
|
||||
* @param l the new query listener
|
||||
*/
|
||||
|
|
@ -539,12 +555,14 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
/**
|
||||
* Lock this table
|
||||
*/
|
||||
@Override
|
||||
public void lock() {
|
||||
m_builder.lock();
|
||||
super.lock();
|
||||
}
|
||||
|
||||
// Export the current order
|
||||
@Override
|
||||
public void generateExtraXMLAttributes(PageState s, Element element) {
|
||||
String key = getOrder(s);
|
||||
if (key != null) {
|
||||
|
|
@ -898,6 +916,7 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
|||
setColumnKey(get(columnIndex), columnKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void remove(TableColumn column) {
|
||||
super.remove(column);
|
||||
m_columnKeys.remove(column);
|
||||
|
|
|
|||
Loading…
Reference in New Issue