XML Specification for SASPackage Events

Sample Code

Implicitly generated events (SASPackage events) are published by using well-formed XML documents whose details are generated as a result of the package publishing process.
In the following example, the published package contains each entry type: SAS catalog, SAS data set, external file, MDDB, HTML file, file reference, SQL view, viewer, and nested package.
<?xml version="1.0" encoding="UTF-8">
<sas-event:Event
   xmlns:sas-event=
   "http://support.sas.com/xml/namespace/services.events-1.1"
   sas-event:name="SASPackage.ChannelName">
   <sas-event:Header>
      <sas-event:Version>1.0</sas-event:Version>
      <sas-event:SentAt>timestamp</sas-event:SentAt>
   </sas-event:Header>
   <sas-event:Body>
      <sas-publish:Package
         xmlns:sas-publish=
         "http://support.sas.com/xml/namespace/services.publish-1.1"
        
xmlns:userSpecPkgNamespace="userSpecPkgNamespaceValue"
         sas-publish:version="1.0"
         sas-publish:packageUrl="URL to saved package"
         sas-publish:description="package description"
         sas-publish:abstract="package abstract"
         sas-publish:channel="channel on which the package was
published"
            userSpecName="value">
         <sas-publish:Entries>
            <sas-publish:Entry sas-publish:type="catalog"
               sas-publish:description="description"
               userSpecName="value">
               <sas-publish:Catalog
                  sas-publish:name="member name"/>
            </sas-publish:Entry>
            <sas-publish:Entry sas-publish:type="dataset"
               sas-publish:description="description"
               userSpecName="value">
               <sas-publish:Dataset
                  sas-publish:name="member name"/>
            </sas-publish:Entry>
            <sas-publish:Entry sas-publish:type="file"
               sas-publish:description="description"
               userSpecName="value">
               <sas-publish:File
                  sas-publish:type="text or binary"
                  sas-publish:name="file name"
                  sas-publish:mimetype="MIME type"/>
            </sas-publish:Entry>
            <sas-publish:Entry sas-publish:type="html"
               sas-publish:description="description"
               userSpecName="value">
               <sas-publish:HTML
                  sas-publish:type="body, frame, contents or
page"
                  sas-publish:name="file name"
                  sas-publish:url="URL"/>
                     <sas-publish:Companion
                        sas-publish:name="file name"
                        sas-publish:url="URL"
                        sas-publish:mimetype="MIME
type"/>
            </sas-publish:Entry>
            <sas-publish:Entry sas-publish:type="mddb"
               sas-publish:description="description"
               userSpecName="value">
               <sas-publish:MDDB
                  sas-publish:name="member name"/>
            </sas-publish:Entry>
            <sas-publish:Entry
               sas-publish:type="reference"
               sas-publish:description="description"
               userSpecName="value">
               <sas-publish:Reference
                  sas-publish:type="html or url"
                  sas-publish:reference="reference"/>
            </sas-publish:Entry>
            <sas-publish:Entry
               sas-publish:type="sqlview"
               sas-publish:description="description"
               userSpecName="value">
               <sas-publish:SQLview
                  sas-publish:name="member name"/>
            </sas-publish:Entry>
            <sas-publish:Entry
               sas-publish:type="viewer"
               sas-publish:description="description"
               userSpecName="value">
               <sas-publish:Viewer
                  sas-publish:type="text or html"
                  sas-publish:name="file name"
                  sas-publish:mimetype="MIME type"/>
            </sas-publish:Entry>
            <sas-publish:Entry
               sas-publish:type="nestedpackage"
               sas-publish:description="description"
               userSpecName="value">
               <sas-publish:Package
                  xmlns:userSpecPackageNamespace=
                  "userSpecPackageNamespaceValue"
                  sas-publish:description="package
description"
                  sas-publish:abstract="package abstract"
                  userSpecName="value" >
                  <sas-publish:Entries>
                     <sas-publish:Entry
                        sas-publish:type="entry type"
                       
sas-publish:description="description"
                        userSpecName="value">
                     </sas-publish:Entry>
                        .
                        .
                     additional Entry elements for this nested
package
                        .
                        .
                  </sas-publish:Entries>
               </sas-publish:Package>
            </sas-publish:Entry>
         </sas-publish:Entries/>
      </sas-publish:Package>
   </sas-event:Body>
</sas-event:Event>

Header Elements

The header elements are standard event elements. The event name is specified as:
"SASPackage.ChannelName"
The following table explains the header elements:
Header Elements
Element
Description
Version
Specifies the version of the event message.
SentAt
Is a timestamp that specifies when the event was sent.

Body Elements

The following table explains the body elements:
Body Elements
Element
Description
Package
Begins the package definition. The following attributes are supported for this element:
version
the version of SASPackage.
packageUrl
URL to saved package.
description
the package description.
abstract
the package abstract.
channel
the channel that the package was published to.
packageUrl
a URL to the saved package. Packages are saved to an archive or to a WebDAV server.
user-specified
one or more user-specified name/value pairs.
The sas-publish namespace is defined in this element. Also, other user-specified namespaces can be declared in this element via the xmlns: prefix. These will be included if the user specified the NAMESPACES property when creating the package.
Entries
Defines the entries that are contained within the package.
Entry
Defines an individual package entry. This element contains the required attribute, type. This attribute identifies the type of entry. Valid types include catalog, dataset, file, html, mddb, reference, sqlview, viewer, and nestedpackage.
If the entry description was specified at publish time, the description attribute will be included. If a name/value is specified for the entry, one or more user-specified name/value attributes are included in the element. The name portion of the name/value specification is provided as the attribute, and the value portion is provided as the attribute value.
Catalog
Defines an individual catalog entry. The required name attribute provides the catalog member name.
Dataset
Defines an individual data set entry. The required name attribute provides the data set member name.
File
Defines an individual file entry. The name and type attributes are required. They provide the filename and the file type. Valid file types include text or binary. The user-specified MIME type of the file entry will be provided in the mimetype attribute.
HTML
Defines an individual HTML entry. The required type and name attributes identify the type of HTML file and its filename. Valid types include body, fname, contents, and page. The url attribute identifies the URL.
Companion
Defines an individual companion file in an HTML entry. The required name attribute identifies name of the file. The url and mimetype attributes can be provided. They identify the URL and the MIME type of the file, respectively.
MDDB
Defines an individual MDDB entry. The required name attribute provides the MDDB member name.
Reference
Defines an individual reference entry. The required type attribute identifies the type of reference, either html or url. The actual reference that is inserted into the package is provided in the reference attribute.
SQLview
Defines an individual SQL view. The required name attribute provides the SQL view member name.
Viewer
Defines an individual viewer entry. The viewer type is provided in the type attribute. Valid types include text or html. The name attribute identifies the name of the viewer file. The user-specified MIME type for the viewer entry will be provided in the mimetype attribute.