/[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.50 - (hide annotations) (download)
Tue Sep 20 12:21:49 2005 UTC (19 years, 9 months ago) by wakaba
Branch: MAIN
Changes since 1.49: +71 -34 lines
++ manakai/lib/Message/Markup/ChangeLog	20 Sep 2005 12:08:51 -0000
2005-09-20  Wakaba  <wakaba@suika.fam.cx>

	* SuikaWikiConfig21.dis (valueRef, nodeIDRef): New attributes.

++ manakai/lib/Message/Util/ChangeLog	20 Sep 2005 12:10:46 -0000
2005-09-20  Wakaba  <wakaba@suika.fam.cx>

	* DIS.dis: Use valueRef and nodeIDRef where possible so
	that dad file can share text data if possible.
	For resources, {subOf} and {supOf} is now optional.
	(sourceNodeIDRef): New attribute.

++ manakai/lib/Message/Util/Error/ChangeLog	20 Sep 2005 12:16:35 -0000
2005-09-20  Wakaba  <wakaba@suika.fam.cx>

	* DOMException.dis (Class, Interface): New types.
	ManakaiDOM:ExceptionClass and ManakaiDOM:ExceptionIF
	are now deprecated.
	(disPerl:EXCEPTION, disPerl:WARNING): Moved
	from /lib/manakai/DISPerl.dis.

++ manakai/lib/Message/Util/DIS/ChangeLog	20 Sep 2005 12:14:37 -0000
2005-09-20  Wakaba  <wakaba@suika.fam.cx>

	* Value.dis (createDVValueRef): New method.  Now
	values are hold as scalar reference in ManakaiDVValue.
	(valueRef): New attribute.

	* DNLite.dis (ManakaiDISImplementationDNLite): Now extends
	class ManakaiDISImplementation.
	(convertDISDocumentToDNLDocument): Typo in class names fixed.
	For nodes, {child} property is now optional.
	(nodeIDRef, valueRef): New attributes.

++ manakai/lib/Message/DOM/ChangeLog	20 Sep 2005 12:08:19 -0000
2005-09-20  Wakaba  <wakaba@suika.fam.cx>

	* DOMFeature.pm: Debug output code copied
	from Attic/DOMMetaImpl.pm (Should these code incorporated
	to source dis file?).

++ manakai/lib/manakai/ChangeLog	20 Sep 2005 12:19:59 -0000
2005-09-20  Wakaba  <wakaba@suika.fam.cx>

	* DISIDL.dis: Full names are given to data types.

	* DISCore.dis, DISLang.dis, DISPerl.dis: Refactored so
	that some resources has made its canonical URI changed.
	Lexical types (DISCore:LexicalType) and programming
	language data types (DISLang:AnyDataType) is now
	clearly separated.  New name given for,
	e.g., dis:TypeQName (now DISCore:QName), Perl:ARRAY (now
	DISPerl:ARRAY), and so on.

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24