From c00933d9bf9b535fcdef7a9418440922830d2c2c Mon Sep 17 00:00:00 2001 From: quasi Date: Thu, 7 Jan 2010 09:48:33 +0000 Subject: [PATCH] =?UTF-8?q?=C3=84nderung=20der=20Verabeitung=20von=20Conte?= =?UTF-8?q?ntBundles=20in=20RelatedLinks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Durch Einführung und Verwendung von ContentItemXMLRenderer weerden ContentBundles bei der Erzeugung der XML-Ausgabe zur ausgehandelten Sprache aufgelöst und statt des ContentBundles dieses neue Objekt ausgeben. Es ist eine API-Änderung nötig gewesen: in DomainObjectTraversal.java mußte die walk()-Methode protected markiert werden. (Dateien vergessen hinzuzufügen.) git-svn-id: https://svn.libreccm.org/ccm/trunk@321 8810af33-2d31-482b-a856-94f89814c4df --- .../arsdigita/cms/ContentItemXMLRenderer.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ccm-cms/src/com/arsdigita/cms/ContentItemXMLRenderer.java diff --git a/ccm-cms/src/com/arsdigita/cms/ContentItemXMLRenderer.java b/ccm-cms/src/com/arsdigita/cms/ContentItemXMLRenderer.java new file mode 100644 index 000000000..ba378cd4e --- /dev/null +++ b/ccm-cms/src/com/arsdigita/cms/ContentItemXMLRenderer.java @@ -0,0 +1,39 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms; + +import com.arsdigita.dispatcher.DispatcherHelper; +import com.arsdigita.domain.DomainObject; +import com.arsdigita.domain.DomainObjectTraversalAdapter; +import com.arsdigita.domain.DomainObjectXMLRenderer; +import com.arsdigita.xml.Element; + +/** + * + * @author quasi + */ + +public class ContentItemXMLRenderer extends DomainObjectXMLRenderer { + + public ContentItemXMLRenderer(Element root) { + super(root); + } + + protected void walk(final DomainObjectTraversalAdapter adapter, + final DomainObject obj, + final String path, + final String context, + final DomainObject linkObject) { + + DomainObject nObj = obj; + + if (nObj instanceof ContentBundle) { + + nObj = ((ContentBundle) obj).negotiate(DispatcherHelper.getRequest().getLocales()); + } + + super.walk(adapter, nObj, path, context, linkObject); + } +}