From 5ee07979d0f143cbc7790564ec6a6fff2d32b372 Mon Sep 17 00:00:00 2001 From: jensp Date: Wed, 7 Sep 2011 17:52:05 +0000 Subject: [PATCH] Kommentare. git-svn-id: https://svn.libreccm.org/ccm/trunk@1107 8810af33-2d31-482b-a856-94f89814c4df --- .../contenttypes/PublicPersonalProfile.java | 61 +++++++++++++++++-- .../PublicPersonalProfileConfig.java | 18 ++++++ 2 files changed, 73 insertions(+), 6 deletions(-) diff --git a/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/PublicPersonalProfile.java b/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/PublicPersonalProfile.java index 6e2c92eca..ad9ed98e3 100644 --- a/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/PublicPersonalProfile.java +++ b/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/PublicPersonalProfile.java @@ -1,7 +1,26 @@ +/* + * 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.cms.ContentPage; import com.arsdigita.cms.ExtraXMLGenerator; +import com.arsdigita.cms.publicpersonalprofile.ContentGenerator; import com.arsdigita.domain.DataObjectNotFoundException; import java.math.BigDecimal; import com.arsdigita.persistence.OID; @@ -12,7 +31,16 @@ import com.arsdigita.util.Assert; import java.util.List; /** - * + * A content type representing a profile (a personal homepage) of a person. + * On the start page of the the profile the contact data and a photo (if any) + * associated with the owner of the profile are shown. Other content items can + * be associated with the profile. They are shown in special navigation. Also, + * there special items for the profile which not backed by a content item. + * Instead, they are backed by a Java class which implements the + * {@link ContentGenerator} interface. A profile can either be shown as + * a standalone page (similar the separate category system) or embedded into + * the normal site. + * * @author Jens Pelzetter * @version $Id$ */ @@ -28,24 +56,28 @@ public class PublicPersonalProfile extends ContentPage { this(BASE_DATA_OBJECT_TYPE); } - public PublicPersonalProfile(BigDecimal id) + public PublicPersonalProfile(final BigDecimal id) throws DataObjectNotFoundException { this(new OID(BASE_DATA_OBJECT_TYPE, id)); } - public PublicPersonalProfile(OID oid) + public PublicPersonalProfile(final OID oid) throws DataObjectNotFoundException { super(oid); } - public PublicPersonalProfile(DataObject dobj) { + public PublicPersonalProfile(final DataObject dobj) { super(dobj); } - public PublicPersonalProfile(String type) { + public PublicPersonalProfile(final String type) { super(type); } + /** + * + * @return The owner of the profile. + */ public GenericPerson getOwner() { final DataCollection collection = (DataCollection) get(OWNER); @@ -62,7 +94,12 @@ public class PublicPersonalProfile extends ContentPage { } } - public void setOwner(GenericPerson owner) { + /** + * Sets the owner of the profile. + * + * @param owner + */ + public void setOwner(final GenericPerson owner) { GenericPerson oldOwner; oldOwner = getOwner(); @@ -76,6 +113,12 @@ public class PublicPersonalProfile extends ContentPage { } } + /** + * + * @return The URL fragment of the profile used to build the URL of the + * profile. + + */ public String getProfileUrl() { return (String) get(PROFILE_URL); } @@ -84,6 +127,12 @@ public class PublicPersonalProfile extends ContentPage { set(PROFILE_URL, profileUrl); } + /** + * The profile has an extra XML Generator, which is primarily to render + * the items and the navigation of the profile for the embedded view. + * + * @return + */ @Override public List getExtraXMLGenerators() { final List generators = super.getExtraXMLGenerators(); diff --git a/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/PublicPersonalProfileConfig.java b/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/PublicPersonalProfileConfig.java index 57820543a..24025b34d 100644 --- a/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/PublicPersonalProfileConfig.java +++ b/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/contenttypes/PublicPersonalProfileConfig.java @@ -1,3 +1,21 @@ +/* + * 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.runtime.AbstractConfig;