Package org.apache.ecs

Examples of org.apache.ecs.XhtmlDocument


*/
public class DavUtil
{
    public static String getCollectionInHTML( WikiContext context, Collection coll )
    {
        XhtmlDocument doc = new XhtmlDocument("UTF-8");
       
        ul content = new ul();
       
        for( Iterator i = coll.iterator(); i.hasNext(); )
        {
            Object o = i.next();
           
            if( o instanceof WikiPage )
            {
                WikiPage p = (WikiPage)o;
                content.addElement( new li().addElement( p.getName() ) );
            }
            else if( o instanceof String )
            {
                content.addElement( new li().addElement( o.toString() ));
            }
        }

        doc.appendBody( content );
       
        return doc.toString();
    }
View Full Code Here


*/
public class DavUtil
{
    public static String getCollectionInHTML( WikiContext context, Collection coll )
    {
        XhtmlDocument doc = new XhtmlDocument("UTF-8");
       
        ul content = new ul();
       
        for( Iterator i = coll.iterator(); i.hasNext(); )
        {
            Object o = i.next();
           
            if( o instanceof WikiPage )
            {
                WikiPage p = (WikiPage)o;
                content.addElement( new li().addElement( p.getName() ) );
            }
            else if( o instanceof String )
            {
                content.addElement( new li().addElement( o.toString() ));
            }
        }

        doc.appendBody( content );
       
        return doc.toString();
    }
View Full Code Here

      PrintWriter w = new PrintWriter(writer);
      if (onlyTable)
        table.output(w);
      else
      {
        XhtmlDocument doc = new XhtmlDocument();
        doc.appendBody(table);
        if (extension.getStyleURL() != null)
        {
          link l = new link(extension.getStyleURL(), "stylesheet", "text/css");
          doc.appendHead(l);         
        }
        if (extension.getScriptURL() != null)
        {
          script jslink = new script();
          jslink.setLanguage("javascript");
          jslink.setSrc(extension.getScriptURL());
          doc.appendHead(jslink);
        }
        doc.output(w);
      }
      w.flush();
      w.close();
    }
    catch (Exception e)
View Full Code Here

TOP

Related Classes of org.apache.ecs.XhtmlDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.