Package de.ddb.conversion.format

Examples of de.ddb.conversion.format.Format


        List<de.ddb.conversion.context.xml.Format> formats = contextDocument
                .getConversionContext().getFormats().getFormatList();
        for (de.ddb.conversion.context.xml.Format formatElement : formats) {
          try
          {
             Format format = new Format(formatElement.getName());
                 if (formatElement.getContentType() != null) {
                     format.setContentType(formatElement.getContentType());
                 }
                 /*
                  * check syntax
                  */
                 new URI(formatElement.getNamespace());
                 format.setNamespaceString(formatElement.getNamespace());
                 if (formatElement.isSetSchemaLocation()) {
                     /*
                      * check syntax
                      */
                     new URL(formatElement.getSchemaLocation());
                     format.setSchemaLocationString(formatElement.getSchemaLocation());
                 }
                 if (formatElement.isSetContentType()) {
                     format.setContentType(formatElement.getContentType());
                 }
                 if (formatElement.isSetEndOfRecordPattern()) {
                     format.setEndOfRecordPatternString(formatElement
                             .getEndOfRecordPattern());
                 }
                 if (formatElement.isSetRecordPattern()) {
                     format.setRecordPatternString(formatElement.getRecordPattern());
                 }
                 if (formatElement.isSetStartOfRecordPattern()) {
                     format.setStartOfRecordPatternString(formatElement
                             .getStartOfRecordPattern());
                 }
                 if (formatElement.isSetRecordDelimiterPattern()) {
                     format.setRecordDelimiterPatternString(formatElement
                             .getRecordDelimiterPattern());
                 }
                 format.setDescription(formatElement.getDescription());
                 context.addFormat(format);
          }
          catch(URISyntaxException e)
          {
            LOGGER.error("Format could not be added because of bad schema uri syntax.");
View Full Code Here


     * @return Converter
     */
    public Converter addConverter(Converter c,
            String sourceFormatName, String targetFormatName,
            String sourceEncoding, String targetEncoding, Properties properties) {
        Format sourceFormat = getFormat(sourceFormatName);
        Format targetFormat = getFormat(targetFormatName);
        if (c == null || sourceFormat == null || targetFormat == null)
            throw new IllegalArgumentException();
       
        c.getConverterContext().setSourceEncoding(sourceEncoding);
        c.getConverterContext().setTargetEncoding(targetEncoding);
View Full Code Here

     */
  @BeforeClass
  public static void init() {
    MabToMabxmlConverterTest.context = ConversionContextFactory
        .newDefaultEnvironment();
    final Format mab2 = new Format("MAB2");
    mab2.setContentType("application/x-mab2");
    mab2.setDescription("Maschinelles Austauschformat für Bibliotheken");
    mab2.setEndOfRecordPatternString("\u001D|\n");
    mab2.setNamespaceString("http://www.ddb.de/standards/mab2");

    final Format mabXml = new Format("MABxml-1");
    mabXml.setContentType("application/xml");
    mabXml.setDescription("XML-Variante von MAB2 / DNB-Titeldaten, ZDB-Titeldaten, Normdaten");
    mabXml.setNamespaceString("http://www.ddb.de/professionell/mabxml/mabxml-1.xsd");
    mabXml.setSchemaLocationString("http://www.d-nb.de/standardisierung/formate/mabxml-1.xsd");
    mabXml.setRecordPatternString("<datensatz.*?/datensatz>");

    MabToMabxmlConverterTest.context.addFormat(mab2);
    MabToMabxmlConverterTest.context.addFormat(mabXml);
  }
 
View Full Code Here

    public final static String DOCFORMATNAME_MABXML1 = "MABxml-1";
    public final static String DOCFORMATNAME_PICAPLUS = "PicaPlus";
    public final static String DOCFORMATNAME_MARCXML = "MARCXML";

    private static void initDefaults(ConversionContext env) {
        Format format;

        format = new Format(DOCFORMATNAME_MAB2);
        format.setContentType(Format.CONTENT_TYPE_TEXT);
        env.addFormat(format);

        format = new Format(DOCFORMATNAME_MABXML1);
        format.setContentType(Format.CONTENT_TYPE_XML);
        env.addFormat(format);

        format = new Format(DOCFORMATNAME_PICAPLUS);
        format.setContentType(Format.CONTENT_TYPE_TEXT);
        env.addFormat(format);

        format = new Format(DOCFORMATNAME_DDBINTERN);
        format.setContentType(Format.CONTENT_TYPE_TEXT);
        format
                .setDescription("Offline expandiertes PicaPlus-Format Der Deutschen Bibliothek");
        env.addFormat(format);

        format = new Format(DOCFORMATNAME_OAIDC);
        format.setContentType(Format.CONTENT_TYPE_XML);
        format.setDescription("Dublin Core für OAI");
        env.addFormat(format);
    }
View Full Code Here

     */
    final List<de.ddb.conversion.context.xml.Format> formats = contextDocument
        .getConversionContext().getFormats().getFormatList();
    for (final de.ddb.conversion.context.xml.Format formatElement : formats) {
      try {
        final Format format = new Format(formatElement.getName());
        if (formatElement.getContentType() != null) {
          format.setContentType(formatElement.getContentType());
        }
        /*
         * check syntax
         */
        new URI(formatElement.getNamespace());
        format.setNamespaceString(formatElement.getNamespace());
        if (formatElement.isSetSchemaLocation()) {
          /*
           * check syntax
           */
          new URL(formatElement.getSchemaLocation());
          format.setSchemaLocationString(formatElement
              .getSchemaLocation());
        }
        if (formatElement.isSetContentType()) {
          format.setContentType(formatElement.getContentType());
        }
        if (formatElement.isSetEndOfRecordPattern()) {
          format.setEndOfRecordPatternString(formatElement
              .getEndOfRecordPattern());
        }
        if (formatElement.isSetRecordPattern()) {
          format.setRecordPatternString(formatElement
              .getRecordPattern());
        }
        if (formatElement.isSetStartOfRecordPattern()) {
          format.setStartOfRecordPatternString(formatElement
              .getStartOfRecordPattern());
        }
        if (formatElement.isSetRecordDelimiterPattern()) {
          format.setRecordDelimiterPatternString(formatElement
              .getRecordDelimiterPattern());
        }
        format.setDescription(formatElement.getDescription());
        context.addFormat(format);
      } catch (final URISyntaxException e) {
        LOGGER.error("Format could not be added because of bad schema uri syntax.");
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug(e, e);
View Full Code Here

  public Converter addConverter(final Converter c,
      final String sourceFormatName, final String targetFormatName,
      final String sourceEncoding, final String targetEncoding,
      final Properties properties)
      throws ConverterInitializationException {
    final Format sourceFormat = getFormat(sourceFormatName);
    final Format targetFormat = getFormat(targetFormatName);
    if (c == null || sourceFormat == null || targetFormat == null)
      throw new IllegalArgumentException();

    c.getConverterContext().setSourceEncoding(sourceEncoding);
    c.getConverterContext().setTargetEncoding(targetEncoding);
View Full Code Here

TOP

Related Classes of de.ddb.conversion.format.Format

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.