Auch die Attribute der Assoziationen zwischen einer Organisation und einem Konatakt sowie zwischen einer Organisation und einer Person lassen sich bearbeiten.
Ebenso bei SciOrganization, SciDepartment und SciProject. git-svn-id: https://svn.libreccm.org/ccm/trunk@766 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
43cf93a12b
commit
03b0e91853
|
|
@ -133,3 +133,4 @@ cms.contenttypes.ui.person.contact.del=Delete
|
|||
cms.contenttypes.ui.genericorgaunit.contact.up=Up
|
||||
cms.contenttypes.ui.genericorgaunit.contact.down=Down
|
||||
cms.contenttypes.ui.genericorgaunit.contact.edit=Edit association
|
||||
cms.contenttypes.ui.genericorganunit.persons.edit=Edit association
|
||||
|
|
|
|||
|
|
@ -144,3 +144,4 @@ cms.contenttypes.ui.person.contact.del=L\u00f6schen
|
|||
cms.contenttypes.ui.genericorgaunit.contact.up=Hoch
|
||||
cms.contenttypes.ui.genericorgaunit.contact.down=Runter
|
||||
cms.contenttypes.ui.genericorgaunit.contact.edit=Verkn\u00fcpfung bearbeiten
|
||||
cms.contenttypes.ui.genericorganunit.persons.edit=Verkn\u00fcpfung bearbeiten
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ package com.arsdigita.cms.contenttypes;
|
|||
import com.arsdigita.domain.DomainCollection;
|
||||
import com.arsdigita.domain.DomainObjectFactory;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
|
||||
/**
|
||||
* Collection class for the GenericOrganizationalUnit -> Person relation.
|
||||
|
|
@ -29,8 +30,10 @@ import com.arsdigita.persistence.DataCollection;
|
|||
*/
|
||||
public class GenericOrganizationalUnitPersonCollection extends DomainCollection {
|
||||
|
||||
public static final String PERSON_ROLE = "link.role_name";
|
||||
public static final String STATUS = "link.status";
|
||||
public static final String LINK_PERSON_ROLE = "link.role_name";
|
||||
public static final String LINK_STATUS = "link.status";
|
||||
public static final String PERSON_ROLE = "role_name";
|
||||
public static final String STATUS = "status";
|
||||
|
||||
public GenericOrganizationalUnitPersonCollection(
|
||||
DataCollection dataCollection) {
|
||||
|
|
@ -44,11 +47,23 @@ public class GenericOrganizationalUnitPersonCollection extends DomainCollection
|
|||
* @return
|
||||
*/
|
||||
public String getRoleName() {
|
||||
return (String) m_dataCollection.get(PERSON_ROLE);
|
||||
return (String) m_dataCollection.get(LINK_PERSON_ROLE);
|
||||
}
|
||||
|
||||
public void setRoleName(final String roleName) {
|
||||
DataObject link = (DataObject) this.get("link");
|
||||
|
||||
link.set(PERSON_ROLE, roleName);
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return (String) m_dataCollection.get(STATUS);
|
||||
return (String) m_dataCollection.get(LINK_STATUS);
|
||||
}
|
||||
|
||||
public void setStatus(final String status) {
|
||||
DataObject link = (DataObject) this.get("link");
|
||||
|
||||
link.set(STATUS, status);
|
||||
}
|
||||
|
||||
public GenericPerson getPerson() {
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.arsdigita.bebop.Label;
|
|||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SaveCancelSection;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.SingleSelect;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
|
|
@ -44,11 +45,13 @@ import com.arsdigita.dispatcher.DispatcherHelper;
|
|||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
* Form for addings an related contact to an organization.
|
||||
* Form for adding an related contact to an organization.
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
|
||||
public class GenericOrganizationalUnitContactAddForm
|
||||
extends BasicItemForm
|
||||
implements FormSubmissionListener {
|
||||
|
||||
private final static Logger s_log = Logger.getLogger(
|
||||
GenericOrganizationalUnitContactAddForm.class);
|
||||
|
|
@ -65,6 +68,7 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
|
|||
super("ContactEntryAddForm", itemModel);
|
||||
m_itemModel = itemModel;
|
||||
this.editStep = editStep;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -162,4 +166,14 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
|
|||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(
|
||||
fse.getPageState())) {
|
||||
editStep.setSelectedContact(null);
|
||||
editStep.setSelectedContactType(null);
|
||||
|
||||
init(fse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ import com.arsdigita.bebop.FormProcessException;
|
|||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.SingleSelect;
|
||||
import com.arsdigita.bebop.parameters.NotEmptyValidationListener;
|
||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.bebop.parameters.StringParameter;
|
||||
|
|
@ -48,16 +48,23 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class GenericOrganizationalUnitPersonAddForm extends BasicItemForm {
|
||||
public class GenericOrganizationalUnitPersonAddForm
|
||||
extends BasicItemForm
|
||||
implements FormSubmissionListener {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(
|
||||
GenericOrganizationalUnitPersonAddForm.class);
|
||||
private GenericOrganizationalUnitPersonPropertiesStep m_step;
|
||||
private ItemSearchWidget m_itemSearch;
|
||||
private final String ITEM_SEARCH = "orgaunitPerson";
|
||||
private GenericOrganizationalUnitPersonSelector selector;
|
||||
private Label selectedPersonNameLabel;
|
||||
|
||||
public GenericOrganizationalUnitPersonAddForm(ItemSelectionModel itemModel) {
|
||||
public GenericOrganizationalUnitPersonAddForm(ItemSelectionModel itemModel,
|
||||
GenericOrganizationalUnitPersonSelector selector) {
|
||||
super("PersonAddForm", itemModel);
|
||||
this.selector = selector;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -70,6 +77,9 @@ public class GenericOrganizationalUnitPersonAddForm extends BasicItemForm {
|
|||
new NotNullValidationListener());
|
||||
add(this.m_itemSearch);
|
||||
|
||||
selectedPersonNameLabel = new Label("");
|
||||
add(selectedPersonNameLabel);
|
||||
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.person.role")));
|
||||
ParameterModel roleParam =
|
||||
|
|
@ -117,8 +127,32 @@ public class GenericOrganizationalUnitPersonAddForm extends BasicItemForm {
|
|||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
|
||||
GenericPerson person;
|
||||
String role;
|
||||
String status;
|
||||
|
||||
person = selector.getSelectedPerson();
|
||||
role = selector.getSelectedPersonRole();
|
||||
status = selector.getSelectedPersonStatus();
|
||||
|
||||
if (person == null) {
|
||||
//m_itemSearch.setVisible(state, true);
|
||||
//selectedPersonNameLabel.setVisible(state, false);
|
||||
} else {
|
||||
data.put(ITEM_SEARCH, person);
|
||||
data.put(GenericOrganizationalUnitPersonCollection.PERSON_ROLE,
|
||||
role);
|
||||
data.put(GenericOrganizationalUnitPersonCollection.STATUS,
|
||||
status);
|
||||
|
||||
//m_itemSearch.setVisible(state, false);
|
||||
//selectedPersonNameLabel.setVisible(state, true);
|
||||
//selectedPersonNameLabel.setLabel(person.getFullName(), state);
|
||||
}
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
|
|
@ -130,23 +164,58 @@ public class GenericOrganizationalUnitPersonAddForm extends BasicItemForm {
|
|||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
logger.warn("Person to add is null!!!");
|
||||
} else {
|
||||
|
||||
GenericPerson person;
|
||||
person = selector.getSelectedPerson();
|
||||
|
||||
if (person == null) {
|
||||
logger.debug(String.format("Adding person %s",
|
||||
((GenericPerson) data.get(ITEM_SEARCH)).
|
||||
getFullName()));
|
||||
}
|
||||
|
||||
orga.addPerson((GenericPerson) data.get(ITEM_SEARCH),
|
||||
(String) data.get(
|
||||
GenericOrganizationalUnitPersonCollection.PERSON_ROLE),
|
||||
(String) data.get(
|
||||
GenericOrganizationalUnitPersonCollection.STATUS));
|
||||
} else {
|
||||
GenericOrganizationalUnitPersonCollection persons;
|
||||
|
||||
persons = orga.getPersons();
|
||||
|
||||
while (persons.next()) {
|
||||
if (persons.getPerson().equals(person)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
persons.setRoleName((String) data.get(
|
||||
GenericOrganizationalUnitPersonCollection.PERSON_ROLE));
|
||||
persons.setStatus((String) data.get(
|
||||
GenericOrganizationalUnitPersonCollection.STATUS));
|
||||
|
||||
selector.setSelectedPerson(null);
|
||||
selector.setSelectedPersonRole(null);
|
||||
selector.setSelectedPersonRole(null);
|
||||
|
||||
persons.close();
|
||||
}
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(
|
||||
fse.getPageState())) {
|
||||
selector.setSelectedPerson(null);
|
||||
selector.setSelectedPersonRole(null);
|
||||
selector.setSelectedPersonRole(null);
|
||||
|
||||
init(fse);
|
||||
}
|
||||
}
|
||||
|
||||
protected String getPersonType() {
|
||||
return GenericPerson.class.getName();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
|
@ -32,9 +34,13 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
|||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class GenericOrganizationalUnitPersonPropertiesStep
|
||||
extends SimpleEditStep {
|
||||
extends SimpleEditStep
|
||||
implements GenericOrganizationalUnitPersonSelector {
|
||||
|
||||
private static final String ADD_PERSON_SHEET_NAME = "addPerson";
|
||||
public static final String ADD_PERSON_SHEET_NAME = "addPerson";
|
||||
private GenericPerson selectedPerson;
|
||||
private String selectedPersonRole;
|
||||
private String selectedPersonStatus;
|
||||
|
||||
public GenericOrganizationalUnitPersonPropertiesStep(
|
||||
ItemSelectionModel itemModel,
|
||||
|
|
@ -49,7 +55,8 @@ public class GenericOrganizationalUnitPersonPropertiesStep
|
|||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm addPersonSheet =
|
||||
new GenericOrganizationalUnitPersonAddForm(itemModel);
|
||||
new GenericOrganizationalUnitPersonAddForm(itemModel,
|
||||
this);
|
||||
add(ADD_PERSON_SHEET_NAME,
|
||||
(String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.add_person").localize(),
|
||||
|
|
@ -57,7 +64,43 @@ public class GenericOrganizationalUnitPersonPropertiesStep
|
|||
addPersonSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
GenericOrganizationalUnitPersonsTable personsTable = new GenericOrganizationalUnitPersonsTable(
|
||||
itemModel);
|
||||
itemModel,
|
||||
this);
|
||||
setDisplayComponent(personsTable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GenericPerson getSelectedPerson() {
|
||||
return selectedPerson;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelectedPerson(GenericPerson selectedPerson) {
|
||||
this.selectedPerson = selectedPerson;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSelectedPersonRole() {
|
||||
return selectedPersonRole;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelectedPersonRole(String selectedPersonRole) {
|
||||
this.selectedPersonRole = selectedPersonRole;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSelectedPersonStatus() {
|
||||
return selectedPersonStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelectedPersonStatus(String selectedPersonStatus) {
|
||||
this.selectedPersonStatus = selectedPersonStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showEditComponent(final PageState state) {
|
||||
showComponent(state, ADD_PERSON_SHEET_NAME);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) 2011 Jens Pelzetter,
|
||||
* for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* 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;
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public interface GenericOrganizationalUnitPersonSelector {
|
||||
|
||||
public GenericPerson getSelectedPerson();
|
||||
|
||||
public void setSelectedPerson(GenericPerson selectedPerson);
|
||||
|
||||
public String getSelectedPersonRole();
|
||||
|
||||
public void setSelectedPersonRole(String selectedPersonRole);
|
||||
|
||||
public String getSelectedPersonStatus();
|
||||
|
||||
public void setSelectedPersonStatus(String selectedPersonStatus);
|
||||
|
||||
public void showEditComponent(PageState state);
|
||||
}
|
||||
|
|
@ -42,6 +42,7 @@ import com.arsdigita.cms.contenttypes.GenericPerson;
|
|||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.cms.SecurityManager;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -61,11 +62,14 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
|||
private final String TABLE_COL_EDIT_LINK = "table_col_edit_link";
|
||||
private final String TABLE_COL_DEL = "table_col_del";
|
||||
private ItemSelectionModel m_itemModel;
|
||||
private GenericOrganizationalUnitPersonSelector personSelector;
|
||||
|
||||
public GenericOrganizationalUnitPersonsTable(
|
||||
final ItemSelectionModel itemModel) {
|
||||
final ItemSelectionModel itemModel,
|
||||
final GenericOrganizationalUnitPersonSelector personSelector) {
|
||||
super();
|
||||
m_itemModel = itemModel;
|
||||
this.personSelector = personSelector;
|
||||
|
||||
setEmptyView(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.persons.none")));
|
||||
|
|
@ -74,7 +78,8 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
|||
tabModel.add(new TableColumn(
|
||||
0,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.persons.name").localize()));
|
||||
"cms.contenttypes.ui.genericorgaunit.persons.name").localize(),
|
||||
TABLE_COL_EDIT));
|
||||
tabModel.add(new TableColumn(
|
||||
1,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
|
|
@ -88,6 +93,12 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
|||
new TableColumn(
|
||||
3,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorganunit.persons.edit").localize(),
|
||||
TABLE_COL_EDIT_LINK));
|
||||
tabModel.add(
|
||||
new TableColumn(
|
||||
4,
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.persons.delete").localize(),
|
||||
TABLE_COL_DEL));
|
||||
|
||||
|
|
@ -95,7 +106,8 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
|||
new GenericOrganizationalUnitTableModelBuilder(itemModel));
|
||||
|
||||
tabModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||
tabModel.get(3).setCellRenderer(new DeleteCellRenderer());
|
||||
tabModel.get(3).setCellRenderer(new EditLinkCellRenderer());
|
||||
tabModel.get(4).setCellRenderer(new DeleteCellRenderer());
|
||||
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
|
@ -165,7 +177,10 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
|||
getRoleAttributeName(),
|
||||
m_personsCollection.getRoleName());
|
||||
if (role.next()) {
|
||||
return role.getName();
|
||||
String roleName;
|
||||
roleName = role.getName();
|
||||
role.close();
|
||||
return roleName;
|
||||
} else {
|
||||
return ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknownRole").localize();
|
||||
|
|
@ -175,12 +190,18 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
|||
getStatusAttributeName(),
|
||||
m_personsCollection.getStatus());
|
||||
if (status.next()) {
|
||||
return status.getName();
|
||||
String statusName;
|
||||
statusName = status.getName();
|
||||
status.close();
|
||||
return statusName;
|
||||
} else {
|
||||
return ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.unknownStatus").localize();
|
||||
}
|
||||
case 3:
|
||||
return ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.edit_assoc").localize();
|
||||
case 4:
|
||||
return ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.ui.delete").localize();
|
||||
default:
|
||||
|
|
@ -239,6 +260,36 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
|||
}
|
||||
}
|
||||
|
||||
private class EditLinkCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int column) {
|
||||
SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
GenericOrganizationalUnit orgaUnit = (GenericOrganizationalUnit) m_itemModel.
|
||||
getSelectedObject(state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(state.getRequest(),
|
||||
SecurityManager.EDIT_ITEM,
|
||||
orgaUnit);
|
||||
|
||||
if (canEdit) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
return link;
|
||||
} else {
|
||||
Label label = new Label(value.toString());
|
||||
return label;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class DeleteCellRenderer extends LockableImpl implements
|
||||
TableCellRenderer {
|
||||
|
||||
|
|
@ -250,14 +301,14 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
|||
Object key,
|
||||
int row,
|
||||
int col) {
|
||||
com.arsdigita.cms.SecurityManager securityManager = Utilities.
|
||||
getSecurityManager(state);
|
||||
SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
GenericOrganizationalUnit orgaunit = (GenericOrganizationalUnit) m_itemModel.
|
||||
getSelectedObject(
|
||||
state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(state.getRequest(),
|
||||
com.arsdigita.cms.SecurityManager.DELETE_ITEM,
|
||||
SecurityManager.DELETE_ITEM,
|
||||
orgaunit);
|
||||
if (canEdit) {
|
||||
ControlLink link = new ControlLink(value.toString());
|
||||
|
|
@ -286,10 +337,27 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
|
|||
GenericOrganizationalUnit orga = (GenericOrganizationalUnit) m_itemModel.
|
||||
getSelectedObject(state);
|
||||
|
||||
GenericOrganizationalUnitPersonCollection persons = orga.getPersons();
|
||||
|
||||
TableColumn col = getColumnModel().get(event.getColumn().intValue());
|
||||
|
||||
if (col.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
||||
} else if (col.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
||||
if (TABLE_COL_EDIT.equals(col.getHeaderKey().toString())) {
|
||||
} else if (TABLE_COL_EDIT_LINK.equals(col.getHeaderKey().toString())) {
|
||||
while (persons.next()) {
|
||||
if (persons.getPerson().equals(person)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
personSelector.setSelectedPerson(person);
|
||||
personSelector.setSelectedPersonRole(persons.getRoleName());
|
||||
personSelector.setSelectedPersonStatus(persons.getStatus());
|
||||
|
||||
persons.close();
|
||||
|
||||
personSelector.showEditComponent(state);
|
||||
|
||||
} else if (TABLE_COL_DEL.equals(col.getHeaderKey().toString())) {
|
||||
s_log.debug("Removing person assoc...");
|
||||
orga.removePerson(person);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.arsdigita.bebop.FormSection;
|
|||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SaveCancelSection;
|
||||
import com.arsdigita.bebop.event.FormCancelListener;
|
||||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
|
|
@ -55,8 +56,10 @@ import java.util.Collection;
|
|||
* @author Stanislav Freidin (stas@arsdigita.com)
|
||||
* @version $Revision: #13 $ $DateTime: 2004/08/17 23:15:09 $
|
||||
**/
|
||||
public abstract class BasicItemForm extends FormSection
|
||||
implements FormInitListener, FormProcessListener,
|
||||
public abstract class BasicItemForm
|
||||
extends FormSection
|
||||
implements FormInitListener,
|
||||
FormProcessListener,
|
||||
FormValidationListener {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(BasicItemForm.class);
|
||||
|
|
@ -201,18 +204,23 @@ public abstract class BasicItemForm extends FormSection
|
|||
* Perform form initialization. Children should override this
|
||||
* this method to pre-fill the widgets with data, instantiate
|
||||
* the content item, etc.
|
||||
* @param e
|
||||
* @throws FormProcessException
|
||||
*/
|
||||
public abstract void init(FormSectionEvent e) throws FormProcessException;
|
||||
|
||||
/**
|
||||
* Process the form. Children should override this method to save
|
||||
* the user's changes to the database.
|
||||
* @param e
|
||||
* @throws FormProcessException
|
||||
*/
|
||||
public abstract void process(FormSectionEvent e) throws FormProcessException;
|
||||
|
||||
/**
|
||||
* Validate the form. Children should override this method to provide
|
||||
* custom form validation.
|
||||
* @param e
|
||||
*/
|
||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||
// do nothing
|
||||
|
|
|
|||
|
|
@ -63,19 +63,16 @@ import org.apache.log4j.Logger;
|
|||
public class FormSection extends SimpleComponent implements Container {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(FormSection.class);
|
||||
|
||||
/**
|
||||
* Underlying <code>FormModel</code> that stores
|
||||
* the parameter models for all the widgets in this form section.
|
||||
*/
|
||||
protected FormModel m_formModel;
|
||||
|
||||
/**
|
||||
* The container to which all children are added. A
|
||||
* <code>ColumnPanel</code> by default.
|
||||
*/
|
||||
protected Container m_panel;
|
||||
|
||||
/**
|
||||
* Contains all the listeners that were added with the various
|
||||
* addXXXListener methods.
|
||||
|
|
@ -85,7 +82,6 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
* FormModel.
|
||||
*/
|
||||
private EventListenerList m_listeners;
|
||||
|
||||
// Listeners we attach to the FormModel to forward
|
||||
// form model events to our listeners with the right source
|
||||
private FormSubmissionListener m_forwardSubmission;
|
||||
|
|
@ -143,8 +139,7 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
*/
|
||||
public void addSubmissionListener(FormSubmissionListener listener) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Adding submission listener " + listener + " to " +
|
||||
this);
|
||||
s_log.debug("Adding submission listener " + listener + " to " + this);
|
||||
}
|
||||
|
||||
Assert.exists(listener, "Submission Listener");
|
||||
|
|
@ -161,8 +156,8 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
*/
|
||||
public void removeSubmissionListener(FormSubmissionListener listener) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Removing submission listener " + listener + " from " +
|
||||
this);
|
||||
s_log.debug("Removing submission listener " + listener + " from "
|
||||
+ this);
|
||||
}
|
||||
|
||||
Assert.exists(listener, "Submission Listener");
|
||||
|
|
@ -183,10 +178,11 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
Assert.exists(e.getFormData(), "FormData");
|
||||
FormProcessException delayedException = null;
|
||||
|
||||
Iterator i = m_listeners.getListenerIterator(FormSubmissionListener
|
||||
.class);
|
||||
Iterator i = m_listeners.getListenerIterator(
|
||||
FormSubmissionListener.class);
|
||||
while (i.hasNext()) {
|
||||
final FormSubmissionListener listener = (FormSubmissionListener) i.next();
|
||||
final FormSubmissionListener listener = (FormSubmissionListener) i.
|
||||
next();
|
||||
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Firing submission listener " + listener);
|
||||
|
|
@ -195,10 +191,11 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
try {
|
||||
listener.submitted(e);
|
||||
} catch (FormProcessException ex) {
|
||||
s_log.error(ex);
|
||||
delayedException = ex;
|
||||
}
|
||||
}
|
||||
if ( delayedException != null ) {
|
||||
if (delayedException != null) {
|
||||
throw delayedException;
|
||||
}
|
||||
}
|
||||
|
|
@ -219,6 +216,7 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
*/
|
||||
protected FormSubmissionListener createSubmissionListener() {
|
||||
return new FormSubmissionListener() {
|
||||
|
||||
public void submitted(FormSectionEvent e)
|
||||
throws FormProcessException {
|
||||
fireSubmitted(new FormSectionEvent(FormSection.this,
|
||||
|
|
@ -258,8 +256,7 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
*/
|
||||
public void removeInitListener(FormInitListener listener) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Removing init listener " + listener + " from " +
|
||||
this);
|
||||
s_log.debug("Removing init listener " + listener + " from " + this);
|
||||
}
|
||||
|
||||
Assert.exists(listener, "Init Listener");
|
||||
|
|
@ -297,7 +294,6 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates the init listener that forwards init events to this form
|
||||
* section.
|
||||
|
|
@ -307,6 +303,7 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
*/
|
||||
protected FormInitListener createInitListener() {
|
||||
return new FormInitListener() {
|
||||
|
||||
public void init(FormSectionEvent e)
|
||||
throws FormProcessException {
|
||||
fireInit(new FormSectionEvent(FormSection.this,
|
||||
|
|
@ -316,6 +313,23 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the cancel listener that forwards cancel events to this form
|
||||
* section
|
||||
*
|
||||
* @return an cancel listener
|
||||
*/
|
||||
protected FormCancelListener createCancelListener() {
|
||||
return new FormCancelListener() {
|
||||
|
||||
public void cancel(FormSectionEvent e) throws FormProcessException {
|
||||
fireCancel(new FormSectionEvent(FormSection.this,
|
||||
e.getPageState(),
|
||||
e.getFormData()));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a validation listener, implementing a custom validation
|
||||
* check that applies to the form as a whole. Useful for checks
|
||||
|
|
@ -326,8 +340,7 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
* */
|
||||
public void addValidationListener(FormValidationListener listener) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Adding validation listener " + listener + " to " +
|
||||
this);
|
||||
s_log.debug("Adding validation listener " + listener + " to " + this);
|
||||
}
|
||||
|
||||
Assert.exists(listener, "FormValidationListener");
|
||||
|
|
@ -344,8 +357,8 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
*/
|
||||
public void removeValidationListener(FormValidationListener listener) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Removing validation listener " + listener + " from " +
|
||||
this);
|
||||
s_log.debug("Removing validation listener " + listener + " from "
|
||||
+ this);
|
||||
}
|
||||
|
||||
Assert.exists(listener, "Validation Listener");
|
||||
|
|
@ -362,8 +375,8 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
protected void fireValidate(FormSectionEvent e) {
|
||||
FormData data = e.getFormData();
|
||||
Assert.exists(data, "FormData");
|
||||
Iterator i = m_listeners.getListenerIterator(FormValidationListener
|
||||
.class);
|
||||
Iterator i = m_listeners.getListenerIterator(
|
||||
FormValidationListener.class);
|
||||
while (i.hasNext()) {
|
||||
try {
|
||||
final FormValidationListener listener =
|
||||
|
|
@ -375,12 +388,12 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
|
||||
listener.validate(e);
|
||||
} catch (FormProcessException fpe) {
|
||||
s_log.error(fpe);
|
||||
data.addError(fpe.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void forwardValidation() {
|
||||
if (m_forwardValidation == null) {
|
||||
m_forwardValidation = createValidationListener();
|
||||
|
|
@ -388,7 +401,6 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create the validation listener that forwards validation events to this
|
||||
* form section.
|
||||
|
|
@ -398,6 +410,7 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
*/
|
||||
protected FormValidationListener createValidationListener() {
|
||||
return new FormValidationListener() {
|
||||
|
||||
public void validate(FormSectionEvent e) {
|
||||
fireValidate(new FormSectionEvent(FormSection.this,
|
||||
e.getPageState(),
|
||||
|
|
@ -437,8 +450,8 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
*/
|
||||
public void removeProcessListener(FormProcessListener listener) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Removing process listener " + listener + " from " +
|
||||
this);
|
||||
s_log.debug("Removing process listener " + listener + " from "
|
||||
+ this);
|
||||
}
|
||||
|
||||
Assert.exists(listener, "Process Listener");
|
||||
|
|
@ -447,17 +460,16 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
m_listeners.remove(FormProcessListener.class, listener);
|
||||
}
|
||||
|
||||
|
||||
protected void forwardProcess() {
|
||||
if ( m_forwardProcess == null ) {
|
||||
if (m_forwardProcess == null) {
|
||||
m_forwardProcess = createProcessListener();
|
||||
getModel().addProcessListener(m_forwardProcess);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected FormProcessListener createProcessListener() {
|
||||
return new FormProcessListener() {
|
||||
|
||||
public void process(FormSectionEvent e)
|
||||
throws FormProcessException {
|
||||
fireProcess(new FormSectionEvent(FormSection.this,
|
||||
|
|
@ -529,8 +541,7 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
*/
|
||||
public void removeCancelListener(FormCancelListener listener) {
|
||||
if (s_log.isDebugEnabled()) {
|
||||
s_log.debug("Removing cancel listener " + listener + " from " +
|
||||
this);
|
||||
s_log.debug("Removing cancel listener " + listener + " from " + this);
|
||||
}
|
||||
|
||||
Assert.exists(listener, "Cancel Listener");
|
||||
|
|
@ -593,6 +604,7 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
m_panel.lock();
|
||||
super.lock();
|
||||
}
|
||||
|
||||
public void respond(PageState state) throws javax.servlet.ServletException {
|
||||
//call listeners here.
|
||||
throw new UnsupportedOperationException();
|
||||
|
|
@ -603,7 +615,7 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
*
|
||||
* This must not be final, because MetaFrom needs to override it.
|
||||
* */
|
||||
public Container getPanel(){
|
||||
public Container getPanel() {
|
||||
return m_panel;
|
||||
}
|
||||
|
||||
|
|
@ -630,13 +642,12 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
* @param parent the node that will be used to write to
|
||||
* */
|
||||
public void generateXML(PageState pageState, Element parent) {
|
||||
if ( isVisible(pageState) ) {
|
||||
if (isVisible(pageState)) {
|
||||
m_panel.generateXML(pageState, parent);
|
||||
}
|
||||
}
|
||||
|
||||
// Container methods
|
||||
|
||||
/**
|
||||
* Adds a component to this container.
|
||||
*
|
||||
|
|
@ -696,7 +707,7 @@ public class FormSection extends SimpleComponent implements Container {
|
|||
* @return the component at the specified position in this container
|
||||
* */
|
||||
public Component get(int index) {
|
||||
return (Component)m_panel.get(index);
|
||||
return (Component) m_panel.get(index);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.arsdigita.bebop.PageState;
|
|||
import com.arsdigita.bebop.event.FormInitListener;
|
||||
import com.arsdigita.bebop.event.FormProcessListener;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.form.Option;
|
||||
import com.arsdigita.bebop.form.RadioGroup;
|
||||
import com.arsdigita.bebop.parameters.BooleanParameter;
|
||||
|
|
@ -48,7 +49,8 @@ import org.apache.log4j.Logger;
|
|||
public class PublicationAuthorAddForm
|
||||
extends BasicItemForm
|
||||
implements FormProcessListener,
|
||||
FormInitListener {
|
||||
FormInitListener,
|
||||
FormSubmissionListener {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(
|
||||
PublicationAuthorAddForm.class);
|
||||
|
|
@ -58,7 +60,6 @@ public class PublicationAuthorAddForm
|
|||
private final String ITEM_SEARCH = "authors";
|
||||
private ItemSelectionModel m_itemModel;
|
||||
private SimpleEditStep editStep;
|
||||
|
||||
private Label selectedAuthorLabel;
|
||||
|
||||
public PublicationAuthorAddForm(ItemSelectionModel itemModel,
|
||||
|
|
@ -66,6 +67,7 @@ public class PublicationAuthorAddForm
|
|||
super("AuthorsEntryForm", itemModel);
|
||||
m_itemModel = itemModel;
|
||||
this.editStep = editStep;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -118,7 +120,7 @@ public class PublicationAuthorAddForm
|
|||
if (author == null) {
|
||||
s_log.warn("No author selected.");
|
||||
|
||||
// m_itemSearch.setVisible(state, true);
|
||||
m_itemSearch.setVisible(state, true);
|
||||
selectedAuthorLabel.setVisible(state, false);
|
||||
} else {
|
||||
s_log.warn(String.format("Author is here: %s", author.getFullName()));
|
||||
|
|
@ -169,9 +171,23 @@ public class PublicationAuthorAddForm
|
|||
null);
|
||||
((PublicationAuthorsPropertyStep) editStep).
|
||||
setSelectedAuthorEditor(null);
|
||||
|
||||
authors.close();
|
||||
}
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(
|
||||
fse.getPageState())) {
|
||||
((PublicationAuthorsPropertyStep) editStep).setSelectedAuthor(
|
||||
null);
|
||||
((PublicationAuthorsPropertyStep) editStep).setSelectedAuthorEditor(
|
||||
null);
|
||||
|
||||
init(fse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ import com.arsdigita.bebop.Label;
|
|||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SaveCancelSection;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||
import com.arsdigita.bebop.parameters.DateParameter;
|
||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||
import com.arsdigita.cms.ContentType;
|
||||
|
|
@ -43,7 +44,9 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SeriesEditshipAddForm extends BasicItemForm {
|
||||
public class SeriesEditshipAddForm
|
||||
extends BasicItemForm
|
||||
implements FormSubmissionListener {
|
||||
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(SeriesEditshipAddForm.class);
|
||||
|
|
@ -60,6 +63,7 @@ public class SeriesEditshipAddForm extends BasicItemForm {
|
|||
super("EditorsEntryForm", itemModel);
|
||||
m_itemModel = itemModel;
|
||||
this.editStep = editStep;
|
||||
addSubmissionListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -107,6 +111,7 @@ public class SeriesEditshipAddForm extends BasicItemForm {
|
|||
to = editStep.getSelectedEditorDateTo();
|
||||
|
||||
if (editor == null) {
|
||||
m_itemSearch.setVisible(state, true);
|
||||
selectedEditorLabel.setVisible(state, false);
|
||||
} else {
|
||||
data.put(ITEM_SEARCH, editor);
|
||||
|
|
@ -159,6 +164,18 @@ public class SeriesEditshipAddForm extends BasicItemForm {
|
|||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(
|
||||
fse.getPageState())) {
|
||||
editStep.setSelectedEditor(null);
|
||||
editStep.setSelectedEditorDateFrom(null);
|
||||
editStep.setSelectedEditorDateTo(null);
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import com.arsdigita.cms.ItemSelectionModel;
|
|||
import com.arsdigita.cms.SecurityManager;
|
||||
import com.arsdigita.cms.contenttypes.EditshipCollection;
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.contenttypes.Series;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
|
|
@ -57,13 +56,13 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
|
|||
//private final String TABLE_COL_UP = "table_col_up";
|
||||
//private final String TABLE_COL_DOWN = "table_col_down";
|
||||
private ItemSelectionModel m_itemModel;
|
||||
private SimpleEditStep editStep;
|
||||
private SeriesEditshipStep editStep;
|
||||
|
||||
public SeriesEditshipTable(ItemSelectionModel itemModel,
|
||||
SimpleEditStep editStep) {
|
||||
super();
|
||||
m_itemModel = itemModel;
|
||||
this.editStep = editStep;
|
||||
this.editStep = (SeriesEditshipStep)editStep;
|
||||
|
||||
setEmptyView(
|
||||
new Label(PublicationGlobalizationUtil.globalize(
|
||||
|
|
@ -373,9 +372,9 @@ public class SeriesEditshipTable extends Table implements TableActionListener {
|
|||
}
|
||||
}
|
||||
|
||||
((SeriesEditshipStep)editStep).setSelectedEditor(editor);
|
||||
((SeriesEditshipStep)editStep).setSelectedEditorDateFrom(editors.getFrom());
|
||||
((SeriesEditshipStep)editStep).setSelectedEditorDateTo(editors.getTo());
|
||||
editStep.setSelectedEditor(editor);
|
||||
editStep.setSelectedEditorDateFrom(editors.getFrom());
|
||||
editStep.setSelectedEditorDateTo(editors.getTo());
|
||||
|
||||
editors.close();
|
||||
|
||||
|
|
|
|||
|
|
@ -36,8 +36,9 @@ import com.arsdigita.cms.contenttypes.SciDepartment;
|
|||
public class SciDepartmentMemberAddForm
|
||||
extends GenericOrganizationalUnitPersonAddForm {
|
||||
|
||||
public SciDepartmentMemberAddForm(ItemSelectionModel itemModel) {
|
||||
super(itemModel);
|
||||
public SciDepartmentMemberAddForm(ItemSelectionModel itemModel,
|
||||
GenericOrganizationalUnitPersonSelector personSelector) {
|
||||
super(itemModel, personSelector);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
|
|
@ -30,9 +32,14 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
|||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciDepartmentMemberStep extends SimpleEditStep {
|
||||
public class SciDepartmentMemberStep
|
||||
extends SimpleEditStep
|
||||
implements GenericOrganizationalUnitPersonSelector {
|
||||
|
||||
private static final String ADD_MEMBER_SHEET_NAME = "addMember";
|
||||
private GenericPerson selectedPerson;
|
||||
private String selectedPersonRole;
|
||||
private String selectedPersonStatus;
|
||||
|
||||
public SciDepartmentMemberStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
|
|
@ -45,7 +52,8 @@ public class SciDepartmentMemberStep extends SimpleEditStep {
|
|||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm addMemberSheet =
|
||||
new SciDepartmentMemberAddForm(itemModel);
|
||||
new SciDepartmentMemberAddForm(itemModel,
|
||||
this);
|
||||
add(ADD_MEMBER_SHEET_NAME,
|
||||
(String) SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.add_member").localize(),
|
||||
|
|
@ -53,7 +61,36 @@ public class SciDepartmentMemberStep extends SimpleEditStep {
|
|||
addMemberSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
SciDepartmentMemberTable memberTable = new SciDepartmentMemberTable(
|
||||
itemModel);
|
||||
itemModel,
|
||||
this);
|
||||
setDisplayComponent(memberTable);
|
||||
}
|
||||
|
||||
public GenericPerson getSelectedPerson() {
|
||||
return selectedPerson;
|
||||
}
|
||||
|
||||
public void setSelectedPerson(final GenericPerson selectedPerson) {
|
||||
this.selectedPerson = selectedPerson;
|
||||
}
|
||||
|
||||
public String getSelectedPersonRole() {
|
||||
return selectedPersonRole;
|
||||
}
|
||||
|
||||
public void setSelectedPersonRole(final String selectedPersonRole) {
|
||||
this.selectedPersonRole = selectedPersonRole;
|
||||
}
|
||||
|
||||
public String getSelectedPersonStatus() {
|
||||
return selectedPersonStatus;
|
||||
}
|
||||
|
||||
public void setSelectedPersonStatus(final String selectedPersonStatus) {
|
||||
this.selectedPersonStatus = selectedPersonStatus;
|
||||
}
|
||||
|
||||
public void showEditComponent(PageState state) {
|
||||
showComponent(state, ADD_MEMBER_SHEET_NAME);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,13 +27,13 @@ import com.arsdigita.cms.ItemSelectionModel;
|
|||
*/
|
||||
public class SciDepartmentMemberTable extends GenericOrganizationalUnitPersonsTable {
|
||||
|
||||
public SciDepartmentMemberTable(ItemSelectionModel itemModel) {
|
||||
super(itemModel);
|
||||
public SciDepartmentMemberTable(ItemSelectionModel itemModel,
|
||||
GenericOrganizationalUnitPersonSelector personSelector) {
|
||||
super(itemModel, personSelector);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getRoleAttributeName() {
|
||||
return "SciDepartmentRole";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,9 +19,11 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.contenttypes.SciMember;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganization;
|
||||
|
||||
/**
|
||||
|
|
@ -38,8 +40,10 @@ import com.arsdigita.cms.contenttypes.SciOrganization;
|
|||
public class SciOrganizationMemberAddForm
|
||||
extends GenericOrganizationalUnitPersonAddForm {
|
||||
|
||||
public SciOrganizationMemberAddForm(ItemSelectionModel itemModel) {
|
||||
super(itemModel);
|
||||
public SciOrganizationMemberAddForm(
|
||||
ItemSelectionModel itemModel,
|
||||
GenericOrganizationalUnitPersonSelector personSelector) {
|
||||
super(itemModel, personSelector);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.contenttypes.SciMember;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganization;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
|
|
@ -35,9 +37,14 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
|||
* @see SciMember
|
||||
* @see SciOrganization
|
||||
*/
|
||||
public class SciOrganizationMemberStep extends SimpleEditStep {
|
||||
public class SciOrganizationMemberStep
|
||||
extends SimpleEditStep
|
||||
implements GenericOrganizationalUnitPersonSelector {
|
||||
|
||||
private static final String ADD_MEMBER_SHEET_NAME = "addMember";
|
||||
public static final String ADD_MEMBER_SHEET_NAME = "addMember";
|
||||
private GenericPerson selectedPerson;
|
||||
private String selectedPersonRole;
|
||||
private String selectedPersonStatus;
|
||||
|
||||
public SciOrganizationMemberStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
|
|
@ -50,7 +57,7 @@ public class SciOrganizationMemberStep extends SimpleEditStep {
|
|||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm addMemberSheet =
|
||||
new SciOrganizationMemberAddForm(itemModel);
|
||||
new SciOrganizationMemberAddForm(itemModel, this);
|
||||
add(ADD_MEMBER_SHEET_NAME,
|
||||
(String) SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.orgnization.add_member").localize(),
|
||||
|
|
@ -58,7 +65,35 @@ public class SciOrganizationMemberStep extends SimpleEditStep {
|
|||
addMemberSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
SciOrganizationMemberTable memberTable = new SciOrganizationMemberTable(
|
||||
itemModel);
|
||||
itemModel, this);
|
||||
setDisplayComponent(memberTable);
|
||||
}
|
||||
|
||||
public GenericPerson getSelectedPerson() {
|
||||
return selectedPerson;
|
||||
}
|
||||
|
||||
public void setSelectedPerson(final GenericPerson selectedPerson) {
|
||||
this.selectedPerson = selectedPerson;
|
||||
}
|
||||
|
||||
public String getSelectedPersonRole() {
|
||||
return selectedPersonRole;
|
||||
}
|
||||
|
||||
public void setSelectedPersonRole(final String selectedPersonRole) {
|
||||
this.selectedPersonRole = selectedPersonRole;
|
||||
}
|
||||
|
||||
public String getSelectedPersonStatus() {
|
||||
return selectedPersonStatus;
|
||||
}
|
||||
|
||||
public void setSelectedPersonStatus(final String selectedPersonStatus) {
|
||||
this.selectedPersonStatus = selectedPersonStatus;
|
||||
}
|
||||
|
||||
public void showEditComponent(final PageState state) {
|
||||
showComponent(state, ADD_MEMBER_SHEET_NAME);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,9 @@ import com.arsdigita.cms.ItemSelectionModel;
|
|||
*/
|
||||
public class SciOrganizationMemberTable extends GenericOrganizationalUnitPersonsTable {
|
||||
|
||||
public SciOrganizationMemberTable(ItemSelectionModel itemModel) {
|
||||
super(itemModel);
|
||||
public SciOrganizationMemberTable(ItemSelectionModel itemModel,
|
||||
GenericOrganizationalUnitPersonSelector personSelector) {
|
||||
super(itemModel, personSelector);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -32,8 +32,9 @@ public class SciProjectMemberAddForm
|
|||
extends GenericOrganizationalUnitPersonAddForm {
|
||||
|
||||
public SciProjectMemberAddForm(
|
||||
ItemSelectionModel itemModel) {
|
||||
super(itemModel);
|
||||
ItemSelectionModel itemModel,
|
||||
GenericOrganizationalUnitPersonSelector personSelector) {
|
||||
super(itemModel, personSelector);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@
|
|||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.contenttypes.SciProject;
|
||||
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
|
@ -31,9 +33,14 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
|||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class SciProjectMemberStep extends SimpleEditStep {
|
||||
public class SciProjectMemberStep
|
||||
extends SimpleEditStep
|
||||
implements GenericOrganizationalUnitPersonSelector {
|
||||
|
||||
private static final String ADD_MEMBER_SHEET_NAME = "addMember";
|
||||
private GenericPerson selectedPerson;
|
||||
private String selectedPersonRole;
|
||||
private String selectedPersonStatus;
|
||||
|
||||
public SciProjectMemberStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
|
|
@ -46,7 +53,8 @@ public class SciProjectMemberStep extends SimpleEditStep {
|
|||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm addMemberSheet =
|
||||
new SciProjectMemberAddForm(itemModel);
|
||||
new SciProjectMemberAddForm(itemModel,
|
||||
this);
|
||||
add(ADD_MEMBER_SHEET_NAME,
|
||||
(String) SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.add_member").localize(),
|
||||
|
|
@ -54,7 +62,35 @@ public class SciProjectMemberStep extends SimpleEditStep {
|
|||
addMemberSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
SciProjectMemberTable memberTable = new SciProjectMemberTable(
|
||||
itemModel);
|
||||
itemModel, this);
|
||||
setDisplayComponent(memberTable);
|
||||
}
|
||||
|
||||
public GenericPerson getSelectedPerson() {
|
||||
return selectedPerson;
|
||||
}
|
||||
|
||||
public void setSelectedPerson(final GenericPerson selectedPerson) {
|
||||
this.selectedPerson = selectedPerson;
|
||||
}
|
||||
|
||||
public String getSelectedPersonRole() {
|
||||
return selectedPersonRole;
|
||||
}
|
||||
|
||||
public void setSelectedPersonRole(final String selectedPersonRole) {
|
||||
this.selectedPersonRole = selectedPersonRole;
|
||||
}
|
||||
|
||||
public String getSelectedPersonStatus() {
|
||||
return selectedPersonStatus;
|
||||
}
|
||||
|
||||
public void setSelectedPersonStatus(final String selectedPersonStatus) {
|
||||
this.selectedPersonStatus = selectedPersonStatus;
|
||||
}
|
||||
|
||||
public void showEditComponent(PageState state) {
|
||||
showComponent(state, ADD_MEMBER_SHEET_NAME);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,8 +28,9 @@ import com.arsdigita.cms.ItemSelectionModel;
|
|||
public class SciProjectMemberTable
|
||||
extends GenericOrganizationalUnitPersonsTable {
|
||||
|
||||
public SciProjectMemberTable(ItemSelectionModel itemModel) {
|
||||
super(itemModel);
|
||||
public SciProjectMemberTable(ItemSelectionModel itemModel,
|
||||
GenericOrganizationalUnitPersonSelector personSelector) {
|
||||
super(itemModel, personSelector);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue