2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 SOPE is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #include <NGObjWeb/WOxElemBuilder.h>
25 This builder builds various elements from the WOExtensions library.
27 All tags are mapped into the <var:> namespace (XMLNS_OD_BIND).
30 <var:js-alert-panel .../> maps to JSAlertPanel
31 <var:js-confirm-panel .../> maps to JSConfirmPanel
32 <var:js-img-flyover .../> maps to JSImageFlyover
33 <var:js-text-flyover .../> maps to JSTextFlyover
34 <var:js-modal-window .../> maps to JSModalWindow
35 <var:js-validated-field .../> maps to JSValidatedField
37 <var:threshold-colored-number .../> maps to WOThresholdColoredNumber
39 <var:collapsible .../> maps to WOCollapsibleComponentContent
40 <var:checkbox-matrix../>maps to WOCheckBoxMatrix
41 <var:radio-matrix .../> maps to WORadioButtonMatrix
43 <var:foreach-key .../> maps to WODictionaryRepetition
44 <var:if-key .../> maps to WOKeyValueConditional
46 <var:tab-panel .../> maps to WOTabPanel
48 <var:table .../> maps to WOTable
49 <var:table-header ../> maps to WOTableHeader
50 <var:table-content ../> maps to WOTableContent
51 <var:table-ctx-key ../> maps to WOTableContextKey
53 //JSKeyHandler : WODynamicElement
56 @interface WOxExtElemBuilder : WOxTagClassElemBuilder
62 #include <SaxObjC/XMLNamespaces.h>
65 @implementation WOxExtElemBuilder
67 - (Class)classForElement:(id<DOMElement>)_element {
72 if (![[_element namespaceURI] isEqualToString:XMLNS_OD_BIND])
75 tagName = [_element tagName];
76 if ((tl = [tagName length]) < 3)
79 c1 = [tagName characterAtIndex:0];
83 if ([tagName isEqualToString:@"collapsible"])
84 return NSClassFromString(@"WOCollapsibleComponentContent");
85 if ([tagName isEqualToString:@"checkbox-matrix"])
86 return NSClassFromString(@"WOCheckBoxMatrix");
92 if ([tagName isEqualToString:@"foreach-key"])
93 return NSClassFromString(@"WODictionaryRepetition");
99 if ([tagName isEqualToString:@"if-key"])
100 return NSClassFromString(@"WOKeyValueConditional");
105 if (tl > 13 && [tagName hasPrefix:@"js-"]) {
106 if ([tagName isEqualToString:@"js-alert-panel"])
107 return NSClassFromString(@"JSAlertPanel");
108 if ([tagName isEqualToString:@"js-confirm-panel"])
109 return NSClassFromString(@"JSConfirmPanel");
110 if ([tagName isEqualToString:@"js-img-flyover"])
111 return NSClassFromString(@"JSImageFlyover");
112 if ([tagName isEqualToString:@"js-text-flyover"])
113 return NSClassFromString(@"JSTextFlyover");
114 if ([tagName isEqualToString:@"js-modal-window"])
115 return NSClassFromString(@"JSModalWindow");
116 if ([tagName isEqualToString:@"js-validated-field"])
117 return NSClassFromString(@"JSValidatedField");
123 if ([tagName isEqualToString:@"radio-matrix"])
124 return NSClassFromString(@"WORadioButtonMatrix");
130 if ([tagName isEqualToString:@"threshold-colored-number"])
131 return NSClassFromString(@"WOThresholdColoredNumber");
134 if ([tagName isEqualToString:@"tab-panel"])
135 return NSClassFromString(@"WOTabPanel");
138 if ([tagName hasPrefix:@"table"]) {
140 return NSClassFromString(@"WOTable");
143 if ([tagName isEqualToString:@"table-content"])
144 return NSClassFromString(@"WOTableContent");
145 if ([tagName isEqualToString:@"table-header"])
146 return NSClassFromString(@"WOTableHeader");
147 if ([tagName isEqualToString:@"table-ctx-key"])
148 return NSClassFromString(@"WOTableContextKey");
157 @end /* WOxExtElemBuilder */