PropertySteps und Forms zum Bearbeiten der ausführlichen Projektbeschreibung und des Textes über die Finanzierung.
git-svn-id: https://svn.libreccm.org/ccm/trunk@561 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
c5d55d7f00
commit
a6e26d4566
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
@ -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">
|
||||
|
||||
<ctd:content-type
|
||||
<ctd:content-type
|
||||
label="SciProject"
|
||||
description="Projects of scientific organizations."
|
||||
objectType="com.arsdigita.cms.contenttypes.SciProject"
|
||||
classname="com.arsdigita.cms.contenttypes.SciProject">
|
||||
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="publications.ui.publication_properties.title"
|
||||
labelBundle="com.arsdigita.cms.contenttypes.ui.SciProjectResources"
|
||||
descriptionKey="publications.ui.publication_properties.title.description"
|
||||
descriptionBundle="com.arsdigita.cms.contenttypes.ui.SciProjectResources"
|
||||
component="com.arsdigita.cms.contenttypes.ui.SciProjectPropertiesStep"
|
||||
ordering="1"/>
|
||||
<ctd:authoring-step
|
||||
labelKey="sciorganization.ui.project_properties.title"
|
||||
labelBundle="com.arsdigita.cms.contenttypes.ui.SciProjectResources"
|
||||
descriptionKey="sciorganization.ui.project_properties.title.description"
|
||||
descriptionBundle="com.arsdigita.cms.contenttypes.ui.SciProjectResources"
|
||||
component="com.arsdigita.cms.contenttypes.ui.SciProjectPropertiesStep"
|
||||
ordering="1"/>
|
||||
|
||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||
<ctd:authoring-step
|
||||
labelKey="sciorganization.ui.project_description.title"
|
||||
labelBundle="com.arsdigita.cms.contenttypes.ui.SciProjectResources"
|
||||
descriptionKey="sciorganization.ui.project_description.title.description"
|
||||
component="com.arsdigita.cms.contenttypes.ui.SciProjectDescriptionStep"
|
||||
ordering="2"/>
|
||||
|
||||
</ctd:authoring-kit>
|
||||
<ctd:authoring-step
|
||||
labelKey="sciorganization.ui.project_funding.title"
|
||||
labelBundle="com.arsdigita.cms.contenttypes.ui.SciProjectResources"
|
||||
descriptionKey="sciorganization.ui.project_funding.title.funding"
|
||||
component="com.arsdigita.cms.contenttypes.ui.SciProjectFundingStep"
|
||||
ordering="3"/>
|
||||
|
||||
</ctd:content-type>
|
||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||
|
||||
</ctd:authoring-kit>
|
||||
|
||||
</ctd:content-type>
|
||||
|
||||
|
||||
</ctd:content-types>
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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");
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue