Fehlerkorrekturen am sci-types-organization Modul.

git-svn-id: https://svn.libreccm.org/ccm/trunk@553 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2010-10-04 12:18:45 +00:00
parent ed228d8917
commit c6ef4bf03e
22 changed files with 110 additions and 77 deletions

View File

@ -115,7 +115,6 @@ public class GenericOrganizationalUnit extends ContentPage {
DataObject link = add(PERSONS, person); DataObject link = add(PERSONS, person);
link.set(ROLE, role); link.set(ROLE, role);
link.set(PERSON_ORDER, BigDecimal.valueOf(getPersons().size()));
} }
public void removePerson(GenericPerson person) { public void removePerson(GenericPerson person) {

View File

@ -143,11 +143,7 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
public Object getElementAt(int columnIndex) { public Object getElementAt(int columnIndex) {
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
return String.format("%s %s %s %s", return m_person.getFullName();
m_person.getTitlePre(),
m_person.getGivenName(),
m_person.getSurname(),
m_person.getTitlePost());
case 1: case 1:
return m_personsCollection.getRoleName(); return m_personsCollection.getRoleName();
case 2: case 2:

View File

@ -55,6 +55,9 @@ public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep {
sheet.add(ContenttypesGlobalizationUtil.globalize( sheet.add(ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorganunit.name"), "cms.contenttypes.ui.genericorganunit.name"),
GenericOrganizationalUnit.NAME); GenericOrganizationalUnit.NAME);
sheet.add(ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorgaunit.title"),
GenericOrganizationalUnit.TITLE);
sheet.add(ContenttypesGlobalizationUtil.globalize( sheet.add(ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorganunit.addendum"), "cms.contenttypes.ui.genericorganunit.addendum"),
GenericOrganizationalUnit.ADDENDUM); GenericOrganizationalUnit.ADDENDUM);

View File

@ -121,9 +121,5 @@ public class GenericOrganizationalUnitPropertyForm
orgaunit.save(); orgaunit.save();
} }
if (m_step != null) {
m_step.maybeForwardToNextStep(fse.getPageState());
}
} }
} }

View File

@ -31,7 +31,7 @@ object type CollectedVolume extends PublicationWithPublisher {
association { association {
CollectedVolume[0..1] collectedVolume = join ct_article_in_collected_volume.article_id CollectedVolume[0..n] collectedVolume = join ct_article_in_collected_volume.article_id
to ct_collected_volume_article_map.article_id, to ct_collected_volume_article_map.article_id,
join ct_collected_volume_article_map.collected_volume_id join ct_collected_volume_article_map.collected_volume_id
to ct_collected_volume.collected_volume_id; to ct_collected_volume.collected_volume_id;

View File

@ -37,7 +37,7 @@ object type Proceedings extends PublicationWithPublisher {
association { association {
Proceedings[0..1] proceedings = join ct_inproceedings.inproceedings_id Proceedings[0..n] proceedings = join ct_inproceedings.inproceedings_id
to ct_proceedings_papers_map.paper_id, to ct_proceedings_papers_map.paper_id,
join ct_proceedings_papers_map.proceedings_id join ct_proceedings_papers_map.proceedings_id
to ct_proceedings.proceedings_id; to ct_proceedings.proceedings_id;

View File

@ -108,7 +108,7 @@ public class Proceedings extends PublicationWithPublisher {
} }
public Date getDateToOfConference() { public Date getDateToOfConference() {
return (Date) get(DATE_FROM_OF_CONFERENCE); return (Date) get(DATE_TO_OF_CONFERENCE);
} }
public void setDateToOfConference(Date dateTo) { public void setDateToOfConference(Date dateTo) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

After

Width:  |  Height:  |  Size: 189 KiB

View File

@ -49,7 +49,7 @@ public class InProceedingsPropertyForm
add(pagesFrom); add(pagesFrom);
add(new Label((String) PublicationGlobalizationUtil.globalize( add(new Label((String) PublicationGlobalizationUtil.globalize(
"publications.ui.inproceedings.pages_from").localize())); "publications.ui.inproceedings.pages_to").localize()));
ParameterModel pagesToParam = ParameterModel pagesToParam =
new IntegerParameter(InProceedings.PAGES_TO); new IntegerParameter(InProceedings.PAGES_TO);
TextField pagesTo = new TextField(pagesToParam); TextField pagesTo = new TextField(pagesToParam);

View File

@ -267,13 +267,13 @@ public class ProceedingsPapersTable
int row, int row,
int col) { int col) {
CollectedVolume collectedVolume = Proceedings proceedings =
(CollectedVolume) m_itemModel.getSelectedObject( (Proceedings) m_itemModel.getSelectedObject(
state); state);
ArticleInCollectedVolumeCollection articles = InProceedingsCollection papers =
collectedVolume.getArticles(); proceedings.getPapers();
if ((articles.size() - 1) if ((papers.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("");

View File

@ -83,9 +83,9 @@ public class ProceedingsPropertyForm
add(dateFrom); add(dateFrom);
add(new Label(PublicationGlobalizationUtil.globalize( add(new Label(PublicationGlobalizationUtil.globalize(
"publications.ui.proceedings.date_from_of_conference"))); "publications.ui.proceedings.date_to_of_conference")));
ParameterModel dateToParam = new DateParameter( ParameterModel dateToParam = new DateParameter(
Proceedings.DATE_FROM_OF_CONFERENCE); Proceedings.DATE_TO_OF_CONFERENCE);
Date dateTo = new Date(dateToParam); Date dateTo = new Date(dateToParam);
dateTo.setYearRange(1900, today.get(Calendar.YEAR) + 3); dateTo.setYearRange(1900, today.get(Calendar.YEAR) + 3);
add(dateTo); add(dateTo);

View File

@ -4,34 +4,34 @@ import com.arsdigita.kernel.ACSObject;
import com.arsdigita.cms.*; import com.arsdigita.cms.*;
object type SciDepartment extends GenericOrganizationalUnit { object type SciDepartment extends GenericOrganizationalUnit {
String[0..1] departmentDescription = ct_scidepartments.description; String[0..1] departmentDescription = ct_scidepartments.description VARCHAR(4096);
reference key ( ct_scidepartments.department_id ); reference key ( ct_scidepartments.department_id );
} }
association { association {
SciDepartment[0..1] department = join ct_scidepartments.department_id SciDepartment[0..n] department = join ct_scidepartments.department_id
to ct_scidepartments_subdepartments_map.department_id,
join ct_scidepartments_subdepartments_map.subdepartment_id
to ct_scidepartments.department_id;
SciDepartment[0..n] subDepartments = join ct_scidepartments.department_id
to ct_scidepartments_subdepartments_map.subdepartment_id, to ct_scidepartments_subdepartments_map.subdepartment_id,
join ct_scidepartments_subdepartments_map.department_id join ct_scidepartments_subdepartments_map.department_id
to ct_scidepartments.department_id; to ct_scidepartments.department_id;
SciDepartment[0..n] subDepartments = join ct_scidepartments.department_id
to ct_scidepartments_subdepartments_map.department_id,
join ct_scidepartments_subdepartments_map.subdepartment_id
to ct_scidepartments.department_id;
Integer[0..1] subDepartmentOrder = ct_scidepartments_subdepartments_map.subdepartments_order INTEGER; Integer[0..1] subDepartmentOrder = ct_scidepartments_subdepartments_map.subdepartments_order INTEGER;
} }
association { association {
SciDepartment[0..1] department = join ct_scidepartments.department_id SciDepartment[0..n] department = join ct_sciprojects.project_id
to ct_scidepartments_projects_map.department_id,
join ct_scidepartments_projects_map.project_id
to ct_sciprojects.project_id;
SciProject[0..n] projects = join ct_sciprojects.project_id
to ct_scidepartments_projects_map.project_id, to ct_scidepartments_projects_map.project_id,
join ct_scidepartments_projects_map.department_id join ct_scidepartments_projects_map.department_id
to ct_scidepartments.department_id; to ct_scidepartments.department_id;
SciProject[0..n] projects = join ct_scidepartments.department_id
to ct_scidepartments_projects_map.department_id,
join ct_scidepartments_projects_map.project_id
to ct_sciprojects.project_id;
Integer[0..1] projectOrder = ct_scidepartments_projects_map.projectorder INTEGER; Integer[0..1] projectOrder = ct_scidepartments_projects_map.projectorder INTEGER;
} }

View File

@ -4,36 +4,36 @@ import com.arsdigita.kernel.ACSObject;
import com.arsdigita.cms.*; import com.arsdigita.cms.*;
object type SciOrganization extends GenericOrganizationalUnit { object type SciOrganization extends GenericOrganizationalUnit {
String[0..1] organizationDescription = ct_sciorganizations.description; String[0..1] organizationDescription = ct_sciorganizations.description VARCHAR(4096);
reference key ( ct_sciorganizations.organization_id ); reference key ( ct_sciorganizations.organization_id );
} }
association { association {
SciOrganization[0..1] organization = join ct_sciorganizations.organization_id SciOrganization[0..n] organization = join ct_scidepartments.department_id
to ct_sciorganizations_departments_map.organization_id,
join ct_sciorganizations_departments_map.department_id
to ct_scidepartments.department_id;
SciDepartment[0..n] departments = join ct_scidepartments.department_id
to ct_sciorganizations_departments_map.department_id, to ct_sciorganizations_departments_map.department_id,
join ct_sciorganizations_departments_map.organization_id join ct_sciorganizations_departments_map.organization_id
to ct_sciorganizations.organization_id; to ct_sciorganizations.organization_id;
SciDepartment[0..n] departments = join ct_sciorganizations.organization_id
to ct_sciorganizations_departments_map.organization_id,
join ct_sciorganizations_departments_map.department_id
to ct_scidepartments.department_id;
Integer[0..1] departmentOrder = ct_sciorganizations_departments_map.department_order INTEGER; Integer[0..1] departmentOrder = ct_sciorganizations_departments_map.department_order INTEGER;
} }
association { association {
SciOrganization[0..1] organization = join ct_sciorganizations.organization_id SciOrganization[0..n] organization = join ct_sciprojects.project_id
to ct_sciorganizations_projects_map.organization_id,
join ct_sciorganizations_projects_map.project_id
to ct_sciprojects.project_id;
SciProject[0..n] projects = join ct_sciprojects.project_id
to ct_sciorganizations_projects_map.project_id, to ct_sciorganizations_projects_map.project_id,
join ct_sciorganizations_projects_map.organization_id join ct_sciorganizations_projects_map.organization_id
to ct_sciorganizations.organization_id; to ct_sciorganizations.organization_id;
SciProject[0..n] projects = join ct_sciorganizations.organization_id
to ct_sciorganizations_projects_map.organization_id,
join ct_sciorganizations_projects_map.project_id
to ct_sciprojects.project_id;
Integer[0..1] projectOrder = ct_sciorganizations_projects_map.project_order INTEGER; Integer[0..1] projectOrder = ct_sciorganizations_projects_map.project_order INTEGER;
} }

View File

@ -14,14 +14,14 @@ object type SciProject extends GenericOrganizationalUnit {
} }
association { association {
SciProject[0..1] project = join ct_sciprojects.project_id SciProject[0..n] project = join ct_sciprojects.project_id
to ct_sciprojects_subprojects_map.project_id, to ct_sciprojects_subprojects_map.subproject_id,
join ct_sciprojects_subprojects_map.subproject_id join ct_sciprojects_subprojects_map.project_id
to ct_sciprojects.project_id; to ct_sciprojects.project_id;
SciProject[0..n] subProjects = join ct_sciprojects.project_id SciProject[0..n] subProjects = join ct_sciprojects.project_id
to ct_sciprojects_subprojects_map.subproject_id, to ct_sciprojects_subprojects_map.project_id,
join ct_sciprojects_subprojects_map.project_id join ct_sciprojects_subprojects_map.subproject_id
to ct_sciprojects.project_id; to ct_sciprojects.project_id;
Integer[0..1] subProjectOrder = ct_sciprojects_subprojects_map.subprojectorder INTEGER; Integer[0..1] subProjectOrder = ct_sciprojects_subprojects_map.subprojectorder INTEGER;

View File

@ -270,7 +270,12 @@ public class SciDepartmentProjectsTable
int row, int row,
int col) { int col) {
if (0 == row) { SciDepartment department = (SciDepartment) m_itemModel.getSelectedObject(
state);
SciDepartmentProjectsCollection projects =
department.getProjects();
if ((projects.size() - 1) == row) {
Label label = new Label(""); Label label = new Label("");
return label; return label;
} else { } else {

View File

@ -1,11 +1,13 @@
package com.arsdigita.cms.contenttypes.ui; package com.arsdigita.cms.contenttypes.ui;
import com.arsdigita.bebop.Component;
import com.arsdigita.bebop.Label; import com.arsdigita.bebop.Label;
import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.ItemSelectionModel;
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.BasicPageForm;
import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.authoring.SimpleEditStep;
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
/** /**
* *
@ -19,6 +21,15 @@ public class SciDepartmentPropertiesStep
super(itemModel, parent); super(itemModel, parent);
} }
public static Component getSciDepartmentPropertySheet(
ItemSelectionModel itemModel) {
DomainObjectPropertySheet sheet =
(DomainObjectPropertySheet) GenericOrganizationalUnitPropertiesStep.
getGenericOrganizationalUnitPropertySheet(itemModel);
return sheet;
}
@Override @Override
protected void addBasicProperties(ItemSelectionModel itemModel, protected void addBasicProperties(ItemSelectionModel itemModel,
AuthoringKitWizard parent) { AuthoringKitWizard parent) {

View File

@ -268,7 +268,12 @@ public class SciDepartmentSubDepartmentsTable
int row, int row,
int col) { int col) {
if (0 == row) { SciDepartment department = (SciDepartment) m_itemModel.
getSelectedObject(state);
SciDepartmentSubDepartmentsCollection subDepartments =
department.getSubDepartments();
if ((subDepartments.size() - 1) == row) {
Label label = new Label(""); Label label = new Label("");
return label; return label;
} else { } else {
@ -300,9 +305,9 @@ public class SciDepartmentSubDepartmentsTable
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
department.removeSubDepartment(department); department.removeSubDepartment(department);
} else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) { } else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) {
subdepartments.swapWithPrevious(department); subdepartments.swapWithPrevious(subdepartment);
} else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) { } else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) {
subdepartments.swapWithNext(department); subdepartments.swapWithNext(subdepartment);
} }
} }

View File

@ -269,7 +269,12 @@ public class SciOrganizationDepartmentsTable
int row, int row,
int col) { int col) {
if (0 == row) { SciOrganization orga = (SciOrganization) m_itemModel.
getSelectedObject(state);
SciOrganizationDepartmentsCollection departments = orga.
getDepartments();
if ((departments.size() - 1) == row) {
Label label = new Label(""); Label label = new Label("");
return label; return label;
} else { } else {

View File

@ -270,7 +270,12 @@ public class SciOrganizationProjectsTable
int row, int row,
int col) { int col) {
if (0 == row) { SciOrganization orga = (SciOrganization) m_itemModel.
getSelectedObject(state);
SciOrganizationProjectsCollection projects = orga.
getProjects();
if ((projects.size() - 1) == row) {
Label label = new Label(""); Label label = new Label("");
return label; return label;
} else { } else {

View File

@ -6,6 +6,7 @@ import com.arsdigita.bebop.Label;
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.TextArea; import com.arsdigita.bebop.form.TextArea;
import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
@ -19,7 +20,8 @@ import com.arsdigita.cms.contenttypes.SciOrganization;
public class SciOrganizationPropertyForm public class SciOrganizationPropertyForm
extends GenericOrganizationalUnitPropertyForm extends GenericOrganizationalUnitPropertyForm
implements FormProcessListener, implements FormProcessListener,
FormInitListener { FormInitListener,
FormSubmissionListener {
public static final String ID = "SciOrganizationEdit"; public static final String ID = "SciOrganizationEdit";
@ -64,16 +66,16 @@ public class SciOrganizationPropertyForm
super.process(fse); super.process(fse);
FormData data = fse.getFormData(); FormData data = fse.getFormData();
SciOrganization organization = (SciOrganization) super.processBasicWidgets(fse); SciOrganization organization = (SciOrganization) super.
processBasicWidgets(fse);
if ((organization != null) && getSaveCancelSection().getSaveButton(). if ((organization != null) && getSaveCancelSection().getSaveButton().
isSelected(fse.getPageState())) { isSelected(fse.getPageState())) {
organization.setDescription((String) data.get(
organization.setOrganizationDescription((String) data.get(
SciOrganization.ORGANIZATION_DESCRIPTION)); SciOrganization.ORGANIZATION_DESCRIPTION));
organization.save(); organization.save();
init(fse);
} }
} }
} }

View File

@ -42,7 +42,8 @@ public class SciProjectPropertyForm
Label descLabel = new Label(SciOrganizationGlobalizationUtil.globalize( Label descLabel = new Label(SciOrganizationGlobalizationUtil.globalize(
"sciorganizations.ui.project.description")); "sciorganizations.ui.project.description"));
add(descLabel); add(descLabel);
ParameterModel descParam = new StringParameter(SciProject.PROJECT_DESCRIPTION); ParameterModel descParam = new StringParameter(
SciProject.PROJECT_DESCRIPTION);
TextArea desc = new TextArea(descParam); TextArea desc = new TextArea(descParam);
desc.setCols(60); desc.setCols(60);
desc.setRows(18); desc.setRows(18);
@ -56,7 +57,8 @@ public class SciProjectPropertyForm
FormData data = fse.getFormData(); FormData data = fse.getFormData();
SciProject project = (SciProject) super.initBasicWidgets(fse); SciProject project = (SciProject) super.initBasicWidgets(fse);
data.put(SciProject.PROJECT_DESCRIPTION, project.getDescription()); data.put(SciProject.PROJECT_DESCRIPTION,
project.getProjectDescription());
} }
@Override @Override
@ -68,7 +70,8 @@ public class SciProjectPropertyForm
if ((project != null) && getSaveCancelSection().getSaveButton(). if ((project != null) && getSaveCancelSection().getSaveButton().
isSelected(fse.getPageState())) { isSelected(fse.getPageState())) {
project.setDescription((String) data.get(SciProject.PROJECT_DESCRIPTION)); project.setProjectDescription((String) data.get(
SciProject.PROJECT_DESCRIPTION));
project.save(); project.save();

View File

@ -269,7 +269,10 @@ public class SciProjectSubProjectsTable
int row, int row,
int col) { int col) {
if (0 == row) { SciProject project = (SciProject) m_itemModel.getSelectedObject(state);
SciProjectSubProjectsCollection subProjects = project.getSubProjects();
if ((subProjects.size() - 1) == row) {
Label label = new Label(""); Label label = new Label("");
return label; return label;
} else { } else {