diff --git a/ccm-cms-types-person/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Person.xml b/ccm-cms-types-person/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Person.xml new file mode 100644 index 000000000..07f9c6b01 --- /dev/null +++ b/ccm-cms-types-person/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Person.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + diff --git a/ccm-cms-types-person/ccm-cms-types-person.config b/ccm-cms-types-person/ccm-cms-types-person.config new file mode 100644 index 000000000..7ce9c49e2 --- /dev/null +++ b/ccm-cms-types-person/ccm-cms-types-person.config @@ -0,0 +1,5 @@ + + + + diff --git a/ccm-cms-types-person/ccm-cms-types-person.load b/ccm-cms-types-person/ccm-cms-types-person.load new file mode 100644 index 000000000..21acfd3c1 --- /dev/null +++ b/ccm-cms-types-person/ccm-cms-types-person.load @@ -0,0 +1,16 @@ + + + +
+
+ + + +
+ + + + + + + diff --git a/ccm-cms-types-person/com/argsdigita/cms/contenttypes/Person.java b/ccm-cms-types-person/com/argsdigita/cms/contenttypes/Person.java new file mode 100644 index 000000000..e2722f5b6 --- /dev/null +++ b/ccm-cms-types-person/com/argsdigita/cms/contenttypes/Person.java @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2009 University Bremen, Center for Social Politics, Parkallee 39, 28209 Bremen. + * + */ + +package com.argsdigita.cms.contenttypes; + +import com.arsdigita.cms.ContentType; +import com.arsdigita.cms.ContentPage; +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import com.arsdigita.util.Assert; +import java.math.BigDecimal; + +/** + * Basic Person Contenttype for OpenCCM. + * + * @author Jens Pelzetter + */ +public class Person extends ContentPage { + + public static final String SURNAME = "surname"; + public static final String GIVENNAME = "givenname"; + public static final String TITLEPRE = "titlepre"; + public static final String TITLEPOST = "titlepost"; + /** Data object type for this domain object */ + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Person"; + private static final PersonConfig s_config = new PersonConfig(); + + + static { + s_config.load(); + } + + public static final PersonConfig getConfig() { + return s_config; + } + + /** + * Default constructor. This creates a new (empty) Person. + **/ + public Person() { + this(BASE_DATA_OBJECT_TYPE); + } + + public Person(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Person(OID id) throws DataObjectNotFoundException { + super(id); + } + + public Person(DataObject obj) { + super(obj); + } + + public Person(String type) { + super(type); + } + + public void beforeSave() { + super.beforeSave(); + + Assert.exists(getContentType(), ContentType.class); + } + + /* accessors *****************************************************/ + public String getSurname() { + return (String)get(SURNAME); + } + public void setSurname(String surname) { + set(SURNAME, surname); + } + + public String getGivenName() { + return (String)get(GIVENNAME); + } + public void setGivenName(String givenName) { + set(GIVENNAME, givenName); + } + + public String getTitlePre() { + return (String)get(TITLEPRE); + } + public void setTitlePre(String titlePre) { + set(TITLEPRE, titlePre); + } + + public String getTitlePost() { + return (String)get(TITLEPOST); + } + public void setTitlePost(String titlePost) { + set(TITLEPOST, titlePost); + } +} diff --git a/ccm-cms-types-person/com/argsdigita/cms/contenttypes/PersonConfig.java b/ccm-cms-types-person/com/argsdigita/cms/contenttypes/PersonConfig.java new file mode 100644 index 000000000..b87550dfb --- /dev/null +++ b/ccm-cms-types-person/com/argsdigita/cms/contenttypes/PersonConfig.java @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2009 University Bremen, Center for Social Politics, Parkallee 39, 28209 Bremen. + * + */ + +package com.argsdigita.cms.contenttypes; + +import com.arsdigita.runtime.AbstractConfig; +import com.arsdigita.util.parameter.Parameter; +import com.arsdigita.util.parameter.BooleanParameter; + +/** + * + * @author Jens Pelzetter + */ +public class PersonConfig extends AbstractConfig { + +} diff --git a/ccm-cms-types-person/com/argsdigita/cms/contenttypes/PersonInitializer.java b/ccm-cms-types-person/com/argsdigita/cms/contenttypes/PersonInitializer.java new file mode 100644 index 000000000..a823b43df --- /dev/null +++ b/ccm-cms-types-person/com/argsdigita/cms/contenttypes/PersonInitializer.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2009 University Bremen, Center for Social Politics, Parkallee 39, 28209 Bremen. + * + */ +package com.argsdigita.cms.contenttypes; + +import com.arsdigita.cms.contenttypes.ContentTypeInitializer; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.domain.DomainObjectInstantiator; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.runtime.DomainInitEvent; +import org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class PersonInitializer extends ContentTypeInitializer { + + public final static String versionId = + "$Id: AddressInitializer.java 1 2009-03-19 08:30:26Z jensp $" + + "$Author: jensp $" + + "$DateTime: 2009/03/19 09:30:00 $"; + + private static final Logger s_log = Logger.getLogger(PersonInitializer.class); + + public PersonInitializer() { + super("ccm-cms-types-person.pdl.mf", + Person.BASE_DATA_OBJECT_TYPE); + } + + public void init(DomainInitEvent evt) { + super.init(evt); + } + + public String[] getStylesheets() { + return new String[] { "" }; + } +} diff --git a/ccm-cms-types-person/com/argsdigita/cms/contenttypes/PersonLoader.java b/ccm-cms-types-person/com/argsdigita/cms/contenttypes/PersonLoader.java new file mode 100644 index 000000000..725055bf4 --- /dev/null +++ b/ccm-cms-types-person/com/argsdigita/cms/contenttypes/PersonLoader.java @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2009 University Bremen, Center for Social Politics, Parkallee 39, 28209 Bremen. + * + */ +package com.argsdigita.cms.contenttypes; + +import com.arsdigita.cms.contenttypes.AbstractContentTypeLoader; + +import org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class PersonLoader extends AbstractContentTypeLoader { + + private static final Logger s_log = Logger.getLogger(PersonLoader.class); + private static final String[] TYPES = { + "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Person.xml" + }; + + public String[] getTypes() { + return TYPES; + } +} diff --git a/ccm-cms-types-person/pdl/com/arsdigita/content-types/Person.pdl b/ccm-cms-types-person/pdl/com/arsdigita/content-types/Person.pdl new file mode 100644 index 000000000..ff4852eb5 --- /dev/null +++ b/ccm-cms-types-person/pdl/com/arsdigita/content-types/Person.pdl @@ -0,0 +1,12 @@ +model com.arsdigita.cms.ContentPage; + +import com.arsdigita.cms.ContentPage; + +object type Person extends ContentPage { + String[0..1] surname = ct_persons.surname VARCHAR(512); + String[0..1] givenname = ct.persons.givenname VARCHAR(512); + String[0..1] titlepre = ct.persons.titlepre VARCHAR(256); + String[0..1] titlepost = ct.persons.titlepost VARCHAR(256); + + reference key (ct.persons.person_id); +} \ No newline at end of file diff --git a/ccm-core/src/com/redhat/persistence/pdl/adapters/BlobAd.java b/ccm-core/src/com/redhat/persistence/pdl/adapters/BlobAd.java index 6b97ccaa8..ecbbabfe4 100755 --- a/ccm-core/src/com/redhat/persistence/pdl/adapters/BlobAd.java +++ b/ccm-core/src/com/redhat/persistence/pdl/adapters/BlobAd.java @@ -75,7 +75,8 @@ public class BlobAd extends SimpleAdapter { return; } - oracle.sql.BLOB blob = + /* Jens Pelzetter 2009-03-16 commented out to get rid of Netbeans errors */ + /*oracle.sql.BLOB blob = (oracle.sql.BLOB) rs.getBlob(column); OutputStream out = blob.getBinaryOutputStream(); try { @@ -88,7 +89,7 @@ public class BlobAd extends SimpleAdapter { // because the classpath isn't set up to include // com.arsdigita.util.* throw new Error("Unable to write LOB: " + e); - } + }*/ } } diff --git a/ccm-core/src/com/redhat/persistence/pdl/adapters/StringAd.java b/ccm-core/src/com/redhat/persistence/pdl/adapters/StringAd.java index b16ad061b..90b74f29e 100755 --- a/ccm-core/src/com/redhat/persistence/pdl/adapters/StringAd.java +++ b/ccm-core/src/com/redhat/persistence/pdl/adapters/StringAd.java @@ -75,7 +75,8 @@ public class StringAd extends SimpleAdapter { return; } - oracle.sql.CLOB clob = + /* Jens Pelzetter 2009-03-16 commented out to get rid of Netbeans errors */ + /*oracle.sql.CLOB clob = (oracle.sql.CLOB) rs.getClob(column); Writer out = clob.getCharacterOutputStream(); try { @@ -88,7 +89,6 @@ public class StringAd extends SimpleAdapter { // because the classpath isn't set up to include // com.arsdigita.util.* throw new Error("Unable to write LOB: " + e); - } + }*/ } - }