From a6e26d45662c095c1bb2501f9f42cce3d84cc3cb Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 7 Oct 2010 18:46:57 +0000 Subject: [PATCH] =?UTF-8?q?PropertySteps=20und=20Forms=20zum=20Bearbeiten?= =?UTF-8?q?=20der=20ausf=C3=BChrlichen=20Projektbeschreibung=20und=20des?= =?UTF-8?q?=20Textes=20=C3=BCber=20die=20Finanzierung.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@561 8810af33-2d31-482b-a856-94f89814c4df --- .../arsdigita/content-types/SciDepartment.pdl | 40 +++++------ .../content-types/SciOrganization.pdl | 40 +++++------ .../arsdigita/content-types/SciProject.pdl | 29 ++++---- .../arsdigita/cms/contenttypes/SciProject.xml | 38 ++++++---- .../cms/contenttypes/SciProject.java | 9 +++ .../ui/SciProjectDescriptionStep.java | 53 ++++++++++++++ .../ui/SciProjectEditDescForm.java | 71 +++++++++++++++++++ .../ui/SciProjectFundingForm.java | 67 +++++++++++++++++ .../ui/SciProjectFundingStep.java | 52 ++++++++++++++ .../ui/SciProjectPropertiesStep.java | 30 ++++++-- .../ui/SciProjectPropertyForm.java | 67 +++++++++++++---- 11 files changed, 412 insertions(+), 84 deletions(-) create mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java create mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectEditDescForm.java create mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingForm.java create mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingStep.java diff --git a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciDepartment.pdl b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciDepartment.pdl index 9680422ed..08e8d7761 100644 --- a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciDepartment.pdl +++ b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciDepartment.pdl @@ -4,34 +4,34 @@ import com.arsdigita.kernel.ACSObject; import com.arsdigita.cms.*; object type SciDepartment extends GenericOrganizationalUnit { - String[0..1] departmentDescription = ct_scidepartments.description VARCHAR(4096); + String[0..1] departmentDescription = ct_sciorga_departments.description VARCHAR(4096); - reference key ( ct_scidepartments.department_id ); + reference key ( ct_sciorga_departments.department_id ); } association { - SciDepartment[0..n] department = join ct_scidepartments.department_id - to ct_scidepartments_subdepartments_map.subdepartment_id, - join ct_scidepartments_subdepartments_map.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; + SciDepartment[0..n] department = join ct_sciorga_departments.department_id + to ct_sciorga_departments_subdepartments_map.subdepartment_id, + join ct_sciorga_departments_subdepartments_map.department_id + to ct_sciorga_departments.department_id; + SciDepartment[0..n] subDepartments = join ct_sciorga_departments.department_id + to ct_sciorga_departments_subdepartments_map.department_id, + join ct_sciorga_departments_subdepartments_map.subdepartment_id + to ct_sciorga_departments.department_id; - Integer[0..1] subDepartmentOrder = ct_scidepartments_subdepartments_map.subdepartments_order INTEGER; + Integer[0..1] subDepartmentOrder = ct_sciorga_departments_subdepartments_map.subdepartments_order INTEGER; } association { - SciDepartment[0..n] department = join ct_sciprojects.project_id - to ct_scidepartments_projects_map.project_id, - join ct_scidepartments_projects_map.department_id - to ct_scidepartments.department_id; + SciDepartment[0..n] department = join ct_sciorga_projects.project_id + to ct_sciorga_departments_projects_map.project_id, + join ct_sciorga_departments_projects_map.department_id + to ct_sciorga_departments.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; + SciProject[0..n] projects = join ct_sciorga_departments.department_id + to ct_sciorga_departments_projects_map.department_id, + join ct_sciorga_departments_projects_map.project_id + to ct_sciorga_projects.project_id; - Integer[0..1] projectOrder = ct_scidepartments_projects_map.projectorder INTEGER; + Integer[0..1] projectOrder = ct_sciorga_departments_projects_map.projectorder INTEGER; } \ No newline at end of file diff --git a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciOrganization.pdl b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciOrganization.pdl index 6aa04c647..f2670d68f 100644 --- a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciOrganization.pdl +++ b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciOrganization.pdl @@ -4,37 +4,37 @@ import com.arsdigita.kernel.ACSObject; import com.arsdigita.cms.*; object type SciOrganization extends GenericOrganizationalUnit { - String[0..1] organizationDescription = ct_sciorganizations.description VARCHAR(4096); + String[0..1] organizationDescription = ct_sciorga_organizations.description VARCHAR(4096); - reference key ( ct_sciorganizations.organization_id ); + reference key ( ct_sciorga_organizations.organization_id ); } association { - SciOrganization[0..n] organization = join ct_scidepartments.department_id - to ct_sciorganizations_departments_map.department_id, - join ct_sciorganizations_departments_map.organization_id - to ct_sciorganizations.organization_id; + SciOrganization[0..n] organization = join ct_sciorga_departments.department_id + to ct_sciorga_organizations_departments_map.department_id, + join ct_sciorga_organizations_departments_map.organization_id + to ct_sciorga_organizations.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; + SciDepartment[0..n] departments = join ct_sciorga_organizations.organization_id + to ct_sciorga_organizations_departments_map.organization_id, + join ct_sciorga_organizations_departments_map.department_id + to ct_sciorga_departments.department_id; - Integer[0..1] departmentOrder = ct_sciorganizations_departments_map.department_order INTEGER; + Integer[0..1] departmentOrder = ct_sciorga_organizations_departments_map.department_order INTEGER; } association { - SciOrganization[0..n] organization = join ct_sciprojects.project_id - to ct_sciorganizations_projects_map.project_id, - join ct_sciorganizations_projects_map.organization_id - to ct_sciorganizations.organization_id; + SciOrganization[0..n] organization = join ct_sciorga_projects.project_id + to ct_sciorga_organizations_projects_map.project_id, + join ct_sciorga_organizations_projects_map.organization_id + to ct_sciorga_organizations.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; + SciProject[0..n] projects = join ct_sciorga_organizations.organization_id + to ct_sciorga_organizations_projects_map.organization_id, + join ct_sciorga_organizations_projects_map.project_id + to ct_sciorga_projects.project_id; - Integer[0..1] projectOrder = ct_sciorganizations_projects_map.project_order INTEGER; + Integer[0..1] projectOrder = ct_sciorga_organizations_projects_map.project_order INTEGER; } diff --git a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciProject.pdl b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciProject.pdl index 89588392b..f01929f39 100644 --- a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciProject.pdl +++ b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciProject.pdl @@ -5,25 +5,26 @@ import com.arsdigita.cms.*; object type SciProject extends GenericOrganizationalUnit { - Date[0..1] projectbegin = ct_sciprojects.projectbegin DATE; - Date[0..1] projectend = ct_sciprojects.projectend DATE; - String[0..1] projectDescription = ct_sciprojects.description VARCHAR(4096); - String[0..1] funding = ct_sciprojects.funding VARCHAR(2048); + Date[0..1] projectbegin = ct_sciorga_projects.projectbegin DATE; + Date[0..1] projectend = ct_sciorga_projects.projectend DATE; + String[0..1] projectShortDesc = ct_sciorga_projects.shortdesc VARCHAR(2048); + String[0..1] projectDescription = ct_sciorga_projects.description CLOB; + String[0..1] funding = ct_sciorga_projects.funding VARCHAR(2048); - reference key ( ct_sciprojects.project_id ); + reference key ( ct_sciorga_projects.project_id ); } association { - SciProject[0..n] project = join ct_sciprojects.project_id - to ct_sciprojects_subprojects_map.subproject_id, - join ct_sciprojects_subprojects_map.project_id - to ct_sciprojects.project_id; + SciProject[0..n] project = join ct_sciorga_projects.project_id + to ct_sciorga_projects_subprojects_map.subproject_id, + join ct_sciorga_projects_subprojects_map.project_id + to ct_sciorga_projects.project_id; - SciProject[0..n] subProjects = join ct_sciprojects.project_id - to ct_sciprojects_subprojects_map.project_id, - join ct_sciprojects_subprojects_map.subproject_id - to ct_sciprojects.project_id; + SciProject[0..n] subProjects = join ct_sciorga_projects.project_id + to ct_sciorga_projects_subprojects_map.project_id, + join ct_sciorga_projects_subprojects_map.subproject_id + to ct_sciorga_projects.project_id; - Integer[0..1] subProjectOrder = ct_sciprojects_subprojects_map.subprojectorder INTEGER; + Integer[0..1] subProjectOrder = ct_sciorga_projects_subprojects_map.subprojectorder INTEGER; } \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProject.xml b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProject.xml index ea22dc4c3..5e6dd59d5 100644 --- a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProject.xml +++ b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProject.xml @@ -4,27 +4,41 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> - - + - + + + + + - + - + - + \ No newline at end of file diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java index 552d551cc..b5929bf3b 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java @@ -35,6 +35,7 @@ public class SciProject extends GenericOrganizationalUnit { public static final String BEGIN = "projectbegin"; public static final String END = "projectend"; + public static final String PROJECT_SHORT_DESCRIPTION = "projectShortDesc"; public static final String PROJECT_DESCRIPTION = "projectDescription"; public static final String FUNDING = "funding"; public static final String SUBPROJECTS = "subProjects"; @@ -78,6 +79,14 @@ public class SciProject extends GenericOrganizationalUnit { set(END, end); } + public String getProjectShortDescription() { + return (String) get(PROJECT_SHORT_DESCRIPTION); + } + + public void setProjectShortDescription(String shortDesc) { + set(PROJECT_SHORT_DESCRIPTION, shortDesc); + } + public String getProjectDescription() { return (String) get(PROJECT_DESCRIPTION); } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java new file mode 100644 index 000000000..77a252e36 --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java @@ -0,0 +1,53 @@ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.bebop.Component; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciProject; +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.toolbox.ui.DomainObjectPropertySheet; + +/** + * + * @author Jens Pelzetter + */ +public class SciProjectDescriptionStep extends SimpleEditStep { + + private String EDIT_PROJECT_DESC_SHEET_NAME = "editProjectDesc"; + + public SciProjectDescriptionStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + this(itemModel, parent, null); + } + + public SciProjectDescriptionStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { + super(itemModel, parent, prefix); + + BasicItemForm editDescForm = new SciProjectEditDescForm(itemModel); + add(EDIT_PROJECT_DESC_SHEET_NAME, + (String) SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.project.edit_desc").localize(), + new WorkflowLockedComponentAccess(editDescForm, itemModel), + editDescForm.getSaveCancelSection().getCancelButton()); + + setDisplayComponent( + getSciProjectEditDescSheet(itemModel)); + + } + + public static Component getSciProjectEditDescSheet( + ItemSelectionModel itemModel) { + DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( + itemModel); + + sheet.add(SciOrganizationGlobalizationUtil.globalize( + "sciorganizaztion.ui.project.desc"), + SciProject.PROJECT_DESCRIPTION); + + return sheet; + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectEditDescForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectEditDescForm.java new file mode 100644 index 000000000..8752c7a7f --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectEditDescForm.java @@ -0,0 +1,71 @@ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.bebop.FormData; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.event.FormInitListener; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.parameters.ParameterModel; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciProject; +import com.arsdigita.cms.ui.CMSDHTMLEditor; +import com.arsdigita.cms.ui.authoring.BasicItemForm; + +/** + * + * @author Jens Pelzetter + */ +public class SciProjectEditDescForm + extends BasicItemForm + implements FormProcessListener, + FormInitListener { + + public SciProjectEditDescForm(ItemSelectionModel itemModel) { + super("sciprojectEditDescForm", itemModel); + } + + @Override + protected void addWidgets() { + ParameterModel descParam = new StringParameter( + SciProject.PROJECT_DESCRIPTION); + CMSDHTMLEditor desc = new CMSDHTMLEditor(descParam); + desc.setCols(75); + desc.setRows(25); + add(desc); + } + + @Override + public void init(FormSectionEvent fse) throws FormProcessException { + PageState state = fse.getPageState(); + + FormData data = fse.getFormData(); + SciProject project = (SciProject) getItemSelectionModel(). + getSelectedObject(state); + + data.put(SciProject.PROJECT_DESCRIPTION, + project.getProjectDescription()); + + setVisible(state, true); + } + + @Override + public void process(FormSectionEvent fse) throws FormProcessException { + PageState state = fse.getPageState(); + + FormData data = fse.getFormData(); + SciProject project = (SciProject) getItemSelectionModel(). + getSelectedObject(state); + + if ((project != null) && this.getSaveCancelSection().getSaveButton(). + isSelected(state)) { + project.setProjectDescription((String) data.get( + SciProject.PROJECT_DESCRIPTION)); + + project.save(); + + init(fse); + } + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingForm.java new file mode 100644 index 000000000..de3c2d72d --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingForm.java @@ -0,0 +1,67 @@ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.bebop.FormData; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.event.FormInitListener; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.parameters.ParameterModel; +import com.arsdigita.bebop.parameters.StringParameter; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciProject; +import com.arsdigita.cms.ui.CMSDHTMLEditor; +import com.arsdigita.cms.ui.authoring.BasicItemForm; + +/** + * + * @author Jens Pelzetter + */ +public class SciProjectFundingForm + extends BasicItemForm + implements FormProcessListener, + FormInitListener { + + public SciProjectFundingForm(ItemSelectionModel itemModel) { + super("sciprojectEditFundingForm", itemModel); + } + + @Override + protected void addWidgets() { + ParameterModel fundingParam = new StringParameter( + SciProject.FUNDING); + CMSDHTMLEditor funding = new CMSDHTMLEditor(fundingParam); + funding.setCols(75); + funding.setRows(25); + add(funding); + } + + @Override + public void init(FormSectionEvent fse) throws FormProcessException { + PageState state = fse.getPageState(); + + FormData data = fse.getFormData(); + SciProject project = (SciProject) getItemSelectionModel(). + getSelectedObject(state); + + data.put(SciProject.FUNDING, project.getFunding()); + } + + @Override + public void process(FormSectionEvent fse) throws FormProcessException { + PageState state = fse.getPageState(); + + FormData data = fse.getFormData(); + SciProject project = (SciProject) getItemSelectionModel(). + getSelectedObject(state); + + if ((project != null) && this.getSaveCancelSection().getSaveButton(). + isSelected(state)) { + project.setFunding((String) data.get(SciProject.FUNDING)); + + project.save(); + + init(fse); + } + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingStep.java new file mode 100644 index 000000000..eb04bec9e --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectFundingStep.java @@ -0,0 +1,52 @@ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.bebop.Component; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciProject; +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.toolbox.ui.DomainObjectPropertySheet; + +/** + * + * @author Jens Pelzetter + */ +public class SciProjectFundingStep extends SimpleEditStep { + + private String EDIT_FUNDING_SHEET_NAME = "editFunding"; + + public SciProjectFundingStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + this(itemModel, parent, null); + } + + public SciProjectFundingStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { + super(itemModel, parent, null); + + BasicItemForm editFundingForm = new SciProjectFundingForm(itemModel); + add(EDIT_FUNDING_SHEET_NAME, + (String) SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.project.edit_funding").localize(), + new WorkflowLockedComponentAccess(editFundingForm, itemModel), + editFundingForm.getSaveCancelSection().getCancelButton()); + + setDisplayComponent( + getSciProjectFundingSheet(itemModel)); + } + + public static Component getSciProjectFundingSheet( + ItemSelectionModel itemModel) { + DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( + itemModel); + + sheet.add(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.project.funding"), + SciProject.FUNDING); + + return sheet; + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java index 904cc7259..f2f694430 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java @@ -1,15 +1,14 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ package com.arsdigita.cms.contenttypes.ui; +import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Label; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciProject; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicPageForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; +import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** * @@ -23,6 +22,25 @@ public class SciProjectPropertiesStep super(itemModel, parent); } + public static Component getSciProjectPropertySheet( + ItemSelectionModel itemModel) { + DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) GenericOrganizationalUnitPropertiesStep. + getGenericOrganizationalUnitPropertySheet( + itemModel); + + sheet.add(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.project.begin"), + SciProject.BEGIN); + sheet.add(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.project.end"), + SciProject.END); + sheet.add(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.project.shortdesc"), + SciProject.PROJECT_SHORT_DESCRIPTION); + + return sheet; + } + @Override protected void addBasicProperties(ItemSelectionModel itemModel, AuthoringKitWizard parent) { @@ -42,7 +60,7 @@ public class SciProjectPropertiesStep getCancelButton()); basicProperties.setDisplayComponent( - getGenericOrganizationalUnitPropertySheet(itemModel)); + getSciProjectPropertySheet(itemModel)); getSegmentedPanel().addSegment( new Label((String) SciOrganizationGlobalizationUtil.globalize( @@ -64,7 +82,7 @@ public class SciProjectPropertiesStep super.addSteps(itemModel, parent); addStep(new SciProjectSubprojectsStep(itemModel, - parent), + parent), "cms.contenttypes.ui.project.subprojects"); } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java index 6505d339e..9ac6aabeb 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java @@ -7,11 +7,16 @@ import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; +import com.arsdigita.bebop.form.Date; import com.arsdigita.bebop.form.TextArea; +import com.arsdigita.bebop.parameters.DateParameter; import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.SciProject; +import com.arsdigita.cms.ui.CMSDHTMLEditor; +import java.util.Calendar; +import java.util.GregorianCalendar; /** * @@ -39,15 +44,47 @@ public class SciProjectPropertyForm protected void addWidgets() { super.addWidgets(); - Label descLabel = new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganizations.ui.project.description")); - add(descLabel); + add(new Label(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.project.begin"))); + ParameterModel beginParam = new DateParameter(SciProject.BEGIN); + Calendar today = new GregorianCalendar(); + Date begin = new Date(beginParam); + begin.setYearRange(1970, (today.get(Calendar.YEAR) + 2)); + add(begin); + + add(new Label(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.project.end"))); + ParameterModel endParam = new DateParameter(SciProject.END); + Date end = new Date(endParam); + end.setYearRange(1970, (today.get(Calendar.YEAR) + 8)); + add(end); + + add(new Label(SciOrganizationGlobalizationUtil.globalize( + "sciorganizations.ui.projectshortdesc"))); + ParameterModel shortDescParam = new StringParameter( + SciProject.PROJECT_SHORT_DESCRIPTION); + TextArea shortDesc = new TextArea(shortDescParam); + shortDesc.setCols(60); + shortDesc.setRows(20); + add(shortDesc); + + /*add(new Label(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.project.description"))); ParameterModel descParam = new StringParameter( - SciProject.PROJECT_DESCRIPTION); - TextArea desc = new TextArea(descParam); - desc.setCols(60); - desc.setRows(18); - add(desc); + SciProject.PROJECT_DESCRIPTION); + CMSDHTMLEditor desc = new CMSDHTMLEditor(descParam); + desc.setCols(75); + desc.setRows(25); + add(desc);*/ + + /*add(new Label(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.project.funding"))); + ParameterModel fundingParam = new StringParameter( + SciProject.FUNDING); + CMSDHTMLEditor funding = new CMSDHTMLEditor(fundingParam); + funding.setCols(60); + funding.setRows(18); + add(funding);*/ } @Override @@ -57,8 +94,10 @@ public class SciProjectPropertyForm FormData data = fse.getFormData(); SciProject project = (SciProject) super.initBasicWidgets(fse); - data.put(SciProject.PROJECT_DESCRIPTION, - project.getProjectDescription()); + data.put(SciProject.BEGIN, project.getBegin()); + data.put(SciProject.END, project.getEnd()); + data.put(SciProject.PROJECT_SHORT_DESCRIPTION, + project.getProjectShortDescription()); } @Override @@ -70,8 +109,12 @@ public class SciProjectPropertyForm if ((project != null) && getSaveCancelSection().getSaveButton(). isSelected(fse.getPageState())) { - project.setProjectDescription((String) data.get( - SciProject.PROJECT_DESCRIPTION)); + project.setBegin((java.util.Date) data.get( + SciProject.BEGIN)); + project.setEnd((java.util.Date) data.get( + SciProject.END)); + project.setProjectShortDescription((String) data.get( + SciProject.PROJECT_SHORT_DESCRIPTION)); project.save();