Kommentare.

git-svn-id: https://svn.libreccm.org/ccm/trunk@1107 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2011-09-07 17:52:05 +00:00
parent 36e34744d0
commit 5ee07979d0
2 changed files with 73 additions and 6 deletions

View File

@ -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; package com.arsdigita.cms.contenttypes;
import com.arsdigita.cms.ContentPage; import com.arsdigita.cms.ContentPage;
import com.arsdigita.cms.ExtraXMLGenerator; import com.arsdigita.cms.ExtraXMLGenerator;
import com.arsdigita.cms.publicpersonalprofile.ContentGenerator;
import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.domain.DataObjectNotFoundException;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.arsdigita.persistence.OID; import com.arsdigita.persistence.OID;
@ -12,6 +31,15 @@ import com.arsdigita.util.Assert;
import java.util.List; 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 * @author Jens Pelzetter
* @version $Id$ * @version $Id$
@ -28,24 +56,28 @@ public class PublicPersonalProfile extends ContentPage {
this(BASE_DATA_OBJECT_TYPE); this(BASE_DATA_OBJECT_TYPE);
} }
public PublicPersonalProfile(BigDecimal id) public PublicPersonalProfile(final BigDecimal id)
throws DataObjectNotFoundException { throws DataObjectNotFoundException {
this(new OID(BASE_DATA_OBJECT_TYPE, id)); this(new OID(BASE_DATA_OBJECT_TYPE, id));
} }
public PublicPersonalProfile(OID oid) public PublicPersonalProfile(final OID oid)
throws DataObjectNotFoundException { throws DataObjectNotFoundException {
super(oid); super(oid);
} }
public PublicPersonalProfile(DataObject dobj) { public PublicPersonalProfile(final DataObject dobj) {
super(dobj); super(dobj);
} }
public PublicPersonalProfile(String type) { public PublicPersonalProfile(final String type) {
super(type); super(type);
} }
/**
*
* @return The owner of the profile.
*/
public GenericPerson getOwner() { public GenericPerson getOwner() {
final DataCollection collection = (DataCollection) get(OWNER); 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; GenericPerson oldOwner;
oldOwner = getOwner(); 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() { public String getProfileUrl() {
return (String) get(PROFILE_URL); return (String) get(PROFILE_URL);
} }
@ -84,6 +127,12 @@ public class PublicPersonalProfile extends ContentPage {
set(PROFILE_URL, profileUrl); 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 @Override
public List<ExtraXMLGenerator> getExtraXMLGenerators() { public List<ExtraXMLGenerator> getExtraXMLGenerators() {
final List<ExtraXMLGenerator> generators = super.getExtraXMLGenerators(); final List<ExtraXMLGenerator> generators = super.getExtraXMLGenerators();

View File

@ -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; package com.arsdigita.cms.contenttypes;
import com.arsdigita.runtime.AbstractConfig; import com.arsdigita.runtime.AbstractConfig;