From b4c8a8ca96f8ca6565f31c39695bb41e70a5a139 Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 7 Nov 2013 19:53:19 +0000 Subject: [PATCH] =?UTF-8?q?-=20ListView=20f=C3=BCr=20SciDepartment=20um=20?= =?UTF-8?q?Abteilungsleitung=20usw.=20erweitert.=20-=20fehlende=20Lizenzhe?= =?UTF-8?q?ader=20und=20Kommentare=20f=C3=BCr=20ccm-sci-types-department?= =?UTF-8?q?=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@2428 8810af33-2d31-482b-a856-94f89814c4df --- .../ui/GenericOrgaUnitExtraXmlGenerator.java | 34 +++- .../PublicationExportLinksInitalizer.java | 20 +++ .../PublicationExportLinksLoader.java | 22 ++- .../cms/contenttypes/SciDepartment.java | 28 ++- .../cms/contenttypes/SciDepartmentBundle.java | 22 ++- .../cms/contenttypes/SciDepartmentConfig.java | 109 +++++++++++- .../SciDepartmentConfig_parameter.properties | 40 +++++ .../SciDepartmentInitializer.java | 4 +- .../cms/contenttypes/SciDepartmentLoader.java | 21 ++- .../SciDepartmentMemberStatus.java | 21 ++- .../contenttypes/ui/SciDepartmentCreate.java | 21 ++- .../contenttypes/ui/SciDepartmentDescTab.java | 49 ++++-- .../ui/SciDepartmentDescriptionEditForm.java | 21 ++- .../ui/SciDepartmentDescriptionStep.java | 21 ++- .../SciDepartmentDescriptionUploadForm.java | 21 ++- .../ui/SciDepartmentExtraXmlGenerator.java | 161 +++++++++++++++++- .../ui/SciDepartmentGlobalizationUtil.java | 2 +- .../ui/SciDepartmentMemberAddForm.java | 28 ++- .../ui/SciDepartmentMemberTable.java | 26 ++- .../ui/SciDepartmentMembersStep.java | 32 +++- .../ui/SciDepartmentMembersTab.java | 36 ++-- .../ui/SciDepartmentMembersTabConfig.java | 28 ++- .../ui/SciDepartmentProjectsStep.java | 21 ++- .../ui/SciDepartmentProjectsTab.java | 21 ++- .../ui/SciDepartmentProjectsTabConfig.java | 21 ++- .../ui/SciDepartmentPropertiesStep.java | 21 ++- .../ui/SciDepartmentPropertyForm.java | 21 ++- .../ui/SciDepartmentPublicationsTab.java | 21 ++- .../SciDepartmentPublicationsTabConfig.java | 21 ++- .../ui/SciDepartmentResources.properties | 3 - .../ui/SciDepartmentSubDepartmentsStep.java | 21 ++- .../ui/SciDepartmentSummaryTab.java | 96 ++++------- .../ui/SciDepartmentSummaryTabConfig.java | 64 +++---- ...tmentSummaryTabConfig_parameter.properties | 20 --- .../ui/SciDepartmentSuperDepartmentsStep.java | 21 ++- .../ui/SciProjectDepartmentsStep.java | 21 ++- .../com/arsdigita/subsite/ui/SiteTable.java | 7 +- .../subsite/ui/SubsiteResources.properties | 1 + .../subsite/ui/SubsiteResources_de.properties | 1 + 39 files changed, 967 insertions(+), 202 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitExtraXmlGenerator.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitExtraXmlGenerator.java index e81511e62..0c0306a4e 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitExtraXmlGenerator.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrgaUnitExtraXmlGenerator.java @@ -1,7 +1,22 @@ /* - * To change this template, choose Tools | Templates - * and open the template in the editor. + * Copyright (c) 2013 Jens Pelzetter + * + * 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.Page; @@ -32,12 +47,9 @@ import org.apache.log4j.Logger; * @version $Id: GenericOrgaUnitExtraXmlGenerator.java 1186 2011-10-21 18:20:36Z * jensp $ */ -public abstract class GenericOrgaUnitExtraXmlGenerator - implements ExtraXMLGenerator { +public abstract class GenericOrgaUnitExtraXmlGenerator implements ExtraXMLGenerator { - private final static Logger LOGGER = - Logger.getLogger( - GenericOrgaUnitExtraXmlGenerator.class); + private final static Logger LOGGER = Logger.getLogger(GenericOrgaUnitExtraXmlGenerator.class); private boolean listMode = false; private final static String SELECTED_TAB_PARAM = "selectedTab"; private String showOnly; @@ -76,8 +88,7 @@ public abstract class GenericOrgaUnitExtraXmlGenerator } final long availableStart = System.currentTimeMillis(); if ((showOnly == null) || showOnly.isEmpty()) { - for (Map.Entry entry : - tabs.entrySet()) { + for (Map.Entry entry : tabs.entrySet()) { if (entry.getValue().hasData(orgaunit, state)) { createAvailableTabElem(availableTabsElem, entry.getKey(), @@ -204,10 +215,15 @@ public abstract class GenericOrgaUnitExtraXmlGenerator return tab; } + @Override public void addGlobalStateParams(final Page page) { //Nothing yet } + public boolean getListMode() { + return listMode; + } + @Override public void setListMode(final boolean listMode) { this.listMode = listMode; diff --git a/ccm-sci-publicationsexportlinks/src/com/arsdigita/cms/scipublications/PublicationExportLinksInitalizer.java b/ccm-sci-publicationsexportlinks/src/com/arsdigita/cms/scipublications/PublicationExportLinksInitalizer.java index 917bd98f7..732e2e23a 100644 --- a/ccm-sci-publicationsexportlinks/src/com/arsdigita/cms/scipublications/PublicationExportLinksInitalizer.java +++ b/ccm-sci-publicationsexportlinks/src/com/arsdigita/cms/scipublications/PublicationExportLinksInitalizer.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.scipublications; import com.arsdigita.db.DbHelper; @@ -9,6 +27,8 @@ import com.arsdigita.runtime.PDLInitializer; import com.arsdigita.runtime.RuntimeConfig; /** + * Initalizer for the PublicationExportLinks module. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-publicationsexportlinks/src/com/arsdigita/cms/scipublications/PublicationExportLinksLoader.java b/ccm-sci-publicationsexportlinks/src/com/arsdigita/cms/scipublications/PublicationExportLinksLoader.java index 18b8064d4..ced9dcb4b 100644 --- a/ccm-sci-publicationsexportlinks/src/com/arsdigita/cms/scipublications/PublicationExportLinksLoader.java +++ b/ccm-sci-publicationsexportlinks/src/com/arsdigita/cms/scipublications/PublicationExportLinksLoader.java @@ -1,10 +1,30 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.scipublications; import com.arsdigita.loader.PackageLoader; import com.arsdigita.runtime.ScriptContext; /** - * + * Loader for the PublicationExportLinks module. Does nothing, simply here to satisfy the loader + * process. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartment.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartment.java index a7b212d64..4d3ac19d0 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartment.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartment.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.cms.ExtraXMLGenerator; @@ -11,7 +29,8 @@ import java.math.BigDecimal; import java.util.List; /** - * + * The DomainObject for SciDepartment items. + * * @author Jens Pelzetter * @version $Id$ */ @@ -231,6 +250,13 @@ public class SciDepartment extends GenericOrganizationalUnit { return generators; } + @Override + public List getExtraListXMLGenerators() { + final List generators = super.getExtraListXMLGenerators(); + generators.add(new SciDepartmentExtraXmlGenerator()); + return generators; + } + @Override public String getSearchSummary() { return getDepartmentShortDescription(); diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentBundle.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentBundle.java index 31243265f..1de8b3175 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentBundle.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentBundle.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.cms.ContentItem; @@ -8,7 +26,9 @@ import com.arsdigita.util.Assert; import java.math.BigDecimal; /** - * + * Special content bundle for SciDepartment items which stores all associations between a + * SciDepartment item and other items. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentConfig.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentConfig.java index a4973483d..9f4bf42cd 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentConfig.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentConfig.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.runtime.AbstractConfig; @@ -7,7 +25,8 @@ import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.StringParameter; /** - * + * Configuration for SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ @@ -25,6 +44,14 @@ public class SciDepartmentConfig extends AbstractConfig { private final Parameter enableDescriptionDhtml; private final Parameter permittedPersonType; private final Parameter tabs; + private final Parameter activeStatus; + private final Parameter headRole; + private final Parameter viceHeadRole; + private final Parameter secretariatRole; + private final Parameter showHeadInList; + private final Parameter showViceHeadInList; + private final Parameter showSecretriatInList; + private final Parameter listShowRoleContacts; public SciDepartmentConfig() { @@ -100,6 +127,46 @@ public class SciDepartmentConfig extends AbstractConfig { Parameter.REQUIRED, "summary:com.arsdigita.cms.contenttypes.ui.SciDepartmentSummaryTab;desc:com.arsdigita.cms.contenttypes.ui.SciDepartmentDescTab;members:com.arsdigita.cms.contenttypes.ui.SciDepartmentMembersTab;projects:com.arsdigita.cms.contenttypes.ui.SciDepartmentProjectsTab;publications:com.arsdigita.cms.contenttypes.ui.SciDepartmentPublicationsTab"); + activeStatus = new StringParameter( + "com.arsdigita.cms.contenttypes.scidepartment.summarytab.status.active", + Parameter.REQUIRED, + "active"); + + headRole = new StringParameter( + "com.arsdigita.cms.contenttypes.scidepartment.heads.role", + Parameter.REQUIRED, + "head"); + + viceHeadRole = new StringParameter( + "com.arsdigita.cms.contenttypes.scidepartment.viceheads.role", + Parameter.REQUIRED, + "vicehead"); + + secretariatRole = new StringParameter( + "com.arsdigita.cms.contenttypes.scidepartment.secretariat.role", + Parameter.REQUIRED, + "secretariat"); + + showHeadInList = new BooleanParameter( + "com.arsdigita.cms.contenttypes.sciproject.listview.show_head", + Parameter.REQUIRED, + Boolean.TRUE); + + showViceHeadInList = new BooleanParameter( + "com.arsdigita.cms.contenttypes.sciproject.listview.show_vicehead", + Parameter.REQUIRED, + Boolean.TRUE); + + showSecretriatInList = new BooleanParameter( + "com.arsdigita.cms.contenttypes.sciproject.listview.show_secretriat", + Parameter.REQUIRED, + Boolean.TRUE); + + listShowRoleContacts = new BooleanParameter( + "com.arsdigita.cms.contenttypes.sciproject.listview.show_role_contacts", + Parameter.REQUIRED, + Boolean.TRUE); + register(enableSubDepartmentsStep); register(subDepartmentsStepSortKey); register(enableSuperDepartmentsStep); @@ -112,6 +179,14 @@ public class SciDepartmentConfig extends AbstractConfig { register(enableDescriptionDhtml); register(permittedPersonType); register(tabs); + register(activeStatus); + register(headRole); + register(viceHeadRole); + register(secretariatRole); + register(showHeadInList); + register(showViceHeadInList); + register(showSecretriatInList); + register(listShowRoleContacts); loadInfo(); } @@ -163,5 +238,37 @@ public class SciDepartmentConfig extends AbstractConfig { public final String getTabs() { return (String) get(tabs); } + + public final String getActiveStatus() { + return (String) get(activeStatus); + } + + public String getHeadRole() { + return (String) get(headRole); + } + + public String getViceHeadRole() { + return (String) get(viceHeadRole); + } + + public String getSecretariatRole() { + return (String) get(secretariatRole); + } + + public Boolean getShowHeadInList() { + return (Boolean) get(showHeadInList); + } + + public Boolean getShowViceHeadInList() { + return (Boolean) get(showViceHeadInList); + } + + public Boolean getShowSecretariatInList() { + return (Boolean) get(showSecretriatInList); + } + + public Boolean getListShowRoleContacts() { + return (Boolean) get(listShowRoleContacts); + } } diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentConfig_parameter.properties b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentConfig_parameter.properties index 4520980c7..7e60126c7 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentConfig_parameter.properties +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentConfig_parameter.properties @@ -57,3 +57,43 @@ com.arsdigita.cms.contenttypes.sciproject.tabs.title = Tabs for SciDepartment de com.arsdigita.cms.contenttypes.sciproject.tabs.purpose = Defines which tabs are shown in the detail view of a SciDepartment com.arsdigita.cms.contenttypes.sciproject.tabs.example = summary:com.arsdigita.cms.contenttypes.ui.SciDepartmentSummaryTab;members:com.arsdigita.cms.contenttypes.ui.SciDepartmentMembersTab com.arsdigita.cms.contenttypes.sciproject.tabs.format = [String] + +com.arsdigita.cms.contenttypes.scidepartment.summarytab.status.active.title = Status of active members +com.arsdigita.cms.contenttypes.scidepartment.summarytab.status.active.purpose = Status of the active members of the department. Used to filter out former heads. This is an attribute of the association between GenericOrganizationalUnit and GenericPerson. This value may contains more than value, separated by ','. +com.arsdigita.cms.contenttypes.scidepartment.summarytab.status.active.example = former,formerHead +com.arsdigita.cms.contenttypes.scidepartment.summarytab.status.active.format = [String] + +com.arsdigita.cms.contenttypes.scidepartment.heads.role.title = Role of the heads of the department +com.arsdigita.cms.contenttypes.scidepartment.heads.role.purpose = Role of the heads of the department. This is an attribute of the association between GenericOrganizationalUnit and GenericPerson. This value may contains more than value, separated by ','. +com.arsdigita.cms.contenttypes.scidepartment.heads.role.example = head +com.arsdigita.cms.contenttypes.scidepartment.heads.role.format = [String] + +com.arsdigita.cms.contenttypes.scidepartment.viceheads.role.title = Role of the vice heads of the department +com.arsdigita.cms.contenttypes.scidepartment.viceheads.role.purpose = Role of the vice heads of the department. This is an attribute of the association between GenericOrganizationalUnit and GenericPerson. This value may contains more than value, separated by ','. +com.arsdigita.cms.contenttypes.scidepartment.viceheads.role.example = vicehead +com.arsdigita.cms.contenttypes.scidepartment.viceheads.role.format = [String] + +com.arsdigita.cms.contenttypes.scidepartment.secretariat.role.title = Role of secretaries of the department +com.arsdigita.cms.contenttypes.scidepartment.secretariat.role.purpose = Role of secretaries of the department. This is an attribute of the association between GenericOrganizationalUnit and GenericPerson. This value may contains more than value, separated by ','. +com.arsdigita.cms.contenttypes.scidepartment.secretariat.role.example = secretariat +com.arsdigita.cms.contenttypes.scidepartment.secretariat.role.format = [String] + +com.arsdigita.cms.contenttypes.sciproject.listview.show_head.title = Controls whether the data about the head of the department if rendered into the XML output for the list mode +com.arsdigita.cms.contenttypes.sciproject.listview.show_head.purpose = Controls whether the data about the head of the department if rendered into the XML output for the list mode +com.arsdigita.cms.contenttypes.sciproject.listview.show_head.example = true +com.arsdigita.cms.contenttypes.sciproject.listview.show_head.format = [Boolean] + +com.arsdigita.cms.contenttypes.sciproject.listview.show_vicehead.title = Controls whether the data about the vice head of the department if rendered into the XML output for the list mode +com.arsdigita.cms.contenttypes.sciproject.listview.show_vicehead.purpose = Controls whether the data about the head of the department if rendered into the XML output for the list mode +com.arsdigita.cms.contenttypes.sciproject.listview.show_vicehead.example = true +com.arsdigita.cms.contenttypes.sciproject.listview.show_vicehead.format = [Boolean] + +com.arsdigita.cms.contenttypes.sciproject.listview.show_secretriat.title = Controls whether the data about the secretriat of the department if rendered into the XML output for the list mode +com.arsdigita.cms.contenttypes.sciproject.listview.show_secretriat.purpose = Controls whether the data about the head of the department if rendered into the XML output for the list mode +com.arsdigita.cms.contenttypes.sciproject.listview.show_secretriat.example = true +com.arsdigita.cms.contenttypes.sciproject.listview.show_secretriat.format = [Boolean] + +com.arsdigita.cms.contenttypes.sciproject.listview.show_role_contacts.title = Show contact information for special roles? +com.arsdigita.cms.contenttypes.sciproject.listview.show_role_contacts.purpose = Show contact information for special roles? +com.arsdigita.cms.contenttypes.sciproject.listview.show_role_contacts.example = true +com.arsdigita.cms.contenttypes.sciproject.listview.show_role_contacts.format = [Boolean] \ No newline at end of file diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java index daec5ff2e..46f335068 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java @@ -30,13 +30,13 @@ import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.runtime.DomainInitEvent; /** - * Executes at each system startup and initializes the SciDepartment + * Executes at each system startup and initialises the SciDepartment * content type, part of the ScientificCMS extension. * * Defines the content type specific properties and just uses the super class * methods to register the content type with the (transient) content type store * (map). This is done by runtimeRuntime startup method which runs the init() - * methods of all initializers (this one just using the parent implementation). + * methods of all initialisers (this one just using the parent implementation). * * @author Jens Pelzetter * @version $Id$ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java index ef357eb01..a53e94611 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java @@ -1,7 +1,26 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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; /** - * + * Loader for the ccm-sci-types-department module. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentMemberStatus.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentMemberStatus.java index c6bbab73a..e2bf6fbe0 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentMemberStatus.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartmentMemberStatus.java @@ -1,7 +1,26 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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; /** - * + * An enumeration for the status of members of a SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentCreate.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentCreate.java index f4eea5fbd..b6b6fb304 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentCreate.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentCreate.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.ContentItem; @@ -7,7 +25,8 @@ import com.arsdigita.cms.contenttypes.SciDepartmentBundle; import com.arsdigita.cms.ui.authoring.CreationSelector; /** - * + * Create step for the {@link SciDepartment} content type. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescTab.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescTab.java index cec9d063c..540cf8af6 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescTab.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescTab.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.PageState; @@ -7,13 +25,15 @@ import com.arsdigita.xml.Element; import org.apache.log4j.Logger; /** - * + * The description tab for an SciDepartment. Displays the text stored in the description property + * of a SciDepartment item. + * * @author Jens Pelzetter * @version $Id$ */ public class SciDepartmentDescTab implements GenericOrgaUnitTab { - public final Logger logger = Logger.getLogger(SciDepartmentDescTab.class); + private static final Logger LOGGER = Logger.getLogger(SciDepartmentDescTab.class); private String key; @Override @@ -31,7 +51,7 @@ public class SciDepartmentDescTab implements GenericOrgaUnitTab { final PageState state) { final long start = System.currentTimeMillis(); boolean result; - final Desc desc = getData(orgaunit); + final Description desc = getData(orgaunit); if (desc.getDesc() == null) { result = false; @@ -39,8 +59,8 @@ public class SciDepartmentDescTab implements GenericOrgaUnitTab { result = !desc.getDesc().trim().isEmpty(); } - if (logger.isDebugEnabled()) { - logger.debug(String.format("Needed %d ms to determine if department '%s' " + if (LOGGER.isDebugEnabled()) { + LOGGER.debug(String.format("Needed %d ms to determine if department '%s' " + "has a description.", System.currentTimeMillis() - start, orgaunit.getName())); @@ -49,11 +69,12 @@ public class SciDepartmentDescTab implements GenericOrgaUnitTab { return result; } + @Override public void generateXml(final GenericOrganizationalUnit orgaunit, final Element parent, final PageState state) { final long start = System.currentTimeMillis(); - final Desc desc = getData(orgaunit); + final Description desc = getData(orgaunit); final Element descTabElem = parent.newChildElement("departmentDescription"); @@ -67,13 +88,13 @@ public class SciDepartmentDescTab implements GenericOrgaUnitTab { final Element descElem = descTabElem.newChildElement("description"); descElem.setText(desc.getDesc()); - logger.debug(String.format("Generated XML for description tab of " + LOGGER.debug(String.format("Generated XML for description tab of " + "department '%s' in %d ms", orgaunit.getName(), System.currentTimeMillis() - start)); } - private Desc getData(final GenericOrganizationalUnit orgaunit) { + private Description getData(final GenericOrganizationalUnit orgaunit) { if (!(orgaunit instanceof SciDepartment)) { throw new IllegalArgumentException(String.format( "This tab can only process instances of " @@ -83,14 +104,22 @@ public class SciDepartmentDescTab implements GenericOrgaUnitTab { } final SciDepartment department = (SciDepartment) orgaunit; - final Desc desc = new Desc(); + final Description desc = new Description(); desc.setShortDesc(department.getDepartmentShortDescription()); desc.setDesc(department.getDepartmentDescription()); return desc; } - private class Desc { + /** + * Internal helper class to transfer the description data between methods. + * + */ + private class Description { + public Description() { + //Nothing + } + private String shortDesc; private String desc; diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java index 7d236a129..30b7b56a6 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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; @@ -17,7 +35,8 @@ import com.arsdigita.cms.ui.CMSDHTMLEditor; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** - * + * Edit form the description of an SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java index 6be944564..6f5497369 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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; @@ -10,7 +28,8 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** - * + * Authoring step for editing the description of a SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java index 19676a496..d7fbfa3ac 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.PageState; @@ -6,7 +24,8 @@ import com.arsdigita.cms.contenttypes.SciDepartment; import com.arsdigita.globalization.GlobalizedMessage; /** - * + * Form for uploading the description of a SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentExtraXmlGenerator.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentExtraXmlGenerator.java index 285d2d56a..48bf204b5 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentExtraXmlGenerator.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentExtraXmlGenerator.java @@ -1,15 +1,69 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.PageState; +import com.arsdigita.cms.ContentItem; +import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitPersonCollection; +import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.SciDepartment; import com.arsdigita.cms.contenttypes.SciDepartmentConfig; +import com.arsdigita.cms.dispatcher.SimpleXMLGenerator; +import com.arsdigita.xml.Element; /** - * + * ExtraXMLGenerator for SciDepartment. Adds data from several associations to the XML output. + * * @author Jens Pelzetter * @version $Id$ */ -public class SciDepartmentExtraXmlGenerator - extends GenericOrgaUnitExtraXmlGenerator { +public class SciDepartmentExtraXmlGenerator extends GenericOrgaUnitExtraXmlGenerator { + + private final static SciDepartmentConfig CONFIG = SciDepartment.getConfig(); + + @Override + public void generateXML(final ContentItem item, final Element element, final PageState state) { + super.generateXML(item, element, state); + + if (!(item instanceof SciDepartment)) { + throw new IllegalArgumentException( + "This ExtraXMLGenerator supports " + + "only instances of SciDepartment only."); + } + + final SciDepartment department = (SciDepartment) item; + + if (getListMode()) { + if (CONFIG.getShowHeadInList()) { + generateHeadOfDepartmentXml(department, element, state); + } + + if (CONFIG.getShowViceHeadInList()) { + generateViceHeadOfDepartmentXml(department, element, state); + } + + if (CONFIG.getShowSecretariatInList()) { + generateSecretariatOfDepartmentXml(department, element, state); + } + } + } @Override public String getTabConfig() { @@ -18,4 +72,105 @@ public class SciDepartmentExtraXmlGenerator return config.getTabs(); } + protected void generateSpecialRolesOfDepartmentXml(final SciDepartment department, + final Element parent, + final PageState state, + final String role, + final String elemName) { + final String activeStatusStr = CONFIG.getActiveStatus(); + final String[] roles = role.split(","); + final String[] activeStatuses = activeStatusStr.split(","); + + final StringBuffer roleFilter = new StringBuffer(); + for (String currentRole : roles) { + if (roleFilter.length() > 0) { + roleFilter.append(','); + } + roleFilter.append(String.format("%s = '%s'", + GenericOrganizationalUnitPersonCollection.LINK_PERSON_ROLE, + currentRole)); + } + + final StringBuffer statusFilter = new StringBuffer(); + for (String activeStatus : activeStatuses) { + if (statusFilter.length() > 0) { + statusFilter.append(','); + } + statusFilter.append(String.format("%s = '%s'", + GenericOrganizationalUnitPersonCollection.LINK_STATUS, + activeStatus)); + } + + final Element elem = parent.newChildElement(elemName); + + final GenericOrganizationalUnitPersonCollection persons = department.getPersons(); + persons.addFilter(roleFilter.toString()); + persons.addFilter(statusFilter.toString()); + persons.addOrder("name"); + + while (persons.next()) { + generateSpecialRoleXml(persons.getPerson(), elem, state, elemName); + } + + } + + protected void generateHeadOfDepartmentXml(final SciDepartment department, + final Element parent, + final PageState state) { + generateSpecialRolesOfDepartmentXml(department, + parent, + state, + CONFIG.getHeadRole(), + "heads"); + } + + protected void generateViceHeadOfDepartmentXml(final SciDepartment department, + final Element parent, + final PageState state) { + generateSpecialRolesOfDepartmentXml(department, + parent, + state, + CONFIG.getViceHeadRole(), + "viceheads"); + } + + protected void generateSecretariatOfDepartmentXml(final SciDepartment department, + final Element parent, + final PageState state) { + generateSpecialRolesOfDepartmentXml(department, + parent, + state, + CONFIG.getSecretariatRole(), + "secretariat"); + } + + protected void generateSpecialRoleXml(final GenericPerson member, + final Element parent, + final PageState state, + final String elemName) { + final XmlGenerator generator = new XmlGenerator(member); + if (CONFIG.getListShowRoleContacts()) { + generator.setUseExtraXml(true); + } else { + generator.setUseExtraXml(false); + } + generator.setItemElemName(elemName, ""); + generator.generateXML(state, parent, ""); + } + + private class XmlGenerator extends SimpleXMLGenerator { + + private final ContentItem item; + + public XmlGenerator(final ContentItem item) { + super(); + this.item = item; + } + + @Override + protected ContentItem getContentItem(final PageState state) { + return item; + } + + } } diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentGlobalizationUtil.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentGlobalizationUtil.java index cbf0c20bf..89220eaa5 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentGlobalizationUtil.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentGlobalizationUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Universität Bremen. All Rights Reserved. + * Copyright (C) 2012 Jens Pelzetter. All Rights Reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java index ab6ea7064..203e1b2a7 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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; @@ -8,12 +26,16 @@ import com.arsdigita.domain.DataObjectNotFoundException; import org.apache.log4j.Logger; /** - * + * Form for adding members to a SciDepartment. The form extends + * {@link GenericOrganizationalUnitPersonAddForm} and overwrites only the methods provided by + * the superclass for customising the form. The logic of the form is completely provided by the + * super class. + * + * * @author Jens Pelzetter * @version $Id$ */ -public class SciDepartmentMemberAddForm - extends GenericOrganizationalUnitPersonAddForm { +public class SciDepartmentMemberAddForm extends GenericOrganizationalUnitPersonAddForm { private final Logger logger = Logger.getLogger( SciDepartmentMemberAddForm.class); diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java index 00aa421b6..6e206b254 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java @@ -1,15 +1,35 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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; import com.arsdigita.cms.contenttypes.SciDepartment; /** - * + * Table displaying the members of an SciDepartment. Based on the + * {@link GenericOrganizationalUnitPersonsTable} it overwrites only the methods provided by the + * superclass for customising the form. + * * @author Jens Pelzetter * @version $Id$ */ -public class SciDepartmentMemberTable -extends GenericOrganizationalUnitPersonsTable { +public class SciDepartmentMemberTable extends GenericOrganizationalUnitPersonsTable { public SciDepartmentMemberTable(final ItemSelectionModel itemModel, final GenericOrganizationalUnitPersonSelector personSelector) { diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersStep.java index c71599462..87fcc98b1 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersStep.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.PageState; @@ -9,7 +27,8 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; /** - * + * Authoring step for editing the memberships of the SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ @@ -36,8 +55,7 @@ public class SciDepartmentMembersStep final BasicItemForm addMemberSheet = new SciDepartmentMemberAddForm( itemModel, this); add(ADD_DEPARTMENT_MEMBER_SHEET_NAME, - (String) SciDepartmentGlobalizationUtil.globalize( - "scidepartment.ui.members.add").localize(), + SciDepartmentGlobalizationUtil.globalize("scidepartment.ui.members.add"), new WorkflowLockedComponentAccess(addMemberSheet, itemModel), addMemberSheet.getSaveCancelSection().getCancelButton()); @@ -47,31 +65,39 @@ public class SciDepartmentMembersStep setDisplayComponent(memberTable); } + @Override public GenericPerson getSelectedPerson() { return selectedPerson; } + @Override public void setSelectedPerson(final GenericPerson selectedPerson) { this.selectedPerson = selectedPerson; } + @Override public String getSelectedPersonRole() { return selectedPersonRole; } + @Override public void setSelectedPersonRole(final String selectedPersonRole) { this.selectedPersonRole = selectedPersonRole; } + @Override public String getSelectedPersonStatus() { return selectedPersonStatus; } + @Override public void setSelectedPersonStatus(final String selectedPersonStatus) { this.selectedPersonStatus = selectedPersonStatus; } + @Override public void showEditComponent(final PageState state) { showComponent(state, ADD_DEPARTMENT_MEMBER_SHEET_NAME); } + } diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersTab.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersTab.java index 71833f377..01e0992a0 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersTab.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersTab.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.PageState; @@ -16,7 +34,6 @@ import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataQuery; import com.arsdigita.persistence.SessionManager; import com.arsdigita.xml.Element; -import java.math.BigDecimal; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -26,22 +43,21 @@ import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; /** - * + * This tab displays all person items associated with a SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ public class SciDepartmentMembersTab implements GenericOrgaUnitTab { - private final Logger logger = Logger.getLogger(SciDepartmentMembersTab.class); private static final SciDepartmentMembersTabConfig config = new SciDepartmentMembersTabConfig(); private static final String STATUS_PARAM = "memberStatus"; private static final String SURNAME_PARAM = "memberSurname"; - private final CompareFilter statusFilter = new CompareFilter( - STATUS_PARAM, - "status", - false, - false, - false); + private final CompareFilter statusFilter = new CompareFilter(STATUS_PARAM, + "status", + false, + false, + false); private final TextFilter surnameFilter = new TextFilter(SURNAME_PARAM, GenericPerson.SURNAME); private String key; @@ -204,7 +220,7 @@ public class SciDepartmentMembersTab implements GenericOrgaUnitTab { final DataQuery personBundlesQuery = SessionManager.getSession(). retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfMembersOfOrgaUnits"); + "com.arsdigita.cms.contenttypes.getIdsOfMembersOfOrgaUnits"); final List orgaUnitIds = new ArrayList(); if (config.isMergingMembers()) { diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersTabConfig.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersTabConfig.java index 42f6b8603..79bf137c8 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersTabConfig.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMembersTabConfig.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.runtime.AbstractConfig; @@ -7,7 +25,8 @@ import com.arsdigita.util.parameter.Parameter; import com.arsdigita.util.parameter.StringArrayParameter; /** - * + * Configuration for the members tab. + * * @author Jens Pelzetter * @version $Id$ */ @@ -24,7 +43,7 @@ public class SciDepartmentMembersTabConfig extends AbstractConfig { "com.arsdigita.cms.contenttypes.scidepartment.tabs.members.status_values", Parameter.REQUIRED, new String[]{"active", "associated", "former"}); - + pageSize = new IntegerParameter( "com.arsdigita.cms.contenttypes.scidepartment.tabs.members.page_size", @@ -43,7 +62,7 @@ public class SciDepartmentMembersTabConfig extends AbstractConfig { Parameter.REQUIRED, Boolean.FALSE); - register(statusValues); + register(statusValues); register(pageSize); register(enableSearchLimit); register(mergeMembers); @@ -54,7 +73,7 @@ public class SciDepartmentMembersTabConfig extends AbstractConfig { public final String[] getStatusValues() { return (String[]) get(statusValues); } - + public final int getPageSize() { return (Integer) get(pageSize); } @@ -66,4 +85,5 @@ public class SciDepartmentMembersTabConfig extends AbstractConfig { public final boolean isMergingMembers() { return (Boolean) get(mergeMembers); } + } diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java index 1f1ee02d8..abd62f462 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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; @@ -7,7 +25,8 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; /** - * + * Authoring step for editing the associations between a SciDepartment and SciProject items. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTab.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTab.java index 2b023a0e5..ee11c6080 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTab.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTab.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.PageState; @@ -31,7 +49,8 @@ import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; /** - * + * This tab displays all SciProject items which are associated with an SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTabConfig.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTabConfig.java index 21152bec1..1f1db80db 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTabConfig.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTabConfig.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.runtime.AbstractConfig; @@ -6,7 +24,8 @@ import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.Parameter; /** - * + * Configuration for the projects tab. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java index 37afb050d..78a4d41b9 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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; @@ -11,7 +29,8 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** - * + * Authoring step for editing the basic properties of a SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java index 93af924ba..ad327783a 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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; @@ -18,7 +36,8 @@ import com.arsdigita.cms.contenttypes.SciDepartmentConfig; import com.arsdigita.globalization.GlobalizedMessage; /** - * + * Form for editing the the basic properties of a SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTab.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTab.java index 98a2951c8..f5df17f6b 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTab.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTab.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.PageState; @@ -29,7 +47,8 @@ import javax.servlet.http.HttpServletRequest; import org.apache.log4j.Logger; /** - * + * Tab displaying all publications associated with a SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTabConfig.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTabConfig.java index a29988657..f006eab77 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTabConfig.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTabConfig.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.runtime.AbstractConfig; @@ -6,7 +24,8 @@ import com.arsdigita.util.parameter.IntegerParameter; import com.arsdigita.util.parameter.Parameter; /** - * + * Configuration for the Publications tab of a SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentResources.properties b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentResources.properties index ea3d3409e..4d4d1a72a 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentResources.properties +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentResources.properties @@ -1,6 +1,3 @@ -# To change this template, choose Tools | Templates -# and open the template in the editor. - sciorganization.ui.department_properties.title=Basic Properties sciorganization.ui.department.members=Members sciorganization.ui.department.members.description=Manages the members of the department diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java index 3825bca9f..a79198045 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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,7 +26,8 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; /** - * + * Authoring step for editing the associations to sub departments of a SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTab.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTab.java index e60be606a..ca67fed94 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTab.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTab.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.PageState; @@ -10,25 +28,26 @@ import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitPersonCollection; import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitSubordinateCollection; import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.SciDepartment; +import com.arsdigita.cms.contenttypes.SciDepartmentConfig; import com.arsdigita.cms.dispatcher.SimpleXMLGenerator; import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.xml.Element; -import java.math.BigDecimal; -import org.apache.log4j.Logger; /** - * + * The summary tab for SciDepartment. Shows several informations about a SciDepartment. + * * @author Jens Pelzetter * @version $Id$ */ public class SciDepartmentSummaryTab implements GenericOrgaUnitTab { - private static final Logger LOGGER = Logger.getLogger(SciDepartmentSummaryTab.class); - private final static SciDepartmentSummaryTabConfig CONFIG = new SciDepartmentSummaryTabConfig(); + private final static SciDepartmentConfig CONFIG = SciDepartment.getConfig(); + private final static SciDepartmentSummaryTabConfig TAB_CONFIG = + new SciDepartmentSummaryTabConfig(); private String key; static { - CONFIG.load(); + TAB_CONFIG.load(); } @Override @@ -66,23 +85,23 @@ public class SciDepartmentSummaryTab implements GenericOrgaUnitTab { generateShortDescXml(department, departmentSummaryElem); - if (CONFIG.isShowingHead()) { + if (TAB_CONFIG.isShowingHead()) { generateHeadOfDepartmentXml(department, departmentSummaryElem, state); } - if (CONFIG.isShowingViceHead()) { + if (TAB_CONFIG.isShowingViceHead()) { generateViceHeadOfDepartmentXml(department, departmentSummaryElem, state); } - if (CONFIG.isShowingSecretriat()) { + if (TAB_CONFIG.isShowingSecretriat()) { generateSecretariatOfDepartmentXml(department, departmentSummaryElem, state); } - if (CONFIG.isShowingSubDepartment()) { + if (TAB_CONFIG.isShowingSubDepartment()) { generateSubDepartmentsXml(department, departmentSummaryElem, state); } - if (CONFIG.isShowingContacts()) { + if (TAB_CONFIG.isShowingContacts()) { generateContactsXml(department, departmentSummaryElem, state); } } @@ -134,7 +153,7 @@ public class SciDepartmentSummaryTab implements GenericOrgaUnitTab { persons.addOrder("name"); while (persons.next()) { - generateSpecialRoleXml(persons.getPerson(), elem, state, "head"); + generateSpecialRoleXml(persons.getPerson(), elem, state, elemName); } } @@ -147,43 +166,6 @@ public class SciDepartmentSummaryTab implements GenericOrgaUnitTab { state, CONFIG.getHeadRole(), "heads"); - -// final String headRoleStr = config.getHeadRole(); -// final String activeStatusStr = config.getActiveStatus(); -// final String[] headRoles = headRoleStr.split(","); -// final String[] activeStatuses = activeStatusStr.split(","); -// -// final StringBuffer roleFilter = new StringBuffer(); -// for (String headRole : headRoles) { -// if (roleFilter.length() > 0) { -// roleFilter.append(','); -// } -// roleFilter.append(String.format("%s = '%s'", -// GenericOrganizationalUnitPersonCollection.LINK_PERSON_ROLE, -// headRole)); -// } -// -// final StringBuffer statusFilter = new StringBuffer(); -// for (String activeStatus : activeStatuses) { -// if (statusFilter.length() > 0) { -// statusFilter.append(","); -// } -// statusFilter.append(String.format("%s = '%s'", -// GenericOrganizationalUnitPersonCollection.LINK_STATUS, -// activeStatus)); -// } -// -// final Element headsElem = parent.newChildElement("heads"); -// -// final GenericOrganizationalUnitPersonCollection heads = department. -// getPersons(); -// heads.addFilter(roleFilter.toString()); -// heads.addFilter(statusFilter.toString()); -// heads.addOrder("name"); -// -// while (heads.next()) { -// generateHeadXml(heads.getPerson(), headsElem, state); -// } } protected void generateViceHeadOfDepartmentXml(final SciDepartment department, @@ -250,18 +232,12 @@ public class SciDepartmentSummaryTab implements GenericOrgaUnitTab { generateHeadOfDepartmentXml(subDepartment, subDepElem, state); } -// protected void generateHeadXml(final BigDecimal memberId, -// final Element parent, -// final PageState state) { -// final GenericPerson member = new GenericPerson(memberId); -// generateHeadXml(member, parent, state); -// } protected void generateSpecialRoleXml(final GenericPerson member, final Element parent, final PageState state, final String elemName) { final XmlGenerator generator = new XmlGenerator(member); - if (CONFIG.isShowingRoleContacts()) { + if (TAB_CONFIG.isShowingRoleContacts()) { generator.setUseExtraXml(true); } else { generator.setUseExtraXml(false); @@ -270,14 +246,6 @@ public class SciDepartmentSummaryTab implements GenericOrgaUnitTab { generator.generateXML(state, parent, ""); } -// protected void generateHeadXml(final GenericPerson member, -// final Element parent, -// final PageState state) { -// final XmlGenerator generator = new XmlGenerator(member); -// generator.setUseExtraXml(false); -// generator.setItemElemName("head", ""); -// generator.generateXML(state, parent, ""); -// } protected void generateContactsXml(final SciDepartment department, final Element parent, final PageState state) { diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTabConfig.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTabConfig.java index 285e6a8c5..f079271cd 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTabConfig.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTabConfig.java @@ -1,11 +1,29 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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.runtime.AbstractConfig; import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.StringParameter; /** + * Configuration for the summary tab of a SciDepartment. * * @author Jens Pelzetter * @version $Id$ @@ -13,13 +31,9 @@ import com.arsdigita.util.parameter.StringParameter; public class SciDepartmentSummaryTabConfig extends AbstractConfig { private final Parameter showHeads; - private final Parameter headRole; private final Parameter showViceHeads; - private final Parameter viceHeadRole; private final Parameter showSecretariat; - private final Parameter secretariatRole; private final Parameter showRoleContacts; - private final Parameter activeStatus; private final Parameter showSubDepartments; private final Parameter showContacts; @@ -31,41 +45,21 @@ public class SciDepartmentSummaryTabConfig extends AbstractConfig { Parameter.REQUIRED, true); - headRole = new StringParameter( - "com.arsdigita.cms.contenttypes.scidepartment.summarytab.heads.role", - Parameter.REQUIRED, - "head"); - showViceHeads = new BooleanParameter( "com.arsdigita.cms.contenttypes.scidepartment.summarytab.viceheads.show", Parameter.REQUIRED, true); - viceHeadRole = new StringParameter( - "com.arsdigita.cms.contenttypes.scidepartment.summarytab.viceheads.role", - Parameter.REQUIRED, - "vicehead"); - showSecretariat = new BooleanParameter( "com.arsdigita.cms.contenttypes.scidepartment.summarytab.secretariat.show", Parameter.REQUIRED, true); - secretariatRole = new StringParameter( - "com.arsdigita.cms.contenttypes.scidepartment.summarytab.secretariat.role", - Parameter.REQUIRED, - "secretariat"); - showRoleContacts = new BooleanParameter( "com.arsdigita.cms.contenttypes.scidepartment.summarytab.role_contacts.show", Parameter.REQUIRED, true); - activeStatus = new StringParameter( - "com.arsdigita.cms.contenttypes.scidepartment.summarytab.status.active", - Parameter.REQUIRED, - "active"); - showSubDepartments = new BooleanParameter( "com.arsdigita.cms.contenttypes.scidepartment.summarytab.subdepartments.show", Parameter.REQUIRED, @@ -77,13 +71,9 @@ public class SciDepartmentSummaryTabConfig extends AbstractConfig { true); register(showHeads); - register(headRole); register(showViceHeads); - register(viceHeadRole); register(showSecretariat); - register(secretariatRole); register(showRoleContacts); - register(activeStatus); register(showSubDepartments); register(showContacts); @@ -94,34 +84,18 @@ public class SciDepartmentSummaryTabConfig extends AbstractConfig { return (Boolean) get(showHeads); } - public final String getHeadRole() { - return (String) get(headRole); - } - public final boolean isShowingViceHead() { return (Boolean) get(showViceHeads); } - public final String getViceHeadRole() { - return (String) get(viceHeadRole); - } - public final boolean isShowingSecretriat() { return (Boolean) get(showSecretariat); } - - public final String getSecretariatRole() { - return (String) get(secretariatRole); - } public final boolean isShowingRoleContacts() { return (Boolean) get(showRoleContacts); } - public final String getActiveStatus() { - return (String) get(activeStatus); - } - public final boolean isShowingSubDepartment() { return (Boolean) get(showSubDepartments); } diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTabConfig_parameter.properties b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTabConfig_parameter.properties index a6edd7e7d..69ff0264c 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTabConfig_parameter.properties +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSummaryTabConfig_parameter.properties @@ -3,36 +3,16 @@ com.arsdigita.cms.contenttypes.scidepartment.summarytab.heads.show.purpose = Sho com.arsdigita.cms.contenttypes.scidepartment.summarytab.heads.show.example = true com.arsdigita.cms.contenttypes.scidepartment.summarytab.heads.show.format = [Boolean] -com.arsdigita.cms.contenttypes.scidepartment.summarytab.heads.role.title = Role of the heads of the department -com.arsdigita.cms.contenttypes.scidepartment.summarytab.heads.role.purpose = Role of the heads of the department. This is an attribute of the association between GenericOrganizationalUnit and GenericPerson. This value may contains more than value, separated by ','. -com.arsdigita.cms.contenttypes.scidepartment.summarytab.heads.role.example = head -com.arsdigita.cms.contenttypes.scidepartment.summarytab.heads.role.format = [String] - com.arsdigita.cms.contenttypes.scidepartment.summarytab.viceheads.show.title = Show vice heads of department in summary tab? com.arsdigita.cms.contenttypes.scidepartment.summarytab.viceheads.show.purpose = Show vice heads of department in summary tab? com.arsdigita.cms.contenttypes.scidepartment.summarytab.viceheads.show.example = true com.arsdigita.cms.contenttypes.scidepartment.summarytab.viceheads.show.format = [Boolean] -com.arsdigita.cms.contenttypes.scidepartment.summarytab.viceheads.role.title = Role of the vice heads of the department -com.arsdigita.cms.contenttypes.scidepartment.summarytab.viceheads.role.purpose = Role of the vice heads of the department. This is an attribute of the association between GenericOrganizationalUnit and GenericPerson. This value may contains more than value, separated by ','. -com.arsdigita.cms.contenttypes.scidepartment.summarytab.viceheads.role.example = vicehead -com.arsdigita.cms.contenttypes.scidepartment.summarytab.viceheads.role.format = [String] - com.arsdigita.cms.contenttypes.scidepartment.summarytab.secretariat.show.title = Show secretariat of department in summary tab? com.arsdigita.cms.contenttypes.scidepartment.summarytab.secretariat.show.purpose = Show secretariat of department in summary tab? com.arsdigita.cms.contenttypes.scidepartment.summarytab.secretariat.show.example = true com.arsdigita.cms.contenttypes.scidepartment.summarytab.secretariat.show.format = [Boolean] -com.arsdigita.cms.contenttypes.scidepartment.summarytab.secretariat.role.title = Role of secretaries of the department -com.arsdigita.cms.contenttypes.scidepartment.summarytab.secretariat.role.purpose = Role of secretaries of the department. This is an attribute of the association between GenericOrganizationalUnit and GenericPerson. This value may contains more than value, separated by ','. -com.arsdigita.cms.contenttypes.scidepartment.summarytab.secretariat.role.example = secretariat -com.arsdigita.cms.contenttypes.scidepartment.summarytab.secretariat.role.format = [String] - -com.arsdigita.cms.contenttypes.scidepartment.summarytab.status.active.title = Status of active members -com.arsdigita.cms.contenttypes.scidepartment.summarytab.status.active.purpose = Status of the active members of the department. Used to filter out former heads. This is an attribute of the association between GenericOrganizationalUnit and GenericPerson. This value may contains more than value, separated by ','. -com.arsdigita.cms.contenttypes.scidepartment.summarytab.status.active.example = former,formerHead -com.arsdigita.cms.contenttypes.scidepartment.summarytab.status.active.format = [String] - com.arsdigita.cms.contenttypes.scidepartment.summarytab.contacts.show.title = Show contact? com.arsdigita.cms.contenttypes.scidepartment.summarytab.contacts.show.purpose = Show contact? com.arsdigita.cms.contenttypes.scidepartment.summarytab.contacts.show.example = true diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentsStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentsStep.java index 27950d12c..430aa7c51 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentsStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentsStep.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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,7 +26,8 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; /** - * + * Step for editing the association the the superior organisational unit. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java index 8352fad07..3af756cc9 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2013 Jens Pelzetter + * + * 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,7 +26,8 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; /** - * + * Authoring step for editing the associations between a department and its projects. + * * @author Jens Pelzetter * @version $Id$ */ diff --git a/ccm-subsite/src/com/arsdigita/subsite/ui/SiteTable.java b/ccm-subsite/src/com/arsdigita/subsite/ui/SiteTable.java index 3de8c0f57..be7d9b444 100644 --- a/ccm-subsite/src/com/arsdigita/subsite/ui/SiteTable.java +++ b/ccm-subsite/src/com/arsdigita/subsite/ui/SiteTable.java @@ -177,13 +177,16 @@ public class SiteTable extends Table implements TableActionListener { @Override public Component getComponent(final Table table, - final PageState state, final Object value, + final PageState state, + final Object value, final boolean isSelected, final Object key, final int row, final int column) { + final Site site = new Site(OID.valueOf((String)key)); final ControlLink link = new ControlLink(new Label((GlobalizedMessage) value)); - link.setConfirmation(SubsiteGlobalizationUtil.globalize("subsite.ui.delete.confirm")); + link.setConfirmation(SubsiteGlobalizationUtil.globalize("subsite.ui.delete.confirm", + new String[]{site.getHostname()})); return link; } diff --git a/ccm-subsite/src/com/arsdigita/subsite/ui/SubsiteResources.properties b/ccm-subsite/src/com/arsdigita/subsite/ui/SubsiteResources.properties index 4ff34a3c4..15e4c5fb6 100644 --- a/ccm-subsite/src/com/arsdigita/subsite/ui/SubsiteResources.properties +++ b/ccm-subsite/src/com/arsdigita/subsite/ui/SubsiteResources.properties @@ -23,3 +23,4 @@ subsite.ui.root_category_missing=No root category selected subsite.ui.hostname_already_in\ use=The hostname {0} is already used by another subsite subsite.ui.edit=Edit subsite.ui.delete=Delete +subsite.ui.delete.confirm=Are you sure to delete the subsite {0}? diff --git a/ccm-subsite/src/com/arsdigita/subsite/ui/SubsiteResources_de.properties b/ccm-subsite/src/com/arsdigita/subsite/ui/SubsiteResources_de.properties index b0b1732b3..981afb477 100644 --- a/ccm-subsite/src/com/arsdigita/subsite/ui/SubsiteResources_de.properties +++ b/ccm-subsite/src/com/arsdigita/subsite/ui/SubsiteResources_de.properties @@ -23,3 +23,4 @@ subsite.ui.root_category_missing=Kein Kategoriensystem ausgew\u00e4hlt subsite.ui.hostname_already_in\ use=Der Hostname {0} wird bereits von einer anderen Subsite verwendet subsite.ui.edit=Bearbeiten subsite.ui.delete=L\u00f6schen +subsite.ui.delete.confirm=Sind Sie sicher, dass Sie die Subsite {0} l\u00f6schen wollen?