001/* 
002    Licensed to the Apache Software Foundation (ASF) under one
003    or more contributor license agreements.  See the NOTICE file
004    distributed with this work for additional information
005    regarding copyright ownership.  The ASF licenses this file
006    to you under the Apache License, Version 2.0 (the
007    "License"); you may not use this file except in compliance
008    with the License.  You may obtain a copy of the License at
009
010       http://www.apache.org/licenses/LICENSE-2.0
011
012    Unless required by applicable law or agreed to in writing,
013    software distributed under the License is distributed on an
014    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015    KIND, either express or implied.  See the License for the
016    specific language governing permissions and limitations
017    under the License.  
018 */
019package org.apache.wiki.tags;
020
021import org.apache.wiki.ui.TemplateManager;
022
023/**
024 *  This tag is used to include any programmatic includes into the
025 *  output stream.  Actually, what it does is that it simply emits a
026 *  tiny marker into the stream, and then a ServletFilter will take
027 *  care of the actual inclusion.
028 *  
029 *
030 */
031public class IncludeResourcesTag extends WikiTagBase
032{
033    private static final long serialVersionUID = 0L;
034        
035    private String m_type;
036
037    public void initTag()
038    {
039        super.initTag();
040        m_type = null;
041    }
042    
043    public void setType(final String type )
044    {
045        m_type = type;
046    }
047    
048    public int doWikiStartTag() throws Exception
049    {
050        //String marker = m_wikiContext.getEngine().getTemplateManager().getMarker(m_wikiContext, m_type);
051        //String marker = TemplateManager.getMarker(pageContext, m_type);
052        final String marker = TemplateManager.getMarker(m_wikiContext, m_type);
053
054        pageContext.getOut().println( marker );
055        
056        return SKIP_BODY;
057    }
058
059}