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.elements; 016 017import java.net.URL; 018import java.util.ArrayList; 019import java.util.List; 020 021import org.apache.commons.logging.Log; 022import org.apache.commons.logging.LogFactory; 023import org.nuxeo.theme.Manager; 024import org.nuxeo.theme.nodes.Node; 025 026public class ThemeElement extends AbstractElement { 027 028 private static final Log log = LogFactory.getLog(ThemeElement.class); 029 030 @Override 031 public List<Node> getChildrenInContext(URL themeURL) { 032 List<Node> children = new ArrayList<Node>(); 033 Node page = Manager.getThemeManager().getThemePageByUrl(themeURL); 034 if (page != null) { 035 children.add(page); 036 } else { 037 log.error("No page found for URL " + themeURL); 038 } 039 return children; 040 } 041 042}