Package nz.govt.natlib.meta.log

Examples of nz.govt.natlib.meta.log.LogMessage


      Object source = event.getError();
      String comment = "";
      if (source instanceof Throwable) {
        comment = ((Throwable) source).getMessage();
      }
      LogMessage msg = new LogMessage(LogMessage.ERROR, source,
          "Error harvesting file :"
              + event.getSource().getFile().getName(), comment);
      LogManager.getInstance().logMessage(msg);
      event.getSource().setStatus(HarvestStatus.ERROR,
          comment + " <b>(log id=" + msg.getId() + ")</b>");
      error = true;
    }

    String name = event.getSource().getFile().getName();
    processedBytes += event.getSource().getFile().length();
View Full Code Here


    for (int i = 0; i < root.getChildCount() && !stopping; i++) {
      ObjectFolderNode object = (ObjectFolderNode) root.getChildAt(i);
      // work out what kind of harvester to use for each object...

      if (!FileModel.hasAFile(object)) {
        LogMessage msg = new LogMessage(LogMessage.DEBUG, object
            .getName(), "Object contains no files - skipping",
            "Add files to this object");
        LogManager.getInstance().logMessage(msg);
        continue;
      }

      String harvesterClass = config.getClassName();
      if (harvesterClass != null) {
        try {
          harvester = (Harvester) Class.forName(harvesterClass)
              .newInstance();
          // go to it...
          System.out.println("Harvesting " + object);
          harvester.harvest(config, object, new PropsManager(object,
              mainFrame), this);
        } catch (Throwable ex) {
          System.out.println("Exception Harvesting " + object);
          LogMessage msg = new LogMessage(LogMessage.ERROR, ex, ex
              .getMessage(), "");
          LogManager.getInstance().logMessage(msg);
          object.setStatus(HarvestStatus.ERROR, ex.getMessage()
              + " (logid=" + msg.getId() + ")");
          error = true;
        }
        System.gc();
      } else {
        LogMessage msg = new LogMessage(
            LogMessage.ERROR,
            null,
            "No harvester class specified for " + config.getName(),
            "check the config file, there should be a\n<harvester class='<classname>'/> tag");
        LogManager.getInstance().logMessage(msg);
View Full Code Here

      createConfigButt = new ImageButton("Create", new ImageIcon(
          ImagePanel.resolveImage(BUTTON_CREATE)));
      folder = new ImageIcon(ImagePanel.resolveImage(BUTTON_FOLDER));
    } catch (Exception e) {
      LogManager.getInstance().logMessage(
          new LogMessage(LogMessage.ERROR, e, "Image not found",
              "Installation may be corrupt?"));
    }
    Border configBorder = new TitledBorder(BorderFactory
        .createEtchedBorder(Color.white, new Color(148, 145, 140)),
        "Configuration Selection");
View Full Code Here

          .resolveImage("button_delete_mapping.gif"));
      mapPic = new ImageIcon(ImagePanel
          .resolveImage("mapping_screen.gif"));
    } catch (Exception e) {
      LogManager.getInstance().logMessage(
          new LogMessage(LogMessage.ERROR, e, "Image not found",
              "Installation may be corrupt?"));
    }
    Border mapBorder = new TitledBorder(BorderFactory.createEtchedBorder(
        Color.white, new Color(148, 145, 140)), "Add/Remove Mappings");
    addMap = new ImageButton("Add", addPic);
View Full Code Here

      cancelPic = new ImageIcon(ImagePanel
          .resolveImage("button_cancel.gif"));
      userPic = new ImageIcon(ImagePanel.resolveImage("icon_user.gif"));
    } catch (Exception e) {
      LogManager.getInstance().logMessage(
          new LogMessage(LogMessage.ERROR, e, "Image not found",
              "Installation may be corrupt?"));
    }
    addUser = new ImageButton("Add", addPic);
    addUser.addActionListener(new AddUserAction());
    delUser = new ImageButton("Del", delPic);
View Full Code Here

            .getOutputType();
      } catch (Exception e) {
        LogManager
            .getInstance()
            .logMessage(
                new LogMessage(
                    LogMessage.ERROR,
                    e,
                    "Trying to add invalid Harvester class in configuration",
                    "Check class name and try again"));
      }
View Full Code Here

        harvester.harvest(config, source, props,
            new HarvestProgressListener());
        LogManager.getInstance().logMessage(
            LogMessage.WORTHLESS_CHATTER, "Harvesting complete");
      } catch (Exception ex) {
        LogMessage msg = new LogMessage(LogMessage.ERROR, ex, ex
            .getMessage(), "");
        LogManager.getInstance().logMessage(msg);
        source.setStatus(HarvestStatus.ERROR, ex.getMessage()
            + " (logid=" + msg.getId() + ")");
      }
    } else {
      LogMessage msg = new LogMessage(
          LogMessage.ERROR,
          null,
          "No harvester class specified for " + config.getName(),
          "check the config file, there should be a\n<harvester class='<classname>'/> tag");
      LogManager.getInstance().logMessage(msg);
View Full Code Here

      // into a compiled Templates object.
      transformer = tFactory.newTransformer(new StreamSource(xsl));

      transformer.setErrorListener(new ErrorListener() {
        public void fatalError(TransformerException ex) {
          LogMessage msg = new LogMessage(LogMessage.CRITICAL,
              ex, "Fatal Error while processing",
              "fix the xsl:" + xsl + " stylesheet");
          // LogManager.logMessage(msg);
          throw new RuntimeException(
              "Error while transforming using " + xsl
                  + " stylesheet:" + ex.getMessage());
        }

        public void error(TransformerException ex) {
          LogMessage msg = new LogMessage(LogMessage.ERROR, ex,
              "Error while processing", "fix the xsl:" + xsl
                  + " stylesheet");
          LogManager.getInstance().logMessage(msg);
        }

        public void warning(TransformerException ex) {
          LogMessage msg = new LogMessage(
              LogMessage.INFO,
              ex,
              "Warning while processing, some elements may not be included",
              "fix the xsl:" + xsl + " stylesheet");
          LogManager.getInstance().logMessage(msg);
View Full Code Here

TOP

Related Classes of nz.govt.natlib.meta.log.LogMessage

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.