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