4 Wrapper for the Cocoon XML publishing framework to be invoked in
7 Author: Ovidiu Predescu <ovidiu@cup.hp.com>
10 Copyright (C) 2000 Ovidiu Predescu
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License as
14 published by the Free Software Foundation; either version 2 of the
15 License, or (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 General Public License for more details.
22 You should have received a copy of the GNU General Public License
23 along with this program; if not, write to the Free Software
24 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
30 import org.apache.cocoon.Cocoon;
34 public static String propFilename = null;
35 public static String userAgent = null;
37 public static void setPropertyFilename(String filename)
39 propFilename = filename;
42 public static void setUserAgent(String ua)
47 public static void invoke(String filename, String outFilename)
49 if (propFilename == null || propFilename.equals("")) {
50 System.out.println("Please setup the Cocoon properties file in the "
51 + "customization menu");
55 boolean hasUserAgent = userAgent != null && !userAgent.equals("");
56 String[] args = new String[hasUserAgent ? 6 : 4];
60 args[i++] = propFilename;
63 args[i++] = userAgent;
66 args[i++] = outFilename;
72 System.out.println("Cannot process: " + e);