Module: @QName: Util|DIS @FullName: @@lang: en @@@: Object Model @Namespace: http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS# @Description: @@lang:en @@@: This module provides an object model for document format. @DISCore:author: DISCore|Wakaba @License: @@@: license:Perl+MPL @@Original: @@@FullName: manakai and @@@Year:2004 @@@DISCore:author: DISCore|Wakaba @Date: @@@: $Date: 2005/11/24 12:08:54 $ @@ContentType: dis:Date.RCS @Require: @@Module: @@@QName: Markup|SuikaWikiConfig21 @@@WithFor: swcfg21|ForLatest @@Module: @@@QName: Util|DIS @@@WithFor: DIS|ForLatest @@Module: @@@QName: Util|DIS @@@WithFor: DIS|ForEmpty @@Module: @@@QName: MDOM|DOMFeature @@@WithFor: ManakaiDOM|all @@Module: @@@QName: DIS|Perl @@@WithFor: DIS|ForLatest @@Module: @@@QName: DIS|Value @@@WithFor: DIS|ForLatest @DefaultFor: DIS|ForLatest Namespace: @DIS: http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS# @dis: http://suika.fam.cx/~wakaba/archive/2004/8/18/lang#dis-- @DOMCore: http://suika.fam.cx/~wakaba/archive/2004/8/18/dom-core# @DOMLS: http://suika.fam.cx/~wakaba/archive/2004/dom/ls# @DOMMain: http://suika.fam.cx/~wakaba/archive/2004/dom/main# @dp: http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#Perl/ @dv: http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/DIS#Value/ @dx: http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/DOMException# @ecore: http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/Error/Core/ @f: http://suika.fam.cx/~wakaba/archive/2004/dom/feature# @idl: http://suika.fam.cx/~wakaba/archive/2004/dis/IDL# @infoset: http://www.w3.org/2001/04/infoset# @kwd: http://suika.fam.cx/~wakaba/archive/2005/rfc2119/ @lang: http://suika.fam.cx/~wakaba/archive/2004/8/18/lang# @license: http://suika.fam.cx/~wakaba/archive/2004/8/18/license# @ManakaiDOM: http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom# @Markup: http://suika.fam.cx/~wakaba/archive/2005/manakai/Markup# @MDOM: http://suika.fam.cx/~wakaba/archive/2004/8/18/manakai-dom#ManakaiDOM. @MDOMX: http://suika.fam.cx/~wakaba/archive/2004/8/4/manakai-dom-exception# @mn: http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ManakaiNode# @rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# @rdfs: http://www.w3.org/2000/01/rdf-schema# @s: http://suika.fam.cx/~wakaba/archive/2004/dis/Markup# @swcfg21: http://suika.fam.cx/~wakaba/archive/2005/swcfg21# @Util: http://suika.fam.cx/~wakaba/archive/2005/manakai/Util/ ## -- "For" definitions ForDef: @QName: DIS|ForEmpty @enDesc: For any version @ISA: ManakaiDOM|Perl ForDef: @QName: DIS:ForLatest @Description: @@lang:en @@@: For latest version of the module implementation @ISA: DIS|ForEmpty ## -- Module sets ResourceDef: @QName: Util| @For: DIS|ForEmpty @rdf:type: dis|ModuleGroup @FullName: @@lang:en @@@: Manakai support modules @DISPerl:packageName: Message::Util:: @DISPerl:interfacePackageName: @@@: Message::Util::IF:: @@For: DIS|ForEmpty !DIS|ForLatest @DISPerl:interfacePackageName: @@@: Message::Util::IFLatest:: @@For: DIS|ForLatest @ImplNote: @@lang:en @@@: Resources for and for is defined in module . ## -- Features ElementTypeBinding: @Name: FeatureDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DOMFeature|Feature @@ForCheck: =ManakaiDOM:all ElementTypeBinding: @Name: FeatureVerDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DOMFeature|Feature ElementTypeBinding: @Name: featureQName @ElementType: DOMFeature:name @ShadowContent: @@ContentType: DISCore|QName FeatureDef: @QName: Core @FeatureVerDef: @@QName: CoreFeature10 @@Version: 1.0 @@DOMFeature:instanceOf: Core @@FullName: @@@lang:en @@@@: The object model, version 1.0 @@Description: @@@lang:en @@@@: The object model, version 1.0. @@DOMMain:requireFeature: swcfg21:CoreFeature21 ## -- Roles ElementTypeBinding: @Name: RoleDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:Role @@ForCheck: =ManakaiDOM:all RoleDef: @QName: ModuleRole @enDesc: Any class playing this role may be returned by method with appropriate feature parameters. RoleDef: @QName: ForRole @enDesc: Any class playing this role may be returned by method with appropriate feature parameters. RoleDef: @QName: ResourceRole @enDesc: Any class playing this role may be returned by method with appropriate feature parameters. RoleDef: @QName: ElementRole @enDesc: Any class playing this role may be returned by method with appropriate feature parameters. RoleDef: @QName: DatabaseRole @enDesc: Any class playing this role may be returned by method with appropriate feature parameters. ElementTypeBinding: @Name: IFQName @ElementType: dis:QName @ShadowContent: @@ForCheck: ManakaiDOM|ForIF ElementTypeBinding: @Name: ClsQName @ElementType: dis:QName @ShadowContent: @@ForCheck: ManakaiDOM|ForClass ElementTypeBinding: @Name: IFISA @ElementType: dis:ISA @ShadowContent: @@ForCheck: ManakaiDOM|ForIF ElementTypeBinding: @Name: ClsISA @ElementType: dis:ISA @ShadowContent: @@ForCheck: ManakaiDOM|ForClass ElementTypeBinding: @Name: IFClsDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: @@@@: dis|MultipleResource @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass @@resourceFor: ManakaiDOM|ForIF @@resourceFor: @@@@: ManakaiDOM|ForClass @@@ForCheck: ForEmpty !=ForEmpty @@For: ForLatest @@For: =ForEmpty @@rdf:type: @@@@: ManakaiDOM|IF @@@ForCheck: ManakaiDOM|ForIF @@rdf:type: @@@@: ManakaiDOM|Class @@@ForCheck: ManakaiDOM|ForClass @@Implement: @@@@: ||ForEmpty||ManakaiDOM|ForIF @@@ContentType: DISCore|TFPQNames @@@ForCheck: ManakaiDOM|ForClass ForEmpty @@Implement: @@@@: ||ForLatest||ManakaiDOM|ForIF @@@ContentType: DISCore|TFPQNames @@@ForCheck: ManakaiDOM|ForClass ForLatest @@DOMMain:implementFeature: @@@@: CoreFeature10 @@@For: ForLatest ElementTypeBinding: @Name: ClsDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: @@@@: dis|MultipleResource @@@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass @@resourceFor: @@@@: ManakaiDOM|ForClass @@@ForCheck: ForEmpty !=ForEmpty @@For: ForLatest @@rdf:type: @@@@: ManakaiDOM|Class @@@ForCheck: ManakaiDOM|ForClass @@DOMMain:implementFeature: @@@@: CoreFeature10 @@@For: ForLatest ElementTypeBinding: @Name: clsActualType @ElementType: dis:actualType @ShadowContent: @@ForCheck: ManakaiDOM|ForClass ## -- SuikaWikiConfig/2.1 extended classes IFClsDef: @IFQName: DISImplementation @ClsQName: ManakaiDISImplementation @ClsISA: swcfg21:ManakaiSWCFGImplementation::swcfg21:ForLatest @ClsISA: dp|ManakaiDISImplementationPerl @ClsISA: dv|ManakaiDISImplementationValue @Description: @@lang:en @@@: A implementation object. @Method: @@Name: createDISDocument @@Description: @@@lang:en @@@@: Creates an empty node. @@Return: @@@Type: DISDocument @@@clsActualType: ManakaiDISDocument @@@Description: @@@@lang:en @@@@@: The newly created document object. @@@PerlDef: $r = bless $self->, ; $r-> (); @Method: @@Name: createDISParser @@Description: @@@lang:en @@@@: Creates a object. @@Return: @@@Type: DISParser @@@clsActualType: ManakaiDISParser @@@Description: @@@@lang:en @@@@@: A newly created parser. @@@PerlDef: $r = bless $self->, ; @Method: @@Name: createDISDatabase @@Description: @@@lang:en @@@@: Creates a new database. @@Return: @@@Type: DISDatabase @@@clsActualType: ManakaiDISDatabase @@@Description: @@@@lang:en @@@@@: A newly created parser. @@@PerlDef: $r = bless { forDef => { => bless ({ uri => , isa => { => 1}, revISA => {}, }, ), }, resDef => {}, modDef => {}, seq => 0, }, ; $r->{forDef}->{}->{db} = $r; @Method: @@Name: tfurisToURI @@Description: @@@lang:en @@@@: Converts a pair of name URI reference and URI reference into a -expanded URI reference. @@Param: @@@Name: typeURI @@@Type: NameURI @@@Description: @@@@lang:en @@@@@: A URI reference to identify a resource. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Equivalent to (for historical reason). @@Param: @@@Name: forURI @@@Type: ForURI @@@Description: @@@@lang:en @@@@@: A URI reference. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Equivalent to , i.e. . @@Return: @@@Type: DISCore:TFURI::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: The -expanded URI references. @@@PerlDef: $typeURI = unless defined $typeURI; $forURI = unless defined $forURI; __CODE{tfurisToURI:: $turi => $typeURI, $furi => $forURI, $uri => $r}__; @ResourceDef: @@ForCheck: ManakaiDOM|ForClass @@QName: tfurisToURI @@rdf:type: DISPerl|BlockCode @@enDesc: Converts a pair of name URI reference and URI reference into a -expanded URI reference. @@PerlDef: if ($furi eq ) { $uri = $turi; } else { ## NOTE: [RFC 3986] ## fragment := *(pchar / "/" / "?") ## pchar := unreserved / pct-encoded / sub-delims / [:@] ## unreserved := ALPHA / DIGIT / [._~-] ## sub-delims := [!$&'()*+,;=] ## NOTE: [XPointer Framework] ## SchemeData := *EscapedData ## EscapedData := NormalChar / "^(" / "^)" / "^^" ## / "(" SchemeData ")" ## NormalChar := UnicodeChar - [()^] my $__turi = $turi; my $__furi = $furi; for my $__uri ($__turi, $__furi) { $__uri =~ s{([^0-9A-Za-z!\$'()*,:;=?\@_./~-])}{sprintf '%%%02X', ord $1}ge; } $uri = qq; } @ResourceDef: @@QName: tfpurisToURI @@rdf:type: DISPerl|BlockCode @@enDesc: Converts a set of name URI reference and URI reference and URI references into a URi reference. @@ForCheck: ManakaiDOM|ForClass @@PerlDef: if ($furi eq and @{$forp} == 0) { $uri = $turi; } elsif (@{$forp}) { my $__turi = $turi; my $__furi = $furi; for my $__uri ($__turi, $__furi) { $__uri =~ s{([^0-9A-Za-z!\$'()*,:;=?\@_./~-])}{sprintf '%%%02X', ord $1}ge; } my @__fp; for my $__uri (@{$forp}) { my $__fpuri = $__uri; $__fpuri =~ s{([^0-9A-Za-z!\$'()*,:;=?\@_./~-])} {sprintf '%%%02X', ord $1}ge; push @__fp, $__fpuri; } $uri = qq.join ('+', @__fp); } else { my $__turi = $turi; my $__furi = $furi; for my $__uri ($__turi, $__furi) { $__uri =~ s{([^0-9A-Za-z!\$'(),*:;=?\@_./~-])}{sprintf '%%%02X', ord $1}ge; } $uri = qq; } @ImplNote: @@lang:en @@@: {TODO:: IRI support. } @ResourceDef: @@QName: getChildResourceURI @@rdf:type: DISPerl|BlockCode @@enDesc: Gets an anonymous URI reference of a child resource of another resource. @@ForCheck: ManakaiDOM|ForClass @@PerlDef: my $__parent = $parentURI; my $__ln = $localName; for my $__uri ($__parent, $__ln) { $__uri =~ s{([^0-9A-Za-z!\$'(),*:;=?\@_./~-])}{sprintf '%%%02X', ord $1}ge; } $result = qq; @IntMethod: @@Name: camelCaseToUnderscoreName @@enDesc: Converts a camelCase name to a underscored_name. @@ManakaiDOM:isStatic:1 @@ForCheck: ManakaiDOM|ForClass @@Param: @@@Name: camelName @@@Type: DISLang:String::ManakaiDOM:all @@@enDesc: The source name. @@Return: @@@Type: DISLang:String::ManakaiDOM:all @@@enDesc: The result name. @@@PerlDef: $r = $camelName; $r =~ s/^([A-Z0-9]+)$/lc $1/ge; $r =~ s/([A-Z][A-Z0-9]*)$/"_".lc $1/ge; $r =~ s/([A-Z0-9])([A-Z0-9]*)([A-Z0-9])/$1.lc ($2)."_".lc $3/ge; $r =~ s/([A-Z])/"_".lc $1/ge; $r =~ s/(?=[0-9](?!$))/_/g; @DOMFeature:provides: CoreFeature10 ##DISImplementation IFClsDef: @IFQName: DISParser @ClsQName: ManakaiDISParser @IFISA: swcfg21|SWCFGParser||swcfg21|ForLatest @ClsISA: swcfg21:ManakaiSWCFGParser::swcfg21:ForLatest @Description: @@lang:en @@@: A SuikaWikiConfig/2.1 parser that returns object. @Method: @@Name: parse @@Description: @@@lang:en @@@@: Parses a document and returns it as an object tree. @@Param: @@@Name: input @@@Type: DOMLS:LSInput::ManakaiDOM:ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: The input source. @@Return: @@@Type: DISDocument @@@clsActualType: ManakaiDISDocument @@@Description: @@@@lang:en @@@@@: The document object created from the . @@@RaiseException: @@@@@: swcfg21:SWCFG_PARSE_ERR::swcfg21:ForLatest @@@@Description: @@@@@lang:en @@@@@@: The was unable to load the SuikaWikiConfig document. @@@PerlDef: __DEEP{ $r = $self->SUPER::parse ($input) ## NOTE: Method name directly written #< M::swcfg21:ManakaiSWCFGParser # ::swcfg21:ForLatest.parse> ($input) }__; if (defined $r) { $r = bless $r, ; $r-> (); } @IntMethod: @@ForCheck: ManakaiDOM|ForClass @@Operator: @@@@: DISPerl|NewMethod @@@ContentType: DISCore|QName @@ForCheck: ManakaiDOM|ForClass @@enDesc: Creates a new instance of the interface and returns it. {NOTE:: This method is compatible with the role so that this class is accessible via the method. } @@Param: @@@Name: impl @@@Type: DOMFeature|MinimumImplementation||ManakaiDOM|ManakaiDOMLatest @@@enDesc: An implementation object. The method with parameter values and respectively return an object implementing the interface. @@Param: @@@Name: features @@@Type: DISLang|String||ManakaiDOM|all @@@dis:actualType: DOMFeature|FeaturesString||ManakaiDOM|ManakaiDOMLatest @@@enDesc: A list of requested features. In the current implementation this parameter is ignored. @@Return: @@@Type: DOMMain|Object||ManakaiDOM|all @@@actualType: ManakaiDISParser @@@enDesc: The newly created parser object. @@@PerlDef: __DEEP{ $r = $self->SUPER::new ($impl-> ( => '2.1'), $features); }__; ##DISParser IFClsDef: @IFQName: DISNode @ClsQName: ManakaiDISNode @Description: @@lang:en @@@: node objects. @ImplNote: @@lang:en @@@: This class does not inherit , since inheriting classes such as indirectly inherit it. @MethodRedef: @@ForCheck: ManakaiDOM|ForClass @@Name:lookupNamespacePrefix @@Description: @@@lang:en @@@@: Looks up the namespace prefix associated to the given namespace URI. The default namespaces are ignored. @@Param: @@@Name:namespaceURI @@@Type: AnyURI @@@Description: @@@@lang:en @@@@@: The namespace URI to look for. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: The namespace. @@NamedParam: @@@Name: makeNewBinding @@@Type: DOMMain:boolean::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: Whether a new namespace prefix should be bound when no namespace URI has been associated yet. @@@TrueCase: @@@@Description: @@@@@lang:en @@@@@@: New binding is made if no prefix associated. @@@FalseCase: @@@@Description: @@@@@lang:en @@@@@@: Simply returns the if no prefix associated. @@Return: @@@Type: swcfg21|SWCFGString||swcfg21|ForLatest @@@actualType: DISCore:NamespacePrefix::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: An associated namespace prefix. If more than one prefix are associated to the namespace URI, the returned prefix is implementation dependent. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: No associated namespace prefix found. @@@PerlDef: $r = null; my $od = $self-> || $self; my $binds = $od->{}->{}; if (defined $namespaceURI) { FIND: { for my $prefix (keys %$binds) { if (defined $binds->{$prefix} and $binds->{$prefix} eq $namespaceURI) { $r = $prefix; last FIND; } } ## From module list try { my $db = $self-> ->; for my $mod_uri (keys %{$db->{modDef}}) { my $mod = $db-> ($mod_uri); my $mod_ln = $mod->; next if exists $binds->{$mod_ln}; my $ns_uri = $mod->; $ns_uri = '' unless defined $ns_uri; if ($ns_uri eq $namespaceURI) { $r = $mod_ln; last FIND; } } } catch with { my $err = shift; $err->throw unless $err->{} eq ; }; last FIND unless $makeNewBinding; ## Not found if ($namespaceURI =~ /(\w+)$/) { my $prefix = $1; unless (exists $binds->{$prefix}) { $binds->{$prefix} = $namespaceURI; $r = $prefix; last FIND; } } my $i = 1; { unless (exists $binds->{'ns'.$i}) { $binds->{$r = 'ns'.$i} = $namespaceURI; last FIND; } $i++; redo; } } # FIND } else { ## Null namespace FIND: { if (exists $binds->{'nu'.'ll'} and not defined $binds->{'nu'.'ll'}) { $r = 'nu'.'ll'; last FIND; } for my $prefix (keys %$binds) { if (not defined $prefix) { $r = $prefix; last FIND; } } last FIND unless $makeNewBinding; ## Not found my $i = ''; { unless (exists $binds->{'nu'.'ll'.$i}) { $binds->{$r = 'nu'.'ll'.$i} = null; last FIND; } $i++; redo; } } } @MethodRedef: @@ForCheck: ManakaiDOM|ForClass @@Name:lookupNamespaceURI @@Description: @@@lang:en @@@@: Looks up the namespace URI associated to the given prefix. @@Param: @@@Name:prefix @@@Type: DISCore:NamespacePrefix::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: The namespace URI to look for. @@NamedParam: @@@Name: makeNewBinding @@@Type: DOMMain:boolean::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: Whether a new binding should be created if no namespace URI is associated with the or not. @@@TrueCase: @@@@Description: @@@@@lang:en @@@@@@: A new binding to the temporary namespace URI exactly same as is created if no binding found. @@@FalseCase: @@@@Description: @@@@@lang:en @@@@@@: No new binding is created if no binding found. Note that even if no association newly created, this method returns the value. @@NamedParam: @@@Name: raisePrefixException @@@Type: DOMMain:boolean::ManakaiDOM:all @@@enDesc: Whehter an exception should be thrown if is not declared or not. @@Return: @@@Type: AnyURI @@@Description: @@@@lang:en @@@@@:The associated namespace URI. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: No namespace URI is associated to the prefix or the namespace is associated. @@@UndeclaredPrefixException: @@@PerlDef: my $od = $self-> || $self; my $binds = $od->{}->{}; if (exists $binds->{$prefix}) { $r = $binds->{$prefix}; } else { ## From module list FIND: { try { my $db = $od->; for my $mod_uri (keys %{$db->{modDef}}) { my $mod = $db-> ($mod_uri); if ($mod-> eq $prefix) { $r = $mod->; last FIND; } } } catch with { my $err = shift; $err->throw unless $err->{} eq ; }; if ($makeNewBinding) { $r = $binds->{$prefix} = $prefix; } elsif ($raisePrefixException) { __EXCEPTION{DIS:UNDECLARED_NS_PREFIX_ERR:: infoset:prefix => {$prefix}, MDOMX:param-name => 'prefix', DIS:sourceNode => {$self}, }__; } else { $r = null; } } # FIND } @IntMethod: @@ForCheck: ManakaiDOM|ForClass @@Name:getNodeReference @@Description: @@@lang:en @@@@: Returns a new reference to the node object. @@ManakaiDOM:isStatic:1 @@Param: @@@Name:object @@@Type: ManakaiNode|NodeStem||ManakaiDOM|Perl @@@Description: @@@@lang:en @@@@@: The node object to be referred. @@Return: @@@Type: ManakaiDISNode @@@Description: @@@@lang:en @@@@@: A newly created reference. @@@PerlDef: my $class; if ($object->{} eq '#element') { $class = ; } elsif ($object->{} eq '#comment') { $class = ; } elsif ($object->{} eq '#document') { $class = ; } elsif ($object->{} eq '#fragment') { $class = ; } else { __ASSERT{DISPerl:invariant:: msg => {qq[Node type: "$object->{}" ]. qq[(ref: "@{[ref $object]}")]}, }__; } __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl:: $object => $object, $ref => $r, $class => $class, }__; @Attr: @@Name:ownerDISDocument @@Description: @@@lang:en @@@@: The document object associated with this node. @@Get: @@@Type: DISDocument @@@clsActualType: ManakaiDISDocument @@@Description: @@@@lang:en @@@@@: The document object associated with this node. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: This node is a document node. @@@PerlDef: $r = ($self->{}->{}) if $self->{}->{}; ##DISNode IFClsDef: @IFQName: NSResolverDIS @ClsQName: ManakaiNSResolverDIS @Method: @@Name: prefixToURI @@Description: @@@lang:en @@@@: Converts a namespace prefix into associated URI reference. @@Param: @@@Name: prefix @@@Type: DISCore:NamespacePrefix::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: A namespace prefix to look for. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Returns the default namespace URI. @@NodeParam: @@Return: @@@Type: AnyURI @@@Description: @@@@lang:en @@@@@: The URI references associated. @@@UndeclaredPrefixException: @@@PerlDef: if (defined $prefix) { __DEEP{ $r = $self-> ($prefix); }__; unless (defined $r) { __EXCEPTION{UNDECLARED_NS_PREFIX_ERR:: infoset:prefix => {$prefix}, MDOMX:param-name => 'prefix', DIS:sourceNode => {$node}, }__; } } elsif (defined $self->{} ->{}) { $r = $self->{}->{}; } else { ## Default namespace __DEEP{ $r = ($self-> || $self) -> ->; }__; } @Method: @@Name: qnameToURI @@Description: @@@lang:en @@@@: Converts a qualified name () to an expanded URI reference. @@Param: @@@Name: qname @@@Type: DISCore|QName||ManakaiDOM|all @@@Description: @@@@lang:en @@@@@: A qualified name. @@NodeParam: @@NamedParam: @@@Name: defaultNamespaceURI @@@Type: AnyURI @@@enDesc: Default namespace URI reference. @@@nullCase: @@@@enDesc: The default namespace is the namespace defined by the module to which this resource belongs. @@Return: @@@Type: AnyURI @@@Description: @@@@lang:en @@@@@: The expanded URI reference. @@@UndeclaredPrefixException: @@@PerlDef: $qname =~ s/^\s+//; $qname =~ s/\s+$//; my ($prefix, $lname) = split /\s*[:|]\s*/, $qname, 2; __DEEP{ if (defined $lname) { $r = $self-> ($prefix) . $lname; } else { ## In default namespace if (defined $defaultNamespaceURI) { $r = $defaultNamespaceURI . $prefix; } else { $r = $self-> (null) . $prefix; } } }__; @Method: @@Name: qnameToPair @@Description: @@@lang:en @@@@: Converts a qualified name () to a pair of namespace URI and local name. @@Param: @@@Name: qname @@@Type: DISCore|QName||ManakaiDOM|all @@@Description: @@@@lang:en @@@@@: A qualified name. @@NodeParam: @@Return: @@@Type: DISPerl:ARRAY::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: A list of namespace URI and local name. @@@UndeclaredPrefixException: @@@PerlDef: $qname =~ s/^\s+//; $qname =~ s/\s+$//; my ($prefix, $lname) = split /\s*[:|]\s*/, $qname, 2; __DEEP{ if (defined $lname) { $r = [$self-> ($prefix), $lname]; } else { ## In default namespace $r = [$self-> (null), $prefix]; } }__; @Method: @@Name: tfqnamesToURI @@Description: @@@lang:en @@@@: Converts a into an expanded URI reference. @@Param: @@@Name: tfqnames @@@Type: dis:TFQNames::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: A to identify a resource. @@Param: @@@Name: defaultTypeURI @@@Type: NameURI @@@Description: @@@@lang:en @@@@@: A name URI reference used if it is missing from . @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Equivalent to . @@Param: @@@Name: defaultForURI @@@Type: ForURI @@@Description: @@@@lang:en @@@@@: A URI reference used if it is missing from . @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Equivalent to , i.e. . @@NodeParam: @@Return: @@@Type: DISCore:TFURI::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: The -expanded URI references. @@@UndeclaredPrefixException: @@@PerlDef: my ($typeq, $forq) = split /\s*[:|][:|]\s*/, $tfqnames, 2; my ($typeURI, $forURI); if (defined $forq) { __DEEP{ $typeURI = $typeq eq '' ? defined $defaultTypeURI ? $defaultTypeURI : : $self-> ($typeq, %opt); }__; if (length $forq) { $forURI = $self-> ($forq, %opt); } else { $forURI = ; } } else { ## "For" omitted __DEEP{ $typeURI = $typeq eq '' ? defined $defaultTypeURI ? $defaultTypeURI : : $self-> ($typeq, %opt); }__; $forURI = defined $defaultForURI ? $defaultForURI : ; } __CODE{tfurisToURI:: $turi => $typeURI, $furi => $forURI, $uri => $r}__; @Method: @@Name: tfpqnamesToURI @@Description: @@@lang:en @@@@: Converts a into an expanded URI reference. @@Param: @@@Name: tfpqnames @@@Type: DISCore:TFPQNames::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: A to identify a resource. @@Param: @@@Name: defaultTypeURI @@@Type: NameURI @@@Description: @@@@lang:en @@@@@: A name URI reference used if it is missing from . @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Equivalent to . @@Param: @@@Name: defaultForURI @@@Type: ForURI @@@Description: @@@@lang:en @@@@@: A URI reference used if it is missing from . @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Equivalent to , i.e. . @@NodeParam: @@Return: @@@Type: DISCore:TFURI::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: The -expanded URI references. @@@UndeclaredPrefixException: @@@PerlDef: my ($typeq, $forq, @forpq) = split /\s*[:|][:|]\s*/, $tfpqnames; my ($typeURI, $forURI); my $forpURI = []; undef $forq if defined $forq and $forq eq '+'; if (defined $forq) { __DEEP{ $typeURI = $typeq eq '' ? defined $defaultTypeURI ? $defaultTypeURI : : $self-> ($typeq, %opt); if (length $forq) { $forURI = $self-> ($forq, %opt); } else { $forURI = ; } }__; } else { ## "For" omitted __DEEP{ $typeURI = $typeq eq '' ? defined $defaultTypeURI ? $defaultTypeURI : : $self-> ($typeq, %opt); }__; $forURI = defined $defaultForURI ? $defaultForURI : ; } __DEEP{ for my $forpq (@forpq) { push @$forpURI, $self-> ($forpq, %opt); } }__; __CODE{tfpurisToURI:: $turi => $typeURI, $furi => $forURI, $forp => $forpURI, $uri => $r}__; ##NSResolverDIS PropDef: @QName: defaultNamespaceURI @enDesc: Default namespace URI for an element. @DIS:key: dns IFClsDef: @IFQName: DISElement @ClsQName: ManakaiDISElement @ClsISA: ManakaiNSResolverDIS @ClsISA: ManakaiDISNode @ClsISA: swcfg21:ManakaiSWCFGElement::swcfg21:ForLatest @ClsISA: dp|ManakaiDISElementPerl @Description: @@lang:en @@@: element node objects. @DISLang:role: ElementRole @Method: @@Name: forMatch @@Description: @@@lang:en @@@@: Tests whether this element is for a or not. @@Param: @@@Name: forArg @@@Type: ForURI @@@Description: @@@@lang:en @@@@@: The URI reference to test against. @@Param: @@@Name: forpArg @@@Type: ForURIList @@@Description: @@@@lang:en @@@@@: The URI references to test against. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: No additional URI reference. Equivalent to an empty array reference. @@NamedParam: @@@Name: databaseArg @@@Type: DISDatabase @@@enDesc: A database. @@@nullCase: @@@@enDesc: The database associated to the document is used. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: Whether this element is for and or not. @@@UndeclaredPrefixException: @@@NoDBException: @@@PerlDef: $forArg = unless defined $forArg; $forpArg ||= []; FORMATCH: { __DEEP{ my $for_res = ($databaseArg ||= $self-> ->) -> ($forArg); my $forp_res = [map { $databaseArg-> ($_) } @{$forpArg}]; my @ce = @{$self->}; for my $ce (@ce) { my $et = $ce->; if ($et eq ) { my $fors = [split /\s+/, $ce->]; FCs: for my $f (@$fors) { if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO my $uri = $self-> ($1); my $for = $databaseArg-> ($uri); $for-> ($ce); for my $arg_res ($for_res, @{$forp_res}) { if ($arg_res eq $for) { $r = false; last FORMATCH; } } } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA my $uri = $self-> ($1); my $for = $databaseArg-> ($uri); $for-> ($ce); for my $arg_res ($for_res, @{$forp_res}) { if ($arg_res-> ($uri)) { $r = false; last FORMATCH; } } } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO my $uri = $self-> ($1); my $for = $databaseArg-> ($uri); $for-> ($ce); for my $arg_res ($for_res, @{$forp_res}) { if ($arg_res eq $for) { next FCs; } } $r = false; last FORMATCH; } else { ## -- ISA my $uri = $self-> ($f); my $for = $databaseArg-> ($uri); $for-> ($ce); for my $arg_res ($for_res, @{$forp_res}) { if ($arg_res-> ($uri)) { next FCs; } } $r = false; last FORMATCH; } } # FCs } # dis:ForCheck } # children my $has_for = false; for my $ce (@ce) { if ($ce-> eq ) { my $fors = [split /\s+/, $ce->]; my $ok = true; $has_for = true; AFOR: for my $f (@$fors) { if ($f =~ /^!=(.+)$/) { ## -- NOT EQUAL TO my $uri = $self-> ($1); my $for = $databaseArg-> ($uri); $for-> ($ce); if ($for eq $for_res) { $ok = false; last AFOR; } } elsif ($f =~ /^!(.+)$/) { ## -- NOT ISA my $uri = $self-> ($1); my $for = $databaseArg-> ($uri); $for-> ($ce); if ($for_res-> ($uri)) { $ok = false; last AFOR; } } elsif ($f =~ /^=(.+)$/) { ## -- EQUAL TO my $uri = $self-> ($1); my $for = $databaseArg-> ($uri); $for-> ($ce); unless ($for eq $for_res) { $ok = false; last AFOR; } } else { ## -- ISA my $uri = $self-> ($f); my $for = $databaseArg-> ($uri); $for-> ($ce); unless ($for_res->($uri)){ $ok = false; last AFOR; } } } # AFOR if ($ok) { $r = true; last FORMATCH; } } # dis:For } # $ce $r = $has_for ? false : true; }__; } # FORMATCH @Method: @@Name: mediaTypeMatch @@Description: @@@lang:en @@@@: Tests whether the content media type of this element matches to a type or not. @@Param: @@@Name: mediaType @@@Type: MediaTypeURI @@@Description: @@@@lang:en @@@@@: A media type URI reference to test against. @@Param: @@@Name: defaultMediaType @@@Type: MediaTypeURI @@@Description: @@@@lang:en @@@@@: The default media type for this element. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: No default type provided. All will match. @@ForParam: @@ForpParam: @@NamedParam: @@@Name: databaseArg @@@Type: DISDatabase @@@enDesc: A database. @@@nullCase: @@@@enDesc: The database associated to the document is used. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: Whether this element is of or not. @@@PerlDef: if (defined $mediaType) { __DEEP{ my $ctn = $self-> (, 'ContentType'); my $ct; $ct = $ctn-> if $ctn; $ct = $defaultMediaType unless defined $ct; my $res = $self-> -> -> ($ct); $res-> ($ctn or $self); unless ($res-> ($mediaType)) { $r = false; } else { $r = true; } }__; } else { $r = true; } @Method: @@Name:mediaTypeURI @@enDesc: The URI reference of the media type of this element. @@Type: MediaTypeURI @@NamedParam: @@@Name:defaultMediaType @@@Type:MediaTypeURI @@@enDesc: The default media type URI reference. @@@nullCase: @@@@enDesc: No default is specified. @@ForParam: @@ForpParam: @@Return: @@@enDesc: The media type URI reference of this element. @@@nullCase: @@@@enDesc: This element has no media type information and parameter is not provided. @@@UndeclaredPrefixException: @@@PerlDef: __DEEP{ $r = $defaultMediaType; my $ctn = $self-> (, 'ContentType'); $r = $ctn-> if $ctn; }__; @Method: @@Name: disGetAttribute @@enDesc: Gets an attribute node. @@Param: @@@Name: attrName @@@Type: AnyURI @@@enDesc: The name expanded URI of the node to retrieve. @@ForParam: @@ForpParam: @@MediaTypeParam: @@MediaTypeDefaultParam: @@NamedParam: @@@Name: databaseArg @@@Type: DISDatabase @@@enDesc: A database. @@@nullCase: @@@@enDesc: The database associated to the document is used. @@Return: @@@Type: DISElement @@@clsActualType: ManakaiDISElement @@@enDesc: The attribute (property) element node. @@@nullCase: @@@@enDesc: No attribute node found. @@@PerlDef: C: for my $c (@{$self-> (for_arg => $forArg, forp_arg => $forpArg, database_arg => $databaseArg)}) { if ($c-> eq $attrName and $c-> ($mediaType, $defaultMediaType, for_arg => $forArg, forp_arg => $forpArg, database_arg => $databaseArg)) { $r = $c; last C; } } @Method: @@Name: disGetAttributeList @@enDesc: Gets attribute nodes. @@Param: @@@Name: attrName @@@Type: AnyURI @@@enDesc: The name expanded URI of the node to retrieve. @@ForParam: @@ForpParam: @@MediaTypeParam: @@MediaTypeDefaultParam: @@NamedParam: @@@Name: databaseArg @@@Type: DISDatabase @@@enDesc: A database. @@@nullCase: @@@@enDesc: The database associated to the document is used. @@Return: @@@Type: DISElementList @@@clsActualType: ManakaiDISElementList @@@enDesc: The attribute (property) element nodes. @@@PerlDef: $r = bless [], ; for my $c (@{$self-> (for_arg => $forArg, forp_arg => $forpArg, database_arg => $databaseArg)}) { if ($c-> eq $attrName and $c-> ($mediaType, $defaultMediaType, for_arg => $forArg, forp_arg => $forpArg, database_arg => $databaseArg)) { push @$r, $c; } } @Method: @@Name: disChildElements @@enDesc: A list of child elements, with check. @@ForParam: @@ForpParam: @@NamedParam: @@@Name: databaseArg @@@Type: DISDatabase @@@enDesc: A database. @@@nullCase: @@@@enDesc: The database associated to the document is used. @@Return: @@@Type: DISElementList @@@clsActualType: ManakaiDISElementList @@@enDesc: The current snapshot of child nodes. @@@PerlDef: $r = bless [], ; __DEEP{ C: for my $cn (@{$self->}) { ## $cn is an #element. my $dn; __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl:: $object => {$cn->{}}, $ref => $dn, $class => {}, }__; next C unless $dn-> ($forArg, $forpArg, database_arg => $databaseArg); push @$r, $dn; } }__; @Method: @@Name: disAllChildElements @@enDesc: A list of child elements, without check. @@Return: @@@Type: DISElementList @@@clsActualType: ManakaiDISElementList @@@enDesc: The current snapshot of child nodes. @@@PerlDef: $r = bless [], ; __DEEP{ for my $cn (@{$self->}) { ## $cn is an #element. my $dn; __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl:: $object => {$cn->{}}, $ref => $dn, $class => {}, }__; push @$r, $dn; } }__; @Attr: @@Name: qnameValueURI @@enDesc: The element value (written as ), as URI reference. \ {NOTE:: What should be if list value? \ } @@Get: @@@Type:AnyURI @@@nullCase: @@@@enDesc: No value. @@@UndeclaredPrefixException: @@@PerlDef: __DEEP{ my $v = $self->; if (defined $v and not ref $v eq 'ARRAY') { $r = $self-> ($v, node => $self); } else { $r = null; } }__; @Attr: @@Name: qnameValueLocalName @@enDesc: The local name part of the element value (assumed as written as ). \ {NOTE:: What should be if list value? \ } @@Get: @@@Type: DISCore:LocalName::ManakaiDOM:all @@@nullCase: @@@@enDesc: No value. @@@PerlDef: __DEEP{ my $v = $self->; if (defined $v and not ref $v eq 'ARRAY') { my ($n, $v) = split /\s*[:|]\s*/, $v, 2; $r = defined $v ? $v : $n; } else { $r = null; } }__; @Attr: @@Name: qnameValuePrefix @@enDesc: The prefix part of the element value (assumed as written as ). \ {NOTE:: What should be if list value? \ } @@Get: @@@Type: DISCore:NamespacePrefix::ManakaiDOM:all @@@nullCase: @@@@enDesc: No value. @@@PerlDef: __DEEP{ my $v = $self->; if (defined $v and not ref $v eq 'ARRAY') { my ($p, $l) = split /\s*[:|]\s*/, $v, 2; $r = defined $l ? $p : null; } else { $r = null; } }__; @Attr: @@Name: qnameValueNamespaceURI @@enDesc: The namespace URI of the element value (assumed as written in ). \ {NOTE:: What should be if list value? \ } @@Get: @@@Type:AnyURI @@@nullCase: @@@@enDesc: No value. @@@UndeclaredPrefixException: @@@PerlDef: __DEEP{ my $v = $self->; if (defined $v and not ref $v eq 'ARRAY') { my ($p, $v) = split /\s*[:|]\s*/, $v, 2; $r = $self-> (defined $v ? $p : null); } else { $r = null; } }__; @Method: @@Name: tfqnamesValueURI @@enDesc: The element value (written as ), as URI reference. \ {NOTE:: What should be if list value? \ } @@Param: @@@Name: defaultTypeURI @@@Type: NameURI @@@Description: @@@@lang:en @@@@@: A name URI reference used if it is missing from . @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Equivalent to . @@Param: @@@Name: defaultForURI @@@Type: ForURI @@@Description: @@@@lang:en @@@@@: A URI reference used if it is missing from . @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Equivalent to , i.e. . @@ForParam: @@ForpParam: @@NamedParam: @@@Name:databaseArg @@@Type:DISDatabase @@Return: @@@Type:ResourceURI @@@nullCase: @@@@enDesc: No value. @@@UndeclaredPrefixException: @@@PerlDef: my $v = $self->; if (defined $v and not ref $v eq 'ARRAY') { __DEEP{ if ($self-> (, , for_arg => $forArg, forp_arg => $forpArg, database_arg => $databaseArg)) { $r = $self-> ($v, $defaultTypeURI, $defaultForURI, node => $self); } else { $r = $self-> ($v, $defaultTypeURI, $defaultForURI, node => $self); } }__; } else { $r = null; } @Method: @@Name: elementTypeMatch @@enDesc: Returns whether the element type of this element matches with another element type (either the same element type or this type is a subtype of another type). @@Param: @@@Name: etype @@@Type: ResourceURI @@@enDesc: An element type name URI reference to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: Either the element type expanded URI reference of this element is same as or it is a sub-element type of . @@@FalseCase: @@@@enDesc: This element is not of . @@@NoDBException: @@@PerlDef: __DEEP{ my $et = $self->; my $rdef = $self-> -> -> ($et); $r = $rdef-> ($etype); }__; @Attr: @@Name: isResourceElement @@enDesc: Whether this element defines a resource or not. \ {NOTE:: An element defines a resource if its element type is or its subtype. \ } @@Get: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: This element defines a resource. @@@FalseCase: @@@@enDesc: This element does not define any resource. @@@NoDBException: @@@PerlDef: __DEEP{ $r = ($self-> eq ); }__; @Method: @@Name: isPropertyElement @@enDesc: Whether this element is a property or not. \ {NOTE:: An element is a property if its element type is or if its element type's property is or is . \ } @@NamedParam: @@@Name: databaseArg @@@Type: DIS|DISDatabase @@@nullCase: @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: This element is a property. @@@FalseCase: @@@@enDesc: This element is not a property. @@@NoDBException: @@@PerlDef: __DEEP{ my $xn = $self->; if ($xn eq ) { $r = true; } else { my $rdef = ($databaseArg or $self-> ->) -> ($xn); $r = $rdef-> (); } }__; @Method: @@Name: getFeature @@Description: @@@lang:en @@@@: Returns a specialized object that implements the specialized interfaces of the specified feature and version. @@Param: @@@Name: feature @@@Type: swcfg21|SWCFGString||swcfg21|ForLatest @@@actualType: DOMFeature|FeatureNameString||ManakaiDOM|ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: A feature name to request. @@Param: @@@Name: version @@@Type: swcfg21|SWCFGString||swcfg21|ForLatest @@@actualType: DOMFeature|FeatureVersionString||ManakaiDOM|ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: A feature version number to request. @@Return: @@@Type: DOMMain:Object::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: An object that implements the specialized APIs of the and . @@@nullCase: @@@@enDesc: There is no object available that implements interfaces associated with the and . @@@PerlDef: $feature =~ s/^\+//; CLASS: for my $class (grep { $Message::Util::DIS::ManakaiDISElement::CompatClass{$_} } keys %Message::Util::DIS::ManakaiDISElement::CompatClass) { if ($Message::DOM::ClassFeature{$class}->{$feature}->{$version}) { __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl:: $object => {$self->{}}, $ref => $r, $class => $class, }__; last CLASS; } } @Method: @@Name: unlinkFromDocument @@enDesc: Removes any relationship to this node from the owner document tree. In addition, namespace bindings are copied from the document. The node be a cloned one (or just newly created one) so that it does not have any parent-child relationship. {NOTE:: Once a subtree has removed from the document, the nodes belongs to the subtree can't be part of any document anymore. } @@Param: @@@Name: databaseArg @@@Type: DISDatabase @@@enDesc: The database. @@Return: @@@PerlDef: __DEEP{ my $ods = $self->{}->{}; $self->{}->{} = $self-> ($databaseArg); $self->{}->{} = ${$self->}; my @nodes = ($self->{}); while (defined (my $node = shift @nodes)) { CORE::delete $node->{}; push @nodes, grep {$_} @{$node->{}}, $node->{}, $node->{}; } $self->{} ->; }__; @Method: @@Name: getNamespaceBindingList @@enDesc: Returns the hash reference of namespace bindings. @@Type: DISPerl|HASH||ManakaiDOM|all @@Param: @@@Name: databaseArg @@@Type: DISDatabase @@@enDesc: The database. @@Return: @@@PerlDef: my $ods = $self->{}->{}; if ($ods->{}) { $r = $ods->{}; } else { if ($databaseArg) { for my $mod_uri (keys %{$databaseArg->{modDef}}) { my $mod = $databaseArg-> ($mod_uri); $ods->{} ->{$mod->} = $mod->; } } for my $prefix (keys %{$ods->{}}) { $ods->{}->{$prefix} = $ods->{}->{$prefix}; } $r = $ods->{}; } @Method: @@Name: getDefaultNamespaceURIRef @@enDesc: A reference to the URI of the default namespace. @@Type: DISPerl|SCALAR||ManakaiDOM|all @@Return: @@@PerlDef: my $ods = $self->{}->{}; if ($ods->{}) { $r = \ ($ods->{}); } else { __DEEP{ $r = \($ods->{} = $self-> -> ->); }__; } @Method: @@Name: preserveNodePath @@enDesc: Saves a copy of node path string. @@Return: @@@PerlDef: __DEEP{ $self-> (nodePath => $self-> (key => [qw/QName Name Type type/])); }__; @Method: @@Operator: @@@ContentType: DISCore|QName @@@@: DISPerl:CloneMethod @@Description: @@@lang:en @@@@: Makes a copy of this node. All child nodes are cloned and all flags and options are copied (rather than cloned). The new node does not have any parent. @@Return: @@@Type: DISElement @@@Description: @@@@lang:en @@@@@: The cloned node. \ If this node is a document node, then the another document is made. @@@PerlDef: $r = bless $self->SUPER::clone, ; ##DISElement PropDef: @QName: allNSBindings @enDesc: Collected set of namespace bindings for a node. IFClsDef: @IFQName: DISModuleElement @ClsQName: ManakaiDISModuleElement @IFISA: DISElement @ClsISA: ManakaiDISElement @enDesc: The elements. @DISLang:role: @@@: DISLang:NullRole @@DISCore:stopISARecursive:1 @Attr: @@Name: requireElement @@enDesc: The child element. The element is newly created if not exist. @@Type: DISElement @@clsActualType: ManakaiDISElement @@Get: @@@PerlDef: __DEEP{ $r = bless $self-> (, 'Require', make_new_node => true), ; }__; @Attr: @@Name: defaultForURI @@enDesc: The value of attribute. @@Type: ForURI @@Get: @@@enDesc: The value of child element. If missing, is returned. @@@PerlDef: __DEEP{ my $df = $self-> (, 'DefaultFor'); if ($df) { $r = (bless $df, ) -> || ; } else { $r = ; } }__; @@Set: @@@PerlDef: __DEEP{ $self-> (, 'DefaultFor' => $given); }__; @Attr: @@Name: definingNamespaceURI @@enDesc: The value of attribute, i.e. the URI reference of the namespace that this module primary defines. \ {NOTE:: Defining namespace URI is independent. \ } @@Type: AnyURI @@Get: @@@PerlDef: __DEEP{ my $df = $self-> (, 'Namespace'); if ($df) { $r = $df->; } else { __ASSERT{DISPerl:invariant:: msg => {qq["dis:Namespace" attribute not found]}, }__; } }__; @@Set: @@@PerlDef: __DEEP{ $self-> (, 'Namespace' => $given); }__; ##DISModuleElement IFClsDef: @IFQName: DISElementList @ClsQName: ManakaiDISElementList @enDesc: @@lang:en @@@: Lists of elements. \ {NOTE:: is ; later changes to the tree does not affect this type of objects. \ } ##DISElementList IFClsDef: @IFQName: DISComment @ClsQName: ManakaiDISComment @ClsISA: ManakaiDISNode @ClsISA: swcfg21:ManakaiSWCFGComment::swcfg21:ForLatest @Description: @@lang:en @@@: comment node objects. ##DISComment IFClsDef: @IFQName: DISDocumentFragment @ClsQName: ManakaiDISDocumentFragment @ClsISA: ManakaiDISNode @ClsISA: swcfg21:ManakaiSWCFGDocumentFragment::swcfg21:ForLatest @Description: @@lang:en @@@: document fragment node objects. ##DISDocumentFragment IFClsDef: @IFQName: DISDocument @ClsQName: ManakaiDISDocument @ClsISA: ManakaiDISNode @ClsISA: swcfg21:ManakaiSWCFGDocument::swcfg21:ForLatest @Description: @@lang:en @@@: document node objects. @Attr: @@Name: moduleElement @@enDesc: The element in this document. The element is newly created if not exist. @@Type: DISModuleElement @@clsActualType: ManakaiDISModuleElement @@Get: @@@PerlDef: __DEEP{ $r = $self-> (, 'Module', make_new_node => true); }__; $r = bless $r, ; @Attr: @@Name: disDatabase @@enDesc: Associated database. @@Type: DISDatabase @@clsActualType: ManakaiDISDatabase @@Get: @@@NoDBException: @@@PerlDef: if ($self->{}->{}) { $r = $self->{}->{}; } else { __EXCEPTION{NO_ASSOCIATED_DB_ERR}__; } @@Set: @@@PerlDef: $self->{}->{} = $given; require Scalar::Util; Scalar::Util::weaken ($self->{}->{}); @Method: @@Name: disChildElements @@enDesc: A list of child elements, with checks. @@ForParam: @@ForpParam: @@NamedParam: @@@Name: databaseArg @@@Type: DISDatabase @@@enDesc: A database. @@@nullCase: @@@@enDesc: The database associated to the document is used. @@Return: @@@Type: DISElementList @@@clsActualType: ManakaiDISElementList @@@enDesc: The current snapshot of child nodes. @@@PerlDef: $r = bless [], ; __DEEP{ C: for my $cn (@{$self->}) { next C unless $cn-> eq '#element'; my $dn; __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl:: $object => {$cn->{}}, $ref => $dn, $class => {}, }__; next C unless $dn-> ($forArg, $forpArg, database_arg => $databaseArg); push @$r, $dn; } }__; @Method: @@Name: disAllChildElements @@enDesc: A list of child elements, without checks. @@Return: @@@Type: DISElementList @@@clsActualType: ManakaiDISElementList @@@enDesc: The current snapshot of child nodes. @@@PerlDef: $r = bless [], ; __DEEP{ C: for my $cn (@{$self->}) { next C unless $cn-> eq '#element'; my $dn; __CODE{ManakaiNode|getNewReference||ManakaiDOM|Perl:: $object => {$cn->{}}, $ref => $dn, $class => {}, }__; push @$r, $dn; } }__; @Method: @@Name: addNamespaceBinding @@Param: @@@Name: prefix @@@Type: DISLang|String||ManakaiDOM|all @@Param: @@@Name: namespaceURI @@@Type: DISLang|String||ManakaiDOM|all @@@nullCase: @@Return: @@@PerlDef: if (defined $namespaceURI) { $self->{}->{}->{$prefix} = $namespaceURI; } else { CORE::delete $self->{}->{} ->{$prefix}; } ##DISDocument PropDef: @QName: db @enDesc: Associated database. @rdfs:domain: ManakaiDISDocument @rdfs:range: ManakaiDISDatabase ## -- Definition object database IFClsDef: @IFQName: DISDatabase @ClsQName: ManakaiDISDatabase @ClsISA: dp|ManakaiDISDatabasePerl @ClsISA: ManakaiDISExceptionTarget @enDesc: Resource database created from source data. @DISLang:role: DatabaseRole @Method: @@Name: getModule @@Description: @@@lang:en @@@@: Returns a module definition. @@Param: @@@Name: moduleURI @@@Type: ModuleURI @@@Description: @@@@lang:en @@@@@: A module URI reference. @@ForParam: @@Return: @@@Type: DISModule @@@clsActualType: ManakaiDISModuleDefinition @@@Description: @@@@lang:en @@@@@: The module definition. @@@PerlDef: my $modURI; if (defined $forArg) { __CODE{tfurisToURI:: $turi => $moduleURI, $furi => $forArg, $uri => $modURI}__; } else { $modURI = $moduleURI; } if (defined $self->{modDef}->{$modURI}) { $r = $self->{modDef}->{$modURI}; } else { $r = $self->{modDef}->{$modURI} = bless { uri => $modURI, db => $self, for => , forp => [], }, ; require Scalar::Util; Scalar::Util::weaken ($r->{db}); } @Method: @@Name: getFor @@Description: @@@lang:en @@@@: Returns a definition object. @@Param: @@@Name: forURI @@@Type: ForURI @@@Description: @@@@lang:en @@@@@: A URI reference. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Defaulted to . @@Return: @@@Type: DISFor @@@clsActualType: ManakaiDISForDefinition @@@PerlDef: $forURI = unless defined $forURI; if (defined $self->{forDef}->{$forURI}) { $r = $self->{forDef}->{$forURI}; } elsif (defined $self->{}->{$forURI}) { __DEEP{ $self-> ($self-> (${$self->{}->{$forURI}})); }__; unless (defined $self->{forDef}->{$forURI}) { __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR:: DIS:uri => {$forURI}, DIS:moduleURI => {${$self->{} ->{$forURI}}}, }__; } $r = $self->{forDef}->{$forURI}; } else { $r = $self->{forDef}->{$forURI} = bless { uri => $forURI, isa => { => true}, revISA => {}, db => $self, }, ; $self->{forDef}->{}->{revISA}->{$forURI} = true; require Scalar::Util; Scalar::Util::weaken ($r->{db}); } @Method: @@Name: getResource @@Description: @@@lang:en @@@@: Returns a resource definition. @@Param: @@@Name: resourceURI @@@Type: ResourceURI @@@Description: @@@@lang:en @@@@@: A resource URI reference. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Defaulted to . @@ForParam: @@Return: @@@Type: DISResource @@@clsActualType: ManakaiDISResourceDefinition @@@Description: @@@@lang:en @@@@@: The resource definition. @@@RaiseException: @@@@@: DIS|RESOURCE_NOT_DEFINED_ERR @@@@enDesc: The resource should be included in database submodule but it is not. @@@PerlDef: $resourceURI = unless defined $resourceURI; my $resURI; if (defined $forArg) { __CODE{tfurisToURI:: $turi => $resourceURI, $furi => $forArg, $uri => $resURI}__; } else { $resURI = $resourceURI; } if (defined $self->{resDef}->{$resURI}) { $r = $self->{resDef}->{$resURI}; } elsif (defined $self->{}->{$resURI}) { __DEEP{ $self-> ($self-> (${$self->{}->{$resURI}})); }__; unless (defined $self->{resDef}->{$resURI}) { __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR:: DIS:uri => {$resURI}, DIS:moduleURI => {${$self->{} ->{$resURI}}}, }__; } $r = $self->{resDef}->{$resURI}; } else { $r = $self->{resDef}->{$resURI} = bless { uri => $resURI, aliasURI => {$resURI => true}, db => $self, for => , forp => [], seq => -1, }, ; require Scalar::Util; Scalar::Util::weaken ($r->{db}); } @Method: @@Name: getAnyResource @@enDesc: Returns a resource object, either module, , or resource. @@Param: @@@Name: resourceURI @@@Type: ResourceURI @@@Description: @@@@lang:en @@@@@: A resource URI. @@@nullCase: @@@@Description: @@@@@lang:en @@@@@@: Defaulted to . @@ForParam: @@Return: @@@Type: DIS|DISAnyResource @@@Description: @@@@lang:en @@@@@: The resource definition. @@@RaiseException: @@@@@: DIS|RESOURCE_NOT_DEFINED_ERR @@@@enDesc: The resource should be included in database submodule but it is not. @@@PerlDef: $resourceURI = unless defined $resourceURI; my $resURI; if (defined $forArg) { __CODE{tfurisToURI:: $turi => $resourceURI, $furi => $forArg, $uri => $resURI}__; } else { $resURI = $resourceURI; } if (defined $self->{resDef}->{$resURI}) { $r = $self->{resDef}->{$resURI}; } elsif (defined $self->{modDef}->{$resURI}) { $r = $self->{modDef}->{$resURI}; } elsif (defined $self->{forDef}->{$resURI}) { $r = $self->{forDef}->{$resURI}; } elsif (defined $self->{}->{$resURI}) { __DEEP{ $self-> ($self-> (${$self->{}->{$resURI}})); }__; if (defined $self->{resDef}->{$resURI}) { $r = $self->{resDef}->{$resURI}; } elsif (defined $self->{forDef}->{$resURI}) { $r = $self->{forDef}->{$resURI}; } else { __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR:: DIS:uri => {$resURI}, DIS:moduleURI => {${$self->{} ->{$resURI}}}, }__; } } else { __DEEP{ $r = $self-> ($resURI); }__; } @Method: @@Name: getSourceFile @@enDesc: Gets source document. @@Param: @@@Name: fileName @@@Type: FileURI @@@enDesc: A URI reference identifying a file. @@Return: @@@Type: DISDocument @@@clsActualType: ManakaiDISDocument @@@enDesc: The source document. @@@nullCase: @@@@enDesc: No document associated with that . @@@PerlDef: $r = $self->{}->{$fileName}; @Method: @@Name: setSourceFile @@enDesc: Puts source document object. @@Param: @@@Name: fileName @@@Type: FileURI @@@enDesc: A URI reference identifying a file. If there is already a source document, then the association has been updated. @@Param: @@@Name: doc @@@Type: DISDocument @@@clsActualType: ManakaiDISDocument @@@enDesc: The document object to set. @@Return: @@@PerlDef: $self->{}->{$fileName} = $doc; @Method: @@Name: loadModule @@enDesc: Loads definitions from a document. @@Param: @@@Name: doc @@@Type: DISDocument @@@clsActualType: ManakaiDISDocument @@@enDesc: The source document object. Its must be this database. @@Param: @@@Name: resolver @@@Type: DISModuleResolver @@@enDesc: The resolver to convert module name into document object. @@ForParam: @@NamedParam: @@@Name: onResourceRead @@@Type: DISPerl:CODE::ManakaiDOM:all @@@enDesc: An event handler called when a resource is read. @@@nullCase: @@@@enDesc: No event handler is read. @@Return: @@@RaiseException: @@@@@: NO_MODULE_QNAME_ERR @@@@enDesc: The element must have a attribute. @@@RaiseException: @@@@@: UNABLE_TO_GET_MODULE_ERR @@@@enDesc: The implementation is unable to get a module source. @@@ForDefDupException: @@@ForDefNoQNameException: @@@ResDefDupException: @@@ElementNotAllowedException: @@@RaiseException: @@@@@:NO_REQUIRED_ATTR_ERR @@@@enDesc: The element does not have attribute. @@@PerlDef: $resolver = bless $resolver, if ref $resolver eq 'CODE'; ## -- Module Name, URI $forArg = unless defined $forArg; my $mod_node; my $mod_name_node; __DEEP{ $mod_node = $doc->; $mod_name_node = $mod_node-> (, 'QName'); unless ($mod_name_node) { __UNDEEP{ __EXCEPTION{NO_MODULE_QNAME_ERR:: DIS:sourceNode => {$mod_node}, }__; }__; } $mod_name_node = bless $mod_name_node, if $mod_name_node->isa (); my $mod_name_uri = $mod_name_node ->; my $mod = $self-> ($mod_name_uri, for_arg => $forArg); unless ($mod->) { ## -- Initializes Module Definition Object my $v = $mod_name_node->; __CODE{DISPerl|HashStringRef||ManakaiDOM|all:: $result => {$mod->{localName}}, $given => {$v}, }__; my $ns = $mod_name_node->; __CODE{DISPerl|HashStringRef||ManakaiDOM|all:: $result => {$mod->{namespaceURI}}, $given => {$ns}, }__; __CODE{DISPerl|HashStringRef||ManakaiDOM|all:: $result => {$mod->{for}}, $given => {$forArg}, }__; $mod->{src} = $mod_node; $mod->{} = true; $self-> ($mod_name_uri => $doc); $mod-> ($mod_node->); __CODE{dv:createValue:: $result => {$mod->{}}, $value => {$doc-> ()}, $base_type => {}, $type => {}, $name => {}, }__; ## -- Loads "for" definition my $root_elements = $doc->; if ($mod-> eq ) { R: for my $el (@$root_elements) { next R unless $el-> eq ; $self-> ($mod, $el); } } ## -- Loads "for all" my $rmod = $self-> ($mod_name_uri, for_arg => ); unless ($rmod->) { my $rdoc = $resolver-> ($self, $rmod->, $mod->, $mod->, ); unless ($rdoc) { __UNDEEP{ __EXCEPTION{UNABLE_TO_GET_MODULE_ERR:: DIS:uri => {$rmod->}, DIS:namespaceURI => {$mod->}, DIS:localName => {$mod->}, DIS:for => {}, DIS:sourceNode => {$mod->}, }__; }__; } $self-> ($rdoc, $resolver, for_arg => , on_resource_read => $onResourceRead); } # Unless "for all" loaded ## -- Loads Required Modules ## NOTE:: "dis:For" is not allowed since "dis:ForDef" is not read my $req_node = $mod_node->; for my $rm (@{$req_node->}) { next unless $rm-> eq ; my ($uri, $nuri, $ln, $for); my $mqn = $rm-> (, 'QName'); if ($mqn) { my $mqv = $mqn->; my $mqp = ($mqn->isa () ? (bless $mqn, ) : $mqn) -> ($mqv, node => $mqn); ($nuri, $ln) = @$mqp; } else { my $mn = $rm-> (, 'Name'); if ($mn) { $nuri = $mod->; $ln = $mn->; } else { $nuri = $mod->; $ln = $mod->; } } my $wfn = $rm-> (, 'WithFor'); if ($wfn) { $for = ($wfn->isa () ? (bless $wfn, ) : $wfn) ->; } else { $for = $mod->; } my $rmod = $self-> ($nuri . $ln, for_arg => $for); unless ($rmod->) { my $rdoc = $resolver-> ($self, $rmod->, $nuri, $ln, $for); unless ($rdoc) { __UNDEEP{ __EXCEPTION{UNABLE_TO_GET_MODULE_ERR:: DIS:uri => {$rmod->}, DIS:namespaceURI => {$nuri}, DIS:localName => {$ln}, DIS:for => {$for}, DIS:sourceNode => {$rm}, }__; }__; } $self-> ($rdoc, $resolver, for_arg => $for, on_resource_read => $onResourceRead); } } # Child Module elements ## -- Loads child resources $root_elements = $doc-> (for_arg => $forArg, database_arg => $self); for my $el (@$root_elements) { if ($el->) { $self-> ($mod, null, null, $el, for_arg => $forArg, on_resource_read => $onResourceRead); } else { my $et = $el->; if ({ => 1, => 1, => 1, }->{$et}) { # } else { __UNDEEP{ __EXCEPTION{ELEMENT_NOT_ALLOWED_ERR:: DIS:elementType => {$et}, DIS:sourceNode => {$el}, DIS:uri => {$mod->{uri}}, }__; }__; } } # element types } my $dn = $mod_node-> (, 'Namespace'); unless ($dn and defined $dn->) { __UNDEEP{ __EXCEPTION{NO_REQUIRED_ATTR_ERR:: DIS:elementType => {}, DIS:sourceNode => {$mod_node}, }__; }__; } } # Unless this module loaded }__; # Deep @Method: @@Name: loadFor @@enDesc: Loads definition of a from a element. @@Param: @@@Name: mod @@@Type: DISModule @@@clsActualType: ManakaiDISModuleDefinition @@@enDesc: The module in which the to load is defined. @@Param: @@@Name: el @@@Type: DISElement @@@enDesc: The source element object. @@Return: @@@ForDefDupException: @@@ForDefNoQNameException: @@@ElementNotAllowedException: @@@PerlDef: __DEEP{ my $qn_node = $el-> (, 'QName'); unless ($qn_node) { __UNDEEP{ __EXCEPTION{NO_FOR_QNAME_ERR:: DIS:sourceNode => {$el}, }__; }__; } $qn_node = bless $qn_node, if $qn_node->isa (); my $qn_uri = $qn_node->; my $for = $self-> ($qn_uri); unless ($for->) { ## -- Initializes "For" Definition Object $for->{src} = $el; $for->{} = true; $for->{} = \ ($mod->{uri}); for my $ce (@{$el->}) { my $xn = $ce->; if ($xn eq or $xn eq ) { my $sfor = $self-> ($ce->); $for-> ($sfor); $sfor-> ($ce); ## TODO: warn if dis:Implement } elsif ({ => 1, => 1, => 1, => 1, }->{$xn}) { # } else { __UNDEEP{ __EXCEPTION{ELEMENT_NOT_ALLOWED_ERR:: DIS:elementType => {$xn}, DIS:sourceNode => {$ce}, DIS:uri => {$qn_uri}, }__; }__; } } } else { __UNDEEP{ __EXCEPTION{FOR_ALREADY_DEFINED_ERR:: DIS:sourceNode => {$el}, DIS:anotherSourceNode => {$el}, DIS:uri => {$qn_uri}, }__; }__; } # isDefine? }__; # DEEP @Method: @@Name: loadResource @@enDesc: Loads definition of a resource from a element. @@Param: @@@Name: mod @@@Type: DISModule @@@clsActualType: ManakaiDISModuleDefinition @@@enDesc: The module in which the resource to load is defined. @@Param: @@@Name: parentResource @@@Type: DISResource @@@clsActualType: ManakaiDISResourceDefinition @@@enDesc: The (static) parent resource in which the resource to load is defined. @@@nullCase: @@@@enDesc: The resource to load is a root resource, i.e. is a direct child of the document node. @@Param: @@@Name: dynParent @@@Type: DISResource @@@clsActualType: ManakaiDISResourceDefinition @@@enDesc: The dynamic parent resource of the resource to load. @@@nullCase: @@@@enDesc: If this resource is a root resource, i.e. is a direct child of the document node. @@Param: @@@Name: el @@@Type: DISElement @@@clsActualType: ManakaiDISElement @@@enDesc: The source element object. @@ForParam: @@ForpParam: @@NamedParam: @@@Name: onResourceRead @@@Type: DISPerl:CODE::ManakaiDOM:all @@@enDesc: An event handler called when a resource is read. @@@nullCase: @@@@enDesc: No event handler is read. @@Return: @@@ResDefDupException: @@@ElementNotAllowedException: @@@RaiseException: @@@@@: NO_RDF_TYPE_ERR @@@@enDesc: There is a resorce that does not have any attribute. @@@PerlDef: $forArg = unless defined $forArg; $forpArg ||= []; __DEEP{ ## -- Node names ## Unique resource identifier generated from node id my $node_id = $el->; my $node_uri; __CODE{tfpurisToURI:: $turi => {$$node_id}, $furi => $forArg, $forp => $forpArg, $uri => $node_uri}__; my $al_node = $el-> (, for_arg => $forArg, forp_arg => $forpArg, database_arg => $self); my $al_canon_uri; if ($al_node) { $al_canon_uri = $al_node-> ($$node_id, $forArg, for_arg => $forArg, forp_arg => $forpArg, database_arg => $self); } ## User defined resource identifiers my $qn_node = $el-> (, for_arg => $forArg, forp_arg => $forpArg, database_arg => $self); my $res; ALD: { if ($qn_node) { my $qn_uri = $qn_node->; $res = $self-> ($qn_uri, for_arg => $forArg); if ($res->) { last ALD if defined $al_canon_uri and $res->{aliasURI}->{$al_canon_uri}; __UNDEEP{ __EXCEPTION{RESOURCE_ALREADY_DEFINED_ERR:: DIS:uri => {$qn_uri}, DIS:sourceNode => {$qn_node}, DIS:anotherSourceNode => {$res->{src}}, }__; }__; } my $v = $qn_node->; __CODE{DISPerl|HashStringRef||ManakaiDOM|all:: $result => {$res->{localName}}, $given => {$v}, }__; my $ns = $qn_node->; __CODE{DISPerl|HashStringRef||ManakaiDOM|all:: $result => {$res->{namespaceURI}}, $given => {$ns}, }__; } else { ## Anonymous or local my $n_node = $el-> (, for_arg => $forArg, forp_arg => $forpArg, database_arg => $self); if ($n_node) { if ($parentResource) { my $puri = $parentResource->{uri}; my $ru; my $ln = $n_node->; __CODE{getChildResourceURI:: $parentURI => $puri, $localName => $ln, $result => $ru}__; $res = $self-> ($ru, for_arg => $forArg); my $v = $n_node->; __CODE{DISPerl|HashStringRef||ManakaiDOM|all:: $result => {$res->{localName}}, $given => {$v}, }__; $res->{} = true; } else { ## Root local name resource my $ln = $n_node->; my $ns_uri = $mod-> ->; my $qn_uri = $ns_uri . $ln; $res = $self-> ($qn_uri, for_arg => $forArg); if ($res->) { last ALD if defined $al_canon_uri and $res->{aliasURI}->{$al_canon_uri}; __UNDEEP{ __EXCEPTION{RESOURCE_ALREADY_DEFINED_ERR:: DIS:uri => {$res->}, DIS:sourceNode => {$n_node}, DIS:anotherSourceNode => {$res->}, }__; }__; } __CODE{DISPerl|HashStringRef||ManakaiDOM|all:: $result => {$res->{namespaceURI}}, $given => {$ns_uri}, }__; __CODE{DISPerl|HashStringRef||ManakaiDOM|all:: $result => {$res->{localName}}, $given => {$ln}, }__; } } else { $res = $self-> ($node_uri); $res->{} = true; } } # anon __CODE{DISPerl|HashStringRef||ManakaiDOM|all:: $result => {$res->{for}}, $given => {$forArg}, }__; $res->{forp} = $forpArg; $res->{src} = $el; $res->{} = \ ($mod->{uri}); $mod-> ($res); $res-> ($parentResource) if $parentResource; $res-> ($dynParent) if $dynParent; unless ($res->{uri} eq $node_uri) { my $nu_res = $self-> ($node_uri); $res-> ($nu_res); } $res->{} = true; $res->{seq} = $self->{seq}++; $res-> ($node_id); ## -- Alias if ($al_node) { my $canon_res = $self-> ($al_canon_uri); $canon_res-> ($al_node); $canon_res-> ($res, node => $al_node); $res = $canon_res; } } # ALD ## -- Registers as child $parentResource-> ($res) if $parentResource; $dynParent-> ($res) if $dynParent; my $is_multires = false; my @props; my @cres; my @ce0 = @{$el-> (for_arg => $forArg, forp_arg => $forpArg, database_arg => $self)}; my $has_type = $al_node; while (@ce0) { my $ce = shift @ce0; if ($ce-> (, database_arg => $self)) { $has_type = true; my $type_uri = $ce->; my $type = $self-> ($type_uri); $res-> (, $type); $type-> ($ce); if ($type-> ()) { $is_multires = true; } } elsif ($ce-> (, database_arg => $self)) { my $sres = $self-> ($ce-> ($$node_id, $forArg, for_arg => $forArg, forp_arg => $forpArg, database_arg => $self)); $res-> ($sres); } elsif ($ce->) { push @cres, $ce; } elsif ($ce-> (, database_arg => $self)) { my $uri = $ce->; __CODE{dv:createURI:: $uri => $uri, $result => {$res->{}}, $name => {$ce->}, }__; my $type = $self-> ($uri); $type-> ($ce); } elsif ($ce-> (, database_arg => $self)) { my $uri = $ce->; __CODE{dv:createURI:: $uri => $uri, $result => {$res->{}}, $name => {$ce->}, }__; my $type = $self-> ($uri); $type-> ($ce); } else { ## Property and invalid element is not checked, since not ## all property definitions has loaded at this stage. push @props, $ce; } } # @ce0 unless ($has_type) { __UNDEEP{__EXCEPTION{NO_RDF_TYPE_ERR:: DIS:uri => {$res->{uri}}, DIS:sourceNode => {$el}, }__}__; } ## -- Child resources unless ($is_multires) { for my $re (@cres) { unless ($al_node) { $self-> ($mod, $res, $res, $re, for_arg => $forArg, forp_arg => $forpArg, on_resource_read => $onResourceRead); } else { my $ac = $re-> (, for_arg => $forArg, forp_arg => $forpArg, database_arg => $self); if ($ac and $ac->) { $self-> ($mod, $res, $res, $re, for_arg => $forArg, forp_arg => $forpArg, on_resource_read => $onResourceRead); } } } } ## -- Multiple representations if ($is_multires) { for my $pe (@props) { if ($pe-> (, database_arg => $self)) { my $for_uri = $pe->; my $for = $self-> ($for_uri); $for-> ($pe); $self-> ($mod, $parentResource, $res, $el, for_arg => $forArg, forp_arg => [@{$forpArg}, $for_uri], on_resource_read => $onResourceRead); } } } ($onResourceRead or sub {})->($self, $res); }__; # DEEP @Method: @@Name: readProperties @@enDesc: Reads property values in the source tree and removes the source tree from the database. @@NamedParam: @@@Name: onResourceRead @@@Type: DISPerl:CODE::ManakaiDOM:all @@@enDesc: An event handler called when a resource is read. @@@nullCase: @@@@enDesc: No event handler is read. @@Return: @@@RaiseException: @@@@@: UNSUPPORTED_ELEMENT_TYPE_ERR @@@@enDesc: There is an element whose element type is not supported. @@@PerlDef: __DEEP{ for my $fd (values %{$self->{modDef}}, values %{$self->{forDef}}, values %{$self->{resDef}}) { if ($fd->) { $fd-> (on_resource_read => $onResourceRead); } } CORE::delete $self->{}; }__; @Method: @@Name: checkUndefinedResource @@enDesc: Checks whether there is referred but undefined resource or not. @@Return: @@@RaiseException: @@@@@: FOR_NOT_DEFINED_ERR @@@@enDesc: There is a that is referred but not defined. @@@RaiseException: @@@@@: RESOURCE_NOT_DEFINED_ERR @@@@enDesc: There is a resource that is referred but not defined. @@@PerlDef: for my $fd (values %{$self->{forDef}}) { if (my $ref = $fd-> and not $fd->) { __EXCEPTION{FOR_NOT_DEFINED_ERR:: DIS:uri => {$fd->}, DIS:sourceNodePath => {$ref}, }__; } } for my $fd (values %{$self->{resDef}}) { if (my $ref = $fd-> and not $fd->) { __EXCEPTION{RESOURCE_NOT_DEFINED_ERR:: DIS:uri => {$fd->}, DIS:sourceNodePath => {$ref}, }__; } } @Method: @@Name: xcrefToResource @@enDesc: Returns a resource object selected by an exception code reference (). @@Param: @@@Name: xcref @@@Type: DOMMain:XCodeRef::ManakaiDOM:all @@@enDesc: Exception code to select. @@Param: @@@Name: contextNode @@@Type: NSResolverDIS @@@enDesc: A context element node. Namespace prefixes in are resolved against this node. @@ForParam: @@NodeParam: @@Return: @@@Type: DISPerl:ARRAY::ManakaiDOM:all @@@enDesc: A reference to the array containing two or three resource definitions (). The first (index ) resource is an exception class. The second (index ) resource is an exception code constant. The third (index ) resource is an exception subtype or if the reference identifies no subtype. @@@RaiseException: @@@@@: RESOURCE_NOT_DEFINED_ERR @@@@enDesc: The resource identified by the is not defined or not an exception. @@@PerlDef: my ($q1, $q2, $q3) = split /\s*\.\s*/, $xcref, 3; __DEEP{ if (defined $q3) { $r->[2] = $self-> ($contextNode-> ($q3, null, $forArg, node => $node)); $r->[1] = $r->[2]->; } elsif (defined $q2) { if ($q2 =~ /:/) { $r->[1] = $self-> ($contextNode-> ($q2, null, $forArg, node => $node)); } else { $r->[0] = $self-> ($contextNode-> ($q1, null, $forArg, node => $node)); $r->[1] = $r->[0]-> ($q2); } } else { ## $q1 only $r->[2] = $self-> ($contextNode-> ($q1, null, $forArg, node => $node)); if ($r->[2]-> ()) { $r->[1] = $r->[2]->; } else { $r->[1] = $r->[2]; CORE::delete $r->[2]; } } if ($r->[2] and not $r->[2]-> ()) { __UNDEEP{__EXCEPTION{RESOURCE_NOT_DEFINED_ERR:: DIS:uri => {$r->[2]->{uri}}, DIS:expectedType => {}, DIS:sourceNode => {$node}, DIS:sourceCode => {$xcref}, }__}__; } $r->[2]-> ($node or $contextNode) if $r->[2]; if (not $r->[1] or not $r->[1]-> ()) { __UNDEEP{__EXCEPTION{RESOURCE_NOT_DEFINED_ERR:: DIS:uri => {($r->[1] ? $r->[1]-> : null)}, DIS:localName => {($r->[1] ? $r->[1]-> : null)}, DIS:expectedType => {}, DIS:sourceNode => {$node}, DIS:sourceCode => {$xcref}, }__}__; } $r->[1]-> ($node or $contextNode); unless ($r->[0]) { my $cg = $r->[1]->; $r->[0] = $cg-> if $cg; } if (not $r->[0] or not $r->[0]-> ()) { __UNDEEP{__EXCEPTION{RESOURCE_NOT_DEFINED_ERR:: DIS:uri => {$r->[0]->{uri}}, DIS:localName => {$r->[0]->}, DIS:expectedType => {}, DIS:sourceNode => {$node}, DIS:sourceCode => {$xcref}, }__}__; } $r->[0]-> ($node or $contextNode); }__; @Method: @@Name: getFeature @@Description: @@@lang:en @@@@: Returns a specialized object that implements the specialized interfaces of the specified feature and version. @@Param: @@@Name: feature @@@Type: DISLang:String::ManakaiDOM:all @@@actualType: ManakaiDOM:ManakaiDOMFeatureName::ManakaiDOM:ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: A feature name to request. @@Param: @@@Name: version @@@Type: DISLang:String::ManakaiDOM:all @@@actualType: ManakaiDOM:ManakaiDOMFeatureVersion::ManakaiDOM:ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: A feature version number to request. @@Return: @@@Type: DOMMain:Object::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: An object that implements the specialized APIs of the and . @@@nullCase: @@@@enDesc: There is no object available that implements interfaces associated with the and . @@@PerlDef: $feature =~ s/^\+//; CLASS: for my $class (grep { $Message::Util::DIS::ManakaiDISDatabase::CompatClass{$_} } keys %Message::Util::DIS::ManakaiDISDatabase::CompatClass) { if ($Message::DOM::ClassFeature{$class}->{$feature}->{$version}) { $r = bless {o => $self}, $class; last CLASS; } } @Method: @@Name: free @@enDesc: Marks the database, resources in the database, and source document trees in the database as no longer used. @@ForCheck: ManakaiDOM|ForClass @@Return: @@@PerlDef: for my $file (values %{$self->{}}) { $file-> if $file; } CORE::delete $self->{modDef}; CORE::delete $self->{forDef}; CORE::delete $self->{resDef}; @Method: @@Name: getModuleURIList @@enDesc: Returns a snapshot list of URIs of modules in the database. @@Return: @@@Type: DISPerl|ARRAY||ManakaiDOM|all @@@enDesc: A snapshot list of URIs. @@@PerlDef: $r = [map {$_->} values %{$self->{modDef}}]; @Method: @@Name: getAnyResourceURIList @@enDesc: Returns a snapshot list of URIs of resources in the database. @@Return: @@@Type: DISPerl|ARRAY||ManakaiDOM|all @@@enDesc: A snapshot list of URIs. @@@PerlDef: $r = [keys %{$self->{}}, map {$_->} values %{$self->{modDef}}]; ##DISDatabase PropDef: @QName: DIS|resourceModuleMap @enDesc: Resource-module mapping table. @DIS:key: rm @Type: DISPerl|HASH PropDef: @QName: sourceNodeID @enDesc: The URI reference of the source node identifier. @rdfs:domain: DIS|DISResource||DIS|ForEmpty @DIS:key: snid @Type: DISPerl|SCALAR PropDef: @QName: DIS|resource @enDesc: Resources defined in a module. @rdfs:range: DIS|DISResource||DIS|ForEmpty @rdfs:domain: DIS|DISModule||DIS|ForEmpty @DIS:key: mres @Type: DISPerl|ARRAY PropDef: @QName: DIS|parentResource @enDesc: Static parent resource. No parent for root resources. @DIS:key: puri PropDef: @QName: DIS|dynamicParentResource @enDesc: Dynamic parent resource. No parent for root resources. @DIS:key: dpuri PropDef: @QName: DIS|childResource @enDesc: Static child resources. @DIS:key: curis PropDef: @QName: DIS|dynamicChildResource @enDesc: Dynamic child resources. @DIS:key: dcuris PropDef: @QName: DIS|key @enDesc: Property name in resource objects. @rdfs:subPropertyOf: DISPerl|propHashKey @dataType: DISCore|String @multipleProperties: DISCore|Single ResourceDef: @QName: DIS|DISResourceList @enDesc: A reference to array whose items are resource () objects. @rdfs:subClassOf: DISPerl|ARRAY @For: =ManakaiDOM|all @rdf:type: DISLang|DataType @For: DIS|ForEmpty !=DIS|ForEmpty @AliasFor: @@@@: ||ManakaiDOM|all @@@For: DIS|ForEmpty ElementTypeBinding: @Name: ForDefDupException @ElementType: ManakaiDOM:raises @ShadowContent: @@@: FOR_ALREADY_DEFINED_ERR @@Description: @@@lang:en @@@@: The is already defined elsewhere. ElementTypeBinding: @Name: ForDefNoQNameException @ElementType: ManakaiDOM:raises @ShadowContent: @@@: NO_FOR_QNAME_ERR @@Description: @@@lang:en @@@@: A element must have a attribute. ElementTypeBinding: @Name: ResDefDupException @ElementType: ManakaiDOM:raises @ShadowContent: @@@: RESOURCE_ALREADY_DEFINED_ERR @@Description: @@@lang:en @@@@: The resource is already defined elsewhere. ElementTypeBinding: @Name: ElementNotAllowedException @ElementType: ManakaiDOM:raises @ShadowContent: @@@: ELEMENT_NOT_ALLOWED_ERR @@Description: @@@lang:en @@@@: An element has found where it is not allowed. IFClsDef: @IFQName: DISModuleResolver @ClsQName: ManakaiDISModuleResolver @enDesc: Objects implementing interface are used to convert module name into document object. \ {NOTE:: It is also acceptable to pass a reference as a method parameter where is expected. \ } @Method: @@Name: uriToDocument @@enDesc: Returns a document from module name information. @@Param: @@@Name: disDB @@@Type: DISDatabase @@@clsActualType: ManakaiDISDatabase @@@enDesc: The database. @@Param: @@@Name: moduleURI @@@Type: ModuleURI @@@enDesc: The URI reference of the module. \ {NOTE:: This parameter is redundant, since it can be composed from other three parameters. \ } @@Param: @@@Name: moduleNamespaceURI @@@Type: AnyURI @@@enDesc: The namespace URI of the module name. @@Param: @@@Name: moduleLocalName @@@Type: DISCore:LocalName::ManakaiDOM:all @@@enDesc: The local name of the module name. @@Param: @@@Name: moduleFor @@@Type: ForURI @@@enDesc: The URI reference for which the module is defined. @@Return: @@@Type: DISDocument @@@clsActualType: ManakaiDISDocument @@@enDesc: The document. It don't have to be a newly created object. @@@nullCase: @@@@enDesc: The method is unable to resolve the reference. @@@PerlDef: goto &$self; @ResourceDef: @@rdf:type: DISLang|InputProcessor @@PerlDef: $INPUT = bless $INPUT, if ref $INPUT eq 'CODE'; ##DISModuleResolver PropDef: @QName: sourceFile @enDesc: Source documents. @rdfs:domain: DISDatabase @rdfs:range: DISDocument IFClsDef: @IFQName: DISAnyResource @ClsQName: ManakaiDISAnyResource @ClsISA: DOMFeature|ManakaiHasFeatureByGetFeature||ManakaiDOM|ManakaiDOMLatest @enDesc: {P:: A object represents a resource defined in files. In model, resources are categorized as: - Module::: A module is a file entity. This kind of objects implement the interface. - ::: A is a target for which resources are defined. This kind of objects implement the interface. - Resource::: Something described in . This kind of objects implement the interface. } The objects implementing this interface also implement the interface. @Attr: @@Name: uri @@Type: AnyURI @@Description: @@@lang:en @@@@: The URI reference of the resource. @@Get: @@@enDesc: The representive URI reference of the resource. {NOTE:: The URI might be non-persistent if the resource is not assigned a URI in source file, in which case a URI is randomly-generated at the time of object generation. } @@@PerlDef: $r = $self->{uri}; @Attr: @@Name: uriRef @@Type: DISPerl|SCALAR||ManakaiDOM|all @@enDesc: A reference to the URI of the resource. {NOTE:: Applications modify the referenced value directly. } @@Get: @@@PerlDef: $r = \ ($self->{uri}); @Attr: @@Name: uris @@Type: DISPerl:Array::ManakaiDOM:all @@enDesc: A set of URIs that identifies the resource. @@Get: @@@enDesc: A reference to array in which the URIs are contained in undefined order. {NOTE:: The array is live; it is only a snapshot. } @Method: @@Name: isSameResource @@Operator: @@@@:eq @@@ContentType: lang:Perl @@enDesc: Whether two resources are same or not. Two resources are same if and only if their are equivalent as strings (i.e. in character-by-character based matching). @@Param: @@@Name: anotherResource @@@Type: DISAnyResource @@@enDesc: Another resource object to compare. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@enDesc: Whether two resources are same or not. @@@TrueCase: @@@@enDesc: Two resources are same. @@@FalseCase: @@@@enDesc: Two resources are different. @@@PerlDef: if (UNIVERSAL::isa ($anotherResource, )) { $r = $self->{uri} eq $anotherResource->{uri}; } @Attr: @@Name: nameURI @@Type: NameURI @@enDesc: The URI reference of this module, without identifier. @@Get: @@@enDesc: The name URI of the resource. @@@nullCase: @@@@enDesc: The resource has no name URI. {NOTE:: A resource has no URI if and only if the resource has no local name. } @@@PerlDef: if (defined $self->{localName}) { $r = defined $self->{namespaceURI} ? ${$self->{namespaceURI}} . ${$self->{localName}} : ${$self->{localName}}; } @Attr: @@Name: localName @@enDesc: The local name of this module. {NOTE:: resources has no local name. } @@Type: DISCore:LocalName::ManakaiDOM:all @@Get: @@@PerlDef: $r = defined $self->{localName} ? ${$self->{localName}} : null; @Attr: @@Name: namespaceURI @@Type: AnyURI @@enDesc: The namespace URI of the name of this resource. {NOTE:: resources has no namespace URI. } @@Get: @@@PerlDef: $r = defined $self->{namespaceURI} ? ${$self->{namespaceURI}} : null; @Attr: @@Name: forURI @@Type: ForURI @@enDesc: The URI reference for which this module is defined. @@Get: @@@PerlDef: $r = defined $self->{for} ? ${$self->{for}} : null; @Attr: @@Name: forpURI @@enDesc: The URI references for which this resource is defined. {NOTE:: resources has no URI. } @@Type: ForURIList @@Get: @@@enDesc: List of URI references. Note that this list is . @@@PerlDef: $r = [@{$self->{forp}}]; @Method: @@Name: isForURI @@enDesc: Tests whether this resource is defined for a or URI reference or not. @@Param: @@@Name:forURI @@@Type:ForURI @@@enDesc: A URI reference to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: This resource is for . @@@FalseCase: @@@@enDesc: This resource is not for . @@@PerlDef: __DEEP{ C: for my $this_for_uri (${$self->{for}||\''}, @{$self->{forp}||[]}) { if ($this_for_uri eq $forURI) { ## Shortcut $r = true; last C; } my $this_for = $self->{db}-> ($this_for_uri); if ($this_for-> ($forURI)) { $r = true; last C; } } }__; @Attr: @@Name: isDefined @@Description: @@@lang:en @@@@: Whether this module is defined or not. @@Type: DOMMain:boolean::ManakaiDOM:all @@Get: @@@PerlDef: $r = $self->{}; @Attr: @@Name: ownerModule @@enDesc: The module in which the resource is defined. If the resource is a module, the module itself is the attribute value. @@Get: @@@Type: DISModule @@@clsActualType: ManakaiDISModuleDefinition @@@enDesc: The owner module object. @@@nullCase: @@@@enDesc: The resource is not part of any module since its definition is not read (i.e. is ). @@@PerlDef: $r = $self->{db} -> (${$self->{}}) if defined $self->{}; @Attr: @@Name: ownerModuleURI @@enDesc: A URI of the owner module of the resource. @@Type: DIS|AnyURI @@nullCase: @@@enDesc: The resource does not belong to any module since the resource definition is not read yet. @@Get: @@@PerlDef: if (defined $self->{}) { $r = ${$self->{}}; } @Attr: @@Name: ownerModuleURIRef @@enDesc: A reference to a URI of the owner module of the resource. @@Type: DISPerl|SCALAR||ManakaiDOM|Perl @@nullCase: @@@enDesc: The resource does not belong to any module since the resource definition is not read yet. @@Get: @@@PerlDef: $r = $self->{}; @Attr: @@Name: isReferred @@Description: @@@lang:en @@@@: Whether the resource is referenced somewhere or not. @@Type: DISLang|String||ManakaiDOM|all @@Get: @@@enDesc: A node path string that identifies the node from which the resource is referenced. @@@nullCase: The resource is not referred. @@@PerlDef: $r = $self->{}; @@Set: @@@enDesc: A node path string that identifies the node from which the resource is referenced. @@@InCase: @@@@Type: DISElement @@@@enDesc: The resource is referenced by the element. It's node path string is set as the attribute value. @@@PerlDef: if (defined $given) { if (ref $given) { __DEEP{ if ($given->isa ()) { $given = $given->; } else { $given = $given-> ('nodePath') || $given-> (key => [qw/QName Name type Type/]); } }__; } $self->{} = $given; } @Attr: @@Name: sourceNodeID @@enDesc: The identifier URI reference of the source node. @@enDesc: @@@ForCheck: ManakaiDOM|ForClass @@@@: Modules and s does not have source node identifier in the current implementation. @@Type: AnyURI @@Get: @@@nullCase: @@@@enDesc: The resource is not (yet) associated with any source node. @@@PerlDef: if (defined $self->{}) { $r = ${$self->{}}; } else { $r = null; } @@Set: @@@PerlDef: if (defined $given) { $self->{} = \$given; } else { CORE::delete $self->{}; } @Attr: @@Name: sourceNodeIDRef @@enDesc: The identifier URI reference of the source node. @@enDesc: @@@ForCheck: ManakaiDOM|ForClass @@@@: Modules and s does not have source node identifier in the current implementation. @@Type: DISPerl|SCALAR||ManakaiDOM|all @@Get: @@@nullCase: @@@@enDesc: The resource is not (yet) associated with any source node. @@@PerlDef: $r = $self->{}; @@Set: @@@PerlDef: if (defined $given) { $self->{} = $given; } else { CORE::delete $self->{}; } @Attr: @@Name: isAnonymous @@enDesc: Whether the resource has persistent name or not. @@Type: DOMMain:boolean::ManakaiDOM:all @@Get: @@@TrueCase: This resource does have any globally unique name. is a temporary URI reference. @@@FalseCase: This resource does have its formal name. is a URI reference generated from the name and the URI reference of this resource. @@@PerlDef: $r = $self->{}; @Attr: @@Name: sourceElement @@enDesc: The source element node from which this definition is read. @@Get: @@@Type: DISElement @@@clsActualType: ManakaiDISElement @@@InCase: @@@@Type: DISModuleElement @@@@clsActualType: ManakaiDISModuleElement @@@@enDesc: If this resource is a module. @@@PerlDef: $r = $self->{src}; @@@nullCase: @@@@enDesc: The definition is not yet read. @Attr: @@Name: database @@enDesc: The database to which the resource belongs. @@Type: DISDatabase @@clsActualType: ManakaiDISDatabase @@Get: @@@PerlDef: $r = $self->{db}; @Method: @@Name: readProperties @@enDesc: Reads property values in the source tree and removes reference to the source node. @@NamedParam: @@@Name: onResourceRead @@@Type: DISPerl:CODE::ManakaiDOM:all @@@enDesc: An event handler called when a resource is read. @@@nullCase: @@@@enDesc: No event handler is read. @@Return: @@@RaiseException: @@@@@: UNSUPPORTED_ELEMENT_TYPE_ERR @@@@enDesc: There is an element whose element type is not supported. @@@PerlDef: __DEEP{ if (my $src = $self->{src}) { my $for = $self->; my $forp = $self->; my $db = $self->; for my $el (@{$src-> (for_arg => $for, forp_arg => $forp, database_arg => $db)}) { my $xu = $el->; if ({ => true, => true, => true, => true, => true, => true, => true, => true, => true, => true, => true, => true, }->{$xu}) { # } elsif ($el-> (database_arg => $db)) { my $add_prop; $add_prop = sub ($$$) { my ($self, $el, $db) = @_; my $prop = $db-> ($el->); my $prop_uri = $prop->; my $prop_mult = $prop->; my $new_value; my $base_type; my $copy_tree = false; my %mtopt = (for_arg => $for, forp_arg => $forp, default_media_type => $prop->, database_arg => $db); my $new_value_type = $el->(%mtopt); if ($el-> (, $mtopt{default_media_type}, %mtopt)) { __CODE{dv|createValue:: $value => {null}, $base_type => {$base_type = }, $type => {$new_value_type}, $result => $new_value, $name => {$prop_uri}, }__; $new_value-> ($el->); $new_value-> (my $prefix = $el->); if (not defined $prefix) { if ($el-> (, $mtopt{default_media_type}, %mtopt)) { $new_value-> ('urn:x-suika-fam-cx:lang:'); } elsif ($el-> (, $mtopt{default_media_type}, %mtopt)) { $new_value-> ('http://suika.fam.cx/~wakaba/archive/2005/5/script#'); } else { $new_value-> ($el->); } } else { $new_value-> ($el->); } ## TODO: Check whether defined } elsif ($el-> (, $mtopt{default_media_type}, %mtopt) or $el-> (, $mtopt{default_media_type}, %mtopt)) { __CODE{dv|createURI:: $uri => {$el-> ($self->, $self->, for_arg => $self->, forp_arg => $self->, database_arg => $db)}, $result => $new_value, $name => {$prop_uri}, }__; ## TODO: Check whether defined $new_value_type = ; } elsif ($el-> (, $mtopt{default_media_type}, %mtopt)) { $el->; __CODE{dv|createValueRef:: $value_ref => {$el->}, $base_type => {$base_type = }, $type => {$new_value_type}, $result => $new_value, $name => $prop_uri, }__; for my $p (, ) { if (UNIVERSAL::isa ($self->{$p},)) { my $v; __CODE{dv|createURI:: $uri => {$self->{$p}->}, $result => $v, $name => $prop_uri, }__; $new_value-> ($p => $v); } } $new_value-> ($el->); $new_value-> ($el-> ($db)); $new_value-> ($el-> ('nodePath')); } elsif ($el-> (, $mtopt{default_media_type}, %mtopt) or $el-> (, $mtopt{default_media_type}, %mtopt) or $el-> (, $mtopt{default_media_type}, %mtopt)) { $el->; __CODE{dv|createValueRef:: $value_ref => {$el->}, $base_type => {$base_type = }, $type => $new_value_type, $result => $new_value, $name => $prop_uri, }__; $new_value-> ($el->); $new_value-> ($el-> ($db)); $new_value-> ($el-> ('nodePath')); } elsif ($el-> (, $mtopt{default_media_type}, %mtopt)) { my $x = $db-> ($el->, $el, node => $el, for_arg => $self->); __CODE{dv|createURI:: $uri => {($x->[2] or $x->[1] or $x->[0]) ->}, $result => $new_value, $name => $prop_uri, }__; $new_value-> ($db) -> ($el); $new_value_type = ; } elsif ($el-> (, $mtopt{default_media_type}, %mtopt)) { my $v = $el->; $v =~ s/^\s+//; $v =~ s/\s+$//; my ($clsq, $mem, $gs) = split /\s*\.\s*/, $v, 3; my $res; if (defined $mem) { my $cls = $db-> ($el-> ($clsq, $self->, $self->, node => $el)); $cls-> ($el); $res = $cls-> ($mem, ); unless ($res) { __UNDEEP{__EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR:: DIS:localName => {$mem}, DIS:parentURI => {$cls->}, DIS:elementType => {$el->}, DIS:sourceNode => {$el}, DIS:sourceCode => {$v}, DIS:expectedType => { defined $gs ? : }, }__}__; } if (defined $gs) { $res = $res-> ($gs eq 'get' ? : ); unless ($res) { __UNDEEP{__EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR:: DIS:parentURI => {$res->}, DIS:elementType => {$el->}, DIS:sourceNode => {$el}, DIS:sourceCode => {$v}, DIS:expectedType => { $gs eq 'get' ? : }, }__}__; } } } else { $res = $db-> ($el-> ($clsq, $self->, $self->, node => $el)); } $res-> ($el); __CODE{dv|createURI:: $uri => {$el->}, $result => $new_value, $name => $prop_uri, }__; $new_value_type = ; } elsif ($el-> (, $mtopt{default_media_type}, %mtopt)) { $copy_tree = true; $el->; my $elc = $el->clone; __CODE{dv|createValue:: $value => {$elc}, $base_type => {$base_type = }, $type => $new_value_type, $result => $new_value, $name => $prop_uri, }__; $elc-> ($db); } elsif ($el-> (, $mtopt{default_media_type}, %mtopt)) { my $v = $el->; if ($v =~ /^0x/) { $v = hex $v; } else { $v += 0; } __CODE{dv|createValue:: $value => $v, $base_type => {$base_type = }, $type => $new_value_type, $result => $new_value, $name => $prop_uri, }__; } else { __CODE{dv|createValue:: $value => {$el->}, $base_type => {$base_type = }, $type => $new_value_type, $result => $new_value, $name => $prop_uri, }__; } unless ($copy_tree) { for my $ce (@{$el-> (for_arg => $for, forp_arg => $forp, database_arg => $db)}) { my $xu = $ce->; if ({ => true, => true, => true, => true, => true, }->{$xu}) { # } elsif ($ce-> (database_arg => $db)) { my $pr; __DEEP{ $pr = $add_prop->($self, $ce, $db); }__; if ($pr->{prop_mult} eq ) { my $cpv = $new_value-> ($xu); if (not $cpv) { __CODE{dv|createOrderedList:: $result => {$cpv}, $type => {$mtopt{default_media_type}}, $base_type => {}, }__; $new_value-> ($xu => $cpv); } $cpv-> ($pr->{new_value}); } elsif ($pr->{prop_mult} eq ) { my $cpv = $new_value-> ($xu); if (not $cpv) { __CODE{dv|createUnorderedList:: $result => {$cpv}, $type => {$mtopt{default_media_type}}, $base_type => {}, }__; $new_value-> ($xu => $cpv); } $cpv-> ($pr->{new_value}); } else { $new_value-> ($xu => $pr->{new_value}); } } else { __UNDEEP{__EXCEPTION{UNSUPPORTED_ELEMENT_TYPE_ERR:: DIS:elementType => {$xu}, DIS:sourceNode => {$ce}, }__}__; } }} # copy_tree {new_value => $new_value, base_type => $base_type, prop_uri => $prop_uri, prop_mult => $prop_mult, new_value_type => $new_value_type}; }; my $pr; __DEEP{ $pr = $add_prop->($self, $el, $db); }__; if ($pr->{prop_mult} eq ) { if (not $self->{$pr->{prop_uri}}) { __CODE{dv|createOrderedList:: $result => {$self->{$pr->{prop_uri}}}, $type => {$pr->{new_value_type}}, $base_type => {$pr->{base_type} || }, }__; } $self->{$pr->{prop_uri}}-> ($pr->{new_value}); } elsif ($pr->{prop_mult} eq ) { if (not $self->{$pr->{prop_uri}}) { __CODE{dv|createUnorderedList:: $result => {$self->{$pr->{prop_uri}}}, $type => {$pr->{new_value_type}}, $base_type => {$pr->{base_type} || }, }__; } $self->{$pr->{prop_uri}}-> ($pr->{new_value}); } else { $self->{$pr->{prop_uri}} = $pr->{new_value}; } if ($el-> (, database_arg => $db)) { $db-> ($xu => $pr->{new_value}-> => $self); } } elsif ($el->) { ## TODO: Should rdf:type be validated? } else { __UNDEEP{__EXCEPTION{UNSUPPORTED_ELEMENT_TYPE_ERR:: DIS:elementType => {$xu}, DIS:sourceNode => {$el}, }__}__; } } CORE::delete $self->{src}; ($onResourceRead or sub () {})->($self, $self); } }__; @Method: @@ForCheck: ManakaiDOM|ForIF @@Name: isTypeURI @@enDesc: Tests whether this resource is of a type or not. @@Param: @@@Name: typeURI @@@Type: ResourceURI @@@enDesc: A type URI reference to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: This is a resource. @@@FalseCase: @@@@enDesc: This is not a resource. ##DISAnyResource IFClsDef: @IFQName: DISModule @ClsQName: ManakaiDISModuleDefinition @ClsISA: ManakaiDISPropertyAccessor @ClsISA: ManakaiDISExceptionTarget @ClsISA: ManakaiDISPerlModuleDefinition @ClsISA: dp|ManakaiDISModulePerl @ClsISA: dp|ManakaiDISAnyResourcePerl @ClsISA: ManakaiDISAnyResource @Implement: DOMMinImpl @enDesc: module definitions. @enDesc: @@ForCheck: ManakaiDOM|ForIF @@@: The objects implementing the interface also implement the interface. @DISLang:role: ModuleRole @Attr: @@ForCheck: ManakaiDOM|ForClass @@Name: uris @@Type: DISPerl:Array::ManakaiDOM:all @@enDesc: A reference to the snapshot array containing the URI reference of the module. @@Get: @@@PerlDef: $r = [$self->{uri}]; @Attr: @@ForCheck: ManakaiDOM|ForClass @@Name: ownerModule @@ManakaiDOM:isRedefining:1 @@enDesc: This module itself. @@Get: @@@Type: DISModule @@@clsActualType: ManakaiDISModuleDefinition @@@nullCase: @@@@enDesc: The resource is not part of any module since its definition is not read ( is ). @@@PerlDef: $r = $self; @Method: @@ForCheck: ManakaiDOM|ForClass @@Name: getFeature @@Description: @@@lang:en @@@@: Returns a specialized object that implements the specialized interfaces of the specified feature and version. @@Param: @@@Name: feature @@@Type: DISLang:String::ManakaiDOM:all @@@actualType: DOMFeature|FeatureNameString||ManakaiDOM|ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: A feature name to request. @@Param: @@@Name: version @@@Type: DISLang:String::ManakaiDOM:all @@@actualType: DOMFeature|FeatureVersionString||ManakaiDOM|ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: A feature version number to request. @@Return: @@@Type: DOMMain:Object::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: An object that implements the specialized APIs of the and . @@@nullCase: @@@@enDesc: There is no object available that implements interfaces associated with the and . @@@PerlDef: $feature =~ s/^\+//; CLASS: for my $class (grep { $Message::Util::DIS::ManakaiDISModuleDefinition::CompatClass{$_} } keys %Message::Util::DIS::ManakaiDISModuleDefinition::CompatClass) { if ($Message::DOM::ClassFeature{$class}->{$feature}->{$version}) { $r = bless {o => $self}, $class; last CLASS; } } @Attr: @@Name: isAnonymous @@enDesc: Whether the resource has persistent name or not. @@Type: DOMMain:boolean::ManakaiDOM:all @@ForCheck: ManakaiDOM|ForClass @@Get: @@@TrueCase: @@@@enDesc: A module have a name. @@@PerlDef: $r = false; @Method: @@Name: addResourceList @@ForCheck: ManakaiDOM|ForClass @@enDesc: Adds a resource to the list of resources belongs to the module. @@Param: @@@Name: disResource @@@Type: DIS|DISResource @@@enDesc: The resource to add. @@Return: @@@PerlDef: __DEEP{ push @{$self->{}||=[]}, $disResource->; }__; @Method: @@Name: getResourceList @@enDesc: Returns the list of resources belongs to the module. @@Return: @@@Type: DIS|ResourceList @@@enDesc: The current snapshot of children. @@@PerlDef: __DEEP{ my $db = $self->; $r = [map { $db-> ($$_) } @{$self->{}}]; }__; @Attr: @@Name: targetNamespaceURI @@enDesc: The default namespace URI of the resources defined in the module. @@Type: DIS|AnyURI @@Get: @@@PerlDef: $r = defined $self->{} ? ${$self->{}} : null; @@Set: @@@ForCheck: ManakaiDOM|ForClass @@@PerlDef: if (defined $given) { $self->{} = \$given; } else { CORE::delete $self->{}; } @Method: @@ForCheck: ManakaiDOM|ForClass @@Name: isTypeURI @@enDesc: Tests whether this resource is of a type or not. @@Param: @@@Name: typeURI @@@Type: ResourceURI @@@enDesc: A type URI reference to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: This is a resource. @@@FalseCase: @@@@enDesc: This is not a resource. @@@PerlDef: __DEEP{ $r = $self-> -> () -> ($typeURI); }__; ##DISModule ClsDef: @ClsQName: ManakaiDISModuleLite @ClsISA: DIS|ManakaiDISAnyResource @ClsISA: dx|ManakaiDefaultExceptionHandler||ManakaiDOM|Perl @Implement: DOMMinImpl @Implement: DIS|DISResourceProp @Implement: dp|DISAnyResourcePerl @Implement: dp|DISModulePerl @Implement: dp|DISResourcePerlModule @enDesc: The class provides very small subset of class. If a method or attribute which is not implemented by the class, then the object is updated to the by reading additional properties from the database. @Attr: @@ForCheck: ManakaiDOM|ForClass @@Name: uris @@Type: DISPerl:Array::ManakaiDOM:all @@enDesc: A reference to the snapshot array containing the URI reference of the module. @@Get: @@@PerlDef: $r = [$self->{uri}]; @Attr: @@ForCheck: ManakaiDOM|ForClass @@Name: ownerModule @@ManakaiDOM:isRedefining:1 @@enDesc: This module itself. @@Get: @@@Type: DISModule @@@clsActualType: ManakaiDISModuleDefinition @@@nullCase: @@@@enDesc: The resource is not part of any module since its definition is not read ( is ). @@@PerlDef: $r = $self; @Attr: @@Name: isAnonymous @@enDesc: Whether the resource has persistent name or not. @@Type: DOMMain:boolean::ManakaiDOM:all @@ForCheck: ManakaiDOM|ForClass @@Get: @@@TrueCase: @@@@enDesc: A module have a name. @@@PerlDef: $r = false; @Method: @@Operator: @@@@: AUTOLOAD @@@ContentType: lang|Perl @@Return: @@@PerlDef: my $al = our $AUTOLOAD; $al =~ s/.+:://; if ($al ne 'DESTROY') { __DEEP{ $self-> -> ($self); }__; if (ref $self eq ) { __EXCEPTION{DIS|RESOURCE_NOT_DEFINED_ERR:: DIS:uri => {$self->}, DIS:moduleURI => {$self->}, }__; } my $code = $self->can ($al); if ($code) { goto &$code; } else { require Carp; local $Carp::CarpLevel = $Error::Depth; Carp::croak (qq); } } # $al @Attr: @@Name: targetNamespaceURI @@enDesc: The default namespace URI of the resources defined in the module. @@Type: DIS|AnyURI @@Get: @@@PerlDef: $r = defined $self->{} ? ${$self->{}} : null; @Method: @@ForCheck: ManakaiDOM|ForClass @@Name: isTypeURI @@enDesc: Tests whether this resource is of a type or not. @@Param: @@@Name: typeURI @@@Type: ResourceURI @@@enDesc: A type URI reference to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: This is a resource. @@@FalseCase: @@@@enDesc: This is not a resource. @@@PerlDef: __DEEP{ $r = $self-> -> () -> ($typeURI); }__; ##DISModuleLite IFClsDef: @IFQName: DISFor @ClsQName: ManakaiDISForDefinition @ClsISA: dp|ManakaiDISAnyResourcePerl @ClsISA: ManakaiDISAnyResource @ClsISA: ManakaiDISExceptionTarget @DISLang:role: ForRole @Description: @@lang:en @@@: definitions. @Attr: @@ForCheck: ManakaiDOM|ForClass @@Name: uris @@Type: DISPerl:Array::ManakaiDOM:all @@actualType: ForURIList @@enDesc: A reference to the snapshot array containing the URI reference of the . @@Get: @@@PerlDef: $r = [$self->{uri}]; @Method: @@Name: isaURI @@Description: @@@lang:en @@@@: Whether this is-a another or not. @@Param: @@@Name: superURI @@@Type: ForURI @@@Description: @@@@lang:en @@@@@: Another URI reference to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: is a super- of this . @@@FalseCase: @@@@enDesc: is not a super- of this . @@@PerlDef: $r = $self->{uri} eq $superURI ? true : $self->{isa}->{$superURI}; @Method: @@Name: addISA @@enDesc: Adds a to the list of super- of this . @@Param: @@@Name: superFor @@@Type: DISFor @@@clsActualType: ManakaiDISForDefinition @@@enDesc: A definition object. @@Return: @@@PerlDef: my @from = ($self->{uri}, grep {$self->{revISA}->{$_}} keys %{$self->{revISA}}); my @to = ($superFor->{uri}, grep {$superFor->{isa}->{$_}} keys %{$superFor->{isa}}); __DEEP{ for my $from (@from) { for my $to (@to) { $self->{db}-> ($from)->{isa}->{$to} = true; $self->{db}-> ($to)->{revISA}->{$from} = true; } } }__; @Method: @@Name: getFeature @@Description: @@@lang:en @@@@: Returns a specialized object that implements the specialized interfaces of the specified feature and version. @@Param: @@@Name: feature @@@Type: DISLang:String::ManakaiDOM:all @@@actualType: ManakaiDOM:ManakaiDOMFeatureName::ManakaiDOM:ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: A feature name to request. @@Param: @@@Name: version @@@Type: DISLang:String::ManakaiDOM:all @@@actualType: ManakaiDOM:ManakaiDOMFeatureVersion::ManakaiDOM:ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: A feature version number to request. @@Return: @@@Type: DOMMain:Object::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: An object that implements the specialized APIs of the and . @@@nullCase: @@@@enDesc: There is no object available that implements interfaces associated with the and . @@@PerlDef: $feature =~ s/^\+//; CLASS: for my $class (grep { $Message::Util::DIS::ManakaiDISForDefinition::CompatClass{$_} } keys %Message::Util::DIS::ManakaiDISForDefinition::CompatClass) { if ($Message::DOM::ClassFeature{$class}->{$feature}->{$version}) { $r = bless {o => $self}, $class; last CLASS; } } @Attr: @@Name: isAnonymous @@enDesc: Whether the resource has persistent name or not. @@Type: DOMMain:boolean::ManakaiDOM:all @@ForCheck: ManakaiDOM|ForClass @@Get: @@@TrueCase: @@@@enDesc: A have a name. @@@PerlDef: $r = true; @Attr: @@ForCheck: ManakaiDOM|ForClass @@Name: forURI @@Type: ForURI @@enDesc: The URI reference for which this module is defined. @@Get: @@@InCase: @@@@Value: @@@@@@: ManakaiDOM|all @@@@@ContentType: DISCore|QName @@@@enDesc: The attribute value is always for a resource. @@@PerlDef: $r = ; @Attr: @@Name: forpURI @@enDesc: The URI references for which this resource is defined. @@Type: ForURIList @@Get: @@@enDesc: List of URI references. Note that this list is . @@@InCase: @@@@Value: @@@@@@: [] @@@@@ContentType: lang|Perl @@@@enDesc: The attribute value is always an empty array reference for a resource. @@@PerlDef: $r = []; @Method: @@Name: isForURI @@enDesc: Tests whether this resource is defined for a or URI reference or not. @@Param: @@@Name:forURI @@@Type:ForURI @@@enDesc: A URI reference to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: This resource is for . The attribute always takes this value for resources. @@@PerlDef: $r = true; @Attr: @@ForCheck: ManakaiDOM|ForClass @@Name: nameURI @@Type: NameURI @@enDesc: The URI reference of this module, without identifier. @@Get: @@@enDesc: The attribute value is always equals to for resources. @@@PerlDef: $r = $self->{uri}; @Method: @@ForCheck: ManakaiDOM|ForClass @@Name: isTypeURI @@enDesc: Tests whether this resource is of a type or not. @@Param: @@@Name: typeURI @@@Type: ResourceURI @@@enDesc: A type URI reference to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: This is a resource. @@@FalseCase: @@@@enDesc: This is not a resource. @@@PerlDef: __DEEP{ $r = $self-> -> () -> ($typeURI); }__; ##DISFor PropDef: @QName: isFeatureImplemented @enDesc: The list of whether a feature is implemented or not. IFClsDef: @IFQName: DISResource @ClsQName: ManakaiDISResourceDefinition @ClsISA: ManakaiDISResourceMV @ClsISA: dp|ManakaiDISResourcePerl @ClsISA: ManakaiDISPerlModuleDefinition @ClsISA: dp|ManakaiDISAnyResourcePerl @ClsISA: ManakaiDISPropertyAccessor @ClsISA: ManakaiDISAnyResource @ClsISA: ManakaiDISExceptionTarget @DISLang:role: ResourceRole @enDesc: resource definitions. @enDesc: @@ForCheck: ManakaiDOM|ForIF @@@: The objects implementing the interface also implement the interface. @Attr: @@ForCheck: ManakaiDOM|ForClass @@Name: uris @@Type: DISPerl:Array::ManakaiDOM:all @@enDesc: Returns the current of the URI references for this resource, including the alias URI references. @@Get: @@@PerlDef: $r = [grep {$self->{aliasURI}->{$_}} keys %{$self->{aliasURI}}]; @Method: @@Name: isSubsetOfURI @@Description: @@@lang:en @@@@: Whether this resource is a subset of another resource or not. @@Param: @@@Name: superURI @@@Type: ResourceURI @@@Description: @@@@lang:en @@@@@: Another resource URI reference to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: is a super-resource of this resource. @@@FalseCase: @@@@enDesc: is not a super-resource of this resource. @@@PerlDef: $r = $self->{aliasURI}->{$superURI} || $self->{subOf}->{$superURI}; @Method: @@Name: addSuperResource @@enDesc: Adds a resource to the list of super-resource of this resource. @@Param: @@@Name: superRes @@@Type: DISResource @@@clsActualType: ManakaiDISResourceDefinition @@@enDesc: A resource definition object. @@Return: @@@PerlDef: my @from = ($self->{uri}, grep {$self->{supOf}->{$_}} keys %{$self->{supOf}||{}}); my @to = ($superRes->{uri}, grep {$superRes->{subOf}->{$_}} keys %{$superRes->{subOf}||{}}); __DEEP{ for my $from (@from) { for my $to (@to) { $self->{db}-> ($from)->{subOf}->{$to} = true; $self->{db}-> ($to)->{supOf}->{$from} = true; } } }__; @Method: @@Name: mergeAsAlias @@enDesc: Merges another resource definition as an alias of this resource. @@Param: @@@Name: aliasResource @@@Type: DISResource @@@clsActualType: ManakaiDISResourceDefinition @@@enDesc: A resource to merge. \ {NOTE:: After merging all references to should be discarded. \ } @@NodeParam: @@Return: @@@RaiseException: @@@@@:MERGE_ITSELF_ERR @@@@@@enDesc: An attempt is made to merge this resource itself. @@@PerlDef: if ($self eq $aliasResource) { __EXCEPTION{MERGE_ITSELF_ERR:: DIS:uri => {$self->{uri}}, DIS:sourceNode => {$node}, }__; } for my $uri ($aliasResource->{uri}, grep {$aliasResource->{aliasURI}->{$_}} keys %{$aliasResource->{aliasURI}}) { $self->{aliasURI}->{$uri} = true; $self->{db}->{resDef}->{$uri} = $self; $self->{subOf}->{$uri} = true; $self->{supOf}->{$uri} = true; } for my $uri (grep {$aliasResource->{subOf}->{$_}} keys %{$aliasResource->{subOf}||{}}) { $self->{subOf}->{$uri} = true; } for my $uri (grep {$aliasResource->{supOf}->{$_}} keys %{$aliasResource->{supOf}||{}}) { $self->{supOf}->{$uri} = true; } my @from = grep {$self->{supOf}->{$_}} keys %{$self->{supOf}||{}}; my @to = grep {$self->{subOf}->{$_}} keys %{$self->{subOf}||{}}; __DEEP{ for my $from (@from) { for my $to (@to) { $self->{db}-> ($from)->{subOf}->{$to} = true; $self->{db}-> ($to)->{supOf}->{$from} = true; } } }__; @Method: @@Name: isTypeURI @@enDesc: Tests whether this resource is of a type or not. @@Param: @@@Name: typeURI @@@Type: ResourceURI @@@enDesc: A type URI reference to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@TrueCase: @@@@enDesc: This is a resource. @@@FalseCase: @@@@enDesc: This is not a resource. @@@PerlDef: if (not $self->{}) { # } elsif ($self->{}->{$typeURI}) { $r = true; } else { __DEEP{ C: for my $t_type_uri (grep {$self->{}->{$_}} keys %{$self->{}}) { my $t_type = $self-> -> ($t_type_uri); if ($t_type-> ($typeURI)) { $self-> (, $typeURI); $r = true; last C; } } }__; } @Attr: @@Name: disDataTypeResource @@enDesc: The resource referenced by property. = If the resource has the property, then its value references the data type resource. = If the resource has no property but the dynamic parent resource has the property, then its value references the data type resource. = Otherwise, the resource has no associated data type resoruce; this method throws a exception. @@Type: DISResource @@clsActualType: ManakaiDISResourceDefinition @@Get: @@@RaiseException: @@@@@:NO_DIS_TYPE_ERR @@@@enDesc: attribute is not specified. @@@PerlDef: __DEEP{ if (UNIVERSAL::isa ($self->{}, )) { $r = $self->{}-> ($self->); } else { my $pr = $self->; $r = $pr-> if $pr; } }__; unless ($r) { __EXCEPTION{NO_DIS_TYPE_ERR:: DIS:uri => {$self->}, DIS:sourceNode => {$self->}, }__; } @Attr: @@Name: disDataTypeValue @@enDesc: The property value for the resource. @@Get: @@@Type: dv|DVURIValue @@@clsActualType: dv|ManakaiDVURIValue @@@RaiseException: @@@@@:NO_DIS_TYPE_ERR @@@@enDesc: attribute is not specified. @@@PerlDef: __DEEP{ if (UNIVERSAL::isa ($self->{}, )) { $r = $self->{}; } else { my $pr = $self->; $r = $pr-> if $pr; } }__; unless ($r) { __EXCEPTION{NO_DIS_TYPE_ERR:: DIS:uri => {$self->}, DIS:sourceNode => {$self->}, }__; } @Attr: @@Name: disActualDataTypeResource @@enDesc: attribute value of this resource. @@Type: DISResource @@clsActualType: ManakaiDISResourceDefinition @@Get: @@@RaiseException: @@@@@:NO_DIS_TYPE_ERR @@@@enDesc: attribute is not specified, and attribute, neigher. @@@PerlDef: __DEEP{ if (UNIVERSAL::isa ($self->{}, )) { $r = $self->{}-> ($self->); } elsif (UNIVERSAL::isa ($self->{}, )) { $r = $self->{}-> ($self->); } else { my $pr = $self->; $r = $pr-> if $pr; } }__; unless ($r) { __EXCEPTION{NO_DIS_TYPE_ERR:: DIS:uri => {$self->}, DIS:sourceNode => {$self->}, }__; } @Attr: @@Name: disActualDataTypeValue @@enDesc: node for this resource. @@Get: @@@Type: DISElement @@@clsActualType: ManakaiDISElement @@@RaiseException: @@@@@:NO_DIS_TYPE_ERR @@@@enDesc: attribute is not specified, and attribute, neigher. @@@PerlDef: __DEEP{ if (UNIVERSAL::isa ($self->{}, )) { $r = $self->{}; } elsif (UNIVERSAL::isa ($self->{}, )) { $r = $self->{}; } else { my $pr = $self->; $r = $pr-> if $pr; } }__; unless ($r) { __EXCEPTION{NO_DIS_TYPE_ERR:: DIS:uri => {$self->}, DIS:sourceNode => {$self->}, }__; } @IntMethod: @@Operator: @@@@: <=> @@@ContentType: lang:Perl @@enDesc: Compares two resources. If the first character of the node in the source tree by which the resource is defined occures before the other resource's first character, then the former resource is than the later resource. If two resources are the same resource, they are . Otherwise, the former resource is than the later resource. There are two exceptions. If two resources belongs to two different modules, i.e. their s are different, the order is not defined. Also, if one of resources is not yet defined, i.e. one's takes value, then the order is not defined. Even in these cases, two calls for the method with the same parameter would return the same result while the resources are left unchanged. @@Param: @@@Name: anotherResource @@@Type: DISResource @@@enDesc: Another resource to compare. @@Return: @@@Type: DOMMain:unsigned-long::ManakaiDOM:all @@@PerlDef: if (UNIVERSAL::isa ($anotherResource, )) { $r = $self->{seq} <=> $anotherResource->{seq}; } else { $r = $self->{uri} <=> $anotherResource; } @Method: @@ForCheck: ManakaiDOM|ForClass @@ManakaiDOM:isForInternal:1 @@Name: addChildResource @@enDesc: Registers a resource as a static child of the resource. @@Param: @@@Name: disResource @@@Type: DIS|DISResource @@@enDesc: The resurce to add. @@Return: @@@PerlDef: __DEEP{ push @{$self->{}||=[]}, $disResource->; }__; @Method: @@ForCheck: ManakaiDOM|ForClass @@ManakaiDOM:isForInternal:1 @@Name: addDynamicChildResource @@enDesc: Registers a resource as a dynamic child of the resource. @@Param: @@@Name: disResource @@@Type: DIS|DISResource @@@enDesc: The resurce to add. @@Return: @@@PerlDef: __DEEP{ push @{$self->{}||=[]}, $disResource->; }__; @Method: @@Name: getChildResourceList @@enDesc: Returns the list of static child resources of the resource. @@Return: @@@Type: DIS|ResourceList @@@enDesc: The current snapshot of children. @@@PerlDef: __DEEP{ my $db = $self->; $r = [map { $db-> ($$_) } @{$self->{}}]; }__; @Method: @@Name: getDynamicChildResourceList @@enDesc: Returns the list of dynamic child resources of the resource. @@Return: @@@Type: DIS|ResourceList @@@enDesc: The current snapshot of children. @@@PerlDef: __DEEP{ my $db = $self->; $r = [map { $db-> ($$_) } @{$self->{}}]; }__; @Method: @@Name: getChildResourceByType @@enDesc: Gets a static child resource selected by its type. @@Param: @@@Name:typeURI @@@Type:ResourceURI @@@enDesc: A URI reference identifying a resource type. @@ImplNote: @@@lang:en @@@@: {ISSUE:: Some inheritance tracing required for e.g. and ? } @@Return: @@@Type: DISResource @@@clsActualType: ManakaiDISResourceDefinition @@@enDesc: The first child resource (in document order) whose type matches with . @@@nullCase: @@@@enDesc: There is no resource whose type is . @@@PerlDef: __DEEP{ my $db = $self->; C: for my $cr_uri (@{$self->{}||[]}) { my $cr = $db-> ($$cr_uri); if ($cr-> ($typeURI)) { $r = $cr; last C; } } }__; @Method: @@Name: getChildResourceListByType @@enDesc: Returns a list of child resources of a specific type. @@Param: @@@Name: typeURI @@@Type: DIS|AnyURI @@@enDesc: A URI of the type. @@Return: @@@Type: DIS|ResourceList @@@enDesc: The current snapshot of the child resources of type . @@@PerlDef: __DEEP{ my $db = $self->; $r = [grep { $_-> ($typeURI) } map { $db-> ($$_) } @{$self->{}||[]}]; }__; @Method: @@Name: getChildResourceByNameAndType @@enDesc: Gets a static child resource selected by its local name and type. @@Param: @@@Name: localName @@@Type: DISCore:LocalName::ManakaiDOM:all @@@enDesc: A local name. @@Param: @@@Name:typeURI @@@Type:ResourceURI @@@enDesc: A URI reference identifying a resource type. @@Return: @@@Type: DISResource @@@clsActualType: ManakaiDISResourceDefinition @@@enDesc: The first (by document order) child resource whose type matches for and . @@@nullCase: @@@@enDesc: There is no resource whose name is and whose type is . @@@PerlDef: __DEEP{ my $db = $self->; C: for my $cr_uri (@{$self->{}||[]}) { my $cr = $db-> ($$cr_uri); my $ln = $cr->; if (defined $ln and $ln eq $localName and $cr-> ($typeURI)) { $r = $cr; last C; } } }__; @Method: @@Name: getConstResourceByName @@enDesc: Gets a constant value resource by its local name. @@Param: @@@Name:localName @@@Type: DISLang:String::ManakaiDOM:all @@@enDesc: Constant name. @@Return: @@@Type: DISResource @@@clsActualType: ManakaiDISResourceDefinition @@@enDesc: The constant resource identified by . @@@nullCase: @@@@enDesc: There is no such constant resource. @@@PerlDef: __DEEP{ my @constGroup; my $db = $self->; C: for my $cr_uri (@{$self->{}||[]}) { my $cr = $db-> ($$cr_uri); my $ln = $cr->; if ($ln and $ln eq $localName and $cr-> ()) { $r = $cr; last C; } elsif ($cr-> ()) { push @constGroup, $cr; } } unless ($r) { D: for my $cg (@constGroup) { $r = $cg-> ($localName, ); last D if $r; } } }__; @Attr: @@Name: parentResource @@enDesc: The static parent resource of the resource. @@Type: DIS|DISResource @@nullCase: @@@enDesc: No parent resource. @@Get: @@@PerlDef: __DEEP{ if ($self->{}) { $r = $self-> -> (${$self->{}}); } }__; @@Set: @@@ForCheck: ManakaiDOM|ForClass @@@PerlDef: __DEEP{ if ($given) { $self->{} = $given->; } else { CORE::delete $self->{}; } }__; @Attr: @@Name: dynamicParentResource @@enDesc: The dynamic parent resource of the resource. @@Type: DIS|DISResource @@nullCase: @@@enDesc: No parent resource. @@Get: @@@PerlDef: __DEEP{ if ($self->{}) { $r = $self-> -> (${$self->{}}); } }__; @@Set: @@@ForCheck: ManakaiDOM|ForClass @@@PerlDef: __DEEP{ if ($given) { $self->{} = $given->; } else { CORE::delete $self->{}; } }__; @Attr: @@Name: ownerClassNodeURI @@enDesc: The node URI reference of the class resource this resource belongs to. @@Type: ResourceURI @@Get: @@@enDesc: The URI reference of the resource. If this resource is a class, then the URI reference of this resource is returned. @@@nullCase: @@@@enDesc: This resource does not belong to any class. @@@PerlDef: if (exists $self->{}) { $r = $self->{}; } else { my $res = $self; __DEEP{ RES: { if ($res-> ()) { $r = $res->; } else { $res = $res->; redo RES if $res; } } }__; $self->{} = $r; } @Attr: @@Name: disIsNullValue @@enDesc: Whether this resource have value or not. A resource have value iff it has attribute node that in turn has attribute whose value set to . @@Type: DOMMain:boolean::ManakaiDOM:all @@Get: @@@PerlDef: if ($self->{}) { $r = $self->{}->; } @Method: @@Name: isFeatureProvided @@enDesc: Whether a feature is provided by this resource or not. Note that the feature is actually available (implemented) or not is other thing (use instead). @@Param: @@@Name: featureResourceURI @@@Type: ResourceURI @@@enDesc: The URI reference of the resource definition for the feature to test. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@enDesc: Whether the feature is provided or not. @@@PerlDef: __DEEP{ my @f = @{$self-> (, isa_recursive => true, default_media_type => )}; if (@f) { for my $f (@f) { if ($f-> ($featureResourceURI)) { $r = true; last; } } } else { my $parent = $self->; $r = $parent-> ($featureResourceURI) if $parent; } }__; @Attr: @@Name: featureNameList @@enDesc: The list of the names of the feature defined by this resource. = If the resource has one or more attributes, their text values are feature names. = If there is no attributes but the resource is a another feature, then the set of the feature names of the resource is equal to the one of another feature's feature names. {OLI:: If two operation above does not result in one or more feature names, = and if the resource has a name (the attribute returns ), then the of the resource is a feature name. = otherwise, i.e. is , then the of the resource, if non-, is a feature name. } @@Type: DISPerl:ARRAY::ManakaiDOM:all @@Get: @@@enDesc: A reference to the array containing feature names. Note that the order in the array is significant. The array might be empty if the resource has no feature name. This array is dead. {NOTE:: The attribute value array might be non-empty even if the resource is not of type as far as the algorithm defined above returns some feature names. } @@@RaiseException: @@@@@:UNSUPPORTED_MEDIA_TYPE_ERR @@@@enDesc: There is an attribute whose media type is not supported. @@@RaiseException: @@@@@: NO_SOURCE_NODE_ERR @@@@enDesc: This resource definition does not have associated node in the source tree. @@@PerlDef: __DEEP{ $r = [map {lc} @{$self-> ()}]; unless (@$r) { ## TODO: instance feature my $pr = $self->; if ($pr) { if ($pr-> () and not $pr->) { push @$r, @{$pr->}; } } } unless (@$r) { if ($self->) { my $ln = $self->; push @$r, lc $ln if defined $ln; } else { push @$r, lc $self->; } } }__; @Method: @@ForCheck: ManakaiDOM|ForClass @@Name: getFeature @@Description: @@@lang:en @@@@: Returns a specialized object that implements the specialized interfaces of the specified feature and version. @@Param: @@@Name: feature @@@Type: DISLang:String::ManakaiDOM:all @@@actualType: ManakaiDOM:ManakaiDOMFeatureName::ManakaiDOM:ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: A feature name to request. @@Param: @@@Name: version @@@Type: DISLang:String::ManakaiDOM:all @@@actualType: ManakaiDOM:ManakaiDOMFeatureVersion::ManakaiDOM:ManakaiDOMLatest @@@Description: @@@@lang:en @@@@@: A feature version number to request. @@Return: @@@Type: DOMMain:Object::ManakaiDOM:all @@@Description: @@@@lang:en @@@@@: An object that implements the specialized APIs of the and . @@@nullCase: @@@@enDesc: There is no object available that implements interfaces associated with the and . @@@PerlDef: $feature =~ s/^\+//; CLASS: for my $class (grep { $Message::Util::DIS::ManakaiDISResourceDefinition::CompatClass{$_} } keys %Message::Util::DIS::ManakaiDISResourceDefinition::CompatClass){ if ($Message::DOM::ClassFeature{$class}->{$feature}->{$version}) { $r = bless {o => $self}, $class; last CLASS; } } @Attr: @@Name: multiplePropertiesURI @@enDesc: Whether the property allows multiple occurence of the attribute in the source tree. @@Type: DISLang|String||ManakaiDOM|all @@Get: @@@PerlDef: __DEEP{ if ($self->{}) { $r = $self->{} -> ($self->) ->; } else { $r = ; } }__; @Attr: @@Name: defaultLextypeURI @@enDesc: The URI of the default lexical type for the attribute. @@Type: DISLang|String||ManakaiDOM|all @@Get: @@@PerlDef: __DEEP{ if ($self->{}) { $r = $self->{} -> ($self->) ->; } else { $r = ; } }__; ##DISResource IFClsDef: @IFQName: DISResourceMV @ClsQName: ManakaiDISResourceMV @enDesc: The objects implementing the also implement the interface. @Attr: @@Name: mvLocalName @@enDesc: The local name of the markup vocabulary element defined by this resource. @@Type: DISLang:String::ManakaiDOM:all @@Get: @@@nullCase: @@@@enDesc: Either this resource does not define a markup vocabulary element or it does define an element but it does not have a local name. @@@PerlDef: __DEEP{ if (UNIVERSAL::isa ($self->{}, )) { $r = $self->{}->; } else { $r = $self->; } }__; @Attr: @@Name: mvPrefix @@enDesc: A typical namespace prefix of the markup vocabulary element defined by this resource. @@Type: DISLang:String::ManakaiDOM:all @@Get: @@@nullCase: @@@@enDesc: Either this resource does not define a markup vocabulary element or it does define an element but it does not have a namespace URI. @@@PerlDef: __DEEP{ if (UNIVERSAL::isa ($self->{}, )) { $r = $self->{}->; } unless (defined $r) { my $nsuri = $self->; if (defined $nsuri and $nsuri =~ /([A-Za-z]\w*)\W*$/) { $r = $1; } elsif (defined $nsuri) { $r = 'ns'; } } }__; @Attr: @@Name: mvNamespaceURI @@enDesc: The namespace URI of the markup vocabulary element defined by this resource. @@Type: AnyURI @@Get: @@@nullCase: @@@@enDesc: Either this resource does not define a markup vocabulary element or it does define an element but it does not have a namespace URI. @@@PerlDef: __DEEP{ if (UNIVERSAL::isa ($self->{}, )) { $r = $self->{}->; } else { $r = $self->; } }__; @Attr: @@Name: mvOwnerElementResource @@enDesc: An resource of the markup vocabulary element defined by this resource. @@Type: DISResource @@clsActualType: ManakaiDISResourceDefinition @@Get: @@@nullCase: @@@@enDesc: Either this resource does not define a markup vocabulary element or it does define an element but it does not have an owner. @@@PerlDef: __DEEP{ if (exists $self->{}) { $r = $self->{db}-> ($self->{}) if defined $self->{}; } else { $r = $self->; undef $r unless $r-> (); $self->{} = $r->{uri} if $r; } }__; ##DISResourceMV PropDef: @QName: mvLocalName @enDesc: . PropDef: @QName: mvPrefix @enDesc: . PropDef: @QName: mvNamespaceURI @enDesc: . PropDef: @QName: mvOwnerElementURI @enDesc: ( resource URI reference). PropDef: @QName: ownerClass @enDesc: The class to which this resource belongs. @Type: ResourceURI @rdfs:range: rdf:Resource @rdfs:domain: ManakaiDOM:Class ResourceDef: @QName: DOMMinImpl @AliasFor: DOMFeature:GetFeature::ManakaiDOM:ManakaiDOMLatest @For: DIS|ForEmpty ResourceDef: @QName: SWCFGNode @AliasFor: swcfg21:SWCFGNode::swcfg21:ForLatest @For: DIS|ForEmpty ResourceDef: @QName: SWCFGElement @AliasFor: swcfg21:SWCFGElement::swcfg21:ForLatest @For: DIS|ForEmpty ResourceDef: @QName: SWCFGDoc @AliasFor: swcfg21:SWCFGDocument::swcfg21:ForLatest @For: DIS|ForEmpty XParamDef: @QName: sourceNodePath @enDesc: A node path string of the source node. XParamDef: @QName: errResource @enDesc: A resource on which an error has occurred. XParamDef: @QName: generatedName @enDesc: A generated name. IFClsDef: @IFQName: DISResourceProp @ClsQName: ManakaiDISPropertyAccessor @enDesc: Accessor methods for resource or module properties. @Method: @@Name: getPropertyValue @@enDesc: Returns a property value object. @@PropNameParam: @@Return: @@@Type: dv|DVValue @@@enDesc: The property value. @@@nullCase: @@@@enDesc: The property has no value. @@@PerlDef: if ($self->{$propName}) { $r = $self->{$propName}->[0]; } else { my $pr = $self-> -> ($propName); A: for (grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}} (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})) { my $v = $self->{$_}; if ($v) { $r = $v->[0]; last A; } } } @Method: @@Name: getPropertyValueList @@enDesc: Returns a property value objects. @@PropNameParam: @@Return: @@@Type: DISPerl|ARRAY||ManakaiDOM|all @@@enDesc: The property value. @@@PerlDef: my $pr = $self-> -> ($propName); $r = [map {@$_} grep {defined $_} map {$self->{$_}} grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}} (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})]; @Method: @@Name: getPropertyBoolean @@enDesc: Gets boolean property value. @@PropNameParam: @@Param: @@@Name:default @@@Type: DOMMain:boolean::ManakaiDOM:all @@@enDesc: The default value that is returned if no explicit property value specification found for this resource. @@Return: @@@Type: DOMMain:boolean::ManakaiDOM:all @@@enDesc: The property value. @@@PerlDef: if (ref $self->{$propName}) { $r = $self->{$propName}-> ? true : false; $r = $default unless defined $r; } else { my $pr = $self-> -> ($propName); C: { for (map {$self->{$_}} grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}} (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})) { if (defined $_) { $r = $_-> ? true : false; last C; } } $r = $default; } # C } @Method: @@Name: getPropertyText @@enDesc: Gets property value text. @@PropNameParam: @@Param: @@@Name:default @@@Type: swcfg21:SWCFGString::swcfg21:ForLatest @@@enDesc: The default value that is returned if no explicit property value specification found for this resource. @@@nullCase: @@@@enDesc: No default value supplied; is returned if no value specified. @@Return: @@@Type: swcfg21:SWCFGString::swcfg21:ForLatest @@@enDesc: The property value string. @@@nullCase: @@@@enDesc: No value nor default value has specified. @@@PerlDef: if (defined $self->{$propName}) { $r = $self->{$propName}->; $r = $default unless defined $r; } else { my $pr = $self-> -> ($propName); C: { for (map {$self->{$_}} grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}} (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})) { if (defined $_) { $r = $_->; last C; } } $r = $default; } # C } @Method: @@Name: getPropertyTextList @@enDesc: Returns a list of property value text. @@PropNameParam: @@MediaTypeDefaultParam: @@Return: @@@Type: DISPerl|ARRAY||ManakaiDOM|all @@@enDesc: A list of the property value strings. @@@RaiseException: @@@@@:UNSUPPORTED_MEDIA_TYPE_ERR @@@@enDesc: There is an attribute whose media type is not supported. @@@PerlDef: my $pr = $self-> -> ($propName); $r = [map {$_->} map {@$_} grep {$_} map {$self->{$_}} grep {$pr->{aliasURI}->{$_} or $pr->{supOf}->{$_}} (keys %{$pr->{aliasURI}}, keys %{$pr->{supOf}||{}})]; @Method: @@Name: getPropertyResource @@enDesc: Gets property value resource. @@PropNameParam: @@NamedParam: @@@Name: defaultMediaType @@@Type: ResourceURI @@@enDesc: The URI reference of the default media type which is used when the property value is retrieved from the source tree and the source tree element does not have its attribute specified. @@@nullCase: @@@@enDesc: Defaulted to . @@Return: @@@Type: DIS|DISAnyResource @@@enDesc: The property value resource. @@@nullCase: @@@@enDesc: No value has specified. @@@UndeclaredPrefixException: @@@RaiseException: @@@@@:UNSUPPORTED_MEDIA_TYPE_ERR @@@@enDesc: The media type of the attribute node in the source tree corresponding to this resource is not supported. @@@PerlDef: __DEEP{ my $v = $self-> ($propName); if (UNIVERSAL::isa ($v, )) { $r = $v-> ($self->); } }__; @Method: @@Name: getPropertyResourceList @@enDesc: Gets property value resource list. @@PropNameParam: @@NamedParam: @@@Name: recursive @@@Type: DOMMain:boolean::ManakaiDOM:all @@@enDesc: Whether property resource values of this resource should also be included to the returned list or not. @@NamedParam: @@@Name: recursiveISA @@@Type: DOMMain:boolean::ManakaiDOM:all @@@enDesc: Whether the ancestors of the resources that are property values should also be included in the returned list or not. @@@TrueCase: @@@@enDesc: If a property value is a resource and the resource 's (or inherits) , then the resource is also a value in the list. @@@FalseCase: @@@@enDesc: Only the resources directly specified as property values is returned. @@NamedParam: @@@Name: isaRecursive @@@Type: DOMMain:boolean::ManakaiDOM:all @@@enDesc: Whether property resource values of resources of this resource should also be included to the returned list or not. @@@TrueCase: @@@@enDesc: If this resource 's (or inherits) another resource and the resource has a property value of , then the resource is also a value in the list. @@@FalseCase: @@@@enDesc: Only the resource directly specified is the returned. @@NamedParam: @@@Name: defaultMediaType @@@Type: ResourceURI @@@enDesc: The URI reference of the default media type which is used when the property value is retrieved from the source tree and the source tree element does not have its attribute specified. @@@nullCase: @@@@enDesc: Defaulted to . @@Return: @@@Type: ResourceList @@@enDesc: An array reference of the property value resources. \ {NOTE:: This list is . \ } @@@UndeclaredPrefixException: @@@RaiseException: @@@@@:UNSUPPORTED_MEDIA_TYPE_ERR @@@@enDesc: The media type of the attribute node in the source tree corresponding to this resource is not supported. @@@PerlDef: $r = []; __DEEP{ my $v = $self-> ($propName); my $db = $self->; for my $a (@$v) { if ($a->isa ()) { push @$r, $a-> ($db); } if ($isaRecursive) { my $b = $a-> (); if ($b and $b->) { $isaRecursive = false; } } } }__; if ($recursive) { __DEEP{ $opt{___recursive_isa_done} ||= {$self->{uri} => true}; my @p_res = @$r; for my $p_res (@p_res) { next if $opt{___recursive_isa_done}->{$p_res->{uri}}; $opt{___recursive_isa_done}->{$p_res->{uri}} = true; push @$r, @{$p_res-> ($propName, recursive => true, recursive_isa => $recursiveISA, ___recursive_isa_done => $opt{___recursive_isa_done}, default_media_type => $defaultMediaType)}; } }__; } if ($recursiveISA) { __DEEP{ $opt{___recursive_isa_done} ||= {$self->{uri} => true}; my @p_res = @$r; for my $p_res (@p_res) { next if $opt{___recursive_isa_done}->{$p_res->{uri}}; $opt{___recursive_isa_done}->{$p_res->{uri}} = true; push @$r, @{$p_res-> (, recursive => true, ___recursive_isa_done => $opt{___recursive_isa_done}, default_media_type => $defaultMediaType)}; } }__; } if ($isaRecursive) { __DEEP{ $opt{___recursive_isa_done} ||= {$self->{uri} => true}; $opt{___isa_recursive_done} ||= {$self->{uri} => true}; my @p_res = @{$self-> (, recursive_isa => false, recursive => false, default_media_type => )}; for my $p_res (@p_res) { next if $opt{___isa_recursive_done}->{$p_res->{uri}}; $opt{___isa_recursive_done}->{$p_res->{uri}} = true; push @$r, @{$p_res-> ($propName, recursive_isa => false, recursive => false, isa_recursive => true, ___isa_recursive_done => $opt{___isa_recursive_done}, default_media_type => $defaultMediaType)}; } }__; } @Method: @@Name: addPropertyResourceList @@enDesc: Adds a resource to a resource-list property value. \ {ISSUE:: Should an exception be thrown if the property is not of list? \ } \ {NOTE:: If the property is not ten ever, adding an item clears the list --- i.e. the property values in the source tree will be ignored. Call before adding to avoid this behavior. \ } @@PropNameParam: @@Param: @@@Name: res @@@Type: DISResource @@@clsActualType: ManakaiDISResourceDefinition @@@enDesc: A resource to add. @@Return: @@@PerlDef: if ($self->{$propName}) { my $uriv; __CODE{dv|createURI:: $uri => {$res->}, $result => $uriv, $name => $propName, }__; $self->{$propName}-> ($uriv); } else { __CODE{dv|createOrderedList:: $result => {$self->{$propName}}, $type => {}, $base_type => {}, }__; my $uriv; __CODE{dv|createURI:: $uri => {$res->}, $result => $uriv, $name => $propName, }__; $self->{$propName}-> ($uriv); } @Method: @@Name: addPropertyResourceUList @@plMName: add_property_resource_ulist @@enDesc: Adds a resource to a resource-list property value. \ {ISSUE:: Should an exception be thrown if the property is not of list? \ } \ {NOTE:: If the property is not ten ever, adding an item clears the list --- i.e. the property values in the source tree will be ignored. Call before adding to avoid this behavior. \ } @@PropNameParam: @@Param: @@@Name: res @@@Type: DISResource @@@clsActualType: ManakaiDISResourceDefinition @@@enDesc: A resource to add. @@Return: @@@PerlDef: if ($self->{$propName}) { my $uriv; __CODE{dv|createURI:: $uri => {$res->}, $result => $uriv, $name => $propName, }__; $self->{$propName}-> ($uriv); } else { __CODE{dv|createUnorderedList:: $result => {$self->{$propName}}, $type => {}, $base_type => {}, }__; my $uriv; __CODE{dv|createURI:: $uri => {$res->}, $result => $uriv, $name => $propName, }__; $self->{$propName}-> ($uriv); } @Method: @@Name: addPropertyURIUList @@plMName: add_peoperty_uri_ulist @@enDesc: Adds a resource to a resource-list property value. \ {ISSUE:: Should an exception be thrown if the property is not of list? \ } \ {NOTE:: If the property is not ten ever, adding an item clears the list --- i.e. the property values in the source tree will be ignored. Call before adding to avoid this behavior. \ } @@PropNameParam: @@Param: @@@Name: uri @@@Type: AnyURI @@@enDesc: A resource to add. @@Return: @@@PerlDef: __DEEP{ if ($self->{$propName}) { my $uriv; __CODE{dv|createURI:: $uri => $uri, $result => $uriv, $name => $propName, }__; $self->{$propName}-> ($uriv); } else { __CODE{dv|createUnorderedList:: $result => {$self->{$propName}}, $type => {}, $base_type => {}, }__; my $uriv; __CODE{dv|createURI:: $uri => $uri, $result => $uriv, $name => $propName, }__; $self->{$propName}-> ($uriv); } }__; ##DISResourceProp ElementTypeBinding: @Name: PropNameParam @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:MethodParameter @@Name: propName @@Type: ResourceURI @@Description: @@@lang:en @@@@: The name of the property. PropDef: @QName:isAnon @Description: @@lang:en @@@: Whether the subject resource is anonymous or not. @Type: DOMMain:boolean::ManakaiDOM:all PropDef: @QName:isDefined @Description: @@lang:en @@@: Whether the subject resource is defined or not. PropDef: @QName:isReferred @Description: @@lang:en @@@: Whether the subject resource is referred or not. @Type: DOMMain:any PropDef: @QName:definingModule @Description: @@lang:en @@@: The module in which the subject resource is defined. \ {NOTE:: The local name should have been or some. \ } @rdfs:domain: DISCore:Module ## -- Datatypes URITypeDef: @QName: AnyURI @Description: @@lang:en @@@: Any URI references. URITypeDef: @QName: FileURI @enDesc: URI references identifying file. URITypeDef: @QName: ForURI @Description: @@lang:en @@@: URI references. DataTypeDef: @QName: ForURIList @Description: @@lang:en @@@: References to the array containing URI references. URITypeDef: @QName: ResourceURI @Description: @@lang:en @@@: A URI reference for a resource. URITypeDef: @QName: MediaTypeURI @Description: @@lang:en @@@: Media type URI references. @rdfs:subClassOf: ResourceURI URITypeDef: @QName: ModuleURI @enDesc: URI references for modules. @rdfs:subClassOf: ResourceURI URITypeDef: @QName: NameURI @enDesc: URI references identifying a resource. @rdfs:subClassOf: ResourceURI DataTypeDef: @QName: ResourceList @enDesc: References to array containing resource definition objects. @rdfs:subClassOf: DISPerl:ARRAY::ManakaiDOM:all ElementTypeBinding: @Name: DataTypeDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: ManakaiDOM:DataType ElementTypeBinding: @Name: URITypeDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: ManakaiDOM:DataType @@rdfs:subClassOf: AnyURI ## -- Exceptions XParamDef: @QName: anotherSourceNode @enDesc: Another source node in which an error has occurred. In cases of errors, it is the node that defines the resource first. @Type: ManakaiDISNode ResourceDef: @QName: UNDECLARED_NS_PREFIX_ERR @For: ForEmpty @AliasFor: DIS:UNDECLARED_NS_PREFIX_ERR::swcfg21:ForLatest ResourceDef: @rdf:type: @@@: dis|MultipleResource @@ForCheck: !ManakaiDOM|ForIF !ManakaiDOM|ForClass @resourceFor: ManakaiDOM|ForIF @resourceFor: @@@: ManakaiDOM|ForClass @@ForCheck: ForEmpty !=ForEmpty @For: ForLatest @For: =ForEmpty @rdf:type: @@@: dx|Interface @@ForCheck: ManakaiDOM|ForIF @rdf:type: @@@: dx|Class @@ForCheck: ManakaiDOM|ForClass @Implement: @@@: ||ForEmpty||ManakaiDOM|ForIF @@ContentType: DISCore|TFPQNames @@ForCheck: ManakaiDOM|ForClass ForEmpty @Implement: @@@: ||ForLatest||ManakaiDOM|ForIF @@ContentType: DISCore|TFPQNames @@ForCheck: ManakaiDOM|ForClass ForLatest @dx:implementedBy: ||DIS|ForLatest||ManakaiDOM|ForClass @f:implements: @@@: CoreFeature10 @@For: ForLatest @ISA: @@@: dx|Exception||ManakaiDOM|Perl @@ForCheck: ManakaiDOM|ForClass @IFQName: DISException @ClsQName: ManakaiDISException @Description: @@lang:en @@@: Exceptions for the operations. @ResourceDef: @@rdf:type: DISLang|ConstGroup @@ForCheck: ManakaiDOM|ForIF !=DIS|ForEmpty @@IFQName: DISExceptionCode @@rdfs:subClassOf: idl|unsignedShort||ManakaiDOM|all @@Type: idl|unsignedShort||ManakaiDOM|all @@enDesc: Exception codes for . @@XConstDef: @@@Name: HIERARCHY_REQUEST_ERR @@@Value: @@@@@:3 @@@@ContentType: DISCore|Integer @@@enDesc: An attempt is made to break the hierarchy. @@@XSubTypeDef: @@@@QName: MERGE_ITSELF_ERR @@@@enDesc: An attempt is made to merge the resource to itself. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the resource to merge. @@@@enMufDef: An attempt is made to merge the resource <%p (name => {} );> to itself @@XConstDef: @@@Name: NOT_SUPPORTED_ERR @@@Value: @@@@@:9 @@@@ContentType: DISCore|Integer @@@enDesc: An attempt is made to do something the implementation does not support. @@@XSubTypeDef: @@@@QName: UNSUPPORTED_MEDIA_TYPE_ERR @@@@enDesc: The implementation does not support the media type. @@@@XParam: @@@@@QName: uri @@@@@enDesc: The URI reference of the media type that is not supported. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The URI reference of the element type of the element in which the media type is referenced. @@@@enMufDef: %p (name => {}, prefix => {"}, suffix => {": } );%p (name => {}, prefix => { (Element type: <}, suffix => {>) } );Media type <%p (name => {});> is not supported @@@XSubTypeDef: @@@@QName: UNSUPPORTED_ELEMENT_TYPE_ERR @@@@enDesc: An unsupported type of element is encounted. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type URI reference of the element. @@@@enMufDef: Element type "%p (name => {});" is not supported @@@XSubTypeDef: @@@@QName: NO_PERL_CODE_IMPL_ERR @@@@enDesc: There is no implementation that supports the feature, version . @@XConstDef: @@@Name: INVALID_STATE_ERR @@@Value: @@@@@:11 @@@@ContentType: DISCore|Integer @@@enDesc: An attempt is made to use an object that is not (or no longer) usable. @@@XSubTypeDef: @@@@QName: NO_ASSOCIATED_DB_ERR @@@@enDesc: No database has been associated with this document. @@XConstDef: @@@Name: INVALID_SOURCE_ERR @@@Value: @@@@@: 501 @@@@ContentType: DISCore|Integer @@@enDesc: The source input is well-formed but invalid. @@@XSubTypeDef: @@@@QName: NO_MODULE_QNAME_ERR @@@@enDesc: The element must have its attribute. @@@@XSourceNodeParam: @@@XSubTypeDef: @@@@QName: NO_LOCAL_NAME_ERR @@@@enDesc: The resource does not have a local name. @@@@XSourceNodeParam: @@@XSubTypeDef: @@@@QName: UNABLE_TO_GET_MODULE_ERR @@@@enDesc: The implementation is unable to get the module source. @@@@enMufDef: Unable to get the module source of <%p (name => {});> @@@@XParam: @@@@@QName: uri @@@@@enDesc: The URI reference of the module. @@@@XParam: @@@@@QName: namespaceURI @@@@@enDesc: The namespace URI of the module name. @@@@XParam: @@@@@QName: localName @@@@@enDesc: The local name of the module name. @@@@XParam: @@@@@QName: for @@@@@enDesc: The of the module. @@@XSubTypeDef: @@@@QName: NO_FOR_QNAME_ERR @@@@enDesc: A element must have attribute. @@@@XSourceNodeParam: @@@XSubTypeDef: @@@@QName: FOR_ALREADY_DEFINED_ERR @@@@enDesc: The named as the same URI reference has already defined. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName: anotherSourceNode @@@@@enDesc: The node that defines the URI reference before. @@@@XParam: @@@@@Name: uri @@@@@enDesc: The URI reference of the attempted to define. @@@@enMufDef: <%p (name => {});> is already defined @@@XSubTypeDef: @@@@QName: RESOURCE_ALREADY_DEFINED_ERR @@@@enDesc: The resource named as the same URI reference has already defined. @@@@XSourceNodeParam: @@@@XParam: @@@@@@: anotherSourceNode @@@@@enDesc: The node that defines the URI reference before. @@@@XParam: @@@@@@: uri @@@@@enDesc: The URI reference of the resource attempted to define. @@@@XParam: @@@@@@: moduleURI @@@@@enDesc: A URI of the module in which the resource is defined. @@@@enMufDef: %p (name => {}, prefix => {Module <}, suffix => {>: }) ;Resource <%p (name => {});> is already defined @@@XSubTypeDef: @@@@QName: ELEMENT_NOT_ALLOWED_ERR @@@@enDesc: An element has occured where it is not allowed. @@@@enMufDef: Module <%p (name => {});>: Element of type <%p (name => {});> is not allowed here @@@@XSourceNodeParam: @@@@XParam: @@@@@QName: elementType @@@@@enDesc: The expanded element type name of the element. @@@@XParam: @@@@@QName: uri @@@@@enDesc: The URI reference of the module. @@@XSubTypeDef: @@@@QName: NO_REQUIRED_ATTR_ERR @@@@enDesc: A required attribute is not specified. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName: elementType @@@@@enDesc: The expanded URI reference of the attribute name. @@@@enMufDef: Attribute <%p (name => {});> must be specified @@@XSubTypeDef: @@@@QName: FOR_NOT_DEFINED_ERR @@@@enDesc: A is referred but not defined. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName: uri @@@@@enDesc: The URI reference of the that is not defined. @@@@enMufDef: <%p (name => {});> is not defined @@@XSubTypeDef: @@@@QName: RESOURCE_NOT_DEFINED_ERR @@@@enDesc: A resource is referred but not defined or the resource referred does not have the type expected. @@@@XSourceNodeParam: @@@@XParam: @@@@@@: sourceNodePath @@@@@enDesc: A node path string of the source node. @@@@XParam: @@@@@QName: uri @@@@@enDesc: The URI reference of the resource that is not defined. @@@@XParam: @@@@@QName: elementType @@@@@enDesc: element type (either tree element type or preprocessing element type) of the element in which a reference to the undefined resource is contained. @@@@XParam: @@@@@QName:parentURI @@@@@enDesc: The URI reference of the resource from whose child resources a resource is tried to find. @@@@XParam: @@@@@QName: moduleURI @@@@@enDesc: The URI of the module in which the resourece should be included. @@@@XParam: @@@@@QName: localName @@@@@enDesc: The local name of the undefined resource. @@@@XParam: @@@@QName: sourceCode @@@@enDesc: Source code fragment that referres this resource. @@@@XParam: @@@@@QName:expectedType @@@@@enDesc: Expected resource type. @@@@enMufDef: %p (name => {}, prefix => {Module <}, suffix => {>: }) ;%p (name => {}, suffix => {: }) ;%p (name => {}, prefix => {"}, suffix => {": }) ;%p (name => {}, prefix => {(In <}, suffix => {>) }) ;Resource%p (name => {}, prefix => { <}, suffix => {>});%p (name => {}, prefix => { "}, suffix => {"}); is not defined or wrong type%p (name => {}, prefix => { (<}, suffix => {> is expected)}); @@@XSubTypeDef: @@@@QName: NO_SOURCE_NODE_ERR @@@@enDesc: A resource does not have associated node in the source tree. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the resource. @@@XSubTypeDef: @@@@QName: RESERVED_PERL_METHOD_NAME_ERR @@@@enDesc: A reserved Perl method name is used. @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the method resource. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName: generatedName @@@@@enDesc: A reserved method name. @@@XSubTypeDef: @@@@QName: NO_DIS_TYPE_ERR @@@@enDesc: attribute is not found. @@@@XSourceNodeParam: @@@@enMufDef: Resource "%t (name => {});" has no "dis:Type" attribute @@@XSubTypeDef: @@@@QName: NO_METHOD_RETURN_ERR @@@@enDesc: A resource does not have any child. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:errResource @@@@@enDesc: The method resource. @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the method. @@@@XParam: @@@@@QName:localName @@@@@enDesc: The local name of the resource. @@@@enMufDef: Method "%p (name => {});" does not have "Return" child @@@XSubTypeDef: @@@@QName: NO_ATTR_GET_ERR @@@@enDesc: A resource does not have any child. @@@@XSourceNodeParam: @@@XSubTypeDef: @@@@QName:INTERFACE_CLASS_METHOD_ERR @@@@enDesc: An attempt is made to call a static (class) method from an interface. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the interface. @@@@XParam: @@@@@QName:sourceCode @@@@@enDesc: Source code fragment that calls a class method. @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type URI reference of the element that calls a method. @@@XSubTypeDef: @@@@QName: BROKEN_PARAM_SPEC_ERR @@@@enDesc: A parameter specification is broken. @@@@XParam: @@@@@QName: sourceCode @@@@@enDesc: Source code fragment that contains the broken parameter specification. @@@@XSourceNodeParam: @@@@enMufDef: %p (name => {}, prefix => {"}, suffix => {": });Broken parameter specification @@@XSubTypeDef: @@@@QName:PERL_PREPROCESS_NO_ELEMENT_TYPE_ERR @@@@enDesc: A preprocessing instruction does not have its element type. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:sourceCode @@@@@enDesc: Source code fragment. @@@@enMufDef: %p (name => {}, prefix => {"}, suffix => {": });Element type name is not specified @@@XSubTypeDef: @@@@QName: NO_PERL_PACKAGE_NAME_ERR @@@@enDesc: No Perl package name is defined for the resource referred. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:sourceCode @@@@@enDesc: Source code fragment. @@@@XParam: @@@@@QName:uri @@@@@enDesc: THe URI reference of the resource referred. @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type of Perl preprocessing instruction in which the resource is referred. @@@@enMufDef: %p (name => {}, prefix => {<}, suffix => {>: });Perl package name is not defined @@@XSubTypeDef: @@@@QName: PERL_PREPROCESS_NO_EXCEPTION_TYPE_ERR @@@@enDesc: An exception type specification is required. @@@@XSourceNodeParam: @@@@XSourceCodeParam: @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type of the preprocessing instruction. @@@XSubTypeDef: @@@@QName: PERL_PREPROCESS_NO_CODE_NAME_ERR @@@@enDesc: A code name specification is required. @@@@XSourceNodeParam: @@@@XSourceCodeParam: @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type of the preprocessing instruction. @@@XSubTypeDef: @@@@QName: PERL_CODE_NOT_DEFINED_ERR @@@@enDesc: The specified resource does not have its Perl definition. @@@@XSourceNodeParam: @@@@XSourceCodeParam: @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type of the preprocessing instruction. @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the resource referred. @@@@XParam: @@@@@QName:localName @@@@@enDesc: The local name of the resource referred. @@@@enMufDef: Resource%p (name => {}, prefix => { "}, suffix => {"}); has no Perl code definition @@@XSubTypeDef: @@@@QName: PERL_PREPROCESS_NO_METHOD_ERR @@@@enDesc: A preprocessing instruction which is only allowed in method definitions is used in a code which is not a method. @@@@XSourceNodeParam: @@@@XSourceCodeParam: @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type of the preprocessing instruction. @@@XSubTypeDef: @@@@QName: PERL_PREPROCESS_NO_FOR_ERR @@@@enDesc: A specification is required. @@@@XSourceNodeParam: @@@@XSourceCodeParam: @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type of the preprocessing instruction. @@@XSubTypeDef: @@@@QName: PERL_PREPROCESS_NO_ASSERT_TYPE_ERR @@@@enDesc: An assertion type specification is required. @@@@XSourceNodeParam: @@@@XSourceCodeParam: @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type of the preprocessing instruction. @@@XSubTypeDef: @@@@QName: PERL_PREPROCESS_BLOCK_NOT_ALLOWED_ERR @@@@enDesc: A preprocessing instruction block occurred with element type which does not allow it. @@@@XSourceNodeParam: @@@@XSourceCodeParam: @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type of the preprocessing instruction. @@@XSubTypeDef: @@@@QName: NON_NAMED_PARAMETER_AFTER_NAMED_ERR @@@@enDesc: A non-named method parameter following any named method parameter is occurred. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the non-named method parameter resource. @@@@XParam: @@@@@QName:localName @@@@@enDesc: The local name of the non-named method parameter. @@@XSubTypeDef: @@@@QName:DISPERL_NO_VALUE_ALLOWED_ERR @@@@enDesc: An element node have a value but the definition of that element type does not allow it. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The element type URI reference of the element. @@@XSubTypeDef: @@@@QName:NO_CONST_VALUE_ERR @@@@enDesc: The source element node for a constant value resource does not have attribute. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:elemntType @@@@@enDesc: The element type URI reference of the element from which a constant value resource is referred. @@@@XParam: @@@@@QName:uri @@@@@enDesc: The resource URI reference of the constant value resource. @@@@XParam: @@@@@QName:localName @@@@@enDesc: The local name of the constant value resource. @@@XSubTypeDef: @@@@QName:NO_ATTR_SET_ERR @@@@enDesc: An attribute setter is referred but the attribute does not define any setter. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:errResource @@@@@enDesc: The attribute resource. @@@@XParam: @@@@@QName:elementType @@@@@enDesc: The type of the element by which this attribute is referred. @@@XSubTypeDef: @@@@QName: PERL_SUBROUTINE_ALREADY_DEFINED_ERR @@@@enDesc: A resource defines a Perl subroutine whose name is same as another subroutine. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the resource that defines the Perl subroutine. @@@@XParam: @@@@@QName: PerlCode:localName @@@@@enDesc: The name of the Perl subroutine. @@@XSubTypeDef: @@@@QName: PERL_OPERATOR_ALREADY_OVERLOADED_ERR @@@@enDesc: A resource is defined to overload a Perl operator which is already overloaded by another resource. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the resource that defines the overloading. @@@@XParam: @@@@@QName: PerlCode:operator @@@@@enDesc: The operator. @@@XSubTypeDef: @@@@QName: PERL_UNUSED_SUBROUTINE_ERR @@@@enDesc: A resource defines a Perl subroutine but it is not used. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the resource. @@@XSubTypeDef: @@@@QName: NO_LICENSE_ATTR_ERR @@@@enDesc: The element does not have the attribute. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the module. @@@XSubTypeDef: @@@@QName: UNSUPPORTED_ROLE_ERR @@@@enDesc: A is not supported. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the unsupported role. @@@@enMufDef: Role <%p (name => {});> is not supported @@@XSubTypeDef: @@@@QName: NO_REFLECT_GET_DEFINED_ERR @@@@enDesc: An attribute is defined to reflect an element attribute but no reflecting attribute getter template is defined. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the datatype resource for which a getter template should have been defined. @@@XSubTypeDef: @@@@QName: NO_REFLECT_SET_DEFINED_ERR @@@@enDesc: An attribute is defined to reflect an element attribute but no reflecting attribute setter template is defined. @@@@XSourceNodeParam: @@@@XParam: @@@@@QName:uri @@@@@enDesc: The URI reference of the datatype resource for which a setter template should have been defined. @@@XSubTypeDef: @@@@QName: NO_END_TAG_ERR @@@@enDesc: Close tag not found. @@@@XSourceNodeParam: @@@@XParam: @@@@@@: elementType @@@@@enDesc: The type URI reference of the element that is not closed. @@@@XParam: @@@@@@: sourceCode @@@@@enDesc: The source code fragment near the position where an end tag is required. @@@@enMufDef: End tag for element "%p (name => {});" is required%p (name => {}, prefix => { (}, suffix => {)}); @@@XSubTypeDef: @@@@QName: NO_RDF_TYPE_ERR @@@@enDesc: There is a resource definition element that does not have any attribute. @@@@XSourceNodeParam: @@@@XParam: @@@@@@: uri @@@@@enDesc: The URI of the resource which does not have . @@@@enMufDef: Resource%p (name => {}, prefix => { "}, suffix => {"}); does not have "rdf:type" attribute @@@XSubTypeDef: @@@@QName: PERL_HASH_KEY_ALREADY_DEFINED_ERR @@@@enDesc: A hash key is already defined. @@@@XSourceNodeParam: @@@@XParam: @@@@@@:uri @@@@@enDesc: The URI of the resource tried to register. @@@@XParam: @@@@@@:anotherURI @@@@@enDesc: The URI of the already registered resource. @@@@XParam: @@@@@@:hashKeyName @@@@@enDesc: Hash key. @@@@XParam: @@@@@@:hashKeyScope @@@@@enDesc: Hash key scope. @@@@enMufDef: <%p (name => {});>: Hash key "%p (name => {});" in <%p (mame => {});> is already defined for <%p (name => {});> @@@XSubTypeDef: @@@@QName: DIS|NO_EXCEPTION_CLASS_ERR @@@@enDesc: The exception interface has no class that implements the interface. @@@@enMufDef: Exception interface <%p (name => {});>: There is no class that implements this interface @@@@XParam: @@@@@@: DIS|uri @@@@@enDesc: The URI of the interface. @ImplNote: @@lang:en @@@: ISSUE: Too many subtypes for a type! New type should be added? @Attr: @@Name: text @@enDesc: The description of the error, in language. @@enImplNote: See for super definition. @@Type: DISLang|String @@Get: @@@PerlDef: $r = $self->SUPER::text; if (defined $self->{}) { $r = '<' . $self->{} . '>: ' . $r; } if (defined $self->{}) { $r = 'Node ' . $self->{}-> . ': ' . $r; } ##DISException ElementTypeBinding: @Name: enImplNote @ElementType: dis:ImplNote @ShadowContent: @@lang:en XParamDef: @QName: hashKeyName @Type: DISLang|String @enDesc: See . XParamDef: @QName: hashKeyScope @Type: AnyURI @enDesc: See . XParamDef: @QName: anotherURI @Type: ResourceURI @enDesc: A URI of another related resource. XParamDef: @QName:expectedType @Type: ResourceURI @enDesc: Expected resource type URI reference. XParamDef: @QName: sourceCode @Type: DISLang:String::ManakaiDOM:all @enDesc: The source code fragment in which an error occurred. XParamDef: @QName: elementType @Type: ResourceURI @enDesc: The name of the element type. XParamDef: @QName: uri @Type: ResourceURI @enDesc: The name of the resource, composed from , and . XParamDef: @QName: localName @Type: DISCore:LocalName::ManakaiDOM:all @enDesc: The local name of the resource, unique in namespace. XParamDef: @QName: namespaceURI @Type: AnyURI @enDesc: The namespace URI reference of the resource name. XParamDef: @QName: for @Type: ForURI @enDesc: The URI reference of the resource. ElementTypeBinding: @Name: XSourceNodeParam @ElementType: ecore:hasParameter @ShadowContent: @@QName: sourceNode @@Description: @@@lang:en @@@@: The node in which an error has occurred. ElementTypeBinding: @Name: XSourceCodeParam @ElementType: ecore:hasParameter @ShadowContent: @@QName: sourceCode @@Description: @@@lang:en @@@@: The source code in which an error has occurred. ResourceDef: @QName: ManakaiDISExceptionTarget @AliasFor: dx|ManakaiDefaultExceptionHandler||ManakaiDOM|Perl @For: DIS|ForEmpty ElementTypeBinding: @Name: plMName @ElementType: DISPerl:methodName @ShadowContent: @@ContentType: lang|Perl @@For: ManakaiDOM|Perl ElementTypeBinding: @Name: plCName @ElementType: DISPerl:exportTagName @ShadowContent: @@ContentType: lang|Perl @@For: ManakaiDOM|Perl ElementTypeBinding: @Name: Method @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:Method @@For: !=ForEmpty ElementTypeBinding: @Name: IntMethod @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:Method @@ManakaiDOM:isForInternal:1 @@ForCheck: ManakaiDOM|ForClass ElementTypeBinding: @Name: Attr @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:Attribute @@For: !=ForEmpty ElementTypeBinding: @Name: Return @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:MethodReturn ElementTypeBinding: @Name: Get @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:AttributeGet ElementTypeBinding: @Name: Set @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:AttributeSet ElementTypeBinding: @Name: Param @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:MethodParameter ElementTypeBinding: @Name: PerlDef @ElementType: dis:Def @ShadowContent: @@ContentType: lang:Perl ElementTypeBinding: @Name: InCase @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: ManakaiDOM:InCase ElementTypeBinding: @Name: nullCase @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: ManakaiDOM:InCase @@Value: @@@is-null:1 @@@ContentType: DISCore|String ElementTypeBinding: @Name: TrueCase @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: ManakaiDOM:InCase @@Value: @@@@: 1 @@@ContentType: DISCore|Boolean @@Type: DOMMain:boolean::ManakaiDOM:all ElementTypeBinding: @Name: FalseCase @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: ManakaiDOM:InCase @@Value: @@@@: 0 @@@ContentType: DISCore|Boolean @@Type: DOMMain:boolean::ManakaiDOM:all ElementTypeBinding: @Name: enDesc @ElementType: dis:Description @ShadowContent: @@lang:en ElementTypeBinding: @Name: PropDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: rdf:Property @@For: =ManakaiDOM|all ElementTypeBinding: @Name: MethodRedef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:Method ElementTypeBinding: @Name: NamedParam @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:MethodParameter @@DISPerl:isNamedParameter:1 ElementTypeBinding: @Name: NodeParam @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:MethodParameter @@DISPerl:isNamedParameter:1 @@Name: node @@Type: DISNode @@actualType: @@@@: ManakaiDISNode @@@ForCheck: ManakaiDOM|ForClass @@Description: @@@lang:en @@@@: The node in which the name has occurred. It is intended to be reported when an exception had been raised. @@ResourceDef: @@@rdf:type: ManakaiDOM:InCase @@@Value: @@@@is-null:1 @@@@ContentType: DISCore|String @@@Description: @@@@lang:en @@@@@: The source of the name is not a node. ElementTypeBinding: @Name: ForParam @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:MethodParameter @@DISPerl:isNamedParameter:1 @@Name: forArg @@Type: ForURI @@Description: @@@lang:en @@@@: The URI reference. @@ResourceDef: @@@rdf:type: ManakaiDOM:InCase @@@Value: @@@@is-null:1 @@@@ContentType: DISCore|String @@@Description: @@@@lang:en @@@@@: Equivalent to , i.e. . ElementTypeBinding: @Name: ForpParam @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:MethodParameter @@DISPerl:isNamedParameter:1 @@Name: forpArg @@Type: ForURIList @@Description: @@@lang:en @@@@: An array reference containing additional constraints ( list). @@ResourceDef: @@@rdf:type: ManakaiDOM:InCase @@@Value: @@@@is-null:1 @@@@ContentType: DISCore|String @@@Description: @@@@lang:en @@@@@: Equivalent to the empty array reference. ElementTypeBinding: @Name: MediaTypeParam @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:MethodParameter @@DISPerl:isNamedParameter:1 @@Name: mediaType @@Type: MediaTypeURI @@Description: @@@lang:en @@@@: The URI reference identifying a media type. @@ResourceDef: @@@rdf:type: ManakaiDOM:InCase @@@Value: @@@@is-null:1 @@@@ContentType: DISCore|String @@@Description: @@@@lang:en @@@@@: No media type specified. ElementTypeBinding: @Name: MediaTypeDefaultParam @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: DISLang:MethodParameter @@DISPerl:isNamedParameter:1 @@Name: defaultMediaType @@Type: MediaTypeURI @@Description: @@@lang:en @@@@: The default media type, i.e. the type used when no explicit specification is not found in the source tree. @@ResourceDef: @@@rdf:type: ManakaiDOM:InCase @@@Value: @@@@is-null:1 @@@@ContentType: DISCore|String @@@Description: @@@@lang:en @@@@@: Defaulted to . ElementTypeBinding: @Name: RaiseException @ElementType: ManakaiDOM:raises ElementTypeBinding: @Name: UndeclaredPrefixException @ElementType: ManakaiDOM:raises @ShadowContent: @@@: UNDECLARED_NS_PREFIX_ERR @@Description: @@@lang:en @@@@: The implementation has encounted an undeclared namespace prefix. ElementTypeBinding: @Name: NoDBException @ElementType: ManakaiDOM:raises @ShadowContent: @@@: NO_ASSOCIATED_DB_ERR @@Description: @@@lang:en @@@@: No database is associated to this document. ElementTypeBinding: @Name: XConstDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: dx|ErrorCode ElementTypeBinding: @Name: XSubTypeDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: dx|ErrorSubCode ElementTypeBinding: @Name: XParam @ElementType: ecore:hasParameter ElementTypeBinding: @Name: XParamDef @ElementType: dis:ResourceDef @ShadowContent: @@rdf:type: ecore|Parameter @@For: =ManakaiDOM|all XParamDef: @QName: DIS|moduleURI @enDesc: A URI of the module in which the resource is defined. ElementTypeBinding: @Name: enMufDef @ElementType: ecore:defaultMessage @ShadowContent: @@ContentType: lang:muf @@lang:en