diff --git a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml b/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml index 510e97c5c..f8908a25b 100644 --- a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml +++ b/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml @@ -13,7 +13,7 @@ - + diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java index 01f08766a..384f1f65b 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java @@ -25,16 +25,9 @@ import com.arsdigita.persistence.OID; import java.math.BigDecimal; /** - *

- * Specialized variant of {@link GenericPerson} for members of scientific - * organizations. Adds two fields to the fields of GenericPerson: - *

- *
- *
associatedMember
- *
Is the member an associated member?
- *
formerMember
- *
Is the member a former member?
- * + * A concrete class extending {@link GenericPerson}. Does not add any new + * fields, it just makes the internal type GenericPerson usable + * without any other modules. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java index 41f6b6dc6..4fb461de7 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java @@ -25,6 +25,7 @@ public class SciOrganizationConfig extends AbstractConfig { private final Parameter m_departmentSetOrganizationHide; private final Parameter m_departmentSetSuperDepartmentHide; private final Parameter m_departmentAddContactHide; + private final Parameter m_departmentPublicationsHide; private final Parameter m_projectAddPersonHide; private final Parameter m_projectAddOrganizationHide; private final Parameter m_projectAddDepartmentHide; @@ -98,6 +99,10 @@ public class SciOrganizationConfig extends AbstractConfig { "com.arsdigita.cms.contenttypes.scidepartment.add_contact_hide", Parameter.REQUIRED, Boolean.FALSE); + m_departmentPublicationsHide = new BooleanParameter( + "com.arsdigita.cms.contenttypes.scidepartment.publications_hide", + Parameter.REQUIRED, + Boolean.FALSE); m_projectAddPersonHide = new BooleanParameter( "com.arsdigita.cms.contenttypes.sciproject.add_person_hide", Parameter.REQUIRED, @@ -170,6 +175,7 @@ public class SciOrganizationConfig extends AbstractConfig { register(m_departmentAddProjectHide); register(m_departmentSetOrganizationHide); register(m_departmentSetSuperDepartmentHide); + register(m_departmentPublicationsHide); register(m_projectAddPersonHide); register(m_projectAddOrganizationHide); @@ -251,6 +257,10 @@ public class SciOrganizationConfig extends AbstractConfig { return (Boolean) get(m_departmentAddContactHide); } + public final boolean getDepartmentPublicationsHide() { + return (Boolean) get(m_departmentPublicationsHide); + } + public final boolean getProjectAddPersonHide() { return (Boolean) get(m_projectAddPersonHide); } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig_parameter.properties b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig_parameter.properties index 9793d2c3e..063f73736 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig_parameter.properties +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig_parameter.properties @@ -133,3 +133,7 @@ com.arsdigita.cms.contenttypes.sciorganization.members_merge.purpose = Merge mem com.arsdigita.cms.contenttypes.sciorganization.members_merge.example = false com.arsdigita.cms.contenttypes.sciorganization.members_merge.format = [boolean] +com.arsdigita.cms.contenttypes.scidepartment.publications_hide.title = Hides the step for linking publications with a department +com.arsdigita.cms.contenttypes.scidepartment.publications_hide.purpose = Hides the step for linking publications with a department +com.arsdigita.cms.contenttypes.scidepartment.publications_hide.example = false +com.arsdigita.cms.contenttypes.scidepartment.publications_hide.format = [boolean] diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java index eb2767f3e..1d87738b4 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java @@ -21,6 +21,8 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.Component; import com.arsdigita.bebop.Label; +import com.arsdigita.cms.ContentType; +import com.arsdigita.cms.ContentTypeCollection; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.SciDepartment; import com.arsdigita.cms.contenttypes.SciOrganizationConfig; @@ -130,5 +132,21 @@ public class SciDepartmentPropertiesStep SciOrganizationGlobalizationUtil.globalize( "sciorganization.ui.department.organization")); } + + ContentTypeCollection contentTypes = ContentType.getAllContentTypes(); + contentTypes.addFilter("associatedObjectType = :type").set( + "type", + "com.arsdigita.cms.contenttypes.Publication"); + if ((!config.getDepartmentPublicationsHide()) + && (contentTypes.size() > 0)) { + /* + * Must add this step manually since the basic class is not + * SimpleEditStep... + */ + getSegmentedPanel().addSegment(new Label(SciOrganizationGlobalizationUtil. + globalize("sciorganization.ui.department.publications")), + new SciDepartmentPublicationsStep( + itemModel, parent)); + } } } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsStep.java new file mode 100644 index 000000000..c5bda9e82 --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsStep.java @@ -0,0 +1,41 @@ +/* + * 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.ContentType; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contentassets.ui.RelatedLinkPropertiesStep; +import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; + +/** + * + * @author Jens Pelzetter + */ +public class SciDepartmentPublicationsStep extends RelatedLinkPropertiesStep { + + protected String m_linkListName = "SciDepartmentPublications"; + protected ContentType m_contentType = ContentType.findByAssociatedObjectType( + "com.arsdigita.cms.contenttypes.Publication"); + + public SciDepartmentPublicationsStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + super(itemModel, parent); + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java index 6ee6607ef..b88cfeed9 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java @@ -1,7 +1,25 @@ +/* + * 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; -import com.arsdigita.bebop.PageState; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.SciMember; @@ -9,7 +27,6 @@ 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.domain.DomainObject; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java index a18a7ec53..83fece82a 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java @@ -20,16 +20,11 @@ package com.arsdigita.cms.contenttypes.ui; import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.Label; import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; import com.arsdigita.bebop.form.CheckboxGroup; -import com.arsdigita.bebop.form.Option; -import com.arsdigita.bebop.parameters.ArrayParameter; -import com.arsdigita.bebop.parameters.BooleanParameter; -import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.SciMember; @@ -49,11 +44,11 @@ public class SciMemberPropertyForm implements FormInitListener, FormSubmissionListener { - private static final Logger logger = + /*private static final Logger logger = Logger.getLogger(SciMemberPropertyForm.class); private SciMemberPropertiesStep m_step; private CheckboxGroup m_associated; - private CheckboxGroup m_former; + private CheckboxGroup m_former;*/ public SciMemberPropertyForm(ItemSelectionModel itemModel) { this(itemModel, null); @@ -62,7 +57,7 @@ public class SciMemberPropertyForm public SciMemberPropertyForm(ItemSelectionModel itemModel, SciMemberPropertiesStep step) { super(itemModel); - m_step = step; + //m_step = step; } @Override diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties index c234d2c6b..52d2224df 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties @@ -134,3 +134,4 @@ sciorganization.ui.project.add_member\ =Add member sciorganization.ui.project.subproject..confirm_remove=Are you sure to remove this subproject? sciorganization.ui.project.superproject..confirm_remove=Are you sure to remove the superior project? sciorganization.ui.project.add_member=Add member +sciorganization.ui.department.publications=Publications of the department diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties index 191a556e9..d32a8b974 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties @@ -134,3 +134,4 @@ sciorganization.ui.project.add_member\ =Mitglied hinzuf\u00fcgen sciorganization.ui.project.subproject..confirm_remove=Sind sie sicher das sie dieses Unterprojekt entfernen wollen? sciorganization.ui.project.superproject..confirm_remove=Wollen sie dieses \u00fcbergeordnete Projekt wirklich entfernen? sciorganization.ui.project.add_member=Mitglied hinzuf\u00fcgen +sciorganization.ui.department.publications=Publikationen der Abteilung diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsStep.java index 4f835eaba..b2ddd2822 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsStep.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,7 +35,7 @@ public class SciProjectPublicationsStep extends RelatedLinkPropertiesStep { "com.arsdigita.cms.contenttypes.Publication"); public SciProjectPublicationsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { + AuthoringKitWizard parent) { super(itemModel, parent); } }