Die OptionBox Gruppe für das festlegen der Herausgeber-Eigenschaft wurde durch eine Checkbox ersetzt.
git-svn-id: https://svn.libreccm.org/ccm/trunk@844 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
5c3f540390
commit
64191ad918
|
|
@ -27,11 +27,8 @@ 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.event.FormSubmissionListener;
|
||||||
|
import com.arsdigita.bebop.form.CheckboxGroup;
|
||||||
import com.arsdigita.bebop.form.Option;
|
import com.arsdigita.bebop.form.Option;
|
||||||
import com.arsdigita.bebop.form.RadioGroup;
|
|
||||||
import com.arsdigita.bebop.parameters.BooleanParameter;
|
|
||||||
import com.arsdigita.bebop.parameters.NotNullValidationListener;
|
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.contenttypes.AuthorshipCollection;
|
import com.arsdigita.cms.contenttypes.AuthorshipCollection;
|
||||||
|
|
@ -56,11 +53,12 @@ public class PublicationAuthorAddForm
|
||||||
PublicationAuthorAddForm.class);
|
PublicationAuthorAddForm.class);
|
||||||
private PublicationPropertiesStep m_step;
|
private PublicationPropertiesStep m_step;
|
||||||
private ItemSearchWidget m_itemSearch;
|
private ItemSearchWidget m_itemSearch;
|
||||||
//private SaveCancelSection m_saveCancelSection;
|
|
||||||
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;
|
||||||
|
private static final String ISEDITOR = "isEditor";
|
||||||
|
private CheckboxGroup isEditor;
|
||||||
|
|
||||||
public PublicationAuthorAddForm(ItemSelectionModel itemModel,
|
public PublicationAuthorAddForm(ItemSelectionModel itemModel,
|
||||||
SimpleEditStep editStep) {
|
SimpleEditStep editStep) {
|
||||||
|
|
@ -85,24 +83,9 @@ public class PublicationAuthorAddForm
|
||||||
|
|
||||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.author.is_editor").localize()));
|
"publications.ui.authors.author.is_editor").localize()));
|
||||||
ParameterModel isEditorModel = new BooleanParameter(
|
isEditor = new CheckboxGroup("isEditorGroup");
|
||||||
AuthorshipCollection.EDITOR);
|
isEditor.addOption(new Option(ISEDITOR, ""));
|
||||||
RadioGroup isEditorGroup = new RadioGroup(isEditorModel);
|
add(isEditor);
|
||||||
isEditorGroup.addValidationListener(new NotNullValidationListener());
|
|
||||||
isEditorGroup.setMetaDataAttribute(
|
|
||||||
"label",
|
|
||||||
(String) PublicationGlobalizationUtil.globalize(
|
|
||||||
"publications.ui.authors.author.is_editor_label").
|
|
||||||
localize());
|
|
||||||
isEditorGroup.addOption(
|
|
||||||
new Option(Boolean.FALSE.toString(),
|
|
||||||
(String) PublicationGlobalizationUtil.globalize(
|
|
||||||
"publications.ui.authors.author.is_editor_false").localize()));
|
|
||||||
isEditorGroup.addOption(
|
|
||||||
new Option(Boolean.TRUE.toString(),
|
|
||||||
(String) PublicationGlobalizationUtil.globalize(
|
|
||||||
"publications.ui.authors.author.is_editor_true").localize()));
|
|
||||||
add(isEditorGroup);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -126,7 +109,12 @@ public class PublicationAuthorAddForm
|
||||||
s_log.warn(String.format("Author is here: %s", author.getFullName()));
|
s_log.warn(String.format("Author is here: %s", author.getFullName()));
|
||||||
|
|
||||||
data.put(ITEM_SEARCH, author);
|
data.put(ITEM_SEARCH, author);
|
||||||
data.put(AuthorshipCollection.EDITOR, editor);
|
//data.put(AuthorshipCollection.EDITOR, editor);
|
||||||
|
if ((editor != null) && editor) {
|
||||||
|
isEditor.setValue(state, new String[]{ISEDITOR});
|
||||||
|
} else {
|
||||||
|
isEditor.setValue(state, null);
|
||||||
|
}
|
||||||
|
|
||||||
m_itemSearch.setVisible(state, false);
|
m_itemSearch.setVisible(state, false);
|
||||||
selectedAuthorLabel.setLabel(author.getFullName(), state);
|
selectedAuthorLabel.setLabel(author.getFullName(), state);
|
||||||
|
|
@ -149,10 +137,18 @@ public class PublicationAuthorAddForm
|
||||||
author = ((PublicationAuthorsPropertyStep) editStep).
|
author = ((PublicationAuthorsPropertyStep) editStep).
|
||||||
getSelectedAuthor();
|
getSelectedAuthor();
|
||||||
|
|
||||||
|
Boolean editor;
|
||||||
|
|
||||||
|
if (isEditor.getValue(state) == null) {
|
||||||
|
editor = Boolean.FALSE;
|
||||||
|
} else {
|
||||||
|
editor = Boolean.TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (author == null) {
|
if (author == null) {
|
||||||
publication.addAuthor(
|
publication.addAuthor(
|
||||||
(GenericPerson) data.get(ITEM_SEARCH),
|
(GenericPerson) data.get(ITEM_SEARCH),
|
||||||
(Boolean) data.get(AuthorshipCollection.EDITOR));
|
editor);
|
||||||
} else {
|
} else {
|
||||||
AuthorshipCollection authors;
|
AuthorshipCollection authors;
|
||||||
|
|
||||||
|
|
@ -164,8 +160,7 @@ public class PublicationAuthorAddForm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
authors.setEditor(
|
authors.setEditor(editor);
|
||||||
(Boolean) data.get(AuthorshipCollection.EDITOR));
|
|
||||||
|
|
||||||
((PublicationAuthorsPropertyStep) editStep).setSelectedAuthor(
|
((PublicationAuthorsPropertyStep) editStep).setSelectedAuthor(
|
||||||
null);
|
null);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue