throws Exception {
parameters.put("user-agent", userAgent);
parameters.put("accept", accept);
FileSavingEnvironment env =
new FileSavingEnvironment(deparameterizedURI, lastModified, context,
attributes, parameters, links,
gatheredLinks, cliContext, null, log);
XMLConsumer consumer = new ContentHandlerWrapper(handler);
ProcessingPipeline pipeline = cocoon.buildPipeline(env);
CocoonComponentManager.enterEnvironment(env, cocoon.getComponentManager(), cocoon);
try {
pipeline.prepareInternal(env);
pipeline.process(env, consumer);
} finally {
CocoonComponentManager.leaveEnvironment();
}
// if we get here, the page was created :-)
int status = env.getStatus();
if (!env.isModified()) {
status = -1;
}
return status;
}