From 9601efd7dca4cb22a263f8e33ffee7d474e7582e Mon Sep 17 00:00:00 2001 From: jensp Date: Tue, 16 Jul 2013 17:55:16 +0000 Subject: [PATCH] =?UTF-8?q?-=20Die=20Liste=20der=20Publikationen=20einer?= =?UTF-8?q?=20Person=20im=20Content-Center=20(AuthoringStep=20Publikatione?= =?UTF-8?q?n=20bei=20Personen)=20zeigt=20jetzt=20auch=20=20=20Publikatione?= =?UTF-8?q?n=20eines=20eventuell=20vorhandenen=20Aliases=20(Fr=C3=BChrer?= =?UTF-8?q?=20Name)=20an=20-=20F=C3=BCr=20die=20Assoziation=20zwischen=20G?= =?UTF-8?q?enericOrganizationalUnit=20und=20Kontakt=20wurde=20bisher=20die?= =?UTF-8?q?=20gleichen=20Werte=20f=C3=BCr=20den=20Kontakttyp=20verwendet?= =?UTF-8?q?=20=20=20wie=20f=C3=BCr=20die=20Assoization=20zwischen=20Generi?= =?UTF-8?q?cPerson=20und=20Kontakt.=20Jetzt=20werden=20unterschiedliche=20?= =?UTF-8?q?Werte=20f=C3=BCr=20den=20Kontakttyp=20bei=20den=20beiden=20=20?= =?UTF-8?q?=20Assoziatonen=20verwendet.=20-=20Verschiedene=20Formatierunge?= =?UTF-8?q?n=20usw.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@2254 8810af33-2d31-482b-a856-94f89814c4df --- .../6.6.1-6.6.2/cms_item_image_attachment.sql | 2 +- .../arsdigita/cms/CMSResources_de.properties | 1 - .../ContenttypesResources.properties | 12 +- .../ContenttypesResources_de.properties | 12 +- ...ericOrganizationContactTypeCollection.java | 45 +++++++ .../ui/GenericContactEntriesTable.java | 96 +++++++-------- .../ui/GenericContactPersonSheet.java | 72 ++++++----- ...nericOrganizationalUnitContactAddForm.java | 5 +- ...GenericOrganizationalUnitContactTable.java | 6 +- ...GenericOrganizationalUnitPersonsTable.java | 6 +- .../arsdigita/bebop/page/PageTransformer.java | 78 +++++++++--- .../dispatcher/DispatcherHelper.java | 115 +++++++++--------- .../upgrade/postgres-6.6.1-6.6.2.sql | 2 +- .../bundles/base/res/bundle/ddenums.xml | 16 ++- .../bundles/demo/res/bundle/ddenums.xml | 16 ++- .../bundles/devel/res/bundle/ddenums.xml | 16 ++- .../bundles/standard/res/bundle/ddenums.xml | 16 ++- .../ui/PersonPublicationsStep.java | 75 +++++++++++- .../ui/PersonPublicationsTable.java | 61 ++++++++-- .../ui/PublicationResources.properties | 2 + .../ui/PublicationResources_de.properties | 2 + .../ui/SciInstituteMembersTab.java | 45 ++++--- 22 files changed, 480 insertions(+), 221 deletions(-) create mode 100644 ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationContactTypeCollection.java diff --git a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/default/upgrade/6.6.1-6.6.2/cms_item_image_attachment.sql b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/default/upgrade/6.6.1-6.6.2/cms_item_image_attachment.sql index 605c80399..745e56e09 100644 --- a/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/default/upgrade/6.6.1-6.6.2/cms_item_image_attachment.sql +++ b/ccm-cms-assets-imagestep/sql/ccm-cms-assets-imagestep/default/upgrade/6.6.1-6.6.2/cms_item_image_attachment.sql @@ -18,4 +18,4 @@ -- $Id: upd_acs_objects.sql $ -alter table cms_item_image_attachement add column sort_key integer set default 1; \ No newline at end of file +alter table cms_item_image_attachment add column sort_key integer; \ No newline at end of file diff --git a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties index a7fa9ea32..0403daa2a 100755 --- a/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties @@ -1015,7 +1015,6 @@ cms.contenttyes.link.ui.table_cell_delete_link=entfernen cms.contenttyes.link.ui.table_cell_move_up=nach oben cms.contenttyes.link.ui.table_cell_move_down=nach unten cms.contenttyes.link.ui.link_type_subtitle=Bitte entweder einen externen Link oder ein Dokument (interner Link) w\u00e4hlen -itte entweder einen externen Link oder ein Dokument (interner Link) w\u00e4hlen cms.contenttyes.link.ui.option_group.link_type.external=URL cms.contenttyes.link.ui.option_group.link_type.internal=Dokument cms.contenttyes.link.ui.option.new_window=URL in einem neuen Fenster \u00f6ffnen diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties index a1ce1adc5..a871c8912 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources.properties @@ -39,10 +39,10 @@ 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 BaseAddres type entry +cms.contenttypes.ui.contact.select_address=Please select an address content item 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 +cms.contenttypes.ui.contact.select_address.wrong_type=Address selection is required cms.contenttypes.ui.contact.select_address.cancelled=cancelled cms.contenttypes.ui.contact.delete_address.label=Do you want to delete the link to the contact content type? cms.contenttypes.ui.contact.delete_address.button_label=Delete @@ -52,7 +52,7 @@ cms.contenttypes.ui.contact.edit_person=Edit Person cms.contenttypes.ui.contact.reattach_person=Reattach Person 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=Please select person content item cms.contenttypes.ui.contact.select_person.add=Add cms.contenttypes.ui.contact.select_person.change=Change cms.contenttypes.ui.contact.select_person.wrong_type=Person selection is required @@ -164,3 +164,9 @@ cms.contenttypes.ui.genericperson.alias.select.wrong_type=No person selected. cms.contenttypes.ui.person_specification=Person Specification: cms.contenttypes.ui.genericperson.alias.select.add_contact=Add contact cms.contenttypes.ui.genericperson.alias.select.change_contact=Change contact +cms.contenttypes.ui.contact.contactEntry.key=Entry +cms.contenttypes.ui.contact.contactEntry.value=Value +cms.contenttypes.ui.contact.contactEntry.description=Descriptions +cms.ui.select_one=Please choose +cms.contenttypes.ui.genericorgaunit.persons.status=Status +cms.ui.edit_assoc=Edit diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties index 39a661224..4eae77ef9 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ContenttypesResources_de.properties @@ -39,10 +39,10 @@ cms.contenttypes.ui.contact.edit_address=Adresse bearbeiten cms.contenttypes.ui.contact.reattach_address=Adresse neu verkn\u00fcpfen cms.contenttypes.ui.contact.delete_address=Adresse l\u00f6schen cms.contenttypes.ui.contact.emptyAddress=Zur Zeit ist keine Adresse verkn\u00fcpft -cms.contenttypes.ui.contact.select_address=Bitte w\u00e4hlen Sie eine Eintrag vom Typ BaseAddress +cms.contenttypes.ui.contact.select_address=Bitte w\u00e4hlen Sie eine Content-Item vom Typ Addresse aus cms.contenttypes.ui.contact.select_address.add=Verkn\u00fcpfen cms.contenttypes.ui.contact.select_address.change=Ver\u00e4ndern -cms.contenttypes.ui.contact.select_address.wrong_type=Der gew\u00e4hlte Eintrag ist nicht vom Typ BaseAddress +cms.contenttypes.ui.contact.select_address.wrong_type=Der gew\u00e4hlte Eintrag ist nicht vom Typ Addresse cms.contenttypes.ui.contact.select_address.cancelled=Abbruch cms.contenttypes.ui.contact.delete_address.label=Wollen Sie die Verkn\u00fcpfung zur Adresse entfernen? cms.contenttypes.ui.contact.delete_address.button_label=L\u00f6schen @@ -52,7 +52,7 @@ cms.contenttypes.ui.contact.edit_person=Person bearbeiten cms.contenttypes.ui.contact.reattach_person=Person neu verkn\u00fcpfen 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=Bitte w\u00e4hlen Sie einen Content-Item vom Typ Person cms.contenttypes.ui.contact.select_person.add=Verkn\u00fcpfen cms.contenttypes.ui.contact.select_person.change=Ver\u00e4ndern cms.contenttypes.ui.contact.select_person.wrong_type=Der gew\u00e4hlte Eintrag ist nicht vom Typ Person @@ -174,3 +174,9 @@ cms.contenttypes.ui.genericperson.alias.select.wrong_type=Kein Personendatensatz cms.contenttypes.ui.person_specification=Person Specification: cms.contenttypes.ui.genericperson.alias.select.add_contact=Kontakt hinzuf\u00fcgen cms.contenttypes.ui.genericperson.alias.select.change_contact=Kontakt anpassen +cms.contenttypes.ui.contact.contactEntry.key=Eintrag +cms.contenttypes.ui.contact.contactEntry.value=Wert +cms.contenttypes.ui.contact.contactEntry.description=Beschreibung +cms.ui.select_one=Bitte ausw\u00e4hlen +cms.contenttypes.ui.genericorgaunit.persons.status=Status +cms.ui.edit_assoc=Bearbeiten diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationContactTypeCollection.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationContactTypeCollection.java new file mode 100644 index 000000000..ca1276b37 --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationContactTypeCollection.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010 Jens Pelzetter + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * +*/ +package com.arsdigita.cms.contenttypes; + +import com.arsdigita.cms.RelationAttributeCollection; +import com.arsdigita.persistence.DataCollection; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class GenericOrganizationContactTypeCollection extends RelationAttributeCollection { + + public static final String ATTRIBUTE_NAME = "GenericOrganizationContactTypes"; + + public GenericOrganizationContactTypeCollection() { + super(ATTRIBUTE_NAME); + } + + public GenericOrganizationContactTypeCollection(final String key) { + super(ATTRIBUTE_NAME, key); + } + + public GenericOrganizationContactTypeCollection(final DataCollection dataCollection) { + super(dataCollection); + } + +} diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java index 57d038fe1..10a342c9a 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactEntriesTable.java @@ -64,33 +64,25 @@ public class GenericContactEntriesTable extends Table implements TableActionList // if table is empty: setEmptyView(new Label(ContenttypesGlobalizationUtil - .globalize("cms.contenttypes.ui.contact.contactEntry.none"))); + .globalize("cms.contenttypes.ui.contact.contactEntry.none"))); TableColumnModel tab_model = getColumnModel(); // define columns tab_model.add(new TableColumn( - 0, - ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.contactEntry.key") - , - TABLE_COL_EDIT)); + 0, + new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.key")), + TABLE_COL_EDIT)); tab_model.add(new TableColumn( - 1, - ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.contactEntry.value") - - )); + 1, + new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.value")))); tab_model.add(new TableColumn( - 2, - ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.contactEntry.description") - )); + 2, + new Label(ContenttypesGlobalizationUtil. + globalize("cms.contenttypes.ui.contact.contactEntry.description")))); tab_model.add(new TableColumn( - 3, - ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.contact.contactEntry.action") - , - TABLE_COL_DEL)); + 3, + new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.contactEntry.action")), + TABLE_COL_DEL)); setModelBuilder(new ContactTableModelBuilder(itemModel)); @@ -105,8 +97,8 @@ public class GenericContactEntriesTable extends Table implements TableActionList * XXXX * */ - private class ContactTableModelBuilder extends LockableImpl - implements TableModelBuilder { + private class ContactTableModelBuilder extends LockableImpl + implements TableModelBuilder { private ItemSelectionModel m_itemModel; @@ -118,10 +110,10 @@ public class GenericContactEntriesTable extends Table implements TableActionList table.getRowSelectionModel().clearSelection(state); - GenericContact contact = (GenericContact) - m_itemModel.getSelectedObject(state); + GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); return new ContactTableModel(table, state, contact); } + } /** @@ -170,14 +162,13 @@ public class GenericContactEntriesTable extends Table implements TableActionList public Object getElementAt(int columnIndex) { switch (columnIndex) { case 0: - GenericContactEntryKeys keys = new - GenericContactEntryKeys(m_contactEntry.getKey()); + GenericContactEntryKeys keys = new GenericContactEntryKeys(m_contactEntry.getKey()); keys.addLanguageFilter( - GlobalizationHelper.getNegotiatedLocale() - .getLanguage()); + GlobalizationHelper.getNegotiatedLocale() + .getLanguage()); if (keys.next()) { - Object key = keys.getName(); - + Object key = keys.getName(); + // Close Collection to prevent open ResultSet keys.close(); @@ -187,14 +178,13 @@ public class GenericContactEntriesTable extends Table implements TableActionList case 1: return m_contactEntry.getValue(); case 2: - return (m_contactEntry.getDescription() != null - && m_contactEntry.getDescription().length() > - MAX_DESC_LENGTH) - ? m_contactEntry.getDescription().substring( - 0, MAX_DESC_LENGTH) - : m_contactEntry.getDescription(); + return (m_contactEntry.getDescription() != null + && m_contactEntry.getDescription().length() > MAX_DESC_LENGTH) + ? m_contactEntry.getDescription().substring( + 0, MAX_DESC_LENGTH) + : m_contactEntry.getDescription(); case 3: - return GlobalizationUtil.globalize("cms.ui.delete"); + return GlobalizationUtil.globalize("cms.ui.delete").localize(); default: return null; } @@ -207,6 +197,7 @@ public class GenericContactEntriesTable extends Table implements TableActionList public Object getKeyAt(int columnIndex) { return m_contactEntry.getID(); } + } /** @@ -216,15 +207,15 @@ public class GenericContactEntriesTable extends Table implements TableActionList private class EditCellRenderer extends LockableImpl implements TableCellRenderer { public Component getComponent(Table table, PageState state, Object value, - boolean isSelected, Object key, - int row, int column) { + boolean isSelected, Object key, + int row, int column) { SecurityManager sm = Utilities.getSecurityManager(state); GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); boolean canEdit = sm.canAccess(state.getRequest(), - SecurityManager.EDIT_ITEM, - contact); + SecurityManager.EDIT_ITEM, + contact); if (canEdit) { ControlLink link = new ControlLink(value.toString()); return link; @@ -232,36 +223,36 @@ public class GenericContactEntriesTable extends Table implements TableActionList return new Label(value.toString()); } } + } /** * Check for the permissions to delete item and put either a Label or * a ControlLink accordingly. */ - private class DeleteCellRenderer extends LockableImpl - implements TableCellRenderer { + private class DeleteCellRenderer extends LockableImpl + implements TableCellRenderer { public Component getComponent(Table table, PageState state, Object value, - boolean isSelected, Object key, - int row, int column) { + boolean isSelected, Object key, + int row, int column) { SecurityManager sm = Utilities.getSecurityManager(state); - GenericContact contact = (GenericContact) - m_itemModel.getSelectedObject(state); + GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); boolean canDelete = sm.canAccess(state.getRequest(), - SecurityManager.DELETE_ITEM, - contact); + SecurityManager.DELETE_ITEM, + contact); if (canDelete) { ControlLink link = new ControlLink(value.toString()); link.setConfirmation( - ContenttypesGlobalizationUtil - .globalize("cms.contenttypes.ui.contact.confirm_delete")); + ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.confirm_delete")); return link; } else { return new Label(value.toString()); } } + } /** @@ -275,7 +266,7 @@ public class GenericContactEntriesTable extends Table implements TableActionList // Get selected GenericContactEntry GenericContactEntry contactEntry = - new GenericContactEntry(new BigDecimal(evt.getRowKey().toString())); + new GenericContactEntry(new BigDecimal(evt.getRowKey().toString())); // Get GenericContact GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); @@ -301,4 +292,5 @@ public class GenericContactEntriesTable extends Table implements TableActionList public void headSelected(TableActionEvent e) { throw new UnsupportedOperationException("Not Implemented"); } + } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java index d7630283e..eae991cc5 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericContactPersonSheet.java @@ -72,16 +72,14 @@ public class GenericContactPersonSheet TableColumnModel colModel = getColumnModel(); colModel.add(new TableColumn( 0, - ContenttypesGlobalizationUtil.globalize( - // "cms.contenttypes.ui.contact.person").localize(), - "cms.contenttypes.ui.genericcontact.person"), + new Label(ContenttypesGlobalizationUtil.globalize( + // "cms.contenttypes.ui.contact.person").localize(), + "cms.contenttypes.ui.genericcontact.person")), TABLE_COL_EDIT)); colModel.add(new TableColumn( 1, - ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericcontact.delete_person") - // .localize() - , + new Label(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericcontact.delete_person")), TABLE_COL_DEL)); setModelBuilder(new GenericContactPersonSheetModelBuilder(itemModel)); @@ -109,12 +107,12 @@ public class GenericContactPersonSheet @Override public TableModel makeModel(Table table, PageState state) { table.getRowSelectionModel().clearSelection(state); - GenericContact contact = (GenericContact) - m_itemModel.getSelectedObject(state); + GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); return new GenericContactPersonSheetModel(table, - state, - contact); + state, + contact); } + } private class GenericContactPersonSheetModel implements TableModel { @@ -124,8 +122,8 @@ public class GenericContactPersonSheet private boolean m_done; public GenericContactPersonSheetModel(Table table, - PageState state, - GenericContact contact) { + PageState state, + GenericContact contact) { m_table = table; m_person = contact.getPerson(); if (m_person == null) { @@ -158,9 +156,7 @@ public class GenericContactPersonSheet return m_person.getFullName(); case 1: return ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericcontact.delete_person") - // .localize(); - ; + "cms.contenttypes.ui.genericcontact.delete_person").localize(); default: return null; } @@ -169,6 +165,7 @@ public class GenericContactPersonSheet public Object getKeyAt(int columnIndex) { return m_person.getID(); } + } private class EditCellRenderer @@ -177,17 +174,16 @@ public class GenericContactPersonSheet @Override public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { + PageState state, + Object value, + boolean isSelected, + Object key, + int row, + int column) { - com.arsdigita.cms.SecurityManager securityManager = + com.arsdigita.cms.SecurityManager securityManager = CMS.getSecurityManager(state); - GenericContact contact = (GenericContact) - m_itemModel.getSelectedObject(state); + GenericContact contact = (GenericContact) m_itemModel.getSelectedObject(state); boolean canEdit = securityManager.canAccess( state.getRequest(), @@ -206,10 +202,10 @@ public class GenericContactPersonSheet ContentSection section = person.getContentSection();//CMS.getContext().getContentSection(); ItemResolver resolver = section.getItemResolver(); - return new Link(value.toString(), - resolver.generateItemURL(state, - person, - section, + return new Link(value.toString(), + resolver.generateItemURL(state, + person, + section, person.getVersion())); } else { @@ -218,6 +214,7 @@ public class GenericContactPersonSheet } } + } private class DeleteCellRenderer @@ -226,12 +223,12 @@ public class GenericContactPersonSheet @Override public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { + PageState state, + Object value, + boolean isSelected, + Object key, + int row, + int col) { SecurityManager securityManager = CMS.getSecurityManager(state); GenericContact contact = (GenericContact) m_itemModel.getSelectedObject( state); @@ -245,14 +242,14 @@ public class GenericContactPersonSheet ControlLink link = new ControlLink(value.toString()); link.setConfirmation(ContenttypesGlobalizationUtil.globalize( "cms.contenttypes.ui.contact.person" - + ".confirm_remove") - ); + + ".confirm_remove")); return link; } else { Label label = new Label(value.toString()); return label; } } + } @Override @@ -274,4 +271,5 @@ public class GenericContactPersonSheet public void headSelected(TableActionEvent event) { //Nothing to do } + } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java index 19c122398..abef947bb 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java @@ -35,6 +35,7 @@ import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.RelationAttribute; import com.arsdigita.cms.contenttypes.GenericContact; import com.arsdigita.cms.contenttypes.GenericContactTypeCollection; +import com.arsdigita.cms.contenttypes.GenericOrganizationContactTypeCollection; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection; import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; @@ -93,8 +94,8 @@ public class GenericOrganizationalUnitContactAddForm new Label(ContenttypesGlobalizationUtil. globalize("cms.ui.select_one")))); - GenericContactTypeCollection contacttypes = - new GenericContactTypeCollection(); + GenericOrganizationContactTypeCollection contacttypes = + new GenericOrganizationContactTypeCollection(); contacttypes.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale(). getLanguage()); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java index 1398b20ac..d8441e33d 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java @@ -31,12 +31,12 @@ 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; import com.arsdigita.cms.contenttypes.GenericContact; import com.arsdigita.cms.contenttypes.GenericContactTypeCollection; +import com.arsdigita.cms.contenttypes.GenericOrganizationContactTypeCollection; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection; import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; @@ -148,8 +148,8 @@ public class GenericOrganizationalUnitContactTable extends Table implements private Table m_table; private GenericOrganizationalUnitContactCollection m_contactCollection; private GenericContact m_contact; - private GenericContactTypeCollection m_contacttypes = - new GenericContactTypeCollection(); + private GenericOrganizationContactTypeCollection m_contacttypes = + new GenericOrganizationContactTypeCollection(); private GenericOrganizationalUnitTableModel( Table table, diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java index e1319b7a6..1c180a934 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java @@ -86,18 +86,18 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements new TableColumn( 2, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.persons.status").localize())); + "cms.contenttypes.ui.genericorgaunit.persons.status"))); tabModel.add( new TableColumn( 3, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorganunit.persons.edit").localize(), + "cms.contenttypes.ui.genericorganunit.persons.edit"), TABLE_COL_EDIT_LINK)); tabModel.add( new TableColumn( 4, ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.persons.delete").localize(), + "cms.contenttypes.ui.genericorgaunit.persons.delete"), TABLE_COL_DEL)); setModelBuilder( diff --git a/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java b/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java index 0b5b91016..dd390c0c2 100755 --- a/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java +++ b/ccm-core/src/com/arsdigita/bebop/page/PageTransformer.java @@ -16,7 +16,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ - package com.arsdigita.bebop.page; import com.arsdigita.bebop.Bebop; @@ -84,56 +83,55 @@ public class PageTransformer implements PresentationManager { // load the default xsl parameter generators static { s_log.debug("Static initalizer starting..."); - + registerXSLParameterGenerator("contextPath", new XSLParameterGenerator() { - @Override public String generateValue(HttpServletRequest request) { return request.getContextPath(); } + }); registerXSLParameterGenerator("root-context-prefix", new XSLParameterGenerator() { - @Override public String generateValue(HttpServletRequest request) { return Web.getConfig().getDispatcherContextPath(); } + }); registerXSLParameterGenerator("context-prefix", new XSLParameterGenerator() { - @Override public String generateValue(HttpServletRequest request) { return Web.getContext().getRequestURL().getContextPath(); } + }); registerXSLParameterGenerator("internal-theme", new XSLParameterGenerator() { - @Override public String generateValue(HttpServletRequest request) { return Web.getContext().getRequestURL().getContextPath() + com.arsdigita.web.URL.INTERNAL_THEME_DIR; } + }); registerXSLParameterGenerator("dispatcher-prefix", new XSLParameterGenerator() { - @Override public String generateValue(HttpServletRequest request) { return com.arsdigita.web.URL.getDispatcherPath(); } + }); registerXSLParameterGenerator("dcp-on-buttons", new XSLParameterGenerator() { - @Override public String generateValue(HttpServletRequest request) { if (Bebop.getConfig().doubleClickProtectionOnButtons()) { @@ -143,11 +141,11 @@ public class PageTransformer implements PresentationManager { } } + }); registerXSLParameterGenerator("dcp-on-links", new XSLParameterGenerator() { - @Override public String generateValue(HttpServletRequest request) { if (Bebop.getConfig().doubleClickProtectionOnLinks()) { @@ -158,38 +156,84 @@ public class PageTransformer implements PresentationManager { } + }); registerXSLParameterGenerator("user-agent", new XSLParameterGenerator() { - @Override public String generateValue(HttpServletRequest request) { return request.getHeader("User-Agent"); } + }); registerXSLParameterGenerator("negotiated-language", new XSLParameterGenerator() { - @Override public String generateValue(HttpServletRequest request) { return GlobalizationHelper.getNegotiatedLocale().getLanguage(); } + }); registerXSLParameterGenerator("selected-language", new XSLParameterGenerator() { - @Override public String generateValue(HttpServletRequest request) { - Locale selectedLocale = com.arsdigita.globalization.GlobalizationHelper.getSelectedLocale(request); + Locale selectedLocale = com.arsdigita.globalization.GlobalizationHelper.getSelectedLocale(request); return (selectedLocale != null) ? selectedLocale.toString() : ""; } + }); + + registerXSLParameterGenerator("request-scheme", + new XSLParameterGenerator() { + @Override + public String generateValue(HttpServletRequest request) { + return request.getScheme(); + } + + }); + + registerXSLParameterGenerator("server-name", + new XSLParameterGenerator() { + @Override + public String generateValue(HttpServletRequest request) { + return request.getServerName(); + } + + }); + + registerXSLParameterGenerator("server-port", + new XSLParameterGenerator() { + @Override + public String generateValue(HttpServletRequest request) { + return Integer.toString(request.getServerPort()); + } + + }); + + registerXSLParameterGenerator("host", + new XSLParameterGenerator() { + @Override + public String generateValue(HttpServletRequest request) { + if (request.getServerPort() == 80) { + return String.format("%s://%s", request.getScheme(), request.getServerName()); + } else { + return String.format("%s://%s:%d", + request.getScheme(), + request.getServerName(), + request.getServerPort()); + } + } + + }); + s_log.debug("Static initalizer finished."); } // XXX These need to move somewhere else. + /** * This is used to indicate that all xsl templates used should * be pulled from the disk and not from the cache. If this @@ -320,9 +364,8 @@ public class PageTransformer implements PresentationManager { // current request. final XSLTemplate template = Templating.getTemplate( req, - fancyErrors, - !Boolean.TRUE.equals(req.getAttribute(CACHE_XSL_NONE)) - ); + fancyErrors, + !Boolean.TRUE.equals(req.getAttribute(CACHE_XSL_NONE))); DeveloperSupport.endStage("PresMgr get stylesheet"); @@ -349,7 +392,7 @@ public class PageTransformer implements PresentationManager { while (entries.hasNext()) { final Map.Entry entry = (Map.Entry) entries.next(); - + xf.setParameter((String) entry.getKey(), entry.getValue()); } @@ -523,4 +566,5 @@ public class PageTransformer implements PresentationManager { transformer.setParameter((String) entry.getKey(), value); } } + } diff --git a/ccm-core/src/com/arsdigita/dispatcher/DispatcherHelper.java b/ccm-core/src/com/arsdigita/dispatcher/DispatcherHelper.java index 1be716e71..43d17f92a 100755 --- a/ccm-core/src/com/arsdigita/dispatcher/DispatcherHelper.java +++ b/ccm-core/src/com/arsdigita/dispatcher/DispatcherHelper.java @@ -61,7 +61,6 @@ import org.apache.log4j.Logger; public final class DispatcherHelper implements DispatcherConstants { private static final Logger s_log = Logger.getLogger(DispatcherHelper.class); - private static String s_webappCtx; private static String s_staticURL; private static boolean s_cachingActive; @@ -169,7 +168,7 @@ public final class DispatcherHelper implements DispatcherConstants { } public static void setDispatcherPrefix(HttpServletRequest req, - String val) { + String val) { req.setAttribute(DISPATCHER_PREFIX_ATTR, val); } @@ -186,8 +185,8 @@ public final class DispatcherHelper implements DispatcherConstants { } private static void forwardHelper(javax.servlet.RequestDispatcher rd, - HttpServletRequest req, - HttpServletResponse resp) + HttpServletRequest req, + HttpServletResponse resp) throws ServletException, IOException { Object attr = req.getAttribute(INCLUDE_URI); @@ -232,9 +231,9 @@ public final class DispatcherHelper implements DispatcherConstants { * propagated from target resource */ public static void forwardRequestByPath(String path, - HttpServletRequest req, - HttpServletResponse resp, - ServletContext sctx) + HttpServletRequest req, + HttpServletResponse resp, + ServletContext sctx) throws IOException, ServletException { RequestDispatcher rd = sctx.getRequestDispatcher(path); forwardHelper(rd, req, resp); @@ -245,11 +244,11 @@ public final class DispatcherHelper implements DispatcherConstants { * DispatcherHelper.getRequestContext(req).getServletContext()). */ public static void forwardRequestByPath(String path, - HttpServletRequest req, - HttpServletResponse resp) + HttpServletRequest req, + HttpServletResponse resp) throws IOException, ServletException { ServletContext sctx = - DispatcherHelper.getRequestContext(req).getServletContext(); + DispatcherHelper.getRequestContext(req).getServletContext(); forwardRequestByPath(path, req, resp, sctx); } @@ -272,7 +271,7 @@ public final class DispatcherHelper implements DispatcherConstants { * propagated from target resource */ public static void forwardRequestByPath(String path, - PageContext pageContext) + PageContext pageContext) throws IOException, ServletException { ServletRequest req = pageContext.getRequest(); @@ -306,9 +305,9 @@ public final class DispatcherHelper implements DispatcherConstants { * propagated from target resource */ public static void forwardRequestByName(String name, - HttpServletRequest req, - HttpServletResponse resp, - ServletContext sctx) + HttpServletRequest req, + HttpServletResponse resp, + ServletContext sctx) throws IOException, ServletException { RequestDispatcher rd = sctx.getNamedDispatcher(name); forwardHelper(rd, req, resp); @@ -319,8 +318,8 @@ public final class DispatcherHelper implements DispatcherConstants { * DispatcherHelper.getRequestContext(req).getServletContext()). */ public static void forwardRequestByName(String name, - HttpServletRequest req, - HttpServletResponse resp) + HttpServletRequest req, + HttpServletResponse resp) throws IOException, ServletException { ServletContext sc = getRequestContext(req).getServletContext(); forwardRequestByName(name, req, resp, sc); @@ -350,9 +349,9 @@ public final class DispatcherHelper implements DispatcherConstants { * extensions when your file on disk has an extension. */ public static String resolveAbstractFile(File abstractFile, - RequestContext actx) + RequestContext actx) throws RedirectException, DirectoryListingException, - java.io.FileNotFoundException { + java.io.FileNotFoundException { s_log.debug("Resolving abstract file"); File dirToSearch = null; @@ -387,13 +386,13 @@ public final class DispatcherHelper implements DispatcherConstants { for (int j = 0; j < extensionSearchList.length; j++) { File possibleFile = - new File(dirToSearch, - filenameStub + extensionSearchList[j]); + new File(dirToSearch, + filenameStub + extensionSearchList[j]); for (int i = 0; i < filesInDir.length; i++) { if (filesInDir[i].equals(possibleFile)) { return (indexPage ? File.separator + "index" : "") - + extensionSearchList[j]; + + extensionSearchList[j]; } } } @@ -466,7 +465,7 @@ public final class DispatcherHelper implements DispatcherConstants { // from somewhere else. Object maybeWrappedReq = req.getAttribute(WRAPPED_REQUEST_ATTR); if (maybeWrappedReq != null - && !(req instanceof MultipartHttpServletRequest)) { + && !(req instanceof MultipartHttpServletRequest)) { req = (HttpServletRequest) maybeWrappedReq; } return req; @@ -481,30 +480,30 @@ public final class DispatcherHelper implements DispatcherConstants { final String type = sreq.getContentType(); if (sreq.getMethod().toUpperCase().equals("POST") - && type != null - && type.toLowerCase().startsWith("multipart")) { + && type != null + && type.toLowerCase().startsWith("multipart")) { final HttpServletRequest orig = sreq; final HttpServletRequest previous = - DispatcherHelper.restoreRequestWrapper(orig); + DispatcherHelper.restoreRequestWrapper(orig); if (previous instanceof MultipartHttpServletRequest) { s_log.debug("Build new multipart request from previous " - + previous + " and current " + orig); + + previous + " and current " + orig); MultipartHttpServletRequest previousmp = - (MultipartHttpServletRequest) previous; + (MultipartHttpServletRequest) previous; sreq = new MultipartHttpServletRequest(previousmp, - orig); + orig); DispatcherHelper.saveOriginalRequest(sreq, - orig); + orig); s_log.debug("The main request is now " + sreq); } else { s_log.debug("The request is a new multipart; wrapping the request " - + "object"); + + "object"); try { sreq = new MultipartHttpServletRequest(sreq); } catch (MessagingException me) { @@ -515,7 +514,7 @@ public final class DispatcherHelper implements DispatcherConstants { } } else { s_log.debug("The request is not multipart; proceeding " - + "without wrapping the request"); + + "without wrapping the request"); } return sreq; } @@ -526,7 +525,7 @@ public final class DispatcherHelper implements DispatcherConstants { * @param oldReq the original servlet request */ public static void saveOriginalRequest(HttpServletRequest req, - HttpServletRequest oldReq) { + HttpServletRequest oldReq) { req.setAttribute(ORIGINAL_REQUEST_ATTR, oldReq); } @@ -543,9 +542,9 @@ public final class DispatcherHelper implements DispatcherConstants { * @param resp the current response * @param url the destination URL for redirect **/ - public static void sendRedirect( HttpServletResponse resp, - String url) - throws IOException { + public static void sendRedirect(HttpServletResponse resp, + String url) + throws IOException { sendExternalRedirect(resp, url); } @@ -561,7 +560,7 @@ public final class DispatcherHelper implements DispatcherConstants { public static void sendRedirect(HttpServletRequest req, HttpServletResponse resp, String url) - throws IOException { + throws IOException { sendExternalRedirect(resp, url); } @@ -572,9 +571,9 @@ public final class DispatcherHelper implements DispatcherConstants { * @param resp the current response * @param url the destination URL for redirect **/ - public static void sendExternalRedirect( HttpServletResponse resp, - String url ) - throws IOException { + public static void sendExternalRedirect(HttpServletResponse resp, + String url) + throws IOException { if (s_log.isDebugEnabled()) { s_log.debug("Redirecting to URL '" + url + "'", new Throwable()); } @@ -592,7 +591,7 @@ public final class DispatcherHelper implements DispatcherConstants { HttpServletRequest req = getRequest(); Object attr; if (req != null - && (attr = req.getAttribute(REENTRANCE_ATTRIBUTE)) != null) { + && (attr = req.getAttribute(REENTRANCE_ATTRIBUTE)) != null) { req.getSession(true).setAttribute(REDIRECT_SEMAPHORE, attr); } @@ -620,14 +619,14 @@ public final class DispatcherHelper implements DispatcherConstants { destination = URL.there(req, url.substring(0, sep), params); if (s_log.isDebugEnabled()) { s_log.debug("Setting destination with map to " - + destination); + + destination); } } throw new RedirectSignal(destination, true); } else { if (s_log.isDebugEnabled()) { s_log.debug("Redirecting to URL without using URL.there. " - + "URL is " + url); + + "URL is " + url); } throw new RedirectSignal(url, true); } @@ -710,8 +709,8 @@ public final class DispatcherHelper implements DispatcherConstants { * @see com.arsdigita.util.URLRewriter **/ public static String encodeURL(HttpServletRequest req, - HttpServletResponse resp, - String url) { + HttpServletResponse resp, + String url) { return URLRewriter.encodeURL(req, resp, url); } @@ -843,7 +842,6 @@ public final class DispatcherHelper implements DispatcherConstants { * Gets the current HttpServletRequest for this thread. * @return the current HttpServletRequest for this thread. */ - public static HttpServletRequest getRequest() { init(); return (HttpServletRequest) s_request.get(); @@ -927,7 +925,7 @@ public final class DispatcherHelper implements DispatcherConstants { * @param maxage the max time in second until this expires */ public static void maybeCacheForUser(HttpServletResponse response, - int maxage) { + int maxage) { if (!response.containsHeader("Cache-Control")) { cacheForUser(response, maxage); } @@ -940,7 +938,7 @@ public final class DispatcherHelper implements DispatcherConstants { * @param expiry the time at which to expire */ public static void maybeCacheForUser(HttpServletResponse response, - Date expiry) { + Date expiry) { if (!response.containsHeader("Cache-Control")) { cacheForUser(response, expiry); } @@ -953,14 +951,14 @@ public final class DispatcherHelper implements DispatcherConstants { * @param maxage the max life of the response in seconds */ public static void cacheForUser(HttpServletResponse response, - int maxage) { + int maxage) { init(); if (!s_cachingActive) { return; } Assert.isTrue(!response.containsHeader("Cache-Control"), - "Caching headers have already been set"); + "Caching headers have already been set"); s_log.info("Setting cache control to user"); @@ -983,7 +981,7 @@ public final class DispatcherHelper implements DispatcherConstants { * @param expiry time at which to expire */ public static void cacheForUser(HttpServletResponse response, - Date expiry) { + Date expiry) { cacheForUser(response, (int) ((expiry.getTime() - (new Date()).getTime()) / 1000l)); } @@ -1015,7 +1013,7 @@ public final class DispatcherHelper implements DispatcherConstants { * @param maxage the time in seconds until expiry */ public static void maybeCacheForWorld(HttpServletResponse response, - int maxage) { + int maxage) { if (!response.containsHeader("Cache-Control")) { cacheForWorld(response, maxage); } @@ -1028,7 +1026,7 @@ public final class DispatcherHelper implements DispatcherConstants { * @param expiry the time at which it will expire */ public static void maybeCacheForWorld(HttpServletResponse response, - Date expiry) { + Date expiry) { if (!response.containsHeader("Cache-Control")) { cacheForWorld(response, expiry); } @@ -1041,14 +1039,14 @@ public final class DispatcherHelper implements DispatcherConstants { * @param maxage time in seconds until this expires */ public static void cacheForWorld(HttpServletResponse response, - int maxage) { + int maxage) { init(); if (!s_cachingActive) { return; } Assert.isTrue(!response.containsHeader("Cache-Control"), - "Caching headers have already been set"); + "Caching headers have already been set"); Calendar expires = Calendar.getInstance(); expires.add(Calendar.SECOND, maxage); @@ -1056,9 +1054,9 @@ public final class DispatcherHelper implements DispatcherConstants { s_log.info("Setting cache control to world"); response.setHeader("Cache-Control", "public, max-age=" + maxage); response.setHeader("Expires", - rfc1123_formatter.format(expires.getTime())); + rfc1123_formatter.format(expires.getTime())); response.setHeader("Last-Modified", - rfc1123_formatter.format(new Date())); + rfc1123_formatter.format(new Date())); } /** @@ -1066,7 +1064,7 @@ public final class DispatcherHelper implements DispatcherConstants { * THe response will expire at the time given. */ public static void cacheForWorld(HttpServletResponse response, - Date expiry) { + Date expiry) { cacheForWorld(response, (int) ((expiry.getTime() - (new Date()).getTime()) / 1000l)); } @@ -1115,14 +1113,13 @@ public final class DispatcherHelper implements DispatcherConstants { } } catch (NullPointerException ex) { - // Don't have to do anything because I want to fall back to default language anyway // This case should only appear during setup - } finally { return preferedLocale; } } + } diff --git a/ccm-ldn-search/sql/ccm-ldn-search/upgrade/postgres-6.6.1-6.6.2.sql b/ccm-ldn-search/sql/ccm-ldn-search/upgrade/postgres-6.6.1-6.6.2.sql index a9d276fdc..6614dda79 100644 --- a/ccm-ldn-search/sql/ccm-ldn-search/upgrade/postgres-6.6.1-6.6.2.sql +++ b/ccm-ldn-search/sql/ccm-ldn-search/upgrade/postgres-6.6.1-6.6.2.sql @@ -20,7 +20,7 @@ \echo Red Hat Enterprise ccm-ldn-search 6.6.1 -> 6.6.2 Upgrade Script (PostgreSQL) begin; -begin + \i default/6.6.1-6.6.2/set_singleton.sql commit; diff --git a/ccm-sci-bundle/bundles/base/res/bundle/ddenums.xml b/ccm-sci-bundle/bundles/base/res/bundle/ddenums.xml index 0ecd78462..41beee372 100644 --- a/ccm-sci-bundle/bundles/base/res/bundle/ddenums.xml +++ b/ccm-sci-bundle/bundles/base/res/bundle/ddenums.xml @@ -143,13 +143,13 @@ Abteilungsleitung - + Member Mitglied - + Office @@ -157,17 +157,25 @@ - + Project head Projektleitung - + Member Mitglied + + + Kontakt + + + Contact + + \ No newline at end of file diff --git a/ccm-sci-bundle/bundles/demo/res/bundle/ddenums.xml b/ccm-sci-bundle/bundles/demo/res/bundle/ddenums.xml index 0ecd78462..41beee372 100644 --- a/ccm-sci-bundle/bundles/demo/res/bundle/ddenums.xml +++ b/ccm-sci-bundle/bundles/demo/res/bundle/ddenums.xml @@ -143,13 +143,13 @@ Abteilungsleitung - + Member Mitglied - + Office @@ -157,17 +157,25 @@ - + Project head Projektleitung - + Member Mitglied + + + Kontakt + + + Contact + + \ No newline at end of file diff --git a/ccm-sci-bundle/bundles/devel/res/bundle/ddenums.xml b/ccm-sci-bundle/bundles/devel/res/bundle/ddenums.xml index 0ecd78462..41beee372 100644 --- a/ccm-sci-bundle/bundles/devel/res/bundle/ddenums.xml +++ b/ccm-sci-bundle/bundles/devel/res/bundle/ddenums.xml @@ -143,13 +143,13 @@ Abteilungsleitung - + Member Mitglied - + Office @@ -157,17 +157,25 @@ - + Project head Projektleitung - + Member Mitglied + + + Kontakt + + + Contact + + \ No newline at end of file diff --git a/ccm-sci-bundle/bundles/standard/res/bundle/ddenums.xml b/ccm-sci-bundle/bundles/standard/res/bundle/ddenums.xml index 0ecd78462..41beee372 100644 --- a/ccm-sci-bundle/bundles/standard/res/bundle/ddenums.xml +++ b/ccm-sci-bundle/bundles/standard/res/bundle/ddenums.xml @@ -143,13 +143,13 @@ Abteilungsleitung - + Member Mitglied - + Office @@ -157,17 +157,25 @@ - + Project head Projektleitung - + Member Mitglied + + + Kontakt + + + Contact + + \ No newline at end of file diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsStep.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsStep.java index 4682afb8e..cd50f70ae 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsStep.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsStep.java @@ -18,7 +18,14 @@ */ package com.arsdigita.cms.contenttypes.ui; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SegmentedPanel; +import com.arsdigita.bebop.SimpleContainer; +import com.arsdigita.bebop.event.PrintEvent; +import com.arsdigita.bebop.event.PrintListener; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.SimpleEditStep; @@ -40,8 +47,72 @@ public class PersonPublicationsStep extends SimpleEditStep { final String prefix) { super(itemModel, parent, prefix); - final PersonPublicationsTable publicationsTable = new PersonPublicationsTable(itemModel); - setDisplayComponent(publicationsTable); + final SegmentedPanel panel = new SegmentedPanel(); + final Label personPubsHeader = new Label(new PrintListener() { + + @Override + public void prepare(final PrintEvent event) { + final PageState state = event.getPageState(); + final Label target = (Label) event.getTarget(); + + final GenericPerson person = (GenericPerson) itemModel.getSelectedItem(state); + + target.setLabel(PublicationGlobalizationUtil.globalize("person.ui.publications.header", + new String[]{person.getFullName()})); + } + }); + final PersonPublicationsTable publicationsTable = new PersonPublicationsTable(itemModel); + panel.addSegment(personPubsHeader, publicationsTable); + + final SimpleContainer aliasHeader = new SimpleContainer(); + final Label personAliasPubsHeader = new Label(new PrintListener() { + + @Override + public void prepare(final PrintEvent event) { + final PageState state = event.getPageState(); + final Label target = (Label) event.getTarget(); + + final GenericPerson person = (GenericPerson) itemModel.getSelectedItem(state); + final GenericPerson alias = person.getAlias(); + + if (alias == null) { + target.setLabel(""); + } else { + target.setLabel(PublicationGlobalizationUtil.globalize("person.ui.publications.header", + new String[]{alias.getFullName()})); + } + } + }); + final Label personAliasOfHeader = new Label(new PrintListener() { + + @Override + public void prepare(final PrintEvent event) { + final PageState state = event.getPageState(); + final Label target = (Label) event.getTarget(); + + final GenericPerson person = (GenericPerson) itemModel.getSelectedItem(state); + final GenericPerson alias = person.getAlias(); + + if (alias == null) { + target.setLabel(""); + } else { + target.setLabel(PublicationGlobalizationUtil.globalize("person.ui.publications.header.alias_of", + new String[]{person.getFullName()})); + } + + } + }); + + + aliasHeader.add(personAliasPubsHeader); + aliasHeader.add(personAliasOfHeader); + + final PersonPublicationsTable aliasPublicationsTable = new PersonPublicationsTable(itemModel, true); + + panel.addSegment(aliasHeader, aliasPublicationsTable); + + //setDisplayComponent(publicationsTable); + setDisplayComponent(panel); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsTable.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsTable.java index 9d1c3c524..ccbf58073 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsTable.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PersonPublicationsTable.java @@ -24,6 +24,8 @@ import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Link; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.Table; +import com.arsdigita.bebop.event.PrintEvent; +import com.arsdigita.bebop.event.PrintListener; import com.arsdigita.bebop.table.TableCellRenderer; import com.arsdigita.bebop.table.TableColumn; import com.arsdigita.bebop.table.TableColumnModel; @@ -51,14 +53,40 @@ public class PersonPublicationsTable extends Table { private final static String TABLE_COL_YEAR = "table_col_year"; private final static String TABLE_COL_TYPE = "table_col_type"; //private final String TABLE_COL_DEL = "table_col_del"; - private ItemSelectionModel itemModel; + //private ItemSelectionModel itemModel; public PersonPublicationsTable(final ItemSelectionModel itemModel) { + this(itemModel, false); + } + + public PersonPublicationsTable(final ItemSelectionModel itemModel, final boolean useAlias) { super(); - this.itemModel = itemModel; + //this.itemModel = itemModel; - setEmptyView(new Label(PublicationGlobalizationUtil.globalize("person.ui.publications.none"))); + //setEmptyView(new Label(PublicationGlobalizationUtil.globalize("person.ui.publications.none"))); + setEmptyView(new Label(new PrintListener() { + @Override + public void prepare(final PrintEvent event) { + final PageState state = event.getPageState(); + final Label target = (Label) event.getTarget(); + + if (useAlias) { + final GenericPerson person = (GenericPerson) itemModel.getSelectedItem(state); + final GenericPerson alias = person.getAlias(); + + if (alias == null) { + target.setLabel(""); + } else { + target.setLabel(PublicationGlobalizationUtil.globalize("person.ui.publications.none")); + } + + } else { + target.setLabel(PublicationGlobalizationUtil.globalize("person.ui.publications.none")); + } + } + + })); final TableColumnModel columnModel = getColumnModel(); columnModel.add(new TableColumn( @@ -74,7 +102,7 @@ public class PersonPublicationsTable extends Table { PublicationGlobalizationUtil.globalize("person.ui.publications.columns.type").localize(), TABLE_COL_TYPE)); - setModelBuilder(new ModelBuilder(itemModel)); + setModelBuilder(new ModelBuilder(itemModel, useAlias)); columnModel.get(0).setCellRenderer(new EditCellRenderer()); @@ -83,15 +111,29 @@ public class PersonPublicationsTable extends Table { private class ModelBuilder extends LockableImpl implements TableModelBuilder { private final ItemSelectionModel itemModel; + private final boolean useAlias; public ModelBuilder(final ItemSelectionModel itemModel) { - this.itemModel = itemModel; + this(itemModel, false); } + public ModelBuilder(final ItemSelectionModel itemModel, final boolean useAlias) { + this.itemModel = itemModel; + this.useAlias = useAlias; + } + + @Override public TableModel makeModel(final Table table, final PageState state) { table.getRowSelectionModel().clearSelection(state); - final GenericPerson person = (GenericPerson) itemModel.getSelectedItem(state); + final GenericPerson person; + if (useAlias && ((GenericPerson) itemModel.getSelectedItem(state)).getAlias() == null) { + person = null; + } else if (useAlias && ((GenericPerson) itemModel.getSelectedItem(state)).getAlias() != null) { + person = ((GenericPerson) itemModel.getSelectedItem(state)).getAlias(); + } else { + person = (GenericPerson) itemModel.getSelectedItem(state); + } return new Model(table, state, person); } @@ -105,7 +147,11 @@ public class PersonPublicationsTable extends Table { public Model(final Table table, final PageState state, final GenericPerson person) { this.table = table; - publications = Publication.getPublications(person); + if (person == null) { + publications = null; + } else { + publications = Publication.getPublications(person); + } } @Override @@ -149,6 +195,7 @@ public class PersonPublicationsTable extends Table { private class EditCellRenderer extends LockableImpl implements TableCellRenderer { + @Override public Component getComponent(final Table table, final PageState state, final Object value, diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties index 07f4c807a..72341e8df 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources.properties @@ -415,3 +415,5 @@ publications.ui.journal.symbol=Symbol of the journal publications.ui.publication.first_published=First published publications.ui.publication.language=Language of publication publications.ui.series.number=Volume of series +person.ui.publications.header=Publications with {0} as author +person.ui.publications.header.alias_of=(Alias of {0}) diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties index 3ec64d308..009f0d67e 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationResources_de.properties @@ -414,3 +414,5 @@ publications.ui.journal.symbol=K\u00fcrzel der Zeitschrift publications.ui.publication.first_published=Erste Ver\u00f6ffentlichung publications.ui.publication.language=Sprache der Publikation publications.ui.series.number=Band der Reihe +person.ui.publications.header=Publikationen mit {0} als Autorin/Autor +person.ui.publications.header.alias_of=\ (Alias von {0}) diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteMembersTab.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteMembersTab.java index e82926c86..92360bfdf 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteMembersTab.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/ui/SciInstituteMembersTab.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2011, 2012, 2013 Jens Pelzetter + * + * 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.PageState; @@ -39,9 +57,7 @@ public class SciInstituteMembersTab implements GenericOrgaUnitTab { false, false, false); - private final TextFilter surnameFilter = - new TextFilter(SURNAME_PARAM, - GenericPerson.SURNAME); + private final TextFilter surnameFilter = new TextFilter(SURNAME_PARAM, GenericPerson.SURNAME); static { config.load(); @@ -58,8 +74,7 @@ public class SciInstituteMembersTab implements GenericOrgaUnitTab { public boolean hasData(final GenericOrganizationalUnit orgaunit, final PageState state) { - if ((orgaunit.getPersons() != null) - && orgaunit.getPersons().size() > 0) { + if ((orgaunit.getPersons() != null) && orgaunit.getPersons().size() > 0) { return true; } else if (config.isMergingMembers()) { final DataCollection persons = getData(orgaunit, state); @@ -86,7 +101,7 @@ public class SciInstituteMembersTab implements GenericOrgaUnitTab { statusFilter.generateXml(filtersElem); - if (persons.isEmpty()) { + if ((persons == null) || persons.isEmpty()) { if ((surnameFilter != null) && (surnameFilter.getFilter() != null) && (!surnameFilter.getFilter().trim().isEmpty())) { @@ -135,7 +150,7 @@ public class SciInstituteMembersTab implements GenericOrgaUnitTab { final DataQuery personBundlesQuery = SessionManager.getSession(). retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfMembersOfOrgaUnits"); + "com.arsdigita.cms.contenttypes.getIdsOfMembersOfOrgaUnits"); final List orgaunitsIds = new ArrayList(); if (config.isMergingMembers()) { @@ -147,32 +162,32 @@ public class SciInstituteMembersTab implements GenericOrgaUnitTab { departmentsQuery.setParameter("assocType", SciInstituteDepartmentsStep.ASSOC_TYPE); - while (departmentsQuery.next()) { + while (departmentsQuery.next()) { orgaunitsIds.add(departmentsQuery.get("orgaunitId").toString()); } - } else { + } else { orgaunitsIds.add(orgaunit.getContentBundle().getID().toString()); } - + personBundlesQuery.setParameter("orgaunitIds", orgaunitsIds); applyStatusFilter(personBundlesQuery, state.getRequest()); final StringBuilder filterBuilder = new StringBuilder(); - while(personBundlesQuery.next()) { + while (personBundlesQuery.next()) { if (filterBuilder.length() > 0) { filterBuilder.append(','); } filterBuilder.append(personBundlesQuery.get("memberId").toString()); } final DataCollection membersQuery = SessionManager.getSession().retrieve(GenericPerson.BASE_DATA_OBJECT_TYPE); - + if (filterBuilder.length() == 0) { //No members, return null to indicate return null; } - + membersQuery.addFilter(String.format("parent.id in (%s)", filterBuilder.toString())); - + membersQuery.addOrder(GenericPerson.SURNAME); membersQuery.addOrder(GenericPerson.GIVENNAME); @@ -182,6 +197,7 @@ public class SciInstituteMembersTab implements GenericOrgaUnitTab { orgaunit.getName(), System.currentTimeMillis() - start, config.isMergingMembers())); + return membersQuery; } @@ -249,5 +265,6 @@ public class SciInstituteMembersTab implements GenericOrgaUnitTab { protected ContentItem getContentItem(final PageState state) { return item; } + } }