
14 Chapter 2
•
•
•
•
All of the functions that use named arguments also accept a single object as an argument.
If an object is passed, each of the object's properties corresponds to an argument
name/value pair; the property's name is the argument name and the property's value is the
argument value. For example, the previous MediaScript could be rewritten as the
following:
var argsObject;
argsObject.name = "out.jpg";
argsObject.quality = 90;
img.save(argsObject);
The advantage of passing an object is that it can be reused across multiple calls.
As a final option, you can use ECMAScript's standard object literal syntax to pass a
temporary, anonymous argument object. In this case, the MediaScript would be rewritten
as:
img.save({name: "out.jpg", quality: 90});
File Systems
MediaRich for SharePoint server implements its own virtual file system for reading and
writing data. This file system is fully customizable allowing advanced installations the
ability of defining various input and output repositories for specific purposes.
MediaRich was designed to support large clusters of servers to maximize performance and
reliability. There are two deployment scenarios for a MediaRich cluster. In one scenario, all
of the servers share a common file system with shared properties, originals, and generated
output files. In the other scenario, each MediaRich server maintains separate storage and
an external mechanism is used to duplicate and synchronize originals across all of the
servers. In either case, as a script developer you can write your scripts once without
worrying about the details of each server's file system layout.
File System Specifiers
In order to abstract file system access, all paths in MediaScript can be prefixed by a file
system specifier of the form:
specifier:/path
Specifiers must consist entirely of alphabetical characters; numbers and punctuation marks
are not allowed. Most file system specifiers are simply aliases for local or shared
directories. The following table lists these specifiers:
File System Specifier Default Location
cache \MediaRich\Shared\Generated\MediaCache
fonts \MediaRich\Shared\Originals\Fonts
logs \MediaRich\Shared\Logs
output \MediaRich\Shared\Generated