KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > portal > event > aspect > impl > FrameEventAspect


1 /*
2  * Copyright 1999-2002,2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.apache.cocoon.portal.event.aspect.impl;
17
18 import org.apache.cocoon.portal.event.Event;
19 import org.apache.cocoon.portal.event.EventManager;
20 import org.apache.cocoon.portal.event.impl.ChangeAspectDataEvent;
21 import org.apache.cocoon.portal.layout.Layout;
22 import org.apache.cocoon.portal.layout.impl.FrameLayout;
23
24 /**
25  *
26  * @author <a HREF="mailto:juergen.seitz@basf-it-services.com">J&uuml;rgen Seitz</a>
27  * @author <a HREF="mailto:cziegeler@s-und-n.de">Carsten Ziegeler</a>
28  * @author <a HREF="mailto:volker.schmitt@basf-it-services.com">Volker Schmitt</a>
29  *
30  * @version CVS $Id: FrameEventAspect.java 219049 2005-07-14 15:11:52Z cziegeler $
31  */

32 public class FrameEventAspect extends AbstractContentEventAspect {
33
34     protected String JavaDoc getRequestParameterName() {
35         // TODO - make this configurable
36
return "frame";
37     }
38
39     protected int getRequiredValueCount() {
40         return 3;
41     }
42
43     /* (non-Javadoc)
44      * @see org.apache.cocoon.portal.event.aspect.impl.AbstractContentEventAspect#publish(org.apache.cocoon.portal.event.Publisher, org.apache.cocoon.portal.layout.Layout, java.lang.String[])
45      */

46     protected void publish(EventManager publisher,
47                              Layout layout,
48                              String JavaDoc[] values) {
49         if (layout instanceof FrameLayout) {
50             final Event e = new ChangeAspectDataEvent(layout, "frame", values[2]);
51             publisher.send(e);
52         } else {
53             this.getLogger().warn(
54                 "the configured layout: "
55                     + layout.getName()
56                     + " is not a FrameLayout.");
57         }
58     }
59
60 }
61
Popular Tags