-
Notifications
You must be signed in to change notification settings - Fork 11
CAP Processor resource
Niklas Spanring edited this page Oct 17, 2016
·
1 revision
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; var $mimeType; var $size; var $uri; var $derefUri; var $digest;
$resource = $info-&gt;addResource();
returns the ResourceDesc
The text describing the type and content of the resource file (REQUIRED)
The human&#45;readable text describing the type and content, such as “map” or “photo”, of the resource file.
$resource-&gt;getResourceDesc();
sets the value of the ResourceDesc
The text describing the type and content of the resource file (REQUIRED)
The human&#45;readable text describing the type and content, such as “map” or “photo”, of the resource file.
$resource-&gt;setResourceDesc('RESOURCE_DESC');
returns the MimeType
The identifier of the MIME content type and sub&#45;type describing the resource file (REQUIRED)
MIME content type and sub&#45;type as described in &#91;RFC 2046&#93;. (As of this document, the current IANA registered MIME types are listed at http&#58;//www.iana.org/assignments/media&#45;types/)
$resource-&gt;getMimeType();
sets the value of the MimeType
The identifier of the MIME content type and sub&#45;type describing the resource file (REQUIRED)
MIME content type and sub&#45;type as described in &#91;RFC 2046&#93;. (As of this document, the current IANA registered MIME types are listed at http&#58;//www.iana.org/assignments/media&#45;types/)
$resource-&gt;setMimeType('MIME_TYPE');
returns the Size
The integer indicating the size of the resource file (OPTIONAL)
(1) Approximate size of the resource file in bytes. (2) For &lt;uri&gt; based resources, &lt;size&gt; SHOULD be included if available.
$resource-&gt;getSize();
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 &lt;uri&gt; based resources, &lt;size&gt; SHOULD be included if available.
$resource-&gt;setSize(INT_SIZE);
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 &lt;derefUri&gt; element if one is present in this resource block.
$resource-&gt;getUri();
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 &lt;derefUri&gt; element if one is present in this resource block.
$resource-&gt;setUri('URI');
returns the DerefUri
The base&#45;64 encoded data content of the resource file (CONDITIONAL)
(1) MAY be used either with or instead of the &lt;uri&gt; element in messages transmitted over one&#45;way (e.g., broadcast) data links where retrieval of a resource via a URI is not feasible. (2) Clients intended for use with one&#45;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&#45;way network, the forwarder MUST strip the &lt;derefUri&gt; element and SHOULD extract the file contents and provide a &lt;uri&gt; link to a retrievable version of the file. (5) Providers of one&#45;way data links MAY enforce additional restrictions on the use of this element, including message&#45;size limits and restrictions regarding file types.
$resource-&gt;getDerefUri();
sets the value of the DerefUri
The base&#45;64 encoded data content of the resource file (CONDITIONAL)
(1) MAY be used either with or instead of the &lt;uri&gt; element in messages transmitted over one&#45;way (e.g., broadcast) data links where retrieval of a resource via a URI is not feasible. (2) Clients intended for use with one&#45;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&#45;way network, the forwarder MUST strip the &lt;derefUri&gt; element and SHOULD extract the file contents and provide a &lt;uri&gt; link to a retrievable version of the file. (5) Providers of one&#45;way data links MAY enforce additional restrictions on the use of this element, including message&#45;size limits and restrictions regarding file types.
$resource-&gt;setDerefUri('DEREF_URI');
returns the Digest
The code representing the digital digest (“hash”) computed from the resource file (OPTIONAL)
Calculated using the Secure Hash Algorithm (SHA&#45;1) per &#91;FIPS 180&#45;2&#93;.
$resource-&gt;getDigest();
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&#45;1) per &#91;FIPS 180&#45;2&#93;.
$resource-&gt;setDigest('DIGEST');
Special ... with additional meteoalarm.eu webservice functions (www.meteoalarm.eu)