Source Code Cross Referenced for RootV1ConfigInstanceTag.java in  » Workflow-Engines » JFolder » org » jfolder » config » instance » v1 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » JFolder » org.jfolder.config.instance.v1 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JFolder, Copyright 2001-2006 Gary Steinmetz
003:         *
004:         * Distributable under LGPL license.
005:         * See terms of license at gnu.org.
006:         */
007:
008:        package org.jfolder.config.instance.v1;
009:
010:        //base classes
011:        import java.util.ArrayList;
012:        import java.util.HashSet;
013:
014:        //project specific classes
015:        import org.jfolder.common.UnexpectedSystemException;
016:        import org.jfolder.common.tagging.AppraiseConceptTagContext;
017:        import org.jfolder.common.tagging.CompoundConceptTagConstraintContext;
018:        import org.jfolder.common.tagging.ConceptTagCharacteristic;
019:        import org.jfolder.common.tagging.ConceptTagCharacteristicHolder;
020:        import org.jfolder.common.tagging.ConceptTagConstraint;
021:        import org.jfolder.common.tagging.ConceptTagConstraintHolder;
022:        import org.jfolder.common.tagging.ConceptTagConstraintTemplate;
023:        import org.jfolder.common.tagging.ConceptTagHelper;
024:        import org.jfolder.common.tagging.ConceptTagMenuBranch;
025:        import org.jfolder.common.tagging.ConceptTagMenuContext;
026:        import org.jfolder.common.tagging.ConceptTagProperties;
027:        import org.jfolder.common.tagging.ConceptTagSetContext;
028:        import org.jfolder.common.tagging.ConceptTagSetHolder;
029:        import org.jfolder.common.tagging.InitializeConceptTagContext;
030:        import org.jfolder.common.tagging.RootConceptTagHolder;
031:        import org.jfolder.common.tagging.StaticConceptTagConstraintContext;
032:        import org.jfolder.common.tagging.StudioConceptTagInstanceInfoContext;
033:        import org.jfolder.common.tagging.StudioConceptTagTypeInfoContext;
034:        import org.jfolder.common.utils.misc.MiscHelper;
035:        import org.jfolder.common.utils.xml.LinearXPath;
036:        import org.jfolder.config.instance.ConfigInstance;
037:        import org.jfolder.config.instance.ConfigInstanceConfig;
038:        import org.jfolder.config.instance.ConfigInstanceTag;
039:        import org.jfolder.config.instance.ConfigInstanceTagHelper;
040:
041:        //other classes
042:
043:        public class RootV1ConfigInstanceTag implements  ConfigInstanceTag,
044:                ConfigInstance {
045:
046:            //characteristics
047:            private ConceptTagCharacteristic registryCtchar = null;
048:            private ConceptTagCharacteristic configCtchar = null;
049:
050:            //
051:            private final static String REGISTRY = ConfigInstanceTagHelper.REGISTRY;
052:            private final static String HANDLE = ConfigInstanceTagHelper.HANDLE;
053:            private final static String SECTION = ConfigInstanceTagHelper.SECTION;
054:            private final static String NAMESPACE = ConfigInstanceTagHelper.NAMESPACE;
055:            private final static String NAME = ConfigInstanceTagHelper.NAME;
056:            private final static String CONCEPT_TAG = ConfigInstanceTagHelper.CONCEPT_TAG;
057:            private final static String INHERIT = ConfigInstanceTagHelper.INHERIT;
058:            private final static String MENU_PATH = ConfigInstanceTagHelper.MENU_PATH;
059:            private final static String TYPE = ConfigInstanceTagHelper.TYPE;
060:            //private final static String CAN_BE = ConfigInstanceTagHelper.CAN_BE;
061:            //private final static String CANNOT_BE = ConfigInstanceTagHelper.CANNOT_BE;
062:            //private final static String CAN_BE_ANYTHING =
063:            //    ConfigInstanceTagHelper.CAN_BE_ANYTHING;
064:            //private final static String INHERIT_CONSTRAINT_CONTEXT =
065:            //    ConfigInstanceTagHelper.INHERIT_CONSTRAINT_CONTEXT;
066:            //private final static String ALLOW_IN_UNCONSTRAINED_CONTEXT_ONLY =
067:            //    ConfigInstanceTagHelper.ALLOW_IN_UNCONSTRAINED_CONTEXT_ONLY;
068:            //private final static String ACTS_AS_TEXT =
069:            //    ConfigInstanceTagHelper.ACTS_AS_TEXT;
070:            private final static String CONFIG = ConfigInstanceTagHelper.CONFIG;
071:            private final static String CONTENT = ConfigInstanceTagHelper.CONTENT;
072:            private final static String CUSTOM_CONTENT = ConfigInstanceTagHelper.CUSTOM_CONTENT;
073:
074:            ///////////////////////////////////
075:
076:            public void initialize(InitializeConceptTagContext inIctc) {
077:
078:                //
079:                ConceptTagConstraintHolder rootCtconh = ConceptTagConstraintHolder
080:                        .newInstance(inIctc);
081:
082:                //constrain "registry"
083:                ConceptTagConstraint registryCtcon = ConceptTagConstraint
084:                        .newInstance(REGISTRY, rootCtconh);
085:                registryCtcon.setTitle("Concept Tag Registry");
086:                registryCtcon.setShortDescription("Concept Tag Registry");
087:                //
088:                CompoundConceptTagConstraintContext registryCctcc = CompoundConceptTagConstraintContext
089:                        .newInstance(registryCtcon);
090:                initRegistry(registryCctcc);
091:                registryCctcc.addDefaultValue();
092:
093:                //
094:
095:                //constrain "config"
096:                ConceptTagConstraint configCtcon = ConceptTagConstraint
097:                        .newInstance(CONFIG, rootCtconh);
098:                configCtcon.setTitle("Configuration Set");
099:                configCtcon.setShortDescription("Configuration Set");
100:                //
101:                CompoundConceptTagConstraintContext configCctcc = CompoundConceptTagConstraintContext
102:                        .newInstance(configCtcon);
103:                initConfig(configCctcc);
104:                configCctcc.addDefaultValue();
105:
106:                //
107:                inIctc.initialize();
108:
109:                //
110:                this .registryCtchar = registryCtcon.getCharacteristic();
111:                this .configCtchar = configCtcon.getCharacteristic();
112:
113:            }
114:
115:            public void initRegistry(CompoundConceptTagConstraintContext inCctcc) {
116:                //
117:                //constrain "inherit" of "namespace" of "registry"
118:                ConceptTagConstraintTemplate inheritCtcont = ConceptTagConstraintTemplate
119:                        .newInstance(INHERIT, inCctcc);
120:                inheritCtcont.setTitle("Inherit");
121:                inheritCtcont.setShortDescription("Inherit");
122:                //
123:                StaticConceptTagConstraintContext inheritSctcc = StaticConceptTagConstraintContext
124:                        .newInstance(inheritCtcont);
125:                inheritSctcc.addDefaultValue("InheritFromSet");
126:                //
127:                //constrain "handle" of "registry"
128:                ConceptTagConstraintTemplate handleCtcont = ConceptTagConstraintTemplate
129:                        .newInstance(HANDLE, inCctcc);
130:                handleCtcont.setTitle("Handle");
131:                handleCtcont.setShortDescription("Handle");
132:                //
133:                StaticConceptTagConstraintContext registryCtconHandleSctcc = StaticConceptTagConstraintContext
134:                        .newInstance(handleCtcont);
135:                //
136:
137:                //constrain "section" of "registry"
138:                ConceptTagConstraintTemplate sectionCtcont = ConceptTagConstraintTemplate
139:                        .newInstance(SECTION, inCctcc);
140:                sectionCtcont.setTitle("Section");
141:                sectionCtcont.setShortDescription("Section");
142:
143:                //
144:                //StaticConceptTagConstraintContext registryCtconNamespaceSctcc =
145:                //    StaticConceptTagConstraintContext.newInstance(
146:                //        registryCtconNamespaceCtctemp);
147:                //
148:                CompoundConceptTagConstraintContext registryCtconSectionCctcc = CompoundConceptTagConstraintContext
149:                        .newInstance(sectionCtcont);
150:                initRegistrySection(registryCtconSectionCctcc);
151:                //
152:                //registryCtconNamespaceSctcc.addDefaultValue("Hi");
153:                //registryCtconNamespaceCctcc.addDefaultValue();
154:                registryCtconSectionCctcc.addDefaultValue();
155:                //
156:            }
157:
158:            public void initRegistrySection(
159:                    CompoundConceptTagConstraintContext inCctcc) {
160:                ////constrain "name" of "namespace" of "registry"
161:                //ConceptTagConstraintTemplate handleCtcont =
162:                //    ConceptTagConstraintTemplate.newInstance(HANDLE, inCctcc);
163:                ////
164:                //StaticConceptTagConstraintContext handleSctcc =
165:                //        StaticConceptTagConstraintContext.newInstance(handleCtcont);
166:                ////
167:                //handleSctcc.addDefaultValue("SectionName");
168:
169:                //constrain "concept-tag" of "namespace" of "registry"
170:                ConceptTagConstraintTemplate namespaceCtcont = ConceptTagConstraintTemplate
171:                        .newInstance(NAMESPACE, inCctcc);
172:                namespaceCtcont.setTitle("Namespace");
173:                namespaceCtcont.setShortDescription("Namespace");
174:                //
175:                StaticConceptTagConstraintContext namespaceSctcc = StaticConceptTagConstraintContext
176:                        .newInstance(namespaceCtcont);
177:                //CompoundConceptTagConstraintContext namespaceCctcc =
178:                //    CompoundConceptTagConstraintContext.newInstance(namespaceCtcont);
179:                //initRegistryNamespace(namespaceCctcc);
180:                //
181:                namespaceSctcc.addDefaultValue("NamespaceHere");
182:                //
183:                //constrain "concept-tag" of "namespace" of "registry"
184:                ConceptTagConstraintTemplate conceptTagCtcont = ConceptTagConstraintTemplate
185:                        .newInstance(CONCEPT_TAG, inCctcc);
186:                conceptTagCtcont.setTitle("Concept Tag");
187:                conceptTagCtcont.setShortDescription("Concept Tag");
188:                //
189:                CompoundConceptTagConstraintContext conceptTagCctcc = CompoundConceptTagConstraintContext
190:                        .newInstance(conceptTagCtcont);
191:                initRegistryNamespaceConceptTag(conceptTagCctcc);
192:                //
193:                conceptTagCctcc.addDefaultValue();
194:
195:            }
196:
197:            //public void initRegistryNamespace(
198:            //    CompoundConceptTagConstraintContext inCctcc) {
199:            //    //constrain "name" of "namespace" of "registry"
200:            //    ConceptTagConstraintTemplate nameCtcont =
201:            //        ConceptTagConstraintTemplate.newInstance(NAME, inCctcc);
202:            //    //
203:            //    StaticConceptTagConstraintContext nameSctcc =
204:            //            StaticConceptTagConstraintContext.newInstance(nameCtcont);
205:            //    //
206:            //    nameSctcc.addDefaultValue("NamespaceHere");
207:            //}
208:
209:            public void initRegistryNamespaceConceptTag(
210:                    CompoundConceptTagConstraintContext inCctcc) {
211:                //
212:                //constrain "name" of "concept-tag" of "namespace"
213:                ConceptTagConstraintTemplate nameCtcont = ConceptTagConstraintTemplate
214:                        .newInstance(NAME, inCctcc);
215:                nameCtcont.setTitle("Name");
216:                nameCtcont.setShortDescription("Name");
217:                //
218:                StaticConceptTagConstraintContext nameSctcc = StaticConceptTagConstraintContext
219:                        .newInstance(nameCtcont);
220:                //
221:                nameSctcc.addDefaultValue("NameHere");
222:                //
223:                //constrain "type" of "concept-tag" of "namespace"
224:                ConceptTagConstraintTemplate typeCtcont = ConceptTagConstraintTemplate
225:                        .newInstance(TYPE, inCctcc);
226:                typeCtcont.setTitle("Type");
227:                typeCtcont.setShortDescription("Type");
228:                //
229:                StaticConceptTagConstraintContext typeSctcc = StaticConceptTagConstraintContext
230:                        .newInstance(typeCtcont);
231:                //
232:                typeSctcc.addDefaultValue("package.class");
233:                //
234:                //constrain "menu-path" of "concept-tag" of "namespace"
235:                ConceptTagConstraintTemplate menuPathCtcont = ConceptTagConstraintTemplate
236:                        .newInstance(MENU_PATH, inCctcc);
237:                menuPathCtcont.setTitle("Menu Path");
238:                menuPathCtcont.setShortDescription("Menu Path");
239:                //
240:                StaticConceptTagConstraintContext menuPathSctcc = StaticConceptTagConstraintContext
241:                        .newInstance(menuPathCtcont);
242:                //
243:                menuPathSctcc.addDefaultValue("Root|Functions|Name");
244:                ////constrain "can-be" of "concept-tag" of "namespace"
245:                //ConceptTagConstraintTemplate canBeCtcont =
246:                //    ConceptTagConstraintTemplate.newInstance(CAN_BE, inCctcc);
247:                ////
248:                //StaticConceptTagConstraintContext canBeSctcc =
249:                //    StaticConceptTagConstraintContext.newInstance(canBeCtcont);
250:                ////
251:                //canBeSctcc.addDefaultValue("java.lang.String");
252:                ////constrain "can-be" of "concept-tag" of "namespace"
253:                //ConceptTagConstraintTemplate cannotBeCtcont =
254:                //    ConceptTagConstraintTemplate.newInstance(CANNOT_BE, inCctcc);
255:                ////
256:                //StaticConceptTagConstraintContext cannotBeSctcc =
257:                //    StaticConceptTagConstraintContext.newInstance(cannotBeCtcont);
258:                ////
259:                //cannotBeSctcc.addDefaultValue("java.lang.Void");
260:                ////constrain "can-be-anything" of "concept-tag" of "namespace"
261:                //ConceptTagConstraintTemplate canBeAnythingCtcont =
262:                //    ConceptTagConstraintTemplate.newInstance(
263:                //        CAN_BE_ANYTHING, inCctcc);
264:                ////
265:                //StaticConceptTagConstraintContext canBeAnythingSctcc =
266:                //    StaticConceptTagConstraintContext.newInstance(
267:                //        canBeAnythingCtcont);
268:                ////
269:                //canBeAnythingSctcc.addDefaultValue("false");
270:                ////constrain "inherit-constraint-context"
271:                ////    of "concept-tag" of "namespace"
272:                //ConceptTagConstraintTemplate inheritConstraintContextCtcont =
273:                //    ConceptTagConstraintTemplate.newInstance(
274:                //        INHERIT_CONSTRAINT_CONTEXT, inCctcc);
275:                ////
276:                //StaticConceptTagConstraintContext inheritConstraintContextSctcc =
277:                //    StaticConceptTagConstraintContext.newInstance(
278:                //        inheritConstraintContextCtcont);
279:                ////
280:                //inheritConstraintContextSctcc.addDefaultValue("true");
281:                ////constrain "allow-in-unconstrained-context-only" 
282:                ////  of "concept-tag" of "namespace"
283:                //ConceptTagConstraintTemplate allowInUnconstrainedContextOnlyCtcont =
284:                //    ConceptTagConstraintTemplate.newInstance(
285:                //        ALLOW_IN_UNCONSTRAINED_CONTEXT_ONLY, inCctcc);
286:                ////
287:                //StaticConceptTagConstraintContext
288:                //    allowInUnconstrainedContextOnlySctcc =
289:                //        StaticConceptTagConstraintContext.newInstance(
290:                //            allowInUnconstrainedContextOnlyCtcont);
291:                ////
292:                //allowInUnconstrainedContextOnlySctcc.addDefaultValue("true");
293:                ////constrain "inherit-constraint-context"
294:                ////    of "concept-tag" of "namespace"
295:                //ConceptTagConstraintTemplate actsAsTextCtcont =
296:                //    ConceptTagConstraintTemplate.newInstance(ACTS_AS_TEXT, inCctcc);
297:                ////
298:                //StaticConceptTagConstraintContext actsAsTextSctcc =
299:                //    StaticConceptTagConstraintContext.newInstance(actsAsTextCtcont);
300:                ////
301:                //actsAsTextSctcc.addDefaultValue("true");
302:            }
303:
304:            public void initConfig(CompoundConceptTagConstraintContext inCctcc) {
305:                //
306:                //constrain "handle" of "config"
307:                ConceptTagConstraintTemplate handleCtcont = ConceptTagConstraintTemplate
308:                        .newInstance(HANDLE, inCctcc);
309:                handleCtcont.setTitle("Handle");
310:                handleCtcont.setShortDescription("Handle");
311:                //
312:                StaticConceptTagConstraintContext handleSctcc = StaticConceptTagConstraintContext
313:                        .newInstance(handleCtcont);
314:                //
315:                handleSctcc.addDefaultValue("NameHere");
316:                //
317:                //constrain "content" of "config"
318:                ConceptTagConstraintTemplate contentCtcont = ConceptTagConstraintTemplate
319:                        .newInstance(CONTENT, inCctcc);
320:                contentCtcont.setTitle("Content");
321:                contentCtcont.setShortDescription("Content");
322:                //
323:                StaticConceptTagConstraintContext contentSctcc = StaticConceptTagConstraintContext
324:                        .newInstance(contentCtcont);
325:                contentSctcc.setMultiLine(true);
326:                //
327:                contentSctcc.addDefaultValue("<config></config>");
328:                //
329:                //constrain "custom-content" of "config"
330:                ConceptTagConstraintTemplate customContentCtcont = ConceptTagConstraintTemplate
331:                        .newInstance(CUSTOM_CONTENT, inCctcc);
332:                customContentCtcont.setTitle("Custom Content");
333:                customContentCtcont.setShortDescription("Custom Content");
334:                //
335:                StaticConceptTagConstraintContext customContentSctcc = StaticConceptTagConstraintContext
336:                        .newInstance(customContentCtcont);
337:                customContentSctcc.setMultiLine(true);
338:                //
339:                contentSctcc.addDefaultValue("<config></config>");
340:                contentSctcc.setMultiLine(true);
341:            }
342:
343:            public void appraise(AppraiseConceptTagContext inCtic) {
344:                if (inCtic instanceof  StudioConceptTagInstanceInfoContext) {
345:                    StudioConceptTagInstanceInfoContext sctiic = (StudioConceptTagInstanceInfoContext) inCtic;
346:                    sctiic.setInstanceTitle("Config Instance");
347:                    sctiic.setInstanceDescription("Config Instance");
348:                } else if (inCtic instanceof  StudioConceptTagTypeInfoContext) {
349:                    StudioConceptTagTypeInfoContext scttic = (StudioConceptTagTypeInfoContext) inCtic;
350:                    scttic.setTypeTitle("Config Instance");
351:                    scttic.setTypeDescription("Config Instance");
352:                }
353:            }
354:
355:            //
356:            public ConceptTagSetHolder accessConceptTagSet(String inNamespace,
357:                    ConceptTagSetContext inCtsc) {
358:
359:                ConceptTagSetHolder outValue = new ConceptTagSetHolder(
360:                        inNamespace);
361:
362:                ConceptTagCharacteristicHolder registryCtcharh = null;
363:                ConceptTagCharacteristic sectionCtchar = null;
364:                for (int i = 0; i < this .registryCtchar.getValueLength(); i++) {
365:                    ConceptTagCharacteristicHolder candidateRegistryCtcharh = this .registryCtchar
366:                            .getValueAsHolder(i, null);
367:                    ConceptTagCharacteristic handleCtchar = candidateRegistryCtcharh
368:                            .getCharacteristic(HANDLE);
369:                    String handle = handleCtchar.getValueAsString(0, null);
370:                    if (inNamespace.equals(handle)) {
371:                        sectionCtchar = candidateRegistryCtcharh
372:                                .getCharacteristic(SECTION);
373:                        registryCtcharh = candidateRegistryCtcharh;
374:                    }
375:                }
376:
377:                for (int i = 0; i < sectionCtchar.getValueLength(); i++) {
378:                    ConceptTagCharacteristicHolder sectionCtcharh = sectionCtchar
379:                            .getValueAsHolder(i, null);
380:
381:                    ConceptTagCharacteristic namespaceCtchar = sectionCtcharh
382:                            .getCharacteristic(NAMESPACE);
383:                    String namespace = null;
384:                    if (namespaceCtchar.getValueLength() > 0) {
385:                        namespace = namespaceCtchar.getValueAsString(0, null);
386:                    }
387:
388:                    ConceptTagCharacteristic conceptTagCtchar = sectionCtcharh
389:                            .getCharacteristic(CONCEPT_TAG);
390:                    for (int j = 0; j < conceptTagCtchar.getValueLength(); j++) {
391:
392:                        ConceptTagCharacteristicHolder conceptTagCtcharh = conceptTagCtchar
393:                                .getValueAsHolder(j, null);
394:                        //
395:                        ConceptTagCharacteristic nameCtchar = conceptTagCtcharh
396:                                .getCharacteristic(NAME);
397:                        ConceptTagCharacteristic typeCtchar = conceptTagCtcharh
398:                                .getCharacteristic(TYPE);
399:                        ConceptTagCharacteristic menuPathCtchar = conceptTagCtcharh
400:                                .getCharacteristic(MENU_PATH);
401:                        //ConceptTagCharacteristic canBeCtchar =
402:                        //    conceptTagCtcharh.getCharacteristic(CAN_BE);
403:                        //ConceptTagCharacteristic cannotBeCtchar =
404:                        //    conceptTagCtcharh.getCharacteristic(CANNOT_BE);
405:                        //ConceptTagCharacteristic canBeAnythingCtchar =
406:                        //    conceptTagCtcharh.getCharacteristic(CAN_BE_ANYTHING);
407:                        //ConceptTagCharacteristic inheritConstraintContextCtchar =
408:                        //    conceptTagCtcharh.getCharacteristic(
409:                        //        INHERIT_CONSTRAINT_CONTEXT);
410:                        //ConceptTagCharacteristic
411:                        //    allowInUnconstrainedContextOnlyCtchar =
412:                        //        conceptTagCtcharh.getCharacteristic(
413:                        //            ALLOW_IN_UNCONSTRAINED_CONTEXT_ONLY);
414:                        //ConceptTagCharacteristic actsAsTextCtchar =
415:                        //    conceptTagCtcharh.getCharacteristic(ACTS_AS_TEXT);
416:                        //
417:                        String name = nameCtchar.getValueAsString(0, null);
418:                        //
419:                        String type = typeCtchar.getValueAsString(0, null);
420:                        //
421:                        String menuPath[] = new String[menuPathCtchar
422:                                .getValueLength()];
423:                        for (int k = 0; k < menuPathCtchar.getValueLength(); k++) {
424:                            menuPath[k] = menuPathCtchar.getValueAsString(k,
425:                                    null);
426:                        }
427:                        //
428:                        ////MiscHelper.println(
429:                        ////    "RootConInTag canBeCtchar = " + canBeCtchar);
430:                        //String canBe[] = new String[canBeCtchar.getValueLength()];
431:                        //for (int k = 0; k < canBeCtchar.getValueLength(); k++) {
432:                        //    canBe[k] = canBeCtchar.getValueAsString(k);
433:                        //}
434:                        ////
435:                        //String cannotBe[] =
436:                        //    new String[cannotBeCtchar.getValueLength()];
437:                        //for (int k = 0; k < cannotBeCtchar.getValueLength(); k++) {
438:                        //    cannotBe[k] = cannotBeCtchar.getValueAsString(k);
439:                        //}
440:                        ////
441:                        //String canBeAnythingString =
442:                        //    canBeAnythingCtchar.getValueAsString(0);
443:                        //boolean canBeAnything =
444:                        //    (Boolean.valueOf(canBeAnythingString)).booleanValue();
445:                        ////
446:                        //String inheritConstContextString =
447:                        //    inheritConstraintContextCtchar.getValueAsString(0);
448:                        //boolean inheritConstraintContext =
449:                        //    (Boolean.valueOf(
450:                        //        inheritConstContextString)).booleanValue();
451:                        ////
452:                        //String allowInUnconConOnlyString =
453:                        //    allowInUnconstrainedContextOnlyCtchar.getValueAsString(0);
454:                        //boolean allowInUnconstrainedContextOnly =
455:                        //    (Boolean.valueOf(
456:                        //        allowInUnconConOnlyString)).booleanValue();
457:                        ////
458:                        //String actsAsTextString =
459:                        //    actsAsTextCtchar.getValueAsString(0);
460:                        //boolean actsAsText =
461:                        //    (Boolean.valueOf(actsAsTextString)).booleanValue();
462:                        ////
463:
464:                        ConceptTagProperties ctProps = ConceptTagProperties
465:                                .newInstance(menuPath);
466:                        outValue.registerConceptTag(namespace, name, type,
467:                                ctProps);
468:
469:                        //
470:                        //ConceptTagMenuQualifier ctmq = outValue.getMenuQualifier();
471:                        //if (!ctmq.isConceptTagMapPresent(type)) {
472:                        //    ctmq.createConceptTagMap(type);
473:                        //}
474:                        //for (int k = 0; k < canBe.length; k++) {
475:                        //    ctmq.addClassToConceptTagMap(type, canBe[k]);
476:                        //}
477:                    }
478:                }
479:
480:                //
481:                ConceptTagCharacteristic inheritCtchar = registryCtcharh
482:                        .getCharacteristic(INHERIT);
483:                for (int i = 0; i < inheritCtchar.getValueLength(); i++) {
484:                    String nextInheritNamespace = inheritCtchar
485:                            .getValueAsString(i, null);
486:                    ConceptTagSetHolder nextCtsh = accessConceptTagSet(
487:                            nextInheritNamespace, inCtsc);
488:                    //
489:                    outValue.addSetHolder(nextCtsh);
490:                }
491:
492:                return outValue;
493:            }
494:
495:            public ConceptTagMenuBranch getConceptTagMenu(String inNamespace,
496:                    ConceptTagMenuContext inCtmc) {
497:                throw UnexpectedSystemException.notImplemented();
498:            }
499:
500:            //
501:            public ConfigInstanceConfig accessConfig(String inNamespace) {
502:                return getConfig(inNamespace);
503:            }
504:
505:            public ConfigInstanceConfig getConfig(String inNamespace) {
506:
507:                ConfigInstanceConfig outValue = null;
508:
509:                for (int i = 0; i < this .configCtchar.getValueLength(); i++) {
510:                    ConceptTagCharacteristicHolder ctcharh = this .configCtchar
511:                            .getValueAsHolder(i, null);
512:                    ConceptTagCharacteristic nameCtchar = ctcharh
513:                            .getCharacteristic(HANDLE);
514:                    //MiscHelper.println("RootConfigInstanceTag ns = " + inNamespace);
515:                    //MiscHelper.println("RootConfigInstanceTag value = "
516:                    //    + nameCtchar.getValueAsString(0));
517:                    if (nameCtchar.getValueAsString(0, null)
518:                            .equals(inNamespace)) {
519:                        //
520:                        ConceptTagCharacteristic contentCtchar = ctcharh
521:                                .getCharacteristic(CONTENT);
522:                        ConceptTagCharacteristic customContentCtchar = ctcharh
523:                                .getCharacteristic(CUSTOM_CONTENT);
524:                        //
525:                        String content = contentCtchar
526:                                .getValueAsString(0, null);
527:                        String customContent = customContentCtchar
528:                                .getValueAsString(0, null);
529:                        //
530:                        outValue = ConfigInstanceConfig.newInstance(content,
531:                                customContent);
532:                    }
533:                }
534:
535:                return outValue;
536:            }
537:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.