Class Index

Classes


Class Clip


Extends CompositionItem.

Class Summary
Constructor Attributes Constructor Name and Description
 
Clip()
Represents a Clip within the Composition.
Field Summary
Field Attributes Field Name and Description
{String[]}  
If Dynamic-resource Caching is enabled for the Clip, this property contains the list of URLs currently in the cache.
{Target[]}  
An array of Target objects representing all of the Targets referenced by this Clip.
{String}  
The value "Clip".
Fields borrowed from class CompositionItem:
children, completionType, failureText, forEachValue, hasErrorEvents, index, name, nextItem, parent, path, playNumber, playNumberBeforeRenewal, playNumberWithinRenewal, previousItem, propertyList, REPEAT_DISTRIBUTION_CONSTANT, REPEAT_TIMING_PARALLEL, REPEAT_TIMING_SERIAL, REPEAT_TYPE_COUNT_CONSTANT, repeatIndex, systemPropertyList
Method Summary
Method Attributes Method Name and Description
{Target}  
getTarget(targetName)
Returns a specific Target object by name.
Methods borrowed from class CompositionItem:
clearRepeat, end, endRepeat, getChild, getItemViaPath, setRepeat
Class Detail
Clip()
Represents a Clip within the Composition.
Field Detail
{String[]} dynamicResourceCache
If Dynamic-resource Caching is enabled for the Clip, this property contains the list of URLs currently in the cache. This list changes as Pages are played and dynamic resources are extracted from responses to the Main Message.

The value is null if the Dynamic-Resource Cache is not enabled, or if the cache is empty.

This property can be set to replace the entire cache. This can be done to modify the existing list of URLs, or to create an entirely new list of URLs.

The value of the property is an array of Strings. Each String is the fully-qualified URL of a Page dynamic resource. The list that is returned is sorted. Any new list that is provided need not be sorted. Null entries in any new list provided are ignored.

Here is an example Script that retrieves the current cache and displays it in the Result:

var urls = $context.currentClip.dynamicResourceCache;
if (urls == null)
{
  $context.result.postMessage($context.result.LEVEL_INFO, "Cache is empty.");
}
else
{
  var text = "";
  for each (var url in urls))
  {
    text += url + "\n";
  }
  $context.result.postMessage($context.result.LEVEL_INFO, urls.length + " URLs", text);
}

Here is an example Script that replaces the entire current cache with a new list that contains two URLs:

var newList = new Array();
newList[0] = "http://somewhere.com/somepage.html";
newList[1] = "http://someplace.com/index.html";
$context.currentClip.dynamicResourceCache = newList;

Here is an example Script that removes a specific URL from the cache, if it is there:

var list = $context.currentClip.dynamicResourceCache;
if (list != null)
{
  for (var i = 0; i < list.length; i++)
  {
    if (list[i] == "http://somewhere.com/somepage.html")
    {
      list[i] = null;
      $context.currentClip.dynamicResourceCache = list;
      $context.result.postMessage($context.result.LEVEL_INFO, "URL removed.");
      break;
    }
  }
}

Here is an example Script that adds a new URL to the current cache:

var list = $context.currentClip.dynamicResourceCache;
if (list == null)
  list = new Array();
list[list.length] = "http://somewhere.com/somepage.html";
$context.currentClip.dynamicResourceCache = list;

{Target[]} targets
An array of Target objects representing all of the Targets referenced by this Clip. Null if there are no Targets.

This will include any Targets adopted from nested child Clips through Target merging.

Read only.


{String} type
The value "Clip". Read only.
Method Detail
{Target} getTarget(targetName)
Returns a specific Target object by name.
Parameters:
{String} targetName

The name of the Target to return.

Returns:
{Target}

The Target object, or null if there is no Target with the specified name.


SOASTA CloudTest Script Documentation (build 8744.736). Copyright 2006-2011. All rights reserved.