- ListView für SciDepartment um Abteilungsleitung usw. erweitert.

- fehlende Lizenzheader und Kommentare für ccm-sci-types-department ergänzt


git-svn-id: https://svn.libreccm.org/ccm/trunk@2428 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2013-11-07 19:53:19 +00:00
parent d03a747c3d
commit b4c8a8ca96
39 changed files with 967 additions and 202 deletions

View File

@ -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<String, GenericOrgaUnitTab> entry :
tabs.entrySet()) {
for (Map.Entry<String, GenericOrgaUnitTab> 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;

View File

@ -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$
*/

View File

@ -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 <jens@jp-digital.de>
* @version $Id$
*/

View File

@ -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<ExtraXMLGenerator> getExtraListXMLGenerators() {
final List<ExtraXMLGenerator> generators = super.getExtraListXMLGenerators();
generators.add(new SciDepartmentExtraXmlGenerator());
return generators;
}
@Override
public String getSearchSummary() {
return getDepartmentShortDescription();

View File

@ -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$
*/

View File

@ -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);
}
}

View File

@ -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]

View File

@ -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$

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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;

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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;
}
}
}

View File

@ -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

View File

@ -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);

View File

@ -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) {

View File

@ -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);
}
}

View File

@ -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<String> orgaUnitIds = new ArrayList<String>();
if (config.isMergingMembers()) {

View File

@ -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);
}
}

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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

View File

@ -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$
*/

View File

@ -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) {

View File

@ -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);
}

View File

@ -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

View File

@ -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$
*/

View File

@ -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$
*/

View File

@ -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;
}

View File

@ -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}?

View File

@ -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?