@Override
	public void toXML(final StringBuilder builder,
			final ConfigVerification errors)
	{

		SurrogateModes surMode = controller.getSurrogates();

		String wikiEncoding = encodingField.getText();
		if (wikiEncoding.length() == 0) {

			errors.add(new ConfigItem(ConfigItemTypes.WARNING,
					ConfigErrorKeys.MISSING_VALUE,
					"The CharacterEncoding was not set."));
		}

		builder.append("\t<input>\r\n");
		builder.append("\t\t<MODE_SURROGATES>" + surMode
				+ "</MODE_SURROGATES>\r\n");
		builder.append("\t\t<WIKIPEDIA_ENCODING>" + wikiEncoding
				+ "</WIKIPEDIA_ENCODING>\r\n");

		ArchiveRegistry reg = controller.getArchives();

		int size = reg.getRowCount();

		ArchiveDescription archive;
		InputType type;
		String archivePath;
		long start;

		if(size==0){
			errors.add(new ConfigItem(ConfigItemTypes.WARNING,
					ConfigErrorKeys.MISSING_VALUE,
			"No source file has been set."));
		}

		for (int i = 0; i < size; i++) {

			archive = reg.get(i);

			type = archive.getType();
			switch (type) {
			case XML:
				break;
			case BZIP2:
				//bzip is always enabled - nothing to check here
				break;
			case SEVENZIP:
				if (!controller.is7ZipEnabled()) {
					errors.add(new ConfigItem(ConfigItemTypes.ERROR,
							ConfigErrorKeys.ILLEGAL_INPUT_FILE,
							"The SevenUip mode is not " + "activated"));
				}
				break;
			}

			archivePath = archive.getPath();
			if (archivePath.length() == 0) {
				errors.add(new ConfigItem(ConfigItemTypes.ERROR,
						ConfigErrorKeys.PATH_NOT_SET,
						"The archive path is missing"));
			}

			start = archive.getStartPosition();
			if (start < 0) {
				errors.add(new ConfigItem(ConfigItemTypes.ERROR,
						ConfigErrorKeys.VALUE_OUT_OF_RANGE,
						"The archive start value should be at least 0"));
			}

			builder.append("\t\t<archive>\r\n");
			builder.append("\t\t\t<type>" + type + "</type>\r\n");
			builder.append("\t\t\t<path>\"" + archivePath + "\"</path>\r\n");
			builder.append("\t\t\t<start>" + start + "</start>\r\n");
			builder.append("\t\t</archive>\r\n");
		}
		builder.append("\t</input>\r\n");
	}
@ Override public void toXML ( final StringBuilder builder , final ConfigVerification errors ) { SurrogateModes surMode = controller . getSurrogates ( ) ; String wikiEncoding = encodingField . getText ( ) ; if ( wikiEncoding . length ( ) == 0 ) { errors . add ( new ConfigItem ( ConfigItemTypes . WARNING , ConfigErrorKeys . MISSING_VALUE , "The CharacterEncoding was not set." ) ) ; } builder . append ( "\t<input>\r\n" ) ; builder . append ( "\t\t<MODE_SURROGATES>" + surMode + "</MODE_SURROGATES>\r\n" ) ; builder . append ( "\t\t<WIKIPEDIA_ENCODING>" + wikiEncoding + "</WIKIPEDIA_ENCODING>\r\n" ) ; ArchiveRegistry reg = controller . getArchives ( ) ; int size = reg . getRowCount ( ) ; ArchiveDescription archive ; InputType type ; String archivePath ; long start ; if ( size == 0 ) { errors . add ( new ConfigItem ( ConfigItemTypes . WARNING , ConfigErrorKeys . MISSING_VALUE , "No source file has been set." ) ) ; } for ( int i = 0 ; i < size ; i ++ ) { archive = reg . get ( i ) ; type = archive . getType ( ) ; switch ( type ) { case XML : break ; case BZIP2 : break ; case SEVENZIP : if ( ! controller . is7ZipEnabled ( ) ) { errors . add ( new ConfigItem ( ConfigItemTypes . ERROR , ConfigErrorKeys . ILLEGAL_INPUT_FILE , "The SevenUip mode is not " + "activated" ) ) ; } break ; } archivePath = archive . getPath ( ) ; if ( archivePath . length ( ) == 0 ) { errors . add ( new ConfigItem ( ConfigItemTypes . ERROR , ConfigErrorKeys . PATH_NOT_SET , "The archive path is missing" ) ) ; } start = archive . getStartPosition ( ) ; if ( start < 0 ) { errors . add ( new ConfigItem ( ConfigItemTypes . ERROR , ConfigErrorKeys . VALUE_OUT_OF_RANGE , "The archive start value should be at least 0" ) ) ; } builder . append ( "\t\t<archive>\r\n" ) ; builder . append ( "\t\t\t<type>" + type + "</type>\r\n" ) ; builder . append ( "\t\t\t<path>\"" + archivePath + "\"</path>\r\n" ) ; builder . append ( "\t\t\t<start>" + start + "</start>\r\n" ) ; builder . append ( "\t\t</archive>\r\n" ) ; } builder . append ( "\t</input>\r\n" ) ; }
Adds the xml description of the panels content to the StringBuilder.
Errors which occur during the xml transformation will be added to the
ConfigVerification.

@param builder
Reference to a StringBuilder object
@param errors
Reference to the ConfigVerification object