sci-types-organization: Bearbeiten-Links in Tabellen ergänzt.
git-svn-id: https://svn.libreccm.org/ccm/trunk@611 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
66cf0be88c
commit
24f0131056
|
|
@ -24,6 +24,7 @@ import java.math.BigDecimal;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.ControlLink;
|
import com.arsdigita.bebop.ControlLink;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.bebop.Link;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.Table;
|
import com.arsdigita.bebop.Table;
|
||||||
import com.arsdigita.bebop.event.TableActionEvent;
|
import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
|
|
@ -33,13 +34,18 @@ import com.arsdigita.bebop.table.TableColumn;
|
||||||
import com.arsdigita.bebop.table.TableColumnModel;
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
import com.arsdigita.bebop.table.TableModel;
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
|
import com.arsdigita.cms.CMS;
|
||||||
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.contenttypes.SciDepartment;
|
import com.arsdigita.cms.contenttypes.SciDepartment;
|
||||||
import com.arsdigita.cms.contenttypes.SciDepartmentProjectsCollection;
|
import com.arsdigita.cms.contenttypes.SciDepartmentProjectsCollection;
|
||||||
import com.arsdigita.cms.contenttypes.SciProject;
|
import com.arsdigita.cms.contenttypes.SciProject;
|
||||||
|
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
|
import com.arsdigita.dispatcher.ObjectNotFoundException;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table for showing all {@link SciProject}s linked with a {@link SciDepartment}
|
* Table for showing all {@link SciProject}s linked with a {@link SciDepartment}
|
||||||
|
|
@ -52,6 +58,8 @@ public class SciDepartmentProjectsTable
|
||||||
extends Table
|
extends Table
|
||||||
implements TableActionListener {
|
implements TableActionListener {
|
||||||
|
|
||||||
|
private final Logger s_log = Logger.getLogger(
|
||||||
|
SciDepartmentProjectsTable.class);
|
||||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||||
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";
|
||||||
|
|
@ -205,7 +213,25 @@ public class SciDepartmentProjectsTable
|
||||||
department);
|
department);
|
||||||
|
|
||||||
if (canEdit) {
|
if (canEdit) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
SciProject project;
|
||||||
|
try {
|
||||||
|
project = new SciProject((BigDecimal) key);
|
||||||
|
} catch (ObjectNotFoundException ex) {
|
||||||
|
s_log.warn(String.format("No object with key '%s' found.",
|
||||||
|
key),
|
||||||
|
ex);
|
||||||
|
return new Label(value.toString());
|
||||||
|
|
||||||
|
}
|
||||||
|
ContentSection section = CMS.getContext().getContentSection();
|
||||||
|
ItemResolver resolver = section.getItemResolver();
|
||||||
|
Link link =
|
||||||
|
new Link(value.toString(),
|
||||||
|
resolver.generateItemURL(state,
|
||||||
|
project,
|
||||||
|
section,
|
||||||
|
project.getVersion()));
|
||||||
|
|
||||||
return link;
|
return link;
|
||||||
} else {
|
} else {
|
||||||
Label label = new Label(value.toString());
|
Label label = new Label(value.toString());
|
||||||
|
|
@ -292,7 +318,8 @@ public class SciDepartmentProjectsTable
|
||||||
int row,
|
int row,
|
||||||
int col) {
|
int col) {
|
||||||
|
|
||||||
SciDepartment department = (SciDepartment) m_itemModel.getSelectedObject(
|
SciDepartment department = (SciDepartment) m_itemModel.
|
||||||
|
getSelectedObject(
|
||||||
state);
|
state);
|
||||||
SciDepartmentProjectsCollection projects =
|
SciDepartmentProjectsCollection projects =
|
||||||
department.getProjects();
|
department.getProjects();
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ package com.arsdigita.cms.contenttypes.ui;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.ControlLink;
|
import com.arsdigita.bebop.ControlLink;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.bebop.Link;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.Table;
|
import com.arsdigita.bebop.Table;
|
||||||
import com.arsdigita.bebop.event.TableActionEvent;
|
import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
|
|
@ -31,13 +32,18 @@ import com.arsdigita.bebop.table.TableColumn;
|
||||||
import com.arsdigita.bebop.table.TableColumnModel;
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
import com.arsdigita.bebop.table.TableModel;
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
|
import com.arsdigita.cms.CMS;
|
||||||
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.contenttypes.SciDepartment;
|
import com.arsdigita.cms.contenttypes.SciDepartment;
|
||||||
import com.arsdigita.cms.contenttypes.SciDepartmentSubDepartmentsCollection;
|
import com.arsdigita.cms.contenttypes.SciDepartmentSubDepartmentsCollection;
|
||||||
|
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
|
import com.arsdigita.dispatcher.ObjectNotFoundException;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table for showing the subdepartments of a {@link SciDepartment}.
|
* Table for showing the subdepartments of a {@link SciDepartment}.
|
||||||
|
|
@ -49,6 +55,8 @@ public class SciDepartmentSubDepartmentsTable
|
||||||
extends Table
|
extends Table
|
||||||
implements TableActionListener {
|
implements TableActionListener {
|
||||||
|
|
||||||
|
private final Logger s_log = Logger.getLogger(
|
||||||
|
SciDepartmentSubDepartmentsTable.class);
|
||||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||||
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";
|
||||||
|
|
@ -202,8 +210,29 @@ public class SciDepartmentSubDepartmentsTable
|
||||||
department);
|
department);
|
||||||
|
|
||||||
if (canEdit) {
|
if (canEdit) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
SciDepartment subDepartment;
|
||||||
|
try {
|
||||||
|
subDepartment = new SciDepartment(
|
||||||
|
(BigDecimal) key);
|
||||||
|
} catch (ObjectNotFoundException ex) {
|
||||||
|
s_log.warn(String.format("No object with key '%s' found.",
|
||||||
|
key),
|
||||||
|
ex);
|
||||||
|
return new Label(value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
ContentSection section = CMS.getContext().getContentSection();
|
||||||
|
ItemResolver resolver = section.getItemResolver();
|
||||||
|
Link link = new Link(value.toString(),
|
||||||
|
resolver.generateItemURL(state,
|
||||||
|
subDepartment,
|
||||||
|
section,
|
||||||
|
subDepartment.
|
||||||
|
getVersion()));
|
||||||
|
|
||||||
return link;
|
return link;
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Label label = new Label(value.toString());
|
Label label = new Label(value.toString());
|
||||||
return label;
|
return label;
|
||||||
|
|
@ -292,7 +321,7 @@ public class SciDepartmentSubDepartmentsTable
|
||||||
SciDepartment department = (SciDepartment) m_itemModel.
|
SciDepartment department = (SciDepartment) m_itemModel.
|
||||||
getSelectedObject(state);
|
getSelectedObject(state);
|
||||||
SciDepartmentSubDepartmentsCollection subDepartments =
|
SciDepartmentSubDepartmentsCollection subDepartments =
|
||||||
department.getSubDepartments();
|
department.getSubDepartments();
|
||||||
|
|
||||||
if ((subDepartments.size() - 1) == row) {
|
if ((subDepartments.size() - 1) == row) {
|
||||||
Label label = new Label("");
|
Label label = new Label("");
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ package com.arsdigita.cms.contenttypes.ui;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.ControlLink;
|
import com.arsdigita.bebop.ControlLink;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.bebop.Link;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.Table;
|
import com.arsdigita.bebop.Table;
|
||||||
import com.arsdigita.bebop.event.TableActionEvent;
|
import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
|
|
@ -31,14 +32,19 @@ import com.arsdigita.bebop.table.TableColumn;
|
||||||
import com.arsdigita.bebop.table.TableColumnModel;
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
import com.arsdigita.bebop.table.TableModel;
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
|
import com.arsdigita.cms.CMS;
|
||||||
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.contenttypes.SciDepartment;
|
import com.arsdigita.cms.contenttypes.SciDepartment;
|
||||||
import com.arsdigita.cms.contenttypes.SciOrganization;
|
import com.arsdigita.cms.contenttypes.SciOrganization;
|
||||||
import com.arsdigita.cms.contenttypes.SciOrganizationDepartmentsCollection;
|
import com.arsdigita.cms.contenttypes.SciOrganizationDepartmentsCollection;
|
||||||
|
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
|
import com.arsdigita.dispatcher.ObjectNotFoundException;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table for showing the {@link SciDepartment}s linked to a
|
* Table for showing the {@link SciDepartment}s linked to a
|
||||||
|
|
@ -52,6 +58,8 @@ public class SciOrganizationDepartmentsTable
|
||||||
extends Table
|
extends Table
|
||||||
implements TableActionListener {
|
implements TableActionListener {
|
||||||
|
|
||||||
|
private final Logger s_log = Logger.getLogger(
|
||||||
|
SciOrganizationDepartmentsTable.class);
|
||||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||||
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";
|
||||||
|
|
@ -205,8 +213,28 @@ public class SciOrganizationDepartmentsTable
|
||||||
orga);
|
orga);
|
||||||
|
|
||||||
if (canEdit) {
|
if (canEdit) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
SciDepartment department;
|
||||||
|
try {
|
||||||
|
department = new SciDepartment((BigDecimal) key);
|
||||||
|
} catch (ObjectNotFoundException ex) {
|
||||||
|
s_log.warn(String.format("No object with key '%s' found.",
|
||||||
|
key),
|
||||||
|
ex);
|
||||||
|
return new Label(value.toString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ContentSection section = CMS.getContext().getContentSection();
|
||||||
|
ItemResolver resolver = section.getItemResolver();
|
||||||
|
Link link = new Link(value.toString(),
|
||||||
|
resolver.generateItemURL(state,
|
||||||
|
department,
|
||||||
|
section,
|
||||||
|
department.
|
||||||
|
getVersion()));
|
||||||
|
|
||||||
return link;
|
return link;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Label label = new Label(value.toString());
|
Label label = new Label(value.toString());
|
||||||
return label;
|
return label;
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import java.math.BigDecimal;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.ControlLink;
|
import com.arsdigita.bebop.ControlLink;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.bebop.Link;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.Table;
|
import com.arsdigita.bebop.Table;
|
||||||
import com.arsdigita.bebop.event.TableActionEvent;
|
import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
|
|
@ -33,13 +34,18 @@ import com.arsdigita.bebop.table.TableColumn;
|
||||||
import com.arsdigita.bebop.table.TableColumnModel;
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
import com.arsdigita.bebop.table.TableModel;
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
|
import com.arsdigita.cms.CMS;
|
||||||
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.contenttypes.SciOrganization;
|
import com.arsdigita.cms.contenttypes.SciOrganization;
|
||||||
import com.arsdigita.cms.contenttypes.SciOrganizationProjectsCollection;
|
import com.arsdigita.cms.contenttypes.SciOrganizationProjectsCollection;
|
||||||
import com.arsdigita.cms.contenttypes.SciProject;
|
import com.arsdigita.cms.contenttypes.SciProject;
|
||||||
|
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
|
import com.arsdigita.dispatcher.ObjectNotFoundException;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table for showing the links between a {@link SciOrganization} and
|
* Table for showing the links between a {@link SciOrganization} and
|
||||||
|
|
@ -53,6 +59,8 @@ public class SciOrganizationProjectsTable
|
||||||
extends Table
|
extends Table
|
||||||
implements TableActionListener {
|
implements TableActionListener {
|
||||||
|
|
||||||
|
private final Logger s_log = Logger.getLogger(
|
||||||
|
SciOrganizationProjectsTable.class);
|
||||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||||
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";
|
||||||
|
|
@ -206,8 +214,26 @@ public class SciOrganizationProjectsTable
|
||||||
orga);
|
orga);
|
||||||
|
|
||||||
if (canEdit) {
|
if (canEdit) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
SciProject project;
|
||||||
|
try {
|
||||||
|
project = new SciProject((BigDecimal) key);
|
||||||
|
} catch (ObjectNotFoundException ex) {
|
||||||
|
s_log.warn(String.format("No object with key '%s' found.",
|
||||||
|
key),
|
||||||
|
ex);
|
||||||
|
return new Label(value.toString());
|
||||||
|
}
|
||||||
|
ContentSection section = CMS.getContext().getContentSection();
|
||||||
|
ItemResolver resolver = section.getItemResolver();
|
||||||
|
Link link =
|
||||||
|
new Link(value.toString(),
|
||||||
|
resolver.generateItemURL(state,
|
||||||
|
project,
|
||||||
|
section,
|
||||||
|
project.getVersion()));
|
||||||
|
|
||||||
return link;
|
return link;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Label label = new Label(value.toString());
|
Label label = new Label(value.toString());
|
||||||
return label;
|
return label;
|
||||||
|
|
@ -293,10 +319,9 @@ public class SciOrganizationProjectsTable
|
||||||
int row,
|
int row,
|
||||||
int col) {
|
int col) {
|
||||||
|
|
||||||
SciOrganization orga = (SciOrganization) m_itemModel.
|
SciOrganization orga = (SciOrganization) m_itemModel.
|
||||||
getSelectedObject(state);
|
getSelectedObject(state);
|
||||||
SciOrganizationProjectsCollection projects = orga.
|
SciOrganizationProjectsCollection projects = orga.getProjects();
|
||||||
getProjects();
|
|
||||||
|
|
||||||
if ((projects.size() - 1) == row) {
|
if ((projects.size() - 1) == row) {
|
||||||
Label label = new Label("");
|
Label label = new Label("");
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ package com.arsdigita.cms.contenttypes.ui;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.ControlLink;
|
import com.arsdigita.bebop.ControlLink;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.bebop.Link;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.Table;
|
import com.arsdigita.bebop.Table;
|
||||||
import com.arsdigita.bebop.event.TableActionEvent;
|
import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
|
|
@ -31,14 +32,19 @@ import com.arsdigita.bebop.table.TableColumn;
|
||||||
import com.arsdigita.bebop.table.TableColumnModel;
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
import com.arsdigita.bebop.table.TableModel;
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
|
import com.arsdigita.cms.CMS;
|
||||||
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.contenttypes.SciDepartment;
|
import com.arsdigita.cms.contenttypes.SciDepartment;
|
||||||
import com.arsdigita.cms.contenttypes.SciProject;
|
import com.arsdigita.cms.contenttypes.SciProject;
|
||||||
import com.arsdigita.cms.contenttypes.SciProjectDepartmentsCollection;
|
import com.arsdigita.cms.contenttypes.SciProjectDepartmentsCollection;
|
||||||
|
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table for showing the links between a {@link SciProject} and a
|
* Table for showing the links between a {@link SciProject} and a
|
||||||
|
|
@ -50,6 +56,8 @@ public class SciProjectDepartmentsTable
|
||||||
extends Table
|
extends Table
|
||||||
implements TableActionListener {
|
implements TableActionListener {
|
||||||
|
|
||||||
|
private final static Logger s_log = Logger.getLogger(
|
||||||
|
SciProjectDepartmentsTable.class);
|
||||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||||
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";
|
||||||
|
|
@ -190,8 +198,39 @@ public class SciProjectDepartmentsTable
|
||||||
Object key,
|
Object key,
|
||||||
int row,
|
int row,
|
||||||
int column) {
|
int column) {
|
||||||
Label label = new Label(value.toString());
|
com.arsdigita.cms.SecurityManager securityManager = Utilities.
|
||||||
return label;
|
getSecurityManager(state);
|
||||||
|
SciProject project = (SciProject) m_itemModel.getSelectedObject(
|
||||||
|
state);
|
||||||
|
|
||||||
|
boolean canEdit = securityManager.canAccess(state.getRequest(),
|
||||||
|
com.arsdigita.cms.SecurityManager.EDIT_ITEM,
|
||||||
|
project);
|
||||||
|
if (canEdit) {
|
||||||
|
SciDepartment department;
|
||||||
|
try {
|
||||||
|
department = new SciDepartment((BigDecimal) key);
|
||||||
|
} catch (DataObjectNotFoundException ex) {
|
||||||
|
s_log.warn(String.format("No object with key '%s' found.",
|
||||||
|
key),
|
||||||
|
ex);
|
||||||
|
return new Label(value.toString());
|
||||||
|
}
|
||||||
|
ContentSection section = CMS.getContext().getContentSection();
|
||||||
|
ItemResolver resolver = section.getItemResolver();
|
||||||
|
Link link =
|
||||||
|
new Link(value.toString(),
|
||||||
|
resolver.generateItemURL(state,
|
||||||
|
department,
|
||||||
|
section,
|
||||||
|
department.getVersion()));
|
||||||
|
|
||||||
|
return link;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
Label label = new Label(value.toString());
|
||||||
|
return label;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -232,7 +271,7 @@ public class SciProjectDepartmentsTable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private class UpCellRenderer
|
private class UpCellRenderer
|
||||||
extends LockableImpl
|
extends LockableImpl
|
||||||
implements TableCellRenderer {
|
implements TableCellRenderer {
|
||||||
|
|
||||||
|
|
@ -291,7 +330,7 @@ public class SciProjectDepartmentsTable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cellSelected(TableActionEvent event) {
|
public void cellSelected(TableActionEvent event) {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import java.math.BigDecimal;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.ControlLink;
|
import com.arsdigita.bebop.ControlLink;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.bebop.Link;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.Table;
|
import com.arsdigita.bebop.Table;
|
||||||
import com.arsdigita.bebop.event.TableActionEvent;
|
import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
|
|
@ -33,14 +34,18 @@ import com.arsdigita.bebop.table.TableColumn;
|
||||||
import com.arsdigita.bebop.table.TableColumnModel;
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
import com.arsdigita.bebop.table.TableModel;
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
|
import com.arsdigita.cms.CMS;
|
||||||
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.contenttypes.SciOrganization;
|
import com.arsdigita.cms.contenttypes.SciOrganization;
|
||||||
import com.arsdigita.cms.contenttypes.SciProject;
|
import com.arsdigita.cms.contenttypes.SciProject;
|
||||||
import com.arsdigita.cms.contenttypes.SciProjectOrganizationsCollection;
|
import com.arsdigita.cms.contenttypes.SciProjectOrganizationsCollection;
|
||||||
import com.arsdigita.cms.contenttypes.SciProjectSubProjectsCollection;
|
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table for showing the links between a {@link SciProject} and
|
* Table for showing the links between a {@link SciProject} and
|
||||||
|
|
@ -52,6 +57,8 @@ public class SciProjectOrganizationsTable
|
||||||
extends Table
|
extends Table
|
||||||
implements TableActionListener {
|
implements TableActionListener {
|
||||||
|
|
||||||
|
private static final Logger s_log = Logger.getLogger(
|
||||||
|
SciProjectOrganizationsTable.class);
|
||||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||||
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";
|
||||||
|
|
@ -204,13 +211,31 @@ public class SciProjectOrganizationsTable
|
||||||
SecurityManager.EDIT_ITEM,
|
SecurityManager.EDIT_ITEM,
|
||||||
project);
|
project);
|
||||||
|
|
||||||
/*if (canEdit) {
|
if (canEdit) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
SciOrganization orga;
|
||||||
|
try {
|
||||||
|
orga = new SciOrganization((BigDecimal) key);
|
||||||
|
} catch (DataObjectNotFoundException ex) {
|
||||||
|
s_log.warn(String.format("No object with key '%s' found.",
|
||||||
|
key),
|
||||||
|
ex);
|
||||||
|
return new Label(value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
ContentSection section = CMS.getContext().getContentSection();
|
||||||
|
ItemResolver resolver = section.getItemResolver();
|
||||||
|
Link link =
|
||||||
|
new Link(value.toString(),
|
||||||
|
resolver.generateItemURL(state,
|
||||||
|
orga,
|
||||||
|
section,
|
||||||
|
orga.getVersion()));
|
||||||
return link;
|
return link;
|
||||||
} else {*/
|
|
||||||
|
} else {
|
||||||
Label label = new Label(value.toString());
|
Label label = new Label(value.toString());
|
||||||
return label;
|
return label;
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -295,7 +320,7 @@ public class SciProjectOrganizationsTable
|
||||||
SciProject project = (SciProject) m_itemModel.getSelectedObject(
|
SciProject project = (SciProject) m_itemModel.getSelectedObject(
|
||||||
state);
|
state);
|
||||||
SciProjectOrganizationsCollection orgas =
|
SciProjectOrganizationsCollection orgas =
|
||||||
project.getOrganizations();
|
project.getOrganizations();
|
||||||
|
|
||||||
if ((orgas.size() - 1) == row) {
|
if ((orgas.size() - 1) == row) {
|
||||||
Label label = new Label("");
|
Label label = new Label("");
|
||||||
|
|
@ -310,7 +335,7 @@ public class SciProjectOrganizationsTable
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cellSelected(TableActionEvent event) {
|
public void cellSelected(TableActionEvent event) {
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
|
|
||||||
|
|
@ -321,7 +346,7 @@ public class SciProjectOrganizationsTable
|
||||||
(SciProject) m_itemModel.getSelectedObject(state);
|
(SciProject) m_itemModel.getSelectedObject(state);
|
||||||
|
|
||||||
SciProjectOrganizationsCollection subprojects =
|
SciProjectOrganizationsCollection subprojects =
|
||||||
project.getOrganizations();
|
project.getOrganizations();
|
||||||
|
|
||||||
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
TableColumn column = getColumnModel().get(event.getColumn().intValue());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import java.math.BigDecimal;
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.ControlLink;
|
import com.arsdigita.bebop.ControlLink;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
|
import com.arsdigita.bebop.Link;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.Table;
|
import com.arsdigita.bebop.Table;
|
||||||
import com.arsdigita.bebop.event.TableActionEvent;
|
import com.arsdigita.bebop.event.TableActionEvent;
|
||||||
|
|
@ -33,12 +34,17 @@ import com.arsdigita.bebop.table.TableColumn;
|
||||||
import com.arsdigita.bebop.table.TableColumnModel;
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
import com.arsdigita.bebop.table.TableModel;
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||||
|
import com.arsdigita.cms.CMS;
|
||||||
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.SecurityManager;
|
import com.arsdigita.cms.SecurityManager;
|
||||||
import com.arsdigita.cms.contenttypes.SciProject;
|
import com.arsdigita.cms.contenttypes.SciProject;
|
||||||
import com.arsdigita.cms.contenttypes.SciProjectSubProjectsCollection;
|
import com.arsdigita.cms.contenttypes.SciProjectSubProjectsCollection;
|
||||||
|
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.util.LockableImpl;
|
import com.arsdigita.util.LockableImpl;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Table of showing the subprojects of a {@link SciProject}.
|
* Table of showing the subprojects of a {@link SciProject}.
|
||||||
|
|
@ -49,6 +55,8 @@ public class SciProjectSubProjectsTable
|
||||||
extends Table
|
extends Table
|
||||||
implements TableActionListener {
|
implements TableActionListener {
|
||||||
|
|
||||||
|
private static final Logger s_log = Logger.getLogger(
|
||||||
|
SciProjectSubProjectsTable.class);
|
||||||
private final String TABLE_COL_EDIT = "table_col_edit";
|
private final String TABLE_COL_EDIT = "table_col_edit";
|
||||||
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";
|
||||||
|
|
@ -200,13 +208,32 @@ public class SciProjectSubProjectsTable
|
||||||
SecurityManager.EDIT_ITEM,
|
SecurityManager.EDIT_ITEM,
|
||||||
project);
|
project);
|
||||||
|
|
||||||
/*if (canEdit) {
|
if (canEdit) {
|
||||||
ControlLink link = new ControlLink(value.toString());
|
SciProject subProject;
|
||||||
|
try {
|
||||||
|
subProject = new SciProject((BigDecimal) key);
|
||||||
|
} catch (DataObjectNotFoundException ex) {
|
||||||
|
s_log.warn(String.format("No object with key '%s' found.",
|
||||||
|
key),
|
||||||
|
ex);
|
||||||
|
return new Label(value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
ContentSection section = CMS.getContext().getContentSection();
|
||||||
|
ItemResolver resolver = section.getItemResolver();
|
||||||
|
Link link = new Link(value.toString(),
|
||||||
|
resolver.generateItemURL(state,
|
||||||
|
subProject,
|
||||||
|
section,
|
||||||
|
subProject.
|
||||||
|
getVersion()));
|
||||||
|
|
||||||
return link;
|
return link;
|
||||||
} else {*/
|
|
||||||
|
} else {
|
||||||
Label label = new Label(value.toString());
|
Label label = new Label(value.toString());
|
||||||
return label;
|
return label;
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue