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()
|
* @see com.arsdigita.cms.contenttypes.ui.LinkTable#addColumns()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void addColumns() {
|
protected void addColumns() {
|
||||||
|
|
||||||
super.addColumns();
|
super.addColumns();
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,9 @@
|
||||||
objectType="com.arsdigita.cms.contenttypes.Contact"
|
objectType="com.arsdigita.cms.contenttypes.Contact"
|
||||||
classname="com.arsdigita.cms.contenttypes.Contact">
|
classname="com.arsdigita.cms.contenttypes.Contact">
|
||||||
|
|
||||||
|
<!-- Contact type's authoring step is completely based on genericcontact! -->
|
||||||
<ctd:authoring-kit
|
<ctd:authoring-kit
|
||||||
createComponent="com.arsdigita.cms.contenttypes.ui.GenericContactCreate">
|
createComponent="com.arsdigita.cms.contenttypes.ui.GenericContactCreate">
|
||||||
|
|
||||||
<ctd:authoring-step
|
<ctd:authoring-step
|
||||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
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.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.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.
|
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.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.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.
|
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.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.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.
|
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.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.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.
|
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.person.contacts.none=No contacts
|
||||||
cms.contenttypes.ui.genericperson.add_contact=Add contact
|
cms.contenttypes.ui.genericperson.add_contact=Add contact
|
||||||
|
|
||||||
cms.contenttypes.ui.contact.basic_properties=Basic Properties
|
cms.contenttypes.ui.genericcontact.basic_properties=Contact's Basic Properties
|
||||||
cms.contenttypes.ui.contact.edit_basic_properties=Edit Basic Properties
|
cms.contenttypes.ui.genericcontact.edit_basic_properties=Edit
|
||||||
cms.contenttypes.ui.contact.edit_basic_properties.description=Description
|
cms.contenttypes.ui.contact.edit_basic_properties.description=Description
|
||||||
cms.contenttypes.ui.contact.confirm_delete=Sure?
|
cms.contenttypes.ui.contact.confirm_delete=Sure?
|
||||||
cms.contenttypes.ui.contact.person=Person
|
cms.contenttypes.ui.genericcontact.person=Attacvh a person
|
||||||
cms.contenttypes.ui.contact.address=Address
|
cms.contenttypes.ui.genericcontact.address=Attach an address
|
||||||
|
|
||||||
cms.contenttypes.ui.contact.attach_address=Attach Address
|
cms.contenttypes.ui.contact.attach_address=Attach Address
|
||||||
cms.contenttypes.ui.contact.edit_address=Edit Address
|
cms.contenttypes.ui.contact.edit_address=Edit Address
|
||||||
cms.contenttypes.ui.contact.reattach_address=Reattach Address
|
cms.contenttypes.ui.contact.reattach_address=Reattach Address
|
||||||
cms.contenttypes.ui.contact.delete_address=Delete Address
|
cms.contenttypes.ui.contact.delete_address=Delete Address
|
||||||
cms.contenttypes.ui.contact.emptyAddress=There is no Address attached
|
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.add=Add
|
||||||
cms.contenttypes.ui.contact.select_address.change=Change
|
cms.contenttypes.ui.contact.select_address.change=Change
|
||||||
cms.contenttypes.ui.contact.select_address.wrong_type=BaseAddress selection is required
|
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.attach_person=Attach Person
|
||||||
cms.contenttypes.ui.contact.edit_person=Edit Person
|
cms.contenttypes.ui.contact.edit_person=Edit Person
|
||||||
cms.contenttypes.ui.contact.reattach_person=Reattach Person
|
cms.contenttypes.ui.contact.reattach_person=Reattach Person
|
||||||
cms.contenttypes.ui.contact.delete_person=Delete Person
|
cms.contenttypes.ui.genericcontact.delete_person=Delete Person
|
||||||
cms.contenttypes.ui.contact.emptyPerson=There is no Person attached
|
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=Please select a Person content type
|
||||||
cms.contenttypes.ui.contact.select_person.add=Add
|
cms.contenttypes.ui.contact.select_person.add=Add
|
||||||
cms.contenttypes.ui.contact.select_person.change=Change
|
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.delete_person.button_label=Delete
|
||||||
|
|
||||||
cms.contenttypes.ui.contact.add_contactEntry=Add Contact Entry
|
cms.contenttypes.ui.contact.add_contactEntry=Add Contact Entry
|
||||||
cms.contenttypes.ui.contact.contactEntry=Contact Entries
|
cms.contenttypes.ui.genericcontact.contactEntry=Contact Entries
|
||||||
cms.contenttypes.ui.contact.contactEntry.key=Type
|
cms.contenttypes.ui.genericcontact.contactEntry.key=Type
|
||||||
cms.contenttypes.ui.contact.contactEntry.value=Value
|
cms.contenttypes.ui.genericcontact.contactEntry.value=Value
|
||||||
cms.contenttypes.ui.contact.contactEntry.description=Description (internal use only)
|
cms.contenttypes.ui.genericcontact.contactEntry.description=Description (internal use only)
|
||||||
cms.contenttypes.ui.contact.contactEntry.action=Action
|
cms.contenttypes.ui.contact.contactEntry.action=Action
|
||||||
|
|
||||||
cms.contenttypes.ui.contact.contactEntry.key.contact_type=Type of Contact
|
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.person.contacts.none=Zur Zeit sind keine Kontakte vorhanden
|
||||||
cms.contenttypes.ui.genericperson.add_contact=Kontakt hinzuf\u00fcgen
|
cms.contenttypes.ui.genericperson.add_contact=Kontakt hinzuf\u00fcgen
|
||||||
|
|
||||||
cms.contenttypes.ui.contact.basic_properties=Eigenschaften von Contact
|
cms.contenttypes.ui.genericcontact.basic_properties=Basiseigenschaften von Kontakt
|
||||||
cms.contenttypes.ui.contact.edit_basic_properties=Bearbeiten
|
cms.contenttypes.ui.genericcontact.edit_basic_properties=Bearbeiten
|
||||||
cms.contenttypes.ui.contact.edit_basic_properties.description=Description
|
cms.contenttypes.ui.contact.edit_basic_properties.description=Description
|
||||||
cms.contenttypes.ui.contact.confirm_delete=Sind Sie sicher?
|
cms.contenttypes.ui.contact.confirm_delete=Sind Sie sicher?
|
||||||
cms.contenttypes.ui.contact.person=Person
|
cms.contenttypes.ui.genericcontact.person=Person verkn\u00fcpfen
|
||||||
cms.contenttypes.ui.contact.address=Adresse
|
cms.contenttypes.ui.genericcontact.address=Adresse verkn\u00fcpfen
|
||||||
|
|
||||||
cms.contenttypes.ui.contact.attach_address=Adresse verkn\u00fcpfen
|
cms.contenttypes.ui.contact.attach_address=Adresse verkn\u00fcpfen
|
||||||
cms.contenttypes.ui.contact.edit_address=Adresse bearbeiten
|
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.attach_person=Person verkn\u00fcpfen
|
||||||
cms.contenttypes.ui.contact.edit_person=Person bearbeiten
|
cms.contenttypes.ui.contact.edit_person=Person bearbeiten
|
||||||
cms.contenttypes.ui.contact.reattach_person=Person neu verkn\u00fcpfen
|
cms.contenttypes.ui.contact.reattach_person=Person neu verkn\u00fcpfen
|
||||||
cms.contenttypes.ui.contact.delete_person=Person l\u00f6schen
|
cms.contenttypes.ui.genericcontact.delete_person=Person l\u00f6schen
|
||||||
cms.contenttypes.ui.contact.emptyPerson=Zur Zeit ist keine Person verkn\u00fcft
|
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=Bitte w\u00e4hlen Sie einen Eintrag vom Typ Person
|
||||||
cms.contenttypes.ui.contact.select_person.add=Verkn\u00fcpfen
|
cms.contenttypes.ui.contact.select_person.add=Verkn\u00fcpfen
|
||||||
cms.contenttypes.ui.contact.select_person.change=Ver\u00e4ndern
|
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.delete_person.button_label=L\u00f6schen
|
||||||
|
|
||||||
cms.contenttypes.ui.contact.add_contactEntry=Kontaktinformation hinzuf\u00fcgen
|
cms.contenttypes.ui.contact.add_contactEntry=Kontaktinformation hinzuf\u00fcgen
|
||||||
cms.contenttypes.ui.contact.contactEntry=Kontaktinformationen
|
cms.contenttypes.ui.genericcontact.contactEntry=Kontaktinformationen
|
||||||
cms.contenttypes.ui.contact.contactEntry.key=Art der Information
|
cms.contenttypes.ui.genericcontact.contactEntry.key=Art der Information
|
||||||
cms.contenttypes.ui.contact.contactEntry.value=Inhalt
|
cms.contenttypes.ui.genericcontact.contactEntry.value=Inhalt
|
||||||
cms.contenttypes.ui.contact.contactEntry.description=Beschreibung (wird nicht \u00f6ffentlich angezeigt)
|
cms.contenttypes.ui.genericcontact.contactEntry.description=Beschreibung (wird nicht \u00f6ffentlich angezeigt)
|
||||||
cms.contenttypes.ui.contact.contactEntry.action=Aktionen
|
cms.contenttypes.ui.contact.contactEntry.action=Aktionen
|
||||||
|
|
||||||
#cms.contenttypes.ui.contact.contactEntry.key.contact_type=Kontaktart
|
#cms.contenttypes.ui.contact.contactEntry.key.contact_type=Kontaktart
|
||||||
|
|
|
||||||
|
|
@ -40,9 +40,8 @@ import org.apache.log4j.Logger;
|
||||||
public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
||||||
implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||||
|
|
||||||
private static final Logger logger =
|
private static final Logger logger = Logger.getLogger(
|
||||||
Logger.getLogger(
|
GenericContactPropertyForm.class);
|
||||||
GenericContactPropertyForm.class);
|
|
||||||
private GenericContactPersonPropertiesStep m_step;
|
private GenericContactPersonPropertiesStep m_step;
|
||||||
private ItemSearchWidget m_itemSearch;
|
private ItemSearchWidget m_itemSearch;
|
||||||
private SaveCancelSection m_saveCancelSection;
|
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 itemModel
|
||||||
* @param step
|
* @param step
|
||||||
|
|
@ -94,7 +94,7 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
||||||
|
|
||||||
// GenericContact type field
|
// GenericContact type field
|
||||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.person.contact.type")));
|
"cms.contenttypes.ui.genericperson.contact.type")));
|
||||||
ParameterModel contactTypeParam = new StringParameter(CONTACTS_KEY);
|
ParameterModel contactTypeParam = new StringParameter(CONTACTS_KEY);
|
||||||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||||
contactType.addValidationListener(new NotNullValidationListener());
|
contactType.addValidationListener(new NotNullValidationListener());
|
||||||
|
|
|
||||||
|
|
@ -59,9 +59,10 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
|
|
||||||
// Key field
|
// Key field
|
||||||
add(new Label(ContenttypesGlobalizationUtil
|
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
.globalize("cms.contenttypes.ui.contact.contactEntry.key")));
|
"cms.contenttypes.ui.genericcontact.contactEntry.key")));
|
||||||
ParameterModel contactEntryKeyParam = new StringParameter(GenericContactEntry.KEY);
|
ParameterModel contactEntryKeyParam = new
|
||||||
|
StringParameter(GenericContactEntry.KEY);
|
||||||
SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam);
|
SingleSelect contactEntryKey = new SingleSelect(contactEntryKeyParam);
|
||||||
contactEntryKey.addValidationListener(new NotNullValidationListener());
|
contactEntryKey.addValidationListener(new NotNullValidationListener());
|
||||||
contactEntryKey.addOption(new
|
contactEntryKey.addOption(new
|
||||||
|
|
@ -70,7 +71,8 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
||||||
|
|
||||||
// Add the Options to the SingleSelect widget
|
// Add the Options to the SingleSelect widget
|
||||||
GenericContactEntryKeys keyList = new GenericContactEntryKeys();
|
GenericContactEntryKeys keyList = new GenericContactEntryKeys();
|
||||||
keyList.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale().getLanguage());
|
keyList.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale()
|
||||||
|
.getLanguage());
|
||||||
while(keyList.next()) {
|
while(keyList.next()) {
|
||||||
String currentKey = keyList.getKey();
|
String currentKey = keyList.getKey();
|
||||||
contactEntryKey.addOption(new Option(currentKey, keyList.getName()));
|
contactEntryKey.addOption(new Option(currentKey, keyList.getName()));
|
||||||
|
|
@ -79,36 +81,48 @@ public class GenericContactEntryAddForm extends BasicItemForm {
|
||||||
add(contactEntryKey);
|
add(contactEntryKey);
|
||||||
|
|
||||||
// Value field
|
// Value field
|
||||||
add(new Label(ContenttypesGlobalizationUtil
|
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
.globalize("cms.contenttypes.ui.contact.contactEntry.value")));
|
"cms.contenttypes.ui.genericcontact.contactEntry.value")));
|
||||||
ParameterModel contactEntryValueParam = new StringParameter(GenericContactEntry.VALUE);
|
ParameterModel contactEntryValueParam = new
|
||||||
|
StringParameter(GenericContactEntry.VALUE);
|
||||||
TextField contactEntryValue = new TextField(contactEntryValueParam);
|
TextField contactEntryValue = new TextField(contactEntryValueParam);
|
||||||
contactEntryValue.addValidationListener(new NotNullValidationListener());
|
contactEntryValue.addValidationListener(new NotNullValidationListener());
|
||||||
add(contactEntryValue);
|
add(contactEntryValue);
|
||||||
|
|
||||||
// Description field, only for internal usage
|
// Description field, only for internal usage
|
||||||
add(new Label(ContenttypesGlobalizationUtil
|
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
.globalize("cms.contenttypes.ui.contact.contactEntry.description")));
|
"cms.contenttypes.ui.genericcontact.contactEntry.description")));
|
||||||
ParameterModel contactEntryDescriptionParam = new StringParameter(GenericContactEntry.DESCRIPTION);
|
ParameterModel contactEntryDescriptionParam = new
|
||||||
|
StringParameter(GenericContactEntry.DESCRIPTION);
|
||||||
TextField contactEntryDescription = new TextField(contactEntryDescriptionParam);
|
TextField contactEntryDescription = new TextField(contactEntryDescriptionParam);
|
||||||
add(contactEntryDescription);
|
add(contactEntryDescription);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does nothing here.
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
public void init(FormSectionEvent fse) {
|
public void init(FormSectionEvent fse) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param fse
|
||||||
|
*/
|
||||||
public void process(FormSectionEvent fse) {
|
public void process(FormSectionEvent fse) {
|
||||||
FormData data = fse.getFormData();
|
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
|
// save only if save button was pressed
|
||||||
if (contact != null
|
if (contact != null
|
||||||
&& getSaveCancelSection().getSaveButton()
|
&& getSaveCancelSection().getSaveButton()
|
||||||
.isSelected(fse.getPageState())) {
|
.isSelected(fse.getPageState())) {
|
||||||
|
|
||||||
GenericContactEntry contactEntry = new GenericContactEntry(contact,
|
GenericContactEntry contactEntry = new GenericContactEntry(
|
||||||
|
contact,
|
||||||
(String)data.get(GenericContactEntry.KEY),
|
(String)data.get(GenericContactEntry.KEY),
|
||||||
(String)data.get(GenericContactEntry.VALUE),
|
(String)data.get(GenericContactEntry.VALUE),
|
||||||
(String)data.get(GenericContactEntry.DESCRIPTION));
|
(String)data.get(GenericContactEntry.DESCRIPTION));
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,42 @@
|
||||||
/*
|
/*
|
||||||
* 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;
|
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.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
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
|
* @author quasi
|
||||||
*/
|
*/
|
||||||
public class GenericContactPersonPropertiesStep extends SimpleEditStep {
|
public class GenericContactPersonPropertiesStep extends SimpleEditStep {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import com.arsdigita.bebop.table.TableColumn;
|
||||||
import com.arsdigita.bebop.table.TableColumnModel;
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
import com.arsdigita.bebop.table.TableModel;
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
|
import com.arsdigita.cms.CMS;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
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.GenericPerson;
|
||||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.dispatcher.ItemResolver;
|
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.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
@ -55,35 +56,45 @@ public class GenericContactPersonSheet
|
||||||
private final String TABLE_COL_DEL = "table_col_del";
|
private final String TABLE_COL_DEL = "table_col_del";
|
||||||
private ItemSelectionModel m_itemModel;
|
private ItemSelectionModel m_itemModel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
* @param itemModel
|
||||||
|
*/
|
||||||
public GenericContactPersonSheet(ItemSelectionModel itemModel) {
|
public GenericContactPersonSheet(ItemSelectionModel itemModel) {
|
||||||
|
|
||||||
super();
|
super();
|
||||||
m_itemModel = itemModel;
|
m_itemModel = itemModel;
|
||||||
|
|
||||||
setEmptyView(
|
setEmptyView(
|
||||||
new Label(ContenttypesGlobalizationUtil.globalize(
|
new Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.contact.emptyPerson")));
|
"cms.contenttypes.ui.genericcontact.emptyPerson")));
|
||||||
|
|
||||||
TableColumnModel colModel = getColumnModel();
|
TableColumnModel colModel = getColumnModel();
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
0,
|
0,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
// "cms.contenttypes.ui.contact.person").localize(),
|
// "cms.contenttypes.ui.contact.person").localize(),
|
||||||
"cms.contenttypes.ui.contact.person"),
|
"cms.contenttypes.ui.genericcontact.person"),
|
||||||
TABLE_COL_EDIT));
|
TABLE_COL_EDIT));
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
1,
|
1,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.contact.delete_person").localize(),
|
"cms.contenttypes.ui.genericcontact.delete_person")
|
||||||
|
// .localize()
|
||||||
|
,
|
||||||
TABLE_COL_DEL));
|
TABLE_COL_DEL));
|
||||||
|
|
||||||
setModelBuilder(
|
setModelBuilder(new GenericContactPersonSheetModelBuilder(itemModel));
|
||||||
new GenericContactPersonSheetModelBuilder(itemModel));
|
|
||||||
colModel.get(0).setCellRenderer(new EditCellRenderer());
|
colModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||||
colModel.get(1).setCellRenderer(new DeleteCellRenderer());
|
colModel.get(1).setCellRenderer(new DeleteCellRenderer());
|
||||||
|
|
||||||
addTableActionListener(this);
|
addTableActionListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
private class GenericContactPersonSheetModelBuilder
|
private class GenericContactPersonSheetModelBuilder
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableModelBuilder {
|
implements TableModelBuilder {
|
||||||
|
|
@ -147,7 +158,7 @@ public class GenericContactPersonSheet
|
||||||
return m_person.getFullName();
|
return m_person.getFullName();
|
||||||
case 1:
|
case 1:
|
||||||
return ContenttypesGlobalizationUtil.globalize(
|
return ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.contact.delete_person")
|
"cms.contenttypes.ui.genericcontact.delete_person")
|
||||||
// .localize();
|
// .localize();
|
||||||
;
|
;
|
||||||
default:
|
default:
|
||||||
|
|
@ -174,7 +185,7 @@ public class GenericContactPersonSheet
|
||||||
int column) {
|
int column) {
|
||||||
|
|
||||||
com.arsdigita.cms.SecurityManager securityManager =
|
com.arsdigita.cms.SecurityManager securityManager =
|
||||||
Utilities.getSecurityManager(state);
|
CMS.getSecurityManager(state);
|
||||||
GenericContact contact = (GenericContact)
|
GenericContact contact = (GenericContact)
|
||||||
m_itemModel.getSelectedObject(state);
|
m_itemModel.getSelectedObject(state);
|
||||||
|
|
||||||
|
|
@ -221,8 +232,7 @@ public class GenericContactPersonSheet
|
||||||
Object key,
|
Object key,
|
||||||
int row,
|
int row,
|
||||||
int col) {
|
int col) {
|
||||||
SecurityManager securityManager =
|
SecurityManager securityManager = CMS.getSecurityManager(state);
|
||||||
Utilities.getSecurityManager(state);
|
|
||||||
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(
|
GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(
|
||||||
state);
|
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;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
|
|
@ -18,16 +36,26 @@ import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import org.apache.log4j.Logger;
|
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 {
|
public class GenericContactPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(
|
private static final Logger logger = Logger.getLogger(
|
||||||
GenericContactPropertiesStep.class);
|
GenericContactPropertiesStep.class);
|
||||||
/**
|
|
||||||
* Name of the this edit sheet (Don't know if this this really needed.
|
/** Name of the this edit sheet (Don't know if this this really needed.
|
||||||
* It has the same value in almost all PropertiesStep classes)
|
* It has the same value in almost all PropertiesStep classes) */
|
||||||
*/
|
|
||||||
public static final String EDIT_BASIC_SHEET_NAME = "editBasic";
|
public static final String EDIT_BASIC_SHEET_NAME = "editBasic";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -38,9 +66,12 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
||||||
*/
|
*/
|
||||||
public GenericContactPropertiesStep(ItemSelectionModel itemModel,
|
public GenericContactPropertiesStep(ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent) {
|
AuthoringKitWizard parent) {
|
||||||
|
|
||||||
|
// Construct a new SimpleEditComponent with basic funtionality
|
||||||
super(itemModel, parent);
|
super(itemModel, parent);
|
||||||
|
|
||||||
setDefaultEditKey(EDIT_BASIC_SHEET_NAME);
|
setDefaultEditKey(EDIT_BASIC_SHEET_NAME);
|
||||||
|
/* Create a SegmentPanel containing all the various editing steps */
|
||||||
SegmentedPanel segmentedPanel = createEditSheet(itemModel, parent);
|
SegmentedPanel segmentedPanel = createEditSheet(itemModel, parent);
|
||||||
|
|
||||||
/* Sets the composed segmentedPanel as display component */
|
/* 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 itemModel
|
||||||
* @param parent
|
* @param parent
|
||||||
|
|
@ -55,23 +91,27 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
||||||
*/
|
*/
|
||||||
protected SegmentedPanel createEditSheet(ItemSelectionModel itemModel,
|
protected SegmentedPanel createEditSheet(ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent) {
|
AuthoringKitWizard parent) {
|
||||||
|
|
||||||
/* Use a Segmented Panel for the multiple parts of data */
|
/* Use a Segmented Panel for the multiple parts of data */
|
||||||
SegmentedPanel segmentedPanel = new SegmentedPanel();
|
SegmentedPanel segmentedPanel = new SegmentedPanel();
|
||||||
|
|
||||||
/* The different parts of information are displayed in seperated
|
/* The different parts of information are displayed in seperated
|
||||||
* segments each containing a SimpleEditStep */
|
* segments each containing a SimpleEditStep */
|
||||||
/* Well, not so simple anymore... */
|
/* Well, not so simple anymore... */
|
||||||
/* A new SimpleEditStep */
|
|
||||||
|
/* A new SimpleEditStep for basic properties */
|
||||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
|
SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
|
||||||
parent,
|
parent,
|
||||||
EDIT_BASIC_SHEET_NAME);
|
EDIT_BASIC_SHEET_NAME);
|
||||||
|
|
||||||
/* Create the edit component for this SimpleEditStep and the corresponding link */
|
/* Create the edit component for this SimpleEditStep and the
|
||||||
BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel, this);
|
* corresponding link */
|
||||||
|
BasicPageForm editBasicSheet = new GenericContactPropertyForm(itemModel,
|
||||||
|
this);
|
||||||
basicProperties.add(
|
basicProperties.add(
|
||||||
EDIT_BASIC_SHEET_NAME,
|
EDIT_BASIC_SHEET_NAME,
|
||||||
ContenttypesGlobalizationUtil.globalize(
|
ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.contact.edit_basic_properties"),
|
"cms.contenttypes.ui.genericcontact.edit_basic_properties"),
|
||||||
new WorkflowLockedComponentAccess(
|
new WorkflowLockedComponentAccess(
|
||||||
editBasicSheet,
|
editBasicSheet,
|
||||||
itemModel),
|
itemModel),
|
||||||
|
|
@ -80,41 +120,49 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
||||||
/* Set the displayComponent for this step */
|
/* Set the displayComponent for this step */
|
||||||
basicProperties.setDisplayComponent(getContactPropertySheet(itemModel));
|
basicProperties.setDisplayComponent(getContactPropertySheet(itemModel));
|
||||||
|
|
||||||
/* Add the SimpleEditStep to the segmented panel */
|
/* Add the basic properties SimpleEditStep to the segmented panel with
|
||||||
segmentedPanel
|
* provided title */
|
||||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
segmentedPanel.addSegment(new
|
||||||
.globalize("cms.contenttypes.ui.contact.basic_properties")),
|
Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
basicProperties);
|
"cms.contenttypes.ui.genericcontact.basic_properties")),
|
||||||
|
basicProperties);
|
||||||
|
|
||||||
|
|
||||||
// If not disabled via registry, add the ui for attaching a person
|
// If not disabled via registry, add the ui for attaching a person
|
||||||
if (!GenericContact.getConfig().getHidePerson()) {
|
if (!GenericContact.getConfig().getHidePerson()) {
|
||||||
|
|
||||||
GenericContactPersonPropertiesStep personProperties = new
|
GenericContactPersonPropertiesStep personProperties = new
|
||||||
GenericContactPersonPropertiesStep(itemModel, parent);
|
GenericContactPersonPropertiesStep(itemModel, parent);
|
||||||
segmentedPanel
|
// Add step to segmented panel with the provided title
|
||||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
segmentedPanel.addSegment(new
|
||||||
.globalize("cms.contenttypes.ui.contact.person")),
|
Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
personProperties);
|
"cms.contenttypes.ui.genericcontact.person")),
|
||||||
|
personProperties);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// If not disabled via registry, add the ui for attaching an address
|
||||||
if (!GenericContact.getConfig().getHideAddress()) {
|
if (!GenericContact.getConfig().getHideAddress()) {
|
||||||
|
|
||||||
GenericContactAddressPropertiesStep addressProperties = new
|
GenericContactAddressPropertiesStep addressProperties = new
|
||||||
GenericContactAddressPropertiesStep(itemModel, parent);
|
GenericContactAddressPropertiesStep(itemModel, parent);
|
||||||
segmentedPanel
|
// Add step to segmented panel with the provided title
|
||||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
segmentedPanel.addSegment(new
|
||||||
.globalize("cms.contenttypes.ui.contact.address")),
|
Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
addressProperties);
|
"cms.contenttypes.ui.genericcontact.address")),
|
||||||
|
addressProperties);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add UI for adding several contact entries.
|
||||||
GenericContactEntriesPropertiesStep contactEntries = new
|
GenericContactEntriesPropertiesStep contactEntries = new
|
||||||
GenericContactEntriesPropertiesStep(itemModel, parent);
|
GenericContactEntriesPropertiesStep(itemModel, parent);
|
||||||
segmentedPanel
|
// Add step to segmented panel with the provided title
|
||||||
.addSegment(new Label(ContenttypesGlobalizationUtil
|
segmentedPanel.addSegment(new
|
||||||
.globalize("cms.contenttypes.ui.contact.contactEntry")),
|
Label(ContenttypesGlobalizationUtil.globalize(
|
||||||
contactEntries);
|
"cms.contenttypes.ui.genericcontact.contactEntry")),
|
||||||
|
contactEntries);
|
||||||
|
|
||||||
return segmentedPanel;
|
return segmentedPanel;
|
||||||
}
|
}
|
||||||
|
|
@ -132,12 +180,14 @@ public class GenericContactPropertiesStep extends SimpleEditStep {
|
||||||
/* The DisplayComponent for the Basic Properties */
|
/* The DisplayComponent for the Basic Properties */
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
||||||
|
|
||||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"), "title");
|
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.title"),
|
||||||
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"), "name");
|
"title");
|
||||||
|
sheet.add(GlobalizationUtil.globalize("cms.contenttypes.ui.name"),
|
||||||
|
"name");
|
||||||
|
|
||||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||||
sheet.add(GlobalizationUtil
|
sheet.add(GlobalizationUtil.globalize(
|
||||||
.globalize("cms.contenttypes.ui.launch_date"),
|
"cms.contenttypes.ui.launch_date"),
|
||||||
ContentPage.LAUNCH_DATE,
|
ContentPage.LAUNCH_DATE,
|
||||||
new LaunchDateAttributeFormatter() );
|
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;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
|
|
@ -13,7 +31,12 @@ import com.arsdigita.cms.contenttypes.GenericContact;
|
||||||
import org.apache.log4j.Logger;
|
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
|
public class GenericContactPropertyForm extends BasicPageForm
|
||||||
implements FormProcessListener,
|
implements FormProcessListener,
|
||||||
|
|
@ -29,13 +52,11 @@ public class GenericContactPropertyForm extends BasicPageForm
|
||||||
public static final String ADRESS = GenericContact.ADDRESS;
|
public static final String ADRESS = GenericContact.ADDRESS;
|
||||||
public static final String CONTACT_ENTRIES= GenericContact.CONTACT_ENTRIES;
|
public static final String CONTACT_ENTRIES= GenericContact.CONTACT_ENTRIES;
|
||||||
|
|
||||||
/**
|
/** ID of the form */
|
||||||
* ID of the form
|
|
||||||
*/
|
|
||||||
public static final String ID = "Contact_edit";
|
public static final String ID = "Contact_edit";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constrctor taking an ItemSelectionModel
|
* Constructor taking an ItemSelectionModel.
|
||||||
*
|
*
|
||||||
* @param itemModel
|
* @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
|
* @param child The <tt>Component</tt> parameter in this constructor is
|
||||||
* {@link Label} or {@link Image}.</p>
|
* 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 vast majority of CCM UI code expects to link through
|
||||||
* the path to the CCM dispatcher. Code using this constructor should not
|
* the dispatcher. Code that does not should use the
|
||||||
* prefix <code>url</code> with the webapp context path or the dispatcher
|
* <code>Link</code> constructor taking a <code>URL</code>.
|
||||||
* servlet path.</p>
|
* @see #Link(String,URL)
|
||||||
*
|
|
||||||
* <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)
|
|
||||||
*/
|
*/
|
||||||
public Link(Component child, String url) {
|
public Link(Component child, String url) {
|
||||||
super(child, url);
|
super(child, url);
|
||||||
|
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -120,6 +117,8 @@ public class Link extends BaseLink {
|
||||||
* separate call to the <tt>addPrintListener</tt> method. PrintListeners
|
* separate call to the <tt>addPrintListener</tt> method. PrintListeners
|
||||||
* are a convenient way to alter underlying Link attributes such as Link
|
* 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.
|
* 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) {
|
public Link(String label, PrintListener l) {
|
||||||
super(label,l);
|
super(label,l);
|
||||||
|
|
@ -129,13 +128,11 @@ public class Link extends BaseLink {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructors with <tt>PrintListener</tt> parameters
|
* Constructors with <tt>PrintListener</tt> parameters allow for a
|
||||||
* allow for a {@link PrintListener} to be set for
|
* {@link PrintListener} to be set for the Link, without the need to make a
|
||||||
* the Link, without the need to make a separate call to
|
* separate call to the <tt>addPrintListener</tt> method. PrintListeners
|
||||||
* the <tt>addPrintListener</tt> method. PrintListeners
|
* are a convenient way to alter underlying Link attributes such as Link
|
||||||
* are a convenient way to alter underlying Link attributes
|
* text or target URL within a locked page on a per request basis.
|
||||||
* such as Link text or target URL within a locked page
|
|
||||||
* on a per request basis.
|
|
||||||
*/
|
*/
|
||||||
public Link(PrintListener l) {
|
public Link(PrintListener l) {
|
||||||
super(l);
|
super(l);
|
||||||
|
|
@ -159,6 +156,8 @@ public class Link extends BaseLink {
|
||||||
* <code>Link</code> constructor taking a <code>URL</code>.</p>
|
* <code>Link</code> constructor taking a <code>URL</code>.</p>
|
||||||
*
|
*
|
||||||
* @see #Link(String,URL)
|
* @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) {
|
public Link(String label, String url) {
|
||||||
super(label, url);
|
super(label, url);
|
||||||
|
|
@ -219,6 +218,11 @@ public class Link extends BaseLink {
|
||||||
// setVar(name, value);
|
// setVar(name, value);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* may be this method should be deprecated as well as addURLVars?
|
||||||
|
*/
|
||||||
public String getURLVarString() {
|
public String getURLVarString() {
|
||||||
return m_params.toString();
|
return m_params.toString();
|
||||||
}
|
}
|
||||||
|
|
@ -241,6 +245,11 @@ public class Link extends BaseLink {
|
||||||
setAttribute(FRAME_TARGET_ATTR, frameName);
|
setAttribute(FRAME_TARGET_ATTR, frameName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
protected void generateURL(PageState state, Element parent) {
|
protected void generateURL(PageState state, Element parent) {
|
||||||
parent.addAttribute("href", prepareURL(state, getTarget()));
|
parent.addAttribute("href", prepareURL(state, getTarget()));
|
||||||
|
|
||||||
|
|
@ -255,6 +264,7 @@ public class Link extends BaseLink {
|
||||||
* @return the URL appended with ACS-specific URL parameters.
|
* @return the URL appended with ACS-specific URL parameters.
|
||||||
*/
|
*/
|
||||||
protected String prepareURL(final PageState state, String location) {
|
protected String prepareURL(final PageState state, String location) {
|
||||||
|
|
||||||
final HttpServletRequest req = state.getRequest();
|
final HttpServletRequest req = state.getRequest();
|
||||||
final HttpServletResponse resp = state.getResponse();
|
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,
|
* The renderer used for ordinary cells in this column. Null by default,
|
||||||
* which instructs the <code>Table</code> to use its default
|
* which instructs the <code>Table</code> to use its default renderer.
|
||||||
* renderer.
|
|
||||||
*/
|
*/
|
||||||
private TableCellRenderer m_cellRenderer;
|
private TableCellRenderer m_cellRenderer;
|
||||||
|
|
||||||
|
|
@ -104,7 +103,11 @@ public class TableColumn extends SimpleComponent
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The display value for identifying the header. Will be passed to the
|
* The display value for identifying the header. Will be passed to the
|
||||||
* header cell renderer.
|
* 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;
|
private Object m_headerValue;
|
||||||
|
|
||||||
|
|
@ -138,8 +141,8 @@ public class TableColumn extends SimpleComponent
|
||||||
* header value. The header key is equal to <code>null</code>.
|
* header value. The header key is equal to <code>null</code>.
|
||||||
*
|
*
|
||||||
* @param modelIndex the index of the column in the table model from
|
* @param modelIndex the index of the column in the table model from
|
||||||
* which to retrieve values.
|
* which to retrieve values.
|
||||||
* @param value the value for the column header.
|
* @param value the value for the column header.
|
||||||
* @pre modelIndex >= 0
|
* @pre modelIndex >= 0
|
||||||
*/
|
*/
|
||||||
public TableColumn(int modelIndex, Object value) {
|
public TableColumn(int modelIndex, Object value) {
|
||||||
|
|
@ -151,9 +154,9 @@ public class TableColumn extends SimpleComponent
|
||||||
* header value and key.
|
* header value and key.
|
||||||
*
|
*
|
||||||
* @param modelIndex the index of the column in the table model from
|
* @param modelIndex the index of the column in the table model from
|
||||||
* which to retrieve values.
|
* which to retrieve values.
|
||||||
* @param value the value for the column header.
|
* @param value the value for the column header.
|
||||||
* @param key the key for the column header.
|
* @param key the key for the column header.
|
||||||
* @pre modelIndex >= 0
|
* @pre modelIndex >= 0
|
||||||
*/
|
*/
|
||||||
public TableColumn(int modelIndex, Object value, Object key) {
|
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
|
* 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.
|
* @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
|
* Set the display value for the header. This object is passed through to
|
||||||
* the header renderer without any modifications.
|
* 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.
|
* @param value the new display value for the header.
|
||||||
* @see #getHeaderValue
|
* @see #getHeaderValue
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,11 @@ public class BaseQueryComponent extends QueryComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param state
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void generateXML(PageState state,
|
public void generateXML(PageState state,
|
||||||
Element parent) {
|
Element parent) {
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@
|
||||||
package com.arsdigita.toolbox.ui;
|
package com.arsdigita.toolbox.ui;
|
||||||
|
|
||||||
|
|
||||||
import com.arsdigita.toolbox.util.GlobalizationUtil ;
|
|
||||||
|
|
||||||
import com.arsdigita.bebop.Page;
|
import com.arsdigita.bebop.Page;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.PaginationModelBuilder;
|
import com.arsdigita.bebop.PaginationModelBuilder;
|
||||||
|
|
@ -63,34 +61,32 @@ import org.apache.log4j.Logger;
|
||||||
* <h4>General</h4>
|
* <h4>General</h4>
|
||||||
*
|
*
|
||||||
* Wraps any {@link DataQuery} in a sortable Bebop {@link Table}.
|
* Wraps any {@link DataQuery} in a sortable Bebop {@link Table}.
|
||||||
|
*
|
||||||
* The {@link DataQuery} is supplied by the {@link DataQueryBuilder} class,
|
* The {@link DataQuery} is supplied by the {@link DataQueryBuilder} class,
|
||||||
* which the user must implement. The <code>DataQueryBuilder</code> may
|
* which the user must implement. The <code>DataQueryBuilder</code> may
|
||||||
* dynamically construct the query during each request, or return the
|
* dynamically construct the query during each request, or return the same
|
||||||
* same named query for each request; the <code>DataTable</code> does
|
* named query for each request; the <code>DataTable</code> does not care
|
||||||
* not care where the query comes from.
|
* where the query comes from.
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
* This class may contain multiple {@link QueryListener}s. These
|
* This class may contain multiple {@link QueryListener}s. These listeners will
|
||||||
* listeners will be fired whenever the query is about to
|
* be fired whenever the query is about to be performed, thus giving the user
|
||||||
* be performed, thus giving the user a chance to set
|
* a chance to set additional filters on the query.
|
||||||
* additional filters on the query.
|
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
* Columns may be added to the <code>DataTable</code> by calling the
|
* Columns may be added to the <code>DataTable</code> by calling the
|
||||||
* {@link #addColumn} method. The user may choose to make the column
|
* {@link #addColumn} method. The user may choose to make the column sortable
|
||||||
* sortable or non-sortable; sortable columns will appear as links
|
* or non-sortable; sortable columns will appear as links on the Web page which,
|
||||||
* on the Web page which, when clicked, will sort the table by the
|
* when clicked, will sort the table by the specified column. See the
|
||||||
* specified column. See the documentation on the various
|
* documentation on the various <code>addColumn</code> methods for more
|
||||||
* <code>addColumn</code> methods for more information.
|
* information.
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
* Note that any {@link com.arsdigita.domain.DomainCollection}
|
* Note that any {@link com.arsdigita.domain.DomainCollection} can be used with
|
||||||
* can be used with <code>DataTable</code>, since the
|
* <code>DataTable</code>, since the <code>DomainCollection</code> is merely
|
||||||
* <code>DomainCollection</code> is merely a wrapper for a {@link
|
* a wrapper for a {@link com.arsdigita.persistence.DataCollection}, which
|
||||||
* com.arsdigita.persistence.DataCollection}, which extends
|
* extends <code>DataQuery</code>. The {@link com.arsdigita.domain.DomainService}
|
||||||
* <code>DataQuery</code>. The {@link
|
* class may be used to retieve the <code>DataCollection</code> for any given
|
||||||
* com.arsdigita.domain.DomainService} class may be used to retieve
|
|
||||||
* the <code>DataCollection</code> for any given
|
|
||||||
* <code>DomainCollection</code>. <p>
|
* <code>DomainCollection</code>. <p>
|
||||||
*
|
*
|
||||||
* This class sets the XSL "class" attribute to "dataTable"
|
* This class sets the XSL "class" attribute to "dataTable"
|
||||||
|
|
@ -98,35 +94,34 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* <h4>Pagination</h4>
|
* <h4>Pagination</h4>
|
||||||
*
|
*
|
||||||
* <code>DataTable</code> also
|
* <code>DataTable</code> also implements {@link PaginationModelBuilder}.
|
||||||
* implements {@link PaginationModelBuilder}. This means that
|
* This means that it could serve as the model builder for any {@link Paginator}
|
||||||
* it could serve as the model builder for any {@link Paginator}
|
* component. Pagination of the query occurs after all the sorting and query
|
||||||
* component. Pagination of the query occurs after all the sorting
|
* events have finished. Consider a query which returns the rows "A B C D E F".
|
||||||
* and query events have finished. Consider a query which returns
|
* If the paginator displays 3 rows per page, page 1 will contain "A B C" and
|
||||||
* the rows "A B C D E F". If the paginator displays 3 rows per page,
|
* page 2 will contain "D E F".
|
||||||
* 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
|
||||||
* If the user then clicks on the header in the <code>DataTable</code>,
|
* the query to be sorted in reverse order, page 1 will contain "F E D" and
|
||||||
* causing the query to be sorted in reverse order, page 1 will
|
* page 2 will contain "C B A". In order for pagination to work properly, the
|
||||||
* contain "F E D" and page 2 will contain "C B A". In order for
|
* following pattern must be used:
|
||||||
* 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, ...);
|
* 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
|
* The <code>setPaginator</code> call is required due to a design flaw in the
|
||||||
* design flaw in the <code>Paginator</code> component.
|
* <code>Paginator</code> component.
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
* <h4>Globalization</h4>
|
* <h4>Globalization</h4>
|
||||||
*
|
*
|
||||||
* The <code>DataTable</code> will ordinarily interpret the labels
|
* The <code>DataTable</code> will ordinarily interpret the labels of its
|
||||||
* of its column headers as plain text, and spit them out on
|
* column headers as plain text, and spit them out on the screen verbatim.
|
||||||
* the screen verbatim. However, if <code>setResouceBundle</code>
|
* However, if <code>setResouceBundle</code> is called, <code>DataTable</code>
|
||||||
* is called, <code>DataTable</code> will instead interpret the
|
* will instead interpret the column header labels as keys into the specified
|
||||||
* column header labels as keys into the specified resource bundle,
|
* resource bundle, thus attempting to globalize the column headers at runtime.
|
||||||
* thus attempting to globalize the column headers at runtime.
|
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
* @author Stanislav Freidin
|
* @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
|
* used to globalize the column labels. If null, column labels will
|
||||||
* be printed verbatim to the screen.
|
* be printed verbatim to the screen.
|
||||||
*/
|
*/
|
||||||
public DataTable (
|
public DataTable (DataQueryBuilder builder,
|
||||||
DataQueryBuilder builder, SingleSelectionModel orderModel
|
SingleSelectionModel orderModel ) {
|
||||||
) {
|
|
||||||
this(builder, orderModel, null);
|
this(builder, orderModel, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -217,6 +211,7 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
||||||
/**
|
/**
|
||||||
* Register the ordering parameter
|
* Register the ordering parameter
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void register(Page p) {
|
public void register(Page p) {
|
||||||
super.register(p);
|
super.register(p);
|
||||||
p.addComponentStateParam(this,
|
p.addComponentStateParam(this,
|
||||||
|
|
@ -252,16 +247,20 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
||||||
/**
|
/**
|
||||||
* Add a column to this table.
|
* 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>
|
* @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
|
* @param isSortable true if it is possible to sort using this column, false
|
||||||
* otherwise
|
* otherwise
|
||||||
* @param renderer a {@link TableCellRenderer} that will be used to
|
* @param renderer a {@link TableCellRenderer} that will be used to
|
||||||
* format the attribute as a string.
|
* format the attribute as a string.
|
||||||
* @return the newly added column
|
* @return the newly added column
|
||||||
*/
|
*/
|
||||||
public TableColumn addColumn(String label, String attribute,
|
public TableColumn addColumn(String label,
|
||||||
|
String attribute,
|
||||||
boolean isSortable,
|
boolean isSortable,
|
||||||
TableCellRenderer renderer) {
|
TableCellRenderer renderer) {
|
||||||
return addColumn(label, attribute, isSortable, renderer, null);
|
return addColumn(label, attribute, isSortable, renderer, null);
|
||||||
|
|
@ -272,6 +271,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
||||||
* Add a column to this table.
|
* 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>
|
* @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
|
* @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
|
* @return the newly added column
|
||||||
*/
|
*/
|
||||||
public TableColumn addColumn(String label, String attribute,
|
public TableColumn addColumn(String label, String attribute,
|
||||||
boolean isSortable, TableCellRenderer renderer, String orderAttribute) {
|
boolean isSortable, TableCellRenderer renderer,
|
||||||
|
String orderAttribute) {
|
||||||
DataTableColumnModel model = (DataTableColumnModel)getColumnModel();
|
DataTableColumnModel model = (DataTableColumnModel)getColumnModel();
|
||||||
TableColumn column = new SortableTableColumn (
|
TableColumn column = new SortableTableColumn(model.size(),
|
||||||
model.size(), label, attribute, isSortable, renderer
|
label,
|
||||||
|
attribute,
|
||||||
|
isSortable,
|
||||||
|
renderer
|
||||||
);
|
);
|
||||||
|
|
||||||
model.add(column, orderAttribute);
|
model.add(column, orderAttribute);
|
||||||
|
|
@ -305,6 +311,9 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
||||||
* Add a column to this table.
|
* 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>
|
* @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
|
* @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.
|
* 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>
|
* @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.
|
||||||
* @return the newly added 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.
|
* will be used to add {@link ControlLink}s to the 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 renderer The cell renderer for the given column
|
* @param renderer The cell renderer for the given column
|
||||||
* @return the newly added 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() {
|
public DataQueryBuilder getDataQueryBuilder() {
|
||||||
return m_builder;
|
return m_builder;
|
||||||
|
|
@ -367,8 +383,8 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the {@link SingleSelectionModel} that will determine the order
|
* Set the {@link SingleSelectionModel} that will determine the order for
|
||||||
* for the items in the tabke
|
* the items in the table.
|
||||||
*
|
*
|
||||||
* @param orderModel The new model
|
* @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
|
* Add a {@link QueryListener} to this table. The listener will be fired
|
||||||
* will be fired whenever the query is about to be performed.
|
* whenever the query is about to be performed.
|
||||||
*
|
*
|
||||||
* @param l the new query listener
|
* @param l the new query listener
|
||||||
*/
|
*/
|
||||||
|
|
@ -539,12 +555,14 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
||||||
/**
|
/**
|
||||||
* Lock this table
|
* Lock this table
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void lock() {
|
public void lock() {
|
||||||
m_builder.lock();
|
m_builder.lock();
|
||||||
super.lock();
|
super.lock();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Export the current order
|
// Export the current order
|
||||||
|
@Override
|
||||||
public void generateExtraXMLAttributes(PageState s, Element element) {
|
public void generateExtraXMLAttributes(PageState s, Element element) {
|
||||||
String key = getOrder(s);
|
String key = getOrder(s);
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
|
|
@ -898,6 +916,7 @@ public class DataTable extends Table implements PaginationModelBuilder {
|
||||||
setColumnKey(get(columnIndex), columnKey);
|
setColumnKey(get(columnIndex), columnKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void remove(TableColumn column) {
|
public void remove(TableColumn column) {
|
||||||
super.remove(column);
|
super.remove(column);
|
||||||
m_columnKeys.remove(column);
|
m_columnKeys.remove(column);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue