@Override protected Event handleStartDocument (Event event) { StartDocument sd = event.getStartDocument(); IParameters prm = sd.getFilterParameters(); String paramsData = null; if ( prm != null ) { paramsData = prm.toString(); } String relativeInput = new File(inputRootDir).toURI().relativize(inputURI).getPath(); String relativeOutput = new File(outputRootDir).toURI().relativize(outputURI).getPath(); writer.setDocumentInformation(relativeInput, filterConfigId, paramsData, sd.getEncoding(), relativeOutput, outputEncoding, sd.getFilterWriter().getSkeletonWriter()); return writer.handleEvent(event); }
paramsList.set(n, currentParams.toString()); displayList.set(n, currentConnector.getSettingsDisplay());
/** * Gets the parameters for a given custom filter configuration. This * default implementation gets the custom data from a file located * in the current directory at the time the method is called. */ @Override public IParameters getCustomParameters (FilterConfiguration config, IFilter existingFilter) { // Instantiate a filter (or re-use one) IFilter filter = instantiateFilter(config, existingFilter); // Get the default parameters object IParameters params = filter.getParameters(); if ( params == null ) { return null; // This filter does not have parameters } // Load the provided parameter file // In this implementation the file is stored in a given directory if (config.parametersLocation != null) { File file = new File(customParmsDir + config.parametersLocation); params.load(Util.URItoURL(file.toURI()), false); } else if (config.parameters != null) { params.fromString(config.parameters.toString()); } return params; }
@Override public IParameters getParameters (FilterConfiguration config, IFilter existingFilter) { IFilter filter = instantiateFilter(config, existingFilter); IParameters params = filter.getParameters(); // No parameters for this filter if ( params == null ) { return null; } // Default parameters if ( config.parametersLocation == null && config.parameters == null ) { return params; } if ( config.custom ) { params = getCustomParameters(config, filter); } else if (config.parametersLocation != null) { // Note that we cannot assume the parameters are the same // if we re-used an existing filter, as we cannot compare the // configuration identifiers URL url = filter.getClass().getResource(config.parametersLocation); params.load(url, false); } else if (config.parameters != null) { params.fromString(config.parameters.toString()); } return params; }
params.fromString(fc.parameters.toString()); } else { params.reset();
newParams.fromString(baseParams.toString());