001/* 002 * (C) Copyright 2006-2007 Nuxeo SAS <http://nuxeo.com> and others 003 * 004 * All rights reserved. This program and the accompanying materials 005 * are made available under the terms of the Eclipse Public License v1.0 006 * which accompanies this distribution, and is available at 007 * http://www.eclipse.org/legal/epl-v10.html 008 * 009 * Contributors: 010 * Jean-Marc Orliaguet, Chalmers 011 * 012 * $Id$ 013 */ 014 015package org.nuxeo.theme.jsf.filters.standalone; 016 017import org.nuxeo.theme.rendering.RenderingInfo; 018import org.nuxeo.theme.rendering.StandaloneFilter; 019 020public final class FragmentTag extends StandaloneFilter { 021 022 @Override 023 public RenderingInfo process(final RenderingInfo info, final boolean cache) { 024 // postpone the rendering 025 if (info.isRenderingPostponed(cache)) { 026 String markup = String.format( 027 "<nxthemes:fragment xmlns:nxthemes=\"http://nuxeo.org/nxthemes\" uid=\"%s\" engine=\"%s\" mode=\"%s\" />", 028 info.getElement().getUid().toString(), info.getEngine().getTypeName(), info.getViewMode()); 029 info.setMarkup(markup); 030 } 031 return info; 032 } 033 034}