}
createSortableHandler(key, requestedOrder, handlerUrl, storeName, id, columnHeaderParameters, parameters);
}
template.evaluate(headersBuffer, columnHeaderParameters);
}
parameter.put(HEADERS, new StringValue(headersBuffer.toString()));
Value []input = ((ArrayValue)parameter.get(SimpleProcessor.INPUT)).getArray();
for ( int i = 0; i < input.length; i++ ) {
StringBuffer columnsBuffer = new StringBuffer(1024);
Map inputParameter = ((MapValue)input[i]).getMap();
for ( int j = 0; j < columns.length; j++ ) {
Map columnMap = ((MapValue)columns[j]).getMap();
boolean replaceColumn = ((BooleanValue)columnMap.get(REPLACE_COLUMN)).booleanValue();
Value processorUri = (Value)columnMap.get(PROCESSOR);
Map columnParameters = new HashMap();
columnParameters.putAll(parameter);
String key = columnMap.get(KEY).toString();
String name = columnMap.get(NAME).toString();
Object value = columnMap.get(VALUE);
if ( value == null || value == NullValue.NULL ) {
value = inputParameter.get(key);
}
columnParameters.put(name, value);
if ( processorUri != NullValue.NULL ) {
Processor processor = ProcessorManager.getInstance().getProcessor((URI)processorUri);
Value processorParameters = (Value)columnMap.get(PARAMETERS);
if ( processorParameters instanceof MapValue ) {
columnParameters.putAll(((MapValue)processorParameters).getMap());
}
Result processorResult = ProcessorManager.process(processor, columnParameters, context);
String resultKey = columnMap.get(RESULT).toString();
Value resultEntry = (Value)processorResult.getResultEntries().get(resultKey);
if ( resultEntry instanceof PrintableValue ) {
if ( replaceColumn ) {
((PrintableValue)resultEntry).print(columnsBuffer);
} else {
StringBuffer resultBuffer = new StringBuffer();
((PrintableValue)resultEntry).print(resultBuffer);
columnParameters.put(VALUE, new StringValue(resultBuffer.toString()));
}
}
}
if ( !replaceColumn ) {
Template template = columnTemplate;
if ( size != null && TableHandler.COLLAPSED.equals(size.get(key))) {
template = collapsedColumnTemplate;
}
template.evaluate(columnsBuffer, columnParameters);
}
}
inputParameter.put(COLUMNS, new StringValue(columnsBuffer.toString()));
}
return super.process(parameter, context);
}