    View Javadoc
    1   /*
    2    * Copyright (c) 2003
    3    * Information Desire GmbH
    4    * All rights reserved.
    5    */
    6   package com.infodesire.infobit.app;
    7
    8   import com.infodesire.infobit.InfobitManager;
    9   import com.infodesire.infobit.InfobitConfiguration;
    10
    11  import com.infodesire.infobit.data.Infobit;
    12
    13  import java.util.Collection;
    14  import java.util.Collections;
    15  import java.util.Iterator;
    16  import java.util.Properties;
    17  import java.util.HashMap;
    18
    19  import com.infodesire.infobit.render.velocity.ExportVelocityRenderer;
    20  import java.io.OutputStreamWriter;
    21  /***
    22   * infobit exporting application
    23   *
    24   * @author    konstantin
    25   * @created   September 12, 2003
    26   * @version   $Revision: 1.3 $
    27   */
    28  public class Export {
    29
    30      /***
    31       * The main program for the Export class
    32       *
    33       * @param argv           The command line arguments
    34       * @exception Exception  Description of Exception
    35       */
    36      public static void main(String[] argv) throws Exception {
    37
    38          InfobitManager manager = InfobitConfiguration.getInstance().getPool("unitracc_pool").getInfobitManager();
    39          ExportVelocityRenderer evr = new ExportVelocityRenderer();
    40          evr.setManager(manager);
    41          evr.init(new Properties());
    42          Collection infobits = manager.queryInfobits("id is not null");
    43          OutputStreamWriter writer = new OutputStreamWriter(System.out);
    44          Infobit ibit;
    45          HashMap params = new HashMap();
    46          params.put("_render_mode", "infobit_only");
    47          Iterator iter;
    48          for (iter = infobits.iterator(); iter.hasNext(); ) {
    49              evr.render(((Infobit) iter.next()).getName(), writer, params);
    50          }
    51
    52          params.put("_render_mode", "content_snapshot");
    53          for (iter = infobits.iterator(); iter.hasNext(); ) {
    54              evr.render(((Infobit) iter.next()).getName(), writer, params);
    55          }
    56
    57          writer.flush();
    58      }
    59  }

This page was automatically generated by Maven