Neuer SciMember-Typ als unabhängiges Modul (hängt nur ccm-core und ccm-cms ab)
git-svn-id: https://svn.libreccm.org/ccm/trunk@1082 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
3502f9dd4e
commit
62c6880332
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||
name="ccm-sci-types-member"
|
||||
prettyName="OpenCCM Content Types"
|
||||
version="6.6.1"
|
||||
release="1"
|
||||
webapp="ROOT">
|
||||
<ccm:dependencies>
|
||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
|
||||
</ccm:dependencies>
|
||||
<ccm:directories>
|
||||
<ccm:directory name="pdl"/>
|
||||
<ccm:directory name="sql"/>
|
||||
<ccm:directory name="src"/>
|
||||
</ccm:directories>
|
||||
<ccm:contacts>
|
||||
<ccm:contact uri="http://www.redhat.com/software/rhea" type="website"/>
|
||||
<ccm:contact uri="mailto:rhea@redhat.com" type="support"/>
|
||||
</ccm:contacts>
|
||||
<ccm:description>
|
||||
Content type for member of a scientific organization, for example a
|
||||
science institute.
|
||||
</ccm:description>
|
||||
</ccm:application>
|
||||
|
|
@ -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 );
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
begin;
|
||||
\i ddl/postgres/create.sql
|
||||
\i ddl/postgres/deferred.sql
|
||||
end;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||
|
||||
<ctd:content-type
|
||||
label="SciMember"
|
||||
description="Base type for members of scientific orgnizations"
|
||||
objectType="com.arsdigita.cms.contenttypes.SciMember"
|
||||
classname="com.arsdigita.cms.contenttypes.SciMember">
|
||||
|
||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.GenericPersonCreate">
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
||||
labelBundle="com.arsdigita.cms.CMSResources"
|
||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
||||
descriptionBundle="com.arsdigita.cms.CMSResources"
|
||||
component="com.arsdigita.cms.contenttypes.ui.SciMemberPropertiesStep"
|
||||
ordering="1"/>
|
||||
|
||||
<ctd:authoring-step
|
||||
labelKey="person.authoring.contact_properties.title"
|
||||
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
||||
descriptionKey="person.authoring.contact_properties.description"
|
||||
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
||||
component="com.arsdigita.cms.contenttypes.ui.GenericPersonContactPropertiesStep"
|
||||
ordering="2"/>
|
||||
|
||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||
|
||||
</ctd:authoring-kit>
|
||||
|
||||
</ctd:content-type>
|
||||
|
||||
</ctd:content-types>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<xrd:adapters
|
||||
xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
|
||||
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator">
|
||||
|
||||
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.SciMember"
|
||||
extends="com.arsdigita.cms.ContentPage">
|
||||
|
||||
<xrd:attributes rule="exclude">
|
||||
<xrd:property name="/object/birthdate"/>
|
||||
<xrd:property name="/object/gender"/>
|
||||
</xrd:attributes>
|
||||
|
||||
<xrd:associations rule="include">
|
||||
<xrd:property name="/object/contacts"/>
|
||||
<xrd:property name="/object/contacts/contactentries"/>
|
||||
<xrd:property name="/object/contacts/address"/>
|
||||
</xrd:associations>
|
||||
|
||||
</xrd:adapter>
|
||||
</xrd:context>
|
||||
</xrd:adapters>
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<registry>
|
||||
<!-- nothing yet -->
|
||||
</registry>
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
<load>
|
||||
<requires>
|
||||
<table name="inits"/>
|
||||
<table name="acs_objects"/>
|
||||
<table name="cms_items"/>
|
||||
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||
</requires>
|
||||
<provides>
|
||||
<table name="ct_sci_members"/>
|
||||
<initializer class="com.arsdigita.cms.contenttypes.SciMemberInitializer"/>
|
||||
</provides>
|
||||
<scripts>
|
||||
<schema directory="ccm-sci-types-member"/>
|
||||
<data class="com.arsdigita.cms.contenttypes.SciMemberLoader"/>
|
||||
</scripts>
|
||||
</load>
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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";
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE stylesheet [
|
||||
<!ENTITY nbsp " " ><!-- no-break space = non-breaking space, U+00A0 ISOnum -->
|
||||
]>
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
version="1.0">
|
||||
|
||||
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.SciMember']"
|
||||
mode="cms:CT_graphics"
|
||||
name="cms:CT_graphics_com_arsdigita_cms_contenttypes_SciMember">
|
||||
<p><xsl:value-of select="./name"/></p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="cms:item[objectType='com.arsdigita.cms.contenttypes.SciMember']" mode="cms:CT_text"
|
||||
name="cms:CT_text_com_arsdigita_cms_contenttypes_SciMember">
|
||||
<p><xsl:value-of select="./name"/></p>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue