01: /*
02: * Copyright 2007 Outerthought bvba and Schaubroeck nv
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.outerj.daisy.frontend;
17:
18: import org.apache.cocoon.components.flow.apples.StatelessAppleController;
19: import org.apache.cocoon.components.flow.apples.AppleRequest;
20: import org.apache.cocoon.components.flow.apples.AppleResponse;
21: import org.outerj.daisy.frontend.util.AbstractDaisyApple;
22: import org.outerj.daisy.frontend.util.GenericPipeConfig;
23:
24: import java.util.Map;
25: import java.util.HashMap;
26:
27: /**
28: * Generic Apple for displaying dialogs.
29: */
30: public class DialogApple extends AbstractDaisyApple implements
31: StatelessAppleController {
32:
33: protected void processRequest(AppleRequest appleRequest,
34: AppleResponse appleResponse) throws Exception {
35: String template = appleRequest.getSitemapParameter("template");
36:
37: Map<String, Object> viewData = new HashMap<String, Object>();
38: viewData.put("pageContext", frontEndContext
39: .getPageContext("dialog"));
40: viewData.put("template", template);
41: viewData.put("pipeConf", GenericPipeConfig
42: .templatePipe(template));
43:
44: appleResponse.sendPage("internal/genericPipe", viewData);
45:
46: }
47: }
|