Skip to content

CAP Processor resource

Niklas Spanring edited this page Oct 17, 2016 · 1 revision

Table of Contents

resourceBlock

The resourceBlock Class initializes the resource part of a CAP

(1) Refers to an additional file with supplemental information related to this <info></info> element; e.g., an image or audio file. (2) Multiple instances MAY occur within an <info></info> block.

  var $resourceDesc&#59;
  var $mimeType&#59;
  var $size&#59;
  var $uri&#59;
  var $derefUri&#59;
  var $digest&#59;
  $resource &#61; $info&#45;&amp;gt&#59;addResource()&#59;

getResourceDesc()

returns the ResourceDesc

The text describing the type and content of the resource file (REQUIRED)
The human&amp;&#35;45&#59;readable text describing the type and content, such as “map” or “photo”, of the resource file.
  $resource&#45;&amp;gt&#59;getResourceDesc()&#59;

setResourceDesc($val)

sets the value of the ResourceDesc

The text describing the type and content of the resource file (REQUIRED)
The human&amp;&#35;45&#59;readable text describing the type and content, such as “map” or “photo”, of the resource file.
  $resource&#45;&amp;gt&#59;setResourceDesc(&#39;RESOURCE_DESC&#39;)&#59;

getMimeType()

returns the MimeType

The identifier of the MIME content type and sub&amp;&#35;45&#59;type describing the resource file (REQUIRED)
MIME content type and sub&amp;&#35;45&#59;type as described in &amp;&#35;91&#59;RFC 2046&amp;&#35;93&#59;. 
(As of this document, the current IANA registered MIME types are listed at http&amp;&#35;58&#59;//www.iana.org/assignments/media&amp;&#35;45&#59;types/)
  $resource&#45;&amp;gt&#59;getMimeType()&#59;

setMimeType($val)

sets the value of the MimeType

The identifier of the MIME content type and sub&amp;&#35;45&#59;type describing the resource file (REQUIRED)
MIME content type and sub&amp;&#35;45&#59;type as described in &amp;&#35;91&#59;RFC 2046&amp;&#35;93&#59;. 
(As of this document, the current IANA registered MIME types are listed at http&amp;&#35;58&#59;//www.iana.org/assignments/media&amp;&#35;45&#59;types/)
  $resource&#45;&amp;gt&#59;setMimeType(&#39;MIME_TYPE&#39;)&#59;

getSize()

returns the Size

The integer indicating the size of the resource file (OPTIONAL)
(1)   Approximate size of the resource file in bytes.
(2)   For &amp;lt&#59;uri&amp;gt&#59; based resources, &amp;lt&#59;size&amp;gt&#59; SHOULD be included if available.
  $resource&#45;&amp;gt&#59;getSize()&#59;

setSize($val)

sets the value of the Size

The integer indicating the size of the resource file (OPTIONAL)
(1)   Approximate size of the resource file in bytes.
(2)   For &amp;lt&#59;uri&amp;gt&#59; based resources, &amp;lt&#59;size&amp;gt&#59; SHOULD be included if available.
  $resource&#45;&amp;gt&#59;setSize(INT_SIZE)&#59;

getUri()

returns the Uri

The identifier of the hyperlink for the resource file (OPTIONAL
A full absolute URI, typically a Uniform Resource Locator that can be used to retrieve the resource over the Internet
OR
a relative URI to name the content of a &amp;lt&#59;derefUri&amp;gt&#59; element if one is present in this resource block.
  $resource&#45;&amp;gt&#59;getUri()&#59;

setUri($val)

sets the value of the Uri

The identifier of the hyperlink for the resource file (OPTIONAL
A full absolute URI, typically a Uniform Resource Locator that can be used to retrieve the resource over the Internet
OR
a relative URI to name the content of a &amp;lt&#59;derefUri&amp;gt&#59; element if one is present in this resource block.
  $resource&#45;&amp;gt&#59;setUri(&#39;URI&#39;)&#59;

getDerefUri()

returns the DerefUri

The base&amp;&#35;45&#59;64 encoded data content of the resource file (CONDITIONAL)
(1) MAY be used either with or instead of the &amp;lt&#59;uri&amp;gt&#59; element in messages transmitted over one&amp;&#35;45&#59;way (e.g., broadcast) data links where retrieval of a resource via a URI is not feasible.
(2) Clients intended for use with one&amp;&#35;45&#59;way data links MUST support this element.
(3) This element MUST NOT be used unless the sender is certain that all direct clients are capable of processing it.
(4) If messages including this element are forwarded onto a two&amp;&#35;45&#59;way network, the forwarder MUST strip the &amp;lt&#59;derefUri&amp;gt&#59; element and SHOULD extract the file contents and provide a &amp;lt&#59;uri&amp;gt&#59; link to a retrievable version of the file.
(5) Providers of one&amp;&#35;45&#59;way data links MAY enforce additional restrictions on the use of this element, including message&amp;&#35;45&#59;size limits and restrictions regarding file types.
  $resource&#45;&amp;gt&#59;getDerefUri()&#59;

setDerefUri($val)

sets the value of the DerefUri

The base&amp;&#35;45&#59;64 encoded data content of the resource file (CONDITIONAL)
(1) MAY be used either with or instead of the &amp;lt&#59;uri&amp;gt&#59; element in messages transmitted over one&amp;&#35;45&#59;way (e.g., broadcast) data links where retrieval of a resource via a URI is not feasible.
(2) Clients intended for use with one&amp;&#35;45&#59;way data links MUST support this element.
(3) This element MUST NOT be used unless the sender is certain that all direct clients are capable of processing it.
(4) If messages including this element are forwarded onto a two&amp;&#35;45&#59;way network, the forwarder MUST strip the &amp;lt&#59;derefUri&amp;gt&#59; element and SHOULD extract the file contents and provide a &amp;lt&#59;uri&amp;gt&#59; link to a retrievable version of the file.
(5) Providers of one&amp;&#35;45&#59;way data links MAY enforce additional restrictions on the use of this element, including message&amp;&#35;45&#59;size limits and restrictions regarding file types.
  $resource&#45;&amp;gt&#59;setDerefUri(&#39;DEREF_URI&#39;)&#59;

getDigest()

returns the Digest

The code representing the digital digest (“hash”) computed from the resource file (OPTIONAL)
Calculated using the Secure Hash Algorithm (SHA&amp;&#35;45&#59;1) per &amp;&#35;91&#59;FIPS 180&amp;&#35;45&#59;2&amp;&#35;93&#59;.
  $resource&#45;&amp;gt&#59;getDigest()&#59;

setDigest($val)

sets the value of the Digest

The code representing the digital digest (“hash”) computed from the resource file (OPTIONAL)
Calculated using the Secure Hash Algorithm (SHA&amp;&#35;45&#59;1) per &amp;&#35;91&#59;FIPS 180&amp;&#35;45&#59;2&amp;&#35;93&#59;.
  $resource&#45;&amp;gt&#59;setDigest(&#39;DIGEST&#39;)&#59;