Package nz.govt.natlib.adapter

Examples of nz.govt.natlib.adapter.DataAdapter.adapt()


    pContext.addListener(listener);
   
    // Attempt to harvest the metadata.
    try {       
      // Extract the metadata.
      adapter.adapt(file, pContext);

      //transformer to convert raw output to nlnz_presmet format
      //TransformProcessor transformer = TransformProcessor.getInstance(outDTD, "nlnz_presmet.xsd");
           
      //get the adapter output as a byte array
View Full Code Here


        : Config.getInstance().getXMLBaseURL() + "/" + outDTD);
    handler.addListener(listener);

    // Adapt the file.
    LogManager.getInstance().logMessage(LogMessage.WORTHLESS_CHATTER, "Starting Adapter");
    adapter.adapt(file, handler);
    LogManager.getInstance().logMessage(LogMessage.WORTHLESS_CHATTER, "Finished adapting");

    // Get the transformer that is configured to map from the native format
    // to the "nlnz_presmet.xsd" format. Note that because the
    // nlnz_presmet.xsd files have a preamble, and may contain metadata for
View Full Code Here

      ParserListener listener = new DTDXmlParserListener(bout,
          outDTD == null ? null : Config.getInstance()
              .getXMLBaseURL()
              + "/" + outDTD);
      handler.addListener(listener);
      adapter.adapt(file, handler);

      transformer.transform(new ByteArrayInputStream(bout.toByteArray()),
          out);
    } finally {
      if (out != null) {
View Full Code Here

     
      // Get the appropriate adapter.
      DataAdapter adapter = AdapterFactory.getInstance().getAdapter(f);
     
      // Extract the metadata.
      adapter.adapt(f, ctx);

      // Display the metadata.
      System.out.println(listener.getContents());
     
    } catch (IOException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.