Contents Publish Package Interface Previous Next

PACKAGE_PUBLISH

The PACKAGE_PUBLISH CALL routine publishes the specified package. The method of publication depends on the following types of delivery transport:

Publish to an Archive

Publishes a package to an archive.

Syntax

CALL PACKAGE_PUBLISH(packageId, publishType, rc, properties,< propValue1, ...propValueN>);

packageID
Numeric, input.
Identifies the package that is to be published.

publishType
Character, input.
Indicates how to publish the package. To publish the package using the archive transport, specify TO_ARCHIVE.

rc
Numeric, output.
Receives a return code.

properties
Character, input.
Identifies a comma-separated list of optional property names. Specify any of the following property names, or specify '' to indicate that no properties are to be applied:

propValue1, ...propValueN
Character, input.
Specifies a value for each specified property name. The order of the property values must match the order of the property names in the properties parameter.

Details

The ARCHIVE_NAME property identifies the name of the archive file to create. If this property is omitted, the archive transport generates a unique name by default.

The ARCHIVE_PATH property identifies where the archive is created. This property can be a physical path name, an LDAP URL, an FTP URL, or an HTTP URL.

Note: In the OS/390 operating environment, an archive can be published only to UNIX System Services directories.

How to Specify an ARCHIVE_PATH

If ARCHIVE_PATH is an LDAP URL, it should represent the sasArchivePath distinguished name. The sasArchivePath entry within the LDAP directory contains a saspath attribute that is used to create the archive.

Furthermore, if an LDAP URL is specified and the LDAP server is running secured, you must specify the LDAP_BINDDN and LDAP_BINDPW properties (or bindname and password LDAP URL extensions) in order to bind to the LDAP server.

If ARCHIVE_PATH is an HTTP URL on a secured server, you must specify the HTTP_USER and HTTP_PASSWORD properties. Specifying the HTTP_PROXY_URL property is optional.

If ARCHIVE_PATH is an FTP URL on a secured host, you must specify the FTP_USER and FTP_PASSWORD properties.

Examples

Example 1

The following example creates the archive file named results in the /u/users directory.
pubType = "TO_ARCHIVE";
properties='archive_path, archive_name';
path = '/u/users';
name = 'results';
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, path, name);

Example 2

The following example specifies the archive path as an LDAP URL that is the SasArchivePath distinguished name. The sasArchivePath entry contains a saspath attribute, which identifies where the archive will be created. In this example, because archive_name is omitted, the archive transport generates a unique name automatically.

apath = "ldap://pcc.host.com:389/sasarchivepathcn=HrArchive,
         saschannelcn=HR,cn=saschannels,sasComponent=sasPublishSubscribe,
         cn=SAS,o=Alpine Airways,c=US";
pubType = "TO_ARCHIVE";
properties='archive_path';
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, apath);

Publish to E-mail

Publishes a package using the e-mail transport.

Syntax

CALL PACKAGE_PUBLISH(packageId, publishType, rc, properties, <propValue1, ...propValueN> , address1<, ...addressN>);

packageID
Numeric, input.
Identifies the package that is to be published.

publishType
Character, input.
Indicates how to publish the package. To publish the package using the e-mail transport, specify TO_EMAIL.

rc
Numeric, output.
Specifies a return code.

properties
Character, input.
Identifies a comma-separated list of optional property names. Specify any of the following property names, or specify '' to indicate that no properties are to be applied:

propValue1, ...propValueN
Specifies a value for each specified property name. The order of the property values must match the order of the property names in the properties parameter.

address1 <, ...addressN>
Character, input.
Specifies one or more e-mail addresses to use when publishing the package.

Details

Default Behavior

When publishing to e-mail, the e-mail message is sent in plain text format by default. Only inserted reference entries are published to e-mail. For details about inserting reference entries, see the INSERT_REF CALL routine.

The package description field precedes the reference value in the e-mail message. All other entries that are inserted into the package are ignored.

To override the default behavior, you can specify the ARCHIVE_PATH, COLLECTION_URL, PARENT_URL, TEXT_VIEWER_NAME, or VIEWER_NAME properties.

Note: If the mailer is not running in a Windows NT operating environment, you will be prompted for the mail profile to use when you send the e-mail message. To avoid being prompted, specify the EMAILID and EMAILPW options at SAS invocation. For example:

   sas -EMAILID "Microsoft Outlook"

Archive Path Properties

If you specify the ARCHIVE_PATH property, an archive is created and published as an e-mail attachment. All entries that are inserted into the package are published as an archive. If you specify a value for ARCHIVE_PATH, the created archive is stored at the designated location. To create a temporary archive that is deleted after the package is published, specify an ARCHIVE_PATH value of "" or "tempfile".

If you specify ARCHIVE_PATH as an LDAP URL, an FTP URL, or an HTTP URL, see How to Specify an ARCHIVE_PATH for details about archive properties.

Note: In order to create an archive under the OS/390 operating environment, the OS/390 environment must support UNIX System Services directories.

If you specify the PROCESS_VIEWER property (with either the VIEWER_NAME or TEXT_VIEWER_NAME property) along with the ARCHIVE_PATH property, the archive is created but is not sent as an attachment in e-mail. Instead, viewer processing occurs and the rendered view is sent in e-mail.

For more information about the application of viewer properties, see Viewer Processing.

When publishing to an archive with the e-mail transport, you can specify the following archive properties: ARCHIVE_NAME, ARCHIVE_PATH, FTP_PASSWORD, FTP_USER, HTTP_PASSWORD, HTTP_PROXY_URL, HTTP_USER, LDAP_BINDDN, or LDAP_BINDPW.

Viewer Properties

If you specify the VIEWER_NAME or TEXT_VIEWER_NAME property, the viewer is used to create the e-mail message and to apply substitutions. VIEWER_NAME renders the view in HTML format. TEXT_VIEWER_NAME renders the view in text format. Only the package information that is rendered by the viewer is published.

If you specify the PROCESS_VIEWER property (with either the VIEWER_NAME or TEXT_VIEWER_NAME property) along with the ARCHIVE_PATH property, the archive is created but is not sent as an attachment in e-mail. Instead, viewer processing occurs and the rendered view is sent in e-mail.

WebDAV Properties

If you specify the COLLECTION_URL property, the package is published to the specified URL on a WebDAV-compliant Web server. An example of a collection URL is http://www.host.com/AlpineAirways/revenue/quarter1. The collection is named quarter1. The e-mail message that is sent to subscribers will contain a reference to the URL that is specified in the COLLECTION_URL property.

The PARENT_URL property is similar to the COLLECTION_URL property except that it specifies the location under which the new WebDAV collection is to be placed. The PUBLISH_PACKAGE CALL routine generates a unique name for the new collection. The unique name is limited to eight characters, with the first character as an s. An example of a parent URL directory location is http://www.host.com/AlpineAirways/revenue. An example of a collection name that is automatically generated might be s9811239. The e-mail message contains a reference to the collection, which is URL that you specified in the PARENT_URL property.

The specifications of COLLECTION_URL and PARENT_URL are mutually exclusive.

When publishing to a WebDAV-compliant server with the e-mail transport, you can specify the following WebDAV properties: HTTP_PASSWORD, HTTP_PROXY_URL, HTTP_USER, IF_EXISTS, TARGET_VIEW_MIMETYPE, TARGET_VIEW_NAME, and VIEWER_NAME (or TEXT_VIEWER_NAME).

WebDAV publishing uses the following file extensions for each item type:

Item Type File Extension
CATALOG .sac
DATA .sad
FDB .saf
MDDB .sam
VIEW .sav

Examples

Example 1

The following example publishes a package to three e-mail addresses. Because no properties are specified, the e-mail message will contain only inserted references and will be published in plain text format.
pubType = "TO_EMAIL";
properties='';
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties,
                     "user1@alpineairways.com", "John Smith",
                     "jsmith@alpineairways.com");

Example 2

The following example publishes a package to one e-mail address and designates text for the subject line of the message:
pubType = "TO_EMAIL";
subject = "Nightly Builds Update";
properties="SUBJECT";
Addr = "admins-l@alpineair03.vm.com";
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, subject, Addr);

Example 3

The following example publishes a package to two e-mail addresses and designates the viewer to be used when formatting the e-mail message. The e-mail message will contain only content that can be rendered in a view. The rendered view is deleted after it is published.

In order to save the rendered view explicitly, you can specify the APPLIED_VIEWER_NAME property and a file name value.
pubType = "TO_EMAIL";
properties="SUBJECT, VIEWER_NAME";
subject = "Nightly Build Updates";
viewer = "filename:template.html";
Addr = "admins-l@alpineair03.vm.com";
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, subject, viewer, 
                     "buildmonitor@alpineairways.com", Addr);

Example 4

The following example uses the ARCHIVE_PATH property to publish an archive as an e-mail attachment. All entries in the package are contained within the archive.
pubType = "TO_EMAIL";
properties="ARCHIVE_PATH";
apath = "/u/users1";
Addr = "admins-l@alpineair05";
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, apath, Addr);

Example 5

The following example uses the e-mail transport to publish a collection URL on a WebDAV-compliant server. The HTTP userid and password enable the publisher to bind to the secured HTTP server. All e-mail recipients who are members of the mail list receive the e-mail announcement that the best rates are accessible at the specified URL.

pubType = "TO_EMAIL";
properties="COLLECTION_URL, SUBJECT", "HTTP_USER", "HTTP_PASSWORD";
collurl="http://www.alpineairways/fares/discount";
subj="Announcing Best Rates Yet";
http_user="vicdamone";
http_password="myway";
Addr = "admins-l@alpineair05";
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, collurl, subj, 
       http_user, http_password, Addr);

Example 6

The following example specifies e-mail addresses that are stored in a variable in a password-protected SAS data set.

pubType = "TO_EMAIL";
properties = "SUBJECT, ADDRESS_DATASET_LIBNAME, ADDRESS_DATASET_MEMNAME,
                     ADDRESSLIST_VARIABLENAME, DATASET_OPTIONS";
subject = "Get out and Vote!";
lib = "voterreg";
mem = "northeast";
var = "emailaddr";
opt = "pw='born2run'";
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, subject, lib, 
                     mem, var, opt);

Publish to Queues

Publishes a package to one or more message queues.

Syntax

CALL PACKAGE_PUBLISH(packageId, publishType, rc, properties, <propValue1, ...propValueN>, queue1<, ...queueN>);

packageID
Numeric, input.
Identifies the package that is to be published.

publishType
Character, input.
Indicates how to publish the package. To publish the package using the queue transport, specify a publishType of TO_QUEUE.
rc
Numeric, output.
Receives a return code.

properties
Character, input.
Identifies a comma-separated list of optional property names. Specify any of the following property names, or specify '' to indicate that no properties are to be applied:

propValue1, ...propValueN
Character/numeric, input.
Specifies one value for each specified property name. The order of the property values must match the order of the property names in the properties parameter.

queue1 <, ...queueN>
Character string that specifies the queue(s) that will be used to publish the package. Specify the queue name using the following syntax:

When publising to MSMQ queues, use the following syntax:
MSMQ://queueHostMachineName\queueName
When publishing to MQSeries queues, use the following syntax:
MQSERIES://queueManager:queueName
or
MQSERIES-C://queueManager:queueName

Details

When publishing to a queue, all entries in the package are published to the queue by default. To override this default, specify the ARCHIVE_PATH property, which indicates that an archive is to be created and only the archive will be published to the queue. The archive will contain all package entries.

If you specify a value for ARCHIVE_PATH, the archive is stored at the designated location. To create a temporary archive that is deleted after the package is published, specify an ARCHIVE_PATH value of "" or "tempfile".

If you specify ARCHIVE_PATH as an LDAP URL, an FTP URL, or an HTTP URL, see How to Specify ARCHIVE_PATH for details about specifying archive properties.

Note: In the OS/390 operating environment, you can publish archives only to UNIX System Services directories.

Queues that support transactional units of work are recommended. By using these types of queues, the queue transport prevents partial packages from remaining on the queue in cases where errors are encountered during package publishing. For MSMQ, this means that the queue should be transactional. For MQSeries, this means that the queue should support synchronization points.

When you specify the CORRELATIONID property, the package message uses the specified CORRELATIONID value. You can retrieve packages can be retrieved from the queue by correlation ID.

Examples

Example 1

The following example publishes a package to two queues. One queue is an MQSeries queue that is named PCONE; the second queue is an MSMQ queue that is specified by the queue manager who is named JSMITH. A CORRELATIONID of 12345678901234567890 is assigned to the package to be published to both queues.

PubType = "TO_QUEUE";
FirstQ = "MQSERIES://PCONE:LOCAL";
SecondQ = "MSMQ://JSMITH:TRANSQ";
CorrValue = "12345678901234567890";
Call PACKAGE_PUBLISH(packageId, pubType, rc, "CORRELATIONID",
                     CorrValue, firstQ, secondQ);

Example 2

The following example publishes the package to one queue and does not apply any additional queue properties:

pubType = "TO_QUEUE";
firstQ = "MQSERIES://PCONE:MYQ";
Call PACKAGE_PUBLISH(packageId, pubType, rc, '', firstQ);

Example 3

The following example creates an archive and publishes it to a queue. The ARCHIVE_PATH property is specified as "tempfile". After the archive is published to the queue, the temporary, local copy is deleted automatically. The archive contains all entries that are inserted into the package.

pubType = "TO_QUEUE";
firstQ = "MQSERIES://PCONE:MYQ";
prop = "ARCHIVE_PATH";
archivePath = "tempfile";
Call PACKAGE_PUBLISH(packageId, pubType, rc, prop, archivePath, firstQ);

Publish to Subscribers

Publishes a package to subscribers who are associated with specified channel.

Syntax

CALL PACKAGE_PUBLISH(packageId, publishType, rc, properties, < propValue1, ...propValueN>, channel);

packageID
Numeric, input.
Identifies the package that is to be published.

publishType
Character, input.
Indicates how to publish the package. To publish a package to the subscribers of a channel, specify a publishType value of TO_SUBSCRIBERS.
rc
Numeric, output.
Receives a return code.

properties
Character, input.
Identifies a comma-separated list of optional property names. Specify any of the following property names, or specify '' to indicate that no properties are to be applied:

propValue1, ...propValueN
Character/Numeric, input.
Specifies one value for each specified property name. The order of the property values must match the order of the property names in the properties parameter.

channel
Character, input.
Specifies the name of the LDAP repository that contains the list of subscribers to whom the package will be published.

Details

When a package is published to a channel, the package is published to each subscriber of the channel. Each subscriber's LDAP entry contains an attribute that specifies the specified publishing transport method: e-mail, message queue, or none.

For details about defining LDAP entries for channels and subscribers, see the documentation for SAS Integration Technologies Administrator.

Subscribers can use the SAS Subscription Manager application to subscribe to channels and to filter the packages and entries that are published to them. Name/value filters set criteria for packages and package entries. MIME-type filters set criteria for package entries that are based on file type.

The mimeType parameter is case-insensitive when the sasFileMIMETypeInclusionFilter and the sasFileMIMETypeExclusionFilter LDAP attributes are applied to LDAP subscribers as package entry filters.

Refer to Filtering Packages and Package Entries for details.

When publishing to subscribers, the PACKAGE_PUBLISH CALL routine ensures that the package is published to each subscriber only once, thus eliminating any duplication. When the delivery transport is a message queue, the sasQueueName attribute is used as the key to enforce uniqueness. When the delivery transport is e-mail, the sasemailaddress attribute is used as the key to enforce uniqueness.

Default Properties

For channel subscribers who specify an e-mail delivery transport, the default action is to publish the e-mail message in plain text format. Only inserted references are published to the e-mail subscriber.

See the INSERT_REF CALL routine for details.

The package description field precedes the reference value in the e-mail message.

All other inserted entries are ignored.

For channel subscribers who specify a queue delivery transport, the default action is to publish all inserted entries to the queue.

Viewer Properties

To override the default e-mail behavior, you can specify the VIEWER_NAME or TEXT_VIEWER_NAME property on the PACKAGE_PUBLISH CALL routine. The specified viewer is used to create the content of the e-mail message and to apply substitutions. If you specify VIEWER_NAME, the e-mail message is published in HTML format. If you specify TEXT_VIEWER_NAME, the e-mail message is published in text format. Only the package information that is rendered by the viewer is published.

Subscribers can also use the sasEmailFormat LDAP attribute to indicate whether they want to receive the e-mail message in HTML format or text format. If no attribute is found when you specify the VIEWER_NAME, the message is published in HTML format by default. If the subscriber specifies text format, the viewer is notused. Instead the subscriber receives reference entries only.

Refer to Viewer Processing for more information.

The VIEWER_NAME and TEXT_VIEWER_NAME properties are ignored by the queue and archive transports.

If you specify the VIEWER_NAME or TEXT_VIEWER_NAME property with the COLLECTION_URL or PARENT_URL property, the e-mail message will contain a reference to a URL. The specified viewer is used to create a rendered view that is named index.html. To override the default name that is assigned to the rendered view, use the TARGET_VIEW_NAME or TARGET_VIEW_MIMETYPE, as appropriate, to specify a file name for the rendered view.

The package is published to a WebDAV-compliant server. For channel subscribers who specify an e-mail delivery transport, the default action is to notify subscribers of the URL of the published package. For channel subscribers who specify a message queue delivery transport, no notification is given to indicate the package's availability on the Web.

Archive Path Property

When publishing to subscribers, the ARCHIVE_PATH property indicates that an archive is to be created at the specified path and that only the archive is to be published to the subscribers. To use the channel's default archive path, you must include this property and leave the value blank.

Subscribers can use the sasArchiveReceiveBy LDAP attribute to indicate whether they want to receive the archive by value or by reference. If no attribute is specified, the default is to publish the archive by value.

For details about defining channels with the sasArchivePath attributes, see documentation for SAS Integration Technologies Administrator.

For channel subscribers who specify e-mail as the delivery transport, the created archive is included as an attachment to the e-mail message. For channel subscribers who specify a queue delivery transport, the created archive is published to the queue.

If you specify the PROCESS_VIEWER property with the ARCHIVE_PATH property, the archive is created but is not sent as an attachment in e-mail. Instead, viewer processing occurs and the rendered view is sent in e-mail.

The ARCHIVE_PATH property identifies where the archive is created. This property can be a physical path name, an LDAP URL, an FTP URL, or an HTTP URL.

If you specify an LDAP URL, it should be the sasArchivePath distinguished name. The sasArchivePath entry within the LDAP directory will contain a saspath attribute, which is used to create the archive.

If the LDAP server is running secured, you must specify the LDAP_BINDDN and LDAP_BINDPW properties (or bindname and password LDAP URL extensions) in order to provide the information that is needed to bind to the LDAP server. In addition, if the ARCHIVE_PATH is an LDAP URL, the created archive is cataloged in LDAP as a sasArchive entry. The sasArchive entry is a child of the specified sasArchivePath entry.

If the ARCHIVE_PATH property value is blank, and the sasArchivePathCn attribute is specified in the sasChannel entry, an archive name is automatically generated. The archive is cataloged under the specified sasArchivePath.

If ARCHIVE_PATH is an HTTP URL on a secured server, you must specify the HTTP_USER and HTTP_PASSWORD properties. Specifying the HTTP_PROXY_URL property is optional.

If ARCHIVE_PATH is an FTP URL on a secured host, you must specify the FTP_USER and FTP_PASSWORD properties.

If you specify both the ARCHIVE_PATH and either the VIEWER_NAME or TEXT_VIEWER_NAME properties, the viewer property is ignored.

Note: In order to create an archive under the OS/390 operating environment, the OS/390 environment must support UNIX System Services directories.

WebDAV Properties

If you specify the COLLECTION_URL or PARENT_URL property, the package is published as a WebDAV collection to a WebDAV-compliant Web server. The PARENT_URL property is similar to the COLLECTION_URL property except that it specifies only the location under which the new WebDAV collection is to be placed. For COLLECTION_URL, you specify the full path and an explicit collection name. For PARENT_URL, you specify only the full path and a unique name is assigned to the collection automatically.

Subscribers to channels who specify an e-mail delivery transport are notified about the availability of the new collection. The e-mail message contains a reference to the value of the COLLECTION_URL or PARENT_URL property, which specifies the URL to which the collection is published. For channel subscribers who specify a message queue delivery transport, no notification is given to announce the collection's availability.

The COLLECTION_URL (or PARENT_URL) property and the ARCHIVE_PATH property are mutually exclusive.

When publishing to a WebDAV-compliant server with the COLLECTION_URL or PARENT_URL properties, you can specify the following WebDAV properties: HTTP_PASSWORD, HTTP_PROXY_URL, HTTP_USER, IF_EXISTS, TARGET_VIEW_MIMETYPE, TARGET_VIEW_NAME, and VIEWER_NAME (or TEXT_VIEWER_NAME).

WebDAV publishing uses the following file extensions for each item type:

Item Type File Extension
CATALOG .sac
DATA .sad
FDB .saf
MDDB .sam
VIEW .sav

Examples

Example 1

The following example publishes the specified package to all subscribers of the WeeklyPayroll channel. The LDAP server on ALPAIR02 will be searched for the stored channel and subscriber information. The LDAP server is using port 8010, and the base of 'o=Alpine Airways, c=US' is to be used during the search. If the bindname contains commas or question marks, you must replace them with a percent sign followed by their ASCII hexadecimal values. This example replaces the commas in the bindname field with the hexadecimal value of %2c.
pubType = "TO_SUBSCRIBERS";
props='CHANNEL_STORE';
storeInfo = "LDAP://alpair02.unx.com:8010/o=Alpine Airways,c=US
            ????bindname=cn=John Smith%2c o=Alpine Airways%2c c=US,
            password=JSmith3";
channel = 'WeeklyPayroll';
CALL PACKAGE_PUBLISH(packageId, pubType, rc, props, storeInfo, channel);

Example 2

The following publishes the package to all subscribers of the HR channel. The subject property is specified so that all e-mail subscribers will receive the message with the specified subject.
pubType = "TO_SUBSCRIBERS";
storeInfo = "LDAP://alpair02.unx.com:8010/o=Alpine Airways,c=US";
channel = 'HR';
property = "SUBJECT, CHANNEL_STORE";
subject = "Weekly HR Updates:"
CALL PACKAGE_PUBLISH(packageId, "TO_SUBSCRIBERS", rc, property, subject,
                     storeInfo, channel);

Publish to a WebDAV-Compliant Server

Publishes a package to a WebDAV-compliant server.

Syntax

CALL PACKAGE_PUBLISH(packageId, publishType, rc, properties,< propValue1, ...propValueN>, channel);
packageID
Numeric, input.
Identifies the package that is to be published.

publishType
Character, input.
Indicates how to publish the package. To publish the package using the WebDAV transport, specify a publishType of TO_WEBDAV.
rc
Numeric, output.
Receives a return code.

properties
Character, input.
Identifies a comma-separated list of optional property names. Specify any of the following property names, or specify '' to indicate that no properties are to be applied:

propValue1, ...propValueN
Character/Numeric, input.
Specifies one value for each specified property name. The order of the property values must match the order of the property names in the properties parameter.

Details

Publishing with a publishType of TO_WEBDAV publishes a package to a specified URL on a WebDAV-compliant server. WebDAV servers enable distributed authoring and versioning, which enables collaborative development of Web files on remote servers.

The WebDAV transport stores package entries as members of a collection.

If you specify the COLLECTION_URL property, the package is published to the specified URL on a WebDAV-compliant Web server. An example of a collection URL is http://www.host.com/AlpineAirways/revenue/quarter1. The collection is named quarter1.

The PARENT_URL property is similar to the COLLECTION_URL property except that it specifies the location under which the new WebDAV collection is to be placed. The PUBLISH_PACKAGE CALL routine generates a unique name for the new collection. The unique name is limited to eight characters with the first character as an s. An example of a parent URL directory location is http://www.host.com/AlpineAirways/revenue. An example of a collection name that is automatically generated might be s9811239.

The specifications of the COLLECTION_URL property and the PARENT_URL property are mutually exclusive.

To control the treatment of same-named collections already existing on the server, use the IF_EXISTS property. The character string "noreplace" in this property indicates that if the package being published contains a collection that already exists, the PUBLISH_PACKAGE call is to return immediately without affecting the contents of the existing collection. The string "update" indicates that if the collection already exists on the server, the PUBLISH_PACKAGE call is to update the existing collection by replacing like-named entities and adding newly named entities. If "update" is specified and both the package to publish and the existing collection have an HTML set (created with INSERT_HTML) with the same NESTED_NAME, the HTML set in the published package replaces the HTML set in the existing collection. Note: When names are generated automatically for HTML set collections, the publish code ensures that name collisions will not occur.

To announce the availability of new WebDAV collections on WebDAV-compliant servers, use a publishType of TO_SUBSCRIBERS or TO_EMAIL.

If you specify the VIEWER_NAME property with the COLLECTION_URL or PARENT_URL property, the view is rendered in HTML format. If you specify the TEXT_VIEWER_NAME with the COLLECTION_URL or PARENT_URL properties, the view is rendered in text format.

The specified viewer is used to create a rendered view that is named index.html. To override the default name that is assigned to the rendered view, use the APPLIED_VIEWER_NAME or APPLIED_TEXT_VIEWER_NAME, as appropriate, to specify a file name for the rendered view.

WebDAV publishing uses the following file extensions for each item type:

Item Type File Extension
CATALOG .sac
DATA .sad
FDB .saf
MDDB .sam
VIEW .sav

Applying a Name/Value Pair to a Package and a Package Item

When publishing to a WebDAV-compliant server, optionally specified name/value pairs are transmitted to the WebDAV server in XML format. XML format requires that the name portion of the name/value pair specification follow these conventions:

If a namespace is associated with the name portion of a name/value pair, the name can also include a colon (:). For details about the NAMESPACE property, see PACKAGE_BEGIN.

For details about specifying the nameValue parameter for an entire package, see PACKAGE_BEGIN. For details about specifying the nameValue parameter for a single package item, see the applicable INSERT_item CALL routine, where item can be any of the following:

Examples

Example 1

The following example publishes a package to the specified URL:
rc = 0;
pubType = "TO_WEBDAV";
subject = "Nightly Maintenance Report";
properties="COLLECTION_URL";
cUrl = "http://www.alpair.web/NightlyMaintReport";
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, cUrl);

Example 2

The following example publishes a package to a URL via the specified proxy server using the specified credentials:
rc = 0;
pubType = "TO_WEBDAV";
properties="COLLECTION_URL,HTTP_PROXY_URL,IF_EXISTS,HTTP_USER,HTTP_PASSWORD";
cUrl = "http://www.alpair.secureweb/NightlyMaintReport";
pUrl = "http://www.alpair.proxy:8000/";
exists = "replace";
user = "JohnSmith";
password = "secret";
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, cUrl, pUrl,  exists,
user, password);

Example 3

The following example uses the e-mail transport to publish a collection URL on a WebDAV-compliant server. The HTTP userid and password enable the publisher to bind to the secured HTTP server. All e-mail recipients who are members of the mail list receive the e-mail announcement that the best rates are accessible at the specified URL.

pubType = "TO_EMAIL";
properties="COLLECTION_URL, SUBJECT";
collurl="http://www.alpineairways/fares/discount.html";
subj="Announcing Best Rates Yet";
http_user="vicdamone";
http_password="myway";
Addr = "admins-l@alpineair05";
CALL PACKAGE_PUBLISH(packageId, pubType, rc, properties, collurl, subj, 
       http_user, http_password, Addr);

Transport Properties

Valid property values are defined as follows:
ADDRESSLIST_DATASET_LIBNAME
an alternative to specifying explicit e-mail addresses, specifies a character string that indicates the name of the SAS library in which resides the data set from which an e-mail list can be extracted. (Applies to the following transport: e-mail.)

ADDRESSLIST_DATASET_MEMNAME
an alternative to specifying explicit e-mail addresses, specifies a character string that indicates the name of the SAS member in which resides the data set from which an e-mail list can be extracted. The data set is fully specified by library.member. (Applies to the following transport: e-mail.)

ADDRESSLIST_VARIABLE_NAME
specifies a character string that indicates the name of the variable (or column) in the data set that contains the e-mail addresses. (Applies to the following transports: e-mail.)

APPLIED_TEXT_VIEWER_NAME
specifies a character string that names the rendered package view, which results from the application of the text viewer template to the package for viewing in e-mail. You can use the following syntax to specify the name of the rendered package view:
  • FILENAME: external_filename
  • FILEREF: sas_fileref
This property is valid only when the TEXT_VIEWER_NAME property is also specified. By default, the rendered view is created as a temporary file. This property overrides the default, causing the rendered view to be saved permanently to a file. (Applies to the following transports: e-mail, subscriber.)

APPLIED_VIEWER_NAME
specifies a character string that indicates the name of the rendered package view, which results from the application of the HTML viewer template to the package for viewing in e-mail. You can use the following syntax to specify the name of the rendered package view:
  • FILENAME: external_filename
  • FILEREF: sas_fileref
This property is valid only when the VIEWER_NAME property is also specified. By default, the rendered view is created as a temporary file. This property overrides the default, causing the rendered view to be saved permanently to a file. (Applies to the following transports: e-mail, subscriber.)

ARCHIVE_NAME
specifies a character string that indicates the name of the archive file. (Applies to the following transports: archive, e-mail, queue, subscriber.)

ARCHIVE_PATH
specifies a character string that indicates the path where the archive should be created. (Applies to the following transports: archive, e-mail, queue, subscriber.)

CHANNEL_STORE
specifies a character string that indicates the location of channel and subscriber authentication information. See LDAP Channel Store Syntax for details. (Applies to this transport: subscriber.)

COLLECTION_URL
specifies a character string that indicates the URL in which the WebDAV collection is placed. You assign an explicit file name to the collection. (Applies to the following transports: e-mail, subscriber, WebDAV.)

CORRELATIONID
specifies a binary character string correlator that is used on the package header message. (Applies to the following transports: queue, subscriber.)

DATASET_OPTIONS
specifies a character string that indicates the options to use for opening and accessing a SAS data set that contains e-mail addresses that are used to populate addressn. Specify this property as option1=value option2=value .... For a complete list of data set options, see the SAS Data Set Options topic in the SAS Online Help, Release 8.2 . (Applies to the following transports: e-mail, subscriber.)

FROM
specifies a character string that indicates the sender (or package publisher) of the e-mail message. (Applies to the following transports: e-mail, subscriber.)

Note: The FROM field is valid only with the SMTP e-mail interface.

FTP_PASSWORD
indicates the password that is needed to log on to the remote host at which the archive will be stored. Specify this property only when the remote host is secured. (Applies to the following transports: archive, e-mail, queue, subscriber.)

FTP_USER
indicates the user ID that is needed to log on to the remote host at which the archive will be stored. Specify this property only when the remote host is secured. (Applies to the following transports: archive, e-mail, queue, subscriber.)

HTTP_PASSWORD
Indicates the password that is needed to bind to the Web server on which the package is published. Specify this property only when the Web server is secured. (Applies to the following transports: archive, e-mail, queue, subscriber, WebDAV.)

HTTP_PROXY_URL
indicates the URL of the proxy server. (Applies to the following transports: archive, e-mail, queue, subscriber, WebDAV.)

HTTP_USER
indicates the user ID that is needed to bind to the Web server on which the package is published. Specify this property only when the Web server is secured. (Applies to the following transports: archive, e-mail, queue, subscriber, WebDAV.)

IF_EXISTS
specifies one of the character strings "noreplace" or "update". The string "noreplace" indicates that if the package being published contains a collection that already exists on the server, the PUBLISH_PACKAGE call is to return immediately without affecting the contents of the existing collection. The string "update" indicates that if the collection already exists on the server, the PUBLISH_PACKAGE call is to update the existing collection by replacing like-named entities and adding newly named entities. If "update" is specified and both the package to publish and the existing collection have an HTML set (created with INSERT_HTML) with the same NESTED_NAME, the HTML set in the published package replaces the HTML set in the existing collection.

LDAP_BINDDN
specifies a character string that indicates the distinguished name that is used to bind to the LDAP server. Specify this property only when the ARCHIVE_PATH is an LDAP URL and when the LDAP server is running secured. (Applies to the following transports: archive, e-mail, queue, subscriber.)

LDAP_BINDPW
specifies a character string that indicates the password that is used to bind to the LDAP server. Specify this property only when the ARCHIVE_PATH is an LDAP URL and when the LDAP server is running secured. (Applies to the following transports: archive, e-mail, queue, subscriber.)

PARENT_URL
specifies a character string that indicates the URL under which the WebDAV collection is placed. The collection is automatically assigned a unique name. (Applies to the following transports: archive, e-mail, subscriber, WebDAV.)

PROCESS_VIEWER
specifies a character string of "yes" to indicate that the rendered view will be delivered in e-mail. If you specify the PROCESS_VIEWER property with the ARCHIVE_PATH property, the archive is created but is not sent as an attachment in e-mail. Instead, viewer processing occurs and the rendered view is sent in e-mail. (Applies to the following transports: e-mail, subscriber.)

REPLYTO
specifies a character string that indicates the designated e-mail address to which package recipients might respond. (Applies to the following transports: e-mail, subscriber.)

Note: The REPLYTO field is valid only with the SMTP e-mail interface.

SUBJECT
specifies a character string that provides the subject line for the e-mail message. (Applies to the following transports: e-mail, subscriber.)

TARGET_VIEW_NAME
specifies a character string that indicates the name of the rendered view for delivery to a WebDAV-compliant server. The specified target view name overrides the default name, which is index.html. (Applies to the following transports: e-mail, subscriber, WebDAV.)

TARGET_VIEW_MIMETYPE
specifies a character string that indicates the MIME type of the rendered view for delivery to a WebDAV-compliant server. The target view mimetype overrides the default view mimetype, which is automatically inferred from the viewer. Typical MIME types are HTML (.htm) and plain text (.txt) files. If this field remains blank, the viewer filename extension is used to locate the MIME type in the appropriate registry. Windows hosts use the Windows Registry; other hosts use the SAS Registry. (Applies to the following transports: e-mail, subscriber, WebDAV.)

TEXT_VIEWER_NAME
specifies a character string that indicates the name of a text viewer template that formats package content for viewing in e-mail using the following syntax:
  • FILENAME: external_filename
  • FILEREF: sas_fileref

A text viewer template might be necessary if the destination e-mail program does not support the HTML MIME type. (Applies to the following transports: e-mail, subscriber, WebDAV.)

See Viewer Processing for more information.

UUID
specifies a character string that serves as a unique ID, which is assigned to the sasGUID attribute of the sasArchive instance. The UUID identifies a package that is published to an archive at an LDAP URL. (Applies to the following transports: archive, e-mail, queue, subscriber.)

VIEWER_NAME
specifies a character string that indicates the name of the HTML viewer template to be applied when publishing e-mail using the following syntax:
  • FILENAME: external_filename
  • FILEREF: sas_fileref
(Applies to the following transports: e-mail, channel, WebDAV.)

See Viewer Processing for more information.

Contents Publish Package Interface Previous Next