/* * [AggHead.java] * * Summary: Produce the header for a Frame Aggregate. * * Copyright: (c) 2004-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.8 2009-02-06 include go package in ZIP bundle. */ package com.mindprod.htmlmacros.macro; import com.mindprod.common18.ST; import com.mindprod.fastcat.FastCat; import static com.mindprod.htmlmacros.macro.Global.configuration; import static java.lang.System.*; /** * Produce the header for a Frame Aggregate. * * @author Roedy Green, Canadian Mind Products * @version 1.8 2009-02-06 include go package in ZIP bundle. * @since 2004 */ @SuppressWarnings( { "UnusedDeclaration" } ) public final class AggHead extends Head { // declarations /** * how to use the macro */ private static final String USAGE = "\nAggHead needs title description keywords"; // /declarations // methods /** * aggregate frame header * * @param title title of the document * @param description long description * @param keywords indexing keywords * * @return expanded header */ public String aggHead( final String title, final String shortTitle, final String description, final String keywords ) { final int firstCopyrightYear = configuration.getFirstCopyrightYear( fileBeingDistributed ); final String copyrightHolderForPage = configuration.getCopyrightHolderForPage( fileBeingDistributed ); final FastCat sb = new FastCat( 7 ); sb.append( configuration.getDoctypeForFrame( fileBeingDistributed ) ); sb.append( "\n" ); sb.append( buildInvisHeaderMetaTags( title, shortTitle, description, keywords, firstCopyrightYear, copyrightHolderForPage ) ); final String screen = configuration.getStylesheetForUsual(); /* e.g. mindprod.css */ final String handheld = ST.chopTrailingString( screen, ".css" ) + "h.css"; sb.append( buildStylesheetLink( screen, "screen" ) ); sb.append( buildStylesheetLink( handheld, "handheld" ) ); sb.append( buildInvisHeaderLinks( null ) ); sb.append( "\n" ); return sb.toString(); } // /method /** * Generate the header for an Aggregate frame page. * * @param parms parameters from macro command line. parms[0] = title description of fragment. parms[1] * = description parms[2] = keywords * @param quiet true if want output suppressed. * @param verbose @return expanded macro text */ public String expandMacro( String[] parms, final boolean quiet, final boolean verbose ) { if ( !quiet ) { out.print( "A" ); } if ( parms.length != 3 ) { throw new IllegalArgumentException( USAGE ); } String title = parms[ 0 ]; String description = parms[ 1 ]; String keywords = parms[ 2 ]; return aggHead( title, title, description, keywords ); } // /method // /methods }