Some small enhancements
git-svn-id: https://svn.libreccm.org/ccm/trunk@2761 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
e34ba310c8
commit
0ab4e576e6
|
|
@ -9,7 +9,7 @@
|
||||||
name="ScientificCMS"
|
name="ScientificCMS"
|
||||||
prettyName="Scientific CMS"
|
prettyName="Scientific CMS"
|
||||||
version="2.3.0"
|
version="2.3.0"
|
||||||
release="devel-SNAPSHOT-r2755"
|
release="devel-SNAPSHOT-r2758"
|
||||||
webxml="sci-web.xml"
|
webxml="sci-web.xml"
|
||||||
portletxml="sci-portlet.xml"
|
portletxml="sci-portlet.xml"
|
||||||
webapp="libreccm"
|
webapp="libreccm"
|
||||||
|
|
|
||||||
|
|
@ -889,7 +889,7 @@ span.cmsGlobalNavigationHelp :before {
|
||||||
content:url('../../images/cms/help.png');
|
content:url('../../images/cms/help.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
span.cmsPreview :before {
|
span.cmsPreview a:before {
|
||||||
content:url('../../images/cms/preview.png');
|
content:url('../../images/cms/preview.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,9 +89,10 @@ public class PublicationAuthorAddForm
|
||||||
add(selectedAuthorLabel);
|
add(selectedAuthorLabel);
|
||||||
|
|
||||||
isEditor = new CheckboxGroup("isEditorGroup");
|
isEditor = new CheckboxGroup("isEditorGroup");
|
||||||
isEditor.addOption(new Option(ISEDITOR, ""));
|
isEditor.addOption(new Option(ISEDITOR, new Label(PublicationGlobalizationUtil.globalize(
|
||||||
isEditor.setLabel(PublicationGlobalizationUtil.globalize(
|
"publications.ui.authors.author.is_editor"))));
|
||||||
"publications.ui.authors.author.is_editor"));
|
// isEditor.setLabel(PublicationGlobalizationUtil.globalize(
|
||||||
|
// "publications.ui.authors.author.is_editor"));
|
||||||
add(isEditor);
|
add(isEditor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,20 +51,18 @@ import org.apache.log4j.Logger;
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class PublicationAuthorsTable
|
public class PublicationAuthorsTable
|
||||||
extends Table
|
extends Table
|
||||||
implements TableActionListener {
|
implements TableActionListener {
|
||||||
|
|
||||||
private static final Logger s_log =
|
private static final Logger s_log = Logger.getLogger(PublicationAuthorsTable.class);
|
||||||
Logger.getLogger(PublicationAuthorsTable.class);
|
|
||||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
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_EDIT_ASSOC = "table_col_edit_assoc";
|
||||||
private final String TABLE_COL_DEL = "table_col_del";
|
private final String TABLE_COL_DEL = "table_col_del";
|
||||||
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";
|
||||||
public static final String SELECTED_PUBLICATION =
|
public static final String SELECTED_PUBLICATION
|
||||||
"selected_publication_author_association_publication";
|
= "selected_publication_author_association_publication";
|
||||||
public static final String SELECTED_AUTHOR =
|
public static final String SELECTED_AUTHOR = "selected_publication_author_association_author";
|
||||||
"selected_publication_author_association_author";
|
|
||||||
private ItemSelectionModel m_itemModel;
|
private ItemSelectionModel m_itemModel;
|
||||||
private SimpleEditStep editStep;
|
private SimpleEditStep editStep;
|
||||||
|
|
||||||
|
|
@ -75,41 +73,41 @@ public class PublicationAuthorsTable
|
||||||
this.editStep = editStep;
|
this.editStep = editStep;
|
||||||
|
|
||||||
setEmptyView(new Label(PublicationGlobalizationUtil.globalize(
|
setEmptyView(new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.none")));
|
"publications.ui.authors.none")));
|
||||||
|
|
||||||
TableColumnModel colModel = getColumnModel();
|
TableColumnModel colModel = getColumnModel();
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
0,
|
0,
|
||||||
PublicationGlobalizationUtil.globalize(
|
PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.author.name"),
|
"publications.ui.authors.author.name"),
|
||||||
TABLE_COL_EDIT));
|
TABLE_COL_EDIT));
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
1,
|
1,
|
||||||
PublicationGlobalizationUtil.globalize(
|
PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.author.isEditor")));
|
"publications.ui.authors.author.isEditor")));
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
2,
|
2,
|
||||||
PublicationGlobalizationUtil.globalize(
|
PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.edit_assoc"),
|
"publications.ui.authors.edit_assoc"),
|
||||||
TABLE_COL_EDIT_ASSOC));
|
TABLE_COL_EDIT_ASSOC));
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
3,
|
3,
|
||||||
PublicationGlobalizationUtil.globalize(
|
PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.author.delete"),
|
"publications.ui.authors.author.delete"),
|
||||||
TABLE_COL_DEL));
|
TABLE_COL_DEL));
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
4,
|
4,
|
||||||
PublicationGlobalizationUtil.globalize(
|
PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.author.up"),
|
"publications.ui.authors.author.up"),
|
||||||
TABLE_COL_UP));
|
TABLE_COL_UP));
|
||||||
colModel.add(new TableColumn(
|
colModel.add(new TableColumn(
|
||||||
5,
|
5,
|
||||||
PublicationGlobalizationUtil.globalize(
|
PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.author.down"),
|
"publications.ui.authors.author.down"),
|
||||||
TABLE_COL_DOWN));
|
TABLE_COL_DOWN));
|
||||||
|
|
||||||
setModelBuilder(
|
setModelBuilder(
|
||||||
new PublicationAuthorsTableModelBuilder(itemModel));
|
new PublicationAuthorsTableModelBuilder(itemModel));
|
||||||
|
|
||||||
colModel.get(0).setCellRenderer(new EditCellRenderer());
|
colModel.get(0).setCellRenderer(new EditCellRenderer());
|
||||||
colModel.get(2).setCellRenderer(new EditAssocCellRenderer());
|
colModel.get(2).setCellRenderer(new EditAssocCellRenderer());
|
||||||
|
|
@ -122,21 +120,20 @@ public class PublicationAuthorsTable
|
||||||
}
|
}
|
||||||
|
|
||||||
private class PublicationAuthorsTableModelBuilder
|
private class PublicationAuthorsTableModelBuilder
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableModelBuilder {
|
implements TableModelBuilder {
|
||||||
|
|
||||||
private ItemSelectionModel m_itemModel;
|
private ItemSelectionModel m_itemModel;
|
||||||
|
|
||||||
public PublicationAuthorsTableModelBuilder(
|
public PublicationAuthorsTableModelBuilder(
|
||||||
ItemSelectionModel itemModel) {
|
ItemSelectionModel itemModel) {
|
||||||
m_itemModel = itemModel;
|
m_itemModel = itemModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TableModel makeModel(Table table, PageState state) {
|
public TableModel makeModel(Table table, PageState state) {
|
||||||
table.getRowSelectionModel().clearSelection(state);
|
table.getRowSelectionModel().clearSelection(state);
|
||||||
Publication publication =
|
Publication publication = (Publication) m_itemModel.getSelectedObject(state);
|
||||||
(Publication) m_itemModel.getSelectedObject(state);
|
|
||||||
return new PublicationAuthorsTableModel(table, state, publication);
|
return new PublicationAuthorsTableModel(table, state, publication);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -166,7 +163,7 @@ public class PublicationAuthorsTable
|
||||||
boolean ret;
|
boolean ret;
|
||||||
|
|
||||||
if ((m_authorshipCollection != null)
|
if ((m_authorshipCollection != null)
|
||||||
&& m_authorshipCollection.next()) {
|
&& m_authorshipCollection.next()) {
|
||||||
m_author = m_authorshipCollection.getAuthor();
|
m_author = m_authorshipCollection.getAuthor();
|
||||||
ret = true;
|
ret = true;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -184,17 +181,17 @@ public class PublicationAuthorsTable
|
||||||
case 1:
|
case 1:
|
||||||
if (m_authorshipCollection.isEditor()) {
|
if (m_authorshipCollection.isEditor()) {
|
||||||
return new Label(PublicationGlobalizationUtil.globalize(
|
return new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.author.is_editor_true"));
|
"publications.ui.authors.author.is_editor_true"));
|
||||||
} else {
|
} else {
|
||||||
return new Label(PublicationGlobalizationUtil.globalize(
|
return new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.author.is_not_editor"));
|
"publications.ui.authors.author.is_not_editor"));
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
return new Label(PublicationGlobalizationUtil.globalize(
|
return new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.edit_assoc"));
|
"publications.ui.authors.edit_assoc"));
|
||||||
case 3:
|
case 3:
|
||||||
return new Label(PublicationGlobalizationUtil.globalize(
|
return new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.author.remove"));
|
"publications.ui.authors.author.remove"));
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -208,8 +205,8 @@ public class PublicationAuthorsTable
|
||||||
}
|
}
|
||||||
|
|
||||||
private class EditCellRenderer
|
private class EditCellRenderer
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableCellRenderer {
|
implements TableCellRenderer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getComponent(Table table,
|
public Component getComponent(Table table,
|
||||||
|
|
@ -219,15 +216,14 @@ public class PublicationAuthorsTable
|
||||||
Object key,
|
Object key,
|
||||||
int row,
|
int row,
|
||||||
int col) {
|
int col) {
|
||||||
SecurityManager securityManager =
|
SecurityManager securityManager = CMS.getSecurityManager(state);
|
||||||
CMS.getSecurityManager(state);
|
|
||||||
Publication publication = (Publication) m_itemModel.
|
Publication publication = (Publication) m_itemModel.
|
||||||
getSelectedObject(state);
|
getSelectedObject(state);
|
||||||
|
|
||||||
boolean canEdit = securityManager.canAccess(
|
boolean canEdit = securityManager.canAccess(
|
||||||
state.getRequest(),
|
state.getRequest(),
|
||||||
SecurityManager.EDIT_ITEM,
|
SecurityManager.EDIT_ITEM,
|
||||||
publication);
|
publication);
|
||||||
|
|
||||||
if (canEdit) {
|
if (canEdit) {
|
||||||
GenericPerson author;
|
GenericPerson author;
|
||||||
|
|
@ -239,7 +235,7 @@ public class PublicationAuthorsTable
|
||||||
ex);
|
ex);
|
||||||
if (value instanceof GlobalizedMessage) {
|
if (value instanceof GlobalizedMessage) {
|
||||||
return new Label((GlobalizedMessage) value);
|
return new Label((GlobalizedMessage) value);
|
||||||
} else if(value instanceof Label) {
|
} else if (value instanceof Label) {
|
||||||
return (Component) value;
|
return (Component) value;
|
||||||
} else {
|
} else {
|
||||||
return new Label(value.toString());
|
return new Label(value.toString());
|
||||||
|
|
@ -250,29 +246,25 @@ public class PublicationAuthorsTable
|
||||||
ItemResolver resolver = section.getItemResolver();
|
ItemResolver resolver = section.getItemResolver();
|
||||||
Link link;
|
Link link;
|
||||||
if (value instanceof GlobalizedMessage) {
|
if (value instanceof GlobalizedMessage) {
|
||||||
link =
|
link = new Link(new Label((GlobalizedMessage) value),
|
||||||
new Link(new Label((GlobalizedMessage) value),
|
resolver.generateItemURL(state,
|
||||||
resolver.generateItemURL(state,
|
author,
|
||||||
author,
|
section,
|
||||||
section,
|
author.getVersion()));
|
||||||
author.getVersion()));
|
} else if (value instanceof Label) {
|
||||||
} else if(value instanceof Label) {
|
link = new Link((Label) value,
|
||||||
link =
|
resolver.generateItemURL(state,
|
||||||
new Link((Label) value,
|
author,
|
||||||
resolver.generateItemURL(state,
|
section,
|
||||||
author,
|
author.getVersion()));
|
||||||
section,
|
|
||||||
author.getVersion()));
|
|
||||||
} else {
|
} else {
|
||||||
link =
|
link = new Link(value.toString(),
|
||||||
new Link(value.toString(),
|
resolver.generateItemURL(state,
|
||||||
resolver.generateItemURL(state,
|
author,
|
||||||
author,
|
section,
|
||||||
section,
|
author.getVersion()));
|
||||||
author.getVersion()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return link;
|
return link;
|
||||||
} else {
|
} else {
|
||||||
GenericPerson author;
|
GenericPerson author;
|
||||||
|
|
@ -293,8 +285,8 @@ public class PublicationAuthorsTable
|
||||||
}
|
}
|
||||||
|
|
||||||
private class EditAssocCellRenderer
|
private class EditAssocCellRenderer
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableCellRenderer {
|
implements TableCellRenderer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getComponent(Table table,
|
public Component getComponent(Table table,
|
||||||
|
|
@ -304,30 +296,28 @@ public class PublicationAuthorsTable
|
||||||
Object key,
|
Object key,
|
||||||
int row,
|
int row,
|
||||||
int col) {
|
int col) {
|
||||||
SecurityManager securityManager =
|
SecurityManager securityManager = CMS.getSecurityManager(state);
|
||||||
CMS.getSecurityManager(state);
|
|
||||||
Publication publication = (Publication) m_itemModel.
|
Publication publication = (Publication) m_itemModel.
|
||||||
getSelectedObject(state);
|
getSelectedObject(state);
|
||||||
|
|
||||||
boolean canEdit = securityManager.canAccess(
|
boolean canEdit = securityManager.canAccess(
|
||||||
state.getRequest(),
|
state.getRequest(),
|
||||||
SecurityManager.EDIT_ITEM,
|
SecurityManager.EDIT_ITEM,
|
||||||
publication);
|
publication);
|
||||||
|
|
||||||
if (canEdit) {
|
if (canEdit) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
ControlLink link = new ControlLink((Label) value);
|
||||||
return link;
|
return link;
|
||||||
} else {
|
} else {
|
||||||
Label label = new Label(value.toString());
|
return (Label) value;
|
||||||
return label;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DeleteCellRenderer
|
private class DeleteCellRenderer
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableCellRenderer {
|
implements TableCellRenderer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getComponent(Table table,
|
public Component getComponent(Table table,
|
||||||
|
|
@ -337,42 +327,40 @@ public class PublicationAuthorsTable
|
||||||
Object key,
|
Object key,
|
||||||
int row,
|
int row,
|
||||||
int col) {
|
int col) {
|
||||||
SecurityManager securityManager =
|
SecurityManager securityManager = CMS.getSecurityManager(state);
|
||||||
CMS.getSecurityManager(state);
|
|
||||||
Publication publication = (Publication) m_itemModel.
|
Publication publication = (Publication) m_itemModel.
|
||||||
getSelectedObject(state);
|
getSelectedObject(state);
|
||||||
|
|
||||||
boolean canDelete = securityManager.canAccess(
|
boolean canDelete = securityManager.canAccess(
|
||||||
state.getRequest(),
|
state.getRequest(),
|
||||||
SecurityManager.DELETE_ITEM,
|
SecurityManager.DELETE_ITEM,
|
||||||
publication);
|
publication);
|
||||||
|
|
||||||
if (canDelete) {
|
if (canDelete) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
ControlLink link = new ControlLink((Label) value);
|
||||||
link.setConfirmation(PublicationGlobalizationUtil.globalize(
|
link.setConfirmation(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.author.confirm_remove"));
|
"publications.ui.authors.author.confirm_remove"));
|
||||||
return link;
|
return link;
|
||||||
} else {
|
} else {
|
||||||
Label label = new Label(value.toString());
|
return (Label) value;
|
||||||
return label;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private class UpCellRenderer
|
private class UpCellRenderer
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableCellRenderer {
|
implements TableCellRenderer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getComponent(
|
public Component getComponent(
|
||||||
Table table,
|
Table table,
|
||||||
PageState state,
|
PageState state,
|
||||||
Object value,
|
Object value,
|
||||||
boolean isSelected,
|
boolean isSelected,
|
||||||
Object key,
|
Object key,
|
||||||
int row,
|
int row,
|
||||||
int col) {
|
int col) {
|
||||||
|
|
||||||
if (0 == row) {
|
if (0 == row) {
|
||||||
s_log.debug("Row is first row in table, don't show up link");
|
s_log.debug("Row is first row in table, don't show up link");
|
||||||
|
|
@ -387,25 +375,25 @@ public class PublicationAuthorsTable
|
||||||
}
|
}
|
||||||
|
|
||||||
private class DownCellRenderer
|
private class DownCellRenderer
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableCellRenderer {
|
implements TableCellRenderer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Component getComponent(
|
public Component getComponent(
|
||||||
Table table,
|
Table table,
|
||||||
PageState state,
|
PageState state,
|
||||||
Object value,
|
Object value,
|
||||||
boolean isSelected,
|
boolean isSelected,
|
||||||
Object key,
|
Object key,
|
||||||
int row,
|
int row,
|
||||||
int col) {
|
int col) {
|
||||||
|
|
||||||
Publication publication = (Publication) m_itemModel.
|
Publication publication = (Publication) m_itemModel.
|
||||||
getSelectedObject(state);
|
getSelectedObject(state);
|
||||||
AuthorshipCollection authors = publication.getAuthors();
|
AuthorshipCollection authors = publication.getAuthors();
|
||||||
|
|
||||||
if ((authors.size() - 1)
|
if ((authors.size() - 1)
|
||||||
== row) {
|
== row) {
|
||||||
s_log.debug("Row is last row in table, don't show down link");
|
s_log.debug("Row is last row in table, don't show down link");
|
||||||
Label label = new Label();
|
Label label = new Label();
|
||||||
return label;
|
return label;
|
||||||
|
|
@ -443,7 +431,7 @@ public class PublicationAuthorsTable
|
||||||
|
|
||||||
((PublicationAuthorsPropertyStep) editStep).setSelectedAuthor(author);
|
((PublicationAuthorsPropertyStep) editStep).setSelectedAuthor(author);
|
||||||
((PublicationAuthorsPropertyStep) editStep).setSelectedAuthorEditor(
|
((PublicationAuthorsPropertyStep) editStep).setSelectedAuthorEditor(
|
||||||
authors.isEditor());
|
authors.isEditor());
|
||||||
|
|
||||||
editStep.showComponent(state,
|
editStep.showComponent(state,
|
||||||
PublicationAuthorsPropertyStep.ADD_AUTHOR_SHEET_NAME);
|
PublicationAuthorsPropertyStep.ADD_AUTHOR_SHEET_NAME);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue