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/05/12 14:00:07 UTC

svn commit: r1102256 - in /incubator/wookie/trunk/scratchpad/widgets/osapitest: ./ config.xml images/ images/icon.png index.html scripts/ scripts/osapi.js

Author: scottbw
Date: Thu May 12 12:00:07 2011
New Revision: 1102256

URL: http://svn.apache.org/viewvc?rev=1102256&view=rev
Log:
adding back in OSAPI test widget into scratchpad/widgets

Added:
    incubator/wookie/trunk/scratchpad/widgets/osapitest/
    incubator/wookie/trunk/scratchpad/widgets/osapitest/config.xml
    incubator/wookie/trunk/scratchpad/widgets/osapitest/images/
    incubator/wookie/trunk/scratchpad/widgets/osapitest/images/icon.png   (with props)
    incubator/wookie/trunk/scratchpad/widgets/osapitest/index.html
    incubator/wookie/trunk/scratchpad/widgets/osapitest/scripts/
    incubator/wookie/trunk/scratchpad/widgets/osapitest/scripts/osapi.js

Added: incubator/wookie/trunk/scratchpad/widgets/osapitest/config.xml
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/scratchpad/widgets/osapitest/config.xml?rev=1102256&view=auto
==============================================================================
--- incubator/wookie/trunk/scratchpad/widgets/osapitest/config.xml (added)
+++ incubator/wookie/trunk/scratchpad/widgets/osapitest/config.xml Thu May 12 12:00:07 2011
@@ -0,0 +1,48 @@
+<!--
+  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 regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+<widget xmlns="http://www.w3.org/ns/widgets"
+ 		id="http://wookie.apache.org/widgets/osapitest"
+ 		version="0.1"
+        width="200"
+        height="320"
+        >
+  <name>osapitest</name>
+  <description>testing osapi api</description>
+  <content src="index.html"/>
+  <icon src="images/icon.png"/>
+  <feature required="true" name="http://opensocial.org/osapi.person"/>
+  <feature required="true" name="http://opensocial.org/osapi.appdata"/>
+  <author>Apache Wookie (Incubating) Team</author>
+  <licence>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 regarding copyright ownership.
+  The ASF licenses this file to You 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.</licence>
+
+</widget>
+
+
+

Added: incubator/wookie/trunk/scratchpad/widgets/osapitest/images/icon.png
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/scratchpad/widgets/osapitest/images/icon.png?rev=1102256&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/wookie/trunk/scratchpad/widgets/osapitest/images/icon.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/wookie/trunk/scratchpad/widgets/osapitest/index.html
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/scratchpad/widgets/osapitest/index.html?rev=1102256&view=auto
==============================================================================
--- incubator/wookie/trunk/scratchpad/widgets/osapitest/index.html (added)
+++ incubator/wookie/trunk/scratchpad/widgets/osapitest/index.html Thu May 12 12:00:07 2011
@@ -0,0 +1,28 @@
+<!--
+  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 regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+        <meta http-equiv="pragma" content="no-cache"/>
+        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+		<title>osapitest</title>
+		<script src="scripts/osapi.js"></script>
+	</head>
+	<body>
+		<h1>Hello World...</h1>
+	</body>
+</html>
\ No newline at end of file

Added: incubator/wookie/trunk/scratchpad/widgets/osapitest/scripts/osapi.js
URL: http://svn.apache.org/viewvc/incubator/wookie/trunk/scratchpad/widgets/osapitest/scripts/osapi.js?rev=1102256&view=auto
==============================================================================
--- incubator/wookie/trunk/scratchpad/widgets/osapitest/scripts/osapi.js (added)
+++ incubator/wookie/trunk/scratchpad/widgets/osapitest/scripts/osapi.js Thu May 12 12:00:07 2011
@@ -0,0 +1,34 @@
+osapi.people.getViewer().execute(
+		function(viewer){
+			alert(viewer.getDisplayName());
+		}
+);
+
+
+function setMonkey(){
+	osapi.appdata.update({userId: '@viewer', data: {gifts: 'a crazed monkey'}}).execute(
+		function(data){
+			alert("added");
+			getMonkey();
+			deleteMonkey();
+		}
+	);	
+}
+
+function getMonkey(){
+osapi.appdata.get({userId: '@viewer', groupId: '@friends', keys: ['gifts']}).execute(
+		function(data){
+			alert(data['gifts']);
+		}
+);
+}
+
+function deleteMonkey(){
+osapi.appdata.Delete({keys: ['gifts']}).execute(
+		function(){
+			alert("deleted");
+			getMonkey();
+		}
+);
+}
+setMonkey();