/[suikacvs]/messaging/manakai/lib/Message/Util/DIS.dis
Suika

Contents of /messaging/manakai/lib/Message/Util/DIS.dis

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.116 - (show annotations) (download)
Fri Sep 21 08:09:20 2007 UTC (17 years, 9 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
Changes since 1.115: +1 -1 lines
FILE REMOVED
++ manakai/bin/ChangeLog	21 Sep 2007 07:55:21 -0000
2007-09-21  Wakaba  <wakaba@suika.fam.cx>

	* daf.pl, mkdisdump.pl, grep-dis.pl, mkdommemlist.pl: Removed.

++ manakai/lib/Message/IMT/ChangeLog	21 Sep 2007 08:02:20 -0000
2007-09-21  Wakaba  <wakaba@suika.fam.cx>

	* InternetMediaType.pm: Don't raise CoreException even if
	a read-only attribute is attempted to be modified.

++ manakai/lib/Message/Markup/ChangeLog	21 Sep 2007 07:46:59 -0000
2007-09-21  Wakaba  <wakaba@suika.fam.cx>

	* SuikaWikiConfig21.dis, SuikaWikiConfig21.pm, common.dis,
	H2H.dis: Removed.

++ manakai/lib/Message/Util/ChangeLog	21 Sep 2007 07:44:10 -0000
2007-09-21  Wakaba  <wakaba@suika.fam.cx>

	* Makefile (clean): Don't remove generated files.

	* ManakaiNode.dis, ManakaiNodeTest.dis, PerlCode.dis,
	PerlCode.pm, ManakaiNode.pm, common.dis, DIS.dis, DIS.pm: Removed.

	* DIS/, AutoLoad/: Removed.

++ manakai/lib/Message/Util/Error/ChangeLog	21 Sep 2007 07:44:55 -0000
2007-09-21  Wakaba  <wakaba@suika.fam.cx>

	* Core.dis, DOMException.pm, DOMException.dis: Removed.

++ manakai/lib/Message/Util/Formatter/ChangeLog	21 Sep 2007 08:09:07 -0000
2007-09-21  Wakaba  <wakaba@suika.fam.cx>

	* Base.pm (___error_def): Error description key names
	are updated.

	* Muf2003.dis: Removed.

++ manakai/lib/manakai/ChangeLog	21 Sep 2007 07:52:20 -0000
2007-09-21  Wakaba  <wakaba@suika.fam.cx>

	* DISLang.dis, Document.dis, NaturalLanguage.dis, DISMarkup.dis,
	ECMAScript.dis, Test.dis, Charset.dis, DISPerl.dis, Java.dis,
	XML.dis, DISCore.dis, DISRDF.dis, DISIDL.dis, DISSource.dis,
	Message.dis, daf-perl-t.pl, daf-dtd-modules.pl, daf-perl-pm.pl,
	dis-catalog, mndebug.pl: Removed.

++ manakai/t/ChangeLog	21 Sep 2007 08:00:31 -0000
2007-09-21  Wakaba  <wakaba@suika.fam.cx>

	* util-mnode.t: Removed.

1 Module:
2 @QName: Util|DIS
3 @FullName:
4 @@lang: en
5 @@@:
6 <QUOTE::DIS> Object Model
7 @Namespace:
8 http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
9
10 @Description:
11 @@lang:en
12 @@@:
13 This module provides an object model for <QUOTE::dis> document format.
14
15 @DISCore:author: DISCore|Wakaba
16 @License:
17 @@@:
18 license:Perl+MPL
19 @@Original:
20 @@@FullName:
21 manakai <CODE::lib/manakai/dis.pl> and <CODE::bin/cdis2pm.pl>
22 @@@Year:2004
23 @@@DISCore:author: DISCore|Wakaba
24 @Date:
25 $Date: 2006/12/31 09:11:57 $
26
27 @Require:
28 @@Module:
29 @@@QName: Util|common
30 @@Module:
31 @@@QName: Markup|SuikaWikiConfig21
32 @@Module:
33 @@@QName: MDOM|DOMFeature
34 @@Module:
35 @@@QName: DIS|Perl
36 @@Module:
37 @@@QName: DIS|Value
38 @@Module:
39 @@@QName: MDOM|DOMCore
40 @@Module:
41 @@@QName: MDOM|TreeStore
42
43 Namespace:
44 @c:
45 http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
46 @DIS:
47 http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#
48 @dis:
49 http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis--
50 @DOMCore:
51 http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core#
52 @DOMLS:
53 http://suika.fam.cx/~wakaba/archive/2004/dom/ls#
54 @DOMMain:
55 http://suika.fam.cx/~wakaba/archive/2004/dom/main#
56 @domperl:
57 http://suika.fam.cx/~wakaba/archive/2006/dom/perl/
58 @dp:
59 http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#Perl/
60 @dv:
61 http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#Value/
62 @dx:
63 http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException#
64 @ecore:
65 http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/Core/
66 @Err:
67 http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/
68 @f:
69 http://suika.fam.cx/~wakaba/archive/2004/dom/feature#
70 @fe:
71 http://suika.fam.cx/www/2006/feature/
72 @idl:
73 http://suika.fam.cx/~wakaba/archive/2004/dis/IDL#
74 @infoset:
75 http://www.w3.org/2001/04/infoset#
76 @kwd:
77 http://suika.fam.cx/~wakaba/archive/2005/rfc2119/
78 @lang:
79 http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#
80 @license:
81 http://suika.fam.cx/~wakaba/archive/2004/8/18/license#
82 @ManakaiDOM:
83 http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#
84 @Markup:
85 http://suika.fam.cx/~wakaba/archive/2005/manakai/Markup#
86 @MDOM:
87 http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM.
88 @MDOMX:
89 http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception#
90 @mn:
91 http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ManakaiNode#
92 @rdf:
93 http://www.w3.org/1999/02/22-rdf-syntax-ns#
94 @rdfs:
95 http://www.w3.org/2000/01/rdf-schema#
96 @s:
97 http://suika.fam.cx/~wakaba/archive/2004/dis/Markup#
98 @swcfg21:
99 http://suika.fam.cx/~wakaba/archive/2005/swcfg21#
100 @tc:
101 http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeCore/
102 @td:
103 http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Document/
104 @te:
105 http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/Element/
106 @test:
107 http://suika.fam.cx/~wakaba/archive/2004/dis/Test#
108 @tst:
109 http://suika.fam.cx/~wakaba/archive/2005/manakai/DOM/TreeStore/
110 @Util:
111 http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/
112
113 ## -- Features
114
115 ElementTypeBinding:
116 @Name: FeatureDef
117 @ElementType:
118 dis:ResourceDef
119 @ShadowContent:
120 @@rdf:type: DOMFeature|Feature
121
122 ElementTypeBinding:
123 @Name: FeatureVerDef
124 @ElementType:
125 dis:ResourceDef
126 @ShadowContent:
127 @@rdf:type: DOMFeature|Feature
128
129 ElementTypeBinding:
130 @Name: featureQName
131 @ElementType:
132 DOMFeature:name
133 @ShadowContent:
134 @@ContentType: DISCore|QName
135
136 FeatureDef:
137 @QName: Core
138 @FeatureVerDef:
139 @@QName: CoreFeature10
140 @@f:version: 1.0
141 @@DOMFeature:instanceOf: Core
142 @@FullName:
143 @@@lang:en
144 @@@@:
145 The <QUOTE::dis> object model, version 1.0
146 @@Description:
147 @@@lang:en
148 @@@@:
149 The <QUOTE::dis> object model, version 1.0.
150 @@f:requires:
151 swcfg21:CoreFeature21
152
153 ElementTypeBinding:
154 @Name: IFQName
155 @ElementType:
156 dis:QName
157 @ShadowContent:
158 @@ForCheck: ManakaiDOM|ForIF
159
160 ElementTypeBinding:
161 @Name: ClsQName
162 @ElementType:
163 dis:QName
164 @ShadowContent:
165 @@ForCheck: ManakaiDOM|ForClass
166
167 ElementTypeBinding:
168 @Name: IFISA
169 @ElementType:
170 dis:ISA
171 @ShadowContent:
172 @@ForCheck: ManakaiDOM|ForIF
173
174 ElementTypeBinding:
175 @Name: ClsISA
176 @ElementType:
177 dis:ISA
178 @ShadowContent:
179 @@ForCheck: ManakaiDOM|ForClass
180
181 ElementTypeBinding:
182 @Name: IFClsDef
183 @ElementType:
184 dis:ResourceDef
185 @ShadowContent:
186 @@rdf:type:
187 @@@@: dis|MultipleResource
188 @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
189 @@resourceFor: ManakaiDOM|ForIF
190 @@resourceFor:
191 @@@@: ManakaiDOM|ForClass
192
193 @@rdf:type:
194 @@@@: ManakaiDOM|IF
195 @@@ForCheck: ManakaiDOM|ForIF
196
197 @@rdf:type:
198 @@@@: ManakaiDOM|Class
199 @@@ForCheck: ManakaiDOM|ForClass
200
201 @@Implement:
202 @@@@: ||+||ManakaiDOM|ForIF
203 @@@ContentType: DISCore|TFPQNames
204 @@@ForCheck: ManakaiDOM|ForClass
205
206 @@f:implements: CoreFeature10
207
208 ElementTypeBinding:
209 @Name: ClsDef
210 @ElementType:
211 dis:ResourceDef
212 @ShadowContent:
213 @@rdf:type:
214 @@@@: dis|MultipleResource
215 @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
216
217 @@resourceFor:
218 @@@@: ManakaiDOM|ForClass
219
220 @@rdf:type:
221 @@@@: ManakaiDOM|Class
222 @@@ForCheck: ManakaiDOM|ForClass
223
224 @@f:implements: CoreFeature10
225
226 ElementTypeBinding:
227 @Name: clsActualType
228 @ElementType:
229 dis:actualType
230 @ShadowContent:
231 @@ForCheck: ManakaiDOM|ForClass
232
233 ## -- SuikaWikiConfig/2.1 extended classes
234
235 IFClsDef:
236 @IFQName: DISImplementation
237 @ClsQName: ManakaiDISImplementation
238
239 @domperl:implementedByObjectsOf: DOMImpl
240 @domperl:classImplementedByObjectsOf:
241 c|ManakaiDOMImplementation
242
243 @Description:
244 @@lang:en
245 @@@:
246 A <QUOTE::dis> implementation object.
247
248 @Method:
249 @@Name: createDISParser
250 @@Description:
251 @@@lang:en
252 @@@@:
253 Creates a <IF::DISParser> object.
254 @@Return:
255 @@@Type: DISParser
256 @@@clsActualType: ManakaiDISParser
257 @@@Description:
258 @@@@lang:en
259 @@@@@:
260 A newly created <QUOTE::dis> parser.
261 @@@PerlDef:
262 $r = bless $self-><M::swcfg21:SWCFGImplementation
263 .createSWCFGParser>,
264 <ClassName::ManakaiDISParser>;
265
266 @Method:
267 @@Name: createDISDatabase
268 @@Description:
269 @@@lang:en
270 @@@@:
271 Creates a new <QUOTE::dis> database.
272 @@Return:
273 @@@Type: DISDatabase
274 @@@clsActualType: ManakaiDISDatabase
275 @@@Description:
276 @@@@lang:en
277 @@@@@:
278 A newly created <QUOTE::dis> parser.
279 @@@PerlDef:
280 $r = bless {
281 forDef => {
282 <Q::ManakaiDOM:all> => bless ({
283 uri => <Q::ManakaiDOM:all>,
284 isa => {<Q::ManakaiDOM:all> => 1},
285 revISA => {},
286 <H::revision> => 0,
287 }, <ClassName::ManakaiDISForDefinition>),
288 },
289 resDef => {},
290 modDef => {},
291 seq => 0,
292 }, <ClassName::ManakaiDISDatabase>;
293 $r->{forDef}->{<Q::ManakaiDOM:all>}->{db} = $r;
294
295 @CODE:
296 @@QName: createDISDBForTest
297 @@PerlDef:
298 $db = <ClassM::ManakaiDISImplementation.createDISDatabase>;
299
300 my $any = $db-><M::DISDatabase.getResource> (<Q::DISCore|AnyResource>);
301
302 my $mod = $db-><M::DISDatabase.getResource> (<Q::DISCore|Module>);
303 $mod-><M::DISResource.addSuperResource> ($any);
304
305 my $for = $db-><M::DISDatabase.getResource> (<Q::DISCore|For>);
306 $for-><M::DISResource.addSuperResource> ($any);
307
308 my $res = $db-><M::DISDatabase.getResource> (<Q::DISCore|Resource>);
309 $res-><M::DISResource.addSuperResource> ($any);
310
311 @ResourceDef:
312 @@QName: tfpurisToURI
313 @@rdf:type: DISPerl|BlockCode
314 @@enDesc:
315 Converts a set of name URI reference
316 and <QUOTE::for+> URI references into a URi reference.
317 @@ForCheck: ManakaiDOM|ForClass
318 @@PerlDef:
319 if (@{$forp} == 0) {
320 $uri = $turi;
321 } else {
322 my $__turi = $turi;
323 my $__furi = <Q::ManakaiDOM|all>;
324 for my $__uri ($__turi, $__furi) {
325 $__uri =~ s{([^0-9A-Za-z!\$'()*,:;=?\@_./~-])}{sprintf '%%%02X', ord $1}ge;
326 }
327 my @__fp;
328 for my $__uri (@{$forp}) {
329 my $__fpuri = $__uri;
330 $__fpuri =~ s{([^0-9A-Za-z!\$'()*,:;=?\@_./~-])}
331 {sprintf '%%%02X', ord $1}ge;
332 push @__fp, $__fpuri;
333 }
334 $uri = qq<tag:suika.fam.cx,2005-09:$__turi+$__furi+>.join ('+', @__fp);
335 }
336
337 @CODE:
338 @@QName: composeSubsetURI
339 @@PerlDef:
340 my $__uri1 = $input1;
341 my $__uri2 = $input2;
342 for my $__uri ($__uri1, $__uri2) {
343 $__uri =~ s{([^0-9A-Za-z!\$'()*,:;=?\@_./~-])}
344 {sprintf '%%%02X', ord $1}ge;
345 }
346 $output = qq<tag:suika.fam.cx,2006-02:$__uri1+$__uri2>;
347
348 @ImplNote:
349 @@lang:en
350 @@@:
351 {TODO:: IRI support.
352 }
353
354 @ResourceDef:
355 @@QName: getChildResourceURI
356 @@rdf:type: DISPerl|BlockCode
357 @@enDesc:
358 Gets an anonymous URI reference of a child resource of another
359 resource.
360 @@ForCheck: ManakaiDOM|ForClass
361 @@PerlDef:
362 my $__parent = $parentURI;
363 my $__ln = $localName;
364 for my $__uri ($__parent, $__ln) {
365 $__uri =~ s{([^0-9A-Za-z!\$'(),*:;=?\@_./~-])}{sprintf '%%%02X', ord $1}ge;
366 }
367 $result = qq<data:suika.fam.cx,2005-09::$__parent+$__ln>;
368
369 @IntMethod:
370 @@Name: camelCaseToUnderscoreName
371 @@enDesc:
372 Converts a camelCase name to a underscored_name.
373 @@ManakaiDOM:isStatic:1
374 @@ForCheck: ManakaiDOM|ForClass
375 @@Param:
376 @@@Name: camelName
377 @@@Type:
378 DISLang:String
379 @@@enDesc:
380 The source name.
381 @@Return:
382 @@@Type:
383 DISLang:String
384 @@@enDesc:
385 The result name.
386 @@@PerlDef:
387 $r = $camelName;
388 $r =~ s/^([A-Z0-9]+)$/lc $1/ge;
389 $r =~ s/([A-Z][A-Z0-9]*)$/"_".lc $1/ge;
390 $r =~ s/([A-Z0-9])([A-Z0-9]*)([A-Z0-9])/$1.lc ($2)."_".lc $3/ge;
391 $r =~ s/([A-Z])/"_".lc $1/ge;
392 $r =~ s/(?=[0-9](?!$))/_/g;
393 $r =~ tr/-/_/;
394 ##DISImplementation
395
396 ElementTypeBinding:
397 @Name: CODE
398 @ElementType:
399 dis:ResourceDef
400 @ShadowContent:
401 @@rdf:type: DISPerl|BlockCode
402 @@ForCheck: ManakaiDOM|ForClass
403
404 IFClsDef:
405 @IFQName: DISParser
406 @ClsQName: ManakaiDISParser
407
408 @IFISA: swcfg21|SWCFGParser
409 @ClsISA:
410 swcfg21:ManakaiSWCFGParser
411
412 @Description:
413 @@lang:en
414 @@@:
415 A SuikaWikiConfig/2.1 parser that returns <QUOTE::dis> object.
416 @Method:
417 @@Name: parse
418 @@Description:
419 @@@lang:en
420 @@@@:
421 Parses a <QUOTE::dis> document and returns it as an object tree.
422 @@Param:
423 @@@Name: input
424 @@@Type: DISPerl|HASH
425 @@@Description:
426 @@@@lang:en
427 @@@@@:
428 The input source.
429 @@Return:
430 @@@Type: DISDocument
431 @@@clsActualType: ManakaiDISDocument
432 @@@Description:
433 @@@@lang:en
434 @@@@@:
435 The <QUOTE::dis> document object created from the <P::input>.
436 @@@RaiseException:
437 @@@@@:
438 swcfg21:SWCFG_PARSE_ERR
439 @@@@Description:
440 @@@@@lang:en
441 @@@@@@:
442 The <IF::swcfg21:SWCFGParser> was unable to load the SuikaWikiConfig
443 document.
444 @@@PerlDef:
445 __DEEP{
446 $r = $self->SUPER::parse ($input)
447 }__;
448 if (defined $r) {
449 $r = bless $r, <ClassName::ManakaiDISDocument>;
450 $r-><AS::swcfg21:SWCFGDocument
451 .defaultElementTypeNamespaceURI>
452 (<Q::dis:>);
453 }
454 ##DISParser
455
456 IFClsDef:
457 @IFQName: DISNode
458 @ClsQName: ManakaiDISNode
459
460 @Description:
461 @@lang:en
462 @@@:
463 <QUOTE::dis> node objects.
464 @ImplNote:
465 @@lang:en
466 @@@:
467 This class does not inherit
468 <Class::swcfg21:ManakaiSWCFGNode>, since
469 inheriting classes such as <Class::ManakaiDISElement> indirectly
470 inherit it.
471
472 @MethodRedef:
473 @@ForCheck: ManakaiDOM|ForClass
474 @@Name:lookupNamespacePrefix
475 @@Description:
476 @@@lang:en
477 @@@@:
478 Looks up the namespace prefix associated to the given
479 namespace URI. The default namespaces are ignored.
480 @@Param:
481 @@@Name:namespaceURI
482 @@@Type: AnyURI
483 @@@Description:
484 @@@@lang:en
485 @@@@@:
486 The namespace URI to look for.
487 @@@nullCase:
488 @@@@Description:
489 @@@@@lang:en
490 @@@@@@:
491 The <DOM::null> namespace.
492 @@NamedParam:
493 @@@Name: makeNewBinding
494 @@@Type:
495 DOMMain:boolean
496 @@@Description:
497 @@@@lang:en
498 @@@@@:
499 Whether a new namespace prefix should be bound when
500 no namespace URI has been associated yet.
501 @@@TrueCase:
502 @@@@Description:
503 @@@@@lang:en
504 @@@@@@:
505 New binding is made if no prefix associated.
506 @@@FalseCase:
507 @@@@Description:
508 @@@@@lang:en
509 @@@@@@:
510 Simply returns the <DOM::null> if no prefix associated.
511 @@Return:
512 @@@Type: swcfg21|SWCFGString
513 @@@actualType:
514 DISCore:NamespacePrefix
515 @@@Description:
516 @@@@lang:en
517 @@@@@:
518 An associated namespace prefix. If more than one prefix
519 are associated to the namespace URI, the returned prefix
520 is implementation dependent.
521 @@@nullCase:
522 @@@@Description:
523 @@@@@lang:en
524 @@@@@@:
525 No associated namespace prefix found.
526 @@@PerlDef:
527 $r = null;
528 my $od = $self-><AG::swcfg21:SWCFGNode
529 .ownerDocument> || $self;
530 my $binds = $od->{<H::mn:node>}->{<H::swcfg21:nsBinding>};
531 if (defined $namespaceURI) {
532 FIND: {
533 for my $prefix (keys %$binds) {
534 if (defined $binds->{$prefix} and
535 $binds->{$prefix} eq $namespaceURI) {
536 $r = $prefix;
537 last FIND;
538 }
539 }
540
541 ## From module list
542 try {
543 my $db = $self-><AG::ManakaiDISNode.ownerDISDocument>
544 -><AG::ManakaiDISDocument.disDatabase>;
545 for my $mod_uri (keys %{$db->{modDef}}) {
546 my $mod = $db-><M::ManakaiDISDatabase.getModule> ($mod_uri);
547 my $mod_ln = $mod-><AG::DISAnyResource.localName>;
548 next if exists $binds->{$mod_ln};
549 my $ns_uri = $mod-><AG::DIS|DISModule.targetNamespaceURI>;
550 $ns_uri = '' unless defined $ns_uri;
551 if ($ns_uri eq $namespaceURI) {
552 $r = $mod_ln;
553 last FIND;
554 }
555 }
556 } catch <IF::DISException> with {
557 my $err = shift;
558 $err->throw
559 unless $err->{<Q::MDOMX:subtype>} eq <Q::NO_ASSOCIATED_DB_ERR>;
560 };
561
562 last FIND unless $makeNewBinding;
563 ## Not found
564 if ($namespaceURI =~ /(\w+)$/) {
565 my $prefix = $1;
566 unless (exists $binds->{$prefix}) {
567 $binds->{$prefix} = $namespaceURI;
568 $r = $prefix;
569 last FIND;
570 }
571 }
572 my $i = 1;
573 {
574 unless (exists $binds->{'ns'.$i}) {
575 $binds->{$r = 'ns'.$i} = $namespaceURI;
576 last FIND;
577 }
578 $i++;
579 redo;
580 }
581 } # FIND
582 } else { ## Null namespace
583 FIND: {
584 if (exists $binds->{'nu'.'ll'} and not defined $binds->{'nu'.'ll'}) {
585 $r = 'nu'.'ll';
586 last FIND;
587 }
588 for my $prefix (keys %$binds) {
589 if (not defined $prefix) {
590 $r = $prefix;
591 last FIND;
592 }
593 }
594 last FIND unless $makeNewBinding;
595 ## Not found
596 my $i = '';
597 {
598 unless (exists $binds->{'nu'.'ll'.$i}) {
599 $binds->{$r = 'nu'.'ll'.$i} = null;
600 last FIND;
601 }
602 $i++;
603 redo;
604 }
605 }
606 }
607
608 @MethodRedef:
609 @@ForCheck: ManakaiDOM|ForClass
610 @@Name:lookupNamespaceURI
611 @@Description:
612 @@@lang:en
613 @@@@:
614 Looks up the namespace URI associated to the given prefix.
615 @@Param:
616 @@@Name:prefix
617 @@@Type:
618 DISCore:NamespacePrefix
619 @@@Description:
620 @@@@lang:en
621 @@@@@:
622 The namespace URI to look for.
623 @@NamedParam:
624 @@@Name: makeNewBinding
625 @@@Type:
626 DOMMain:boolean
627 @@@Description:
628 @@@@lang:en
629 @@@@@:
630 Whether a new binding should be created if no namespace URI
631 is associated with the <P::prefix> or not.
632 @@@TrueCase:
633 @@@@Description:
634 @@@@@lang:en
635 @@@@@@:
636 A new binding to the temporary namespace URI
637 exactly same as <P::prefix> is created
638 if no binding found.
639 @@@FalseCase:
640 @@@@Description:
641 @@@@@lang:en
642 @@@@@@:
643 No new binding is created if no binding found. Note that
644 even if no association newly created, this method
645 returns the <DOM::null> value.
646 @@NamedParam:
647 @@@Name: raisePrefixException
648 @@@Type:
649 DOMMain:boolean
650 @@@enDesc:
651 Whehter an exception should be thrown if <P::prefix>
652 is not declared or not.
653 @@Return:
654 @@@Type: AnyURI
655 @@@Description:
656 @@@@lang:en
657 @@@@@:The associated namespace URI.
658 @@@nullCase:
659 @@@@Description:
660 @@@@@lang:en
661 @@@@@@:
662 No namespace URI is associated to the prefix or
663 the <DOM::null> namespace is associated.
664 @@@UndeclaredPrefixException:
665 @@@PerlDef:
666 my $od = $self-><AG::DISNode.ownerDISDocument> || $self;
667 my $binds = $od->{<H::mn:node>}->{<H::swcfg21:nsBinding>};
668 if (exists $binds->{$prefix}) {
669 $r = $binds->{$prefix};
670 } else {
671 ## From module list
672 FIND: {
673 if ($od->{<H::mn:node>}->{<H::DIS|disNamespaceResolver>}) {
674 $r = $od->{<H::mn:node>}->{<H::DIS|disNamespaceResolver>}
675 ->($prefix);
676 last FIND if defined $r;
677 }
678 try {
679 my $db = $od-><AG::DISDocument.disDatabase>;
680 for my $mod_uri (keys %{$db->{modDef}}) {
681 my $mod = $db-><M::ManakaiDISDatabase.getModule> ($mod_uri);
682 if ($mod-><AG::DISAnyResource.localName>
683 eq $prefix) {
684 $r = $mod-><AG::DIS|DISModule.targetNamespaceURI>;
685 last FIND;
686 }
687 }
688 } catch <IF::DISException> with {
689 my $err = shift;
690 $err->throw
691 unless $err->{<Q::MDOMX:subtype>} eq <Q::NO_ASSOCIATED_DB_ERR>;
692 };
693 if ($makeNewBinding) {
694 $r = $binds->{$prefix} = $prefix;
695 } elsif ($raisePrefixException) {
696 __EXCEPTION{DIS:UNDECLARED_NS_PREFIX_ERR::
697 infoset:prefix => {$prefix},
698 MDOMX:param-name => 'prefix',
699 DIS:sourceNode => {$self},
700 }__;
701 } else {
702 $r = null;
703 }
704 } # FIND
705 }
706
707 @IntMethod:
708 @@ForCheck: ManakaiDOM|ForClass
709 @@Name:getNodeReference
710 @@Description:
711 @@@lang:en
712 @@@@:
713 Returns a new reference to the node object.
714 @@ManakaiDOM:isStatic:1
715 @@Param:
716 @@@Name:object
717 @@@Type: ManakaiNode|NodeStem
718 @@@Description:
719 @@@@lang:en
720 @@@@@:
721 The node object to be referred.
722 @@Return:
723 @@@Type: ManakaiDISNode
724 @@@Description:
725 @@@@lang:en
726 @@@@@:
727 A newly created reference.
728 @@@PerlDef:
729 my $class;
730 if ($object->{<H::swcfg21:nodeType>} eq '#element') {
731 $class = <ClassName::ManakaiDISElement>;
732 } elsif ($object->{<H::swcfg21:nodeType>} eq '#comment') {
733 $class = <ClassName::ManakaiDISComment>;
734 } elsif ($object->{<H::swcfg21:nodeType>} eq '#document') {
735 $class = <ClassName::ManakaiDISDocument>;
736 } elsif ($object->{<H::swcfg21:nodeType>} eq '#fragment') {
737 $class = <ClassName::ManakaiDISDocumentFragment>;
738 } else {
739 __ASSERT{DISPerl:invariant::
740 msg => {qq[Node type: "$object->{<H::swcfg21:nodeType>}" ].
741 qq[(ref: "@{[ref $object]}")]},
742 }__;
743 }
744 __CODE{ManakaiNode|getNewReference::
745 $object => $object,
746 $ref => $r,
747 $class => $class,
748 }__;
749
750 @Attr:
751 @@Name:ownerDISDocument
752 @@Description:
753 @@@lang:en
754 @@@@:
755 The <QUOTE::dis> document object associated with this node.
756 @@Get:
757 @@@Type: DISDocument
758 @@@clsActualType: ManakaiDISDocument
759 @@@Description:
760 @@@@lang:en
761 @@@@@:
762 The document object associated with this node.
763 @@@nullCase:
764 @@@@Description:
765 @@@@@lang:en
766 @@@@@@:
767 This node is a document node.
768 @@@PerlDef:
769 $r = <ClassM::ManakaiDISNode.getNodeReference>
770 ($self->{<H::mn:node>}->{<H::swcfg21:ownerDocument>})
771 if $self->{<H::mn:node>}->{<H::swcfg21:ownerDocument>};
772 ##DISNode
773
774 IFClsDef:
775 @IFQName: NSResolverDIS
776 @ClsQName: ManakaiNSResolverDIS
777
778 @Method:
779 @@Name: prefixToURI
780 @@Description:
781 @@@lang:en
782 @@@@:
783 Converts a namespace prefix into associated URI reference.
784 @@Param:
785 @@@Name: prefix
786 @@@Type:
787 DISCore:NamespacePrefix
788 @@@Description:
789 @@@@lang:en
790 @@@@@:
791 A namespace prefix to look for.
792 @@@nullCase:
793 @@@@Description:
794 @@@@@lang:en
795 @@@@@@:
796 Returns the default namespace URI.
797 @@NodeParam:
798 @@Return:
799 @@@Type: AnyURI
800 @@@Description:
801 @@@@lang:en
802 @@@@@: The URI references associated.
803 @@@UndeclaredPrefixException:
804 @@@PerlDef:
805 if (defined $prefix) {
806 __DEEP{
807 $r = $self-><M::SWCFGNode.lookupNamespaceURI> ($prefix);
808 }__;
809 unless (defined $r) {
810 __EXCEPTION{UNDECLARED_NS_PREFIX_ERR::
811 infoset:prefix => {$prefix},
812 MDOMX:param-name => 'prefix',
813 DIS:sourceNode => {$node},
814 }__;
815 }
816 } elsif (defined $self->{<H::mn:node>}
817 ->{<H::DIS|defaultNamespaceURI>}) {
818 $r = $self->{<H::mn:node>}->{<H::DIS|defaultNamespaceURI>};
819 } else { ## Default namespace
820 __DEEP{
821 $r = ($self-><AG::ManakaiDISNode.ownerDISDocument> || $self)
822 -><AG::ManakaiDISDocument.moduleElement>
823 -><AG::ManakaiDISModuleElement.definingNamespaceURI>;
824 }__;
825 }
826
827 @Method:
828 @@Name: qnameToURI
829 @@Description:
830 @@@lang:en
831 @@@@:
832 Converts a qualified name (<Q::DISCore:QName>) to
833 an expanded URI reference.
834 @@Param:
835 @@@Name: qname
836 @@@Type: DISCore|QName
837 @@@Description:
838 @@@@lang:en
839 @@@@@:
840 A qualified name.
841 @@NodeParam:
842 @@NamedParam:
843 @@@Name: defaultNamespaceURI
844 @@@Type: AnyURI
845 @@@enDesc:
846 Default namespace URI reference.
847 @@@nullCase:
848 @@@@enDesc:
849 The default namespace is the namespace defined by the module
850 to which this resource belongs.
851 @@Return:
852 @@@Type: AnyURI
853 @@@Description:
854 @@@@lang:en
855 @@@@@:
856 The expanded URI reference.
857 @@@UndeclaredPrefixException:
858 @@@PerlDef:
859 $qname =~ s/^\s+//; $qname =~ s/\s+$//;
860 my ($prefix, $lname) = split /\s*[:|]\s*/, $qname, 2;
861 __DEEP{
862 if (defined $lname) {
863 $r = $self-><M::NSResolverDIS.prefixToURI> ($prefix) . $lname;
864 } else { ## In default namespace
865 if (defined $defaultNamespaceURI) {
866 $r = $defaultNamespaceURI . $prefix;
867 } else {
868 $r = $self-><M::NSResolverDIS.prefixToURI> (null) . $prefix;
869 }
870 }
871 }__;
872
873 @Method:
874 @@Name: qnameToPair
875 @@Description:
876 @@@lang:en
877 @@@@:
878 Converts a qualified name (<Q::DISCore:QName>) to
879 a pair of namespace URI and local name.
880 @@Param:
881 @@@Name: qname
882 @@@Type: DISCore|QName
883 @@@Description:
884 @@@@lang:en
885 @@@@@:
886 A qualified name.
887 @@NodeParam:
888 @@Return:
889 @@@Type:
890 DISPerl:ARRAY
891 @@@Description:
892 @@@@lang:en
893 @@@@@:
894 A list of namespace URI and local name.
895 @@@UndeclaredPrefixException:
896 @@@PerlDef:
897 $qname =~ s/^\s+//; $qname =~ s/\s+$//;
898 my ($prefix, $lname) = split /\s*[:|]\s*/, $qname, 2;
899 __DEEP{
900 if (defined $lname) {
901 $r = [$self-><M::NSResolverDIS.prefixToURI> ($prefix), $lname];
902 } else { ## In default namespace
903 $r = [$self-><M::NSResolverDIS.prefixToURI> (null), $prefix];
904 }
905 }__;
906
907 @Method:
908 @@Name: tfpqnamesToURI
909 @@Description:
910 @@@lang:en
911 @@@@:
912 Converts a <Q::DISCore:TFPQNames>
913 into an expanded URI reference.
914 @@Param:
915 @@@Name: tfpqnames
916 @@@Type:
917 DISCore:TFPQNames
918 @@@Description:
919 @@@@lang:en
920 @@@@@:
921 A <Q::DISCore:TFPQNames> to identify a resource.
922 @@Param:
923 @@@Name: defaultTypeURI
924 @@@Type: NameURI
925 @@@Description:
926 @@@@lang:en
927 @@@@@:
928 A name URI reference used if it is missing from
929 <P::tfqnames>.
930 @@@nullCase:
931 @@@@Description:
932 @@@@@lang:en
933 @@@@@@:
934 Equivalent to <Q::DOMMain:any>.
935 @@NodeParam:
936 @@Return:
937 @@@Type: DISString
938 @@@enDesc:
939 The URI reference obtained by expanding the <P::tfpqnames>.
940 @@@UndeclaredPrefixException:
941 @@@PerlDef:
942 my ($typeq, undef, @forpq) = split /\s*[:|][:|]\s*/, $tfpqnames;
943 my ($typeURI);
944 my $forpURI = [];
945 __DEEP{
946 $typeURI = $typeq eq ''
947 ? defined $defaultTypeURI ? $defaultTypeURI
948 : <Q::DOMMain:any>
949 : $self-><M::NSResolverDIS.qnameToURI> ($typeq, %opt);
950 for my $forpq (@forpq) {
951 push @$forpURI, $self-><M::NSResolverDIS.qnameToURI>
952 ($forpq, %opt);
953 }
954 }__;
955 __CODE{tfpurisToURI:: $turi => $typeURI,
956 $forp => $forpURI, $uri => $r}__;
957 ##NSResolverDIS
958
959 PropDef:
960 @QName: defaultNamespaceURI
961 @enDesc:
962 Default namespace URI for an element.
963 @DIS:key: dns
964
965 IFClsDef:
966 @IFQName: DISElement
967 @ClsQName: ManakaiDISElement
968
969 @ClsISA: ManakaiNSResolverDIS
970 @ClsISA: ManakaiDISNode
971 @ClsISA:
972 swcfg21:ManakaiSWCFGElement
973 @ClsISA: dp|ManakaiDISElementPerl
974
975 @Description:
976 @@lang:en
977 @@@:
978 <QUOTE::dis> element node objects.
979
980 @Method:
981 @@Name: forMatch
982 @@Description:
983 @@@lang:en
984 @@@@:
985 Tests whether this element is for a <QUOTE::for> or not.
986 @@Param:
987 @@@Name: forArg
988 @@@Type: ForURI
989 @@@enDesc:
990 This parameter <kwd:MUST> be ignored.
991 @@Param:
992 @@@Name: forpArg
993 @@@Type: ForURIList
994 @@@Description:
995 @@@@lang:en
996 @@@@@:
997 The <QUOTE::For+> URI references to test against.
998 @@@nullCase:
999 @@@@Description:
1000 @@@@@lang:en
1001 @@@@@@:
1002 No additional <QUOTE::For> URI reference.
1003 Equivalent to an empty array reference.
1004 @@NamedParam:
1005 @@@Name: databaseArg
1006 @@@Type: DISDatabase
1007 @@@enDesc:
1008 A <QUOTE::dis> database.
1009 @@@nullCase:
1010 @@@@enDesc:
1011 The database associated to the document is used.
1012 @@Return:
1013 @@@Type:
1014 DOMMain:boolean
1015 @@@Description:
1016 @@@@lang:en
1017 @@@@@:
1018 Whether this element is for <P::forpArg> or not.
1019 @@@UndeclaredPrefixException:
1020 @@@NoDBException:
1021 @@@PerlDef:
1022 $forpArg ||= [];
1023
1024 FORMATCH: {
1025 __DEEP{
1026 my $for_res = ($databaseArg ||=
1027 $self-><AG::DISNode.ownerDISDocument>
1028 -><AG::DISDocument.disDatabase>)
1029 ->get_for (<Q::ManakaiDOM|all>);
1030 my $forp_res = [map {
1031 $databaseArg-><M::DISDatabase.getFor> ($_)
1032 } @{$forpArg}];
1033
1034 my @ce = @{$self-><M::ManakaiDISElement.disAllChildElements>};
1035 for my $ce (@ce) {
1036 my $et = $ce-><AG::swcfg21:SWCFGElement
1037 .expandedURI>;
1038 if ($et eq <Q::dis:ForCheck>) {
1039 my $fors = [split /\s+/, $ce-><M::swcfg21:SWCFGNode
1040 .value>];
1041 FCs: for my $f (@$fors) {
1042 if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO
1043 my $uri = $self-><M::NSResolverDIS.qnameToURI> ($1);
1044 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1045 $for-><AS::DISAnyResource.isReferred> ($ce);
1046 for my $arg_res ($for_res, @{$forp_res}) {
1047 if ($arg_res eq $for) {
1048 $r = false;
1049 last FORMATCH;
1050 }
1051 }
1052 } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA
1053 my $uri = $self-><M::NSResolverDIS.qnameToURI> ($1);
1054 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1055 $for-><AS::DISAnyResource.isReferred> ($ce);
1056 for my $arg_res ($for_res, @{$forp_res}) {
1057 if ($arg_res-><M::DISFor.isaURI> ($uri)) {
1058 $r = false;
1059 last FORMATCH;
1060 }
1061 }
1062 } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO
1063 my $uri = $self-><M::NSResolverDIS.qnameToURI> ($1);
1064 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1065 $for-><AS::DISAnyResource.isReferred> ($ce);
1066 for my $arg_res ($for_res, @{$forp_res}) {
1067 if ($arg_res eq $for) {
1068 next FCs;
1069 }
1070 }
1071 $r = false;
1072 last FORMATCH;
1073 } else { ## -- ISA
1074 my $uri = $self-><M::NSResolverDIS.qnameToURI> ($f);
1075 my $for = $databaseArg-><M::DISDatabase.getFor> ($uri);
1076 $for-><AS::DISAnyResource.isReferred> ($ce);
1077 for my $arg_res ($for_res, @{$forp_res}) {
1078 if ($arg_res-><M::DISFor.isaURI> ($uri)) {
1079 next FCs;
1080 }
1081 }
1082 $r = false;
1083 last FORMATCH;
1084 }
1085 } # FCs
1086 } # dis:ForCheck
1087 } # children
1088
1089 $r = 1;
1090 }__;
1091 } # FORMATCH
1092
1093 @Method:
1094 @@Name: mediaTypeMatch
1095 @@Description:
1096 @@@lang:en
1097 @@@@:
1098 Tests whether the content media type of this element matches to
1099 a type or not.
1100 @@Param:
1101 @@@Name: mediaType
1102 @@@Type: MediaTypeURI
1103 @@@Description:
1104 @@@@lang:en
1105 @@@@@:
1106 A media type URI reference to test against.
1107 @@Param:
1108 @@@Name: defaultMediaType
1109 @@@Type: MediaTypeURI
1110 @@@Description:
1111 @@@@lang:en
1112 @@@@@:
1113 The default media type for this element.
1114 @@@nullCase:
1115 @@@@Description:
1116 @@@@@lang:en
1117 @@@@@@:
1118 No default type provided. All <P::mediaType> will match.
1119 @@NamedParam:
1120 @@@Name: databaseArg
1121 @@@Type: DISDatabase
1122 @@@enDesc:
1123 A <QUOTE::dis> database.
1124 @@@nullCase:
1125 @@@@enDesc:
1126 The database associated to the document is used.
1127 @@Return:
1128 @@@Type:
1129 DOMMain:boolean
1130 @@@Description:
1131 @@@@lang:en
1132 @@@@@:
1133 Whether this element is of <P::mediaType> or not.
1134 @@@PerlDef:
1135 if (defined $mediaType) {
1136 __DEEP{
1137 my $ctn = $self-><M::SWCFGNode.getAttributeNS>
1138 (<Q::dis:>, 'ContentType');
1139 my $ct;
1140 $ct = $ctn-><AG::DISElement.qnameValueURI> if $ctn;
1141 $ct = $defaultMediaType unless defined $ct;
1142 my $res = $self-><AG::ManakaiDISNode.ownerDISDocument>
1143 -><AG::ManakaiDISDocument.disDatabase>
1144 -><M::ManakaiDISDatabase.getResource> ($ct);
1145 $res-><AS::DISAnyResource.isReferred> ($ctn or $self);
1146 unless ($res-><M::ManakaiDISResourceDefinition
1147 .isSubsetOfURI> ($mediaType)) {
1148 $r = false;
1149 } else {
1150 $r = true;
1151 }
1152 }__;
1153 } else {
1154 $r = true;
1155 }
1156
1157 @Method:
1158 @@Name:mediaTypeURI
1159 @@enDesc:
1160 The URI reference of the media type of this element.
1161 @@Type: MediaTypeURI
1162 @@NamedParam:
1163 @@@Name:defaultMediaType
1164 @@@Type:MediaTypeURI
1165 @@@enDesc:
1166 The default media type URI reference.
1167 @@@nullCase:
1168 @@@@enDesc:
1169 No default is specified.
1170 @@Return:
1171 @@@enDesc:
1172 The media type URI reference of this element.
1173 @@@nullCase:
1174 @@@@enDesc:
1175 This element has no media type information and
1176 <P::defaultMediaType> parameter is not provided.
1177 @@@UndeclaredPrefixException:
1178 @@@PerlDef:
1179 __DEEP{
1180 $r = $defaultMediaType;
1181 my $ctn = $self-><M::SWCFGNode.getAttributeNS>
1182 (<Q::dis:>, 'ContentType');
1183 $r = $ctn-><AG::DISElement.qnameValueURI> if $ctn;
1184 }__;
1185
1186 @Method:
1187 @@Name: disGetAttribute
1188 @@enDesc:
1189 Gets an attribute node.
1190 @@Param:
1191 @@@Name: attrName
1192 @@@Type: AnyURI
1193 @@@enDesc:
1194 The name expanded URI of the node to retrieve.
1195 @@ForpParam:
1196 @@MediaTypeParam:
1197 @@MediaTypeDefaultParam:
1198 @@NamedParam:
1199 @@@Name: databaseArg
1200 @@@Type: DISDatabase
1201 @@@enDesc:
1202 A <QUOTE::dis> database.
1203 @@@nullCase:
1204 @@@@enDesc:
1205 The database associated to the document is used.
1206 @@Return:
1207 @@@Type: DISElement
1208 @@@clsActualType: ManakaiDISElement
1209 @@@enDesc:
1210 The attribute (property) element node.
1211 @@@nullCase:
1212 @@@@enDesc:
1213 No attribute node found.
1214 @@@PerlDef:
1215 C: for my $c (@{$self-><M::ManakaiDISElement.disChildElements>
1216 (forp_arg => $forpArg,
1217 database_arg => $databaseArg)}) {
1218 if ($c-><AG::swcfg21:SWCFGElement
1219 .expandedURI> eq $attrName and
1220 $c-><M::ManakaiDISElement.mediaTypeMatch>
1221 ($mediaType, $defaultMediaType,
1222 database_arg => $databaseArg)) {
1223 $r = $c;
1224 last C;
1225 }
1226 }
1227
1228 @Method:
1229 @@Name: disGetAttributeList
1230 @@enDesc:
1231 Gets attribute nodes.
1232 @@Param:
1233 @@@Name: attrName
1234 @@@Type: AnyURI
1235 @@@enDesc:
1236 The name expanded URI of the node to retrieve.
1237 @@ForpParam:
1238 @@MediaTypeParam:
1239 @@MediaTypeDefaultParam:
1240 @@NamedParam:
1241 @@@Name: databaseArg
1242 @@@Type: DISDatabase
1243 @@@enDesc:
1244 A <QUOTE::dis> database.
1245 @@@nullCase:
1246 @@@@enDesc:
1247 The database associated to the document is used.
1248 @@Return:
1249 @@@Type: DISElementList
1250 @@@clsActualType: ManakaiDISElementList
1251 @@@enDesc:
1252 The attribute (property) element nodes.
1253 @@@PerlDef:
1254 $r = bless [], <ClassName::ManakaiDISElementList>;
1255 for my $c (@{$self-><M::ManakaiDISElement.disChildElements>
1256 (forp_arg => $forpArg,
1257 database_arg => $databaseArg)}) {
1258 if ($c-><AG::swcfg21:SWCFGElement
1259 .expandedURI> eq $attrName and
1260 $c-><M::ManakaiDISElement.mediaTypeMatch>
1261 ($mediaType, $defaultMediaType,
1262 database_arg => $databaseArg)) {
1263 push @$r, $c;
1264 }
1265 }
1266
1267 @Method:
1268 @@Name: disChildElements
1269 @@enDesc:
1270 A list of child elements, with <QUOTE::for> check.
1271 @@ForpParam:
1272 @@NamedParam:
1273 @@@Name: databaseArg
1274 @@@Type: DISDatabase
1275 @@@enDesc:
1276 A <QUOTE::dis> database.
1277 @@@nullCase:
1278 @@@@enDesc:
1279 The database associated to the document is used.
1280 @@Return:
1281 @@@Type: DISElementList
1282 @@@clsActualType: ManakaiDISElementList
1283 @@@enDesc:
1284 The current snapshot of child nodes.
1285 @@@PerlDef:
1286 $r = bless [], <ClassName::ManakaiDISElementList>;
1287 __DEEP{
1288 C: for my $cn (@{$self-><AG::swcfg21:SWCFGNode
1289 .childNodes>}) {
1290 ## $cn is an #element.
1291 my $dn;
1292 __CODE{ManakaiNode|getNewReference::
1293 $object => {$cn->{<H::mn:node>}},
1294 $ref => $dn,
1295 $class => {<ClassName::ManakaiDISElement>},
1296 }__;
1297 next C unless $dn-><M::ManakaiDISElement.forMatch>
1298 (undef, $forpArg,
1299 database_arg => $databaseArg);
1300 push @$r, $dn;
1301 }
1302 }__;
1303
1304 @Method:
1305 @@Name: disAllChildElements
1306 @@enDesc:
1307 A list of child elements, without <QUOTE::for> check.
1308 @@Return:
1309 @@@Type: DISElementList
1310 @@@clsActualType: ManakaiDISElementList
1311 @@@enDesc:
1312 The current snapshot of child nodes.
1313 @@@PerlDef:
1314 $r = bless [], <ClassName::ManakaiDISElementList>;
1315 __DEEP{
1316 for my $cn (@{$self-><AG::swcfg21:SWCFGNode
1317 .childNodes>}) {
1318 ## $cn is an #element.
1319 my $dn;
1320 __CODE{ManakaiNode|getNewReference::
1321 $object => {$cn->{<H::mn:node>}},
1322 $ref => $dn,
1323 $class => {<ClassName::ManakaiDISElement>},
1324 }__;
1325 push @$r, $dn;
1326 }
1327 }__;
1328
1329 @Attr:
1330 @@Name: qnameValueURI
1331 @@enDesc:
1332 The element value (written as <Q::DISCore:QName>), as URI reference.
1333 \
1334 {NOTE:: What should be if list value?
1335 \
1336 }
1337 @@Get:
1338 @@@Type:AnyURI
1339 @@@nullCase:
1340 @@@@enDesc:
1341 No value.
1342 @@@UndeclaredPrefixException:
1343 @@@PerlDef:
1344 __DEEP{
1345 my $v = $self-><M::swcfg21:SWCFGNode.value>;
1346 if (defined $v and not ref $v eq 'ARRAY') {
1347 $r = $self-><M::NSResolverDIS.qnameToURI> ($v, node => $self);
1348 } else {
1349 $r = null;
1350 }
1351 }__;
1352
1353 @Attr:
1354 @@Name: qnameValueLocalName
1355 @@enDesc:
1356 The local name part of the element value (assumed as
1357 written as <Q::DISCore:QName>).
1358 \
1359 {NOTE:: What should be if list value?
1360 \
1361 }
1362 @@Get:
1363 @@@Type:
1364 DISCore:LocalName
1365 @@@nullCase:
1366 @@@@enDesc:
1367 No value.
1368 @@@PerlDef:
1369 __DEEP{
1370 my $v = $self-><M::swcfg21:SWCFGNode.value>;
1371 if (defined $v and not ref $v eq 'ARRAY') {
1372 my ($n, $v) = split /\s*[:|]\s*/, $v, 2;
1373 $r = defined $v ? $v : $n;
1374 } else {
1375 $r = null;
1376 }
1377 }__;
1378
1379 @Attr:
1380 @@Name: qnameValuePrefix
1381 @@enDesc:
1382 The prefix part of the element value (assumed as
1383 written as <Q::DISCore:QName>).
1384 \
1385 {NOTE:: What should be if list value?
1386 \
1387 }
1388 @@Get:
1389 @@@Type:
1390 DISCore:NamespacePrefix
1391 @@@nullCase:
1392 @@@@enDesc:
1393 No value.
1394 @@@PerlDef:
1395 __DEEP{
1396 my $v = $self-><M::swcfg21:SWCFGNode.value>;
1397 if (defined $v and not ref $v eq 'ARRAY') {
1398 my ($p, $l) = split /\s*[:|]\s*/, $v, 2;
1399 $r = defined $l ? $p : null;
1400 } else {
1401 $r = null;
1402 }
1403 }__;
1404
1405 @Attr:
1406 @@Name: qnameValueNamespaceURI
1407 @@enDesc:
1408 The namespace URI of the element value (assumed as written
1409 in <Q::DISCore:QName>).
1410 \
1411 {NOTE:: What should be if list value?
1412 \
1413 }
1414 @@Get:
1415 @@@Type:AnyURI
1416 @@@nullCase:
1417 @@@@enDesc:
1418 No value.
1419 @@@UndeclaredPrefixException:
1420 @@@PerlDef:
1421 __DEEP{
1422 my $v = $self-><M::swcfg21:SWCFGNode.value>;
1423 if (defined $v and not ref $v eq 'ARRAY') {
1424 my ($p, $v) = split /\s*[:|]\s*/, $v, 2;
1425 $r = $self-><M::NSResolverDIS.prefixToURI>
1426 (defined $v ? $p : null);
1427 } else {
1428 $r = null;
1429 }
1430 }__;
1431
1432 @Method:
1433 @@Name: tfqnamesValueURI
1434 @@enDesc:
1435 The element value (written as <Q::DISCore|TFPQNames>),
1436 as URI reference.
1437 \
1438 {NOTE:: What should be if list value?
1439 \
1440 }
1441 @@Param:
1442 @@@Name: defaultTypeURI
1443 @@@Type: NameURI
1444 @@@Description:
1445 @@@@lang:en
1446 @@@@@:
1447 A name URI reference used if it is missing from
1448 <P::tfqnames>.
1449 @@@nullCase:
1450 @@@@Description:
1451 @@@@@lang:en
1452 @@@@@@:
1453 Equivalent to <Q::DOMMain:any>.
1454 @@Return:
1455 @@@Type:ResourceURI
1456 @@@nullCase:
1457 @@@@enDesc:
1458 No value.
1459 @@@UndeclaredPrefixException:
1460 @@@PerlDef:
1461 my $v = $self-><M::swcfg21:SWCFGNode.value>;
1462 if (defined $v and not ref $v eq 'ARRAY') {
1463 __DEEP{
1464 $r = $self-><M::NSResolverDIS.tfpqnamesToURI>
1465 ($v, $defaultTypeURI,
1466 node => $self);
1467 }__;
1468 } else {
1469 $r = null;
1470 }
1471
1472 @Method:
1473 @@Name: elementTypeMatch
1474 @@enDesc:
1475 Returns whether the element type of this element matches
1476 with another element type (either the same element type or
1477 this type is a subtype of another type).
1478 @@Param:
1479 @@@Name: etype
1480 @@@Type: ResourceURI
1481 @@@enDesc:
1482 An element type name URI reference to test.
1483 @@NamedParam:
1484 @@@Name: srinfo
1485 @@@Type: DISPerl|HASH
1486 @@@enDesc:
1487 The <CODE::srinfo> hash.
1488 @@@nullCase:
1489 @@@@enDesc:
1490 No <CODE::srinfo>.
1491 @@Return:
1492 @@@Type:
1493 DOMMain:boolean
1494 @@@TrueCase:
1495 @@@@enDesc:
1496 Either the element type expanded URI reference of this element is
1497 same as <P::etype> or it is a sub-element type of <P::etype>.
1498 @@@FalseCase:
1499 @@@@enDesc:
1500 This element is not of <P::etype>.
1501 @@@NoDBException:
1502 @@@PerlDef:
1503 __DEEP{
1504 my $et = $self->expanded_uri;
1505 my $rdef = $self-><AG::ManakaiDISNode.ownerDISDocument>
1506 -><AG::ManakaiDISDocument.disDatabase>
1507 -><M::ManakaiDISDatabase.getResource> ($et);
1508 $r = $rdef-><M::DISResource.isSubsetOfURI>
1509 ($etype, srinfo => $srinfo);
1510 }__;
1511
1512 @Attr:
1513 @@Name: isResourceElement
1514 @@enDesc:
1515 Whether this element defines a resource or not.
1516 \
1517 {NOTE:: An element defines a resource if its element type is
1518 <Q::dis:ResourceDef> or its subtype.
1519 \
1520 }
1521 @@Get:
1522 @@@Type:
1523 DOMMain:boolean
1524 @@@TrueCase:
1525 @@@@enDesc:
1526 This element defines a resource.
1527 @@@FalseCase:
1528 @@@@enDesc:
1529 This element does not define any resource.
1530 @@@NoDBException:
1531 @@@PerlDef:
1532 __DEEP{
1533 $r = ($self-><AG::SWCFGElement.expandedURI> eq <Q::dis:ResourceDef>);
1534 }__;
1535
1536 @Method:
1537 @@Name: isPropertyElement
1538 @@enDesc:
1539 Whether this element is a property or not.
1540 \
1541 {NOTE:: An element is a property if the resource whose
1542 URI is equal to the element type name is a property,
1543 i.e. whose type is <Q::DISSource|Property>.
1544 }
1545 @@NamedParam:
1546 @@@Name: databaseArg
1547 @@@Type: DIS|DISDatabase
1548 @@@nullCase:
1549 @@Return:
1550 @@@Type:
1551 DOMMain:boolean
1552 @@@TrueCase:
1553 @@@@enDesc:
1554 This element is a property.
1555 @@@FalseCase:
1556 @@@@enDesc:
1557 This element is not a property.
1558 @@@NoDBException:
1559 @@@PerlDef:
1560 __DEEP{
1561 my $xn = $self-><AG::SWCFGElement.expandedURI>;
1562 if ($xn eq <Q::DISCore|resourceType> or $xn eq <Q::rdf:type>) {
1563 $r = true;
1564 } else {
1565 my $rdef = ($databaseArg or
1566 $self-><AG::DISNode.ownerDISDocument>
1567 -><AG::DISDocument.disDatabase>)
1568 -><M::DISDatabase.getResource> ($xn);
1569 $r = $rdef-><M::DISAnyResource.isTypeURI>
1570 (<Q::DISSource|Property>) ||
1571 $rdef-><M::DISAnyResource.isTypeURI> (<Q::rdf:Property>);
1572 ## TODO: Remove this.
1573 }
1574 }__;
1575
1576 @Method:
1577 @@Name: unlinkFromDocument
1578 @@enDesc:
1579 Removes any relationship to this node from the owner document tree.
1580 In addition, namespace bindings are copied from the document.
1581 The node <kwd:MUST> be a cloned one (or just newly created one)
1582 so that it does not have any parent-child relationship.
1583
1584 {NOTE:: Once a subtree has removed from the document, the nodes
1585 belongs to the subtree can't be part of any document anymore.
1586 }
1587 @@Param:
1588 @@@Name: databaseArg
1589 @@@Type: DISDatabase
1590 @@@enDesc:
1591 The <QUOTE::dis> database.
1592 @@Return:
1593 @@@PerlDef:
1594 __DEEP{
1595 my $ods = $self->{<H::mn:node>}->{<H::swcfg21:ownerDocument>};
1596 $self->{<H::mn:node>}->{<H::swcfg21:nsBinding>}
1597 = $self-><M::DISElement.getNamespaceBindingList> ($databaseArg);
1598 $self->{<H::mn:node>}->{<H::DIS|defaultNamespaceURI>}
1599 = ${$self-><M::DISElement.getDefaultNamespaceURIRef>};
1600 my @nodes = ($self->{<H::mn:node>});
1601 while (defined (my $node = shift @nodes)) {
1602 CORE::delete $node->{<H::swcfg21:ownerDocument>};
1603 push @nodes, grep {$_} @{$node->{<H::swcfg21:childNodes>}},
1604 $node->{<H::swcfg21:shadowContent>},
1605 $node->{<H::swcfg21:shadowSibling>};
1606 }
1607 $self->{<H::mn:node>}
1608 -><M::ManakaiNode|NodeStem.orphanate>;
1609 }__;
1610
1611 @Method:
1612 @@Name: getNamespaceBindingList
1613 @@enDesc:
1614 Returns the <QUOTE::live> hash reference of namespace bindings.
1615 @@Type: DISPerl|HASH
1616 @@Param:
1617 @@@Name: databaseArg
1618 @@@Type: DISDatabase
1619 @@@enDesc:
1620 The <QUOTE::dis> database.
1621 @@Return:
1622 @@@PerlDef:
1623 my $ods = $self->{<H::mn:node>}->{<H::swcfg21:ownerDocument>};
1624 if ($ods->{<H::DIS|allNSBindings>}) {
1625 $r = $ods->{<H::DIS|allNSBindings>};
1626 } else {
1627 if ($databaseArg) {
1628 for my $mod_uri (keys %{$databaseArg->{modDef}}) {
1629 my $mod = $databaseArg-><M::DISDatabase.getModule> ($mod_uri);
1630 $ods->{<H::DIS|allNSBindings>}
1631 ->{$mod-><AG::DISAnyResource.localName>}
1632 = $mod-><AG::DIS|DISModule.targetNamespaceURI>;
1633 }
1634 }
1635 for my $prefix (keys %{$ods->{<H::swcfg21:nsBinding>}}) {
1636 $ods->{<H::DIS|allNSBindings>}->{$prefix}
1637 = $ods->{<H::swcfg21:nsBinding>}->{$prefix};
1638 }
1639 $r = $ods->{<H::DIS|allNSBindings>};
1640 }
1641
1642 @Method:
1643 @@Name: getDefaultNamespaceURIRef
1644 @@enDesc: A reference to the URI of the default namespace.
1645 @@Type: DISPerl|SCALAR
1646 @@Return:
1647 @@@PerlDef:
1648 my $ods = $self->{<H::mn:node>}->{<H::swcfg21:ownerDocument>};
1649 if ($ods->{<H::DIS|defaultNamespaceURI>}) {
1650 $r = \ ($ods->{<H::DIS|defaultNamespaceURI>});
1651 } else {
1652 __DEEP{
1653 $r = \($ods->{<H::DIS|defaultNamespaceURI>}
1654 = $self-><AG::DISNode.ownerDISDocument>
1655 -><AG::DISDocument.moduleElement>
1656 -><AG::DISModuleElement.definingNamespaceURI>);
1657 }__;
1658 }
1659
1660
1661 @Method:
1662 @@Name: preserveNodePath
1663 @@enDesc:
1664 Saves a copy of node path string.
1665 @@Return:
1666 @@@PerlDef:
1667 __DEEP{
1668 $self-><M::SWCFGNode.flag> (nodePath => $self-><M::SWCFGNode.nodePath>
1669 (key => [qw/QName Name Type type/]));
1670 }__;
1671
1672 @Method:
1673 @@Operator:
1674 @@@ContentType: DISCore|QName
1675 @@@@:
1676 DISPerl:CloneMethod
1677 @@Description:
1678 @@@lang:en
1679 @@@@:
1680 Makes a copy of this node. All child nodes are cloned and
1681 all flags and options are copied (rather than cloned).
1682 The new node does not have any parent.
1683 @@Return:
1684 @@@Type: DISElement
1685 @@@Description:
1686 @@@@lang:en
1687 @@@@@:
1688 The cloned node.
1689 \
1690 If this node is a document node, then the another document is made.
1691 @@@PerlDef:
1692 $r = bless $self->SUPER::clone, <ClassName::ManakaiDISElement>;
1693 ##DISElement
1694
1695 PropDef:
1696 @QName: allNSBindings
1697 @enDesc:
1698 Collected set of namespace bindings for a node.
1699
1700 ResourceTypeDef:
1701 @QName: DIS|AnyMethod
1702 @enDesc:
1703 A method or attribute for particular resource types.
1704 @subsetOf: DISLang|AnyMethod
1705
1706 ResourceTypeDef:
1707 @QName: DIS|Method
1708 @enDesc:
1709 A method for particular resource types.
1710 @subsetOf: DISLang|Method
1711 @subsetOf: DIS|AnyMethod
1712
1713 ResourceTypeDef:
1714 @QName: DIS|Attribute
1715 @enDesc:
1716 A attribute for particular resource types.
1717 @subsetOf: DISLang|Attribute
1718 @subsetOf: DIS|AnyMethod
1719
1720 RPropDef:
1721 @QName: DIS|targetType
1722 @enDesc:
1723 A resource type for which the method is applied.
1724 @rdfs:range: DISCore|ResourceType
1725 @rdfs:domain: DIS|Method
1726 @dataType: DISCore|QName
1727 @multipleProperties: DISCore|UnorderedList
1728
1729 ResourceDef:
1730 @QName: DISString
1731 @AliasFor: DISLang|String
1732
1733 ElementTypeBinding:
1734 @Name: ResourceTypeDef
1735 @ElementType:
1736 dis:ResourceDef
1737 @ShadowContent:
1738 @@DISCore:resourceType: DISCore|ResourceType
1739
1740 IFClsDef:
1741 @IFQName: DISModuleElement
1742 @ClsQName: ManakaiDISModuleElement
1743
1744 @IFISA: DISElement
1745 @ClsISA: ManakaiDISElement
1746
1747 @enDesc:
1748 The <Q::dis:Module> elements.
1749
1750 @Attr:
1751 @@Name: requireElement
1752 @@enDesc:
1753 The <Q::dis:Require> child element. The element is
1754 newly created if not exist.
1755 @@Type: DISElement
1756 @@clsActualType: ManakaiDISElement
1757 @@Get:
1758 @@@PerlDef:
1759 __DEEP{
1760 $r = bless $self-><M::swcfg21:SWCFGNode
1761 .getAttributeNS>
1762 (<Q::dis:>, 'Require', make_new_node => true),
1763 <ClassName::ManakaiDISElement>;
1764 }__;
1765
1766 @Attr:
1767 @@Name: definingNamespaceURI
1768 @@enDesc:
1769 The value of <Q::dis:Namespace> attribute, i.e.
1770 the URI reference of the namespace that this module primary
1771 defines.
1772 \
1773 {NOTE:: Defining namespace URI is <QUOTE::for> independent.
1774 \
1775 }
1776 @@Type: AnyURI
1777 @@Get:
1778 @@@PerlDef:
1779 __DEEP{
1780 my $df = $self-><M::swcfg21:SWCFGNode
1781 .getAttributeNS>
1782 (<Q::dis:>, 'Namespace');
1783 if ($df) {
1784 $r = $df->value;
1785 } else {
1786 __ASSERT{DISPerl:invariant::
1787 msg => {qq["dis:Namespace" attribute not found]},
1788 }__;
1789 }
1790 }__;
1791 @@Set:
1792 @@@PerlDef:
1793 __DEEP{
1794 $self-><M::swcfg21:SWCFGNode.setAttributeNS>
1795 (<Q::dis:>, 'Namespace' => $given);
1796 }__;
1797 ##DISModuleElement
1798
1799 IFClsDef:
1800 @IFQName: DISElementList
1801 @ClsQName: ManakaiDISElementList
1802
1803 @enDesc:
1804 @@lang:en
1805 @@@:
1806 Lists of elements.
1807 \
1808 {NOTE:: <Class::ManakaiDISElementList> is <QUOTE::dead>;
1809 later changes to the tree does not affect this type of objects.
1810 \
1811 }
1812 ##DISElementList
1813
1814 IFClsDef:
1815 @IFQName: DISComment
1816 @ClsQName: ManakaiDISComment
1817
1818 @ClsISA: ManakaiDISNode
1819 @ClsISA:
1820 swcfg21:ManakaiSWCFGComment
1821
1822 @Description:
1823 @@lang:en
1824 @@@:
1825 <QUOTE::dis> comment node objects.
1826 ##DISComment
1827
1828 IFClsDef:
1829 @IFQName: DISDocumentFragment
1830 @ClsQName: ManakaiDISDocumentFragment
1831
1832 @ClsISA: ManakaiDISNode
1833 @ClsISA:
1834 swcfg21:ManakaiSWCFGDocumentFragment
1835
1836 @Description:
1837 @@lang:en
1838 @@@:
1839 <QUOTE::dis> document fragment node objects.
1840 ##DISDocumentFragment
1841
1842 IFClsDef:
1843 @IFQName: DISDocument
1844 @ClsQName: ManakaiDISDocument
1845
1846 @ClsISA: ManakaiDISNode
1847 @ClsISA:
1848 swcfg21:ManakaiSWCFGDocument
1849
1850 @Description:
1851 @@lang:en
1852 @@@:
1853 <QUOTE::dis> document node objects.
1854
1855 @Attr:
1856 @@Name: moduleElement
1857 @@enDesc:
1858 The <Q::dis:Module> element in this document. The element is
1859 newly created if not exist.
1860 @@Type: DISModuleElement
1861 @@clsActualType: ManakaiDISModuleElement
1862 @@Get:
1863 @@@PerlDef:
1864 __DEEP{
1865 $r = $self-><M::swcfg21:SWCFGNode
1866 .getAttributeNS>
1867 (<Q::dis:>, 'Module', make_new_node => true);
1868 }__;
1869 $r = bless $r, <ClassName::ManakaiDISModuleElement>;
1870
1871 @Attr:
1872 @@Name: disDatabase
1873 @@enDesc:
1874 Associated <QUOTE::dis> database.
1875
1876 @@Type: DISDatabase
1877 @@clsActualType: ManakaiDISDatabase
1878 @@Get:
1879 @@@NoDBException:
1880 @@@PerlDef:
1881 if ($self->{<H::mn:node>}->{<H::DIS|db>}) {
1882 $r = $self->{<H::mn:node>}->{<H::DIS|db>};
1883 } else {
1884 __EXCEPTION{NO_ASSOCIATED_DB_ERR}__;
1885 }
1886 @@Set:
1887 @@@PerlDef:
1888 $self->{<H::mn:node>}->{<H::DIS|db>} = $given;
1889 require Scalar::Util;
1890 Scalar::Util::weaken ($self->{<H::mn:node>}->{<H::DIS|db>});
1891
1892 @Method:
1893 @@Name: disChildElements
1894 @@enDesc:
1895 A list of child elements, with <QUOTE::for> checks.
1896 @@ForpParam:
1897 @@NamedParam:
1898 @@@Name: databaseArg
1899 @@@Type: DISDatabase
1900 @@@enDesc:
1901 A <QUOTE::dis> database.
1902 @@@nullCase:
1903 @@@@enDesc:
1904 The database associated to the document is used.
1905 @@Return:
1906 @@@Type: DISElementList
1907 @@@clsActualType: ManakaiDISElementList
1908 @@@enDesc:
1909 The current snapshot of child nodes.
1910 @@@PerlDef:
1911 $r = bless [], <ClassName::ManakaiDISElementList>;
1912 __DEEP{
1913 C: for my $cn (@{$self-><AG::swcfg21:SWCFGNode
1914 .childNodes>}) {
1915 next C unless $cn-><AG::swcfg21:SWCFGNode
1916 .nodeType> eq '#element';
1917 my $dn;
1918 __CODE{ManakaiNode|getNewReference::
1919 $object => {$cn->{<H::mn:node>}},
1920 $ref => $dn,
1921 $class => {<ClassName::ManakaiDISElement>},
1922 }__;
1923 next C unless $dn-><M::ManakaiDISElement.forMatch>
1924 (undef, $forpArg,
1925 database_arg => $databaseArg);
1926 push @$r, $dn;
1927 }
1928 }__;
1929
1930 @Method:
1931 @@Name: disAllChildElements
1932 @@enDesc:
1933 A list of child elements, without <QUOTE::for> checks.
1934 @@Return:
1935 @@@Type: DISElementList
1936 @@@clsActualType: ManakaiDISElementList
1937 @@@enDesc:
1938 The current snapshot of child nodes.
1939 @@@PerlDef:
1940 $r = bless [], <ClassName::ManakaiDISElementList>;
1941 __DEEP{
1942 C: for my $cn (@{$self-><AG::swcfg21:SWCFGNode
1943 .childNodes>}) {
1944 next C unless $cn-><AG::swcfg21:SWCFGNode
1945 .nodeType> eq '#element';
1946 my $dn;
1947 __CODE{ManakaiNode|getNewReference::
1948 $object => {$cn->{<H::mn:node>}},
1949 $ref => $dn,
1950 $class => {<ClassName::ManakaiDISElement>},
1951 }__;
1952 push @$r, $dn;
1953 }
1954 }__;
1955
1956 @Method:
1957 @@Name: addNamespaceBinding
1958 @@Param:
1959 @@@Name: prefix
1960 @@@Type: DISLang|String
1961 @@Param:
1962 @@@Name: namespaceURI
1963 @@@Type: DISLang|String
1964 @@@nullCase:
1965 @@Return:
1966 @@@PerlDef:
1967 if (defined $namespaceURI) {
1968 $self->{<H::mn:node>}->{<H::swcfg21:nsBinding>}->{$prefix}
1969 = $namespaceURI;
1970 } else {
1971 CORE::delete $self->{<H::mn:node>}->{<H::swcfg21:nsBinding>}
1972 ->{$prefix};
1973 }
1974
1975 @Attr:
1976 @@Name: disNamespaceResolver
1977 @@enDesc:
1978 A namespace resolver code that is called by
1979 <M::swcfg21|SWCFGNode.lookupNamesopaceURI> method
1980 when in-document namespace binding information is not sufficient.
1981 @@Type: DISPerl|CODE
1982 @@Get:
1983 @@@PerlDef:
1984 $r = $self->{<H::mn:node>}->{<H::DIS|disNamespaceResolver>};
1985 @@Set:
1986 @@@PerlDef:
1987 $self->{<H::mn:node>}->{<H::DIS|disNamespaceResolver>} = $given;
1988 ##DISDocument
1989
1990 PropDef:
1991 @QName: DIS|disNamespaceResolver
1992
1993 PropDef:
1994 @QName: db
1995 @enDesc:
1996 Associated <QUOTE::dis> database.
1997 @rdfs:domain: ManakaiDISDocument
1998 @rdfs:range: ManakaiDISDatabase
1999
2000 ## -- Definition object database
2001
2002 IFClsDef:
2003 @IFQName: DISDatabase
2004 @ClsQName: ManakaiDISDatabase
2005
2006 @ClsISA: dp|ManakaiDISDatabasePerl
2007
2008 @enDesc:
2009 Resource database created from <QUOTE::dis> source data.
2010
2011 @Method:
2012 @@Name: getModule
2013 @@Description:
2014 @@@lang:en
2015 @@@@:
2016 Returns a <QUOTE::dis> module definition.
2017 @@Param:
2018 @@@Name: moduleURI
2019 @@@Type: ModuleURI
2020 @@@Description:
2021 @@@@lang:en
2022 @@@@@:
2023 A <QUOTE::dis> module URI reference.
2024 @@Return:
2025 @@@Type: DISModule
2026 @@@clsActualType: ManakaiDISModuleDefinition
2027 @@@Description:
2028 @@@@lang:en
2029 @@@@@:
2030 The module definition.
2031 @@@PerlDef:
2032 if (defined $self->{modDef}->{$moduleURI}) {
2033 $r = $self->{modDef}->{$moduleURI};
2034 } else {
2035 $r = $self->{modDef}->{$moduleURI}
2036 = bless {
2037 uri => $moduleURI,
2038 db => $self,
2039 forp => [],
2040 <H::DIS|typeURI> => <Q::DISCore|Module>,
2041 <H::DIS|revision> => 0,
2042 }, <ClassName::ManakaiDISModuleDefinition>;
2043 require Scalar::Util;
2044 Scalar::Util::weaken ($r->{db});
2045 }
2046
2047 @@Test:
2048 @@@QName: DISDB.getModule.test
2049 @@@PerlDef:
2050 my $db;
2051 __CODE{createDISDBForTest:: $db => $db}__;
2052
2053 my $res = $db-><M::DISDatabase.getModule> ('about:1');
2054
2055 $test->id ('is.type.uri');
2056 $test->assert_true ($res-><M::DISAnyResource.isTypeURI>
2057 (<Q::DISCore|Module>));
2058 $test->assert_true ($res-><M::DISAnyResource.isTypeURI>
2059 (<Q::DISCore|AnyResource>));
2060
2061 $test->id ('revision');
2062 $test->assert_num_equals
2063 (actual_value => $res-><AG::DISAnyResource.revision>,
2064 expected_value => 0);
2065
2066 @Method:
2067 @@Name: getFor
2068 @@Description:
2069 @@@lang:en
2070 @@@@:
2071 Returns a <QUOTE::for> definition object.
2072 @@Param:
2073 @@@Name: forURI
2074 @@@Type: ForURI
2075 @@@Description:
2076 @@@@lang:en
2077 @@@@@:
2078 A <QUOTE::for> URI reference.
2079 @@@nullCase:
2080 @@@@Description:
2081 @@@@@lang:en
2082 @@@@@@:
2083 Defaulted to <Q::ManakaiDOM:all>.
2084 @@Return:
2085 @@@Type: DISFor
2086 @@@clsActualType: ManakaiDISForDefinition
2087 @@@PerlDef:
2088 $forURI = <Q::ManakaiDOM:all> unless defined $forURI;
2089 if (defined $self->{forDef}->{$forURI}) {
2090 $r = $self->{forDef}->{$forURI};
2091 } elsif (defined $self->{<H::DIS|resourceModuleMap>}->{$forURI}) {
2092 __DEEP{
2093 $self-><M::dp|ManakaiDISDatabasePerl.plLoadDISDatabaseModule>
2094 ($self-><M::DIS|DISDatabase.getModule>
2095 (${$self->{<H::DIS|resourceModuleMap>}->{$forURI}}));
2096 }__;
2097 unless (defined $self->{forDef}->{$forURI}) {
2098 __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR::
2099 DIS:uri => {$forURI},
2100 DIS:moduleURI => {${$self->{<H::DIS|resourceModuleMap>}
2101 ->{$forURI}}},
2102 }__;
2103 }
2104 $r = $self->{forDef}->{$forURI};
2105 } else {
2106 $r = $self->{forDef}->{$forURI}
2107 = bless {
2108 uri => $forURI,
2109 isa => {<Q::ManakaiDOM:all> => true},
2110 revISA => {},
2111 db => $self,
2112 <H::DIS|typeURI> => <Q::DISCore|For>,
2113 <H::DIS|revision> => 0,
2114 }, <ClassName::ManakaiDISForDefinition>;
2115 $self->{forDef}->{<Q::ManakaiDOM:all>}->{revISA}->{$forURI} = true;
2116 require Scalar::Util;
2117 Scalar::Util::weaken ($r->{db});
2118 }
2119
2120 @@Test:
2121 @@@QName: DISDB.getFor.test
2122 @@@PerlDef:
2123 my $db;
2124 __CODE{createDISDBForTest:: $db => $db}__;
2125
2126 my $res = $db-><M::DISDatabase.getFor> ('about:1');
2127
2128 $test->id ('is.type.uri');
2129 $test->assert_true ($res-><M::DISAnyResource.isTypeURI>
2130 (<Q::DISCore|For>));
2131 $test->assert_true ($res-><M::DISAnyResource.isTypeURI>
2132 (<Q::DISCore|AnyResource>));
2133
2134 $test->id ('revision');
2135 $test->assert_num_equals
2136 (actual_value => $res-><AG::DISAnyResource.revision>,
2137 expected_value => 0);
2138
2139 @Method:
2140 @@Name: getResource
2141 @@Description:
2142 @@@lang:en
2143 @@@@:
2144 Returns a <QUOTE::dis> resource definition.
2145 @@Param:
2146 @@@Name: resourceURI
2147 @@@Type: ResourceURI
2148 @@@Description:
2149 @@@@lang:en
2150 @@@@@:
2151 A <QUOTE::dis> resource URI reference.
2152 @@@nullCase:
2153 @@@@Description:
2154 @@@@@lang:en
2155 @@@@@@:
2156 Defaulted to <Q::DOMMain:any>.
2157 @@Return:
2158 @@@Type: DISResource
2159 @@@clsActualType: ManakaiDISResourceDefinition
2160 @@@Description:
2161 @@@@lang:en
2162 @@@@@:
2163 The resource definition.
2164 @@@RaiseException:
2165 @@@@@: DIS|RESOURCE_NOT_DEFINED_ERR
2166 @@@@enDesc:
2167 The resource should be included in database submodule but
2168 it is not.
2169 @@@PerlDef:
2170 $resourceURI = <Q::DOMMain:any> unless defined $resourceURI;
2171 my $resURI = $resourceURI;
2172
2173 if (defined $self->{resDef}->{$resURI}) {
2174 $r = $self->{resDef}->{$resURI};
2175 } elsif (defined $self->{<H::DIS|resourceModuleMap>}->{$resURI}) {
2176 __DEEP{
2177 $self-><M::dp|ManakaiDISDatabasePerl.plLoadDISDatabaseModule>
2178 ($self-><M::DIS|DISDatabase.getModule>
2179 (${$self->{<H::DIS|resourceModuleMap>}->{$resURI}}));
2180 }__;
2181 unless (defined $self->{resDef}->{$resURI}) {
2182 __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR::
2183 DIS:uri => {$resURI},
2184 DIS:moduleURI => {${$self->{<H::DIS|resourceModuleMap>}
2185 ->{$resURI}}},
2186 }__;
2187 }
2188 $r = $self->{resDef}->{$resURI};
2189 } else {
2190 $r = $self->{resDef}->{$resURI}
2191 = bless {
2192 uri => $resURI,
2193 aliasURI => {$resURI => true},
2194 db => $self,
2195 forp => [],
2196 seq => -1,
2197 <H::DIS|typeURI> => <Q::DISCore|Resource>,
2198 <H::DIS|revision> => 0,
2199 }, <ClassName::ManakaiDISResourceDefinition>;
2200 require Scalar::Util;
2201 Scalar::Util::weaken ($r->{db});
2202 }
2203
2204 @@Test:
2205 @@@QName: DISDB.getResource.test
2206 @@@PerlDef:
2207 my $db;
2208 __CODE{createDISDBForTest:: $db => $db}__;
2209
2210 my $res = $db-><M::DISDatabase.getResource> ('about:1');
2211
2212
2213 $test->id ('is.type.uri');
2214 $test->assert_true ($res-><M::DISAnyResource.isTypeURI>
2215 (<Q::DISCore|Resource>));
2216 $test->assert_true ($res-><M::DISAnyResource.isTypeURI>
2217 (<Q::DISCore|AnyResource>));
2218
2219 $test->id ('revision');
2220 $test->assert_num_equals
2221 (actual_value => $res-><AG::DISAnyResource.revision>,
2222 expected_value => 0);
2223
2224 @Method:
2225 @@Name: getAnyResource
2226 @@enDesc:
2227 Returns a resource object, either module, <Q::for>, or resource.
2228 @@Param:
2229 @@@Name: resourceURI
2230 @@@Type: ResourceURI
2231 @@@Description:
2232 @@@@lang:en
2233 @@@@@:
2234 A resource URI.
2235 @@@nullCase:
2236 @@@@Description:
2237 @@@@@lang:en
2238 @@@@@@:
2239 Defaulted to <Q::DOMMain:any>.
2240 @@Return:
2241 @@@Type: DIS|DISAnyResource
2242 @@@Description:
2243 @@@@lang:en
2244 @@@@@:
2245 The resource definition.
2246 @@@RaiseException:
2247 @@@@@: DIS|RESOURCE_NOT_DEFINED_ERR
2248 @@@@enDesc:
2249 The resource should be included in database submodule but
2250 it is not.
2251 @@@PerlDef:
2252 $resourceURI = <Q::DOMMain:any> unless defined $resourceURI;
2253 my $resURI = $resourceURI;
2254
2255 if (defined $self->{resDef}->{$resURI}) {
2256 $r = $self->{resDef}->{$resURI};
2257 } elsif (defined $self->{modDef}->{$resURI}) {
2258 $r = $self->{modDef}->{$resURI};
2259 } elsif (defined $self->{forDef}->{$resURI}) {
2260 $r = $self->{forDef}->{$resURI};
2261 } elsif (defined $self->{<H::DIS|resourceModuleMap>}->{$resURI}) {
2262 __DEEP{
2263 $self-><M::dp|ManakaiDISDatabasePerl.plLoadDISDatabaseModule>
2264 ($self-><M::DIS|DISDatabase.getModule>
2265 (${$self->{<H::DIS|resourceModuleMap>}->{$resURI}}));
2266 }__;
2267 if (defined $self->{resDef}->{$resURI}) {
2268 $r = $self->{resDef}->{$resURI};
2269 } elsif (defined $self->{forDef}->{$resURI}) {
2270 $r = $self->{forDef}->{$resURI};
2271 } else {
2272 __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR::
2273 DIS:uri => {$resURI},
2274 DIS:moduleURI => {${$self->{<H::DIS|resourceModuleMap>}
2275 ->{$resURI}}},
2276 }__;
2277 }
2278 } else {
2279 __DEEP{
2280 $r = $self-><M::DIS|DISDatabase.getResource> ($resURI);
2281 }__;
2282 }
2283
2284 @Method:
2285 @@Name: getSourceFile
2286 @@enDesc:
2287 Gets <QUOTE::dis> source document.
2288 @@Param:
2289 @@@Name: fileName
2290 @@@Type: FileURI
2291 @@@enDesc:
2292 A URI reference identifying a file.
2293 @@Return:
2294 @@@Type: DISDocument
2295 @@@clsActualType: ManakaiDISDocument
2296 @@@enDesc:
2297 The <QUOTE::dis> source document.
2298 @@@nullCase:
2299 @@@@enDesc:
2300 No document associated with that <P::fileName>.
2301 @@@PerlDef:
2302 $r = $self->{<H::DIS|sourceFile>}->{$fileName};
2303 @Method:
2304 @@Name: setSourceFile
2305 @@enDesc:
2306 Puts <QUOTE::dis> source document object.
2307 @@Param:
2308 @@@Name: fileName
2309 @@@Type: FileURI
2310 @@@enDesc:
2311 A URI reference identifying a file. If there is already a
2312 source document, then the association has been updated.
2313 @@Param:
2314 @@@Name: doc
2315 @@@Type: DISDocument
2316 @@@clsActualType: ManakaiDISDocument
2317 @@@enDesc:
2318 The document object to set.
2319 @@Return:
2320 @@@PerlDef:
2321 $self->{<H::DIS|sourceFile>}->{$fileName} = $doc;
2322
2323 @Method:
2324 @@Name: loadModule
2325 @@enDesc:
2326 Loads definitions from a <QUOTE::dis> document.
2327 @@Param:
2328 @@@Name: doc
2329 @@@Type: DISDocument
2330 @@@clsActualType: ManakaiDISDocument
2331 @@@enDesc:
2332 The source <QUOTE::dis> document object. Its
2333 <A::ManakaiDISDocument.disDatabase> must be this database.
2334 @@Param:
2335 @@@Name: resolver
2336 @@@Type: DISModuleResolver
2337 @@@enDesc:
2338 The resolver to convert module name into <QUOTE::dis> document object.
2339 @@NamedParam:
2340 @@@Name: onResourceRead
2341 @@@Type:
2342 DISPerl:CODE
2343 @@@enDesc:
2344 An event handler called when a resource is read.
2345 @@@nullCase:
2346 @@@@enDesc:
2347 No event handler is read.
2348 @@NamedParam:
2349 @@@Name: srinfo
2350 @@@Type: DISPerl|HASH
2351 @@@enDesc:
2352 A hash returned by <M::DISDatabase.unloadModule>, to
2353 restore super-resource relationship.
2354 @@@nullCase:
2355 @@@@enDesc:
2356 If it is not the updating.
2357 @@Return:
2358 @@@RaiseException:
2359 @@@@@: NO_MODULE_QNAME_ERR
2360 @@@@enDesc:
2361 The <Q::dis:Module> element must have a <Q::dis:QName> attribute.
2362 @@@RaiseException:
2363 @@@@@: UNABLE_TO_GET_MODULE_ERR
2364 @@@@enDesc:
2365 The implementation is unable to get a module source.
2366 @@@ForDefDupException:
2367 @@@ForDefNoQNameException:
2368 @@@ResDefDupException:
2369 @@@ElementNotAllowedException:
2370 @@@RaiseException:
2371 @@@@@:NO_REQUIRED_ATTR_ERR
2372 @@@@enDesc:
2373 The <Q::dis:Module> element does not have
2374 <Q::dis:Namespace> attribute.
2375 @@@PerlDef:
2376 $resolver = bless $resolver, <ClassName::ManakaiDISModuleResolver>
2377 if ref $resolver eq 'CODE';
2378 ## -- Module Name, URI
2379 my $mod_node;
2380 my $mod_name_node;
2381 __DEEP{
2382 $mod_node = $doc-><AG::DISDocument.moduleElement>;
2383 $mod_name_node = $mod_node-><M::SWCFGNode.getAttributeNS>
2384 (<Q::dis:>, 'QName');
2385 unless ($mod_name_node) {
2386 __UNDEEP{
2387 __EXCEPTION{NO_MODULE_QNAME_ERR::
2388 DIS:sourceNode => {$mod_node},
2389 }__;
2390 }__;
2391 }
2392 $mod_name_node = bless $mod_name_node, <ClassName::ManakaiDISElement>
2393 if $mod_name_node->isa (<ClassName::swcfg21:ManakaiSWCFGElement
2394 >);
2395 my $mod_name_uri = $mod_name_node
2396 -><AG::DISElement.qnameValueURI>;
2397 my $mod = $self-><M::DISDatabase.getModule>
2398 ($mod_name_uri);
2399
2400 unless ($mod-><AG::DISAnyResource.isDefined>) {
2401 ## -- Initializes Module Definition Object
2402 my $v = $mod_name_node-><AG::DISElement.qnameValueLocalName>;
2403 __CODE{DISPerl|HashStringRef::
2404 $result => {$mod->{localName}},
2405 $given => {$v},
2406 }__;
2407 my $ns = $mod_name_node-><AG::DISElement.qnameValueNamespaceURI>;
2408 __CODE{DISPerl|HashStringRef::
2409 $result => {$mod->{namespaceURI}},
2410 $given => {$ns},
2411 }__;
2412 $mod->{src} = $mod_node;
2413 $mod->{<Q::DIS|isDefined>} = true;
2414 $self-><M::DISDatabase.setSourceFile> ($mod_name_uri => $doc);
2415
2416 $mod-><AS::DIS|ManakaiDISModuleDefinition.targetNamespaceURI>
2417 ($mod_node-><AG::DISModuleElement.definingNamespaceURI>);
2418
2419 __CODE{dv:createValue::
2420 $result => {$mod->{<Q::DIS:sourceFile>}},
2421 $value => {$doc-><M::SWCFGNode.flag> (<Q::swcfg21:fileName>)},
2422 $base_type => {<Q::DISCore:String>},
2423 $type => {<Q::DISCore:String>},
2424 $name => {<Q::DIS:sourceFile>},
2425 }__;
2426 __CODE{setRevision:: $resource => $mod}__;
2427
2428 ## -- Loads "for" definition
2429 my $root_elements
2430 = $doc-><M::DISDocument.disAllChildElements>;
2431 R: for my $el (@$root_elements) {
2432 next R unless $el-><AG::SWCFGElement
2433 .expandedURI> eq <Q::dis:ForDef>;
2434 $self-><M::DISDatabase.loadFor>
2435 ($mod, $el, srinfo => $srinfo);
2436 }
2437
2438 ## -- Loads "for all"
2439 my $rmod = $self-><M::DISDatabase.getModule>
2440 ($mod_name_uri);
2441 unless ($rmod-><AG::DISAnyResource.isDefined>) {
2442 my $rdoc = $resolver-><M::DISModuleResolver.uriToDocument>
2443 ($self, $rmod-><AG::DISAnyResource.uri>,
2444 $mod-><AG::DISAnyResource.namespaceURI>,
2445 $mod-><AG::DISAnyResource.localName>);
2446 unless ($rdoc) {
2447 __UNDEEP{
2448 __EXCEPTION{UNABLE_TO_GET_MODULE_ERR::
2449 DIS:uri => {$rmod-><AG::DISAnyResource.uri>},
2450 DIS:namespaceURI =>
2451 {$mod-><AG::DISAnyResource.namespaceURI>},
2452 DIS:localName => {$mod-><AG::DISAnyResource.localName>},
2453 DIS:sourceNode => {$mod-><AG::DISAnyResource.sourceElement>},
2454 }__;
2455 }__;
2456 }
2457 $self-><M::DISDatabase.loadModule>
2458 ($rdoc, $resolver,
2459 on_resource_read => $onResourceRead,
2460 srinfo => $srinfo);
2461 } else { # if "for all" loaded
2462 $rmod-><M::DIS|DISResourceProp.getPropertyBoolean>
2463 (<Q::dis:In>);
2464 ## Dummy to ensure the module is loaded
2465 }
2466
2467 ## -- Loads Required Modules
2468 my $req_node = $mod_node-><AG::DISModuleElement.requireElement>;
2469 for my $rm (@{$req_node-><M::DISElement.disAllChildElements>}) {
2470 next unless $rm-><AG::SWCFGElement.expandedURI> eq <Q::dis:Module>;
2471 my ($uri, $nuri, $ln);
2472 my $mqn = $rm-><M::SWCFGNode.getAttributeNS> (<Q::dis:>, 'QName');
2473 if ($mqn) {
2474 my $mqv = $mqn-><M::SWCFGNode.value>;
2475 my $mqp = ($mqn->isa (<ClassName::swcfg21:ManakaiSWCFGElement
2476 >)
2477 ? (bless $mqn, <ClassName::ManakaiDISElement>) : $mqn)
2478 -><M::NSResolverDIS.qnameToPair> ($mqv, node => $mqn);
2479 ($nuri, $ln) = @$mqp;
2480 } else {
2481 my $mn = $rm-><M::SWCFGNode.getAttributeNS> (<Q::dis:>, 'Name');
2482 if ($mn) {
2483 $nuri = $mod-><AG::DISAnyResource.namespaceURI>;
2484 $ln = $mn-><M::SWCFGNode.value>;
2485 } else {
2486 $nuri = $mod-><AG::DISAnyResource.namespaceURI>;
2487 $ln = $mod-><AG::DISAnyResource.localName>;
2488 }
2489 }
2490 my $rmod = $self-><M::DISDatabase.getModule>
2491 ($nuri . $ln);
2492 $mod-><M::DISModule.addReferringModuleURI> ($nuri.$ln);
2493 unless ($rmod-><AG::DISAnyResource.isDefined>) {
2494 my $rdoc = $resolver-><M::DISModuleResolver.uriToDocument>
2495 ($self, $rmod-><AG::DISAnyResource.uri>,
2496 $nuri, $ln);
2497 unless ($rdoc) {
2498 __UNDEEP{
2499 __EXCEPTION{UNABLE_TO_GET_MODULE_ERR::
2500 DIS:uri => {$rmod-><AG::DISAnyResource.uri>},
2501 DIS:namespaceURI => {$nuri},
2502 DIS:localName => {$ln},
2503 DIS:sourceNode => {$rm},
2504 }__;
2505 }__;
2506 }
2507 $self-><M::DISDatabase.loadModule>
2508 ($rdoc, $resolver,
2509 on_resource_read => $onResourceRead,
2510 srinfo => $srinfo);
2511 }
2512 } # Child Module elements
2513
2514 ## -- Loads child resources
2515 $root_elements = $doc-><M::DISDocument.disChildElements>
2516 (database_arg => $self);
2517 for my $el (@$root_elements) {
2518 if ($el-><AG::DISElement.isResourceElement>) {
2519 $self-><M::DISDatabase.loadResource>
2520 ($mod, null, null, $el,
2521 on_resource_read => $onResourceRead,
2522 srinfo => $srinfo);
2523 } else {
2524 my $et = $el-><AG::SWCFGElement.expandedURI>;
2525 if ({
2526 <Q::dis:ForDef> => 1,
2527 <Q::dis:Module> => 1,
2528 <Q::dis:ImplNote> => 1,
2529 }->{$et}) {
2530 #
2531 } else {
2532 __UNDEEP{
2533 __EXCEPTION{ELEMENT_NOT_ALLOWED_ERR::
2534 DIS:elementType => {$et},
2535 DIS:sourceNode => {$el},
2536 DIS:uri => {$mod-><AG::anyres.uri>},
2537 }__;
2538 }__;
2539 }
2540 } # element types
2541 }
2542
2543 my $dn = $mod_node-><M::SWCFGNode.getAttributeNS>
2544 (<Q::dis:>, 'Namespace');
2545 unless ($dn and defined $dn-><M::SWCFGNode.value>) {
2546 __UNDEEP{
2547 __EXCEPTION{NO_REQUIRED_ATTR_ERR::
2548 DIS:elementType => {<Q::dis:Namespace>},
2549 DIS:sourceNode => {$mod_node},
2550 }__;
2551 }__;
2552 }
2553 } # Unless this module loaded
2554 }__; # Deep
2555
2556 @Method:
2557 @@Name: loadFor
2558 @@enDesc:
2559 Loads definition of a <QUOTE::for> from a <Q::dis:ForDef> element.
2560 @@Param:
2561 @@@Name: mod
2562 @@@Type: DISModule
2563 @@@clsActualType: ManakaiDISModuleDefinition
2564 @@@enDesc:
2565 The module in which the <QUOTE::for> to load is defined.
2566 @@Param:
2567 @@@Name: el
2568 @@@Type: DISElement
2569 @@@enDesc:
2570 The source <QUOTE::dis> <Q::dis:ForDef> element object.
2571 @@NamedParam:
2572 @@@Name: srinfo
2573 @@@Type: DISPerl|HASH
2574 @@@enDesc:
2575 A hash returned by <M::DISDatabase.unloadModule>, to
2576 restore super-resource relationship.
2577 @@@nullCase:
2578 @@@@enDesc:
2579 If it is not the updating.
2580 @@Return:
2581 @@@ForDefDupException:
2582 @@@ForDefNoQNameException:
2583 @@@ElementNotAllowedException:
2584 @@@PerlDef:
2585 __DEEP{
2586 my $qn_node = $el-><M::SWCFGNode.getAttributeNS> (<Q::dis:>, 'QName');
2587 unless ($qn_node) {
2588 __UNDEEP{
2589 __EXCEPTION{NO_FOR_QNAME_ERR::
2590 DIS:sourceNode => {$el},
2591 }__;
2592 }__;
2593 }
2594 $qn_node = bless $qn_node, <ClassName::ManakaiDISElement>
2595 if $qn_node->isa (<ClassName::swcfg21:ManakaiSWCFGElement
2596 >);
2597 my $qn_uri = $qn_node-><AG::DISElement.qnameValueURI>;
2598 my $for = $self-><M::DISDatabase.getFor> ($qn_uri);
2599
2600 unless ($for-><AG::DISAnyResource.isDefined>) {
2601 ## -- Initializes "For" Definition Object
2602 $for->{src} = $el;
2603 $for->{<H::DIS|isDefined>} = true;
2604 $for->{<H::DIS|definingModule>} = \ ($mod->{uri});
2605 $mod-><M::DISModule.addForResource> ($for);
2606
2607 for my $ce (@{$el-><M::ManakaiDISElement.disAllChildElements>}) {
2608 my $xn = $ce-><AG::SWCFGElement.expandedURI>;
2609 if ($xn eq <Q::dis:ISA> or $xn eq <Q::dis:Implement>) {
2610 my $sfor = $self-><M::DISDatabase.getFor>
2611 ($ce-><AG::DISElement.qnameValueURI>);
2612 $for-><M::DISFor.addISA> ($sfor);
2613 $sfor-><AS::DISAnyResource.isReferred> ($ce);
2614 ## TODO: warn if dis:Implement
2615 } elsif ({
2616 <Q::dis:Description> => 1,
2617 <Q::dis:ImplNote> => 1,
2618 <Q::dis:FullName> => 1,
2619 <Q::dis:QName> => 1,
2620 }->{$xn}) {
2621 #
2622 } else {
2623 __UNDEEP{
2624 __EXCEPTION{ELEMENT_NOT_ALLOWED_ERR::
2625 DIS:elementType => {$xn},
2626 DIS:sourceNode => {$ce},
2627 DIS:uri => {$qn_uri},
2628 }__;
2629 }__;
2630 }
2631 }
2632
2633 for (keys %{$srinfo->{for}->{$qn_uri}->{supOf} or {}}) {
2634 my $subfor = $self-><M::DISDatabase.getFor> ($_);
2635 $subfor-><M::DISFor.addISA> ($for, srinfo => $srinfo);
2636 }
2637 for (keys %{$srinfo->{for}->{$qn_uri}->{subOf} or {}}) {
2638 my $supfor = $self-><M::DISDatabase.getFor> ($_);
2639 $for-><M::DISFor.addISA> ($supfor, srinfo => $srinfo);
2640 }
2641 } else {
2642 __UNDEEP{
2643 __EXCEPTION{FOR_ALREADY_DEFINED_ERR::
2644 DIS:sourceNode => {$el},
2645 DIS:anotherSourceNode => {$el},
2646 DIS:uri => {$qn_uri},
2647 }__;
2648 }__;
2649 } # isDefine?
2650 }__; # DEEP
2651
2652 @Method:
2653 @@Name: loadResource
2654 @@enDesc:
2655 Loads definition of a <QUOTE::dis> resource from a
2656 <Q::dis:ResourceDef> element.
2657 @@Param:
2658 @@@Name: mod
2659 @@@Type: DISModule
2660 @@@enDesc:
2661 The module in which the resource to load is defined.
2662 @@Param:
2663 @@@Name: parentResource
2664 @@@Type: DISResource
2665 @@@enDesc:
2666 The (static) parent resource in which the resource to load is defined.
2667 @@@nullCase:
2668 @@@@enDesc:
2669 The resource to load is a root resource, i.e. <P::el> is
2670 a direct child of the document node.
2671 @@Param:
2672 @@@Name: dynParent
2673 @@@Type: DISResource
2674 @@@enDesc:
2675 The dynamic parent resource of the resource to load.
2676 @@@nullCase:
2677 @@@@enDesc:
2678 If this resource is a root resource, i.e. <P::el> is
2679 a direct child of the document node.
2680 @@Param:
2681 @@@Name: el
2682 @@@Type: DISElement
2683 @@@clsActualType: ManakaiDISElement
2684 @@@enDesc:
2685 The source <QUOTE::dis> <Q::dis:ResourceDef> element object.
2686 @@ForpParam:
2687 @@NamedParam:
2688 @@@Name: onResourceRead
2689 @@@Type:
2690 DISPerl:CODE
2691 @@@enDesc:
2692 An event handler called when a resource is read.
2693 @@@nullCase:
2694 @@@@enDesc:
2695 No event handler is read.
2696 @@NamedParam:
2697 @@@Name: srinfo
2698 @@@Type: DISPerl|HASH
2699 @@@enDesc:
2700 A hash returned by <M::DISDatabase.unloadModule>, to
2701 restore super-resource relationship.
2702 @@@nullCase:
2703 @@@@enDesc:
2704 If it is not the updating.
2705 @@Return:
2706 @@@ResDefDupException:
2707 @@@ElementNotAllowedException:
2708 @@@RaiseException:
2709 @@@@@: NO_RDF_TYPE_ERR
2710 @@@@enDesc:
2711 There is a resorce that does not have any <Q::rdf:type>
2712 attribute.
2713 @@@PerlDef:
2714 $forpArg ||= [];
2715 __DEEP{
2716 ## -- Node names
2717 my @res_uri;
2718
2719 ## Unique resource identifier generated from node id
2720 my $node_id = $el-><AG::SWCFGNode.nodeIDRef>;
2721 my $node_uri;
2722 __CODE{tfpurisToURI:: $turi => {$$node_id},
2723 $forp => $forpArg, $uri => $node_uri}__;
2724
2725 my $al_node = $el-><M::DISElement.disGetAttribute>
2726 (<Q::dis:AliasFor>,
2727 forp_arg => $forpArg,
2728 database_arg => $self);
2729 my $al_canon_uri;
2730 if ($al_node) {
2731 $al_canon_uri = $al_node->qname_value_uri;
2732 }
2733
2734 ## User defined resource identifiers
2735 my $qn_node = $el-><M::ManakaiDISElement.disGetAttribute>
2736 (<Q::dis:QName>,
2737 forp_arg => $forpArg,
2738 database_arg => $self);
2739 my $res;
2740 ALD: {
2741 if ($qn_node) {
2742 my $qn_urif = $qn_node-><AG::ManakaiDISElement.qnameValueURI>;
2743 push @res_uri, $qn_urif;
2744 $res = $self-><M::DISDatabase.getResource> ($qn_urif);
2745 if ($res-><AG::DISAnyResource.isDefined>) {
2746 last ALD if defined $al_canon_uri and
2747 $res->{aliasURI}->{$al_canon_uri};
2748 __UNDEEP{
2749 __EXCEPTION{RESOURCE_ALREADY_DEFINED_ERR::
2750 DIS:uri => {$qn_urif},
2751 DIS:sourceNode => {$qn_node},
2752 DIS:anotherSourceNode => {$res->{src}},
2753 }__;
2754 }__;
2755 }
2756 my $v = $qn_node-><AG::DIS|DISElement.qnameValueLocalName>;
2757 __CODE{DISPerl|HashStringRef::
2758 $result => {$res->{localName}},
2759 $given => {$v},
2760 }__;
2761 my $ns = $qn_node-><AG::DIS|DISElement.qnameValueNamespaceURI>;
2762 __CODE{DISPerl|HashStringRef::
2763 $result => {$res->{namespaceURI}},
2764 $given => {$ns},
2765 }__;
2766 } else { ## Anonymous or local
2767 my $n_node = $el-><M::ManakaiDISElement.disGetAttribute>
2768 (<Q::dis:Name>,
2769 forp_arg => $forpArg,
2770 database_arg => $self);
2771 if ($n_node) {
2772 if ($parentResource) {
2773 my $puri = $parentResource->{uri};
2774 my $ru;
2775 my $ruf;
2776 my $ln = $n_node-><M::swcfg21:SWCFGNode
2777 .value>;
2778 __CODE{getChildResourceURI:: $parentURI => $puri,
2779 $localName => $ln,
2780 $result => $ru}__;
2781 $ruf = $ru;
2782 push @res_uri, $ruf;
2783 $res = $self-><M::DISDatabase.getResource> ($ruf);
2784 my $v = $n_node-><M::SWCFGNode.value>;
2785 __CODE{DISPerl|HashStringRef::
2786 $result => {$res->{localName}},
2787 $given => {$v},
2788 }__;
2789 $res->{<H::DIS|isAnon>} = true;
2790 } else { ## Root local name resource
2791 my $ln = $n_node-><M::SWCFGNode.value>;
2792 my $ns_uri = $mod-><AG::DISAnyResource.sourceElement>
2793 -><AG::DISModuleElement.definingNamespaceURI>;
2794 my $qn_urif = $ns_uri . $ln;
2795 push @res_uri, $qn_urif;
2796 $res = $self-><M::DISDatabase.getResource> ($qn_urif);
2797 if ($res-><AG::DISAnyResource.isDefined>) {
2798 last ALD if defined $al_canon_uri and
2799 $res->{aliasURI}->{$al_canon_uri};
2800 __UNDEEP{
2801 __EXCEPTION{RESOURCE_ALREADY_DEFINED_ERR::
2802 DIS:uri => {$res-><AG::DISAnyResource.uri>},
2803 DIS:sourceNode => {$n_node},
2804 DIS:anotherSourceNode
2805 => {$res-><AG::DISAnyResource.sourceElement>},
2806 }__;
2807 }__;
2808 }
2809 __CODE{DISPerl|HashStringRef::
2810 $result => {$res->{namespaceURI}},
2811 $given => {$ns_uri},
2812 }__;
2813 __CODE{DISPerl|HashStringRef::
2814 $result => {$res->{localName}},
2815 $given => {$ln},
2816 }__;
2817 }
2818 } else {
2819 push @res_uri, $node_uri;
2820 $res = $self-><M::DISDatabase.getResource> ($node_uri);
2821 $res->{<H::DIS|isAnon>} = true;
2822 }
2823 } # anon
2824 $res->{forp} = $forpArg;
2825 $res->{src} = $el;
2826 $res->{<H::DIS|definingModule>} = \ ($mod->{uri});
2827 $res-><AS::DIS|ManakaiDISResourceDefinition.parentResource>
2828 ($parentResource) if $parentResource;
2829 $res-><AS::DIS|ManakaiDISResourceDefinition.dynamicParentResource>
2830 ($dynParent) if $dynParent;
2831 unless ($res->{uri} eq $node_uri) {
2832 push @res_uri, $node_uri;
2833 my $nu_res = $self-><M::DISDatabase.getResource> ($node_uri);
2834 $res-><M::DISResource.mergeAsAlias> ($nu_res);
2835 }
2836 $res->{seq} = $self->{seq}++;
2837 $res-><AS::DISAnyResource.sourceNodeIDRef> ($node_id);
2838 __CODE{setRevision:: $resource => $res}__;
2839 $mod-><M::DISModule.addResourceURI> ($_) for @res_uri;
2840
2841 ## -- Alias
2842 if ($al_node) {
2843 my $canon_res = $self-><M::DISDatabase.getResource> ($al_canon_uri);
2844 $canon_res-><AS::DISAnyResource.isReferred> ($al_node);
2845 $canon_res-><M::DISResource.mergeAsAlias>
2846 ($res, node => $al_node, no_equality_check => true);
2847 $res = $canon_res;
2848 } else {
2849 $res->{<H::DIS|isDefined>} = true;
2850 }
2851 } # ALD
2852
2853 ## -- Registers as child
2854 $parentResource-><M::DIS|ManakaiDISResourceDefinition
2855 .addChildResource> ($res)
2856 if $parentResource;
2857 $dynParent-><M::DIS|ManakaiDISResourceDefinition
2858 .addDynamicChildResource> ($res)
2859 if $dynParent;
2860
2861 my $is_multires = false;
2862 my @props;
2863 my @cres;
2864 my @ce0 = @{$el-><M::DISElement.disChildElements>
2865 (forp_arg => $forpArg,
2866 database_arg => $self)};
2867 my $has_type = $al_node;
2868 while (@ce0) {
2869 my $ce = shift @ce0;
2870 if ($ce-><M::DISElement.elementTypeMatch>
2871 (<Q::DISCore|resourceType>, database_arg => $self,
2872 srinfo => $srinfo) or
2873 $ce-><M::DISElement.elementTypeMatch> (<Q::rdf:type>,
2874 database_arg => $self,
2875 srinfo => $srinfo)) {
2876 ## TODO: Remove this.
2877 $has_type = true;
2878 my $type_uri = $ce-><AG::DISElement.qnameValueURI>;
2879 my $type = $self-><M::DISDatabase.getResource> ($type_uri);
2880 $res-><M::DISAnyResource.addTypeURI> ($type_uri,
2881 srinfo => $srinfo);
2882 $type-><AS::DISAnyResource.isReferred> ($ce);
2883 if ($type-><M::DISResource.isSubsetOfURI>
2884 (<Q::dis:MultipleResource>,
2885 srinfo => $srinfo)) {
2886 $is_multires = true;
2887 }
2888 } elsif ($ce-><M::DISElement.elementTypeMatch>
2889 (<Q::dis:subsetOf>,
2890 database_arg => $self,
2891 srinfo => $srinfo)) {
2892 my $sres = $self-><M::DISDatabase.getResource>
2893 ($ce->qname_value_uri);
2894 $res-><M::DISResource.addSuperResource> ($sres, srinfo => $srinfo);
2895 } elsif ($ce-><AG::DISElement.isResourceElement>) {
2896 push @cres, $ce;
2897 } elsif ($ce-><M::DISElement.elementTypeMatch>
2898 (<Q::dis:dataType>,
2899 database_arg => $self,
2900 srinfo => $srinfo)) {
2901 my $uri = $ce-><AG::DISElement.qnameValueURI>;
2902 __CODE{dv:createURI::
2903 $uri => $uri,
2904 $result => {$res->{<Q::dis:dataType>}},
2905 $name => {$ce-><AG::SWCFGElement.expandedURI>},
2906 }__;
2907 my $type = $self-><M::DISDatabase.getResource> ($uri);
2908 $type-><AS::DISAnyResource.isReferred> ($ce);
2909 } elsif ($ce-><M::DISElement.elementTypeMatch>
2910 (<Q::dis:multipleProperties>,
2911 database_arg => $self,
2912 srinfo => $srinfo)) {
2913 my $uri = $ce-><AG::DISElement.qnameValueURI>;
2914 __CODE{dv:createURI::
2915 $uri => $uri,
2916 $result => {$res->{<Q::dis:multipleProperties>}},
2917 $name => {$ce-><AG::SWCFGElement.expandedURI>},
2918 }__;
2919 my $type = $self-><M::DISDatabase.getResource> ($uri);
2920 $type-><AS::DISAnyResource.isReferred> ($ce);
2921 } else {
2922 ## Property and invalid element is not checked, since not
2923 ## all property definitions has loaded at this stage.
2924 push @props, $ce;
2925 }
2926 } # @ce0
2927
2928 unless ($has_type) {
2929 __UNDEEP{__EXCEPTION{NO_RDF_TYPE_ERR::
2930 DIS:uri => {$res->{uri}},
2931 DIS:sourceNode => {$el},
2932 }__}__;
2933 }
2934
2935 my $srres = $srinfo->{resource}->{$res-><AG::DISAnyResource.uri>};
2936 F: for my $auri (keys %{$srres->{aliasURI} or {}}) {
2937 next F unless $srres->{aliasURI}->{$auri};
2938 $res->{aliasURI}->{$auri} = true;
2939 $self->{resDef}->{$auri} = $res;
2940 A: for (keys %{$res->{subOf} or {}}) {
2941 next A unless $res->{subOf}->{$_};
2942 my $s = $self-><M::DISDatabase.getResource> ($_);
2943 $s->{supOf}->{$auri} = true;
2944 }
2945 A: for (keys %{$res->{supOf} or {}}) {
2946 next A unless $res->{supOf}->{$_};
2947 my $s = $self-><M::DISDatabase.getResource> ($_);
2948 $s->{subOf}->{$auri} = true;
2949 }
2950 }
2951 F: for my $suri (keys %{$srres->{supOf} or {}}) {
2952 next F unless $srres->{supOf}->{$suri};
2953 my $sres = $self-><M::DISDatabase.getResource> ($suri);
2954 $sres-><M::DISResource.addSuperResource> ($res, srinfo => $srinfo);
2955 }
2956 F: for my $suri (keys %{$srres->{subOf} or {}}) {
2957 next F unless $srres->{subOf}->{$suri};
2958 my $sres = $self-><M::DISDatabase.getResource> ($suri);
2959 $res-><M::DISResource.addSuperResource> ($sres, srinfo => $srinfo);
2960 }
2961
2962 ## -- Child resources
2963 if (not $is_multires and not $al_node) {
2964 for my $re (@cres) {
2965 $self-><M::ManakaiDISDatabase.loadResource>
2966 ($mod, $res, $res, $re,
2967 forp_arg => $forpArg,
2968 on_resource_read => $onResourceRead,
2969 srinfo => $srinfo);
2970 }
2971 }
2972
2973 ## -- Multiple representations
2974 if ($is_multires) {
2975 for my $pe (@props) {
2976 if ($pe-><M::ManakaiDISElement.elementTypeMatch>
2977 (<Q::dis:resourceFor>,
2978 database_arg => $self,
2979 srinfo => $srinfo)) {
2980 my $for_uri = $pe-><AG::ManakaiDISElement.qnameValueURI>;
2981 my $for = $self-><M::ManakaiDISDatabase.getFor> ($for_uri);
2982 $for-><AS::DISAnyResource.isReferred> ($pe);
2983 $self-><M::ManakaiDISDatabase.loadResource>
2984 ($mod, $parentResource, $res, $el,
2985 forp_arg => [@{$forpArg}, $for_uri],
2986 on_resource_read => $onResourceRead,
2987 srinfo => $srinfo);
2988 }
2989 }
2990 }
2991 ($onResourceRead or sub {})->($self, $res);
2992 }__; # DEEP
2993
2994 @Method:
2995 @@Name: readProperties
2996 @@enDesc:
2997 Reads property values in the source tree and
2998 removes the source tree from the database.
2999 @@NamedParam:
3000 @@@Name: onResourceRead
3001 @@@Type:
3002 DISPerl:CODE
3003 @@@enDesc:
3004 An event handler called when a resource is read.
3005 @@@nullCase:
3006 @@@@enDesc:
3007 No event handler is read.
3008 @@NamedParam:
3009 @@@Name: implementation
3010 @@@Type: DOMImpl
3011 @@@enDesc:
3012 The <IF::DOMImpl> object to which the database belongs.
3013 It might be used to create property value objects.
3014 @@Return:
3015 @@@RaiseException:
3016 @@@@@: UNSUPPORTED_ELEMENT_TYPE_ERR
3017 @@@@enDesc:
3018 There is an element whose element type is not supported.
3019 @@@PerlDef:
3020 __DEEP{
3021 F: for my $fd (values %{$self->{modDef}},
3022 values %{$self->{forDef}},
3023 values %{$self->{resDef}}) {
3024 next F if $fd->isa (<ClassName::ManakaiDISModuleLite>);
3025 if ($fd-><AG::DISAnyResource.isDefined>) {
3026 $fd-><M::DISAnyResource.readProperties>
3027 (on_resource_read => $onResourceRead,
3028 implementation => $implementation);
3029 }
3030 }
3031 CORE::delete $self->{<H::DIS|sourceFile>};
3032 }__;
3033
3034 @Method:
3035 @@Name: checkUndefinedResource
3036 @@enDesc:
3037 Checks whether there is referred but undefined resource or not.
3038 @@Return:
3039 @@@RaiseException:
3040 @@@@@: FOR_NOT_DEFINED_ERR
3041 @@@@enDesc:
3042 There is a <QUOTE::for> that is referred but not defined.
3043 @@@RaiseException:
3044 @@@@@: RESOURCE_NOT_DEFINED_ERR
3045 @@@@enDesc:
3046 There is a resource that is referred but not defined.
3047 @@@PerlDef:
3048 for my $fd (values %{$self->{forDef}}) {
3049 if (my $ref = $fd-><AG::DISAnyResource.isReferred> and
3050 not $fd-><AG::DISAnyResource.isDefined>) {
3051 __EXCEPTION{FOR_NOT_DEFINED_ERR::
3052 DIS:uri => {$fd-><AG::DISAnyResource.uri>},
3053 DIS:sourceNodePath => {$ref},
3054 }__;
3055 }
3056 }
3057 for my $fd (values %{$self->{resDef}}) {
3058 if (my $ref = $fd-><AG::DISAnyResource.isReferred> and
3059 not $fd-><AG::DISAnyResource.isDefined>) {
3060 __EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
3061 DIS:uri => {$fd-><AG::DISAnyResource.uri>},
3062 DIS:sourceNodePath => {$ref},
3063 }__;
3064 }
3065 }
3066
3067 @Method:
3068 @@Name: unloadModule
3069 @@enDesc:
3070 Removes a module and resources defined in the module
3071 from the database.
3072 @@Param:
3073 @@@Name: module
3074 @@@Type: DISModule
3075 @@@enDesc:
3076 The module to remove.
3077 @@NamedParam:
3078 @@@Name: srinfo
3079 @@@Type: DISPerl|HASH
3080 @@@enDesc:
3081 A hash returned by <M::DISDatabase.unloadModule>, to
3082 restore super-resource relationship later. The hash
3083 returned by the method is built based on this value.
3084 @@@nullCase:
3085 @@@@enDesc:
3086 If it is not the updating.
3087 @@Return:
3088 @@@Type: DISPerl|HASH
3089 @@@enDesc:
3090 {LI:: <CODE::resource> or <CODE::for>:::
3091
3092 {LI:: <VAR::Resource URI>:::
3093
3094 {LI:: <CODE::supOf>:::
3095
3096 - <VAR::Superset URI>::: A <DOM::true> value
3097
3098 where <VAR::resource URI> is a URI of the resource
3099 (either canonical URI or an alias URI defined within
3100 the module) and <VAR::superset URI> is a URI
3101 from the list of superset URI of the resource minus
3102 the list of alias URIs (including the canonical URI)
3103 of the resource.
3104
3105 }
3106
3107 {LI:: <CODE::aliasURI>:::
3108
3109 - <VAR::Alias URI>::: A <DOM::true> value
3110
3111 where <VAR::alias URI> is an alias URI of the resource
3112 defined by other module.
3113
3114 }
3115 }
3116 }
3117 @@@PerlDef:
3118 __DEEP{
3119 $r = $srinfo || {};
3120
3121 ## -- |For|s
3122 F: for my $for (@{$module-><M::DISModule.getForResourceList>}) {
3123 my $uri = $for-><AG::DISAnyResource.uri>;
3124 A: for (%{$for->{ISA} or {}}) {
3125 next A unless $for->{ISA}->{$_};
3126 my $sfor = $self-><M::DISDatabase.getFor> ($_);
3127 next A unless $sfor;
3128 delete $sfor->{revISA}->{$uri};
3129 }
3130 A: for (%{$for->{revISA} or {}}) {
3131 next A unless $for->{revISA}->{$_};
3132 my $sfor = $self-><M::DISDatabase.getFor> ($_);
3133 next A unless $sfor;
3134 delete $sfor->{ISA}->{$uri};
3135 $r->{for}->{$uri}->{supOf}->{$_} = true;
3136 }
3137 delete $self->{forDef}->{$uri};
3138 delete $self->{<H::DIS|resourceModuleMap>}->{$uri};
3139 } # F
3140
3141 ## -- Resources
3142 my @res_list = map {
3143 [$_, $self-><M::DISDatabase.getResource> ($_)]
3144 } @{$module-><M::DISModule.getResourceURIList>};
3145 my %res_list = map {$_->[0] => true} @res_list;
3146 for my $ur (@res_list) {
3147 my $uri = $ur->[0];
3148 my $res = $ur->[1];
3149 my $owner = $res-><AG::DISAnyResource.ownerModule>;
3150 if (defined $owner and $owner eq $module) {
3151 ## Non-alias
3152 my %alias;
3153 my %sub = %{$res->{supOf} or {}};
3154 A: for (keys %{$res->{aliasURI} or {}}) {
3155 next A unless $res->{aliasURI}->{$_};
3156 $alias{$_} = true;
3157 delete $sub{$_} if $res->{aliasURI}->{$_};
3158 $r->{resource}->{$uri}->{supOf} = \%sub;
3159 unless ($res_list{$_}) {
3160 ## Defined by other module
3161 $r->{resource}->{$uri}->{aliasURI}->{$_} = true;
3162 }
3163 }
3164 A: for (keys %{$res->{subOf} or {}}) {
3165 next A unless $res->{aliasURI}->{$_};
3166 my $sres = $self-><M::DISDatabase.getResource> ($_);
3167 next A unless $sres;
3168 delete $res->{supOf}->{$_} for keys %alias;
3169 }
3170 A: for (keys %{$res->{supOf} or {}}) {
3171 next A unless $res->{aliasURI}->{$_};
3172 my $sres = $self-><M::DISDatabase.getResource> ($_);
3173 next A unless $sres;
3174 delete $res->{subOf}->{$_} for keys %alias;
3175 }
3176 A: for (keys %alias) {
3177 delete $self->{resDef}->{$_};
3178 delete $self->{<H::DIS|resourceModuleMap>}->{$_};
3179 }
3180 } else {
3181 ## Alias
3182 delete $res->{aliasURI}->{$uri};
3183 delete $res->{subOf}->{$uri};
3184 delete $res->{supOf}->{$uri};
3185 A: for (keys %{$res->{subOf} or {}}) {
3186 next A unless $res->{subOf}->{$_};
3187 my $sres = $self-><M::DISDatabase.getResource> ($_);
3188 next A unless $sres;
3189 delete $sres->{supOf}->{$uri};
3190 }
3191 A: for (keys %{$res->{supOf} or {}}) {
3192 next A unless $res->{supOf}->{$_};
3193 my $sres = $self-><M::DISDatabase.getResource> ($_);
3194 next A unless $sres;
3195 delete $sres->{subOf}->{$uri};
3196 }
3197 delete $self->{resDef}->{$uri};
3198 delete $self->{<H::DIS|resourceModuleMap>}->{$uri};
3199 }
3200 }
3201
3202 ## -- Keys
3203 my $v = $module->{<H::dp|plHashKey>};
3204 K: for my $scope (keys %{$v or {}}) {
3205 my $ks = $self-><M::DISDatabase.getResource> ($scope);
3206 L: for my $key (keys %{$v->{$scope} or {}}) {
3207 next L unless $v->{$scope}->{$key};
3208 delete $ks->{<H::dp|plHashKey>}->{$key};
3209 }
3210 }
3211
3212 ## -- Module itself
3213 for (@{$module-><AG::DISAnyResource.uris>}) {
3214 delete $self->{modDef}->{$_};
3215 }
3216 }__;
3217
3218 @Method:
3219 @@Name: xcrefToResource
3220 @@enDesc:
3221 Returns a resource object selected by an exception code
3222 reference (<Q::dx|XCRef>).
3223 @@Param:
3224 @@@Name: xcref
3225 @@@Type: DISString
3226 @@@enDesc:
3227 Exception code to select.
3228 @@Param:
3229 @@@Name: contextNode
3230 @@@Type: NSResolverDIS
3231 @@@enDesc:
3232 A context element node. Namespace prefixes in
3233 <P::xcref> are resolved against this node.
3234 @@NodeParam:
3235 @@Return:
3236 @@@Type:
3237 DISPerl:ARRAY
3238 @@@enDesc:
3239 A reference to the array containing two or three
3240 resource definitions (<Class::ManakaiDISResourceDefinition>).
3241 The first (index <CODE::0>) resource is an exception class.
3242 The second (index <CODE::1>) resource is an exception code
3243 constant. The third (index <CODE::2>) resource
3244 is an exception subtype or <DOM::null> if the reference identifies
3245 no subtype.
3246 @@@RaiseException:
3247 @@@@@: RESOURCE_NOT_DEFINED_ERR
3248 @@@@enDesc:
3249 The resource identified by the <P::xcref> is not defined
3250 or not an exception.
3251 @@@PerlDef:
3252 my ($q1, $q2, $q3) = split /\s*\.\s*/, $xcref, 3;
3253 __DEEP{
3254 if (defined $q3) {
3255 $r->[2] = $self-><M::ManakaiDISDatabase.getResource>
3256 ($contextNode-><M::NSResolverDIS.qnameToURI>
3257 ($q3, node => $node));
3258 $r->[1] = $r->[2]-><AG::DIS|DISResource.parentResource>;
3259 } elsif (defined $q2) {
3260 if ($q2 =~ /:/) {
3261 $r->[1] = $self-><M::ManakaiDISDatabase.getResource>
3262 ($contextNode-><M::NSResolverDIS.qnameToURI>
3263 ($q2, node => $node));
3264 } else {
3265 $r->[0] = $self-><M::ManakaiDISDatabase.getResource>
3266 ($contextNode-><M::NSResolverDIS.qnameToURI>
3267 ($q1, node => $node));
3268 $r->[1] = $r->[0]-><M::ManakaiDISResourceDefinition
3269 .getConstResourceByName> ($q2);
3270 }
3271 } else { ## $q1 only
3272 $r->[2] = $self-><M::ManakaiDISDatabase.getResource>
3273 ($contextNode-><M::NSResolverDIS.qnameToURI>
3274 ($q1, node => $node));
3275 if ($r->[2]-><M::DISAnyResource.isTypeURI> (<Q::dx:ErrorSubCode>)) {
3276 $r->[1] = $r->[2]-><AG::DIS|DISResource.parentResource>;
3277 } else {
3278 $r->[1] = $r->[2]; CORE::delete $r->[2];
3279 }
3280 }
3281
3282 if ($r->[2] and
3283 not $r->[2]-><M::DISAnyResource
3284 .isTypeURI> (<Q::dx:ErrorSubCode>)) {
3285 __UNDEEP{__EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
3286 DIS:uri => {$r->[2]->{uri}},
3287 DIS:expectedType => {<Q::dx:ErrorSubCode>},
3288 DIS:sourceNode => {$node},
3289 DIS:sourceCode => {$xcref},
3290 }__}__;
3291 }
3292 $r->[2]-><AS::DISAnyResource.isReferred>
3293 ($node or $contextNode)
3294 if $r->[2];
3295
3296 if (not $r->[1] or
3297 not $r->[1]-><M::DISAnyResource
3298 .isTypeURI> (<Q::ManakaiDOM:Const>)) {
3299 __UNDEEP{__EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
3300 DIS:uri => {($r->[1] ? $r->[1]-><AG::DIS|DISAnyResource.uri>
3301 : null)},
3302 DIS:localName => {($r->[1] ? $r->[1]-><AG::DIS|DISAnyResource
3303 .localName> : null)},
3304 DIS:expectedType => {<Q::ManakaiDOM:Const>},
3305 DIS:sourceNode => {$node},
3306 DIS:sourceCode => {$xcref},
3307 }__}__;
3308 }
3309 $r->[1]-><AS::DISAnyResource.isReferred>
3310 ($node or $contextNode);
3311
3312 unless ($r->[0]) {
3313 my $cg = $r->[1]-><AG::DIS|DISResource.parentResource>;
3314 $r->[0] = $cg-><AG::DIS|DISResource.parentResource> if $cg;
3315 }
3316 if (not $r->[0] or
3317 not $r->[0]-><M::DISAnyResource
3318 .isTypeURI> (<Q::dx:AnyExceptionAnyClass>)) {
3319 __UNDEEP{__EXCEPTION{RESOURCE_NOT_DEFINED_ERR::
3320 DIS:uri => {$r->[0]->{uri}},
3321 DIS:localName => {$r->[0]-><AG::DIS|DISAnyResource.localName>},
3322 DIS:expectedType => {<Q::dx:AnyExceptionAnyClass>},
3323 DIS:sourceNode => {$node},
3324 DIS:sourceCode => {$xcref},
3325 }__}__;
3326 }
3327 $r->[0]-><AS::DISAnyResource.isReferred>
3328 ($node or $contextNode);
3329 }__;
3330
3331 @Method:
3332 @@Name: free
3333 @@enDesc:
3334 Marks the database, resources in the database, and source
3335 <QUOTE::dis> document trees in the database as no longer used.
3336 @@ForCheck: ManakaiDOM|ForClass
3337 @@Return:
3338 @@@PerlDef:
3339 for my $file (values %{$self->{<H::DIS|sourceFile>}}) {
3340 $file-><M::ManakaiNode|ManakaiNodeRef.free>
3341 if $file;
3342 }
3343 CORE::delete $self->{modDef};
3344 CORE::delete $self->{forDef};
3345 CORE::delete $self->{resDef};
3346
3347 @Method:
3348 @@Name: getModuleURIList
3349 @@enDesc:
3350 Returns a snapshot list of URIs of modules in the database.
3351 @@Return:
3352 @@@Type: DISPerl|ARRAY
3353 @@@enDesc:
3354 A snapshot list of URIs.
3355 @@@PerlDef:
3356 $r = [map {$_-><AG::DIS|DISAnyResource.uri>} values %{$self->{modDef}}];
3357
3358 @Method:
3359 @@Name: getAnyResourceURIList
3360 @@enDesc:
3361 Returns a snapshot list of URIs of resources in the database.
3362 @@Return:
3363 @@@Type: DISPerl|ARRAY
3364 @@@enDesc:
3365 A snapshot list of URIs.
3366 @@@PerlDef:
3367 $r = [keys %{$self->{<H::DIS|resourceModuleMap>}},
3368 map {$_-><AG::DIS|DISAnyResource.uri>} values %{$self->{modDef}}];
3369
3370 @IntMethod:
3371 @@Operator: ManakaiDOM|MUErrorHandler
3372 @@enDesc:
3373 When a <IF::ecore|ErrorInterface> is <Perl::report>ed
3374 with an <Perl::-object> of <IF::Node>, then this method is invoked.
3375
3376 The method calls the <cfg::error-handler> if the error is of
3377 <IF::c|DOMError>. Otherwise, including the cases of
3378 <IF::DOMCore|DOMException>s,
3379 the error is rethrown so that appropriate <Perl::catch> clause
3380 can catch the error.
3381 @@Param:
3382 @@@Name: err
3383 @@@Type: ecore|ErrorInterface
3384 @@@enDesc:
3385 The reported error object.
3386 @@Return:
3387 @@@Type: DISPerl|Any
3388 @@@enDesc:
3389 If the <P::err> is a <IF::c|DOMError>, then the return value
3390 of the error handler.
3391
3392 {NOTE:: If the error is thrown, the method never returns.
3393 }
3394 @@@nullCase:
3395 @@@@enDesc:
3396 No error handler.
3397 @@@PerlDef:
3398 if ($err->isa (<IFName::c|DOMError>)) {
3399 __DEEP{
3400 my $cfg = $self-><AG::DISDatabase.domConfig>;
3401 my $h = $cfg-><M::DOMConfig.getParameter> ('error-handler');
3402 $r = $h-><M::DOMCore|DOMErrorHandler.handleError> ($err);
3403 }__;
3404 } else {
3405 $err-><M::ecore|ErrorInterface.throw>;
3406 }
3407
3408 @Attr:
3409 @@Name: domConfig
3410 @@enDesc:
3411 The configuration of the document.
3412 @@Get:
3413 @@@Type: DOMConfig
3414 @@@enDesc: The DOM configuration object.
3415 @@@PerlDef:
3416 __CODE{c|getConfigObject::
3417 $target => $self,
3418 $targetHash => {$self},
3419 $targetType => {<IFName::DISDatabase>},
3420 $result => $r,
3421 }__;
3422
3423 @Method:
3424 @@Name: getModuleResourceList
3425 @@enDesc:
3426 Returns a snapshot list of modules contained in the database.
3427 @@Return:
3428 @@@Type: ResourceList
3429 @@@enDesc:
3430 A snapshot list of the modules.
3431 @@@PerlDef:
3432 $r = [map {$self->{modDef}->{$_}}
3433 grep {defined $self->{modDef}->{$_}}
3434 keys %{$self->{modDef}}];
3435 ##DISDatabase
3436
3437 CParamApp:
3438 @c:domConfigurationParameter: c|error-handler
3439 @c:targetType: DISDatabase
3440
3441 ElementTypeBinding:
3442 @Name: CParamApp
3443 @ElementType:
3444 dis:ResourceDef
3445 @ShadowContent:
3446 @@rdf:type: c|DOMConfigurationParameterApplication
3447
3448 PropDef:
3449 @QName: DIS|resourceModuleMap
3450 @enDesc:
3451 Resource-module mapping table.
3452 @DIS:key: rm
3453 @Type: DISPerl|HASH
3454
3455 PropDef:
3456 @QName: sourceNodeID
3457 @enDesc:
3458 The URI reference of the source node identifier.
3459 @DIS:key: snid
3460 @Type: DISPerl|SCALAR
3461
3462 PropDef:
3463 @QName: DIS|resource
3464 @enDesc:
3465 Resources defined in a module.
3466 @DIS:key: mres
3467 @Type: DISPerl|ARRAY
3468
3469 PropDef:
3470 @QName: DIS|parentResource
3471 @enDesc:
3472 Static parent resource. No parent for root resources.
3473 @DIS:key: puri
3474
3475 PropDef:
3476 @QName: DIS|dynamicParentResource
3477 @enDesc:
3478 Dynamic parent resource. No parent for root resources.
3479 @DIS:key: dpuri
3480
3481 PropDef:
3482 @QName: DIS|childResource
3483 @enDesc:
3484 Static child resources.
3485 @DIS:key: curis
3486
3487 PropDef:
3488 @QName: DIS|dynamicChildResource
3489 @enDesc:
3490 Dynamic child resources.
3491 @DIS:key: dcuris
3492
3493 PropDef:
3494 @QName: DIS|key
3495 @enDesc:
3496 Property name in resource objects.
3497 @rdfs:subPropertyOf: DISPerl|propHashKey
3498 @dataType: DISCore|String
3499 @multipleProperties: DISCore|Single
3500
3501 ResourceDef:
3502 @QName: DIS|DISResourceList
3503 @enDesc:
3504 A reference to array whose items are resource
3505 (<IF::DIS|DISAnyResource>) objects.
3506 @rdfs:subClassOf: DISPerl|ARRAY
3507 @rdf:type: DISLang|DataType
3508
3509 ElementTypeBinding:
3510 @Name: ForDefDupException
3511 @ElementType:
3512 ManakaiDOM:raises
3513 @ShadowContent:
3514 @@@: FOR_ALREADY_DEFINED_ERR
3515 @@Description:
3516 @@@lang:en
3517 @@@@:
3518 The <QUOTE::for> is already defined elsewhere.
3519
3520 ElementTypeBinding:
3521 @Name: ForDefNoQNameException
3522 @ElementType:
3523 ManakaiDOM:raises
3524 @ShadowContent:
3525 @@@: NO_FOR_QNAME_ERR
3526 @@Description:
3527 @@@lang:en
3528 @@@@:
3529 A <Q::dis:ForDef> element must have a <Q::dis:QName> attribute.
3530
3531 ElementTypeBinding:
3532 @Name: ResDefDupException
3533 @ElementType:
3534 ManakaiDOM:raises
3535 @ShadowContent:
3536 @@@: RESOURCE_ALREADY_DEFINED_ERR
3537 @@Description:
3538 @@@lang:en
3539 @@@@:
3540 The <QUOTE::dis> resource is already defined elsewhere.
3541
3542 ElementTypeBinding:
3543 @Name: ElementNotAllowedException
3544 @ElementType:
3545 ManakaiDOM:raises
3546 @ShadowContent:
3547 @@@: ELEMENT_NOT_ALLOWED_ERR
3548 @@Description:
3549 @@@lang:en
3550 @@@@:
3551 An element has found where it is not allowed.
3552
3553 IFClsDef:
3554 @IFQName: DISModuleResolver
3555 @ClsQName: ManakaiDISModuleResolver
3556
3557 @enDesc:
3558 Objects implementing <IF::DISModuleResolver> interface
3559 are used to convert module name into <QUOTE::dis> document object.
3560 \
3561 {NOTE:: It is also acceptable to pass a <Perl::CODE> reference
3562 as a method parameter where <IF::DISModuleResolver> is
3563 expected.
3564 \
3565 }
3566 @Method:
3567 @@Name: uriToDocument
3568 @@enDesc:
3569 Returns a <QUOTE::dis> document from module name information.
3570 @@Param:
3571 @@@Name: disDB
3572 @@@Type: DISDatabase
3573 @@@clsActualType: ManakaiDISDatabase
3574 @@@enDesc:
3575 The <QUOTE::dis> database.
3576 @@Param:
3577 @@@Name: moduleURI
3578 @@@Type: ModuleURI
3579 @@@enDesc:
3580 The URI reference of the module.
3581 \
3582 {NOTE:: This parameter is redundant, since it can be
3583 composed from other three parameters.
3584 \
3585 }
3586 @@Param:
3587 @@@Name: moduleNamespaceURI
3588 @@@Type: AnyURI
3589 @@@enDesc:
3590 The namespace URI of the module name.
3591 @@Param:
3592 @@@Name: moduleLocalName
3593 @@@Type:
3594 DISCore:LocalName
3595 @@@enDesc:
3596 The local name of the module name.
3597 @@Return:
3598 @@@Type: DISDocument
3599 @@@clsActualType: ManakaiDISDocument
3600 @@@enDesc:
3601 The <QUOTE::dis> document. It don't have to be a newly created
3602 object.
3603 @@@nullCase:
3604 @@@@enDesc:
3605 The method is unable to resolve the reference.
3606 @@@PerlDef:
3607 goto &$self;
3608
3609 @ResourceDef:
3610 @@ForCheck: ManakaiDOM|ForIF
3611 @@QName: DISModuleResolverInputProcessor
3612 @@rdf:type: DISLang|InputProcessor
3613 @@PerlDef:
3614 $INPUT = bless $INPUT, <ClassName::ManakaiDISModuleResolver>
3615 if ref $INPUT eq 'CODE';
3616 ##DISModuleResolver
3617
3618 PropDef:
3619 @QName: sourceFile
3620 @enDesc:
3621 Source <QUOTE::dis> documents.
3622 @rdfs:domain: DISDatabase
3623 @rdfs:range: DISDocument
3624
3625 IFClsDef:
3626 @IFQName: DISAnyResource
3627 @ClsQName: ManakaiDISAnyResource
3628
3629 @enDesc:
3630 {P:: A <IF::DISAnyResource> object represents a resource defined
3631 in <QUOTE::dis> files. In <QUOTE::dis> model, resources are
3632 categorized as:
3633
3634 - Module::: A <QUOTE::dis> module is a file entity.
3635 This kind of objects <kwd:MUST> implement the
3636 <IF::DISModule> interface.
3637
3638 - <QUOTE::For>::: A <QUOTE::for> is a target for which
3639 resources are defined. This kind of objects
3640 <kwd:MUST> implement the <IF::DISFor> interface.
3641
3642 - <QUOTE::dis> Resource::: Something described in <QUOTE::dis>.
3643 This kind of objects <kwd:MUST> implement the
3644 <IF::DISModule> interface.
3645
3646 }
3647
3648 @Attr:
3649 @@Name: uri
3650 @@Type: AnyURI
3651 @@Description:
3652 @@@lang:en
3653 @@@@:
3654 The URI reference of the resource.
3655 @@Get:
3656 @@@enDesc:
3657 The representive URI reference of the resource.
3658
3659 {NOTE:: The URI might be non-persistent if the
3660 resource is not assigned a URI in <QUOTE::dis> source file,
3661 in which case a URI is randomly-generated at the
3662 time of object generation.
3663 }
3664 @@@PerlDef:
3665 $r = $self->{uri};
3666
3667 @Attr:
3668 @@Name: uriRef
3669 @@Type: DISPerl|SCALAR
3670 @@enDesc:
3671 A reference to the URI of the resource.
3672
3673 {NOTE:: Applications <kwd:MUST-NOT> modify the referenced
3674 value directly.
3675 }
3676 @@Get:
3677 @@@PerlDef: $r = \ ($self->{uri});
3678
3679 @Attr:
3680 @@Name: uris
3681 @@Type:
3682 DISPerl:Array
3683 @@enDesc:
3684 A set of URIs that identifies the resource.
3685 @@Get:
3686 @@@enDesc:
3687 A reference to array in which the URIs are contained
3688 in undefined order.
3689
3690 {NOTE:: The array is <EM::not> live; it is only a snapshot.
3691 }
3692
3693 @Method:
3694 @@Name: isSameResource
3695 @@Operator:
3696 @@@@:eq
3697 @@@ContentType:
3698 lang:Perl
3699 @@enDesc:
3700 Whether two resources are same or not. Two resources are
3701 same if and only if their <A::DISAnyResource.uri> are
3702 equivalent as strings (i.e. in character-by-character based matching).
3703 @@Param:
3704 @@@Name: anotherResource
3705 @@@Type: DISAnyResource
3706 @@@enDesc:
3707 Another resource object to compare.
3708 @@Return:
3709 @@@Type:
3710 DOMMain:boolean
3711 @@@enDesc:
3712 Whether two resources are same or not.
3713 @@@TrueCase:
3714 @@@@enDesc: Two resources are same.
3715 @@@FalseCase:
3716 @@@@enDesc: Two resources are different.
3717 @@@PerlDef:
3718 if (UNIVERSAL::isa ($anotherResource,
3719 <ClassName::ManakaiDISAnyResource>)) {
3720 $r = $self->{uri} eq $anotherResource->{uri};
3721 }
3722
3723 @Attr:
3724 @@Name: nameURI
3725 @@Type: NameURI
3726 @@enDesc:
3727 The URI reference of this module, without
3728 <QUOTE::for> identifier.
3729 @@Get:
3730 @@@enDesc:
3731 The name URI of the resource.
3732 @@@nullCase:
3733 @@@@enDesc:
3734 The resource has no name URI.
3735
3736 {NOTE:: A resource has no URI if and only if the resource
3737 has no local name.
3738 }
3739 @@@PerlDef:
3740 if (defined $self->{localName}) {
3741 $r = defined $self->{namespaceURI}
3742 ? ${$self->{namespaceURI}} . ${$self->{localName}}
3743 : ${$self->{localName}};
3744 }
3745
3746 @Attr:
3747 @@Name: localName
3748 @@enDesc:
3749 The local name of this module.
3750
3751 {NOTE:: <QUOTE::for> resources has no local name.
3752 }
3753 @@Type:
3754 DISCore:LocalName
3755 @@Get:
3756 @@@PerlDef:
3757 $r = defined $self->{localName} ? ${$self->{localName}} : null;
3758
3759 @Attr:
3760 @@Name: namespaceURI
3761 @@Type: AnyURI
3762 @@enDesc:
3763 The namespace URI of the name of this resource.
3764
3765 {NOTE:: <QUOTE::for> resources has no namespace URI.
3766 }
3767 @@Get:
3768 @@@PerlDef:
3769 $r = defined $self->{namespaceURI} ? ${$self->{namespaceURI}} : null;
3770
3771 @Attr:
3772 @@Name: forpURI
3773 @@enDesc:
3774 The <QUOTE::for+> URI references for which this resource is defined.
3775
3776 {NOTE:: <QUOTE::for> resources has no <QUOTE::for+> URI.
3777 }
3778 @@Type: ForURIList
3779 @@Get:
3780 @@@enDesc:
3781 List of <QUOTE::for> URI references. Note that this list is
3782 <QUOTE::dead>.
3783 @@@PerlDef:
3784 $r = [@{$self->{forp}}];
3785
3786 @Method:
3787 @@Name: isForURI
3788 @@enDesc:
3789 Tests whether this resource is defined for a <QUOTE::for>
3790 or <QUOTE::for+> URI reference or not.
3791 @@Param:
3792 @@@Name:forURI
3793 @@@Type:ForURI
3794 @@@enDesc:
3795 A <QUOTE::for> URI reference to test.
3796 @@Return:
3797 @@@Type:
3798 DOMMain:boolean
3799 @@@TrueCase:
3800 @@@@enDesc:
3801 This resource is for <P::forURI>.
3802 @@@FalseCase:
3803 @@@@enDesc:
3804 This resource is not for <P::forURI>.
3805 @@@PerlDef:
3806 __DEEP{
3807 C: for my $this_for_uri (<Q::ManakaiDOM|all>, @{$self->{forp}||[]}) {
3808 if ($this_for_uri eq $forURI) { ## Shortcut
3809 $r = true;
3810 last C;
3811 }
3812 my $this_for = $self-><AG::DISAnyResource.database>
3813 -><M::DIS|DISDatabase.getFor>
3814 ($this_for_uri);
3815 if ($this_for-><M::DIS|DISFor.isaURI> ($forURI)) {
3816 $r = true;
3817 last C;
3818 }
3819 }
3820 }__;
3821
3822 @Attr:
3823 @@Name: isDefined
3824 @@Description:
3825 @@@lang:en
3826 @@@@:
3827 Whether this module is defined or not.
3828 @@Type:
3829 DOMMain:boolean
3830 @@Get:
3831 @@@PerlDef:
3832 $r = $self->{<H::DIS|isDefined>};
3833 @@Set:
3834 @@@PerlDef:
3835 $self->{<H::DIS|isDefined>} = $given;
3836
3837 @Attr:
3838 @@Name: ownerModule
3839 @@enDesc:
3840 The module in which the resource is defined. If the resource
3841 is a module, the module itself is the attribute value.
3842 @@Get:
3843 @@@Type: DISModule
3844 @@@clsActualType: ManakaiDISModuleDefinition
3845 @@@enDesc:
3846 The owner module object.
3847 @@@nullCase:
3848 @@@@enDesc:
3849 The resource is not part of any module since
3850 its definition is not read (i.e. <A::DISAnyResource.isDefined> is
3851 <DOM::false>) or since it is created in memory.
3852 @@@PerlDef:
3853 $r = $self-><AG::DISAnyResource.database>
3854 -><M::DISDatabase.getModule>
3855 (${$self->{<H::DIS|definingModule>}})
3856 if defined $self->{<H::DIS|definingModule>};
3857
3858 @Attr:
3859 @@Name: ownerModuleURI
3860 @@enDesc:
3861 A URI of the owner module of the resource.
3862 @@Type: DIS|AnyURI
3863 @@nullCase:
3864 @@@enDesc:
3865 The resource does not belong to any module since the
3866 resource definition is not read yet or since
3867 it is created in memory.
3868 @@Get:
3869 @@@PerlDef:
3870 if (defined $self->{<H::DIS|definingModule>}) {
3871 $r = ${$self->{<H::DIS|definingModule>}};
3872 }
3873
3874 @Attr:
3875 @@Name: ownerModuleURIRef
3876 @@enDesc:
3877 A reference to a URI of the owner module of the resource.
3878 @@Type: DISPerl|SCALAR
3879 @@nullCase:
3880 @@@enDesc:
3881 The resource does not belong to any module since the
3882 resource definition is not read yet or since
3883 it is created in memory.
3884 @@Get:
3885 @@@PerlDef:
3886 $r = $self->{<H::DIS|definingModule>};
3887 @@Set:
3888 @@@PerlDef:
3889 $self->{<H::DIS|definingModule>} = $given;
3890
3891 @Attr:
3892 @@Name: isReferred
3893 @@Description:
3894 @@@lang:en
3895 @@@@:
3896 Whether the resource is referenced somewhere or not.
3897 @@Type: DISLang|String
3898 @@Get:
3899 @@@enDesc:
3900 A node path string that identifies the node from
3901 which the resource is referenced.
3902 @@@nullCase:
3903 The resource is not referred.
3904 @@@PerlDef:
3905 $r = $self->{<H::DIS|isReferred>};
3906 @@Set:
3907 @@@enDesc:
3908 A node path string that identifies the node from
3909 which the resource is referenced.
3910 @@@InCase:
3911 @@@@Type: DISElement
3912 @@@@enDesc:
3913 The resource is referenced by the element. It's node path
3914 string is set as the attribute value.
3915 @@@PerlDef:
3916 if (defined $given) {
3917 if (ref $given) {
3918 __DEEP{
3919 if ($given->isa (<IFName::dv|DVValue>)) {
3920 $given = $given-><AG::dv|DVValue.sourceNodePath>;
3921 } else {
3922 $given = $given-><M::SWCFGNode.flag> ('nodePath') ||
3923 $given-><M::SWCFGNode.nodePath>
3924 (key => [qw/QName Name type Type/]);
3925 }
3926 }__;
3927 }
3928 $self->{<H::DIS|isReferred>} = $given;
3929 }
3930
3931 @Attr:
3932 @@Name: sourceNodeID
3933 @@enDesc:
3934 The identifier URI reference of the source node.
3935 @@enDesc:
3936 @@@ForCheck: ManakaiDOM|ForClass
3937 @@@@:
3938 Modules and <QUOTE::for>s does not have source node identifier
3939 in the current implementation.
3940 @@Type: AnyURI
3941 @@Get:
3942 @@@nullCase:
3943 @@@@enDesc:
3944 The resource is not (yet) associated with any source node.
3945 @@@PerlDef:
3946 if (defined $self->{<H::DIS:sourceNodeID>}) {
3947 $r = ${$self->{<H::DIS:sourceNodeID>}};
3948 } else {
3949 $r = null;
3950 }
3951 @@Set:
3952 @@@PerlDef:
3953 if (defined $given) {
3954 $self->{<H::DIS:sourceNodeID>} = \$given;
3955 } else {
3956 CORE::delete $self->{<H::DIS:sourceNodeID>};
3957 }
3958
3959 @Attr:
3960 @@Name: sourceNodeIDRef
3961 @@enDesc:
3962 The identifier URI reference of the source node.
3963 @@enDesc:
3964 @@@ForCheck: ManakaiDOM|ForClass
3965 @@@@:
3966 Modules and <QUOTE::for>s does not have source node identifier
3967 in the current implementation.
3968 @@Type: DISPerl|SCALAR
3969 @@Get:
3970 @@@nullCase:
3971 @@@@enDesc:
3972 The resource is not (yet) associated with any source node.
3973 @@@PerlDef:
3974 $r = $self->{<H::DIS:sourceNodeID>};
3975 @@Set:
3976 @@@PerlDef:
3977 if (defined $given) {
3978 $self->{<H::DIS:sourceNodeID>} = $given;
3979 } else {
3980 CORE::delete $self->{<H::DIS:sourceNodeID>};
3981 }
3982
3983 @Attr:
3984 @@Name: isAnonymous
3985 @@enDesc:
3986 Whether the resource has persistent name or not.
3987 @@Type:
3988 DOMMain:boolean
3989 @@Get:
3990 @@@TrueCase:
3991 This resource does <EM::not> have any globally unique name.
3992 <A::DISAnyResource.uri> is a temporary URI reference.
3993 @@@FalseCase:
3994 This resource does have its formal name.
3995 <A::DISAnyResource.uri> is a URI reference
3996 generated from the name and the <QUOTE::for> URI reference
3997 of this resource.
3998 @@@PerlDef:
3999 $r = $self->{<H::DIS|isAnon>};
4000 @@Set:
4001 @@@PerlDef:
4002 $self->{<H::DIS|isAnon>} = $given;
4003
4004 @Attr:
4005 @@Name: sourceElement
4006 @@enDesc:
4007 The source <QUOTE::dis> element node from which this
4008 definition is read.
4009 @@Get:
4010 @@@Type: DISElement
4011 @@@InCase:
4012 @@@@Type: DISModuleElement
4013 @@@@enDesc: If this resource is a module.
4014 @@@PerlDef: $r = $self->{src};
4015 @@@nullCase:
4016 @@@@enDesc:
4017 The definition is not yet read.
4018
4019 @Attr:
4020 @@Name: database
4021 @@enDesc:
4022 The <QUOTE::dis> database to which the resource belongs.
4023 @@Type: DISDatabase
4024 @@Get:
4025 @@@PerlDef:
4026 $r = $self->{db};
4027
4028 @Method:
4029 @@Name: readProperties
4030 @@enDesc:
4031 Reads property values in the source tree and
4032 removes reference to the source node.
4033 @@NamedParam:
4034 @@@Name: onResourceRead
4035 @@@Type:
4036 DISPerl:CODE
4037 @@@enDesc:
4038 An event handler called when a resource is read.
4039 @@@nullCase:
4040 @@@@enDesc:
4041 No event handler is read.
4042 @@NamedParam:
4043 @@@Name: implementation
4044 @@@Type: DOMImpl
4045 @@@enDesc:
4046 The <IF::DOMImpl> object to which the database belongs.
4047 It might be used to create property value objects.
4048 @@Return:
4049 @@@RaiseException:
4050 @@@@@: UNSUPPORTED_ELEMENT_TYPE_ERR
4051 @@@@enDesc:
4052 There is an element whose element type is not supported.
4053 @@@PerlDef:
4054 __DEEP{
4055 if (my $src = $self->{src}) {
4056 my $forp = $self-><AG::DISAnyResource.forpURI>;
4057 my $db = $self-><AG::DISAnyResource.database>;
4058 my $factory;
4059 for my $el (@{$src-><M::DISElement.disChildElements>
4060 (forp_arg => $forp,
4061 database_arg => $db)}) {
4062 my $xu = $el-><AG::SWCFGElement.expandedURI>;
4063 if ({
4064 <Q::dis:AliasFor> => true,
4065 <Q::dis:ContentType> => true,
4066 <Q::dis:dataType> => true,
4067 <Q::dis:ForCheck> => true,
4068 <Q::dis:Name> => true,
4069 <Q::dis:Namespace> => true,
4070 <Q::dis:multipleProperties> => true,
4071 <Q::DISCore|resourceType> => true,
4072 <Q::rdf:type> => true, ## TODO: Remove this.
4073 <Q::dis:QName> => true,
4074 <Q::dis:Require> => true,
4075 <Q::dis:resourceFor> => true,
4076 }->{$xu}) {
4077 #
4078 } elsif ($el-><M::DISElement.isPropertyElement>
4079 (database_arg => $db)) {
4080 my $add_prop;
4081 $add_prop = sub ($$$) {
4082 my ($self, $el, $db) = @_;
4083 my $prop = $db-><M::DISDatabase.getResource>
4084 ($el-><AG::SWCFGElement.expandedURI>);
4085 my $prop_uri = $prop-><AG::DISAnyResource.uri>;
4086 my $prop_mult = $prop-><AG::DISResource.multiplePropertiesURI>;
4087 my $new_value;
4088 my $base_type;
4089 my $copy_tree = false;
4090
4091 my %mtopt = (default_media_type => $prop-><AG::DISResource
4092 .defaultLextypeURI>,
4093 database_arg => $db);
4094 my $new_value_type = $el-><M::DISElement.mediaTypeURI>(%mtopt);
4095
4096 if ($el-><M::DISElement.mediaTypeMatch>
4097 (<Q::DISCore:QName>, $mtopt{default_media_type}, %mtopt)) {
4098 __CODE{dv|createValue::
4099 $value => {null},
4100 $base_type => {$base_type = <Q::DISCore:QName>},
4101 $type => {$new_value_type},
4102 $result => $new_value,
4103 $name => {$prop_uri},
4104 }__;
4105 $new_value-><AS::dv|DVQNameValue.localName>
4106 ($el-><AG::DISElement.qnameValueLocalName>);
4107 $new_value-><AS::dv|DVQNameValue.prefix>
4108 (my $prefix = $el-><AG::DISElement.qnameValuePrefix>);
4109 if (not defined $prefix) {
4110 if ($el-><M::DISElement.mediaTypeMatch>
4111 (<Q::DISCore:LanguageTag>,
4112 $mtopt{default_media_type}, %mtopt)) {
4113 $new_value-><AS::dv|DVQNameValue.namespaceURI>
4114 ('urn:x-suika-fam-cx:lang:');
4115 } elsif ($el-><M::DISElement.mediaTypeMatch>
4116 (<Q::DISCore:ScriptTag>,
4117 $mtopt{default_media_type}, %mtopt)) {
4118 $new_value-><AS::dv|DVQNameValue.namespaceURI>
4119 ('http://suika.fam.cx/~wakaba/archive/2005/5/script#');
4120 } else {
4121 $new_value-><AS::dv|DVQNameValue.namespaceURI>
4122 ($el-><AG::DISElement.qnameValueNamespaceURI>);
4123 }
4124 } else {
4125 $new_value-><AS::dv|DVQNameValue.namespaceURI>
4126 ($el-><AG::DISElement.qnameValueNamespaceURI>);
4127 }
4128 ## TODO: Check whether defined
4129 } elsif ($el-><M::DISElement.mediaTypeMatch>
4130 (<Q::DISCore:TFPQNames>, $mtopt{default_media_type}, %mtopt)) {
4131 __CODE{dv|createURI::
4132 $uri => {$el-><M::DISElement.tfqnamesValueURI>
4133 ($self-><AG::DISAnyResource.sourceNodeID>)},
4134 $result => $new_value,
4135 $name => $prop_uri,
4136 }__;
4137 ## TODO: Check whether defined
4138 $new_value_type = <Q::DISCore:URI>;
4139 } elsif ($el-><M::DISElement.mediaTypeMatch>
4140 (<Q::lang:Perl>, $mtopt{default_media_type},
4141 %mtopt)) {
4142 $el-><M::DISElement.preserveNodePath>;
4143 __CODE{dv|createValueRef::
4144 $value_ref => {$el-><AG::SWCFGNode.valueRef>},
4145 $base_type => {$base_type = <Q::lang:Perl>},
4146 $type => {$new_value_type},
4147 $result => $new_value,
4148 $name => $prop_uri,
4149 }__;
4150 for my $p (<Q::dis:Type>, <Q::dis:actualType>) {
4151 if (UNIVERSAL::isa ($self->{$p},<IFName::dv|DVURIValue>)) {
4152 my $v;
4153 __CODE{dv|createURI::
4154 $uri => {$self->{$p}-><AG::dv|DVURIValue.uri>},
4155 $result => $v,
4156 $name => $prop_uri,
4157 }__;
4158 $new_value-><M::dv|DVValue.setProperty> ($p => $v);
4159 }
4160 }
4161 $new_value-><AS::dv|DVNSValue.defaultNamespaceURIRef>
4162 ($el-><M::DISElement.getDefaultNamespaceURIRef>);
4163 $new_value-><AS::dv|DVNSValue.namespaceBindingList>
4164 ($el-><M::DISElement.getNamespaceBindingList> ($db));
4165 $new_value-><AS::dv|DVValue.sourceNodePath>
4166 ($el-><M::SWCFGNode.flag> ('nodePath'));
4167 } elsif ($el-><M::DISElement.mediaTypeMatch>
4168 (<Q::lang:disdoc>, $mtopt{default_media_type},
4169 %mtopt) or
4170 $el-><M::DISElement.mediaTypeMatch>
4171 (<Q::lang:disdocInline>, $mtopt{default_media_type},
4172 %mtopt) or
4173 $el-><M::DISElement.mediaTypeMatch>
4174 (<Q::lang:muf>, $mtopt{default_media_type},
4175 %mtopt) or
4176 $el-><M::DISElement.mediaTypeMatch>
4177 (<Q::lang:dpg>, $mtopt{default_media_type},
4178 %mtopt) or
4179 $el-><M::DISElement.mediaTypeMatch>
4180 (<Q::lang:tdterr>,
4181 $mtopt{default_media_type},
4182 %mtopt)) {
4183 $el-><M::DISElement.preserveNodePath>;
4184 __CODE{dv|createValueRef::
4185 $value_ref => {$el-><AG::SWCFGNode.valueRef>},
4186 $base_type => {$base_type = <Q::lang:disdoc>},
4187 $type => $new_value_type,
4188 $result => $new_value,
4189 $name => $prop_uri,
4190 }__;
4191 $new_value-><AS::dv|DVNSValue.defaultNamespaceURIRef>
4192 ($el-><M::DISElement.getDefaultNamespaceURIRef>);
4193 $new_value-><AS::dv|DVNSValue.namespaceBindingList>
4194 ($el-><M::DISElement.getNamespaceBindingList> ($db));
4195 $new_value-><AS::dv|DVValue.sourceNodePath>
4196 ($el-><M::SWCFGNode.flag> ('nodePath'));
4197 } elsif ($el-><M::DISElement.mediaTypeMatch>
4198 (<Q::dx|XCRef>,
4199 $mtopt{default_media_type}, %mtopt)) {
4200 my $x = $db-><M::DISDatabase.xcrefToResource>
4201 ($el-><M::SWCFGNode.value>,
4202 $el, node => $el);
4203 __CODE{dv|createURI::
4204 $uri => {($x->[2] or $x->[1] or $x->[0])
4205 -><AG::DISAnyResource.uri>},
4206 $result => $new_value,
4207 $name => $prop_uri,
4208 }__;
4209 $new_value-><M::dv|DVURIValue.getResource> ($db)
4210 -><AS::DISAnyResource.isReferred> ($el);
4211 $new_value_type = <Q::DISCore:URI>;
4212 } elsif ($el-><M::DISElement.mediaTypeMatch>
4213 (<Q::lang|dcmodel>,
4214 $mtopt{default_media_type}, %mtopt)) {
4215 unless (defined $factory) {
4216 $factory = $implementation->create_document;
4217 }
4218 my $mt = $db-><M::DISDatabase.getResource>
4219 ($el-><M::DISElement.mediaTypeURI>);
4220 my $node = $mt-><M::DISAnyResource.parseString>
4221 ($el-><M::SWCFGNode.value>, $el, $factory,
4222 );
4223 __CODE{dv|createXMLValue::
4224 $value => $node,
4225 $result => $new_value,
4226 $name => $prop_uri,
4227 }__;
4228 $new_value-><AS::dv|DVValue.sourceNodePath>
4229 ($el-><M::SWCFGNode.flag> ('nodePath'));
4230 } elsif ($el-><M::DISElement.mediaTypeMatch>
4231 (<Q::DISCore:NSString>,
4232 $mtopt{default_media_type}, %mtopt)) {
4233 $el-><M::DISElement.preserveNodePath>;
4234 __CODE{dv|createValueRef::
4235 $value_ref => {$el-><AG::SWCFGNode.valueRef>},
4236 $base_type => {$base_type = <Q::DISCore:NSString>},
4237 $type => $new_value_type,
4238 $result => $new_value,
4239 $name => $prop_uri,
4240 }__;
4241 $new_value-><AS::dv|DVNSValue.defaultNamespaceURIRef>
4242 ($el-><M::DISElement.getDefaultNamespaceURIRef>);
4243 $new_value-><AS::dv|DVNSValue.namespaceBindingList>
4244 ($el-><M::DISElement.getNamespaceBindingList> ($db));
4245 $new_value-><AS::dv|DVValue.sourceNodePath>
4246 ($el-><M::SWCFGNode.flag> ('nodePath'));
4247 } elsif ($el-><M::DISElement.mediaTypeMatch>
4248 (<Q::lang:dis>, $mtopt{default_media_type},
4249 %mtopt)) {
4250 $copy_tree = true;
4251 $el-><M::DISElement.preserveNodePath>;
4252 my $elc = $el->clone;
4253 __CODE{dv|createValue::
4254 $value => {$elc},
4255 $base_type => {$base_type = <Q::lang:dis>},
4256 $type => $new_value_type,
4257 $result => $new_value,
4258 $name => $prop_uri,
4259 }__;
4260 $elc-><M::DISElement.unlinkFromDocument> ($db);
4261 } elsif ($el-><M::DISElement.mediaTypeMatch>
4262 (<Q::DISCore:Integer>,
4263 $mtopt{default_media_type}, %mtopt)) {
4264 my $v = $el-><M::SWCFGNode.value>;
4265 if ($v =~ /^0x/) {
4266 $v = hex $v;
4267 } else {
4268 $v += 0;
4269 }
4270 __CODE{dv|createValue::
4271 $value => $v,
4272 $base_type => {$base_type = <Q::DISCore:Integer>},
4273 $type => $new_value_type,
4274 $result => $new_value,
4275 $name => $prop_uri,
4276 }__;
4277 } elsif ($el-><M::DISElement.mediaTypeMatch>
4278 (<Q::DISCore:UString>,
4279 $mtopt{default_media_type}, %mtopt)) {
4280 my $v = $el-><M::SWCFGNode.value>;
4281 $v =~ s/\$\x0D?\x0A//gs;
4282 $v =~ s/\$\z//;
4283 warn 'String |'.$el-><M::SWCFGNode.value>.'| contains '.
4284 'illegal |$| character' if $v =~ /\$(?![uU])/;
4285 ## TODO: Use error-handler
4286 $v =~ s{\$(u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})}{
4287 chr hex substr $1, 1
4288 }ge;
4289 __CODE{dv|createValue::
4290 $value => $v,
4291 $base_type => {$base_type = <Q::DISCore:String>},
4292 $type => {<Q::DISCore:String>},
4293 $result => $new_value,
4294 $name => $prop_uri,
4295 }__;
4296 ## NOTE: Since |type| is set to |DISCore:String|,
4297 ## what subtype of |DISCore:UString| it was originally
4298 ## is not preserved.
4299 } else {
4300 __CODE{dv|createValue::
4301 $value => {$el-><M::SWCFGNode.value>},
4302 $base_type => {$base_type = <Q::DISCore:String>},
4303 $type => $new_value_type,
4304 $result => $new_value,
4305 $name => $prop_uri,
4306 }__;
4307 }
4308
4309 unless ($copy_tree) {
4310 for my $ce (@{$el-><M::DISElement.disChildElements>
4311 (forp_arg => $forp,
4312 database_arg => $db)}) {
4313 my $xu = $ce-><AG::SWCFGElement.expandedURI>;
4314 if ({
4315 <Q::dis:AliasFor> => true,
4316 <Q::dis:ForCheck> => true,
4317 <Q::dis:ContentType> => true,
4318 <Q::dis:resourceFor> => true,
4319 }->{$xu}) {
4320 #
4321 } elsif ($ce-><M::DISElement.isPropertyElement>
4322 (database_arg => $db)) {
4323 my $pr;
4324 __DEEP{
4325 $pr = $add_prop->($self, $ce, $db);
4326 }__;
4327 if ($pr->{prop_mult} eq <Q::DISCore|OrderedList>) {
4328 my $cpv = $new_value-><M::dv|DVValue.getProperty> ($xu);
4329 if (not $cpv) {
4330 __CODE{dv|createOrderedList::
4331 $result => {$cpv},
4332 $type => {$mtopt{default_media_type}},
4333 $base_type => {<Q::DISCore:String>},
4334 }__;
4335 $new_value-><M::dv|DVValue.setProperty> ($xu => $cpv);
4336 }
4337 $cpv-><M::dv|DVList.addItem> ($pr->{new_value});
4338 } elsif ($pr->{prop_mult} eq <Q::DISCore|UnorderedList>) {
4339 my $cpv = $new_value-><M::dv|DVValue.getProperty> ($xu);
4340 if (not $cpv) {
4341 __CODE{dv|createUnorderedList::
4342 $result => {$cpv},
4343 $type => {$mtopt{default_media_type}},
4344 $base_type => {<Q::DISCore:String>},
4345 }__;
4346 $new_value-><M::dv|DVValue.setProperty> ($xu => $cpv);
4347 }
4348 $cpv-><M::dv|DVList.addItem> ($pr->{new_value});
4349 } else {
4350 $new_value-><M::dv|DVValue.setProperty>
4351 ($xu => $pr->{new_value});
4352 }
4353 } else {
4354 __UNDEEP{__EXCEPTION{UNSUPPORTED_ELEMENT_TYPE_ERR::
4355 DIS:elementType => {$xu},
4356 DIS:sourceNode => {$ce},
4357 }__}__;
4358 }
4359 }} # copy_tree
4360
4361 {new_value => $new_value, base_type => $base_type,
4362 prop_uri => $prop_uri, prop_mult => $prop_mult,
4363 new_value_type => $new_value_type};
4364 };
4365
4366 my $pr;
4367 __DEEP{
4368 $pr = $add_prop->($self, $el, $db);
4369 }__;
4370 if ($pr->{prop_mult} eq <Q::DISCore|OrderedList>) {
4371 if (not $self->{$pr->{prop_uri}}) {
4372 __CODE{dv|createOrderedList::
4373 $result => {$self->{$pr->{prop_uri}}},
4374 $type => {$pr->{new_value_type}},
4375 $base_type => {$pr->{base_type} || <Q::DISCore:String>},
4376 }__;
4377 }
4378 $self->{$pr->{prop_uri}}-><M::dv|DVList.addItem>
4379 ($pr->{new_value});
4380 } elsif ($pr->{prop_mult} eq <Q::DISCore|UnorderedList>) {
4381 if (not $self->{$pr->{prop_uri}}) {
4382 __CODE{dv|createUnorderedList::
4383 $result => {$self->{$pr->{prop_uri}}},
4384 $type => {$pr->{new_value_type}},
4385 $base_type => {$pr->{base_type} || <Q::DISCore:String>},
4386 }__;
4387 }
4388 $self->{$pr->{prop_uri}}-><M::dv|DVList.addItem>
4389 ($pr->{new_value});
4390 } else {
4391 $self->{$pr->{prop_uri}} = $pr->{new_value};
4392 }
4393
4394 if ($el-><M::DISElement.elementTypeMatch>
4395 (<Q::DISPerl:propHashKey>, database_arg => $db)) {
4396 $db-><M::dp|DISDatabasePerl.plAddHashKey>
4397 ($xu => $pr->{new_value}-><AG::dv|DVValue.stringValue>
4398 => $self);
4399 }
4400 } elsif ($el-><AG::DISElement.isResourceElement>) {
4401 ## TODO: Should rdf:type be validated?
4402 } else {
4403 __UNDEEP{__EXCEPTION{UNSUPPORTED_ELEMENT_TYPE_ERR::
4404 DIS:elementType => {$xu},
4405 DIS:sourceNode => {$el},
4406 }__}__;
4407 }
4408 }
4409 CORE::delete $self->{src};
4410 ($onResourceRead or sub () {})->($self, $self);
4411 }
4412 }__;
4413
4414 @Method:
4415 @@Name: isTypeURI
4416 @@enDesc:
4417 Tests whether this resource is of a type or not.
4418 @@Param:
4419 @@@Name: typeURI
4420 @@@Type: ResourceURI
4421 @@@enDesc:
4422 A type URI reference to test.
4423 @@Return:
4424 @@@Type:
4425 DOMMain:boolean
4426 @@@TrueCase:
4427 @@@@enDesc:
4428 This is a <P::typeURI> resource.
4429 @@@FalseCase:
4430 @@@@enDesc:
4431 This is not a <P::typeURI> resource.
4432 @@@PerlDef:
4433 __DEEP{
4434 $r = $self-><AG::DISAnyResource.typeResource>
4435 -><M::DISResource.isSubsetOfURI> ($typeURI);
4436 }__;
4437
4438 @Attr:
4439 @@Name: revision
4440 @@enDesc:
4441 The revision number of the resource.
4442
4443 {ISSUE::
4444 Is it necessary for revision numbers to hold some
4445 kind of globality?
4446 }
4447 @@Type: RevisionNumber
4448 @@Get:
4449 @@@PerlDef:
4450 $r = $self->{<H::DIS|revision>};
4451
4452 @CODE:
4453 @@QName: setRevision
4454 @@enDesc:
4455 Sets new revision number to a resource.
4456 @@PerlDef:
4457 $resource->{<H::DIS|revision>} = time;
4458
4459 @CODE:
4460 @@QName: updateRevision
4461 @@enDesc:
4462 Updates revision number of a resource.
4463
4464 {ISSUE::
4465 How revision number should be increased?
4466 }
4467 @@PerlDef:
4468 $resource->{<H::DIS|revision>}++;
4469
4470 @Method:
4471 @@Name: getTypeURIList
4472 @@enDesc:
4473 Returns a snapshot list of resource type URIs of the resource.
4474 @@Return:
4475 @@@Type: URIList
4476 @@@enDesc:
4477 A snapshot list of URIs.
4478 @@@PerlDef:
4479 __DEEP{
4480 $r = $self-><AG::DISAnyResource.typeResource>
4481 -><M::DISAnyResource.getSuperResourceURIList>;
4482 }__;
4483
4484 @@Test:
4485 @@@QName: DISAnyResource.getTypeURIList.test
4486 @@@PerlDef:
4487 my $db;
4488 __CODE{createDISDBForTest:: $db => $db}__;
4489
4490 $test->id ('module');
4491 my $mod1 = $db-><M::DISDatabase.getModule> ('about:module1');
4492 my %lm1 = map {$_ => true} @{$mod1-><M::DISAnyResource.getTypeURIList>};
4493
4494 $test->assert_true ($lm1{<Q::DISCore|Module>});
4495 $test->assert_true ($lm1{<Q::DISCore|AnyResource>});
4496
4497 $test->id ('for');
4498 my $for1 = $db-><M::DISDatabase.getFor> ('about:for1');
4499 my %lf1 = map {$_ => true} @{$for1-><M::DISAnyResource.getTypeURIList>};
4500
4501 $test->assert_true ($lf1{<Q::DISCore|For>});
4502 $test->assert_true ($lf1{<Q::DISCore|AnyResource>});
4503
4504 @@Test:
4505 @@@QName: DISAnyResource.resource.getTypeURIList.test
4506 @@@PerlDef:
4507 my $db;
4508 __CODE{createDISDBForTest:: $db => $db}__;
4509
4510 $test->id ('resource');
4511 my $res1 = $db-><M::DISDatabase.getResource> ('about:resource1');
4512 my %lr1 = map {$_ => true} @{$res1-><M::DISAnyResource.getTypeURIList>};
4513
4514 $test->assert_true ($lr1{<Q::DISCore|Resource>});
4515 $test->assert_true ($lr1{<Q::DISCore|AnyResource>});
4516
4517 @Method:
4518 @@ForCheck: ManakaiDOM|ForIF
4519 @@Name: getSuperResourceURIList
4520 @@enDesc:
4521 Returns a snapshot list of super-resources URIs of the resource,
4522 including canonical and alias URIs of the resource itself.
4523 @@Return:
4524 @@@Type: URIList
4525 @@@enDesc:
4526 A snapshot list of URIs.
4527
4528 @Attr:
4529 @@Name: typeResource
4530 @@enDesc:
4531 The most specific type of the resource.
4532 @@Type: DISResource
4533 @@Get:
4534 @@@PerlDef:
4535 __DEEP{
4536 $r = $self-><AG::DISAnyResource.database>
4537 -><M::DISDatabase.getResource> ($self->{<H::DIS|typeURI>});
4538 }__;
4539
4540 @Method:
4541 @@Name: addTypeURI
4542 @@enDesc:
4543 Adds a URI to the list of types of the resource.
4544 @@Param:
4545 @@@Name: uri
4546 @@@Type: AnyResourceURI
4547 @@@enDesc:
4548 A URI to add.
4549 @@NamedParam:
4550 @@@Name: srinfo
4551 @@@Type: DISPerl|HASH
4552 @@@enDesc:
4553 A hash returned by <M::DISDatabase.unloadModule>, to
4554 restore super-resource relationship.
4555 @@@nullCase:
4556 @@@@enDesc:
4557 If it is not the updating.
4558 @@Return:
4559 @@@PerlDef:
4560 __DEEP{
4561 my $current_type = $self-><AG::DISAnyResource.typeResource>;
4562 unless ($current_type-><M::DISResource.isSubsetOfURI>
4563 ($uri, srinfo => $srinfo)) {
4564 my $db = $self-><AG::DISAnyResource.database>;
4565 my $res = $db-><M::DISDatabase.getResource> ($uri);
4566 my $current_uri = $current_type-><AG::DISAnyResource.uri>;
4567 if ($res-><M::DISResource.isSubsetOfURI>
4568 ($current_uri, srinfo => $srinfo)) {
4569 $self->{<H::DIS|typeURI>} = $uri;
4570 } else {
4571 my $new_uri;
4572 __CODE{composeSubsetURI:: $input1 => $current_uri,
4573 $input2 => $uri,
4574 $output => $new_uri}__;
4575 my $new_res = $db-><M::DISDatabase.getResource> ($new_uri);
4576 unless ($new_res-><AG::DISAnyResource.isDefined>) {
4577 $new_res-><AS::DISAnyResource.isAnonymous> (true);
4578 $new_res-><AS::DISAnyResource.isDefined> (true);
4579 $new_res-><M::DISResource.addSuperResource>
4580 ($current_type, srinfo => $srinfo);
4581 $new_res-><M::DISResource.addSuperResource>
4582 ($res, srinfo => $srinfo);
4583 }
4584 unless ($new_res-><AG::DISAnyResource.ownerModuleURIRef>) {
4585 $new_res-><AS::DISAnyResource.ownerModuleURIRef>
4586 ($res-><AG::DISAnyResource.ownerModuleURIRef>);
4587 }
4588 $self->{<H::DIS|typeURI>} = $new_uri;
4589 }
4590 }
4591 }__;
4592
4593 @@Test:
4594 @@@QName: DISAnyResource.addTypeURI.test
4595 @@@PerlDef:
4596 my $db;
4597 __CODE{createDISDBForTest:: $db => $db}__;
4598
4599 my $res = $db-><M::DISDatabase.getResource> ('about:1');
4600 my $res2 = $db-><M::DISDatabase.getResource> ('about:2');
4601 $test->id ('initial.resource');
4602 $test->assert_true
4603 ($res-><M::DISAnyResource.isTypeURI> (<Q::DISCore|Resource>));
4604 $test->id ('initial.anyresource');
4605 $test->assert_true
4606 ($res-><M::DISAnyResource.isTypeURI>
4607 (<Q::DISCore|AnyResource>));
4608 $test->id ('initial.type1');
4609 $test->assert_false
4610 ($res-><M::DISAnyResource.isTypeURI> ('about:type1'));
4611
4612 $res-><M::DISAnyResource.addTypeURI> ('about:type1');
4613
4614 $test->id ('added.resource');
4615 $test->assert_true
4616 ($res-><M::DISAnyResource.isTypeURI> (<Q::DISCore|Resource>));
4617 $test->id ('added.anyresource');
4618 $test->assert_true
4619 ($res-><M::DISAnyResource.isTypeURI>
4620 (<Q::DISCore|AnyResource>));
4621 $test->id ('added.type1');
4622 $test->assert_true
4623 ($res-><M::DISAnyResource.isTypeURI> ('about:type1'));
4624
4625 $test->id ('added2.resource');
4626 $test->assert_true
4627 ($res2-><M::DISAnyResource.isTypeURI>
4628 (<Q::DISCore|Resource>));
4629 $test->id ('added2.anyresource');
4630 $test->assert_true
4631 ($res2-><M::DISAnyResource.isTypeURI>
4632 (<Q::DISCore|AnyResource>));
4633 $test->id ('added2.type1');
4634 $test->assert_false
4635 ($res2-><M::DISAnyResource.isTypeURI> ('about:type1'));
4636
4637 @CODE:
4638 @@QName: getMethodForType
4639 @@enDesc:
4640 Returns a method for a particular resource type.
4641
4642 In: <Perl::$type_resource>, <Perl::$method_name>
4643
4644 Out: <Perl::$method>
4645 @@PerlDef:
4646 my $__type_uri = $type_resource-><AG::DISAnyResource.uri>;
4647 $method = $Message::Util::DIS::Method{$__type_uri}->{$method_name};
4648 unless ($method) {
4649 my %__methods;
4650 for (@{$type_resource-><M::DISAnyResource.getSuperResourceURIList>}) {
4651 $__methods{$_} = $Message::Util::DIS::Method{$_}->{$method_name}
4652 if $Message::Util::DIS::Method{$_}->{$method_name};
4653 }
4654 my $__db = $type_resource-><AG::DISAnyResource.database>;
4655 T1: for my $__t1_uri (keys %__methods) {
4656 next T1 unless $__methods{$__t1_uri};
4657 my $__t1 = $__db-><M::DISDatabase.getResource> ($__t1_uri);
4658 T2: for my $__t2_uri (keys %__methods) {
4659 next T2 if $__t1_uri eq $__t2_uri;
4660 if ($__t1-><M::DISResource.isSubsetOfURI> ($__t2_uri)) {
4661 delete $__methods{$__t2_uri};
4662 next T2;
4663 }
4664 if ($Message::Util::DIS::Method{$__t1_uri}->{$method_name}
4665 eq $Message::Util::DIS::Method{$__t2_uri}->{$method_name}) {
4666 delete $__methods{$__t2_uri};
4667 next T2;
4668 }
4669 }
4670 }
4671 if (keys %__methods > 1) {
4672 __c|ERROR{DIS|more-than-one-methods-for-a-type::
4673 DIS|uri => {$__type_uri},
4674 DIS|method-name => {$method_name},
4675 DIS|method-resource-types => {[keys %__methods]},
4676 }__;
4677 }
4678 $Message::Util::DIS::Method{$__type_uri}->{$method_name} =
4679 $method = $__methods{[keys %__methods]->[0]} if %__methods;
4680 }
4681
4682 @IntMethod:
4683 @@Operator: ManakaiDOM|MUErrorHandler
4684 @@enDesc:
4685 When a <IF::ecore|ErrorInterface> is <Perl::report>ed
4686 with an <Perl::-object> of <IF::Node>, then this method is invoked.
4687
4688 The method calls the <cfg::error-handler> if the error is of
4689 <IF::c|DOMError>. Otherwise, including the cases of <IF::c|DOMException>s,
4690 the error is rethrown so that appropriate <Perl::catch> clause
4691 can catch the error.
4692 @@Param:
4693 @@@Name: err
4694 @@@Type: ecore|ErrorInterface
4695 @@@enDesc:
4696 The reported error object.
4697 @@Return:
4698 @@@Type: DISPerl|Any
4699 @@@enDesc:
4700 If the <P::err> is a <IF::c|DOMError>, then the return value
4701 of the error handler.
4702
4703 {NOTE:: If the error is thrown, the method never returns.
4704 }
4705 @@@nullCase:
4706 @@@@enDesc:
4707 No error handler.
4708 @@@PerlDef:
4709 if ($err->isa (<IFName::c|DOMError>)) {
4710 __DEEP{
4711 my $cfg = $self-><AG::DISAnyResource.database>
4712 -><AG::DISDatabase.domConfig>;
4713 my $h = $cfg-><M::DOMConfig.getParameter> ('error-handler');
4714 $r = $h-><M::DOMCore|DOMErrorHandler.handleError> ($err);
4715 }__;
4716 } else {
4717 $err-><M::ecore|ErrorInterface.throw>;
4718 }
4719
4720 @Method:
4721 @@Name: getErrorInterfaceResource
4722 @@enDesc:
4723 Returns the <Q::ecore|ErrorInterface> resource
4724 to which the resource belongs.
4725 @@Return:
4726 @@@Type: DISAnyResource
4727 @@@enDesc:
4728 The interface resource.
4729 @@@nullCase:
4730 @@@@enDesc:
4731 If no resource found.
4732 @@@PerlDef:
4733 my $method;
4734 my $tr = $self-><AG::DISAnyResource.typeResource>;
4735 __CODE{DIS|getMethodForType::
4736 $type_resource => $tr,
4737 $method_name => 'get_error_interface_resource',
4738 $method => $method,
4739 }__;
4740 if ($method) {
4741 __DEEP{
4742 $r = $method->(@_);
4743 }__;
4744 } else {
4745 $r = null;
4746 }
4747
4748 @Method:
4749 @@Name: getErrorCodeResource
4750 @@enDesc:
4751 Returns the <Q::dx|ErrorCode> resource
4752 to which the resource belongs.
4753 @@Return:
4754 @@@Type: DISAnyResource
4755 @@@enDesc:
4756 The interface resource.
4757 @@@nullCase:
4758 @@@@enDesc:
4759 If no resource found.
4760 @@@PerlDef:
4761 my $method;
4762 my $tr = $self-><AG::DISAnyResource.typeResource>;
4763 __CODE{DIS|getMethodForType::
4764 $type_resource => $tr,
4765 $method_name => 'get_error_code_resource',
4766 $method => $method,
4767 }__;
4768 if ($method) {
4769 __DEEP{
4770 $r = $method->(@_);
4771 }__;
4772 } else {
4773 $r = null;
4774 }
4775
4776 @Method:
4777 @@Name: getDOMConfigurationParameterName
4778 @@enDesc:
4779 Returns the name of the DOM configuration parameter represented
4780 by the resource.
4781 @@Return:
4782 @@@Type: DISString
4783 @@@enDesc:
4784 The name.
4785 @@@nullCase:
4786 @@@@enDesc:
4787 If it is not a DOM configuration parameter or
4788 if it is an invalid configuration parameter and
4789 it has no name.
4790 @@@PerlDef:
4791 my $method;
4792 my $tr = $self-><AG::DISAnyResource.typeResource>;
4793 __CODE{DIS|getMethodForType::
4794 $type_resource => $tr,
4795 $method_name => 'get_dom_configuration_parameter_name',
4796 $method => $method,
4797 }__;
4798 if ($method) {
4799 __DEEP{
4800 $r = $method->(@_);
4801 }__;
4802 } else {
4803 $r = null;
4804 }
4805
4806 @Method:
4807 @@Name: getNodeFromStorage
4808 @@enDesc:
4809 Returns a <IF::Node> from the storage associated
4810 to the resource.
4811 @@Param:
4812 @@@Name: key
4813 @@@Type: DISString
4814 @@@enDesc:
4815 A DOM URI that identifies the kind of the node.
4816 @@Param:
4817 @@@Name: hash
4818 @@@Type: DISString
4819 @@@enDesc:
4820 A short string that identifies the content of the node
4821 to retrieve. If it does not match to the one associated
4822 to the node in the storage, no node is returned.
4823 @@Param:
4824 @@@Name: factory
4825 @@@Type: Document
4826 @@@enDesc:
4827 The document to which the retrieved node belongs.
4828 @@Return:
4829 @@@Type: Node
4830 @@@enDesc:
4831 The retrieved node.
4832 @@@nullCase:
4833 @@@@enDesc:
4834 If no node is found.
4835 @@@PerlDef:
4836 require Message::DOM::TreeStore;
4837 my $mod = $self-><AG::DISAnyResource.ownerModule>;
4838 $mod-><M::dp|DISModulePerl.plLoadNodeStorage>
4839 unless defined $mod->{<H::DIS|nodeStorage>};
4840 my $st = $mod->{<H::DIS|nodeStorage>};
4841 if (defined $st->{$key} and $st->{$key}->[1] eq $hash) {
4842 $r = $factory->implementation
4843 ->get_feature (<Q::fe|TreeStore>)
4844 ->create_node_from_storable_object
4845 ($st->{$key}->[0], $factory);
4846 }
4847
4848 @Method:
4849 @@Name: setNodeToStorage
4850 @@enDesc:
4851 Saves a copy of the <IF::Node> to the storage. Exactly
4852 when the physical storage is updated is implementation dependent.
4853 @@Param:
4854 @@@Name: key
4855 @@@Type: DISString
4856 @@@enDesc:
4857 A DOM URI that identifies the kind of the node.
4858 @@Param:
4859 @@@Name: hash
4860 @@@Type: DISString
4861 @@@enDesc:
4862 A short string that identifies the content of the node.
4863 If the <P::node> parameter is set to <DOM::null>,
4864 this value is ignored.
4865 @@Param:
4866 @@@Name: node
4867 @@@Type: Node
4868 @@@enDesc:
4869 The node to store. If there is already a node
4870 with the <P::key>, it is discarded.
4871 @@@nullCase:
4872 @@@@enDesc:
4873 The stored node, if any, is removed from the storage.
4874 @@Return:
4875 @@@PerlDef:
4876 require Message::DOM::TreeStore;
4877 my $mod = $self-><AG::DISAnyResource.ownerModule>;
4878 $mod-><M::dp|DISModulePerl.plLoadNodeStorage>
4879 unless defined $mod->{<H::DIS|nodeStorage>};
4880 my $st = $mod->{<H::DIS|nodeStorage>};
4881 if (defined $node) {
4882 $st->{$key}->[0] = [$node->owner_document
4883 ->implementation
4884 ->get_feature (<Q::fe|TreeStore>)
4885 ->create_storable_object_from_node
4886 ($node), $hash];
4887 } else {
4888 delete $st->{$key};
4889 }
4890 $mod->{<H::DIS|nodeStorageModified>} = true;
4891
4892 @Method:
4893 @@Name: parseString
4894 @@enDesc:
4895 Parses a string assuming that this resource is a <Q::DISCore|LexicalType>.
4896 @@Param:
4897 @@@Name: s
4898 @@@Type: DISString
4899 @@@enDesc:
4900 The string to parse.
4901 @@Param:
4902 @@@Name: ns
4903 @@@Type: NSResolverDIS
4904 @@@enDesc:
4905 The namespace context object.
4906 @@Param:
4907 @@@Name: factory
4908 @@@Type: Document
4909 @@@enDesc:
4910 The <IF::Document> node to which the returned <IF::Node> belongs.
4911 @@Return:
4912 @@@Type: Node
4913 @@@enDesc:
4914 The <IF::Node> object obtained as a result of parsing
4915 of <P::s> in the context of <P::ns>.
4916 @@@nullCase:
4917 @@@@enDesc:
4918 If this resource is not a <Q::DISCore|LexicalType>
4919 or if no parser is found.
4920 @@@PerlDef:
4921 my $method;
4922 __CODE{DIS|getMethodForType::
4923 $type_resource => $self,
4924 $method_name => 'parse_string',
4925 $method => $method,
4926 }__;
4927 if ($method) {
4928 __DEEP{
4929 $r = $method->(@_);
4930 }__;
4931 } else {
4932 $r = null;
4933 }
4934 ##DISAnyResource
4935
4936 PropDef:
4937 @QName: DIS|nodeStorage
4938 @DIS:key: nst
4939
4940 PropDef:
4941 @QName: DIS|nodeStorageModified
4942 @DIS:key: nstmod
4943
4944 ResourceDef:
4945 @QName: Node
4946 @AliasFor: tc|Node
4947
4948 ResourceDef:
4949 @QName: Document
4950 @AliasFor: td|Document
4951
4952 ResourceDef:
4953 @QName: Element
4954 @AliasFor: te|Element
4955
4956 ResourceDef:
4957 @QName: DOMConfig
4958 @AliasFor: DOMCore|DOMConfiguration
4959
4960 ErrDef:
4961 @QName: DIS|more-than-one-methods-for-a-type
4962 @enDesc:
4963 If more than one different method implementations are defined
4964 for a resource type.
4965 @enMufDef:
4966 Method |%p (name => {<Q::DIS|method-name>});| for
4967 resource <%p (name => {<Q::DIS|uri>});> has multiple definitions
4968 @c:severity: DOMCore|SEVERITY_WARNING
4969 @ecore:hasParameter:
4970 @@@: DIS|uri
4971 @@enDesc:
4972 A URI of the type.
4973 @ecore:hasParameter:
4974 @@@: DIS|method-name
4975 @@enDesc:
4976 The name of the method.
4977 @ecore:hasParameter:
4978 @@@: DIS|method-resource-types
4979 @@enDesc:
4980 The snapshot list of types for which methods are defined.
4981
4982 XParamDef:
4983 @QName: DIS|fileName
4984 @enDesc:
4985 The name of the file.
4986
4987 XParamDef:
4988 @QName: DIS|method-name
4989 @enDesc:
4990 The name of the method in question.
4991
4992 XParamDef:
4993 @QName: DIS|method-resource-types
4994 @enDesc:
4995 The snapshot list of types for which methods are defined.
4996
4997 XParamDef:
4998 @QName: DIS|forURI
4999
5000 ElementTypeBinding:
5001 @Name: ErrDef
5002 @ElementType:
5003 dis:ResourceDef
5004 @ShadowContent:
5005 @@DISCore:resourceType: DOMCore|DOMErrorType
5006 @@ecore:textFormatter: ecore|MUErrorFormatter
5007
5008 URITypeDef:
5009 @QName: AnyResourceURI
5010 @enDesc:
5011 A URI that identifies a <Q::DISCore|AnyResource>.
5012
5013 DataTypeDef:
5014 @QName: AnyResourceURIList
5015 @enDesc:
5016 A snapshot list of URIs that identify <Q::DISCore|AnyResource>s.
5017 @rdfs:subClassOf: DISPerl|ARRAY
5018
5019 PropDef:
5020 @QName: DIS|typeURI
5021 @enDesc:
5022 The URI of the most specific type of the resource.
5023 @DIS:key: tu
5024
5025 IFClsDef:
5026 @IFQName: DISModule
5027 @ClsQName: ManakaiDISModuleDefinition
5028
5029 @ClsISA: ManakaiDISPropertyAccessor
5030 @ClsISA: ManakaiDISPerlModuleDefinition
5031 @ClsISA: dp|ManakaiDISModulePerl
5032 @ClsISA: dp|ManakaiDISAnyResourcePerl
5033 @ClsISA: ManakaiDISAnyResource
5034
5035 @enDesc:
5036 <QUOTE::dis> module definitions.
5037
5038 @enDesc:
5039 @@ForCheck: ManakaiDOM|ForIF
5040 @@@:
5041 The objects implementing the <IF::DISModule> interface <kwd:MUST>
5042 also implement the <IF::DISAnyResource> interface.
5043
5044 @Attr:
5045 @@ForCheck: ManakaiDOM|ForClass
5046 @@Name: uris
5047 @@Type:
5048 DISPerl:Array
5049 @@enDesc:
5050 A reference to the snapshot array containing the URI reference
5051 of the module.
5052 @@Get:
5053 @@@PerlDef:
5054 $r = [$self->{uri}];
5055
5056 @Attr:
5057 @@ForCheck: ManakaiDOM|ForClass
5058 @@Name: ownerModule
5059 @@ManakaiDOM:isRedefining:1
5060 @@enDesc:
5061 This module itself.
5062 @@Get:
5063 @@@Type: DISModule
5064 @@@clsActualType: ManakaiDISModuleDefinition
5065 @@@nullCase:
5066 @@@@enDesc:
5067 The resource is not part of any module since
5068 its definition is not read (<IF::DISModule.isDefined> is <DOM::false>).
5069 @@@PerlDef: $r = $self;
5070
5071 @Method:
5072 @@Name: addResourceList
5073 @@enDesc:
5074 Adds a resource to the list of resources belongs to the module.
5075 @@Param:
5076 @@@Name: disResource
5077 @@@Type: DIS|DISResource
5078 @@@enDesc: The resource to add.
5079 @@Return:
5080 @@@PerlDef:
5081 __DEEP{
5082 push @{$self->{<H::DIS|resource>}||=[]},
5083 map {\$_} @{$disResource-><AG::DIS|DISAnyResource.uris>};
5084 }__;
5085
5086 @Method:
5087 @@Name: addResourceURI
5088 @@enDesc:
5089 Adds a resource URI to the list of resources belongs to the module.
5090 @@Param:
5091 @@@Name: uri
5092 @@@Type: DISString
5093 @@@enDesc:
5094 The URI to add.
5095 @@Return:
5096 @@@PerlDef:
5097 push @{$self->{<H::DIS|resource>}||=[]}, \$uri;
5098
5099 @Method:
5100 @@Name: getResourceURIList
5101 @@enDesc:
5102 Returns the list of URIs of resources belongs to the module.
5103 @@Return:
5104 @@@Type: AnyResourceURIList
5105 @@@enDesc:
5106 The snapshot list of URIs.
5107 @@@PerlDef:
5108 $r = [map {$$_} @{$self->{<H::DIS|resource>} or []}];
5109
5110 @Method:
5111 @@Name: getResourceList
5112 @@enDesc:
5113 Returns the list of resources belongs to the module.
5114 @@Return:
5115 @@@Type: DIS|ResourceList
5116 @@@enDesc:
5117 The current snapshot of children.
5118 @@@PerlDef:
5119 __DEEP{
5120 my $db = $self-><AG::DIS|DISAnyResource.database>;
5121 $r = [map {
5122 $db-><M::DIS|DISDatabase.getResource> ($$_)
5123 } @{$self->{<H::DIS|resource>}}];
5124 }__;
5125
5126 @Method:
5127 @@Name: addForResource
5128 @@enDesc:
5129 Adds a <QUOTE::for> resource to the list of <QUOTE::for>
5130 resources belongs to the module.
5131 @@Param:
5132 @@@Name: disResource
5133 @@@Type: DISFor
5134 @@@enDesc: The resource to add.
5135 @@Return:
5136 @@@PerlDef:
5137 __DEEP{
5138 push @{$self->{<H::DIS|forList>}||=[]},
5139 $disResource-><AG::DISAnyResource.uriRef>;
5140 }__;
5141
5142 @Method:
5143 @@Name: getForResourceList
5144 @@enDesc:
5145 Returns the list of <QUOTE::for> resources belongs to the module.
5146 @@Return:
5147 @@@Type: ResourceList
5148 @@@enDesc:
5149 The current snapshot list of <QUOTE::for> resources,
5150 which may or may not contains dupulications.
5151 @@@PerlDef:
5152 __DEEP{
5153 my $db = $self-><AG::DIS|DISAnyResource.database>;
5154 $r = [map {
5155 $db-><M::DIS|DISDatabase.getFor> ($$_)
5156 } @{$self->{<H::DIS|forList>}}];
5157 }__;
5158
5159 @Attr:
5160 @@Name: targetNamespaceURI
5161 @@enDesc:
5162 The default namespace URI of the resources defined in the module.
5163 @@Type: DIS|AnyURI
5164 @@Get:
5165 @@@PerlDef:
5166 $r = defined $self->{<H::DIS|defaultNamespaceURI>}
5167 ? ${$self->{<H::DIS|defaultNamespaceURI>}} : null;
5168 @@Set:
5169 @@@ForCheck: ManakaiDOM|ForClass
5170 @@@PerlDef:
5171 if (defined $given) {
5172 $self->{<H::DIS|defaultNamespaceURI>} = \$given;
5173 } else {
5174 CORE::delete $self->{<H::DIS|defaultNamespaceURI>};
5175 }
5176
5177 @CMethod:
5178 @@Name: getSuperResourceURIList
5179 @@enDesc:
5180 Returns a snapshot list of super-resources URIs of the resource,
5181 including canonical and alias URIs of the resource itself.
5182 @@Return:
5183 @@@Type: URIList
5184 @@@enDesc:
5185 A snapshot list of URIs.
5186 @@@PerlDef:
5187 $r = [$self->{uri}];
5188
5189 @@Test:
5190 @@@QName: DISModule.getSuperResourceURIList.test
5191 @@@PerlDef:
5192 my $db;
5193 __CODE{createDISDBForTest:: $db => $db}__;
5194
5195 my $res = $db-><M::DISDatabase.getModule> ('about:1');
5196
5197 my %list = map {$_ => true} @{$res-><M::DISAnyResource
5198 .getSuperResourceURIList>};
5199
5200 $test->assert_true ($list{'about:1'});
5201 $test->assert_false ($list{'about:2'});
5202
5203 @Method:
5204 @@Name: getReferringModuleURIList
5205 @@enDesc:
5206 Reurns a snapshot list of the name URIs of modules referenced
5207 from the module.
5208 @@Return:
5209 @@@Type: URIList
5210 @@@enDesc:
5211 The snapshot list of URIs.
5212 @@@PerlDef:
5213 $r = [grep {$self->{<H::DIS|referringModule>}->{$_}}
5214 keys %{$self->{<H::DIS|referringModule>} or {}}];
5215
5216 @Method:
5217 @@Name: addReferringModuleURI
5218 @@enDesc:
5219 Adds a URI to the list of modules referenced from the module.
5220 @@Param:
5221 @@@Name: uri
5222 @@@Type: DISString
5223 @@@enDesc:
5224 The URI to add.
5225 @@Return:
5226 @@@PerlDef:
5227 $self->{<H::DIS|referringModule>}->{$uri} = true;
5228 ##DISModule
5229
5230 PropDef:
5231 @QName: DIS|referringModule
5232 @DIS:key: ref
5233
5234 PropDef:
5235 @QName: DIS|forList
5236 @enDesc:
5237 A list of references to URIs of <QUOTE::for> resources
5238 belongs to the module.
5239
5240 ClsDef:
5241 @ClsQName: ManakaiDISModuleLite
5242
5243 @Implement: DIS|DISResourceProp
5244 @Implement: dp|DISAnyResourcePerl
5245 @Implement: dp|DISModulePerl
5246 @Implement: dp|DISResourcePerlModule
5247
5248 @enDesc:
5249 The <Class::ManakaiDISModuleLite> class provides very small
5250 subset of <Class::ManakaiDISModuleDefinition> class. If a
5251 method or attribute which is not implemented by the class, then
5252 the object is updated to the <Class::ManakaiDISModuleDefinition>
5253 by reading additional properties from the <QUOTE::dis> database.
5254
5255 @Attr:
5256 @@Name: uri
5257 @@Type: AnyURI
5258 @@Description:
5259 @@@lang:en
5260 @@@@:
5261 The URI reference of the resource.
5262 @@Get:
5263 @@@enDesc:
5264 The representive URI reference of the resource.
5265
5266 {NOTE:: The URI might be non-persistent if the
5267 resource is not assigned a URI in <QUOTE::dis> source file,
5268 in which case a URI is randomly-generated at the
5269 time of object generation.
5270 }
5271 @@@PerlDef:
5272 $r = $self->{uri};
5273
5274 @Attr:
5275 @@Name: uriRef
5276 @@Type: DISPerl|SCALAR
5277 @@enDesc:
5278 A reference to the URI of the resource.
5279
5280 {NOTE:: Applications <kwd:MUST-NOT> modify the referenced
5281 value directly.
5282 }
5283 @@Get:
5284 @@@PerlDef: $r = \ ($self->{uri});
5285
5286 @Attr:
5287 @@ForCheck: ManakaiDOM|ForClass
5288 @@Name: uris
5289 @@Type:
5290 DISPerl:Array
5291 @@enDesc:
5292 A reference to the snapshot array containing the URI reference
5293 of the module.
5294 @@Get:
5295 @@@PerlDef:
5296 $r = [$self->{uri}];
5297
5298 @Method:
5299 @@Name: isSameResource
5300 @@Operator:
5301 @@@@:eq
5302 @@@ContentType:
5303 lang:Perl
5304 @@enDesc:
5305 Whether two resources are same or not. Two resources are
5306 same if and only if their <A::DISAnyResource.uri> are
5307 equivalent as strings (i.e. in character-by-character based matching).
5308 @@Param:
5309 @@@Name: anotherResource
5310 @@@Type: DISAnyResource
5311 @@@enDesc:
5312 Another resource object to compare.
5313 @@Return:
5314 @@@Type:
5315 DOMMain:boolean
5316 @@@enDesc:
5317 Whether two resources are same or not.
5318 @@@TrueCase:
5319 @@@@enDesc: Two resources are same.
5320 @@@FalseCase:
5321 @@@@enDesc: Two resources are different.
5322 @@@PerlDef:
5323 if (UNIVERSAL::isa ($anotherResource,
5324 <ClassName::ManakaiDISAnyResource>)) {
5325 $r = $self->{uri} eq $anotherResource->{uri};
5326 }
5327
5328 @Attr:
5329 @@Name: nameURI
5330 @@Type: NameURI
5331 @@enDesc:
5332 The URI reference of this module, without
5333 <QUOTE::for> identifier.
5334 @@Get:
5335 @@@enDesc:
5336 The name URI of the resource.
5337 @@@nullCase:
5338 @@@@enDesc:
5339 The resource has no name URI.
5340
5341 {NOTE:: A resource has no URI if and only if the resource
5342 has no local name.
5343 }
5344 @@@PerlDef:
5345 if (defined $self->{localName}) {
5346 $r = defined $self->{namespaceURI}
5347 ? ${$self->{namespaceURI}} . ${$self->{localName}}
5348 : ${$self->{localName}};
5349 }
5350
5351 @Attr:
5352 @@Name: localName
5353 @@enDesc:
5354 The local name of this module.
5355
5356 {NOTE:: <QUOTE::for> resources has no local name.
5357 }
5358 @@Type:
5359 DISCore:LocalName
5360 @@Get:
5361 @@@PerlDef:
5362 $r = defined $self->{localName} ? ${$self->{localName}} : null;
5363
5364 @Attr:
5365 @@Name: namespaceURI
5366 @@Type: AnyURI
5367 @@enDesc:
5368 The namespace URI of the name of this resource.
5369
5370 {NOTE:: <QUOTE::for> resources has no namespace URI.
5371 }
5372 @@Get:
5373 @@@PerlDef:
5374 $r = defined $self->{namespaceURI} ? ${$self->{namespaceURI}} : null;
5375
5376 @Attr:
5377 @@Name: forpURI
5378 @@enDesc:
5379 The <QUOTE::for+> URI references for which this resource is defined.
5380
5381 {NOTE:: <QUOTE::for> resources has no <QUOTE::for+> URI.
5382 }
5383 @@Type: ForURIList
5384 @@Get:
5385 @@@enDesc:
5386 List of <QUOTE::for> URI references. Note that this list is
5387 <QUOTE::dead>.
5388 @@@PerlDef:
5389 $r = [@{$self->{forp}}];
5390
5391 @Method:
5392 @@Name: isForURI
5393 @@enDesc:
5394 Tests whether this resource is defined for a <QUOTE::for>
5395 or <QUOTE::for+> URI reference or not.
5396 @@Param:
5397 @@@Name:forURI
5398 @@@Type:ForURI
5399 @@@enDesc:
5400 A <QUOTE::for> URI reference to test.
5401 @@Return:
5402 @@@Type:
5403 DOMMain:boolean
5404 @@@TrueCase:
5405 @@@@enDesc:
5406 This resource is for <P::forURI>.
5407 @@@FalseCase:
5408 @@@@enDesc:
5409 This resource is not for <P::forURI>.
5410 @@@PerlDef:
5411 __DEEP{
5412 C: for my $this_for_uri (<Q::ManakaiDOM|all>, @{$self->{forp}||[]}) {
5413 if ($this_for_uri eq $forURI) { ## Shortcut
5414 $r = true;
5415 last C;
5416 }
5417 my $this_for = $self-><AG::DISAnyResource.database>
5418 -><M::DIS|DISDatabase.getFor>
5419 ($this_for_uri);
5420 if ($this_for-><M::DIS|DISFor.isaURI> ($forURI)) {
5421 $r = true;
5422 last C;
5423 }
5424 }
5425 }__;
5426
5427 @Attr:
5428 @@Name: isDefined
5429 @@Description:
5430 @@@lang:en
5431 @@@@:
5432 Whether this module is defined or not.
5433 @@Type:
5434 DOMMain:boolean
5435 @@Get:
5436 @@@PerlDef:
5437 $r = $self->{<H::DIS|isDefined>};
5438 @@Set:
5439 @@@PerlDef:
5440 $self->{<H::DIS|isDefined>} = $given;
5441
5442 @Attr:
5443 @@ForCheck: ManakaiDOM|ForClass
5444 @@Name: ownerModule
5445 @@ManakaiDOM:isRedefining:1
5446 @@enDesc:
5447 This module itself.
5448 @@Get:
5449 @@@Type: DISModule
5450 @@@clsActualType: ManakaiDISModuleDefinition
5451 @@@nullCase:
5452 @@@@enDesc:
5453 The resource is not part of any module since
5454 its definition is not read (<IF::DISModule.isDefined> is <DOM::false>).
5455 @@@PerlDef: $r = $self;
5456
5457 @Attr:
5458 @@Name: ownerModuleURI
5459 @@enDesc:
5460 A URI of the owner module of the resource.
5461 @@Type: DIS|AnyURI
5462 @@nullCase:
5463 @@@enDesc:
5464 The resource does not belong to any module since the
5465 resource definition is not read yet or since
5466 it is created in memory.
5467 @@Get:
5468 @@@PerlDef:
5469 $r = $self->{uri};
5470
5471 @Attr:
5472 @@Name: ownerModuleURIRef
5473 @@enDesc:
5474 A reference to a URI of the owner module of the resource.
5475 @@Type: DISPerl|SCALAR
5476 @@nullCase:
5477 @@@enDesc:
5478 The resource does not belong to any module since the
5479 resource definition is not read yet or since
5480 it is created in memory.
5481 @@Get:
5482 @@@PerlDef:
5483 $r = \ ($self->{uri});
5484 @@Set:
5485 @@@PerlDef: # no effect
5486
5487 @Attr:
5488 @@Name: database
5489 @@enDesc:
5490 The <QUOTE::dis> database to which the resource belongs.
5491 @@Type: DISDatabase
5492 @@clsActualType: ManakaiDISDatabase
5493 @@Get:
5494 @@@PerlDef:
5495 $r = $self->{db};
5496
5497 @Method:
5498 @@Operator:
5499 @@@@: AUTOLOAD
5500 @@@ContentType: lang|Perl
5501 @@Return:
5502 @@@PerlDef:
5503 my $al = our $AUTOLOAD;
5504 $al =~ s/.+:://;
5505 if ($al ne 'DESTROY') {
5506
5507 __DEEP{
5508 $self-><AG::DIS|DISAnyResource.database>
5509 -><M::dp|ManakaiDISDatabasePerl.plLoadDISDatabaseModule> ($self);
5510 }__;
5511 if (ref $self eq <ClassName::ManakaiDISModuleLite>) {
5512 __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR::
5513 DIS:uri => {$self-><AG::DIS|DISAnyResource.uri>},
5514 DIS:moduleURI => {$self-><AG::DIS|DISAnyResource.uri>},
5515 }__;
5516 }
5517
5518 my $code = $self->can ($al);
5519 if ($code) {
5520 goto &$code;
5521 } else {
5522 require Carp;
5523 local $Carp::CarpLevel = $Error::Depth;
5524 Carp::croak (qq<Can't locate method "$AUTOLOAD">);
5525 }
5526
5527 } # $al
5528
5529 @Attr:
5530 @@Name: targetNamespaceURI
5531 @@enDesc:
5532 The default namespace URI of the resources defined in the module.
5533 @@Type: DIS|AnyURI
5534 @@Get:
5535 @@@PerlDef:
5536 $r = defined $self->{<H::DIS|defaultNamespaceURI>}
5537 ? ${$self->{<H::DIS|defaultNamespaceURI>}} : null;
5538 ##DISModuleLite
5539
5540 IFClsDef:
5541 @IFQName: DISFor
5542 @ClsQName: ManakaiDISForDefinition
5543
5544 @ClsISA: dp|ManakaiDISAnyResourcePerl
5545 @ClsISA: ManakaiDISPropertyAccessor
5546 @ClsISA: ManakaiDISAnyResource
5547
5548 @Description:
5549 @@lang:en
5550 @@@:
5551 <QUOTE::dis> <QUOTE::for> definitions.
5552
5553 @Attr:
5554 @@ForCheck: ManakaiDOM|ForClass
5555 @@Name: uris
5556 @@Type:
5557 DISPerl:Array
5558 @@actualType: ForURIList
5559 @@enDesc:
5560 A reference to the snapshot array containing the URI reference
5561 of the <QUOTE::for>.
5562 @@Get:
5563 @@@PerlDef:
5564 $r = [$self->{uri}];
5565
5566 @Method:
5567 @@Name: isaURI
5568 @@Description:
5569 @@@lang:en
5570 @@@@:
5571 Whether this <QUOTE::for> is-a another <QUOTE::for> or not.
5572 @@Param:
5573 @@@Name: superURI
5574 @@@Type: ForURI
5575 @@@Description:
5576 @@@@lang:en
5577 @@@@@:
5578 Another <QUOTE::for> URI reference to test.
5579 @@Return:
5580 @@@Type:
5581 DOMMain:boolean
5582 @@@TrueCase:
5583 @@@@enDesc:
5584 <P::superURI> is a super-<QUOTE::for> of this <QUOTE::for>.
5585 @@@FalseCase:
5586 @@@@enDesc:
5587 <P::superURI> is not a super-<QUOTE::for> of this <QUOTE::for>.
5588 @@@PerlDef:
5589 $r = $self->{uri} eq $superURI ? true : $self->{isa}->{$superURI};
5590
5591 @Method:
5592 @@Name: addISA
5593 @@enDesc:
5594 Adds a <QUOTE::for> to the list of super-<QUOTE::for> of this
5595 <QUOTE::for>.
5596 @@Param:
5597 @@@Name: superFor
5598 @@@Type: DISFor
5599 @@@clsActualType: ManakaiDISForDefinition
5600 @@@enDesc:
5601 A <QUOTE::for> definition object.
5602 @@Return:
5603 @@@PerlDef:
5604 my @from = ($self->{uri},
5605 grep {$self->{revISA}->{$_}} keys %{$self->{revISA}});
5606 my @to = ($superFor->{uri},
5607 grep {$superFor->{isa}->{$_}} keys %{$superFor->{isa}});
5608 __DEEP{
5609 for my $from (@from) {
5610 for my $to (@to) {
5611 $self->{db}-><M::ManakaiDISDatabase.getFor>
5612 ($from)->{isa}->{$to} = true;
5613 $self->{db}-><M::ManakaiDISDatabase.getFor>
5614 ($to)->{revISA}->{$from} = true;
5615 }
5616 }
5617 }__;
5618
5619 @Attr:
5620 @@Name: forpURI
5621 @@enDesc:
5622 The <QUOTE::for+> URI references for which this resource is defined.
5623 @@Type: ForURIList
5624 @@Get:
5625 @@@enDesc:
5626 List of <QUOTE::for> URI references. Note that this list is
5627 <QUOTE::dead>.
5628 @@@InCase:
5629 @@@@Value:
5630 @@@@@@: []
5631 @@@@@ContentType: lang|Perl
5632 @@@@enDesc:
5633 The attribute value is always an empty array reference
5634 for a <QUOTE::for> resource.
5635 @@@PerlDef: $r = [];
5636
5637 @Method:
5638 @@Name: isForURI
5639 @@enDesc:
5640 Tests whether this resource is defined for a <QUOTE::for>
5641 or <QUOTE::for+> URI reference or not.
5642 @@Param:
5643 @@@Name:forURI
5644 @@@Type:ForURI
5645 @@@enDesc:
5646 A <QUOTE::for> URI reference to test.
5647 @@Return:
5648 @@@Type:
5649 DOMMain:boolean
5650 @@@TrueCase:
5651 @@@@enDesc:
5652 This resource is for <P::forURI>. The attribute
5653 always takes this value for <QUOTE::for> resources.
5654 @@@PerlDef: $r = true;
5655
5656 @Attr:
5657 @@ForCheck: ManakaiDOM|ForClass
5658 @@Name: nameURI
5659 @@Type: NameURI
5660 @@enDesc:
5661 The URI reference of this module, without
5662 <QUOTE::for> identifier.
5663 @@Get:
5664 @@@enDesc:
5665 The attribute value is always equals to
5666 <A::DISAnyResource.uri> for <QUOTE::for> resources.
5667 @@@PerlDef: $r = $self->{uri};
5668
5669 @CMethod:
5670 @@Name: getSuperResourceURIList
5671 @@enDesc:
5672 Returns a snapshot list of super-resources URIs of the resource,
5673 including canonical and alias URIs of the resource itself.
5674 @@Return:
5675 @@@Type: URIList
5676 @@@enDesc:
5677 A snapshot list of URIs.
5678 @@@PerlDef:
5679 $r = [
5680 (grep {$self->{isa}->{$_}} keys %{$self->{isa}}),
5681 (grep {$self->{aliasURI}->{$_}} keys %{$self->{aliasURI}}),
5682 ($self->{uri}),
5683 ];
5684
5685 @@Test:
5686 @@@QName: DISFor.getSuperResourceURIList.test
5687 @@@PerlDef:
5688 my $db;
5689 __CODE{createDISDBForTest:: $db => $db}__;
5690
5691 my $res1 = $db-><M::DISDatabase.getFor> ('about:1');
5692
5693 my %list1 = map {$_ => true} @{$res1-><M::DISAnyResource
5694 .getSuperResourceURIList>};
5695
5696 $test->assert_true ($list1{'about:1'});
5697 $test->assert_false ($list1{'about:2'});
5698 $test->assert_true ($list1{<Q::ManakaiDOM:all>});
5699
5700 my $res2 = $db-><M::DISDatabase.getFor> ('about:2');
5701 $res1-><M::DISFor.addISA> ($res2);
5702
5703 my %list1_2 = map {$_ => true} @{$res1-><M::DISAnyResource
5704 .getSuperResourceURIList>};
5705
5706 $test->assert_true ($list1_2{'about:1'});
5707 $test->assert_true ($list1_2{'about:2'});
5708 $test->assert_true ($list1_2{<Q::ManakaiDOM:all>});
5709
5710 my %list2 = map {$_ => true} @{$res2-><M::DISAnyResource
5711 .getSuperResourceURIList>};
5712
5713 $test->assert_false ($list2{'about:1'});
5714 $test->assert_true ($list2{'about:2'});
5715 $test->assert_true ($list2{<Q::ManakaiDOM:all>});
5716 ##DISFor
5717
5718 IFClsDef:
5719 @IFQName: DISResource
5720 @ClsQName: ManakaiDISResourceDefinition
5721
5722 @ClsISA: ManakaiDISResourceMV
5723 @ClsISA: dp|ManakaiDISResourcePerl
5724 @ClsISA: ManakaiDISPerlModuleDefinition
5725 @ClsISA: dp|ManakaiDISAnyResourcePerl
5726 @ClsISA: ManakaiDISPropertyAccessor
5727 @ClsISA: ManakaiDISAnyResource
5728
5729 @enDesc:
5730 <QUOTE::dis> resource definitions.
5731
5732 @enDesc:
5733 @@ForCheck: ManakaiDOM|ForIF
5734 @@@:
5735 The objects implementing the <IF::DISResource> interface
5736 <kwd:MUST> also implement the <IF::DISAnyResource> interface.
5737
5738 @Attr:
5739 @@ForCheck: ManakaiDOM|ForClass
5740 @@Name: uris
5741 @@Type:
5742 DISPerl:Array
5743 @@enDesc:
5744 Returns the current <EM::snapshot> of the URI references
5745 for this resource, including the alias URI references.
5746 @@Get:
5747 @@@PerlDef:
5748 $r = [grep {$self->{aliasURI}->{$_}} keys %{$self->{aliasURI}}];
5749
5750 @Method:
5751 @@Name: isSubsetOfURI
5752 @@Description:
5753 @@@lang:en
5754 @@@@:
5755 Whether this resource is a subset of another resource or not.
5756 @@Param:
5757 @@@Name: superURI
5758 @@@Type: ResourceURI
5759 @@@Description:
5760 @@@@lang:en
5761 @@@@@:
5762 Another resource URI reference to test.
5763 @@NamedParam:
5764 @@@Name: srinfo
5765 @@@Type: DISPerl|HASH
5766 @@@enDesc:
5767 The <CODE::srinfo> hash.
5768 @@@nullCase:
5769 @@@@enDesc:
5770 No <CODE::srinfo>.
5771 @@Return:
5772 @@@Type:
5773 DOMMain:boolean
5774 @@@TrueCase:
5775 @@@@enDesc:
5776 <P::superURI> is a super-resource of this resource.
5777 @@@FalseCase:
5778 @@@@enDesc:
5779 <P::superURI> is not a super-resource of this resource.
5780 @@@PerlDef:
5781 $r = $self->{aliasURI}->{$superURI} || $self->{subOf}->{$superURI};
5782 if (not $r and $srinfo) {
5783 A: {
5784 if ($srinfo->{resource}->{$superURI}) {
5785 for my $this_uri (grep {$self->{aliasURI}->{$_}}
5786 keys %{$self->{aliasURI}}) {
5787 if ($srinfo->{resource}->{$superURI}->{aliasURI}->{$this_uri}) {
5788 $r = true;
5789 last A;
5790 }
5791 if ($srinfo->{resource}->{$superURI}->{supOf}->{$this_uri}) {
5792 $r = true;
5793 last A;
5794 }
5795 }
5796 }
5797 for my $this_uri (grep {$self->{aliasURI}->{$_}}
5798 keys %{$self->{aliasURI}}) {
5799 if ($srinfo->{resource}->{$this_uri}) {
5800 if ($srinfo->{resource}->{$this_uri}->{aliasURI}->{$superURI}) {
5801 $r = true;
5802 last A;
5803 }
5804 }
5805 }
5806 } # A
5807 }
5808
5809 @Method:
5810 @@Name: addSuperResource
5811 @@enDesc:
5812 Adds a <QUOTE::dis> resource to the list of super-resource
5813 of this <QUOTE::dis> resource.
5814 @@Param:
5815 @@@Name: superRes
5816 @@@Type: DISResource
5817 @@@clsActualType: ManakaiDISResourceDefinition
5818 @@@enDesc:
5819 A <QUOTE::dis> resource definition object.
5820 @@NamedParam:
5821 @@@Name: srinfo
5822 @@@Type: DISPerl|HASH
5823 @@@enDesc:
5824 The <CODE::srinfo> hash.
5825 @@@nullCase:
5826 @@@@enDesc:
5827 No <CODE::srinfo>.
5828 @@Return:
5829 @@@PerlDef:
5830 my @from = ($self->{uri},
5831 grep {$self->{supOf}->{$_}} keys %{$self->{supOf}||{}});
5832 my @to = ($superRes->{uri},
5833 grep {$superRes->{subOf}->{$_}} keys %{$superRes->{subOf}||{}});
5834 __DEEP{
5835 for my $from (@from) {
5836 for my $to (@to) {
5837 $self->{db}-><M::ManakaiDISDatabase.getResource>
5838 ($from)->{subOf}->{$to} = true;
5839 $srinfo->{resource}->{$from}->{subOf}->{$to} = true;
5840 $self->{db}-><M::ManakaiDISDatabase.getResource>
5841 ($to)->{supOf}->{$from} = true;
5842 $srinfo->{resource}->{$to}->{supOf}->{$from} = true;
5843 }
5844 }
5845 }__;
5846
5847 @Method:
5848 @@Name: mergeAsAlias
5849 @@enDesc:
5850 Merges another resource definition as an alias of this resource.
5851 @@Param:
5852 @@@Name: aliasResource
5853 @@@Type: DISResource
5854 @@@clsActualType: ManakaiDISResourceDefinition
5855 @@@enDesc:
5856 A resource to merge.
5857 \
5858 {NOTE:: After merging all references to <P::aliasResource>
5859 should be discarded.
5860 \
5861 }
5862 @@NodeParam:
5863 @@NamedParam:
5864 @@@Name: noEqualityCheck
5865 @@@Type: idl|boolean
5866 @@@enDesc:
5867 Don't throw <X::MERGE_ITSELF_ERR> exception.
5868 @@NamedParam:
5869 @@@Name: srinfo
5870 @@@Type: DISPerl|HASH
5871 @@@enDesc:
5872 The <CODE::srinfo> hash.
5873 @@@nullCase:
5874 @@@@enDesc:
5875 No <CODE::srinfo>.
5876 @@Return:
5877 @@@RaiseException:
5878 @@@@@:MERGE_ITSELF_ERR
5879 @@@@@@enDesc:
5880 An attempt is made to merge this resource itself.
5881 @@@PerlDef:
5882 if (not $noEqualityCheck and $self eq $aliasResource) {
5883 __EXCEPTION{MERGE_ITSELF_ERR::
5884 DIS:uri => {$self-><AG::DISAnyResource.uri>},
5885 DIS:sourceNode => {$node},
5886 }__;
5887 }
5888 for my $uri ($aliasResource->{uri},
5889 grep {$aliasResource->{aliasURI}->{$_}}
5890 keys %{$aliasResource->{aliasURI}}) {
5891 $self->{aliasURI}->{$uri} = true;
5892 $self->{db}->{resDef}->{$uri} = $self;
5893 $self->{subOf}->{$uri} = true;
5894 $self->{supOf}->{$uri} = true;
5895 }
5896 for my $uri (grep {$aliasResource->{subOf}->{$_}}
5897 keys %{$aliasResource->{subOf}||{}}) {
5898 $self->{subOf}->{$uri} = true;
5899 }
5900 for my $uri (grep {$aliasResource->{supOf}->{$_}}
5901 keys %{$aliasResource->{supOf}||{}}) {
5902 $self->{supOf}->{$uri} = true;
5903 }
5904 my @from = grep {$self->{supOf}->{$_}} keys %{$self->{supOf}||{}};
5905 my @to = grep {$self->{subOf}->{$_}} keys %{$self->{subOf}||{}};
5906 __DEEP{
5907 for my $from (@from) {
5908 for my $to (@to) {
5909 $self->{db}-><M::ManakaiDISDatabase.getResource>
5910 ($from)->{subOf}->{$to} = true;
5911 $srinfo->{resource}->{$from}->{subOf}->{$to} = true;
5912 $self->{db}-><M::ManakaiDISDatabase.getResource>
5913 ($to)->{supOf}->{$from} = true;
5914 $srinfo->{resource}->{$to}->{supOf}->{$from} = true;
5915 }
5916 }
5917 }__;
5918
5919 @Attr:
5920 @@Name: disDataTypeResource
5921 @@enDesc:
5922 The resource referenced by <Q::dis:Type> property.
5923
5924 = If the resource has the <Q::dis:Type> property,
5925 then its value references the data type resource.
5926
5927 = If the resource has no <Q::dis:Type> property but
5928 the dynamic parent resource has the <Q::dis:Type> property,
5929 then its value references the data type resource.
5930
5931 = Otherwise, the resource has no associated data type resoruce;
5932 this method throws a <X::NO_DIS_TYPE_ERR> exception.
5933 @@Type: DISResource
5934 @@clsActualType: ManakaiDISResourceDefinition
5935 @@Get:
5936 @@@RaiseException:
5937 @@@@@:NO_DIS_TYPE_ERR
5938 @@@@enDesc:
5939 <Q::dis:Type> attribute is not specified.
5940 @@@PerlDef:
5941 __DEEP{
5942 if (UNIVERSAL::isa ($self->{<Q::dis:Type>}, <IFName::dv|DVURIValue>)) {
5943 $r = $self->{<Q::dis:Type>}-><M::dv|DVURIValue.getResource>
5944 ($self-><AG::DISAnyResource.database>);
5945 } else {
5946 my $pr = $self-><AG::DIS|DISResource.dynamicParentResource>;
5947 $r = $pr-><AG::DISResource.disDataTypeResource> if $pr;
5948 }
5949 }__;
5950 unless ($r) {
5951 __EXCEPTION{NO_DIS_TYPE_ERR::
5952 DIS:uri => {$self-><AG::DISAnyResource.uri>},
5953 DIS:sourceNode => {$self-><AG::DISAnyResource.sourceElement>},
5954 }__;
5955 }
5956
5957 @Attr:
5958 @@Name: disDataTypeValue
5959 @@enDesc:
5960 The <Q::dis:Type> property value for the resource.
5961 @@Get:
5962 @@@Type: dv|DVURIValue
5963 @@@clsActualType: dv|ManakaiDVURIValue
5964 @@@RaiseException:
5965 @@@@@:NO_DIS_TYPE_ERR
5966 @@@@enDesc:
5967 <Q::dis:Type> attribute is not specified.
5968 @@@PerlDef:
5969 __DEEP{
5970 if (UNIVERSAL::isa ($self->{<Q::dis:Type>}, <IFName::dv|DVURIValue>)) {
5971 $r = $self->{<Q::dis:Type>};
5972 } else {
5973 my $pr = $self-><AG::DIS|DISResource.dynamicParentResource>;
5974 $r = $pr-><AG::DISResource.disDataTypeValue> if $pr;
5975 }
5976 }__;
5977 unless ($r) {
5978 __EXCEPTION{NO_DIS_TYPE_ERR::
5979 DIS:uri => {$self-><AG::DISAnyResource.uri>},
5980 DIS:sourceNode => {$self-><AG::DISAnyResource.sourceElement>},
5981 }__;
5982 }
5983
5984 @Attr:
5985 @@Name: disActualDataTypeResource
5986 @@enDesc:
5987 <Q::dis:actualType> attribute value of this resource.
5988 @@Type: DISResource
5989 @@clsActualType: ManakaiDISResourceDefinition
5990 @@Get:
5991 @@@RaiseException:
5992 @@@@@:NO_DIS_TYPE_ERR
5993 @@@@enDesc:
5994 <Q::dis:actualType> attribute is not specified,
5995 and <Q::dis:Type> attribute, neigher.
5996 @@@PerlDef:
5997 __DEEP{
5998 if (UNIVERSAL::isa ($self->{<Q::dis:actualType>},
5999 <IFName::dv|DVURIValue>)) {
6000 $r = $self->{<Q::dis:actualType>}-><M::dv|DVURIValue.getResource>
6001 ($self-><AG::DISAnyResource.database>);
6002 } elsif (UNIVERSAL::isa ($self->{<Q::dis:Type>},
6003 <IFName::dv|DVURIValue>)) {
6004 $r = $self->{<Q::dis:Type>}-><M::dv|DVURIValue.getResource>
6005 ($self-><AG::DISAnyResource.database>);
6006 } else {
6007 my $pr = $self-><AG::DIS|DISResource.dynamicParentResource>;
6008 $r = $pr-><AG::DISResource.disActualDataTypeResource> if $pr;
6009 }
6010 }__;
6011 unless ($r) {
6012 __EXCEPTION{NO_DIS_TYPE_ERR::
6013 DIS:uri => {$self-><AG::DISAnyResource.uri>},
6014 DIS:sourceNode => {$self-><AG::DISAnyResource.sourceElement>},
6015 }__;
6016 }
6017
6018 @Attr:
6019 @@Name: disActualDataTypeValue
6020 @@enDesc:
6021 <Q::dis:actualType> node for this resource.
6022 @@Get:
6023 @@@Type: DISElement
6024 @@@clsActualType: ManakaiDISElement
6025 @@@RaiseException:
6026 @@@@@:NO_DIS_TYPE_ERR
6027 @@@@enDesc:
6028 <Q::dis:actualType> attribute is not specified,
6029 and <Q::dis:Type> attribute, neigher.
6030 @@@PerlDef:
6031 __DEEP{
6032 if (UNIVERSAL::isa ($self->{<Q::dis:actualType>},
6033 <IFName::dv|DVURIValue>)) {
6034 $r = $self->{<Q::dis:actualType>};
6035 } elsif (UNIVERSAL::isa ($self->{<Q::dis:Type>},
6036 <IFName::dv|DVURIValue>)) {
6037 $r = $self->{<Q::dis:Type>};
6038 } else {
6039 my $pr = $self-><AG::DIS|DISResource.dynamicParentResource>;
6040 $r = $pr-><AG::DISResource.disActualDataTypeValue> if $pr;
6041 }
6042 }__;
6043 unless ($r) {
6044 __EXCEPTION{NO_DIS_TYPE_ERR::
6045 DIS:uri => {$self-><AG::DISAnyResource.uri>},
6046 DIS:sourceNode => {$self-><AG::DISAnyResource.sourceElement>},
6047 }__;
6048 }
6049
6050 @IntMethod:
6051 @@Operator:
6052 @@@@: <=>
6053 @@@ContentType:
6054 lang:Perl
6055 @@enDesc:
6056 Compares two resources. If the first character of the
6057 node in the source tree by which the resource is defined
6058 occures before the other resource's first character, then
6059 the former resource is <DFN::less> than the later resource.
6060 If two resources are the same resource, they are <DFN::equal>.
6061 Otherwise, the former resource is <DFN::greater> than
6062 the later resource.
6063
6064 There are two exceptions. If two resources belongs to
6065 two different modules, i.e. their <A::DIS|DISAnyResource.ownerModule>s
6066 are different, the order is not defined. Also, if
6067 one of resources is not yet defined, i.e. one's
6068 <A::DIS|DISAnyResource.isDefined> takes <DOM::false> value,
6069 then the order is not defined. Even in these cases, two
6070 calls for the method with the same parameter would return
6071 the same result while the resources are left unchanged.
6072 @@Param:
6073 @@@Name: anotherResource
6074 @@@Type: DISResource
6075 @@@enDesc: Another resource to compare.
6076 @@Return:
6077 @@@Type:
6078 DOMMain:unsigned-long
6079 @@@PerlDef:
6080 if (UNIVERSAL::isa ($anotherResource,
6081 <ClassName::ManakaiDISResourceDefinition>)) {
6082 $r = $self->{seq} <=> $anotherResource->{seq};
6083 } else {
6084 $r = $self->{uri} <=> $anotherResource;
6085 }
6086
6087 @Method:
6088 @@ForCheck: ManakaiDOM|ForClass
6089 @@ManakaiDOM:isForInternal:1
6090 @@Name: addChildResource
6091 @@enDesc:
6092 Registers a resource as a static child of the resource.
6093 @@Param:
6094 @@@Name: disResource
6095 @@@Type: DIS|DISResource
6096 @@@enDesc:
6097 The resurce to add.
6098 @@Return:
6099 @@@PerlDef:
6100 __DEEP{
6101 push @{$self->{<H::DIS|childResource>}||=[]},
6102 $disResource-><AG::DIS|DISAnyResource.uriRef>;
6103 }__;
6104
6105 @Method:
6106 @@ForCheck: ManakaiDOM|ForClass
6107 @@ManakaiDOM:isForInternal:1
6108 @@Name: addDynamicChildResource
6109 @@enDesc:
6110 Registers a resource as a dynamic child of the resource.
6111 @@Param:
6112 @@@Name: disResource
6113 @@@Type: DIS|DISResource
6114 @@@enDesc:
6115 The resurce to add.
6116 @@Return:
6117 @@@PerlDef:
6118 __DEEP{
6119 push @{$self->{<H::DIS|dynamicChildResource>}||=[]},
6120 $disResource-><AG::DIS|DISAnyResource.uriRef>;
6121 }__;
6122
6123 @Method:
6124 @@Name: getChildResourceList
6125 @@enDesc:
6126 Returns the list of static child resources of the resource.
6127 @@Return:
6128 @@@Type: DIS|ResourceList
6129 @@@enDesc:
6130 The current snapshot of children.
6131 @@@PerlDef:
6132 __DEEP{
6133 my $db = $self-><AG::DIS|DISAnyResource.database>;
6134 $r = [map {
6135 $db-><M::DIS|DISDatabase.getResource> ($$_)
6136 } @{$self->{<H::DIS|childResource>}}];
6137 }__;
6138
6139 @Method:
6140 @@Name: getDynamicChildResourceList
6141 @@enDesc:
6142 Returns the list of dynamic child resources of the resource.
6143 @@Return:
6144 @@@Type: DIS|ResourceList
6145 @@@enDesc:
6146 The current snapshot of children.
6147 @@@PerlDef:
6148 __DEEP{
6149 my $db = $self-><AG::DIS|DISAnyResource.database>;
6150 $r = [map {
6151 $db-><M::DIS|DISDatabase.getResource> ($$_)
6152 } @{$self->{<H::DIS|dynamicChildResource>}}];
6153 }__;
6154
6155 @Method:
6156 @@Name: getChildResourceByType
6157 @@enDesc:
6158 Gets a static child resource selected by its type.
6159 @@Param:
6160 @@@Name:typeURI
6161 @@@Type:ResourceURI
6162 @@@enDesc:
6163 A URI reference identifying a resource type.
6164 @@ImplNote:
6165 @@@lang:en
6166 @@@@:
6167 {ISSUE:: Some inheritance tracing required for
6168 e.g. <Q::DISLang:InputProcessor> and <Q::DOMMain:ReflectGet>?
6169 }
6170 @@Return:
6171 @@@Type: DISResource
6172 @@@clsActualType: ManakaiDISResourceDefinition
6173 @@@enDesc:
6174 The first child resource (in document order) whose
6175 type matches with <P::typeURI>.
6176 @@@nullCase:
6177 @@@@enDesc:
6178 There is no resource whose type is <P::typeURI>.
6179 @@@PerlDef:
6180 __DEEP{
6181 my $db = $self-><AG::DIS|DISAnyResource.database>;
6182 C: for my $cr_uri (@{$self->{<H::DIS:childResource>}||[]}) {
6183 my $cr = $db-><M::DIS|DISDatabase.getResource> ($$cr_uri);
6184 if ($cr-><M::DIS|DISAnyResource.isTypeURI> ($typeURI)) {
6185 $r = $cr;
6186 last C;
6187 }
6188 }
6189 }__;
6190
6191 @Method:
6192 @@Name: getChildResourceListByType
6193 @@enDesc:
6194 Returns a list of child resources of a specific type.
6195 @@Param:
6196 @@@Name: typeURI
6197 @@@Type: DIS|AnyURI
6198 @@@enDesc:
6199 A URI of the type.
6200 @@Return:
6201 @@@Type: DIS|ResourceList
6202 @@@enDesc:
6203 The current snapshot of the child resources of type <P::typeURI>.
6204 @@@PerlDef:
6205 __DEEP{
6206 my $db = $self-><AG::DIS|DISAnyResource.database>;
6207 $r = [grep {
6208 $_-><M::DIS|DISAnyResource.isTypeURI> ($typeURI)
6209 } map {
6210 $db-><M::DIS|DISDatabase.getResource> ($$_)
6211 } @{$self->{<H::DIS|childResource>}||[]}];
6212 }__;
6213
6214 @Method:
6215 @@Name: getChildResourceByNameAndType
6216 @@enDesc:
6217 Gets a static child resource selected by its local name and type.
6218 @@Param:
6219 @@@Name: localName
6220 @@@Type:
6221 DISCore:LocalName
6222 @@@enDesc:
6223 A local name.
6224 @@Param:
6225 @@@Name:typeURI
6226 @@@Type:ResourceURI
6227 @@@enDesc:
6228 A URI reference identifying a resource type.
6229 @@Return:
6230 @@@Type: DISResource
6231 @@@clsActualType: ManakaiDISResourceDefinition
6232 @@@enDesc:
6233 The first (by document order) child resource whose
6234 type matches for <P::localName> and <P::typeURI>.
6235 @@@nullCase:
6236 @@@@enDesc:
6237 There is no resource whose name is <P::localName> and
6238 whose type is <P::typeURI>.
6239 @@@PerlDef:
6240 __DEEP{
6241 my $db = $self-><AG::DIS|DISAnyResource.database>;
6242 C: for my $cr_uri (@{$self->{<H::DIS:childResource>}||[]}) {
6243 my $cr = $db-><M::DIS|DISDatabase.getResource> ($$cr_uri);
6244 my $ln = $cr-><AG::DIS|DISAnyResource.localName>;
6245 if (defined $ln and $ln eq $localName and
6246 $cr-><M::DIS|DISAnyResource.isTypeURI> ($typeURI)) {
6247 $r = $cr;
6248 last C;
6249 }
6250 }
6251 }__;
6252
6253 @Method:
6254 @@Name: getConstResourceByName
6255 @@enDesc:
6256 Gets a constant value resource by its local name.
6257 @@Param:
6258 @@@Name:localName
6259 @@@Type:
6260 DISLang:String
6261 @@@enDesc:
6262 Constant name.
6263 @@Return:
6264 @@@Type: DISResource
6265 @@@clsActualType: ManakaiDISResourceDefinition
6266 @@@enDesc:
6267 The constant resource identified by <P::localName>.
6268 @@@nullCase:
6269 @@@@enDesc:
6270 There is no such constant resource.
6271 @@@PerlDef:
6272 __DEEP{
6273 my @constGroup;
6274 my $db = $self-><AG::DIS|DISAnyResource.database>;
6275 C: for my $cr_uri (@{$self->{<H::DIS:childResource>}||[]}) {
6276 my $cr = $db-><M::DIS|DISDatabase.getResource> ($$cr_uri);
6277 my $ln = $cr-><AG::DIS|DISAnyResource.localName>;
6278 if ($ln and $ln eq $localName and
6279 $cr-><M::DIS|DISAnyResource.isTypeURI> (<Q::DISLang:Const>)) {
6280 $r = $cr;
6281 last C;
6282 } elsif ($cr-><M::DIS|DISAnyResource.isTypeURI>
6283 (<Q::DISLang:ConstGroup>)) {
6284 push @constGroup, $cr;
6285 }
6286 }
6287 unless ($r) {
6288 D: for my $cg (@constGroup) {
6289 $r = $cg-><M::DIS|DISResource.getChildResourceByNameAndType>
6290 ($localName, <Q::DISLang:Const>);
6291 last D if $r;
6292 }
6293 }
6294 }__;
6295
6296 @Attr:
6297 @@Name: parentResource
6298 @@enDesc:
6299 The static parent resource of the resource.
6300 @@Type: DIS|DISResource
6301 @@nullCase:
6302 @@@enDesc: No parent resource.
6303 @@Get:
6304 @@@PerlDef:
6305 __DEEP{
6306 if ($self->{<H::DIS|parentResource>}) {
6307 $r = $self-><AG::DIS|DISAnyResource.database>
6308 -><M::DIS|DISDatabase.getResource>
6309 (${$self->{<H::DIS|parentResource>}});
6310 }
6311 }__;
6312 @@Set:
6313 @@@ForCheck: ManakaiDOM|ForClass
6314 @@@PerlDef:
6315 __DEEP{
6316 if ($given) {
6317 $self->{<H::DIS|parentResource>}
6318 = $given-><AG::DIS|DISAnyResource.uriRef>;
6319 } else {
6320 CORE::delete $self->{<H::DIS|parentResource>};
6321 }
6322 }__;
6323
6324 @Attr:
6325 @@Name: dynamicParentResource
6326 @@enDesc:
6327 The dynamic parent resource of the resource.
6328 @@Type: DIS|DISResource
6329 @@nullCase:
6330 @@@enDesc: No parent resource.
6331 @@Get:
6332 @@@PerlDef:
6333 __DEEP{
6334 if ($self->{<H::DIS|dynamicParentResource>}) {
6335 $r = $self-><AG::DIS|DISAnyResource.database>
6336 -><M::DIS|DISDatabase.getResource>
6337 (${$self->{<H::DIS|dynamicParentResource>}});
6338 }
6339 }__;
6340 @@Set:
6341 @@@ForCheck: ManakaiDOM|ForClass
6342 @@@PerlDef:
6343 __DEEP{
6344 if ($given) {
6345 $self->{<H::DIS|dynamicParentResource>}
6346 = $given-><AG::DIS|DISAnyResource.uriRef>;
6347 } else {
6348 CORE::delete $self->{<H::DIS|dynamicParentResource>};
6349 }
6350 }__;
6351
6352 @Attr:
6353 @@Name: ownerClassNodeURI
6354 @@enDesc:
6355 The node URI reference of the class resource this resource
6356 belongs to.
6357 @@Type: ResourceURI
6358 @@Get:
6359 @@@enDesc:
6360 The URI reference of the <Q::ManakaiDOM:Class> resource.
6361 If this resource is a class, then the URI reference
6362 of this resource is returned.
6363 @@@nullCase:
6364 @@@@enDesc:
6365 This resource does not belong to any class.
6366 @@@PerlDef:
6367 if (exists $self->{<H::DIS:ownerClass>}) {
6368 $r = $self->{<H::DIS:ownerClass>};
6369 } else {
6370 my $res = $self;
6371 __DEEP{
6372 RES: {
6373 if ($res-><M::DISAnyResource.isTypeURI>
6374 (<Q::ManakaiDOM:Class>)) {
6375 $r = $res-><AG::DISAnyResource.sourceNodeID>;
6376 } else {
6377 $res = $res-><AG::DIS|DISResource.parentResource>;
6378 redo RES if $res;
6379 }
6380 }
6381 }__;
6382 $self->{<H::DIS:ownerClass>} = $r;
6383 }
6384
6385 @Attr:
6386 @@Name: disIsNullValue
6387 @@enDesc:
6388 Whether this resource have <DOM::null> value or not.
6389 A resource have <DOM::null> value iff it has
6390 <Q::dis:Value> attribute node that in turn has
6391 <Q::dis:is-null> attribute whose value set to <DOM::true>.
6392 @@Type:
6393 DOMMain:boolean
6394 @@Get:
6395 @@@PerlDef:
6396 if ($self->{<Q::dis:Value>}) {
6397 $r = $self->{<Q::dis:Value>}-><AG::dv|DVValue.isNull>;
6398 }
6399
6400 @Attr:
6401 @@Name: featureNameList
6402 @@enDesc:
6403 The list of the names of the feature defined by this resource.
6404
6405 = If the resource has one or more <Q::dis:AppName> attributes,
6406 their text values are feature names.
6407
6408 = If there is no <Q::dis:AppName> attributes but the resource
6409 is a <Q::DOMFeature:instanceOf> another feature, then
6410 the set of the feature names of the resource is equal
6411 to the one of another feature's feature names.
6412
6413 {OLI:: If two operation above does not result in one or more
6414 feature names,
6415
6416 = and if the resource has a name (the <A::DISAnyResource
6417 .isAnonymous> attribute returns <DOM::false>), then
6418 the <A::DISAnyResource.nameURI> of the resource is
6419 a feature name.
6420
6421 = otherwise, i.e. <A::DISAnyResource.isAnonymous> is
6422 <DOM::true>, then the <A::DISAnyResource.localName>
6423 of the resource, if non-<DOM::null>, is a feature name.
6424
6425 }
6426
6427 @@Type:
6428 DISPerl:ARRAY
6429 @@Get:
6430 @@@enDesc:
6431 A reference to the array containing feature names.
6432 Note that the order in the array is <EM::not> significant.
6433 The array might be empty if the resource has no feature name.
6434 This array is dead.
6435
6436 {NOTE:: The attribute value array might be non-empty
6437 even if the resource is not of type <Q::DOMFeature:Feature>
6438 as far as the algorithm defined above returns
6439 some feature names.
6440 }
6441 @@@RaiseException:
6442 @@@@@: NO_SOURCE_NODE_ERR
6443 @@@@enDesc:
6444 This resource definition does not have associated node
6445 in the source tree.
6446 @@@PerlDef:
6447 __DEEP{
6448 $r = [map {lc} @{$self-><M::DISResourceProp.getPropertyTextList>
6449 (<Q::DOMFeature:name>)}];
6450 unless (@$r) {
6451 ## TODO: instance feature
6452 my $pr = $self-><AG::DIS|DISResource.parentResource>;
6453 if ($pr) {
6454 if ($pr-><M::DISAnyResource.isTypeURI> (<Q::DOMFeature:Feature>) and
6455 not $pr-><AG::DISAnyResource.isAnonymous>) {
6456 push @$r, @{$pr-><AG::DISResource.featureNameList>};
6457 }
6458 }
6459 }
6460 unless (@$r) {
6461 if ($self-><AG::DISAnyResource.isAnonymous>) {
6462 my $ln = $self-><AG::DISAnyResource.localName>;
6463 push @$r, lc $ln if defined $ln;
6464 } else {
6465 push @$r, lc $self-><AG::DISAnyResource.nameURI>;
6466 }
6467 }
6468 }__;
6469
6470 @Attr:
6471 @@Name: multiplePropertiesURI
6472 @@enDesc:
6473 Whether the property allows multiple occurence of the attribute
6474 in the <QUOTE::dis> source tree.
6475 @@Type: DISLang|String
6476 @@Get:
6477 @@@PerlDef:
6478 __DEEP{
6479 if ($self->{<Q::dis|multipleProperties>}) {
6480 $r = $self->{<Q::dis|multipleProperties>}
6481 -><M::dv|DVURIValue.getResource>
6482 ($self-><AG::DISAnyResource.database>)
6483 -><AG::DISAnyResource.uri>;
6484 } else {
6485 $r = <Q::DISCore|OrderedList>;
6486 }
6487 }__;
6488
6489 @Attr:
6490 @@Name: defaultLextypeURI
6491 @@enDesc:
6492 The URI of the default lexical type for the <QUOTE::dis> attribute.
6493 @@Type: DISLang|String
6494 @@Get:
6495 @@@PerlDef:
6496 __DEEP{
6497 if ($self->{<Q::dis:dataType>}) {
6498 $r = $self->{<Q::dis:dataType>}
6499 -><M::dv|DVURIValue.getResource>
6500 ($self-><AG::DISAnyResource.database>)
6501 -><AG::DISAnyResource.uri>;
6502 } else {
6503 $r = <Q::DISCore|String>;
6504 }
6505 }__;
6506
6507 @CMethod:
6508 @@Name: getSuperResourceURIList
6509 @@enDesc:
6510 Returns a snapshot list of super-resources URIs of the resource,
6511 including canonical and alias URIs of the resource itself.
6512 @@Return:
6513 @@@Type: URIList
6514 @@@enDesc:
6515 A snapshot list of URIs.
6516 @@@PerlDef:
6517 $r = [
6518 (grep {$self->{subOf}->{$_}} keys %{$self->{subOf}}),
6519 (grep {$self->{aliasURI}->{$_}} keys %{$self->{aliasURI}}),
6520 ];
6521
6522 @@Test:
6523 @@@QName: DISResource.getSuperResourceURIList.test
6524 @@@PerlDef:
6525 my $db;
6526 __CODE{createDISDBForTest:: $db => $db}__;
6527
6528 my $res1 = $db->get_resource ('about:test1');
6529 my $res2 = $db->get_resource ('about:test2');
6530 $res1->add_super_resource ($res2);
6531
6532 my %list1 = map {$_ => true} @{$res1->get_super_resource_uri_list};
6533 $test->id ('res1.itself');
6534 $test->assert_true ($list1{'about:test1'});
6535 $test->id ('res1.res2');
6536 $test->assert_true ($list1{'about:test2'});
6537
6538 my %list2 = map {$_ => true} @{$res2->get_super_resource_uri_list};
6539 $test->id ('res2.itself');
6540 $test->assert_true ($list2{'about:test2'});
6541 $test->id ('res2.res1');
6542 $test->assert_false ($list2{'about:test1'});
6543
6544 @Method:
6545 @@ForCheck: ManakaiDOM|ForIF
6546 @@Name: isTypeURI
6547 @@enImplNote: For compatibility with old code.
6548 ##DISResource
6549
6550 ResourceDef:
6551 @QName: String
6552 @AliasFor: DISLang|String
6553
6554 ResourceDef:
6555 @QName: RevisionNumber
6556 @AliasFor: idl|unsignedLong
6557 @enImplNote:
6558 {ISSUE::
6559 Should be <Q::idl|unsignedLongLong>?
6560 }
6561
6562 PropDef:
6563 @QName: DIS|revision
6564 @DIS:key: r
6565
6566 ElementTypeBinding:
6567 @Name: Test
6568 @ElementType:
6569 dis:ResourceDef
6570 @ShadowContent:
6571 @@rdf:type: test|StandaloneTest
6572 @@ForCheck: ManakaiDOM|ForClass
6573
6574 DataTypeDef:
6575 @QName: URIList
6576 @rdfs:subClassOf: DISPerl|ARRAY
6577
6578 IFClsDef:
6579 @IFQName: DISResourceMV
6580 @ClsQName: ManakaiDISResourceMV
6581
6582 @enDesc:
6583 The objects implementing the <IF::DISResourceMV> <kwd:MUST>
6584 also implement the <IF::DISResource> interface.
6585
6586 @Attr:
6587 @@Name: mvLocalName
6588 @@enDesc:
6589 The local name of the markup vocabulary element defined by this
6590 resource.
6591 @@Type:
6592 DISLang:String
6593 @@Get:
6594 @@@nullCase:
6595 @@@@enDesc:
6596 Either this resource does not define a markup vocabulary element
6597 or it does define an element but it does not have a local name.
6598 @@@PerlDef:
6599 __DEEP{
6600 if (UNIVERSAL::isa ($self->{<Q::dis|AppName>},
6601 <IFName::dv|DVQNameValue>)) {
6602 $r = $self->{<Q::dis|AppName>}-><AG::dv|DVQNameValue.localName>;
6603 } elsif (defined $self->{<Q::dis|AppName>}) {
6604 $r = $self->{<Q::dis|AppName>}-><AG::dv|DVValue.stringValue>;
6605 } else {
6606 $r = $self-><AG::DIS|DISAnyResource.localName>;
6607 }
6608 }__;
6609
6610 @Attr:
6611 @@Name: mvPrefix
6612 @@enDesc:
6613 A typical namespace prefix of the markup vocabulary element defined
6614 by this resource.
6615 @@Type:
6616 DISLang:String
6617 @@Get:
6618 @@@nullCase:
6619 @@@@enDesc:
6620 Either this resource does not define a markup vocabulary element
6621 or it does define an element but it does not have a namespace URI.
6622 @@@PerlDef:
6623 __DEEP{
6624 if (UNIVERSAL::isa ($self->{<Q::dis|AppName>},
6625 <IFName::dv|DVQNameValue>)) {
6626 $r = $self->{<Q::dis|AppName>}-><AG::dv|DVQNameValue.prefix>;
6627 }
6628 unless (defined $r) {
6629 my $nsuri = $self-><AG::DISResourceMV.mvNamespaceURI>;
6630 if (defined $nsuri and $nsuri =~ /([A-Za-z]\w*)\W*$/) {
6631 $r = $1;
6632 } elsif (defined $nsuri) {
6633 $r = 'ns';
6634 }
6635 }
6636 }__;
6637
6638 @Attr:
6639 @@Name: mvNamespaceURI
6640 @@enDesc:
6641 The namespace URI of the markup vocabulary element defined by this
6642 resource.
6643 @@Type: AnyURI
6644 @@Get:
6645 @@@nullCase:
6646 @@@@enDesc:
6647 Either this resource does not define a markup vocabulary element
6648 or it does define an element but it does not have a namespace URI.
6649 @@@PerlDef:
6650 __DEEP{
6651 if (UNIVERSAL::isa ($self->{<Q::dis|AppName>},
6652 <IFName::dv|DVQNameValue>)) {
6653 $r = $self->{<Q::dis|AppName>}-><AG::dv|DVQNameValue.namespaceURI>;
6654 } elsif (defined $self->{<Q::dis|AppName>}) {
6655 $r = null;
6656 } else {
6657 $r = $self-><AG::DIS|DISAnyResource.namespaceURI>;
6658 }
6659 }__;
6660
6661 @Attr:
6662 @@Name: mvOwnerElementResource
6663 @@enDesc:
6664 An <QUOTE::owner element> resource of the markup vocabulary
6665 element defined by this resource.
6666 @@Type: DISResource
6667 @@clsActualType: ManakaiDISResourceDefinition
6668 @@Get:
6669 @@@nullCase:
6670 @@@@enDesc:
6671 Either this resource does not define a markup vocabulary element
6672 or it does define an element but it does not have an owner.
6673 @@@PerlDef:
6674 __DEEP{
6675 if (exists $self->{<H::DIS:mvOwnerElementURI>}) {
6676 $r = $self-><AG::DISAnyResource.database>
6677 -><M::DISDatabase.getResource>
6678 ($self->{<H::DIS:mvOwnerElementURI>})
6679 if defined $self->{<H::DIS:mvOwnerElementURI>};
6680 } else {
6681 $r = $self-><AG::DIS|DISResource.parentResource>;
6682 undef $r if $r and not $r-><M::DIS|DISAnyResource
6683 .isTypeURI> (<Q::s:AnyOwnerElement>);
6684 $self->{<H::DIS:mvOwnerElementURI>} = $r-><AG::DISAnyResource.uri>
6685 if $r;
6686 }
6687 }__;
6688 ##DISResourceMV
6689
6690 PropDef:
6691 @QName: mvLocalName
6692 @enDesc:
6693 <A::ManakaiDISResourceDefinition.mvLocalName>.
6694
6695 PropDef:
6696 @QName: mvPrefix
6697 @enDesc:
6698 <A::ManakaiDISResourceDefinition.mvPrerix>.
6699
6700 PropDef:
6701 @QName: mvNamespaceURI
6702 @enDesc:
6703 <A::ManakaiDISResourceDefinition.mvNamespaceURI>.
6704
6705 PropDef:
6706 @QName: mvOwnerElementURI
6707 @enDesc:
6708 <A::ManakaiDISResourceDefinition.mvOwnerElementResource>
6709 (<QUOTE::dis> resource URI reference).
6710
6711 PropDef:
6712 @QName: ownerClass
6713 @enDesc:
6714 The class to which this resource belongs.
6715 @Type: ResourceURI
6716 @rdfs:range:
6717 rdf:Resource
6718 @rdfs:domain:
6719 ManakaiDOM:Class
6720
6721 ResourceDef:
6722 @QName: SWCFGNode
6723 @AliasFor:
6724 swcfg21:SWCFGNode
6725
6726 ResourceDef:
6727 @QName: SWCFGElement
6728 @AliasFor:
6729 swcfg21:SWCFGElement
6730
6731 ResourceDef:
6732 @QName: SWCFGDoc
6733 @AliasFor:
6734 swcfg21:SWCFGDocument
6735
6736 ResourceDef:
6737 @QName: DOMImpl
6738 @AliasFor: c|DOMImplementation
6739
6740 XParamDef:
6741 @QName: sourceNodePath
6742 @enDesc:
6743 A node path string of the source node.
6744
6745 XParamDef:
6746 @QName: errResource
6747 @enDesc:
6748 A resource on which an error has occurred.
6749
6750 XParamDef:
6751 @QName: generatedName
6752 @enDesc:
6753 A generated name.
6754
6755 IFClsDef:
6756 @IFQName: DISResourceProp
6757 @ClsQName: ManakaiDISPropertyAccessor
6758
6759 @enDesc:
6760 Accessor methods for resource or module properties.
6761
6762 @Method:
6763 @@Name: getPropertyValue
6764 @@enDesc:
6765 Returns a property value object.
6766 @@PropNameParam:
6767 @@Return:
6768 @@@Type: dv|DVValue
6769 @@@enDesc: The property value.
6770 @@@nullCase:
6771 @@@@enDesc:
6772 The property has no value.
6773 @@@PerlDef:
6774 if ($self->{$propName}) {
6775 $r = $self->{$propName}->[0];
6776 } else {
6777 my $pr = $self-><AG::DISAnyResource.database>
6778 -><M::DISDatabase.getResource> ($propName);
6779 A: for (grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}}
6780 (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})) {
6781 my $v = $self->{$_};
6782 if ($v) {
6783 $r = $v->[0];
6784 last A;
6785 }
6786 }
6787 }
6788
6789 @Method:
6790 @@Name: getPropertyValueList
6791 @@enDesc:
6792 Returns a property value objects.
6793 @@PropNameParam:
6794 @@Return:
6795 @@@Type: DISPerl|ARRAY
6796 @@@enDesc: The property value.
6797 @@@PerlDef:
6798 my $pr = $self-><AG::DISAnyResource.database>
6799 -><M::DISDatabase.getResource> ($propName);
6800 $r = [map {@$_}
6801 grep {defined $_}
6802 map {$self->{$_}}
6803 grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}}
6804 (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})];
6805
6806 @Method:
6807 @@Name: getPropertyBoolean
6808 @@enDesc:
6809 Gets boolean property value.
6810 @@PropNameParam:
6811 @@Param:
6812 @@@Name:default
6813 @@@Type:
6814 DOMMain:boolean
6815 @@@enDesc:
6816 The default value that is returned if no explicit property
6817 value specification found for this resource.
6818 @@Return:
6819 @@@Type:
6820 DOMMain:boolean
6821 @@@enDesc:
6822 The property value.
6823 @@@PerlDef:
6824 if (ref $self->{$propName}) {
6825 $r = $self->{$propName}-><AG::dv|DVValue.value> ? true : false;
6826 $r = $default unless defined $r;
6827 } else {
6828 my $pr = $self-><AG::DISAnyResource.database>
6829 -><M::DISDatabase.getResource> ($propName);
6830 C: {
6831 for (map {$self->{$_}}
6832 grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}}
6833 (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})) {
6834 if (defined $_) {
6835 $r = $_-><AG::dv|DVValue.value> ? true : false;
6836 last C;
6837 }
6838 }
6839 $r = $default;
6840 } # C
6841 }
6842
6843 @Method:
6844 @@Name: getPropertyText
6845 @@enDesc:
6846 Gets property value text.
6847 @@PropNameParam:
6848 @@Param:
6849 @@@Name:default
6850 @@@Type:
6851 swcfg21:SWCFGString
6852 @@@enDesc:
6853 The default value that is returned if no explicit property
6854 value specification found for this resource.
6855 @@@nullCase:
6856 @@@@enDesc:
6857 No default value supplied; <DOM::null> is returned if
6858 no value specified.
6859 @@Return:
6860 @@@Type:
6861 swcfg21:SWCFGString
6862 @@@enDesc:
6863 The property value string.
6864 @@@nullCase:
6865 @@@@enDesc:
6866 No value nor default value has specified.
6867 @@@PerlDef:
6868 if (defined $self->{$propName}) {
6869 $r = $self->{$propName}-><AG::dv|DVValue.stringValue>;
6870 $r = $default unless defined $r;
6871 } else {
6872 my $pr = $self-><AG::DISAnyResource.database>
6873 -><M::DISDatabase.getResource> ($propName);
6874 C: {
6875 for (map {$self->{$_}}
6876 grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}}
6877 (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})) {
6878 if (defined $_) {
6879 $r = $_-><AG::dv|DVValue.stringValue>;
6880 last C;
6881 }
6882 }
6883 $r = $default;
6884 } # C
6885 }
6886
6887 @Method:
6888 @@Name: getPropertyTextList
6889 @@enDesc:
6890 Returns a list of property value text.
6891 @@PropNameParam:
6892 @@Return:
6893 @@@Type: DISPerl|ARRAY
6894 @@@enDesc:
6895 A list of the property value strings.
6896 @@@PerlDef:
6897 my $pr = $self-><AG::DISAnyResource.database>
6898 -><M::DISDatabase.getResource> ($propName);
6899 $r = [map {$_-><AG::dv|DVValue.stringValue>}
6900 map {@$_}
6901 grep {$_}
6902 map {$self->{$_}}
6903 grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}}
6904 (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})];
6905
6906 @Method:
6907 @@Name: getPropertyResource
6908 @@enDesc:
6909 Gets property value resource.
6910 @@PropNameParam:
6911 @@Return:
6912 @@@Type: DIS|DISAnyResource
6913 @@@enDesc:
6914 The property value resource.
6915 @@@nullCase:
6916 @@@@enDesc:
6917 No value has specified.
6918 @@@UndeclaredPrefixException:
6919 @@@PerlDef:
6920 __DEEP{
6921 my $v = $self-><M::DISResourceProp.getPropertyValue>
6922 ($propName);
6923 if (UNIVERSAL::isa ($v, <IFName::dv|DVURIValue>)) {
6924 $r = $v-><M::dv|DVURIValue.getResource>
6925 ($self-><AG::DISAnyResource.database>);
6926 }
6927 }__;
6928
6929 @Method:
6930 @@Name: getPropertyResourceList
6931 @@enDesc:
6932 Gets property value resource list.
6933 @@PropNameParam:
6934 @@NamedParam:
6935 @@@Name: recursive
6936 @@@Type:
6937 DOMMain:boolean
6938 @@@enDesc:
6939 Whether property resource values of this resource
6940 should also be included to the returned list or not.
6941 @@NamedParam:
6942 @@@Name: recursiveISA
6943 @@@Type:
6944 DOMMain:boolean
6945 @@@enDesc:
6946 Whether the <Q::dis:ISA> ancestors of the resources
6947 that are property values should also be included in the returned list
6948 or not.
6949 @@@TrueCase:
6950 @@@@enDesc:
6951 If a property value is a resource <VAR::R> and
6952 the resource <VAR::R> does <P::recursiveISAPropName> <VAR::S>, then
6953 the resource <VAR::S> is also a value in the list.
6954 @@@FalseCase:
6955 @@@@enDesc:
6956 Only the resources directly specified as property values is returned.
6957 @@NamedParam:
6958 @@@Name: recursiveISAPropName
6959 @@@Type: DISString
6960 @@@enDesc:
6961 The URI of the property used when the <P::recursiveISA>
6962 option is enabled.
6963 @@@nullCase:
6964 @@@@enDesc:
6965 The default value, <Q::dis|ISA>, is used.
6966 @@NamedParam:
6967 @@@Name: isaRecursive
6968 @@@Type:
6969 DOMMain:boolean
6970 @@@enDesc:
6971 Whether property resource values of <Q::dis:ISA> resources
6972 of this resource should also be included to the returned list or not.
6973 @@@TrueCase:
6974 @@@@enDesc:
6975 If this resource does <P::isaRecursivePropName> another resource
6976 <VAR::S> and the <VAR::S> resource has a <P::propName>
6977 property value of <VAR::R>, then the resource <VAR::R>
6978 is also a value in the list.
6979 @@@FalseCase:
6980 @@@@enDesc:
6981 Only the resource directly specified is the returned.
6982 @@NamedParam:
6983 @@@Name: isaRecursivePropName
6984 @@@Type: DISString
6985 @@@enDesc:
6986 The URI of the property used when the <P::isaRecursive>
6987 option is enabled.
6988 @@@nullCase:
6989 @@@@enDesc:
6990 The default value, <Q::dis|ISA>, is used.
6991 @@Return:
6992 @@@Type: ResourceList
6993 @@@enDesc:
6994 An array reference of the property value resources.
6995 \
6996 {NOTE:: This list is <QUOTE::dead>.
6997 \
6998 }
6999 @@@UndeclaredPrefixException:
7000 @@@PerlDef:
7001 $r = [];
7002 __DEEP{
7003 my $v = $self-><M::DISResourceProp.getPropertyValueList> ($propName);
7004 my $db = $self-><AG::DISAnyResource.database>;
7005 for my $a (@$v) {
7006 if ($a->isa (<IFName::dv|DVURIValue>)) {
7007 push @$r, $a-><M::dv|DVURIValue.getResource> ($db);
7008 }
7009 if ($isaRecursive) {
7010 my $b = $a-><M::dv|DVValue.getProperty>
7011 (<Q::DISCore:stopISARecursive>);
7012 if ($b and $b-><AG::dv|DVValue.value>) {
7013 $isaRecursive = false;
7014 }
7015 }
7016 }
7017 }__;
7018
7019 if ($recursive) {
7020 __DEEP{
7021 $opt{___recursive_isa_done} ||= {$self-><AG::anyres.uri> => true};
7022 my @p_res = @$r;
7023 for my $p_res (@p_res) {
7024 my $p_res_uri = $p_res-><AG::anyres.uri>;
7025 next if $opt{___recursive_isa_done}->{$p_res_uri};
7026 $opt{___recursive_isa_done}->{$p_res_uri} = true;
7027 push @$r, @{$p_res-><M::DISResourceProp.getPropertyResourceList>
7028 ($propName, recursive => true,
7029 recursive_isa => $recursiveISA,
7030 ___recursive_isa_done => $opt{___recursive_isa_done})};
7031 }
7032 }__;
7033 }
7034 if ($recursiveISA) {
7035 __DEEP{
7036 $recursiveISAPropName = <Q::dis|ISA>
7037 unless defined $recursiveISAPropName;
7038 $opt{___recursive_isa_done} ||= {$self-><AG::anyres.uri> => true};
7039 my @p_res = @$r;
7040 for my $p_res (@p_res) {
7041 my $p_res_uri = $p_res-><AG::anyres.uri>;
7042 next if $opt{___recursive_isa_done}->{$p_res_uri};
7043 $opt{___recursive_isa_done}->{$p_res_uri} = true;
7044 push @$r, @{$p_res-><M::DISResourceProp.getPropertyResourceList>
7045 ($recursiveISAPropName,
7046 recursive => true,
7047 ___recursive_isa_done => $opt{___recursive_isa_done})};
7048 }
7049 }__;
7050 }
7051 if ($isaRecursive) {
7052 __DEEP{
7053 $isaRecursivePropName = <Q::dis|ISA>
7054 unless defined $isaRecursivePropName;
7055 my $self_uri = $self-><AG::anyres.uri>;
7056 $opt{___recursive_isa_done} ||= {$self_uri => true};
7057 $opt{___isa_recursive_done} ||= {$self_uri => true};
7058 my @p_res = @{$self-><M::DISResourceProp.getPropertyResourceList>
7059 ($isaRecursivePropName, recursive_isa => false,
7060 recursive => false,
7061 )};
7062 for my $p_res (@p_res) {
7063 my $p_res_uri = $p_res-><AG::anyres.uri>;
7064 next if $opt{___isa_recursive_done}->{$p_res_uri};
7065 $opt{___isa_recursive_done}->{$p_res_uri} = true;
7066 push @$r, @{$p_res-><M::DISResourceProp.getPropertyResourceList>
7067 ($propName, recursive_isa => false,
7068 recursive => false,
7069 isa_recursive => true,
7070 ___isa_recursive_done =>
7071 $opt{___isa_recursive_done})};
7072 }
7073 }__;
7074 }
7075
7076 @Method:
7077 @@Name: addPropertyResourceList
7078 @@enDesc:
7079 Adds a resource to a resource-list property value.
7080 \
7081 {ISSUE:: Should an exception be thrown if the property is
7082 not of list?
7083 \
7084 }
7085 \
7086 {NOTE:: If the property is not <QUOTE::get>ten ever, adding
7087 an item clears the list --- i.e. the property values
7088 in the source tree will be ignored. Call
7089 <M::ManakaiDISPropertyAccessor.getPropertyResourceList>
7090 before adding to avoid this behavior.
7091 \
7092 }
7093 @@PropNameParam:
7094 @@Param:
7095 @@@Name: res
7096 @@@Type: DISResource
7097 @@@clsActualType: ManakaiDISResourceDefinition
7098 @@@enDesc:
7099 A resource to add.
7100 @@Return:
7101 @@@PerlDef:
7102 if ($self->{$propName}) {
7103 my $uriv;
7104 __CODE{dv|createURI::
7105 $uri => {$res-><AG::DISAnyResource.uri>},
7106 $result => $uriv,
7107 $name => $propName,
7108 }__;
7109 $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
7110 } else {
7111 __CODE{dv|createOrderedList::
7112 $result => {$self->{$propName}},
7113 $type => {<Q::DISCore:URI>},
7114 $base_type => {<Q::DISCore:URI>},
7115 }__;
7116 my $uriv;
7117 __CODE{dv|createURI::
7118 $uri => {$res-><AG::DISAnyResource.uri>},
7119 $result => $uriv,
7120 $name => $propName,
7121 }__;
7122 $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
7123 }
7124
7125 @Method:
7126 @@Name: addPropertyResourceUList
7127 @@plMName: add_property_resource_ulist
7128 @@enDesc:
7129 Adds a resource to a resource-list property value.
7130 \
7131 {ISSUE:: Should an exception be thrown if the property is
7132 not of list?
7133 \
7134 }
7135 \
7136 {NOTE:: If the property is not <QUOTE::get>ten ever, adding
7137 an item clears the list --- i.e. the property values
7138 in the source tree will be ignored. Call
7139 <M::ManakaiDISPropertyAccessor.getPropertyResourceList>
7140 before adding to avoid this behavior.
7141 \
7142 }
7143 @@PropNameParam:
7144 @@Param:
7145 @@@Name: res
7146 @@@Type: DISResource
7147 @@@clsActualType: ManakaiDISResourceDefinition
7148 @@@enDesc:
7149 A resource to add.
7150 @@Return:
7151 @@@PerlDef:
7152 if ($self->{$propName}) {
7153 my $uriv;
7154 __CODE{dv|createURI::
7155 $uri => {$res-><AG::DISAnyResource.uri>},
7156 $result => $uriv,
7157 $name => $propName,
7158 }__;
7159 $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
7160 } else {
7161 __CODE{dv|createUnorderedList::
7162 $result => {$self->{$propName}},
7163 $type => {<Q::DISCore:URI>},
7164 $base_type => {<Q::DISCore:URI>},
7165 }__;
7166 my $uriv;
7167 __CODE{dv|createURI::
7168 $uri => {$res-><AG::DISAnyResource.uri>},
7169 $result => $uriv,
7170 $name => $propName,
7171 }__;
7172 $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
7173 }
7174
7175 @Method:
7176 @@Name: addPropertyURIUList
7177 @@plMName: add_peoperty_uri_ulist
7178 @@enDesc:
7179 Adds a resource to a resource-list property value.
7180 \
7181 {ISSUE:: Should an exception be thrown if the property is
7182 not of list?
7183 \
7184 }
7185 \
7186 {NOTE:: If the property is not <QUOTE::get>ten ever, adding
7187 an item clears the list --- i.e. the property values
7188 in the source tree will be ignored. Call
7189 <M::ManakaiDISPropertyAccessor.getPropertyResourceList>
7190 before adding to avoid this behavior.
7191 \
7192 }
7193 @@PropNameParam:
7194 @@Param:
7195 @@@Name: uri
7196 @@@Type: AnyURI
7197 @@@enDesc:
7198 A resource to add.
7199 @@Return:
7200 @@@PerlDef:
7201 __DEEP{
7202 if ($self->{$propName}) {
7203 my $uriv;
7204 __CODE{dv|createURI::
7205 $uri => $uri,
7206 $result => $uriv,
7207 $name => $propName,
7208 }__;
7209 $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
7210 } else {
7211 __CODE{dv|createUnorderedList::
7212 $result => {$self->{$propName}},
7213 $type => {<Q::DISCore|URI>},
7214 $base_type => {<Q::DISCore:URI>},
7215 }__;
7216 my $uriv;
7217 __CODE{dv|createURI::
7218 $uri => $uri,
7219 $result => $uriv,
7220 $name => $propName,
7221 }__;
7222 $self->{$propName}-><M::dv|DVList.addItem> ($uriv);
7223 }
7224 }__;
7225 ##DISResourceProp
7226
7227
7228 ElementTypeBinding:
7229 @Name: TMethods
7230 @ElementType:
7231 dis:ResourceDef
7232 @ShadowContent:
7233 @@DISCore:resourceType:
7234 @@@@: dis|MultipleResource
7235 @@@ForCheck: !ManakaiDOM|ForClass
7236 @@resourceFor: ManakaiDOM|ForClass
7237 @@DISCore:resourceType: DISCore|Resource
7238
7239 ElementTypeBinding:
7240 @Name: TMethod
7241 @ElementType:
7242 dis:ResourceDef
7243 @ShadowContent:
7244 @@ForCheck: ManakaiDOM|ForClass
7245 @@DISCore:resourceType: DIS|Method
7246
7247 ElementTypeBinding:
7248 @Name: TAttr
7249 @ElementType:
7250 dis:ResourceDef
7251 @ShadowContent:
7252 @@ForCheck: ManakaiDOM|ForClass
7253 @@DISCore:resourceType: DIS|Attribute
7254
7255
7256 TMethods:
7257 @TMethod:
7258 @@Name: getErrorInterfaceResource
7259 @@DIS:targetType: dx|Interface
7260 @@Return:
7261 @@@Type: DISAnyResource
7262 @@@PerlDef:
7263 __DEEP{
7264 $r = $self;
7265 }__;
7266 ##dx:Interface
7267
7268 TMethods:
7269 @TMethod:
7270 @@Name: getErrorInterfaceResource
7271 @@DIS:targetType: DISLang|ConstGroup
7272 @@Return:
7273 @@@Type: DISAnyResource
7274 @@@PerlDef:
7275 __DEEP{
7276 my $parent = $self-><AG::DISResource.parentResource>;
7277 if ($parent and
7278 $parent-><M::DISAnyResource.isTypeURI> (<Q::Err|ErrorAny>)) {
7279 $r = $parent;
7280 }
7281 }__;
7282 ##DISLang:ConstGroup
7283
7284 TMethods:
7285 @TMethod:
7286 @@Name: getDOMConfigurationParameterName
7287 @@DIS:targetType: DOMCore|DOMConfigurationParameter
7288 @@Return:
7289 @@@Type: DISString
7290 @@@PerlDef:
7291 __DEEP{
7292 $r = $self-><M::DIS|DISResourceProp.getPropertyText>
7293 (<Q::DOMCore:domConfigurationParameterName>);
7294 unless (defined $r) {
7295 $r = $self-><AG::DISAnyResource.nameURI>;
7296 }
7297 $r = lc $r if defined $r;
7298 }__;
7299 ##DOMCore|DOMConfigurationParameter
7300
7301 TMethods:
7302 @TMethod:
7303 @@Name: getDOMConfigurationParameterName
7304 @@DIS:targetType: DOMCore|DOMConfigurationParameterApplication
7305 @@Return:
7306 @@@Type: DISString
7307 @@@PerlDef:
7308 __DEEP{
7309 my $cp = $self-><M::DISResourceProp.getPropertyResource>
7310 (<Q::DOMCore:domConfigurationParameter>);
7311 if (defined $cp) {
7312 $r = $cp-><M::DIS|DISResourceProp.getPropertyText>
7313 (<Q::DOMCore:domConfigurationParameterName>);
7314 unless (defined $r) {
7315 $r = $cp-><AG::DISAnyResource.nameURI>;
7316 }
7317 $r = lc $r if defined $r;
7318 } else {
7319 $r = null; # error
7320 }
7321 }__;
7322 ##DOMCore|DOMConfigurationParameterApplication
7323
7324 TMethods:
7325 @TMethod:
7326 @@Name: getErrorInterfaceResource
7327 @@DIS:targetType: dx|ErrorCode
7328 @@Return:
7329 @@@Type: DISAnyResource
7330 @@@PerlDef:
7331 __DEEP{
7332 my $parent = $self-><AG::DISResource.parentResource>;
7333 if ($parent) {
7334 $r = $parent-><M::DISAnyResource.getErrorInterfaceResource>;
7335 }
7336 }__;
7337 ##dx:ErrorCode
7338
7339 TMethods:
7340 @TMethod:
7341 @@Name: getErrorInterfaceResource
7342 @@DIS:targetType: dx|ErrorSubCode
7343 @@Return:
7344 @@@Type: DISAnyResource
7345 @@@PerlDef:
7346 __DEEP{
7347 my $parent = $self-><M::DISAnyResource.getErrorCodeResource>;
7348 if ($parent) {
7349 $r = $parent-><M::DISAnyResource.getErrorInterfaceResource>;
7350 }
7351 }__;
7352
7353 @TMethod:
7354 @@Name: getErrorCodeResource
7355 @@DIS:targetType: dx|ErrorSubCode
7356 @@Return:
7357 @@@Type: DISAnyResource
7358 @@@PerlDef:
7359 __DEEP{
7360 my $parent = $self-><AG::DISResource.parentResource>;
7361 if ($parent and $parent-><M::DISAnyResource.isTypeURI>
7362 (<Q::dx|ErrorCode>)) {
7363 $r = $parent;
7364 }
7365 }__;
7366 ##dx:ErrorSubCode
7367
7368 TMethods:
7369 @TMethod:
7370 @@Name: parseString
7371 @@DIS:targetType: lang|dcmodel
7372 @@Param:
7373 @@@Name: s
7374 @@@Type: DISString
7375 @@Param:
7376 @@@Name: ns
7377 @@@Type: NSResolverDIS
7378 @@Param:
7379 @@@Name: factory
7380 @@@Type: Document
7381 @@Return:
7382 @@@Type: Node
7383 @@@PerlDef:
7384 __DEEP{
7385 $s =~ s/^\s+//;
7386 if ($s =~ s/^([^\s(][^\s+*?]*)\s*//) {
7387 $r = $factory-><M::Document.createElementNS>
7388 (<Q::lang|dcmodel:>, 'terminal');
7389 my $uri = $ns-><M::NSResolverDIS.qnameToURI>
7390 ($1);
7391 $r-><AS::Node.textContent> ($uri);
7392 if ($s =~ s/^([+*?])\s*//) {
7393 $r-><M::Element.setAttributeNS> (null, 'occurence', $1);
7394 }
7395 } else {
7396 $s =~ s/^\(\s*//;
7397 $r = $factory-><M::Document.createElementNS>
7398 (<Q::lang|dcmodel:>, 'group');
7399 my $current = $r;
7400 my $last;
7401 while (length $s) {
7402 if ($s =~ s/^([^\s()+*?|,&][^\s)+*?,&]*|[+*?|,&][^\s)+*?,&]+)\s*//) {
7403 my $el = $factory-><M::Document.createElementNS>
7404 (<Q::lang|dcmodel:>, 'terminal');
7405 my $uri = $ns-><M::NSResolverDIS.qnameToURI>
7406 ($1, node => $ns);
7407 $el-><AS::Node.textContent> ($uri);
7408 $current-><M::Node.appendChild> ($el);
7409 $last = $el;
7410 } elsif ($s =~ s/^([+*?])\s*//) {
7411 if (defined $last) {
7412 $last-><M::Element.setAttributeNS> (null, 'occurence', $1);
7413 $last = null;
7414 }
7415 } elsif ($s =~ s/^([|,&])\s*//) {
7416 $current-><M::Element.setAttributeNS> (null, 'connector', $1);
7417 $last = null;
7418 } elsif ($s =~ s/^\(\s*//) {
7419 my $el = $factory-><M::Document.createElementNS>
7420 (<Q::lang|dcmodel:>, 'group');
7421 $current = $current-><M::Node.appendChild> ($el);
7422 $last = null;
7423 } elsif ($s =~ s/^\)\s*//) {
7424 $last = $current;
7425 $current = $current-><AG::Node.parentNode>;
7426 $current = $last unless defined $current; # error
7427 } else {
7428 last; # error
7429 }
7430 }
7431 }
7432 }__;
7433 ##lang:dcmodel
7434
7435 ElementTypeBinding:
7436 @Name: PropNameParam
7437 @ElementType:
7438 dis:ResourceDef
7439 @ShadowContent:
7440 @@rdf:type:
7441 DISLang:MethodParameter
7442 @@Name: propName
7443 @@Type: ResourceURI
7444 @@Description:
7445 @@@lang:en
7446 @@@@:
7447 The name of the property.
7448
7449 PropDef:
7450 @QName:isAnon
7451 @Description:
7452 @@lang:en
7453 @@@:
7454 Whether the subject resource is anonymous or not.
7455 @Type:
7456 DOMMain:boolean
7457
7458 PropDef:
7459 @QName:isDefined
7460 @Description:
7461 @@lang:en
7462 @@@:
7463 Whether the subject resource is defined or not.
7464
7465 PropDef:
7466 @QName:isReferred
7467 @Description:
7468 @@lang:en
7469 @@@:
7470 Whether the subject resource is referred or not.
7471 @Type:
7472 DOMMain:any
7473
7474 PropDef:
7475 @QName:definingModule
7476 @Description:
7477 @@lang:en
7478 @@@:
7479 The <QUOTE::dis> module in which the subject resource is defined.
7480 \
7481 {NOTE:: The local name should have been <QUOTE::ownerModule> or some.
7482 \
7483 }
7484 @rdfs:domain:
7485 DISCore:Module
7486
7487 ## -- Datatypes
7488
7489 URITypeDef:
7490 @QName: AnyURI
7491 @Description:
7492 @@lang:en
7493 @@@:
7494 Any URI references.
7495
7496 URITypeDef:
7497 @QName: FileURI
7498 @enDesc:
7499 URI references identifying file.
7500
7501 URITypeDef:
7502 @QName: ForURI
7503 @Description:
7504 @@lang:en
7505 @@@:
7506 <QUOTE::For> URI references.
7507
7508 DataTypeDef:
7509 @QName: ForURIList
7510 @Description:
7511 @@lang:en
7512 @@@:
7513 References to the array containing <QUOTE::for> URI references.
7514
7515 URITypeDef:
7516 @QName: ResourceURI
7517 @Description:
7518 @@lang:en
7519 @@@:
7520 A URI reference for a <QUOTE::dis> resource.
7521
7522 URITypeDef:
7523 @QName: MediaTypeURI
7524 @Description:
7525 @@lang:en
7526 @@@:
7527 Media type URI references.
7528 @rdfs:subClassOf: ResourceURI
7529
7530 URITypeDef:
7531 @QName: ModuleURI
7532 @enDesc:
7533 URI references for <QUOTE::dis> modules.
7534 @rdfs:subClassOf: ResourceURI
7535
7536 URITypeDef:
7537 @QName: NameURI
7538 @enDesc:
7539 URI references identifying a resource.
7540 @rdfs:subClassOf: ResourceURI
7541
7542 DataTypeDef:
7543 @QName: ResourceList
7544 @enDesc:
7545 References to array containing resource definition objects.
7546 @rdfs:subClassOf:
7547 DISPerl:ARRAY
7548
7549 ElementTypeBinding:
7550 @Name: DataTypeDef
7551 @ElementType:
7552 dis:ResourceDef
7553 @ShadowContent:
7554 @@rdf:type:
7555 ManakaiDOM:DataType
7556
7557 ElementTypeBinding:
7558 @Name: URITypeDef
7559 @ElementType:
7560 dis:ResourceDef
7561 @ShadowContent:
7562 @@rdf:type:
7563 ManakaiDOM:DataType
7564 @@rdfs:subClassOf: AnyURI
7565
7566 ## -- Exceptions
7567
7568 XParamDef:
7569 @QName: anotherSourceNode
7570 @enDesc:
7571 Another source node in which an error has occurred. In cases
7572 of <QUOTE::already defined> errors, it is the node that
7573 defines the resource first.
7574 @Type: ManakaiDISNode
7575
7576 ResourceDef:
7577 @QName: anyres
7578 @AliasFor: DISAnyResource
7579
7580 ResourceDef:
7581 @rdf:type:
7582 @@@: dis|MultipleResource
7583 @@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass
7584 @resourceFor: ManakaiDOM|ForIF
7585 @resourceFor:
7586 @@@: ManakaiDOM|ForClass
7587
7588 @rdf:type:
7589 @@@: dx|Interface
7590 @@ForCheck: ManakaiDOM|ForIF
7591
7592 @rdf:type:
7593 @@@: dx|Class
7594 @@ForCheck: ManakaiDOM|ForClass
7595
7596 @Implement:
7597 @@@: ||+||ManakaiDOM|ForIF
7598 @@ContentType: DISCore|TFPQNames
7599 @@ForCheck: ManakaiDOM|ForClass
7600 @dx:implementedBy: ||+||ManakaiDOM|ForClass
7601
7602 @f:implements:
7603 @@@: CoreFeature10
7604
7605 @ISA:
7606 @@@: dx|Exception
7607 @@ForCheck: ManakaiDOM|ForClass
7608
7609 @IFQName: DISException
7610 @ClsQName: ManakaiDISException
7611
7612 @Description:
7613 @@lang:en
7614 @@@:
7615 Exceptions for the <QUOTE::dis> operations.
7616
7617 @ResourceDef:
7618 @@rdf:type: DISLang|ConstGroup
7619 @@ForCheck: ManakaiDOM|ForIF
7620
7621 @@IFQName: DISExceptionCode
7622
7623 @@rdfs:subClassOf: idl|unsignedShort
7624 @@Type: idl|unsignedShort
7625
7626 @@enDesc:
7627 Exception codes for <Class::DISException>.
7628
7629 @@XConstDef:
7630 @@@Name: HIERARCHY_REQUEST_ERR
7631 @@@Value:
7632 @@@@@:3
7633 @@@@ContentType: DISCore|Integer
7634 @@@enDesc:
7635 An attempt is made to break the hierarchy.
7636 @@@XSubTypeDef:
7637 @@@@QName: MERGE_ITSELF_ERR
7638 @@@@enDesc:
7639 An attempt is made to merge the resource to itself.
7640 @@@@XSourceNodeParam:
7641 @@@@XParam:
7642 @@@@@QName:uri
7643 @@@@@enDesc:
7644 The URI reference of the resource to merge.
7645 @@@@enMufDef:
7646 An attempt is made to merge the resource <%p (name => {<Q::DIS:uri>}
7647 );> to itself
7648 @@XConstDef:
7649 @@@Name: NOT_SUPPORTED_ERR
7650 @@@Value:
7651 @@@@@:9
7652 @@@@ContentType: DISCore|Integer
7653 @@@enDesc:
7654 An attempt is made to do something the implementation does not support.
7655 @@@XSubTypeDef:
7656 @@@@QName: UNSUPPORTED_MEDIA_TYPE_ERR
7657 @@@@enDesc:
7658 The implementation does not support the media type.
7659 @@@@XParam:
7660 @@@@@QName: uri
7661 @@@@@enDesc:
7662 The URI reference of the media type that is not supported.
7663 @@@@XSourceNodeParam:
7664 @@@@XParam:
7665 @@@@@QName:elementType
7666 @@@@@enDesc:
7667 The URI reference of the element type of the element
7668 in which the media type is referenced.
7669 @@@@enMufDef:
7670 %p (name => {<Q::DIS:sourceCode>}, prefix => {"}, suffix => {": }
7671 );%p (name => {<Q::DIS:elementType>}, prefix => { (Element type: <},
7672 suffix => {>) }
7673 );Media type <%p (name => {<Q::DIS:uri>});> is not supported
7674 @@@XSubTypeDef:
7675 @@@@QName: UNSUPPORTED_ELEMENT_TYPE_ERR
7676 @@@@enDesc:
7677 An unsupported type of element is encounted.
7678 @@@@XSourceNodeParam:
7679 @@@@XParam:
7680 @@@@@QName:elementType
7681 @@@@@enDesc:
7682 The element type URI reference of the element.
7683 @@@@enMufDef:
7684 Element type "%p (name => {<Q::DIS:elementType>});" is not supported
7685 @@XConstDef:
7686 @@@Name: INVALID_STATE_ERR
7687 @@@Value:
7688 @@@@@:11
7689 @@@@ContentType: DISCore|Integer
7690 @@@enDesc:
7691 An attempt is made to use an object that is not (or no longer) usable.
7692 @@@XSubTypeDef:
7693 @@@@QName: NO_ASSOCIATED_DB_ERR
7694 @@@@enDesc:
7695 No <QUOTE::dis> database has been associated with this document.
7696 @@XConstDef:
7697 @@@Name: INVALID_SOURCE_ERR
7698 @@@Value:
7699 @@@@@: 501
7700 @@@@ContentType: DISCore|Integer
7701 @@@enDesc:
7702 The source input is well-formed but invalid.
7703 @@@XSubTypeDef:
7704 @@@@QName: NO_MODULE_QNAME_ERR
7705 @@@@enDesc:
7706 The <Q::dis:Module> element must have its <Q::dis:QName>
7707 attribute.
7708 @@@@XSourceNodeParam:
7709 @@@XSubTypeDef:
7710 @@@@QName: NO_LOCAL_NAME_ERR
7711 @@@@enDesc:
7712 The resource does not have a local name.
7713 @@@@XSourceNodeParam:
7714 @@@XSubTypeDef:
7715 @@@@QName: UNABLE_TO_GET_MODULE_ERR
7716 @@@@enDesc:
7717 The implementation is unable to get the module source.
7718 @@@@enMufDef:
7719 Unable to get the module source of <%p (name => {<Q::DIS:uri>});>
7720 @@@@XParam:
7721 @@@@@QName: uri
7722 @@@@@enDesc:
7723 The URI reference of the module.
7724 @@@@XParam:
7725 @@@@@QName: namespaceURI
7726 @@@@@enDesc:
7727 The namespace URI of the module name.
7728 @@@@XParam:
7729 @@@@@QName: localName
7730 @@@@@enDesc:
7731 The local name of the module name.
7732 @@@@XParam:
7733 @@@@@QName: for
7734 @@@@@enDesc:
7735 The <QUOTE::for> of the module.
7736 @@@XSubTypeDef:
7737 @@@@QName: NO_FOR_QNAME_ERR
7738 @@@@enDesc:
7739 A <Q::dis:ForDef> element must have <Q::dis:QName> attribute.
7740 @@@@XSourceNodeParam:
7741 @@@XSubTypeDef:
7742 @@@@QName: FOR_ALREADY_DEFINED_ERR
7743 @@@@enDesc:
7744 The <QUOTE::for> named as the same URI reference has
7745 already defined.
7746 @@@@XSourceNodeParam:
7747 @@@@XParam:
7748 @@@@@QName: anotherSourceNode
7749 @@@@@enDesc:
7750 The node that defines the <QUOTE::for> URI reference before.
7751 @@@@XParam:
7752 @@@@@Name: uri
7753 @@@@@enDesc:
7754 The URI reference of the <QUOTE::for> attempted to define.
7755 @@@@enMufDef:
7756 <QUOTE::For> <%p (name => {<Q::DIS:uri>});> is already defined
7757 @@@XSubTypeDef:
7758 @@@@QName: RESOURCE_ALREADY_DEFINED_ERR
7759 @@@@enDesc:
7760 The <QUOTE::dis> resource named as the same URI reference has
7761 already defined.
7762 @@@@XSourceNodeParam:
7763 @@@@XParam:
7764 @@@@@@: anotherSourceNode
7765 @@@@@enDesc:
7766 The node that defines the <QUOTE::for> URI reference before.
7767 @@@@XParam:
7768 @@@@@@: uri
7769 @@@@@enDesc:
7770 The URI reference of the resource attempted to define.
7771 @@@@XParam:
7772 @@@@@@: moduleURI
7773 @@@@@enDesc:
7774 A URI of the module in which the <Q::DIS|uri> resource is
7775 defined.
7776 @@@@enMufDef:
7777 %p (name => {<Q::DIS:moduleURI>}, prefix => {Module <},
7778 suffix => {>: })
7779 ;Resource <%p (name => {<Q::DIS:uri>});> is already defined
7780 @@@XSubTypeDef:
7781 @@@@QName: ELEMENT_NOT_ALLOWED_ERR
7782 @@@@enDesc:
7783 An element has occured where it is not allowed.
7784 @@@@enMufDef:
7785 Module <%p (name => {<Q::DIS:uri>});>:
7786 Element of type <%p (name => {<Q::DIS:elementType>});>
7787 is not allowed here
7788 @@@@XSourceNodeParam:
7789 @@@@XParam:
7790 @@@@@QName: elementType
7791 @@@@@enDesc:
7792 The expanded element type name of the element.
7793 @@@@XParam:
7794 @@@@@QName: uri
7795 @@@@@enDesc:
7796 The URI reference of the module.
7797 @@@XSubTypeDef:
7798 @@@@QName: NO_REQUIRED_ATTR_ERR
7799 @@@@enDesc:
7800 A required attribute is not specified.
7801 @@@@XSourceNodeParam:
7802 @@@@XParam:
7803 @@@@@QName: elementType
7804 @@@@@enDesc:
7805 The expanded URI reference of the attribute name.
7806 @@@@enMufDef:
7807 Attribute <%p (name => {<Q::DIS:elementType>});> must be specified
7808 @@@XSubTypeDef:
7809 @@@@QName: FOR_NOT_DEFINED_ERR
7810 @@@@enDesc:
7811 A <QUOTE::for> is referred but not defined.
7812 @@@@XSourceNodeParam:
7813 @@@@XParam:
7814 @@@@@QName: uri
7815 @@@@@enDesc:
7816 The URI reference of the <QUOTE::for> that is not defined.
7817 @@@@enMufDef:
7818 <QUOTE::For> <%p (name => {<Q::DIS:uri>});> is not defined
7819 @@@XSubTypeDef:
7820 @@@@QName: RESOURCE_NOT_DEFINED_ERR
7821 @@@@enDesc:
7822 A <QUOTE::dis> resource is referred but not defined
7823 or the resource referred does not have the type expected.
7824 @@@@XSourceNodeParam:
7825 @@@@XParam:
7826 @@@@@@: sourceNodePath
7827 @@@@@enDesc:
7828 A node path string of the source node.
7829 @@@@XParam:
7830 @@@@@QName: uri
7831 @@@@@enDesc:
7832 The URI reference of the resource that is not defined.
7833 @@@@XParam:
7834 @@@@@QName: elementType
7835 @@@@@enDesc:
7836 <QUOTE::dis> element type (either tree element type
7837 or preprocessing element type) of the element
7838 in which a reference to the undefined resource is contained.
7839 @@@@XParam:
7840 @@@@@QName:parentURI
7841 @@@@@enDesc:
7842 The URI reference of the resource from whose child resources
7843 a resource is tried to find.
7844 @@@@XParam:
7845 @@@@@QName: moduleURI
7846 @@@@@enDesc:
7847 The URI of the module in which the resourece should be included.
7848 @@@@XParam:
7849 @@@@@QName: localName
7850 @@@@@enDesc:
7851 The local name of the undefined resource.
7852 @@@@XParam:
7853 @@@@QName: sourceCode
7854 @@@@enDesc:
7855 Source code fragment that referres this resource.
7856 @@@@XParam:
7857 @@@@@QName:expectedType
7858 @@@@@enDesc:
7859 Expected resource type.
7860 @@@@enMufDef:
7861 %p (name => {<Q::DIS:moduleURI>}, prefix => {Module <},
7862 suffix => {>: })
7863 ;%p (name => {<Q::DIS:sourceNodePath>}, suffix => {: })
7864 ;%p (name => {<Q::DIS:sourceCode>}, prefix => {"}, suffix => {": })
7865 ;%p (name => {<Q::DIS:parentURI>}, prefix => {(In <}, suffix => {>) })
7866 ;Resource%p (name => {<Q::DIS:uri>}, prefix => { <},
7867 suffix => {>});%p (name => {<Q::DIS:localName>},
7868 prefix => { "}, suffix => {"}); is not defined or wrong type%p
7869 (name => {<Q::DIS:expectedType>}, prefix => { (<},
7870 suffix => {> is expected)});
7871 @@@XSubTypeDef:
7872 @@@@QName: NO_SOURCE_NODE_ERR
7873 @@@@enDesc:
7874 A resource does not have associated node in the source tree.
7875 @@@@XSourceNodeParam:
7876 @@@@XParam:
7877 @@@@@QName:uri
7878 @@@@@enDesc:
7879 The URI reference of the resource.
7880 @@@XSubTypeDef:
7881 @@@@QName: RESERVED_PERL_METHOD_NAME_ERR
7882 @@@@enDesc:
7883 A reserved Perl method name is used.
7884 @@@@XParam:
7885 @@@@@QName:uri
7886 @@@@@enDesc:
7887 The URI reference of the method resource.
7888 @@@@XSourceNodeParam:
7889 @@@@XParam:
7890 @@@@@QName: generatedName
7891 @@@@@enDesc:
7892 A reserved method name.
7893 @@@XSubTypeDef:
7894 @@@@QName: NO_DIS_TYPE_ERR
7895 @@@@enDesc:
7896 <Q::dis:Type> attribute is not found.
7897 @@@@XSourceNodeParam:
7898 @@@@enMufDef:
7899 Resource "%t (name => {<Q::DIS:uri>});" has no "dis:Type" attribute
7900 @@@XSubTypeDef:
7901 @@@@QName: NO_METHOD_RETURN_ERR
7902 @@@@enDesc:
7903 A <Q::DISLang:Method> resource does not have any
7904 <Q::DISLang:MethodReturn> child.
7905 @@@@XSourceNodeParam:
7906 @@@@XParam:
7907 @@@@@QName:errResource
7908 @@@@@enDesc: The method resource.
7909 @@@@XParam:
7910 @@@@@QName:uri
7911 @@@@@enDesc:
7912 The URI reference of the method.
7913 @@@@XParam:
7914 @@@@@QName:localName
7915 @@@@@enDesc:
7916 The local name of the resource.
7917 @@@@enMufDef:
7918 Method "%p (name => {<Q::DIS:localName>});" does not have
7919 "Return" child
7920 @@@XSubTypeDef:
7921 @@@@QName: NO_ATTR_GET_ERR
7922 @@@@enDesc:
7923 A <Q::DISLang:Attribute> resource does not have any
7924 <Q::DISLang:AttributeGet> child.
7925 @@@@XSourceNodeParam:
7926 @@@XSubTypeDef:
7927 @@@@QName:INTERFACE_CLASS_METHOD_ERR
7928 @@@@enDesc:
7929 An attempt is made to call a static (class) method
7930 from an interface.
7931 @@@@XSourceNodeParam:
7932 @@@@XParam:
7933 @@@@@QName:uri
7934 @@@@@enDesc:
7935 The URI reference of the interface.
7936 @@@@XParam:
7937 @@@@@QName:sourceCode
7938 @@@@@enDesc:
7939 Source code fragment that calls a class method.
7940 @@@@XParam:
7941 @@@@@QName:elementType
7942 @@@@@enDesc:
7943 The element type URI reference of the element
7944 that calls a method.
7945 @@@XSubTypeDef:
7946 @@@@QName: BROKEN_PARAM_SPEC_ERR
7947 @@@@enDesc:
7948 A parameter specification is broken.
7949 @@@@XParam:
7950 @@@@@QName: sourceCode
7951 @@@@@enDesc:
7952 Source code fragment that contains the broken parameter
7953 specification.
7954 @@@@XSourceNodeParam:
7955 @@@@enMufDef:
7956 %p (name => {<Q::DIS:sourceCode>}, prefix => {"},
7957 suffix => {": });Broken parameter specification
7958 @@@XSubTypeDef:
7959 @@@@QName:PERL_PREPROCESS_NO_ELEMENT_TYPE_ERR
7960 @@@@enDesc:
7961 A preprocessing instruction does not have its element
7962 type.
7963 @@@@XSourceNodeParam:
7964 @@@@XParam:
7965 @@@@@QName:sourceCode
7966 @@@@@enDesc:
7967 Source code fragment.
7968 @@@@enMufDef:
7969 %p (name => {<Q::DIS:sourceCode>}, prefix => {"},
7970 suffix => {": });Element type name is not specified
7971 @@@XSubTypeDef:
7972 @@@@QName: NO_PERL_PACKAGE_NAME_ERR
7973 @@@@enDesc:
7974 No Perl package name is defined for the resource referred.
7975 @@@@XSourceNodeParam:
7976 @@@@XParam:
7977 @@@@@QName:sourceCode
7978 @@@@@enDesc:
7979 Source code fragment.
7980 @@@@XParam:
7981 @@@@@QName:uri
7982 @@@@@enDesc:
7983 THe URI reference of the resource referred.
7984 @@@@XParam:
7985 @@@@@QName:elementType
7986 @@@@@enDesc:
7987 The element type of Perl preprocessing instruction
7988 in which the resource is referred.
7989 @@@@enMufDef:
7990 %p (name => {<Q::DIS:uri>}, prefix => {<}, suffix => {>: });Perl
7991 package name is not defined
7992 @@@XSubTypeDef:
7993 @@@@QName: PERL_PREPROCESS_NO_EXCEPTION_TYPE_ERR
7994 @@@@enDesc:
7995 An exception type specification is required.
7996 @@@@XSourceNodeParam:
7997 @@@@XSourceCodeParam:
7998 @@@@XParam:
7999 @@@@@QName:elementType
8000 @@@@@enDesc:
8001 The element type of the preprocessing instruction.
8002 @@@XSubTypeDef:
8003 @@@@QName: PERL_PREPROCESS_NO_CODE_NAME_ERR
8004 @@@@enDesc:
8005 A code name specification is required.
8006 @@@@XSourceNodeParam:
8007 @@@@XSourceCodeParam:
8008 @@@@XParam:
8009 @@@@@QName:elementType
8010 @@@@@enDesc:
8011 The element type of the preprocessing instruction.
8012 @@@XSubTypeDef:
8013 @@@@QName: PERL_CODE_NOT_DEFINED_ERR
8014 @@@@enDesc:
8015 The specified resource does not have its Perl definition.
8016 @@@@XSourceNodeParam:
8017 @@@@XSourceCodeParam:
8018 @@@@XParam:
8019 @@@@@QName:elementType
8020 @@@@@enDesc:
8021 The element type of the preprocessing instruction.
8022 @@@@XParam:
8023 @@@@@QName:uri
8024 @@@@@enDesc:
8025 The URI reference of the resource referred.
8026 @@@@XParam:
8027 @@@@@QName:localName
8028 @@@@@enDesc:
8029 The local name of the resource referred.
8030 @@@@enMufDef:
8031 Resource%p (name => {<Q::DIS:uri>}, prefix => { "}, suffix => {"});
8032 has no Perl code definition
8033 @@@XSubTypeDef:
8034 @@@@QName: PERL_PREPROCESS_NO_METHOD_ERR
8035 @@@@enDesc:
8036 A preprocessing instruction which is only allowed in
8037 method definitions is used in a code which is not a method.
8038 @@@@XSourceNodeParam:
8039 @@@@XSourceCodeParam:
8040 @@@@XParam:
8041 @@@@@QName:elementType
8042 @@@@@enDesc:
8043 The element type of the preprocessing instruction.
8044 @@@XSubTypeDef:
8045 @@@@QName: PERL_PREPROCESS_NO_FOR_ERR
8046 @@@@enDesc:
8047 A <QUOTE::for> specification is required.
8048 @@@@XSourceNodeParam:
8049 @@@@XSourceCodeParam:
8050 @@@@XParam:
8051 @@@@@QName:elementType
8052 @@@@@enDesc:
8053 The element type of the preprocessing instruction.
8054 @@@XSubTypeDef:
8055 @@@@QName: PERL_PREPROCESS_NO_ASSERT_TYPE_ERR
8056 @@@@enDesc:
8057 An assertion type specification is required.
8058 @@@@XSourceNodeParam:
8059 @@@@XSourceCodeParam:
8060 @@@@XParam:
8061 @@@@@QName:elementType
8062 @@@@@enDesc:
8063 The element type of the preprocessing instruction.
8064 @@@XSubTypeDef:
8065 @@@@QName: PERL_PREPROCESS_BLOCK_NOT_ALLOWED_ERR
8066 @@@@enDesc:
8067 A preprocessing instruction block occurred with
8068 element type which does not allow it.
8069 @@@@XSourceNodeParam:
8070 @@@@XSourceCodeParam:
8071 @@@@XParam:
8072 @@@@@QName:elementType
8073 @@@@@enDesc:
8074 The element type of the preprocessing instruction.
8075 @@@XSubTypeDef:
8076 @@@@QName: NON_NAMED_PARAMETER_AFTER_NAMED_ERR
8077 @@@@enDesc:
8078 A non-named method parameter following
8079 any named method parameter is occurred.
8080 @@@@XSourceNodeParam:
8081 @@@@XParam:
8082 @@@@@QName:uri
8083 @@@@@enDesc:
8084 The URI reference of the non-named method parameter resource.
8085 @@@@XParam:
8086 @@@@@QName:localName
8087 @@@@@enDesc:
8088 The local name of the non-named method parameter.
8089 @@@XSubTypeDef:
8090 @@@@QName:DISPERL_NO_VALUE_ALLOWED_ERR
8091 @@@@enDesc:
8092 An element node have a value but the definition
8093 of that element type does not allow it.
8094 @@@@XSourceNodeParam:
8095 @@@@XParam:
8096 @@@@@QName:elementType
8097 @@@@@enDesc:
8098 The element type URI reference of the element.
8099 @@@XSubTypeDef:
8100 @@@@QName:NO_CONST_VALUE_ERR
8101 @@@@enDesc:
8102 The source element node for a constant value resource
8103 does not have <Q::dis:Value> attribute.
8104 @@@@XSourceNodeParam:
8105 @@@@XParam:
8106 @@@@@QName:elemntType
8107 @@@@@enDesc:
8108 The element type URI reference of the element from which
8109 a constant value resource is referred.
8110 @@@@XParam:
8111 @@@@@QName:uri
8112 @@@@@enDesc:
8113 The resource URI reference of the constant value resource.
8114 @@@@XParam:
8115 @@@@@QName:localName
8116 @@@@@enDesc:
8117 The local name of the constant value resource.
8118 @@@XSubTypeDef:
8119 @@@@QName:NO_ATTR_SET_ERR
8120 @@@@enDesc:
8121 An attribute setter is referred but the attribute
8122 does not define any setter.
8123 @@@@XSourceNodeParam:
8124 @@@@XParam:
8125 @@@@@QName:errResource
8126 @@@@@enDesc:
8127 The attribute resource.
8128 @@@@XParam:
8129 @@@@@QName:elementType
8130 @@@@@enDesc:
8131 The type of the element by which this attribute
8132 is referred.
8133 @@@XSubTypeDef:
8134 @@@@QName: PERL_SUBROUTINE_ALREADY_DEFINED_ERR
8135 @@@@enDesc:
8136 A resource defines a Perl subroutine whose name is
8137 same as another subroutine.
8138 @@@@XSourceNodeParam:
8139 @@@@XParam:
8140 @@@@@QName:uri
8141 @@@@@enDesc:
8142 The URI reference of the resource that defines the Perl subroutine.
8143 @@@@XParam:
8144 @@@@@QName:
8145 PerlCode:localName
8146 @@@@@enDesc:
8147 The name of the Perl subroutine.
8148 @@@XSubTypeDef:
8149 @@@@QName: PERL_OPERATOR_ALREADY_OVERLOADED_ERR
8150 @@@@enDesc:
8151 A resource is defined to overload a Perl operator which
8152 is already overloaded by another resource.
8153 @@@@XSourceNodeParam:
8154 @@@@XParam:
8155 @@@@@QName:uri
8156 @@@@@enDesc:
8157 The URI reference of the resource that defines the overloading.
8158 @@@@XParam:
8159 @@@@@QName:
8160 PerlCode:operator
8161 @@@@@enDesc:
8162 The operator.
8163 @@@XSubTypeDef:
8164 @@@@QName: PERL_UNUSED_SUBROUTINE_ERR
8165 @@@@enDesc:
8166 A resource defines a Perl subroutine but it is not used.
8167 @@@@XSourceNodeParam:
8168 @@@@XParam:
8169 @@@@@QName:uri
8170 @@@@@enDesc:
8171 The URI reference of the resource.
8172 @@@XSubTypeDef:
8173 @@@@QName: NO_LICENSE_ATTR_ERR
8174 @@@@enDesc:
8175 The <Q::dis:Module> element does not have the
8176 <Q::dis:License> attribute.
8177 @@@@XSourceNodeParam:
8178 @@@@XParam:
8179 @@@@@QName:uri
8180 @@@@@enDesc:
8181 The URI reference of the module.
8182 @@@XSubTypeDef:
8183 @@@@QName: UNSUPPORTED_ROLE_ERR
8184 @@@@enDesc:
8185 A <Q::dis:Role> is not supported.
8186 @@@@XSourceNodeParam:
8187 @@@@XParam:
8188 @@@@@QName:uri
8189 @@@@@enDesc:
8190 The URI reference of the unsupported role.
8191 @@@@enMufDef:
8192 Role <%p (name => {<Q::DIS:uri>});> is not supported
8193 @@@XSubTypeDef:
8194 @@@@QName: NO_REFLECT_GET_DEFINED_ERR
8195 @@@@enDesc:
8196 An attribute is defined to reflect an element attribute
8197 but no reflecting attribute getter template is defined.
8198 @@@@XSourceNodeParam:
8199 @@@@XParam:
8200 @@@@@QName:uri
8201 @@@@@enDesc:
8202 The URI reference of the datatype resource for which
8203 a getter template should have been defined.
8204 @@@XSubTypeDef:
8205 @@@@QName: NO_REFLECT_SET_DEFINED_ERR
8206 @@@@enDesc:
8207 An attribute is defined to reflect an element attribute
8208 but no reflecting attribute setter template is defined.
8209 @@@@XSourceNodeParam:
8210 @@@@XParam:
8211 @@@@@QName:uri
8212 @@@@@enDesc:
8213 The URI reference of the datatype resource for which
8214 a setter template should have been defined.
8215 @@@XSubTypeDef:
8216 @@@@QName: NO_END_TAG_ERR
8217 @@@@enDesc:
8218 Close tag not found.
8219 @@@@XSourceNodeParam:
8220 @@@@XParam:
8221 @@@@@@: elementType
8222 @@@@@enDesc:
8223 The type URI reference of the element that is not closed.
8224 @@@@XParam:
8225 @@@@@@: sourceCode
8226 @@@@@enDesc:
8227 The source code fragment near the position where
8228 an end tag is required.
8229 @@@@enMufDef:
8230 End tag for element "%p (name => {<Q::DIS:elementType>});"
8231 is required%p (name => {<Q::DIS:sourceCode>},
8232 prefix => { (}, suffix => {)});
8233 @@@XSubTypeDef:
8234 @@@@QName: NO_RDF_TYPE_ERR
8235 @@@@enDesc:
8236 There is a resource definition element that does
8237 not have any <Q::rdf:type> attribute.
8238 @@@@XSourceNodeParam:
8239 @@@@XParam:
8240 @@@@@@: uri
8241 @@@@@enDesc:
8242 The URI of the resource which does not have <Q::rdf:type>.
8243 @@@@enMufDef:
8244 Resource%p (name => {<Q::DIS:uri>}, prefix => { "},
8245 suffix => {"}); does not have "rdf:type" attribute
8246 @@@XSubTypeDef:
8247 @@@@QName: PERL_HASH_KEY_ALREADY_DEFINED_ERR
8248 @@@@enDesc:
8249 A hash key is already defined.
8250 @@@@XSourceNodeParam:
8251 @@@@XParam:
8252 @@@@@@:uri
8253 @@@@@enDesc:
8254 The URI of the resource tried to register.
8255 @@@@XParam:
8256 @@@@@@:anotherURI
8257 @@@@@enDesc:
8258 The URI of the already registered resource.
8259 @@@@XParam:
8260 @@@@@@:hashKeyName
8261 @@@@@enDesc:
8262 Hash key.
8263 @@@@XParam:
8264 @@@@@@:hashKeyScope
8265 @@@@@enDesc:
8266 Hash key scope.
8267 @@@@enMufDef:
8268 <%p (name => {<Q::DIS:uri>});>:
8269 Hash key "%p (name => {<Q::DIS:hashKeyName>});" in
8270 <%p (mame => {<Q::DIS:hashKeyScope>});> is already
8271 defined for <%p (name => {<Q::DIS:anotherURI>});>
8272 @@@XSubTypeDef:
8273 @@@@QName: DIS|NO_EXCEPTION_CLASS_ERR
8274 @@@@enDesc:
8275 The exception interface has no class that implements the interface.
8276 @@@@enMufDef:
8277 Exception interface <%p (name => {<Q::DIS:uri>});>:
8278 There is no class that implements this interface
8279 @@@@XParam:
8280 @@@@@@: DIS|uri
8281 @@@@@enDesc:
8282 The URI of the interface.
8283 @ImplNote:
8284 @@lang:en
8285 @@@:
8286 ISSUE: Too many subtypes for a type! New type should be added?
8287
8288 @Attr:
8289 @@Name: text
8290 @@enDesc:
8291 The description of the error, in <LANG::i-default> language.
8292 @@enImplNote:
8293 See <A::dx|Exception.text> for super definition.
8294 @@Type: DISLang|String
8295 @@Get:
8296 @@@PerlDef:
8297 $r = $self->SUPER::text;
8298 if (defined $self->{<H::DIS:uri>}) {
8299 $r = '<' . $self->{<H::DIS:uri>} . '>: ' . $r;
8300 }
8301 if (defined $self->{<H::DIS:sourceNode>}) {
8302 $r = 'Node ' . $self->{<H::DIS:sourceNode>}-><M::SWCFGNode.nodePath>
8303 . ': ' . $r;
8304 }
8305 ##DISException
8306
8307 ElementTypeBinding:
8308 @Name: enImplNote
8309 @ElementType:
8310 dis:ImplNote
8311 @ShadowContent:
8312 @@lang:en
8313
8314 XParamDef:
8315 @QName: hashKeyName
8316 @Type: DISLang|String
8317 @enDesc:
8318 See <M::dp|DISDatabasePerl.plAddHashKey>.
8319
8320 XParamDef:
8321 @QName: hashKeyScope
8322 @Type: AnyURI
8323 @enDesc:
8324 See <M::dp|DISDatabasePerl.plAddHashKey>.
8325
8326 XParamDef:
8327 @QName: anotherURI
8328 @Type: ResourceURI
8329 @enDesc:
8330 A URI of another related resource.
8331
8332 XParamDef:
8333 @QName:expectedType
8334 @Type: ResourceURI
8335 @enDesc:
8336 Expected resource type URI reference.
8337
8338 XParamDef:
8339 @QName: sourceCode
8340 @Type:
8341 DISLang:String
8342 @enDesc:
8343 The source code fragment in which an error occurred.
8344
8345 XParamDef:
8346 @QName: elementType
8347 @Type: ResourceURI
8348 @enDesc:
8349 The name of the element type.
8350
8351 XParamDef:
8352 @QName: uri
8353 @Type: ResourceURI
8354 @enDesc:
8355 The name of the resource, composed from <Q::namespaceURI>,
8356 <Q::localName> and <Q::for>.
8357
8358 XParamDef:
8359 @QName: localName
8360 @Type:
8361 DISCore:LocalName
8362 @enDesc:
8363 The local name of the resource, unique in <Q::namespaceURI> namespace.
8364
8365 XParamDef:
8366 @QName: namespaceURI
8367 @Type: AnyURI
8368 @enDesc:
8369 The namespace URI reference of the resource name.
8370
8371 XParamDef:
8372 @QName: for
8373 @Type: ForURI
8374 @enDesc:
8375 The <QUOTE::for> URI reference of the resource.
8376
8377 ElementTypeBinding:
8378 @Name: XSourceNodeParam
8379 @ElementType:
8380 ecore:hasParameter
8381 @ShadowContent:
8382 @@QName: sourceNode
8383 @@Description:
8384 @@@lang:en
8385 @@@@:
8386 The node in which an error has occurred.
8387
8388 ElementTypeBinding:
8389 @Name: XSourceCodeParam
8390 @ElementType:
8391 ecore:hasParameter
8392 @ShadowContent:
8393 @@QName: sourceCode
8394 @@Description:
8395 @@@lang:en
8396 @@@@:
8397 The source code in which an error has occurred.
8398
8399 ElementTypeBinding:
8400 @Name: plMName
8401 @ElementType:
8402 DISPerl:methodName
8403 @ShadowContent:
8404 @@ContentType: lang|Perl
8405
8406 ElementTypeBinding:
8407 @Name: plCName
8408 @ElementType:
8409 DISPerl:exportTagName
8410 @ShadowContent:
8411 @@ContentType: lang|Perl
8412
8413 ElementTypeBinding:
8414 @Name: Method
8415 @ElementType:
8416 dis:ResourceDef
8417 @ShadowContent:
8418 @@rdf:type:
8419 DISLang:Method
8420
8421 ElementTypeBinding:
8422 @Name: CMethod
8423 @ElementType:
8424 dis:ResourceDef
8425 @ShadowContent:
8426 @@rdf:type:
8427 DISLang:Method
8428 @@ForCheck: ManakaiDOM|ForClass
8429
8430 ElementTypeBinding:
8431 @Name: IntMethod
8432 @ElementType:
8433 dis:ResourceDef
8434 @ShadowContent:
8435 @@rdf:type:
8436 DISLang:Method
8437 @@ManakaiDOM:isForInternal:1
8438 @@ForCheck: ManakaiDOM|ForClass
8439
8440 ElementTypeBinding:
8441 @Name: Attr
8442 @ElementType:
8443 dis:ResourceDef
8444 @ShadowContent:
8445 @@rdf:type:
8446 DISLang:Attribute
8447
8448 ElementTypeBinding:
8449 @Name: CAttr
8450 @ElementType:
8451 dis:ResourceDef
8452 @ShadowContent:
8453 @@rdf:type:
8454 DISLang:Attribute
8455 @@ForCheck: ManakaiDOM|ForClass
8456
8457 ElementTypeBinding:
8458 @Name: Return
8459 @ElementType:
8460 dis:ResourceDef
8461 @ShadowContent:
8462 @@rdf:type:
8463 DISLang:MethodReturn
8464
8465 ElementTypeBinding:
8466 @Name: Get
8467 @ElementType:
8468 dis:ResourceDef
8469 @ShadowContent:
8470 @@rdf:type:
8471 DISLang:AttributeGet
8472
8473 ElementTypeBinding:
8474 @Name: Set
8475 @ElementType:
8476 dis:ResourceDef
8477 @ShadowContent:
8478 @@rdf:type:
8479 DISLang:AttributeSet
8480
8481 ElementTypeBinding:
8482 @Name: Param
8483 @ElementType:
8484 dis:ResourceDef
8485 @ShadowContent:
8486 @@rdf:type:
8487 DISLang:MethodParameter
8488
8489 ElementTypeBinding:
8490 @Name: PerlDef
8491 @ElementType:
8492 dis:Def
8493 @ShadowContent:
8494 @@ContentType:
8495 lang:Perl
8496
8497 ElementTypeBinding:
8498 @Name: InCase
8499 @ElementType:
8500 dis:ResourceDef
8501 @ShadowContent:
8502 @@rdf:type:
8503 ManakaiDOM:InCase
8504
8505 ElementTypeBinding:
8506 @Name: nullCase
8507 @ElementType:
8508 dis:ResourceDef
8509 @ShadowContent:
8510 @@rdf:type:
8511 ManakaiDOM:InCase
8512 @@Value:
8513 @@@is-null:1
8514 @@@ContentType: DISCore|String
8515
8516 ElementTypeBinding:
8517 @Name: TrueCase
8518 @ElementType:
8519 dis:ResourceDef
8520 @ShadowContent:
8521 @@rdf:type:
8522 ManakaiDOM:InCase
8523 @@Value:
8524 @@@@: 1
8525 @@@ContentType: DISCore|Boolean
8526 @@Type:
8527 DOMMain:boolean
8528
8529 ElementTypeBinding:
8530 @Name: FalseCase
8531 @ElementType:
8532 dis:ResourceDef
8533 @ShadowContent:
8534 @@rdf:type:
8535 ManakaiDOM:InCase
8536 @@Value:
8537 @@@@: 0
8538 @@@ContentType: DISCore|Boolean
8539 @@Type:
8540 DOMMain:boolean
8541
8542 ElementTypeBinding:
8543 @Name: enDesc
8544 @ElementType:
8545 dis:Description
8546 @ShadowContent:
8547 @@lang:en
8548
8549 ElementTypeBinding:
8550 @Name: PropDef
8551 @ElementType:
8552 dis:ResourceDef
8553 @ShadowContent:
8554 @@DISCore:resourceType: DISCore|Property
8555
8556 ElementTypeBinding:
8557 @Name: RPropDef
8558 @ElementType:
8559 dis:ResourceDef
8560 @ShadowContent:
8561 @@DISCore:resourceType: DISSource|ResourceProperty
8562
8563 ElementTypeBinding:
8564 @Name: MethodRedef
8565 @ElementType:
8566 dis:ResourceDef
8567 @ShadowContent:
8568 @@rdf:type:
8569 DISLang:Method
8570
8571 ElementTypeBinding:
8572 @Name: NamedParam
8573 @ElementType:
8574 dis:ResourceDef
8575 @ShadowContent:
8576 @@rdf:type:
8577 DISLang:MethodParameter
8578 @@DISPerl:isNamedParameter:1
8579
8580 ElementTypeBinding:
8581 @Name: NodeParam
8582 @ElementType:
8583 dis:ResourceDef
8584 @ShadowContent:
8585 @@rdf:type:
8586 DISLang:MethodParameter
8587 @@DISPerl:isNamedParameter:1
8588 @@Name: node
8589 @@Type: DISNode
8590 @@actualType:
8591 @@@@: ManakaiDISNode
8592 @@@ForCheck: ManakaiDOM|ForClass
8593 @@Description:
8594 @@@lang:en
8595 @@@@:
8596 The node in which the name has occurred. It is intended
8597 to be reported when an exception had been raised.
8598 @@ResourceDef:
8599 @@@rdf:type:
8600 ManakaiDOM:InCase
8601 @@@Value:
8602 @@@@is-null:1
8603 @@@@ContentType: DISCore|String
8604 @@@Description:
8605 @@@@lang:en
8606 @@@@@:
8607 The source of the name is not a node.
8608
8609 ElementTypeBinding:
8610 @Name: ForpParam
8611 @ElementType:
8612 dis:ResourceDef
8613 @ShadowContent:
8614 @@rdf:type:
8615 DISLang:MethodParameter
8616 @@DISPerl:isNamedParameter:1
8617 @@Name: forpArg
8618 @@Type: ForURIList
8619 @@Description:
8620 @@@lang:en
8621 @@@@:
8622 An array reference containing additional <QUOTE::for>
8623 constraints (<QUOTE::For+> list).
8624 @@ResourceDef:
8625 @@@rdf:type:
8626 ManakaiDOM:InCase
8627 @@@Value:
8628 @@@@is-null:1
8629 @@@@ContentType: DISCore|String
8630 @@@Description:
8631 @@@@lang:en
8632 @@@@@:
8633 Equivalent to the empty array reference.
8634
8635 ElementTypeBinding:
8636 @Name: MediaTypeParam
8637 @ElementType:
8638 dis:ResourceDef
8639 @ShadowContent:
8640 @@rdf:type:
8641 DISLang:MethodParameter
8642 @@DISPerl:isNamedParameter:1
8643 @@Name: mediaType
8644 @@Type: MediaTypeURI
8645 @@Description:
8646 @@@lang:en
8647 @@@@:
8648 The URI reference identifying a media type.
8649 @@ResourceDef:
8650 @@@rdf:type:
8651 ManakaiDOM:InCase
8652 @@@Value:
8653 @@@@is-null:1
8654 @@@@ContentType: DISCore|String
8655 @@@Description:
8656 @@@@lang:en
8657 @@@@@:
8658 No media type specified.
8659
8660 ElementTypeBinding:
8661 @Name: MediaTypeDefaultParam
8662 @ElementType:
8663 dis:ResourceDef
8664 @ShadowContent:
8665 @@rdf:type:
8666 DISLang:MethodParameter
8667 @@DISPerl:isNamedParameter:1
8668 @@Name: defaultMediaType
8669 @@Type: MediaTypeURI
8670 @@Description:
8671 @@@lang:en
8672 @@@@:
8673 The default media type, i.e. the type used when no explicit
8674 specification is not found in the source tree.
8675 @@ResourceDef:
8676 @@@rdf:type:
8677 ManakaiDOM:InCase
8678 @@@Value:
8679 @@@@is-null:1
8680 @@@@ContentType: DISCore|String
8681 @@@Description:
8682 @@@@lang:en
8683 @@@@@:
8684 Defaulted to <Q::DOMMain:any>.
8685
8686 ElementTypeBinding:
8687 @Name: RaiseException
8688 @ElementType:
8689 ManakaiDOM:raises
8690
8691 ElementTypeBinding:
8692 @Name: UndeclaredPrefixException
8693 @ElementType:
8694 ManakaiDOM:raises
8695 @ShadowContent:
8696 @@@: UNDECLARED_NS_PREFIX_ERR
8697 @@Description:
8698 @@@lang:en
8699 @@@@:
8700 The implementation has encounted an undeclared namespace prefix.
8701
8702 ElementTypeBinding:
8703 @Name: NoDBException
8704 @ElementType:
8705 ManakaiDOM:raises
8706 @ShadowContent:
8707 @@@: NO_ASSOCIATED_DB_ERR
8708 @@Description:
8709 @@@lang:en
8710 @@@@:
8711 No <QUOTE::dis> database is associated to this document.
8712
8713 ElementTypeBinding:
8714 @Name: XConstDef
8715 @ElementType:
8716 dis:ResourceDef
8717 @ShadowContent:
8718 @@rdf:type: dx|ErrorCode
8719
8720 ElementTypeBinding:
8721 @Name: XSubTypeDef
8722 @ElementType:
8723 dis:ResourceDef
8724 @ShadowContent:
8725 @@rdf:type: dx|ErrorSubCode
8726
8727 ElementTypeBinding:
8728 @Name: XParam
8729 @ElementType:
8730 ecore:hasParameter
8731
8732 ElementTypeBinding:
8733 @Name: XParamDef
8734 @ElementType:
8735 dis:ResourceDef
8736 @ShadowContent:
8737 @@rdf:type: ecore|Parameter
8738
8739 XParamDef:
8740 @QName: DIS|moduleURI
8741 @enDesc:
8742 A URI of the module in which the resource is defined.
8743
8744 ElementTypeBinding:
8745 @Name: enMufDef
8746 @ElementType:
8747 ecore:defaultMessage
8748 @ShadowContent:
8749 @@ContentType:
8750 lang:muf
8751 @@lang:en

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24