2N/A# The contents of this file are subject to the terms of the 2N/A# Common Development and Distribution License (the "License"). 2N/A# You may not use this file except in compliance with the License. 2N/A# See the License for the specific language governing permissions 2N/A# and limitations under the License. 2N/A# When distributing Covered Code, include this CDDL HEADER in each 2N/A# If applicable, add the following below this CDDL HEADER, with the 2N/A# fields enclosed by brackets "[]" replaced with your own identifying 2N/A# information: Portions Copyright [yyyy] [name of copyright owner] 2N/A# Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A # separate kids into classes and create hash of entries and an 2N/A print STDERR "no external attributes defined for $id/$kidId\n";
2N/A }
# handle event id translation... 2N/A print STDERR "missing id for internal name of $id\n";
2N/A return bless {
'id' => $
id,
2N/A# return internal name if it exists, else id 2N/A return $
pkg->{
'internalName'};
2N/A# getNextEntry reads from 'entryList' destructively 2N/A# but resets when the list after the list is emptied 2N/A unless (@{$
pkg->{
'entryList'}}) {
2N/A @{$
pkg->{
'entryList'}} = @{$
pkg->{
'entryListCopy'}};
2N/A# getEntryIds returns list of all ids from entryList 2N/A return (@{$
pkg->{
'entryList'}});
2N/A# getEntry returns a selected entry for the current event 2N/A my $
id =
shift;
#entry id 2N/A# getNextInclude reads from 'include' destructively 2N/A return shift @{$
pkg->{
'include'}};
2N/A# getIncludes returns list of 'include' 2N/A# return a reference to the list of event id's allowed for 2N/A return $
pkg->{
'allowed_types'};
2N/A print STDERR "no internal attributes defined for $id\n";
2N/A return bless {
'id' => $
id,
2N/A# getEntries returns a list of all entry references 2N/A return undef unless @{$
pkg->{
'entry'}};
2N/A print STDERR "$uniqueId{$idNo} and $id have the same id ($idNo)\n";
2N/A return bless {
'id' => $
id,
2N/A# putDef is called at the end of an <event></event> block, so 2N/A# it sees a completed object. 2N/A my $
obj =
shift;
# ref to xmlHandlers event object 2N/A return $
ref->{
'internalName'};
2N/A return shift->{
'title'};
2N/A return shift->{
'program'};
2N/A return shift->{
'see'};
2N/A return shift->{
'note'};
2N/A# this isn't fully implemented; just a skeleton 2N/A return bless {
'id' => $
id,
2N/A print STDERR "missing id for $class <msg>\n";
2N/A print STDERR "invalid tag in <msg_list> block: $class\n";
2N/A return bless {
'id' => $
id,
2N/A# destructive read of @msg... 2N/A print STDERR "missing id for $class <note>\n";
2N/A print STDERR "invalid tag in <note_list> block: $class\n";
2N/A return bless {
'id' => $
id,
2N/A# These aren't internal state because the callback functions don't 2N/A# have the object handle. 2N/A@
debug = ();
# stack for nesting debug state 2N/A my $
file =
shift;
# xml file to be parsed 2N/A # do not use register() for debug because register generates extra 2N/A return bless {
'xmlObj' => $
xml,
2N/A# local function -- register both the auditxml function and the 2N/A# xmlHandler callback 2N/A print "*** $callbackSource: $class", (
defined ($
id)) ?
"= $id\n" :
"\n";
2N/A print "*** $attribute = $attributes{$attribute}\n";
2N/A print "*** content = $content\n" if defined $
content;
2N/A print STDERR "no auditxml function defined for $class\n";
2N/A# getNextEvent reads from @event destructively. 'firstEvent' could 2N/A# be used to make a copy from which to read. 2N/A# returns all event ids 2N/A# returns event for id 2N/A# getNextToken reads from @token destructively. 'firstToken' could 2N/A# be used to make a copy from which to read. 2N/A# getNextMsgId reads from @msg_list destructively. 2N/A print STDERR "eventStart can't get a valid id\n";
2N/A print STDERR "event element is missing required id attribute\n";
2N/A#sub getInternalName { 2N/A# return $externalToInternal{$name}; 2N/A# my $id = $obj->getAttr('id'); 2N/A# print "include = $id\n" if $main::debug; 2N/A# print STDERR "include element is missing required id attribute\n"; 2N/A# $main::errExit = 3; 2N/A print STDERR "token element is missing required id attribute\n";
2N/A "msg_list element is missing required id attribute\n";
2N/A print STDERR "note_list \'$id\' already defined\n";
2N/A "note_list element is missing required id attribute\n";
2N/A# Service name was dropped during PSARC review 2N/A print STDERR "service $name is missing an id number\n";
2N/A print STDERR "service name missing for id = $id\n";
2N/A print STDERR "missing both name and id for a service entry\n";
2N/A# <debug set="on"> or <debug set="off"> or <debug> 2N/A# if the set attribute is omitted, debug state is toggled 2N/A# debugStart / debugEnd are used to insure debug state is 2N/A# scoped to the block between <debug> and </debug>