Änderung der Verabeitung von ContentBundles in RelatedLinks
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-94f89814c4dfmaster
parent
69b61307a4
commit
c00933d9bf
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue