From 327319609e31ba4794ef19e04419ba207d29e86c Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 22 Jul 2010 14:39:21 +0000 Subject: [PATCH] Organization/Project content types: most recent versions of the code git-svn-id: https://svn.libreccm.org/ccm/trunk@488 8810af33-2d31-482b-a856-94f89814c4df --- ccm-cms-types-department/application.xml | 4 +- .../arsdigita/content-types/Department.pdl | 2 +- .../arsdigita/cms/contenttypes/Department.xml | 30 ++++ .../arsdigita/cms/contenttypes/Department.xml | 17 +++ .../src/ccm-cms-types-department.config | 4 + .../src/ccm-cms-types-department.load | 17 +++ .../cms/contenttypes/Department.java | 36 +++++ .../contenttypes/DepartmentInitializer.java | 29 ++++ .../cms/contenttypes/DepartmentLoader.java | 17 +++ .../ui/DepartmentProjectAddForm.java | 26 ++++ .../ui/DepartmentProjectPropertiesStep.java | 49 +++++++ .../ui/DepartmentPropertiesStep.java | 38 +++++ .../ui/DepartmentSubDepartmentAddForm.java | 21 +++ ...DepartmentSubDepartmentPropertiesStep.java | 42 ++++++ ccm-cms-types-organization/application.xml | 1 + .../cms/contenttypes/Organization.xml | 27 +--- .../src/ccm-cms-types-organization.load | 1 + .../ui/OrganizationAddChildForm.java | 72 --------- .../ui/OrganizationDepartmentAddForm.java | 21 +++ ...OrganizationDepartmentPropertiesStep.java} | 21 +-- .../ui/OrganizationPropertiesStep.java | 35 +++++ .../arsdigita/cms/contenttypes/Project.xml | 33 +---- .../src/ccm-cms-types-project.load | 1 + .../contenttypes/ui/ProjectAddChildForm.java | 73 --------- .../ui/ProjectSubprojectAddForm.java | 21 +++ ...a => ProjectSubprojectPropertiesStep.java} | 10 +- ccm-cms/.settings/org.eclipse.jdt.core.prefs | 6 +- .../GenericOrganizationalUnit.pdl | 14 +- .../GenericOrganizationalUnit.xml | 28 ---- .../GenericOrganizationalUnit.java | 20 +-- ...cOrganizationalUnitChildrenCollection.java | 29 +++- ...icOrganizationalUnitContactCollection.java | 21 ++- ...ricOrganizationalUnitPersonCollection.java | 19 +++ ...GenericOrganizationalUnitChildAddForm.java | 42 +++++- .../GenericOrganizationalUnitChildTable.java | 20 ++- ...anizationalUnitChildrenPropertiesStep.java | 22 ++- ...nericOrganizationalUnitContactAddForm.java | 23 ++- ...ganizationalUnitContactPropertiesStep.java | 20 ++- ...GenericOrganizationalUnitContactTable.java | 20 ++- ...enericOrganizationalUnitPersonAddForm.java | 20 ++- ...rganizationalUnitPersonPropertiesStep.java | 23 ++- ...GenericOrganizationalUnitPersonsTable.java | 20 +++ ...nericOrganizationalUnitPropertiesStep.java | 138 ++++++++++++------ ...GenericOrganizationalUnitPropertyForm.java | 21 ++- 44 files changed, 815 insertions(+), 339 deletions(-) create mode 100644 ccm-cms-types-department/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Department.xml create mode 100644 ccm-cms-types-department/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Department.xml create mode 100644 ccm-cms-types-department/src/ccm-cms-types-department.config create mode 100644 ccm-cms-types-department/src/ccm-cms-types-department.load create mode 100644 ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/Department.java create mode 100644 ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/DepartmentInitializer.java create mode 100644 ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/DepartmentLoader.java create mode 100644 ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentProjectAddForm.java create mode 100644 ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentProjectPropertiesStep.java create mode 100644 ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentPropertiesStep.java create mode 100644 ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentSubDepartmentAddForm.java create mode 100644 ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentSubDepartmentPropertiesStep.java delete mode 100644 ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationAddChildForm.java create mode 100644 ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationDepartmentAddForm.java rename ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/{OrganizationChildrenPropertiesStep.java => OrganizationDepartmentPropertiesStep.java} (70%) create mode 100644 ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationPropertiesStep.java delete mode 100644 ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectAddChildForm.java create mode 100644 ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectSubprojectAddForm.java rename ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/{ProjectChildrenPropertiesStep.java => ProjectSubprojectPropertiesStep.java} (81%) diff --git a/ccm-cms-types-department/application.xml b/ccm-cms-types-department/application.xml index 6f7f197ef..f36608c3b 100644 --- a/ccm-cms-types-department/application.xml +++ b/ccm-cms-types-department/application.xml @@ -6,8 +6,8 @@ webapp="ROOT"> - - + + diff --git a/ccm-cms-types-department/pdl/com/arsdigita/content-types/Department.pdl b/ccm-cms-types-department/pdl/com/arsdigita/content-types/Department.pdl index 0a5866bed..05e76c737 100644 --- a/ccm-cms-types-department/pdl/com/arsdigita/content-types/Department.pdl +++ b/ccm-cms-types-department/pdl/com/arsdigita/content-types/Department.pdl @@ -3,6 +3,6 @@ model com.arsdigita.cms.contenttypes; import com.arsdigita.kernel.ACSObject; import com.arsdigita.cms.*; -object type Department extends Organization { +object type Department extends GenericOrganizationalUnit { reference key ( ct_departments.department_id ); } diff --git a/ccm-cms-types-department/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Department.xml b/ccm-cms-types-department/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Department.xml new file mode 100644 index 000000000..fcf0e7b72 --- /dev/null +++ b/ccm-cms-types-department/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Department.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + diff --git a/ccm-cms-types-department/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Department.xml b/ccm-cms-types-department/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Department.xml new file mode 100644 index 000000000..465714565 --- /dev/null +++ b/ccm-cms-types-department/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Department.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ccm-cms-types-department/src/ccm-cms-types-department.config b/ccm-cms-types-department/src/ccm-cms-types-department.config new file mode 100644 index 000000000..d82661708 --- /dev/null +++ b/ccm-cms-types-department/src/ccm-cms-types-department.config @@ -0,0 +1,4 @@ + + + + diff --git a/ccm-cms-types-department/src/ccm-cms-types-department.load b/ccm-cms-types-department/src/ccm-cms-types-department.load new file mode 100644 index 000000000..a9a831237 --- /dev/null +++ b/ccm-cms-types-department/src/ccm-cms-types-department.load @@ -0,0 +1,17 @@ + + + +
+
+ + + + +
+ + + + + + + diff --git a/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/Department.java b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/Department.java new file mode 100644 index 000000000..35677340c --- /dev/null +++ b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/Department.java @@ -0,0 +1,36 @@ +package com.arsdigita.cms.contenttypes; + +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import java.math.BigDecimal; + +/** + * + * @author Jens Pelzetter + */ +public class Department extends GenericOrganizationalUnit { + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.Department"; + + public Department() { + super(BASE_DATA_OBJECT_TYPE); + } + + public Department(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Department(OID oid) { + super(oid); + } + + public Department(DataObject obj) { + super(obj); + } + + public Department(String type) { + super(type); + } +} diff --git a/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/DepartmentInitializer.java b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/DepartmentInitializer.java new file mode 100644 index 000000000..4673ce7bd --- /dev/null +++ b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/DepartmentInitializer.java @@ -0,0 +1,29 @@ +package com.arsdigita.cms.contenttypes; + +import org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class DepartmentInitializer extends ContentTypeInitializer { + + private static final Logger s_log = Logger.getLogger(DepartmentInitializer.class); + + public DepartmentInitializer() { + super("ccm-cms-types-department.pdl.mf", Department.BASE_DATA_OBJECT_TYPE); + } + + @Override + public String[] getStylesheets() { + return new String[] { + "/static/content-types/com/arsdigita/cms/contenttypes/Department.xsl" + }; + } + + @Override + public String getTraversalXML() { + return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Department.xml"; + } + +} diff --git a/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/DepartmentLoader.java b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/DepartmentLoader.java new file mode 100644 index 000000000..8341d96dd --- /dev/null +++ b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/DepartmentLoader.java @@ -0,0 +1,17 @@ +package com.arsdigita.cms.contenttypes; + +/** + * + * @author Jens Pelzetter + */ +public class DepartmentLoader extends AbstractContentTypeLoader { + + private static final String[] TYPES = { + "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Department.xml" + }; + + public String[] getTypes() { + return TYPES; + } + +} diff --git a/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentProjectAddForm.java b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentProjectAddForm.java new file mode 100644 index 000000000..38ef1838f --- /dev/null +++ b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentProjectAddForm.java @@ -0,0 +1,26 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.Project; + +/** + * + * @author Jens Pelzetter + */ +public class DepartmentProjectAddForm + extends GenericOrganizationalUnitChildAddForm { + + public DepartmentProjectAddForm(ItemSelectionModel itemModel) { + super("ProjectAddForm", itemModel); + } + + @Override + protected String getChildDataObjectType() { + return Project.BASE_DATA_OBJECT_TYPE; + } +} diff --git a/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentProjectPropertiesStep.java b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentProjectPropertiesStep.java new file mode 100644 index 000000000..65f4a6298 --- /dev/null +++ b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentProjectPropertiesStep.java @@ -0,0 +1,49 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; +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 org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class DepartmentProjectPropertiesStep extends SimpleEditStep { + + private static final Logger s_log = + Logger.getLogger(DepartmentProjectPropertiesStep.class); + private static String ADD_CHILD_SHEET_NAME = "addProject"; + + public DepartmentProjectPropertiesStep( + ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + this(itemModel, parent, null); + } + + public DepartmentProjectPropertiesStep( + ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { + super(itemModel, parent, prefix); + + BasicItemForm addChildSheet = new DepartmentProjectAddForm(itemModel); + add(ADD_CHILD_SHEET_NAME, + (String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.department.add_project").localize(), + new WorkflowLockedComponentAccess(addChildSheet, itemModel), + addChildSheet.getSaveCancelSection().getCancelButton()); + + GenericOrganizationalUnitChildTable childrenTable = new GenericOrganizationalUnitChildTable( + itemModel); + setDisplayComponent(childrenTable); + } +} diff --git a/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentPropertiesStep.java b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentPropertiesStep.java new file mode 100644 index 000000000..9f7daf1e5 --- /dev/null +++ b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentPropertiesStep.java @@ -0,0 +1,38 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; + +/** + * + * @author Jens Pelzetter + */ +public class DepartmentPropertiesStep + extends GenericOrganizationalUnitPropertiesStep { + + public DepartmentPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + super(itemModel, parent); + } + + @Override + protected void addSteps(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel, + parent), + "cms.contenttypes.ui.orgaunit.contact"); + addStep(new DepartmentSubDepartmentPropertiesStep(itemModel, + parent), + "cms.contenttypes.ui.orgaunit.subdepartments"); + addStep(new DepartmentProjectPropertiesStep(itemModel, + parent), + "cms.contenttypes.ui.orgaunit.projects"); + addStep(new GenericOrganizationalUnitPersonPropertiesStep(itemModel, + parent), + "cms.contenttypes.ui.orgaunit.persons"); + } +} diff --git a/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentSubDepartmentAddForm.java b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentSubDepartmentAddForm.java new file mode 100644 index 000000000..84b04b22b --- /dev/null +++ b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentSubDepartmentAddForm.java @@ -0,0 +1,21 @@ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.Department; + +/** + * + * @author Jens Pelzetter + */ +public class DepartmentSubDepartmentAddForm + extends GenericOrganizationalUnitChildAddForm { + + public DepartmentSubDepartmentAddForm(ItemSelectionModel itemModel) { + super("SubDepartmentAddForm", itemModel); + } + + @Override + protected String getChildDataObjectType() { + return Department.BASE_DATA_OBJECT_TYPE; + } +} diff --git a/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentSubDepartmentPropertiesStep.java b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentSubDepartmentPropertiesStep.java new file mode 100644 index 000000000..10093bdc3 --- /dev/null +++ b/ccm-cms-types-department/src/com/arsdigita/cms/contenttypes/ui/DepartmentSubDepartmentPropertiesStep.java @@ -0,0 +1,42 @@ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; +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 org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class DepartmentSubDepartmentPropertiesStep extends SimpleEditStep { + + private static final Logger s_log = Logger.getLogger( + DepartmentSubDepartmentPropertiesStep.class); + private static String ADD_CHILD_SHEET_NAME = "addChild"; + + public DepartmentSubDepartmentPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + this(itemModel, parent, null); + } + + public DepartmentSubDepartmentPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { + super(itemModel, parent, prefix); + + BasicItemForm addChildSheet = new DepartmentSubDepartmentAddForm(itemModel); + add(ADD_CHILD_SHEET_NAME, (String) ContenttypesGlobalizationUtil. + globalize("cms.contenttypes.ui.genericorgaunit.add_child"). + localize(), + new WorkflowLockedComponentAccess(addChildSheet, itemModel), + addChildSheet.getSaveCancelSection().getCancelButton()); + + GenericOrganizationalUnitChildTable childrenTable = new GenericOrganizationalUnitChildTable( + itemModel); + setDisplayComponent(childrenTable); + } +} diff --git a/ccm-cms-types-organization/application.xml b/ccm-cms-types-organization/application.xml index 2a79205c2..96caef0f6 100644 --- a/ccm-cms-types-organization/application.xml +++ b/ccm-cms-types-organization/application.xml @@ -8,6 +8,7 @@ + diff --git a/ccm-cms-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Organization.xml b/ccm-cms-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Organization.xml index 09a9ac500..675ba002f 100644 --- a/ccm-cms-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Organization.xml +++ b/ccm-cms-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Organization.xml @@ -14,32 +14,13 @@ - - - - - + /> diff --git a/ccm-cms-types-organization/src/ccm-cms-types-organization.load b/ccm-cms-types-organization/src/ccm-cms-types-organization.load index 5f089ecbc..4d3e3abb6 100644 --- a/ccm-cms-types-organization/src/ccm-cms-types-organization.load +++ b/ccm-cms-types-organization/src/ccm-cms-types-organization.load @@ -3,6 +3,7 @@
+ diff --git a/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationAddChildForm.java b/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationAddChildForm.java deleted file mode 100644 index 0d7f9fdc8..000000000 --- a/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationAddChildForm.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.SaveCancelSection; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; -import com.arsdigita.cms.contenttypes.Organization; -import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class OrganizationAddChildForm extends BasicItemForm { - - private static final Logger s_log = Logger.getLogger( - OrganizationAddChildForm.class); - private OrganizationChildrenPropertiesStep m_step; - private ItemSearchWidget m_itemSearch; - private SaveCancelSection m_saveCancelSection; - private final String ITEM_SEARCH = "orgaunitChild"; - private ItemSelectionModel m_itemModel; - - public OrganizationAddChildForm(ItemSelectionModel itemModel) { - super("ChildAddForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.select_child").localize())); - this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. - findByAssociatedObjectType( - Organization.BASE_DATA_OBJECT_TYPE)); - add(this.m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - GenericOrganizationalUnit parent = (GenericOrganizationalUnit) getItemSelectionModel(). - getSelectedObject(state); - - if (!(this.getSaveCancelSection().getCancelButton().isSelected(state))) { - parent.addOrgaUnitChildren((GenericOrganizationalUnit) data.get( - ITEM_SEARCH)); - } - - init(fse); - } -} \ No newline at end of file diff --git a/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationDepartmentAddForm.java b/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationDepartmentAddForm.java new file mode 100644 index 000000000..75990107f --- /dev/null +++ b/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationDepartmentAddForm.java @@ -0,0 +1,21 @@ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.Department; + +/** + * + * @author Jens Pelzetter + */ +public class OrganizationDepartmentAddForm + extends GenericOrganizationalUnitChildAddForm { + + public OrganizationDepartmentAddForm(ItemSelectionModel itemModel) { + super("DepartmentAddForm", itemModel); + } + + @Override + protected String getChildDataObjectType() { + return Department.BASE_DATA_OBJECT_TYPE; + } +} \ No newline at end of file diff --git a/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationChildrenPropertiesStep.java b/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationDepartmentPropertiesStep.java similarity index 70% rename from ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationChildrenPropertiesStep.java rename to ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationDepartmentPropertiesStep.java index d77e977d4..f2b6124c9 100644 --- a/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationChildrenPropertiesStep.java +++ b/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationDepartmentPropertiesStep.java @@ -14,30 +14,31 @@ import org.apache.log4j.Logger; /** * - * @author jensp + * @author Jens Pelzetter */ -public class OrganizationChildrenPropertiesStep extends SimpleEditStep { +public class OrganizationDepartmentPropertiesStep extends SimpleEditStep { - private static final Logger s_log = Logger.getLogger(OrganizationChildrenPropertiesStep.class); - private static String ADD_CHILD_SHEET_NAME = "addChild"; + private static final Logger s_log = Logger.getLogger( + OrganizationDepartmentPropertiesStep.class); + private static String ADD_CHILD_SHEET_NAME = "addDepartment"; - public OrganizationChildrenPropertiesStep( + public OrganizationDepartmentPropertiesStep( ItemSelectionModel itemModel, AuthoringKitWizard parent) { this(itemModel, parent, null); } - public OrganizationChildrenPropertiesStep( + public OrganizationDepartmentPropertiesStep( ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { super(itemModel, parent, prefix); - - BasicItemForm addChildSheet = new OrganizationAddChildForm( + + BasicItemForm addChildSheet = new OrganizationDepartmentAddForm( itemModel); add(ADD_CHILD_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.add_child").localize(), + "cms.contenttypes.ui.organization.add_department").localize(), new WorkflowLockedComponentAccess(addChildSheet, itemModel), addChildSheet.getSaveCancelSection().getCancelButton()); @@ -45,4 +46,4 @@ public class OrganizationChildrenPropertiesStep extends SimpleEditStep { itemModel); setDisplayComponent(childrenTable); } -} \ No newline at end of file +} diff --git a/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationPropertiesStep.java b/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationPropertiesStep.java new file mode 100644 index 000000000..ffdc725dd --- /dev/null +++ b/ccm-cms-types-organization/src/com/arsdigita/cms/contenttypes/ui/OrganizationPropertiesStep.java @@ -0,0 +1,35 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; + +/** + * + * @author Jens Pelzetter + */ +public class OrganizationPropertiesStep + extends GenericOrganizationalUnitPropertiesStep { + + public OrganizationPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + super(itemModel, parent); + } + + @Override + protected void addSteps(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel, + parent), + "cms.contenttypes.ui.orgaunit.contact"); + addStep(new OrganizationDepartmentPropertiesStep(itemModel, + parent), + "cms.contenttypes.ui.orgaunit.departments"); + addStep(new GenericOrganizationalUnitPersonPropertiesStep(itemModel, + parent), + "cms.contenttypes.ui.orgaunit.persons"); + } +} diff --git a/ccm-cms-types-project/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml b/ccm-cms-types-project/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml index 32ea788fc..88af81e96 100644 --- a/ccm-cms-types-project/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml +++ b/ccm-cms-types-project/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml @@ -4,43 +4,22 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd"> - - - - - - - + component="com.arsdigita.cms.contenttypes.ui.ProjectPropertiesStep" + ordering="1"/> + diff --git a/ccm-cms-types-project/src/ccm-cms-types-project.load b/ccm-cms-types-project/src/ccm-cms-types-project.load index 40ed693fd..b575d12ad 100644 --- a/ccm-cms-types-project/src/ccm-cms-types-project.load +++ b/ccm-cms-types-project/src/ccm-cms-types-project.load @@ -3,6 +3,7 @@
+ diff --git a/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectAddChildForm.java b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectAddChildForm.java deleted file mode 100644 index ebad665de..000000000 --- a/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectAddChildForm.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * To change this template, choose Tools | Templates - * and open the template in the editor. - */ - -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.SaveCancelSection; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; -import com.arsdigita.cms.contenttypes.Project; -import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class ProjectAddChildForm extends BasicItemForm{ - - private static final Logger s_log = Logger.getLogger(ProjectAddChildForm.class); - private ProjectChildrenPropertiesStep m_step; - private ItemSearchWidget m_itemSearch; - private SaveCancelSection m_saveCancelSection; - private final String ITEM_SEARCH = "projectChild"; - private ItemSelectionModel m_itemModel; - - public ProjectAddChildForm(ItemSelectionModel itemModel) { - super("ChildAddForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label((String) ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.select_child").localize())); - this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. - findByAssociatedObjectType( - Project.BASE_DATA_OBJECT_TYPE)); - add(this.m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - GenericOrganizationalUnit parent = (GenericOrganizationalUnit) getItemSelectionModel(). - getSelectedObject(state); - - if (!(this.getSaveCancelSection().getCancelButton().isSelected(state))) { - parent.addOrgaUnitChildren((GenericOrganizationalUnit) data.get( - ITEM_SEARCH)); - } - - init(fse); - } - -} diff --git a/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectSubprojectAddForm.java b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectSubprojectAddForm.java new file mode 100644 index 000000000..351e11c9d --- /dev/null +++ b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectSubprojectAddForm.java @@ -0,0 +1,21 @@ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.Project; + +/** + * + * @author Jens Pelzetter + */ +public class ProjectSubprojectAddForm + extends GenericOrganizationalUnitChildAddForm { + + public ProjectSubprojectAddForm(ItemSelectionModel itemModel) { + super("SubprojectAddForm", itemModel); + } + + @Override + protected String getChildDataObjectType() { + return Project.BASE_DATA_OBJECT_TYPE; + } +} diff --git a/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectChildrenPropertiesStep.java b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectSubprojectPropertiesStep.java similarity index 81% rename from ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectChildrenPropertiesStep.java rename to ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectSubprojectPropertiesStep.java index 89bd30930..728e816b7 100644 --- a/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectChildrenPropertiesStep.java +++ b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectSubprojectPropertiesStep.java @@ -16,24 +16,24 @@ import org.apache.log4j.Logger; * * @author Jens Pelzetter */ -public class ProjectChildrenPropertiesStep extends SimpleEditStep { +public class ProjectSubprojectPropertiesStep extends SimpleEditStep { private final static Logger s_log = Logger.getLogger( - ProjectChildrenPropertiesStep.class); + ProjectSubprojectPropertiesStep.class); private String ADD_CHILD_SHEET_NAME = "addChild"; - public ProjectChildrenPropertiesStep(ItemSelectionModel itemModel, + public ProjectSubprojectPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { this(itemModel, parent, null); } - public ProjectChildrenPropertiesStep( + public ProjectSubprojectPropertiesStep( ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { super(itemModel, parent, prefix); - BasicItemForm addChildSheet = new ProjectAddChildForm(itemModel); + BasicItemForm addChildSheet = new ProjectSubprojectAddForm(itemModel); add(ADD_CHILD_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize( "cms.contenttypes.ui.genericorgaunit.add_child").localize(), diff --git a/ccm-cms/.settings/org.eclipse.jdt.core.prefs b/ccm-cms/.settings/org.eclipse.jdt.core.prefs index bd9ef2817..3cee92cf0 100755 --- a/ccm-cms/.settings/org.eclipse.jdt.core.prefs +++ b/ccm-cms/.settings/org.eclipse.jdt.core.prefs @@ -1,4 +1,4 @@ -#Tue Jul 20 17:23:53 CEST 2010 +#Wed Jul 21 09:20:24 CEST 2010 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 @@ -37,7 +37,7 @@ org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore org.eclipse.jdt.core.compiler.problem.nullReference=ignore org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning @@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning +org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled diff --git a/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl b/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl index 211d9d714..35faa9367 100644 --- a/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl +++ b/ccm-cms/pdl/com/arsdigita/content-types/GenericOrganizationalUnit.pdl @@ -22,7 +22,7 @@ model com.arsdigita.cms.contenttypes; import com.arsdigita.cms.ContentPage; -//PDL definition for a commons base type for orgnizations, departments, projects etc. +// PDL definition for a commons base type for orgnizations, departments, projects etc. object type GenericOrganizationalUnit extends ContentPage { //String[0..1] orgaunit_name = cms_organizationalunits.name VARCHAR(256); @@ -31,7 +31,7 @@ object type GenericOrganizationalUnit extends ContentPage { reference key (cms_organizationalunits.organizationalunit_id); } -//Parent <-> child relation organizationalunits to build department structures etc. +// Parent <-> child relation organizationalunits to build department structures etc. association { GenericOrganizationalUnit[0..1] orgaunit_parent = join cms_organizationalunits.organizationalunit_id @@ -44,11 +44,11 @@ association { join cms_organizationalunits_organizationalunit_map.orgaunit_children_id to cms_organizationalunits.organizationalunit_id; - //Link attribute, allows it to customize the order which the childs will be shown. + // Link attribute, allows it to customize the order which the childs will be shown. BigDecimal[0..1] orgaunit_children_order = cms_organizationalunits_organizationalunit_map.map_order INTEGER; } -//Link for contact points. +// Link for contact points. association { GenericOrganizationalUnit[0..1] organizationalunit = join cms_contacts.contact_id @@ -61,13 +61,13 @@ association { join cms_organizationalunits_contact_map.contact_id to cms_contacts.contact_id; - //Some link attributes. + // Some link attributes. String contact_type = cms_organizationalunits_contact_map.contact_type VARCHAR(100); BigDecimal contact_order = cms_organizationalunits_contact_map.map_order INTEGER; } -//Links a organization with persons. +// Links a organization with persons. association { GenericOrganizationalUnit[0..1] organizationalunit = join cms_persons.person_id @@ -80,7 +80,7 @@ association { join cms_organizationalunits_person_map.person_id to cms_persons.person_id; - //Additional attributes for the association + // Additional attributes for the association String role_name = cms_organizationalunits_person_map.role_name VARCHAR(100); BigDecimal person_order = cms_organizationalunits_person_map.map_order INTEGER; diff --git a/ccm-cms/src/WEB-INF/content-types/GenericOrganizationalUnit.xml b/ccm-cms/src/WEB-INF/content-types/GenericOrganizationalUnit.xml index 217439a8a..6cfd407ec 100644 --- a/ccm-cms/src/WEB-INF/content-types/GenericOrganizationalUnit.xml +++ b/ccm-cms/src/WEB-INF/content-types/GenericOrganizationalUnit.xml @@ -22,34 +22,6 @@ component="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitPropertiesStep" ordering="1" /> - - - - - - - diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java index c4ce5b695..d0c28ec67 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java @@ -30,6 +30,11 @@ import java.math.BigDecimal; * This class provides a base type for building content types which represent organizations, * departments, projects etc. * + * An item of this content type can be linked with several other content types: + * - Contact (0..n) + * - Person (0..n) + * - GenericOrganizationalUnit (0..n) to build organizations structures. + * * @author Jens Pelzetter * @version $Id$ */ @@ -67,21 +72,6 @@ public class GenericOrganizationalUnit extends ContentPage { super(type); } - /*@Override - public void beforeSave() { - super.beforeSave(); - - Assert.exists(getContentType(), ContentType.class); - }*/ - - /*public String getOrgaUnitName() { - return (String) get(ORGAUNIT_NAME); - } - - public void setOrgaUnitName(String orgaUnitName) { - set(ORGAUNIT_NAME, orgaUnitName); - }*/ - public String getAddendum() { return (String) get(ADDENDUM); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitChildrenCollection.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitChildrenCollection.java index 1742000a6..f37491e80 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitChildrenCollection.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitChildrenCollection.java @@ -1,6 +1,20 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright (c) 2010 Jens Pelzetter, for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * */ package com.arsdigita.cms.contenttypes; @@ -9,22 +23,23 @@ import com.arsdigita.persistence.DataCollection; import java.math.BigDecimal; /** + * Collection class for the childs of a GenericOrganizationalUnit. * - * @author jensp + * @author Jens Pelzetter */ public class GenericOrganizationalUnitChildrenCollection extends DomainCollection { - public static final String ORDER = "link.contact_order asc"; - public static final String CHILDREN_ORDER = "link.children_order"; + public static final String ORDER = "map_order asc"; + //public static final String CHILDREN_ORDER = "link.children_order"; public GenericOrganizationalUnitChildrenCollection(DataCollection dataCollection) { super(dataCollection); - m_dataCollection.addOrder(ORDER); + //m_dataCollection.addOrder(ORDER); } public String getChildrenOrder() { - String retVal = ((BigDecimal) m_dataCollection.get(CHILDREN_ORDER)).toString(); + String retVal = ((BigDecimal) m_dataCollection.get(ORDER)).toString(); if (retVal == null || retVal.isEmpty()) { retVal = String.valueOf(this.getPosition()); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitContactCollection.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitContactCollection.java index 01d337d64..22cdd221a 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitContactCollection.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitContactCollection.java @@ -1,6 +1,20 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright (c) 2010 Jens Pelzetter, for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * */ package com.arsdigita.cms.contenttypes; @@ -9,8 +23,9 @@ import com.arsdigita.persistence.DataCollection; import java.math.BigDecimal; /** + * Collection class for the GenericOrganizationalUnit -> Contact relation. * - * @author jensp + * @author Jens Pelzetter */ public class GenericOrganizationalUnitContactCollection extends DomainCollection { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitPersonCollection.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitPersonCollection.java index 764f2be12..9071c98ca 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitPersonCollection.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnitPersonCollection.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2010 Jens Pelzetter, for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ package com.arsdigita.cms.contenttypes; import com.arsdigita.domain.DomainCollection; @@ -5,6 +23,7 @@ import com.arsdigita.persistence.DataCollection; import java.math.BigDecimal; /** + * Collection class for the GenericOrganizationalUnit -> Person relation. * * @author Jens Pelzetter */ diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildAddForm.java index b36e9301c..4c3799b15 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildAddForm.java @@ -1,3 +1,22 @@ +/* + * Copyright (c) 2010 Jens Pelzetter, + * for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; @@ -15,21 +34,28 @@ import com.arsdigita.cms.ui.authoring.BasicItemForm; import org.apache.log4j.Logger; /** + * Form for adding a child to an organization. To change the type of childs + * allowed, overwrite the {@link getChildDataObjectType()} method. * * @author Jens Pelzetter */ -public class GenericOrganizationalUnitAddChildForm extends BasicItemForm { +public class GenericOrganizationalUnitChildAddForm extends BasicItemForm { private static final Logger s_log = Logger.getLogger( GenericOrganizationalUnitChildAddForm.class); private GenericOrganizationalUnitChildrenPropertiesStep m_step; - private ItemSearchWidget m_itemSGenericOrganizationalUnitAddChildFormearch; + private ItemSearchWidget m_itemSearch; private SaveCancelSection m_saveCancelSection; private final String ITEM_SEARCH = "orgaunitChild"; private ItemSelectionModel m_itemModel; public GenericOrganizationalUnitChildAddForm(ItemSelectionModel itemModel) { - super("ChildAddForm", itemModel); + this("ChildAddForm", itemModel); + } + + public GenericOrganizationalUnitChildAddForm(String formName, + ItemSelectionModel itemModel) { + super(formName, itemModel); } @Override @@ -38,7 +64,7 @@ public class GenericOrganizationalUnitAddChildForm extends BasicItemForm { "cms.contenttypes.ui.genericorgaunit.select_child").localize())); this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType( - GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE)); + getChildDataObjectType())); add(this.m_itemSearch); } @@ -64,4 +90,12 @@ public class GenericOrganizationalUnitAddChildForm extends BasicItemForm { init(fse); } + + /** + * + * @return The BASE_DATA_OBJECT_TYPE of the childs allowed. + */ + protected String getChildDataObjectType() { + return GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE; + } } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildTable.java index 1a8466143..9bfe90759 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildTable.java @@ -1,6 +1,21 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright (c) 2010 Jens Pelzetter, + * for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * */ package com.arsdigita.cms.contenttypes.ui; @@ -26,6 +41,7 @@ import com.arsdigita.util.LockableImpl; import java.math.BigDecimal; /** + * Table for showing the childs of an organization. * * @author Jens Pelzetter */ diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildrenPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildrenPropertiesStep.java index 59746d235..f67ad1ff2 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildrenPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitChildrenPropertiesStep.java @@ -1,3 +1,22 @@ +/* + * Copyright (c) 2010 Jens Pelzetter, + * for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.cms.ItemSelectionModel; @@ -8,8 +27,9 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; /** + * Step for editing the childs of an organization (other organizations). * - * @author jensp + * @author Jens Pelzetter */ public class GenericOrganizationalUnitChildrenPropertiesStep extends SimpleEditStep { diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java index b9fe44aad..f00776bf6 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactAddForm.java @@ -1,6 +1,21 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright (c) 2010 Jens Pelzetter, + * for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * */ package com.arsdigita.cms.contenttypes.ui; @@ -29,6 +44,7 @@ import com.arsdigita.dispatcher.DispatcherHelper; import org.apache.log4j.Logger; /** + * Form for addings an related contact to an organization. * * @author Jens Pelzetter */ @@ -74,6 +90,9 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm { contactType.addOption(new Option(ct.getKey(), ct.getName())); } + //Only for testing + contactType.addOption(new Option("commonContact", "Common Contact")); + add(contactType); } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactPropertiesStep.java index 34e005521..2f6fcd2c5 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactPropertiesStep.java @@ -1,6 +1,21 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright (c) 2010 Jens Pelzetter, + * for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * */ package com.arsdigita.cms.contenttypes.ui; @@ -12,6 +27,7 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; /** + * Step for editing the associated contacts. * * @author Jens Pelzetter */ diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java index 9470b01ca..ff6aa340f 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitContactTable.java @@ -1,6 +1,21 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright (c) 2010 Jens Pelzetter, + * for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * */ package com.arsdigita.cms.contenttypes.ui; @@ -31,6 +46,7 @@ import java.math.BigDecimal; import java.math.BigInteger; /** + * Table for showing the contacts associated with an organization. * * @author Jens Pelzetter */ diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java index 5faa620ed..f3d2cd034 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java @@ -1,6 +1,21 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright (c) 2010 Jens Pelzetter, + * for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * */ package com.arsdigita.cms.contenttypes.ui; @@ -20,6 +35,7 @@ import com.arsdigita.cms.ui.authoring.BasicItemForm; import org.apache.log4j.Logger; /** + * Form for adding related persons the an organization. * * @author Jens Pelzetter */ diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonPropertiesStep.java index 1d2edcbec..db53b9141 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonPropertiesStep.java @@ -1,3 +1,22 @@ +/* + * Copyright (c) 2010 Jens Pelzetter, + * for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.cms.ItemSelectionModel; @@ -8,10 +27,12 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; /** + * Properties step for editing the persons related to an organization. * * @author Jens Pelzetter */ -public class GenericOrganizationalUnitPersonPropertiesStep extends SimpleEditStep { +public class GenericOrganizationalUnitPersonPropertiesStep + extends SimpleEditStep { private static final String ADD_PERSON_SHEET_NAME = "addPerson"; diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java index 6b387734f..9c78fe82b 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonsTable.java @@ -1,3 +1,22 @@ +/* + * Copyright (c) 2010 Jens Pelzetter, + * for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.Component; @@ -23,6 +42,7 @@ import com.arsdigita.util.LockableImpl; import java.math.BigDecimal; /** + * Table for showing the persons associated with an organization. * * @author Jens Pelzetter */ diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertiesStep.java index a6f495302..87fb31ab4 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertiesStep.java @@ -2,7 +2,6 @@ * 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; @@ -24,71 +23,122 @@ import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import java.text.DateFormat; /** + * PropertiesStep for GenericOrganizationalUnits. This properties step uses an + * SegmentedPanel to show all relevant data of an organization. To change the + * steps shown, extend this class, and overwrite the {@link addSteps()} method. * * @author Jens Pelzetter */ public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep { public static final String EDIT_SHEET_NAME = "edit"; + private SegmentedPanel segmentedPanel; public GenericOrganizationalUnitPropertiesStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { + AuthoringKitWizard parent) { super(itemModel, parent); - SegmentedPanel segmentedPanel = new SegmentedPanel(); - + segmentedPanel = new SegmentedPanel(); setDefaultEditKey(EDIT_SHEET_NAME); - - SimpleEditStep basicProperties = new SimpleEditStep(itemModel, - parent, - EDIT_SHEET_NAME); - - BasicPageForm editBasicSheet = - new GenericOrganizationalUnitPropertyForm(itemModel, this); - basicProperties.add(EDIT_SHEET_NAME, - (String) ContenttypesGlobalizationUtil - .globalize("cms.contenttypes.ui.genericorgaunit.edit_basic_properties").localize(), - new WorkflowLockedComponentAccess(editBasicSheet, itemModel), - editBasicSheet.getSaveCancelSection().getCancelButton()); - - basicProperties.setDisplayComponent(getGenericOrganizationalUnitPropertySheet(itemModel)); - - segmentedPanel.addSegment( - new Label((String) ContenttypesGlobalizationUtil - .globalize("cms.contenttypes.ui.genericorganunit.basic_properties").localize()), - basicProperties); + + addBasicProperties(itemModel, parent); + addSteps(itemModel, parent); setDisplayComponent(segmentedPanel); } - public static Component - getGenericOrganizationalUnitPropertySheet( + public static Component getGenericOrganizationalUnitPropertySheet( ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); + DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( + itemModel); - sheet.add(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.genericorganunit.name"), - GenericOrganizationalUnit.NAME); - sheet.add(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.genericorganunit.addendum"), - GenericOrganizationalUnit.ADDENDUM); + sheet.add(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorganunit.name"), + GenericOrganizationalUnit.NAME); + sheet.add(ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorganunit.addendum"), + GenericOrganizationalUnit.ADDENDUM); if (!ContentSection.getConfig().getHideLaunchDate()) { - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(), - ContentPage.LAUNCH_DATE, - new DomainObjectPropertySheet.AttributeFormatter() { + sheet.add((String) ContenttypesGlobalizationUtil.globalize( + "cms.ui.authoring.page_launch_date").localize(), + ContentPage.LAUNCH_DATE, + new DomainObjectPropertySheet.AttributeFormatter() { - public String format(DomainObject item, - String attribute, - PageState state) { - ContentPage page = (ContentPage) item; - if (page.getLaunchDate() != null) { - return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate()); - } else { - return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize(); - } - } - }); + public String format(DomainObject item, + String attribute, + PageState state) { + ContentPage page = (ContentPage) item; + if (page.getLaunchDate() != null) { + return DateFormat.getDateInstance(DateFormat.LONG). + format(page.getLaunchDate()); + } else { + return (String) ContenttypesGlobalizationUtil.globalize( + "cms.ui.unknown").localize(); + } + } + }); } return sheet; } + + protected void addBasicProperties(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + SimpleEditStep basicProperties = new SimpleEditStep(itemModel, + parent, + EDIT_SHEET_NAME); + + BasicPageForm editBasicSheet = + new GenericOrganizationalUnitPropertyForm(itemModel, this); + basicProperties.add(EDIT_SHEET_NAME, + (String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorgaunit.edit_basic_properties"). + localize(), + new WorkflowLockedComponentAccess(editBasicSheet, + itemModel), + editBasicSheet.getSaveCancelSection(). + getCancelButton()); + + basicProperties.setDisplayComponent(getGenericOrganizationalUnitPropertySheet( + itemModel)); + + segmentedPanel.addSegment( + new Label((String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorganunit.basic_properties"). + localize()), + basicProperties); + } + + /** + * This method adds the steps for editing the relations of an organization. + * To change the steps, overwrite this method. + * + * @param itemModel + * @param parent + */ + protected void addSteps(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel, + parent), + "cms.contenttypes.ui.orgaunit.contact"); + addStep(new GenericOrganizationalUnitChildrenPropertiesStep(itemModel, + parent), + "cms.contenttypes.ui.orgaunit.contact"); + addStep(new GenericOrganizationalUnitPersonPropertiesStep(itemModel, + parent), + "cms.contenttypes.ui.orgaunit.persons"); + } + + /** + * Helper method for editing a step. + * + * @param step + * @param labelKey + */ + protected void addStep(SimpleEditStep step, String labelKey) { + segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil. + globalize(labelKey).localize()), + step); + } } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java index ee507f984..db23a717f 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPropertyForm.java @@ -1,6 +1,21 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright (c) 2010 Jens Pelzetter, + for the Center of Social Politics of the University of Bremen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * */ package com.arsdigita.cms.contenttypes.ui; @@ -12,7 +27,6 @@ import com.arsdigita.bebop.event.FormProcessListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.bebop.form.TextField; -import com.arsdigita.bebop.parameters.DateParameter; import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.cms.ItemSelectionModel; @@ -22,6 +36,7 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm; import org.apache.log4j.Logger; /** + * Form for editing the basic properties of an GenericOrganizationalUnit. * * @author Jens Pelzetter */