- Die Assoziation zwischen einer Publikation und einer Person (Autor) kann jetzt bearbeitet werden. Es können nur die zusätzlichen Attribute der Verknüpfung verändert werden, nicht das Ziel der
Verknüpfung (die verknüpfte Person). - Einige PropertySheets in sci-publications so angepasst, dass sie beim Verlag statt der OID den Namen des Verlages (= Titel des Content-Items) anzeigen. Leider ist es mit den Methoden von DomainObjectPropertySheet nicht möglich sowohl den Names als auch den Ort anzuzeigen. git-svn-id: https://svn.libreccm.org/ccm/trunk@751 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
44bf556993
commit
f53938ad94
|
|
@ -135,4 +135,5 @@ public class GenericOrganizationalUnit extends ContentPage {
|
|||
public boolean hasPersons() {
|
||||
return !this.getPersons().isEmpty();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ public class ExpertisePropertiesStep extends PublicationPropertiesStep {
|
|||
Expertise.PLACE);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.organization"),
|
||||
"organization.title"),
|
||||
Expertise.ORGANIZATION);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
|
|
@ -58,7 +58,7 @@ public class ExpertisePropertiesStep extends PublicationPropertiesStep {
|
|||
Expertise.NUMBER_OF_PAGES);
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.orderer"),
|
||||
"orderer.title"),
|
||||
Expertise.ORDERER);
|
||||
|
||||
return sheet;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class InternetArticlePropertiesStep extends PublicationPropertiesStep {
|
|||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.organization"),
|
||||
InternetArticle.ORGANIZATION);
|
||||
"organization.title");
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.number"),
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class ProceedingsPropertiesStep
|
|||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.organizer_of_conference"),
|
||||
Proceedings.ORGANIZER_OF_CONFERENCE);
|
||||
"organizerOfConference.title");
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.name_of_conference"),
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import com.arsdigita.cms.contenttypes.GenericPerson;
|
|||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
|
|
@ -56,10 +57,15 @@ public class PublicationAuthorAddForm
|
|||
//private SaveCancelSection m_saveCancelSection;
|
||||
private final String ITEM_SEARCH = "authors";
|
||||
private ItemSelectionModel m_itemModel;
|
||||
private SimpleEditStep editStep;
|
||||
|
||||
public PublicationAuthorAddForm(ItemSelectionModel itemModel) {
|
||||
private Label selectedAuthorLabel;
|
||||
|
||||
public PublicationAuthorAddForm(ItemSelectionModel itemModel,
|
||||
SimpleEditStep editStep) {
|
||||
super("AuthorsEntryForm", itemModel);
|
||||
m_itemModel = itemModel;
|
||||
this.editStep = editStep;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -72,6 +78,9 @@ public class PublicationAuthorAddForm
|
|||
getName()));
|
||||
add(m_itemSearch);
|
||||
|
||||
selectedAuthorLabel = new Label("");
|
||||
add(selectedAuthorLabel);
|
||||
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.author.is_editor").localize()));
|
||||
ParameterModel isEditorModel = new BooleanParameter(
|
||||
|
|
@ -99,6 +108,29 @@ public class PublicationAuthorAddForm
|
|||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
|
||||
GenericPerson author;
|
||||
Boolean editor;
|
||||
|
||||
author = ((PublicationAuthorsPropertyStep) editStep).getSelectedAuthor();
|
||||
editor = ((PublicationAuthorsPropertyStep) editStep).
|
||||
isSelectedAuthorEditor();
|
||||
|
||||
if (author == null) {
|
||||
s_log.warn("No author selected.");
|
||||
|
||||
m_itemSearch.setVisible(state, true);
|
||||
selectedAuthorLabel.setVisible(state, false);
|
||||
} else {
|
||||
s_log.warn(String.format("Author is here: %s", author.getFullName()));
|
||||
|
||||
data.put(ITEM_SEARCH, author);
|
||||
data.put(AuthorshipCollection.EDITOR, editor);
|
||||
|
||||
m_itemSearch.setVisible(state, false);
|
||||
selectedAuthorLabel.setLabel(author.getFullName(), state);
|
||||
selectedAuthorLabel.setVisible(state, true);
|
||||
}
|
||||
|
||||
setVisible(state, true);
|
||||
}
|
||||
|
||||
|
|
@ -111,9 +143,33 @@ public class PublicationAuthorAddForm
|
|||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
GenericPerson author;
|
||||
author = ((PublicationAuthorsPropertyStep) editStep).
|
||||
getSelectedAuthor();
|
||||
|
||||
if (author == null) {
|
||||
publication.addAuthor(
|
||||
(GenericPerson) data.get(ITEM_SEARCH),
|
||||
(Boolean) data.get(AuthorshipCollection.EDITOR));
|
||||
} else {
|
||||
AuthorshipCollection authors;
|
||||
|
||||
authors = publication.getAuthors();
|
||||
|
||||
while (authors.next()) {
|
||||
if (authors.getAuthor().equals(author)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
authors.setEditor(
|
||||
(Boolean) data.get(AuthorshipCollection.EDITOR));
|
||||
|
||||
((PublicationAuthorsPropertyStep) editStep).setSelectedAuthor(
|
||||
null);
|
||||
((PublicationAuthorsPropertyStep) editStep).
|
||||
setSelectedAuthorEditor(null);
|
||||
}
|
||||
}
|
||||
|
||||
init(fse);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
|||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -31,7 +32,10 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
|||
*/
|
||||
public class PublicationAuthorsPropertyStep extends SimpleEditStep {
|
||||
|
||||
private static final String ADD_AUTHOR_SHEET_NAME = "addAuthor";
|
||||
public static final String ADD_AUTHOR_SHEET_NAME = "addAuthor";
|
||||
|
||||
private GenericPerson selectedAuthor;
|
||||
private Boolean selectedAuthorEditor;
|
||||
|
||||
public PublicationAuthorsPropertyStep(ItemSelectionModel itemModel,
|
||||
AuthoringKitWizard parent) {
|
||||
|
|
@ -44,7 +48,7 @@ public class PublicationAuthorsPropertyStep extends SimpleEditStep {
|
|||
super(itemModel, parent, prefix);
|
||||
|
||||
BasicItemForm addAuthorSheet =
|
||||
new PublicationAuthorAddForm(itemModel);
|
||||
new PublicationAuthorAddForm(itemModel, this);
|
||||
add(ADD_AUTHOR_SHEET_NAME,
|
||||
(String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.add_author").localize(),
|
||||
|
|
@ -52,7 +56,23 @@ public class PublicationAuthorsPropertyStep extends SimpleEditStep {
|
|||
addAuthorSheet.getSaveCancelSection().getCancelButton());
|
||||
|
||||
PublicationAuthorsTable authorsTable = new PublicationAuthorsTable(
|
||||
itemModel);
|
||||
itemModel, this);
|
||||
setDisplayComponent(authorsTable);
|
||||
}
|
||||
|
||||
protected GenericPerson getSelectedAuthor() {
|
||||
return selectedAuthor;
|
||||
}
|
||||
|
||||
protected Boolean isSelectedAuthorEditor() {
|
||||
return selectedAuthorEditor;
|
||||
}
|
||||
|
||||
protected void setSelectedAuthor(GenericPerson selectedAuthor) {
|
||||
this.selectedAuthor = selectedAuthor;
|
||||
}
|
||||
|
||||
protected void setSelectedAuthorEditor(Boolean selectedAuthorEditor) {
|
||||
this.selectedAuthorEditor = selectedAuthorEditor;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import com.arsdigita.cms.contenttypes.AuthorshipCollection;
|
|||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -52,14 +53,22 @@ public class PublicationAuthorsTable
|
|||
private static final Logger s_log =
|
||||
Logger.getLogger(PublicationAuthorsTable.class);
|
||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||
private final String TABLE_COL_EDIT_ASSOC = "table_col_edit_assoc";
|
||||
private final String TABLE_COL_DEL = "table_col_del";
|
||||
private final String TABLE_COL_UP = "table_col_up";
|
||||
private final String TABLE_COL_DOWN = "table_col_down";
|
||||
public static final String SELECTED_PUBLICATION =
|
||||
"selected_publication_author_association_publication";
|
||||
public static final String SELECTED_AUTHOR =
|
||||
"selected_publication_author_association_author";
|
||||
private ItemSelectionModel m_itemModel;
|
||||
private SimpleEditStep editStep;
|
||||
|
||||
public PublicationAuthorsTable(ItemSelectionModel itemModel) {
|
||||
public PublicationAuthorsTable(ItemSelectionModel itemModel,
|
||||
SimpleEditStep editStep) {
|
||||
super();
|
||||
m_itemModel = itemModel;
|
||||
this.editStep = editStep;
|
||||
|
||||
setEmptyView(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.none")));
|
||||
|
|
@ -77,15 +86,20 @@ public class PublicationAuthorsTable
|
|||
colModel.add(new TableColumn(
|
||||
2,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.edit_assoc").localize(),
|
||||
TABLE_COL_EDIT_ASSOC));
|
||||
colModel.add(new TableColumn(
|
||||
3,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.author.delete").localize(),
|
||||
TABLE_COL_DEL));
|
||||
colModel.add(new TableColumn(
|
||||
3,
|
||||
4,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.author.up").localize(),
|
||||
TABLE_COL_UP));
|
||||
colModel.add(new TableColumn(
|
||||
4,
|
||||
5,
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.author.down").localize(),
|
||||
TABLE_COL_DOWN));
|
||||
|
|
@ -94,9 +108,10 @@ public class PublicationAuthorsTable
|
|||
new PublicationAuthorsTableModelBuilder(itemModel));
|
||||
|
||||
colModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||
colModel.get(2).setCellRenderer(new DeleteCellRenderer());
|
||||
colModel.get(3).setCellRenderer(new UpCellRenderer());
|
||||
colModel.get(4).setCellRenderer(new DownCellRenderer());
|
||||
colModel.get(2).setCellRenderer(new EditAssocCellRenderer());
|
||||
colModel.get(3).setCellRenderer(new DeleteCellRenderer());
|
||||
colModel.get(4).setCellRenderer(new UpCellRenderer());
|
||||
colModel.get(5).setCellRenderer(new DownCellRenderer());
|
||||
|
||||
s_log.info("Adding table action listener...");
|
||||
addTableActionListener(this);
|
||||
|
|
@ -164,7 +179,7 @@ public class PublicationAuthorsTable
|
|||
case 1:
|
||||
if (m_authorshipCollection.isEditor()) {
|
||||
return (String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.author.is_editor").
|
||||
"publications.ui.authors.author.is_editor_true").
|
||||
localize();
|
||||
} else {
|
||||
return PublicationGlobalizationUtil.globalize(
|
||||
|
|
@ -172,6 +187,9 @@ public class PublicationAuthorsTable
|
|||
localize();
|
||||
}
|
||||
case 2:
|
||||
return PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.edit_assoc").localize();
|
||||
case 3:
|
||||
return PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.author.remove").
|
||||
localize();
|
||||
|
|
@ -218,6 +236,38 @@ public class PublicationAuthorsTable
|
|||
}
|
||||
}
|
||||
|
||||
private class EditAssocCellRenderer
|
||||
extends LockableImpl
|
||||
implements TableCellRenderer {
|
||||
|
||||
@Override
|
||||
public Component getComponent(Table table,
|
||||
PageState state,
|
||||
Object value,
|
||||
boolean isSelected,
|
||||
Object key,
|
||||
int row,
|
||||
int col) {
|
||||
SecurityManager securityManager =
|
||||
Utilities.getSecurityManager(state);
|
||||
Publication publication = (Publication) m_itemModel.
|
||||
getSelectedObject(state);
|
||||
|
||||
boolean canEdit = securityManager.canAccess(
|
||||
state.getRequest(),
|
||||
SecurityManager.EDIT_ITEM,
|
||||
publication);
|
||||
|
||||
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 {
|
||||
|
|
@ -327,6 +377,23 @@ public class PublicationAuthorsTable
|
|||
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
||||
|
||||
if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
|
||||
} else if (column.getHeaderKey().toString().equals(
|
||||
TABLE_COL_EDIT_ASSOC)) {
|
||||
|
||||
while(authors.next()) {
|
||||
if (authors.getAuthor().equals(author)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
((PublicationAuthorsPropertyStep)editStep).setSelectedAuthor(author);
|
||||
((PublicationAuthorsPropertyStep)editStep).setSelectedAuthorEditor(
|
||||
authors.isEditor());
|
||||
|
||||
editStep.showComponent(state,
|
||||
PublicationAuthorsPropertyStep.ADD_AUTHOR_SHEET_NAME);
|
||||
|
||||
authors.close();
|
||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
|
||||
publication.removeAuthor(author);
|
||||
} else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) {
|
||||
|
|
|
|||
|
|
@ -271,3 +271,4 @@ publications.ui.inProceedings.proceedings.none=Not associated with a procedings
|
|||
publications.ui.inProceedings.proceedings.remove=Remove this association
|
||||
publications.ui.inProceedings.proceedings.confirm_remove=Do really want to remove this association
|
||||
publications.ui.series.name=Name (URL)
|
||||
publications.ui.authors.edit_assoc=Edit association
|
||||
|
|
|
|||
|
|
@ -270,3 +270,4 @@ publications.ui.inProceedings.proceedings.none=Derzeit mit keinem Tagungsband ve
|
|||
publications.ui.inProceedings.proceedings.remove=Verkn\u00fcpfung entfernen
|
||||
publications.ui.inProceedings.proceedings.confirm_remove=Wollen Sie diese Verkn\u00fcpfung wirklich entfernen
|
||||
publications.ui.series.name=Name (URL)
|
||||
publications.ui.authors.edit_assoc=Verkn\u00fcpfung bearbeiten
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class PublicationWithPublisherPropertiesStep
|
|||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.publisher"),
|
||||
PublicationWithPublisher.PUBLISHER);
|
||||
"publisher.title");
|
||||
|
||||
return sheet;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ public class UnPublishedPropertiesStep extends PublicationPropertiesStep {
|
|||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.organization"),
|
||||
UnPublished.ORGANIZATION);
|
||||
"organization.title");
|
||||
|
||||
sheet.add(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.number"),
|
||||
|
|
|
|||
Loading…
Reference in New Issue