Author: scottbw
Date: Fri Jul 6 14:52:52 2012
New Revision: 1358249
URL: http://svn.apache.org/viewvc?rev=1358249&view=rev
Log:
Added more info on new connector framework capabilities, and documented
preferences
Modified:
incubator/wookie/site/trunk/content/wookie/docs/embedding.mdtext
Modified: incubator/wookie/site/trunk/content/wookie/docs/embedding.mdtext
URL:
http://svn.apache.org/viewvc/incubator/wookie/site/trunk/content/wookie/docs/embedding.mdtext?rev=1358249&r1=1358248&r2=1358249&view=diff
==============================================================================
--- incubator/wookie/site/trunk/content/wookie/docs/embedding.mdtext (original)
+++ incubator/wookie/site/trunk/content/wookie/docs/embedding.mdtext Fri Jul 6
14:52:52 2012
@@ -1,4 +1,4 @@
-Title:
+Title: Embedding widgets in your applications
Notice: Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
@@ -91,7 +91,9 @@ possibility; another is an opaque hashco
A widget instance is a persistent instance of a particular widget created for
a user. Each widget instance has its own storage area in Wookie. Widget
Instances are created by invoking the Wookie REST API using an API Key and
supplying values for the viewer and the shared data key.
#### API Key
-An API Key is used to access many of the features of the Wookie REST API. Each
individual web application needs its own API key. API Keys are generated from
Wookie's administration interface.
+An API Key is used to access many of the features of the Wookie REST API. Each
individual web application needs its own API key.
+
+For information on creating and managing API keys, see the [Server
Administration][3] documentation.
#### Shared Data Key
The shared data key is an arbitrary identifier that marks widget instances as
being sibling instances that can share state information. It is up to the
plugin to determine this value; typically there is a persistent identifier
available for whichever view is being used as the container for a widget.
@@ -144,6 +146,22 @@ To do this you will need an URL for retr
String url = instance.getUrl(); // get the URL from the WidgetInstance
displayWidget(url); // a method you implement that displays the data at
the URL
+### Working with preferences and shared data
+
+The connector framework also provides access to preferences and shared data
for specific widget instances; for example, you can
+pre-populate information in a widget instance, such as the video to show in
video player widget, or the initial location to use for a
+local weather information widget. For example, the following sets the widget
preference key "city" to "manchester" for a single viewer:
+
+ conn.setPropertyForInstance(instance, false, "city", "manchester");
+
+To set a property for all widget instances in the same context, use "true" for
the second parameter.
+
+### Using admin functions from a connector or plugin
+The connector framework also supports (as of v0.10) calling the administrator
APIs of a Wookie server, provided
+you supply the correct admin credentials. This includes the ability to manage
API keys, access policies for the built-in
+proxy service, and even to add and remove widgets from the server. This means
that you can use the connector framework
+to build a complete admin client for Wookie.
[1]:
https://svn.apache.org/repos/asf/incubator/wookie/trunk/connector/java/src/org/apache/wookie/connector/framework/AbstractWookieConnectorService.java
- [2]:
http://svn.apache.org/repos/asf/incubator/wookie/trunk/connector/java/src/org/apache/wookie/connector/framework/WookieConnectorService.java
\ No newline at end of file
+ [2]:
http://svn.apache.org/repos/asf/incubator/wookie/trunk/connector/java/src/org/apache/wookie/connector/framework/WookieConnectorService.java
+ [3]: admin.html
\ No newline at end of file