From 62c688033283ebea6e1054b5f5b29f7eeb963a36 Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 31 Aug 2011 13:35:51 +0000 Subject: [PATCH] =?UTF-8?q?Neuer=20SciMember-Typ=20als=20unabh=C3=A4ngiges?= =?UTF-8?q?=20Modul=20(h=C3=A4ngt=20nur=20ccm-core=20und=20ccm-cms=20ab)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@1082 8810af33-2d31-482b-a856-94f89814c4df --- ccm-sci-types-member/application.xml | 25 ++++++++ .../com/arsdigita/content-types/SciMember.pdl | 8 +++ .../ccm-sci-types-member/postgres-create.sql | 4 ++ .../arsdigita/cms/contenttypes/SciMember.xml | 37 +++++++++++ .../arsdigita/cms/contenttypes/SciMember.xml | 25 ++++++++ .../src/ccm-sci-types-member.config | 4 ++ .../src/ccm-sci-types-member.load | 16 +++++ .../arsdigita/cms/contenttypes/SciMember.java | 56 +++++++++++++++++ .../contenttypes/SciMemberInitializer.java | 26 ++++++++ .../cms/contenttypes/SciMemberLoader.java | 37 +++++++++++ .../ui/SciMemberPropertiesStep.java | 56 +++++++++++++++++ .../ui/SciMemberPropertyForm.java | 63 +++++++++++++++++++ .../arsdigita/cms/contenttypes/SciMember.xsl | 20 ++++++ .../arsdigita/cms/contenttypes/SciMember.java | 3 +- .../cms/contenttypes/SciMemberLoader.java | 1 - .../ui/SciMemberPropertiesStep.java | 3 +- .../ui/SciMemberPropertyForm.java | 5 +- 17 files changed, 380 insertions(+), 9 deletions(-) create mode 100644 ccm-sci-types-member/application.xml create mode 100644 ccm-sci-types-member/pdl/com/arsdigita/content-types/SciMember.pdl create mode 100644 ccm-sci-types-member/sql/ccm-sci-types-member/postgres-create.sql create mode 100644 ccm-sci-types-member/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml create mode 100644 ccm-sci-types-member/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml create mode 100644 ccm-sci-types-member/src/ccm-sci-types-member.config create mode 100644 ccm-sci-types-member/src/ccm-sci-types-member.load create mode 100644 ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMember.java create mode 100644 ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java create mode 100644 ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java create mode 100644 ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java create mode 100644 ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java create mode 100644 ccm-sci-types-member/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl diff --git a/ccm-sci-types-member/application.xml b/ccm-sci-types-member/application.xml new file mode 100644 index 000000000..775b688a9 --- /dev/null +++ b/ccm-sci-types-member/application.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + Content type for member of a scientific organization, for example a + science institute. + + \ No newline at end of file diff --git a/ccm-sci-types-member/pdl/com/arsdigita/content-types/SciMember.pdl b/ccm-sci-types-member/pdl/com/arsdigita/content-types/SciMember.pdl new file mode 100644 index 000000000..9453d18d2 --- /dev/null +++ b/ccm-sci-types-member/pdl/com/arsdigita/content-types/SciMember.pdl @@ -0,0 +1,8 @@ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.kernel.ACSObject; +import com.arsdigita.cms.*; + +object type SciMember extends GenericPerson { + reference key ( ct_sci_members.member_id ); +} \ No newline at end of file diff --git a/ccm-sci-types-member/sql/ccm-sci-types-member/postgres-create.sql b/ccm-sci-types-member/sql/ccm-sci-types-member/postgres-create.sql new file mode 100644 index 000000000..38716a0ca --- /dev/null +++ b/ccm-sci-types-member/sql/ccm-sci-types-member/postgres-create.sql @@ -0,0 +1,4 @@ +begin; +\i ddl/postgres/create.sql +\i ddl/postgres/deferred.sql +end; \ No newline at end of file diff --git a/ccm-sci-types-member/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml b/ccm-sci-types-member/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml new file mode 100644 index 000000000..d61132f9f --- /dev/null +++ b/ccm-sci-types-member/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ccm-sci-types-member/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml b/ccm-sci-types-member/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml new file mode 100644 index 000000000..578e9d702 --- /dev/null +++ b/ccm-sci-types-member/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/ccm-sci-types-member/src/ccm-sci-types-member.config b/ccm-sci-types-member/src/ccm-sci-types-member.config new file mode 100644 index 000000000..2cf5a931f --- /dev/null +++ b/ccm-sci-types-member/src/ccm-sci-types-member.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ccm-sci-types-member/src/ccm-sci-types-member.load b/ccm-sci-types-member/src/ccm-sci-types-member.load new file mode 100644 index 000000000..942a9cf61 --- /dev/null +++ b/ccm-sci-types-member/src/ccm-sci-types-member.load @@ -0,0 +1,16 @@ + + + +
+
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMember.java b/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMember.java new file mode 100644 index 000000000..904602095 --- /dev/null +++ b/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMember.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2011 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.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import java.math.BigDecimal; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class SciMember extends GenericPerson { + + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.SciMember"; + + public SciMember() { + this(BASE_DATA_OBJECT_TYPE); + } + + public SciMember(final BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public SciMember(final OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public SciMember(final DataObject dobj) { + super(dobj); + } + + public SciMember(final String type) { + super(type); + } + +} diff --git a/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java b/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java new file mode 100644 index 000000000..5da82f225 --- /dev/null +++ b/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java @@ -0,0 +1,26 @@ +package com.arsdigita.cms.contenttypes; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class SciMemberInitializer extends ContentTypeInitializer { + + public SciMemberInitializer() { + super("ccm-sci-types-member.pdl.mf", SciMember.BASE_DATA_OBJECT_TYPE); + } + + @Override + public String[] getStylesheets() { + return new String[]{ + "/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl" + }; + } + + @Override + public String getTraversalXML() { + return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml"; + + } +} diff --git a/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java b/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java new file mode 100644 index 000000000..12d5adebf --- /dev/null +++ b/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2011 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; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class SciMemberLoader extends AbstractContentTypeLoader { + + private static final String[] TYPES = { + "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml" + }; + + @Override + public String[] getTypes() { + return TYPES; + } + +} diff --git a/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java b/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java new file mode 100644 index 000000000..281bbe7ef --- /dev/null +++ b/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2011 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; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; +import com.arsdigita.cms.ui.authoring.BasicPageForm; +import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class SciMemberPropertiesStep extends GenericPersonPropertiesStep { + + public static final String EDIT_SHEET_NAME = "edit"; + + public SciMemberPropertiesStep(final ItemSelectionModel itemModel, + final AuthoringKitWizard parent) { + super(itemModel, parent); + } + + protected void createEditSheet(final ItemSelectionModel itemModel) { + final BasicPageForm editSheet = new SciMemberPropertyForm(itemModel, + this); + add(EDIT_SHEET_NAME, "Edit", + new WorkflowLockedComponentAccess(editSheet, itemModel), + editSheet.getSaveCancelSection().getCancelButton()); + } + + public static Component getSciMemberPropertySheet( + final ItemSelectionModel itemModel) { + Component sheet = GenericPersonPropertiesStep. + getGenericPersonPropertySheet(itemModel); + + return sheet; + } +} diff --git a/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java b/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java new file mode 100644 index 000000000..2cb2974c7 --- /dev/null +++ b/ccm-sci-types-member/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2011 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.event.FormInitListener; +import com.arsdigita.bebop.event.FormProcessListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.event.FormSubmissionListener; +import com.arsdigita.cms.ItemSelectionModel; + +/** + * + * @author Jens Pelzetter + * @version $Id$ + */ +public class SciMemberPropertyForm + extends GenericPersonPropertyForm + implements FormProcessListener, + FormInitListener, + FormSubmissionListener { + + public SciMemberPropertyForm(final ItemSelectionModel itemModel) { + this(itemModel, null); + } + + public SciMemberPropertyForm(final ItemSelectionModel itemModel, + final SciMemberPropertiesStep step) { + super(itemModel, step); + addSubmissionListener(this); + } + + @Override + protected void addWidgets() { + super.addWidgets(); + } + + @Override + public void init(final FormSectionEvent fse) { + super.init(fse); + + } + + @Override + public void process(final FormSectionEvent fse) { + super.process(fse); + } +} diff --git a/ccm-sci-types-member/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl b/ccm-sci-types-member/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl new file mode 100644 index 000000000..80359c344 --- /dev/null +++ b/ccm-sci-types-member/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl @@ -0,0 +1,20 @@ + +]> + + + + +

+
+ + +

+
+ +
\ No newline at end of file diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java index d93067f7a..c64615130 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java @@ -1,6 +1,5 @@ /* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen + * Copyright (c) 2010 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 diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java index 764ec32d9..0749a92c3 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java @@ -1,6 +1,5 @@ /* * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java index 1d3eb896a..c801f9a20 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java @@ -1,6 +1,5 @@ /* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen + * Copyright (c) 2010 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 diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java index 83fece82a..b6a17e674 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java @@ -1,6 +1,5 @@ /* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen + * Copyright (c) 2010 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 @@ -24,11 +23,9 @@ import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.event.FormInitListener; import com.arsdigita.bebop.event.FormSectionEvent; import com.arsdigita.bebop.event.FormSubmissionListener; -import com.arsdigita.bebop.form.CheckboxGroup; import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.SciMember; -import org.apache.log4j.Logger; /** * Form for editing the basic properties of a {@link SciMember}. This form