Files
Phraseanet/www/include/jslibs/yui2.8/docs/YAHOO.util.StorageManager.html
2011-02-16 16:09:48 +01:00

522 lines
36 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>API: Storage YAHOO.util.StorageManager (YUI Library)</title>
<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
<link rel="stylesheet" type="text/css" href="assets/api.css" />
<script type="text/javascript" src="assets/api-js"></script>
<script type="text/javascript" src="assets/ac-js"></script>
</head>
<body id="yahoo-com">
<div id="doc3" class="yui-t2">
<div id="hd">
<h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
<h3>Storage&nbsp; <span class="subtitle">2.8.2r1</span></h3>
<a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a>
&gt; <a href="./module_storage.html" title="Storage">Storage</a>
&gt; YAHOO.util.StorageManager
<form onsubmit="return false">
<div id="propertysearch">
Search: <input autocomplete="off" id="searchinput" />
<div id="searchresults">
&nbsp;
</div>
</div>
</form>
</div>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
<fieldset>
<legend>Filters</legend>
<span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
<span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
<span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
</fieldset>
</form>
<h2>
<code>static</code>
Class <b property="yui:name">YAHOO.util.StorageManager</b>
<span class="extends">
</span>
</h2>
<!-- class tree goes here -->
<div class="summary description" property="yui:description">
The StorageManager class is a singleton that registers DataStorage objects and returns instances of those objects.
</div>
<div rel="yui:properties" resource="#properties">
<div class="section field details">
<h3 id="properties">Properties</h3>
<div class="content">
<div class="" rel="yui:property" resource="#property_LOCATION_LOCAL">
<h4><a name="property_LOCATION_LOCAL" property="yui:name">LOCATION_LOCAL</a>
- <code>static <span property="yui:type">{String}</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The storage location - local; data cleared on demand.
</div>
</div>
<hr />
</div>
<div class="" rel="yui:property" resource="#property_LOCATION_SESSION">
<h4><a name="property_LOCATION_SESSION" property="yui:name">LOCATION_SESSION</a>
- <code>static <span property="yui:type">{String}</span></code>
</h4>
<div class="detail">
<div class="description" property="yui:description">
The storage location - session; data cleared at the end of a user's session.
</div>
</div>
<hr />
</div>
</div>
</div>
</div>
<div rel="yui:methods" resource="#methods">
<div class="section method details">
<h3 id="methods">Methods</h3>
<div class="content">
<div class="private" rel="yui:method" resource="#method__getClass">
<h4>
<a name="method__getClass">_getClass</a></h4>
<div class="detail" >
<code>
private
Function
<strong property="yui:name">_getClass</strong>
(
klass
)
</code>
<div class="description" property="yui:description">
Fetches a storage constructor if it is available, otherwise returns NULL.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">klass</span>
&lt;<span property="yui:type">Function</span>&gt;
</code>
<span property="yui:description"> Required. The storage constructor to test.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Function
</code></dt>
<dd property="yui:returnInfo">An available storage constructor or NULL.</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private" rel="yui:method" resource="#method__getStorageEngine">
<h4>
<a name="method__getStorageEngine">_getStorageEngine</a></h4>
<div class="detail" >
<code>
private
void
<strong property="yui:name">_getStorageEngine</strong>
(
location
,
klass
,
conf
)
</code>
<div class="description" property="yui:description">
Fetches the storage engine from the cache, or creates and caches it.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">location</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> Required. The location to store.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">klass</span>
&lt;<span property="yui:type">Function</span>&gt;
</code>
<span property="yui:description"> Required. A pointer to the engineType Class.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">conf</span>
&lt;<span property="yui:type">Object</span>&gt;
</code>
<span property="yui:description"> Optional. Additional configuration for the data source engine.</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="private" rel="yui:method" resource="#method__getValidLocation">
<h4>
<a name="method__getValidLocation">_getValidLocation</a></h4>
<div class="detail" >
<code>
private
void
<strong property="yui:name">_getValidLocation</strong>
(
location
)
</code>
<div class="description" property="yui:description">
Ensures that the location is valid before returning it or a default value.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">location</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> Required. The location to evaluate.</span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_get">
<h4>
<a name="method_get">get</a></h4>
<div class="detail" >
<code>
static
void
<strong property="yui:name">get</strong>
(
engineType
,
location
,
conf
)
</code>
<div class="description" property="yui:description">
Fetches the desired engine type or first available engine type.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">engineType</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> Optional. The engine type, see engines.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">location</span>
&lt;<span property="yui:type">String</span>&gt;
</code>
<span property="yui:description"> Optional. The storage location - LOCATION_SESSION & LOCATION_LOCAL; default is LOCAL.</span>
</dd>
<dd rel="yui:parameter">
<code><span property="yui:name">conf</span>
&lt;<span property="yui:type">Object} Optional. Additional configuration for the getting the storage engine.
{
engine: {Object} configuration parameters for the desired engine
order: {Array} an array of storage engine names; the desired order to try engines}
</span>&gt;
</code>
<span property="yui:description"></span>
</dd>
</dl>
</div>
</div>
<hr />
</div>
<div class="" rel="yui:method" resource="#method_register">
<h4>
<a name="method_register">register</a></h4>
<div class="detail" >
<code>
static
Boolean
<strong property="yui:name">register</strong>
(
engineConstructor
)
</code>
<div class="description" property="yui:description">
Registers a engineType Class with the StorageManager singleton; first in is the first out.
</div>
<div class="description">
<dl rel="yui:parameters">
<dt>Parameters:</dt>
<dd rel="yui:parameter">
<code><span property="yui:name">engineConstructor</span>
&lt;<span property="yui:type">Function</span>&gt;
</code>
<span property="yui:description"> Required. The engine constructor function, see engines.</span>
</dd>
</dl>
<dl>
<dt>Returns:
<code property="yui:return">
Boolean
</code></dt>
<dd property="yui:returnInfo">When successfully registered.</dd>
</dl>
</div>
</div>
<hr />
</div>
</div>
</div>
</div>
<div rel="yui:events" resource="#events">
</div>
<div rel="yui:attributes" resource="#configattributes">
</div>
</div>
</div>
<div class="yui-b">
<div class="nav">
<div id="moduleList" class="module">
<h4>Modules</h4>
<ul class="content">
<li class=""><a href="module_animation.html" title="animation">animation</a></li>
<li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
<li class=""><a href="module_button.html" title="button">button</a></li>
<li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
<li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
<li class=""><a href="module_charts.html" title="charts">charts</a></li>
<li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
<li class=""><a href="module_connection.html" title="connection">connection</a></li>
<li class=""><a href="module_container.html" title="container">container</a></li>
<li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
<li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
<li class=""><a href="module_datatable.html" title="datatable">datatable</a></li>
<li class=""><a href="module_datemath.html" title="datemath">datemath</a></li>
<li class=""><a href="module_dom.html" title="dom">dom</a></li>
<li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
<li class=""><a href="module_editor.html" title="editor">editor</a></li>
<li class=""><a href="module_element.html" title="element">element</a></li>
<li class=""><a href="module_element-delegate.html" title="element-delegate">element-delegate</a></li>
<li class=""><a href="module_event.html" title="event">event</a></li>
<li class=""><a href="module_event-delegate.html" title="event-delegate">event-delegate</a></li>
<li class=""><a href="module_event-mouseenter.html" title="event-mouseenter">event-mouseenter</a></li>
<li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
<li class=""><a href="module_get.html" title="get">get</a></li>
<li class=""><a href="module_history.html" title="history">history</a></li>
<li class=""><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
<li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
<li class=""><a href="module_json.html" title="json">json</a></li>
<li class=""><a href="module_layout.html" title="layout">layout</a></li>
<li class=""><a href="module_logger.html" title="logger">logger</a></li>
<li class=""><a href="module_menu.html" title="menu">menu</a></li>
<li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
<li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
<li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
<li class=""><a href="module_progressbar.html" title="progressbar">progressbar</a></li>
<li class=""><a href="module_resize.html" title="resize">resize</a></li>
<li class=""><a href="module_selector.html" title="selector">selector</a></li>
<li class=""><a href="module_slider.html" title="slider">slider</a></li>
<li class="selected"><a href="module_storage.html" title="Storage">Storage</a></li>
<li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
<li class=""><a href="module_swf.html" title="swf">swf</a></li>
<li class=""><a href="module_swfdetect.html" title="swfdetect">swfdetect</a></li>
<li class=""><a href="module_swfstore.html" title="swfstore">swfstore</a></li>
<li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
<li class=""><a href="module_treeview.html" title="treeview">treeview</a></li>
<li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
<li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
<li class=""><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
<li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
</ul>
</div>
<div id="classList" class="module">
<h4>Classes</h4>
<ul class="content">
<li class=""><a href="YAHOO.util.Storage.html" title="YAHOO.util.Storage">YAHOO.util.Storage</a></li>
<li class=""><a href="YAHOO.util.StorageEngineGears.html" title="YAHOO.util.StorageEngineGears">YAHOO.util.StorageEngineGears</a></li>
<li class=""><a href="YAHOO.util.StorageEngineHTML5.html" title="YAHOO.util.StorageEngineHTML5">YAHOO.util.StorageEngineHTML5</a></li>
<li class=""><a href="YAHOO.util.StorageEngineKeyed.html" title="YAHOO.util.StorageEngineKeyed">YAHOO.util.StorageEngineKeyed</a></li>
<li class=""><a href="YAHOO.util.StorageEngineSWF.html" title="YAHOO.util.StorageEngineSWF">YAHOO.util.StorageEngineSWF</a></li>
<li class=""><a href="YAHOO.util.StorageEvent.html" title="YAHOO.util.StorageEvent">YAHOO.util.StorageEvent</a></li>
<li class="selected"><a href="YAHOO.util.StorageManager.html" title="YAHOO.util.StorageManager">YAHOO.util.StorageManager</a></li>
</ul>
</div>
<div id="fileList" class="module">
<h4>Files</h4>
<ul class="content">
<li class=""><a href="gears_init.js.html" title="gears_init.js">gears_init.js</a></li>
<li class=""><a href="Storage.js.html" title="Storage.js">Storage.js</a></li>
<li class=""><a href="StorageEngineGears.js.html" title="StorageEngineGears.js">StorageEngineGears.js</a></li>
<li class=""><a href="StorageEngineHTML5.js.html" title="StorageEngineHTML5.js">StorageEngineHTML5.js</a></li>
<li class=""><a href="StorageEngineKeyed.js.html" title="StorageEngineKeyed.js">StorageEngineKeyed.js</a></li>
<li class=""><a href="StorageEngineSWF.js.html" title="StorageEngineSWF.js">StorageEngineSWF.js</a></li>
<li class=""><a href="StorageEvent.js.html" title="StorageEvent.js">StorageEvent.js</a></li>
<li class=""><a href="StorageManager.js.html" title="StorageManager.js">StorageManager.js</a></li>
</ul>
</div>
<div id="propertyList" class="module">
<h4>Properties</h4>
<ul class="content">
<li class=""><a href="#property_LOCATION_LOCAL" title="LOCATION_LOCAL">LOCATION_LOCAL</a></li>
<li class=""><a href="#property_LOCATION_SESSION" title="LOCATION_SESSION">LOCATION_SESSION</a></li>
</ul>
</div>
<div id="methodsList" class="module">
<h4>Methods</h4>
<ul class="content">
<li class="private"><a href="#method__getClass" title="_getClass">_getClass</a></li>
<li class="private"><a href="#method__getStorageEngine" title="_getStorageEngine">_getStorageEngine</a></li>
<li class="private"><a href="#method__getValidLocation" title="_getValidLocation">_getValidLocation</a></li>
<li class=""><a href="#method_get" title="get">get</a></li>
<li class=""><a href="#method_register" title="register">register</a></li>
</ul>
</div>
</div>
</div>
</div>
<div id="ft">
<hr />
Copyright &copy; 2010 Yahoo! Inc. All rights reserved.
</div>
</div>
<script type="text/javascript">
var ALL_YUI_PROPS = [{"access": "protected", "host": "YAHOO.util.StorageEngineKeyed", "name": "_addKey", "url": "YAHOO.util.StorageEngineKeyed.html#method__addKey", "type": "method"}, {"access": "", "host": "YAHOO.util.Storage", "name": "CE_CHANGE", "url": "YAHOO.util.Storage.html#property_CE_CHANGE", "type": "property"}, {"access": "", "host": "YAHOO.util.Storage", "name": "CE_READY", "url": "YAHOO.util.Storage.html#property_CE_READY", "type": "property"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "_cfg", "url": "YAHOO.util.Storage.html#property__cfg", "type": "property"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "_clear", "url": "YAHOO.util.Storage.html#method__clear", "type": "method"}, {"access": "", "host": "YAHOO.util.Storage", "name": "clear", "url": "YAHOO.util.Storage.html#method_clear", "type": "method"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "_createValue", "url": "YAHOO.util.Storage.html#method__createValue", "type": "method"}, {"access": "", "host": "YAHOO.util.Storage", "name": "DELIMITER", "url": "YAHOO.util.Storage.html#property_DELIMITER", "type": "property"}, {"access": "", "host": "YAHOO.util.StorageManager", "name": "get", "url": "YAHOO.util.StorageManager.html#method_get", "type": "method"}, {"access": "private", "host": "YAHOO.util.StorageManager", "name": "_getClass", "url": "YAHOO.util.StorageManager.html#method__getClass", "type": "method"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "_getItem", "url": "YAHOO.util.Storage.html#method__getItem", "type": "method"}, {"access": "", "host": "YAHOO.util.Storage", "name": "getItem", "url": "YAHOO.util.Storage.html#method_getItem", "type": "method"}, {"access": "", "host": "YAHOO.util.Storage", "name": "getName", "url": "YAHOO.util.Storage.html#method_getName", "type": "method"}, {"access": "private", "host": "YAHOO.util.StorageManager", "name": "_getStorageEngine", "url": "YAHOO.util.StorageManager.html#method__getStorageEngine", "type": "method"}, {"access": "private", "host": "YAHOO.util.StorageManager", "name": "_getValidLocation", "url": "YAHOO.util.StorageManager.html#method__getValidLocation", "type": "method"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "_getValue", "url": "YAHOO.util.Storage.html#method__getValue", "type": "method"}, {"access": "", "host": "YAHOO.util.Storage", "name": "hasKey", "url": "YAHOO.util.Storage.html#method_hasKey", "type": "method"}, {"access": "protected", "host": "YAHOO.util.StorageEngineKeyed", "name": "_indexOfKey", "url": "YAHOO.util.StorageEngineKeyed.html#method__indexOfKey", "type": "method"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "isReady", "url": "YAHOO.util.Storage.html#property_isReady", "type": "property"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "_key", "url": "YAHOO.util.Storage.html#method__key", "type": "method"}, {"access": "", "host": "YAHOO.util.Storage", "name": "key", "url": "YAHOO.util.Storage.html#method_key", "type": "method"}, {"access": "", "host": "YAHOO.util.StorageEvent", "name": "key", "url": "YAHOO.util.StorageEvent.html#property_key", "type": "property"}, {"access": "protected", "host": "YAHOO.util.StorageEngineKeyed", "name": "_keyMap", "url": "YAHOO.util.StorageEngineKeyed.html#property__keyMap", "type": "property"}, {"access": "protected", "host": "YAHOO.util.StorageEngineKeyed", "name": "_keys", "url": "YAHOO.util.StorageEngineKeyed.html#property__keys", "type": "property"}, {"access": "", "host": "YAHOO.util.Storage", "name": "length", "url": "YAHOO.util.Storage.html#property_length", "type": "property"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "_location", "url": "YAHOO.util.Storage.html#property__location", "type": "property"}, {"access": "", "host": "YAHOO.util.StorageManager", "name": "LOCATION_LOCAL", "url": "YAHOO.util.StorageManager.html#property_LOCATION_LOCAL", "type": "property"}, {"access": "", "host": "YAHOO.util.StorageManager", "name": "LOCATION_SESSION", "url": "YAHOO.util.StorageManager.html#property_LOCATION_SESSION", "type": "property"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "_name", "url": "YAHOO.util.Storage.html#property__name", "type": "property"}, {"access": "", "host": "YAHOO.util.StorageEvent", "name": "newValue", "url": "YAHOO.util.StorageEvent.html#property_newValue", "type": "property"}, {"access": "", "host": "YAHOO.util.StorageEvent", "name": "oldValue", "url": "YAHOO.util.StorageEvent.html#property_oldValue", "type": "property"}, {"access": "", "host": "YAHOO.util.StorageManager", "name": "register", "url": "YAHOO.util.StorageManager.html#method_register", "type": "method"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "_removeItem", "url": "YAHOO.util.Storage.html#method__removeItem", "type": "method"}, {"access": "protected", "host": "YAHOO.util.StorageEngineKeyed", "name": "_removeKey", "url": "YAHOO.util.StorageEngineKeyed.html#method__removeKey", "type": "method"}, {"access": "protected", "host": "YAHOO.util.Storage", "name": "_setItem", "url": "YAHOO.util.Storage.html#method__setItem", "type": "method"}, {"access": "", "host": "YAHOO.util.Storage", "name": "setItem", "url": "YAHOO.util.Storage.html#method_setItem", "type": "method"}, {"access": "", "host": "YAHOO.util.StorageEvent", "name": "source", "url": "YAHOO.util.StorageEvent.html#property_source", "type": "property"}, {"access": "", "host": "YAHOO.util.StorageEvent", "name": "storageArea", "url": "YAHOO.util.StorageEvent.html#property_storageArea", "type": "property"}, {"access": "protected", "host": "YAHOO.util.StorageEngineSWF", "name": "_swf", "url": "YAHOO.util.StorageEngineSWF.html#property__swf", "type": "property"}, {"access": "", "host": "YAHOO.util.StorageEvent", "name": "type", "url": "YAHOO.util.StorageEvent.html#property_type", "type": "property"}, {"access": "", "host": "YAHOO.util.StorageEvent", "name": "url", "url": "YAHOO.util.StorageEvent.html#property_url", "type": "property"}];
</script>
</body>
</html>