- Die Liste der Publikationen einer Person im Content-Center (AuthoringStep Publikationen bei Personen) zeigt jetzt auch
Publikationen eines eventuell vorhandenen Aliases (Frührer Name) an - Für die Assoziation zwischen GenericOrganizationalUnit und Kontakt wurde bisher die gleichen Werte für den Kontakttyp verwendet wie für die Assoization zwischen GenericPerson und Kontakt. Jetzt werden unterschiedliche Werte für den Kontakttyp bei den beiden Assoziatonen verwendet. - Verschiedene Formatierungen usw. git-svn-id: https://svn.libreccm.org/ccm/trunk@2254 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
f86f3a8f79
commit
9601efd7dc
|
|
@ -18,4 +18,4 @@
|
|||
-- $Id: upd_acs_objects.sql $
|
||||
|
||||
|
||||
alter table cms_item_image_attachement add column sort_key integer set default 1;
|
||||
alter table cms_item_image_attachment add column sort_key integer;
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 <jens@jp-digital.de>
|
||||
* @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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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())</code>.
|
||||
*/
|
||||
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())</code>.
|
||||
*/
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -143,13 +143,13 @@
|
|||
<entry key="head" lang="de">
|
||||
<value>Abteilungsleitung</value>
|
||||
</entry>
|
||||
<entry key="member" lang="en">
|
||||
<entry key="member" lang="en">
|
||||
<value>Member</value>
|
||||
</entry>
|
||||
<entry key="member" lang="de">
|
||||
<value>Mitglied</value>
|
||||
</entry>
|
||||
<entry key="secretariat" lang="en">
|
||||
<entry key="secretariat" lang="en">
|
||||
<value>Office</value>
|
||||
</entry>
|
||||
<entry key="secretariat" lang="de">
|
||||
|
|
@ -157,17 +157,25 @@
|
|||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="SciProjectRole">
|
||||
<entry key="head" lang="en">
|
||||
<entry key="head" lang="en">
|
||||
<value>Project head</value>
|
||||
</entry>
|
||||
<entry key="head" lang="de">
|
||||
<value>Projektleitung</value>
|
||||
</entry>
|
||||
<entry key="member" lang="en">
|
||||
<entry key="member" lang="en">
|
||||
<value>Member</value>
|
||||
</entry>
|
||||
<entry key="member" lang="de">
|
||||
<value>Mitglied</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="GenericOrganizationContactType">
|
||||
<entry key="contact" lang="de">
|
||||
<value>Kontakt</value>
|
||||
</entry>
|
||||
<entry key="contact" lang="en">
|
||||
<value>Contact</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
</ddenums>
|
||||
|
|
@ -143,13 +143,13 @@
|
|||
<entry key="head" lang="de">
|
||||
<value>Abteilungsleitung</value>
|
||||
</entry>
|
||||
<entry key="member" lang="en">
|
||||
<entry key="member" lang="en">
|
||||
<value>Member</value>
|
||||
</entry>
|
||||
<entry key="member" lang="de">
|
||||
<value>Mitglied</value>
|
||||
</entry>
|
||||
<entry key="secretariat" lang="en">
|
||||
<entry key="secretariat" lang="en">
|
||||
<value>Office</value>
|
||||
</entry>
|
||||
<entry key="secretariat" lang="de">
|
||||
|
|
@ -157,17 +157,25 @@
|
|||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="SciProjectRole">
|
||||
<entry key="head" lang="en">
|
||||
<entry key="head" lang="en">
|
||||
<value>Project head</value>
|
||||
</entry>
|
||||
<entry key="head" lang="de">
|
||||
<value>Projektleitung</value>
|
||||
</entry>
|
||||
<entry key="member" lang="en">
|
||||
<entry key="member" lang="en">
|
||||
<value>Member</value>
|
||||
</entry>
|
||||
<entry key="member" lang="de">
|
||||
<value>Mitglied</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="GenericOrganizationContactType">
|
||||
<entry key="contact" lang="de">
|
||||
<value>Kontakt</value>
|
||||
</entry>
|
||||
<entry key="contact" lang="en">
|
||||
<value>Contact</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
</ddenums>
|
||||
|
|
@ -143,13 +143,13 @@
|
|||
<entry key="head" lang="de">
|
||||
<value>Abteilungsleitung</value>
|
||||
</entry>
|
||||
<entry key="member" lang="en">
|
||||
<entry key="member" lang="en">
|
||||
<value>Member</value>
|
||||
</entry>
|
||||
<entry key="member" lang="de">
|
||||
<value>Mitglied</value>
|
||||
</entry>
|
||||
<entry key="secretariat" lang="en">
|
||||
<entry key="secretariat" lang="en">
|
||||
<value>Office</value>
|
||||
</entry>
|
||||
<entry key="secretariat" lang="de">
|
||||
|
|
@ -157,17 +157,25 @@
|
|||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="SciProjectRole">
|
||||
<entry key="head" lang="en">
|
||||
<entry key="head" lang="en">
|
||||
<value>Project head</value>
|
||||
</entry>
|
||||
<entry key="head" lang="de">
|
||||
<value>Projektleitung</value>
|
||||
</entry>
|
||||
<entry key="member" lang="en">
|
||||
<entry key="member" lang="en">
|
||||
<value>Member</value>
|
||||
</entry>
|
||||
<entry key="member" lang="de">
|
||||
<value>Mitglied</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="GenericOrganizationContactType">
|
||||
<entry key="contact" lang="de">
|
||||
<value>Kontakt</value>
|
||||
</entry>
|
||||
<entry key="contact" lang="en">
|
||||
<value>Contact</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
</ddenums>
|
||||
|
|
@ -143,13 +143,13 @@
|
|||
<entry key="head" lang="de">
|
||||
<value>Abteilungsleitung</value>
|
||||
</entry>
|
||||
<entry key="member" lang="en">
|
||||
<entry key="member" lang="en">
|
||||
<value>Member</value>
|
||||
</entry>
|
||||
<entry key="member" lang="de">
|
||||
<value>Mitglied</value>
|
||||
</entry>
|
||||
<entry key="secretariat" lang="en">
|
||||
<entry key="secretariat" lang="en">
|
||||
<value>Office</value>
|
||||
</entry>
|
||||
<entry key="secretariat" lang="de">
|
||||
|
|
@ -157,17 +157,25 @@
|
|||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="SciProjectRole">
|
||||
<entry key="head" lang="en">
|
||||
<entry key="head" lang="en">
|
||||
<value>Project head</value>
|
||||
</entry>
|
||||
<entry key="head" lang="de">
|
||||
<value>Projektleitung</value>
|
||||
</entry>
|
||||
<entry key="member" lang="en">
|
||||
<entry key="member" lang="en">
|
||||
<value>Member</value>
|
||||
</entry>
|
||||
<entry key="member" lang="de">
|
||||
<value>Mitglied</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
<ddenum name="GenericOrganizationContactType">
|
||||
<entry key="contact" lang="de">
|
||||
<value>Kontakt</value>
|
||||
</entry>
|
||||
<entry key="contact" lang="en">
|
||||
<value>Contact</value>
|
||||
</entry>
|
||||
</ddenum>
|
||||
</ddenums>
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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})
|
||||
|
|
|
|||
|
|
@ -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})
|
||||
|
|
|
|||
|
|
@ -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<String> orgaunitsIds = new ArrayList<String>();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue