01: /*
02: * This file is not part of the ItsNat framework.
03: *
04: * Original source code use and closed source derivatives are authorized
05: * to third parties with no restriction or fee.
06: * The original source code is owned by the author.
07: *
08: * This program is distributed AS IS in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11: *
12: * Author: Jose Maria Arranz Santamaria
13: * (C) Innowhere Software Services S.L., Spanish company, year 2007
14: */
15:
16: package org.itsnat.feashow.features.components.custom;
17:
18: import org.itsnat.comp.ItsNatComponent;
19: import org.itsnat.comp.CreateItsNatComponentListener;
20: import org.itsnat.comp.ItsNatComponentManager;
21: import org.itsnat.core.NameValue;
22: import org.w3c.dom.Element;
23: import org.w3c.dom.Node;
24:
25: public class LoginCreationItsNatComponentListener implements
26: CreateItsNatComponentListener {
27:
28: public LoginCreationItsNatComponentListener() {
29: }
30:
31: public ItsNatComponent before(Node node, String componentType,
32: NameValue[] artifacts, ItsNatComponentManager compMgr) {
33: if (node.getNodeType() != Node.ELEMENT_NODE)
34: return null;
35:
36: Element elem = (Element) node;
37:
38: if ((componentType != null) && componentType.equals("login"))
39: return new LoginComponent(elem, compMgr);
40:
41: return null;
42: }
43:
44: public ItsNatComponent after(ItsNatComponent comp) {
45: return comp;
46: }
47:
48: }
|