From ec708d80d8bc44a64c7cff0f7f4da03ae5552948 Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 10 May 2012 18:06:43 +0000 Subject: [PATCH] Korrekturen am AbstractBundleUpgrade und an PersonalProjects git-svn-id: https://svn.libreccm.org/ccm/trunk@1654 8810af33-2d31-482b-a856-94f89814c4df --- .../PublicPersonalProfilesServlet.java | 22 +------------------ .../upgrades/AbstractBundleUpgrade.java | 5 ++--- .../PersonalProjects.java | 11 +++++----- 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/publicpersonalprofile/PublicPersonalProfilesServlet.java b/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/publicpersonalprofile/PublicPersonalProfilesServlet.java index 5850eb3ba..5c9aec67c 100644 --- a/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/publicpersonalprofile/PublicPersonalProfilesServlet.java +++ b/ccm-cms-publicpersonalprofile/src/com/arsdigita/cms/publicpersonalprofile/PublicPersonalProfilesServlet.java @@ -125,27 +125,7 @@ public class PublicPersonalProfilesServlet extends BaseApplicationServlet { final Element root = document.getRootElement(); final Session session = SessionManager.getSession(); - - /*final DataCollection profiles = getProfiles(session, - path.getProfileOwner(), - path.getPreview(), - GlobalizationHelper. - getNegotiatedLocale().getLanguage()); - - if (profiles.isEmpty()) { - response.sendError(HttpServletResponse.SC_NOT_FOUND); - return; - } else if (profiles.size() > 1) { - throw new IllegalStateException( - "More than one matching members found."); - } - - profiles.next(); - PublicPersonalProfile profile = - (PublicPersonalProfile) DomainObjectFactory. - newInstance(profiles.getDataObject()); - profiles.close();*/ - + PublicPersonalProfile profile = getProfile( session, path.getProfileOwner(), diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java index f18dbaf4b..2a02abeed 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/upgrades/AbstractBundleUpgrade.java @@ -95,10 +95,9 @@ public abstract class AbstractBundleUpgrade extends Program { "SELECT parent_id " + "FROM cms_items " + "JOIN %s " - + "ON cms_items.item_id = %s.%s", + + "ON cms_items.item_id = %s.bundle_id", getBundleTableName(), - getBundleTableName(), - getIdColName())); + getBundleTableName())); while (personsRs.next()) { stmt.addBatch(String.format("INSERT INTO %s (bundle_id) " diff --git a/ccm-sci-personalprojects/src/com/arsdigita/cms/publicpersonalprofile/PersonalProjects.java b/ccm-sci-personalprojects/src/com/arsdigita/cms/publicpersonalprofile/PersonalProjects.java index 31193a90c..ccbc5f03d 100644 --- a/ccm-sci-personalprojects/src/com/arsdigita/cms/publicpersonalprofile/PersonalProjects.java +++ b/ccm-sci-personalprojects/src/com/arsdigita/cms/publicpersonalprofile/PersonalProjects.java @@ -18,7 +18,6 @@ import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.OID; import com.arsdigita.xml.Element; -import java.math.BigDecimal; import java.text.DateFormat; import java.util.ArrayList; import java.util.Calendar; @@ -95,7 +94,7 @@ public class PersonalProjects implements ContentGenerator { final List projects = new LinkedList(); final DataCollection collection = (DataCollection) person. - getGenericPersonBundle().get("organizationalunits"); + getGenericPersonBundle().get("organizationalunits"); DomainObject obj; while (collection.next()) { obj = DomainObjectFactory.newInstance(collection.getDataObject()); @@ -248,13 +247,15 @@ public class PersonalProjects implements ContentGenerator { final SciProject project = projectBundle.getProject(GlobalizationHelper. getNegotiatedLocale().getLanguage()); + if (project == null) { + return; + } + Element projectElem = projectGroupElem.newChildElement("project"); projectElem.addAttribute("oid", project.getOID().toString()); Element title = projectElem.newChildElement("title"); - title.setText(project.getTitle()); - - //Element beginElem = projectElem.newChildElement("projectbegin"); + title.setText(project.getTitle()); if ((project.getAddendum() != null) && !(project.getAddendum().isEmpty())) {