You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wookie.apache.org by sc...@apache.org on 2011/07/07 23:02:39 UTC

svn commit: r1144035 - in /incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel: IWidgetAPI.java IWookieExtensionAPI.java impl/WidgetAPIImpl.java

Author: scottbw
Date: Thu Jul  7 21:02:38 2011
New Revision: 1144035

URL: http://svn.apache.org/viewvc?rev=1144035&view=rev
Log:
Split the Widget runtime API into those that are used to implement the W3C standard API (IWidgetAPI) and Wookie extensions (IWookieExtensionAPI). See WOOKIE-225.

Added:
    incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/IWookieExtensionAPI.java
Modified:
    incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/IWidgetAPI.java
    incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/impl/WidgetAPIImpl.java

Modified: incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/IWidgetAPI.java
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/IWidgetAPI.java?rev=1144035&r1=1144034&r2=1144035&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/IWidgetAPI.java (original)
+++ incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/IWidgetAPI.java Thu Jul  7 21:02:38 2011
@@ -21,56 +21,12 @@ import org.apache.wookie.beans.IPreferen
 
 
 /**
- * Definition of the widget API.  
- * @author Paul Sharples
- * @version $Id: IWidgetAPI.java,v 1.3 2009-09-14 21:15:08 scottwilson Exp $
+ * The Widget API: functions required to support the W3C Widget Interface specification
  *
  */
 public interface IWidgetAPI {	
 	
 	/**
-	 * Appends a string to the string contained in the shared data value in the DB, obtained
-	 * from the given "key" 
-	 * 
-	 * Note that this method is retained only as a workaround for some issues in the Wave Gadget API implementation
-	 * and is likely to be deprecated in the future.
-	 * 
-	 * @param id_key - the unique instance id key for a widget instance
-	 * @param key - key for the value to change
- 	 * @param key - the value to change to
-	 * @return - a string value marking status or an error message
-	 */
-	public String appendSharedDataForKey(String id_key, String key, String value);	
-	
-	/**
-	 * Call to hide a widget instance based on the instance_key
-	 * 
-	 * Note this is not a part of the W3C standard interface, but a Wookie-specific extension
-	 * 
-	 * @param id_key
-	 * @return
-	 */
-	public String hide(String id_key);
-	
-	/**
-	 * Call to lock a widget instance
-	 * 
-   * Note this is not a part of the W3C standard interface, but a Wookie-specific extension
-   * 
-	 * @param id_key
-	 * @return
-	 */
-	public String lock(String id_key);
-	
-	/**
-	 * Open a url in a window
-	 * @param url
-	 * @return
-	 */
-	@Deprecated
-	public String openURL(String url);
-	
-	/**
 	 * Returns the set of preferences as a map of [key][value] objects
 	 * @param id_key
 	 * @return
@@ -84,67 +40,6 @@ public interface IWidgetAPI {	
 	 */
 	public Map<String, String> metadata(String id_key);
 	
-	/**
-	 * Returns a string preference value from the DB, obtained
-	 * from the given "key" 
-	 * @param id_key - the unique instance id key for a widget instance
-	 * @param key - key for the value to retrieve
-	 * @return - a string value found in the DB or an error message
-	 */
-	 @Deprecated
-	public String preferenceForKey(String id_key, String key);
-	
-	/**
-	 * Sets a string preference value in the DB, obtained
-	 * from the given "key" 
-	 * @param id_key - the unique instance id key for a widget instance
-	 * @param key - key for the value to change
- 	 * @param key - the value to change to
-	 * @return - a string value marking status or an error message
-	 */
-	 @Deprecated
-	public String setPreferenceForKey(String id_key, String key, String value);
-		
-	/**
-	 * Sets a string shared data value in the DB, obtained
-	 * from the given "key" 
-	 * @param id_key - the unique instance id key for a widget instance
-	 * @param key - key for the value to change
- 	 * @param key - the value to change to
-	 * @return - a string value marking status or an error message
-	 */
-	@Deprecated
-	public String setSharedDataForKey(String id_key, String key, String value);
-	
-	/**
-	 * Returns a string value from the DB, obtained
-	 * from the given "key". This is a shared data value
-	 * between widgets using the same data 
-	 * @param id_key - the unique instance id key for a widget instance
-	 * @param key - key for the value to retrieve
-	 * @return - a string value found in the DB or an error message
-	 */
-	 @Deprecated
-	public String sharedDataForKey(String id_key, String key);	
-	
-	/**
-	 * show a widget instance based on the id_key
-	 * 
-	 * Note this is not a part of the W3C standard interface, but a Wookie-specific extension
-	 * 
-	 * @param id_key
-	 * @return
-	 */
-	public String show(String id_key);
-	
-	/**
-	 * Unlock a widget instance based on the id_key
-	 * 
-	 * Note this is not a part of the W3C standard interface, but a Wookie-specific extension
-	 * 
-	 * @param id_key
-	 * @return
-	 */
-	public String unlock(String id_key);
+
 	
 }

Added: incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/IWookieExtensionAPI.java
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/IWookieExtensionAPI.java?rev=1144035&view=auto
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/IWookieExtensionAPI.java (added)
+++ incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/IWookieExtensionAPI.java Thu Jul  7 21:02:38 2011
@@ -0,0 +1,110 @@
+/*
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * 
+ */
+
+package org.apache.wookie.ajaxmodel;
+
+/**
+ * Wookie-specific runtime API extensions, including "private" support methods
+ */
+public interface IWookieExtensionAPI {
+  
+  
+  /**
+   * Appends a string to the string contained in the shared data value in the DB, obtained
+   * from the given "key" 
+   * 
+   * Note that this method is retained only as a workaround for some issues in the Wave Gadget API implementation
+   * and is likely to be deprecated in the future.
+   * 
+   * @param id_key - the unique instance id key for a widget instance
+   * @param key - key for the value to change
+   * @param key - the value to change to
+   * @return - a string value marking status or an error message
+   */
+  public String appendSharedDataForKey(String id_key, String key, String value);  
+  
+  /**
+   * Call to hide a widget instance based on the instance_key
+   * 
+   * Note this is not a part of the W3C standard interface, but a Wookie-specific extension
+   * 
+   * @param id_key
+   * @return
+   */
+  public String hide(String id_key);
+  
+  /**
+   * Open a url in a window. DEPRECATED.
+   * @param url
+   * @return
+   */
+  @Deprecated
+  public String openURL(String url);
+  
+  /**
+   * Returns a string preference value from the DB, obtained
+   * from the given "key" . DEPRECATED: Use widget.preferences
+   * @param id_key - the unique instance id key for a widget instance
+   * @param key - key for the value to retrieve
+   * @return - a string value found in the DB or an error message
+   */
+   @Deprecated
+  public String preferenceForKey(String id_key, String key);
+  
+  /**
+   * Sets a string preference value in the DB, obtained
+   * from the given "key" 
+   * @param id_key - the unique instance id key for a widget instance
+   * @param key - key for the value to change
+   * @param key - the value to change to
+   * @return - a string value marking status or an error message
+   */
+  public String setPreferenceForKey(String id_key, String key, String value);
+    
+  /**
+   * Sets a string shared data value in the DB, obtained
+   * from the given "key". DEPRECATED: Use wave.getState().submitValue()
+   * @param id_key - the unique instance id key for a widget instance
+   * @param key - key for the value to change
+   * @param key - the value to change to
+   * @return - a string value marking status or an error message
+   */
+  @Deprecated
+  public String setSharedDataForKey(String id_key, String key, String value);
+  
+  /**
+   * Returns a string value from the DB, obtained
+   * from the given "key". This is a shared data value
+   * between widgets using the same data. DEPRECATED: Use wave.getState().get()
+   * @param id_key - the unique instance id key for a widget instance
+   * @param key - key for the value to retrieve
+   * @return - a string value found in the DB or an error message
+   */
+   @Deprecated
+  public String sharedDataForKey(String id_key, String key);  
+  
+  /**
+   * show a widget instance based on the id_key
+   * 
+   * Note this is not a part of the W3C standard interface, but a Wookie-specific extension
+   * 
+   * @param id_key
+   * @return
+   */
+  public String show(String id_key);
+  
+}

Modified: incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/impl/WidgetAPIImpl.java
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/impl/WidgetAPIImpl.java?rev=1144035&r1=1144034&r2=1144035&view=diff
==============================================================================
--- incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/impl/WidgetAPIImpl.java (original)
+++ incubator/wookie/trunk/src/org/apache/wookie/ajaxmodel/impl/WidgetAPIImpl.java Thu Jul  7 21:02:38 2011
@@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletReq
 import org.apache.log4j.Logger;
 import org.apache.wookie.Messages;
 import org.apache.wookie.ajaxmodel.IWidgetAPI;
+import org.apache.wookie.ajaxmodel.IWookieExtensionAPI;
 import org.apache.wookie.beans.IDescription;
 import org.apache.wookie.beans.IName;
 import org.apache.wookie.beans.IPreference;
@@ -65,14 +66,14 @@ import org.directwebremoting.WebContextF
  * @version $Id: WidgetAPIImpl.java,v 1.3 2009-09-14 21:15:07 scottwilson Exp $
  *
  */
-public class WidgetAPIImpl implements IWidgetAPI {
+public class WidgetAPIImpl implements IWidgetAPI, IWookieExtensionAPI {
 
 	static Logger _logger = Logger.getLogger(WidgetAPIImpl.class.getName());
 
 	public WidgetAPIImpl(){}
 	
 	/* (non-Javadoc)
-	 * @see org.apache.wookie.ajaxmodel.IWidgetAPI#preferences2(java.lang.String)
+	 * @see org.apache.wookie.ajaxmodel.IWidgetAPI#preferences(java.lang.String)
 	 */
 	public List<IPreference> preferences(String id_key) {
 		ArrayList<IPreference> prefs = new ArrayList<IPreference>();