|
PrivateGadgetAdministratorsGuide
Private Gadget Administrator's Guide: FSCT, Private Gadget Editor, and Domain Gadget Directory Manager
Private Gadget Administrator's GuideThis guide provides information for administrators to use the Feed Server private gadget administrative tools: Feed Server Client Tool, the Private Gadget Editor, and the Domain Gadget Directory Manager. In addition, this guide describes the schemas for hosted feeds. Hosted feeds are provided by Google Apps. The primary use for these tools is to support Google Gadget features for Google Apps for Your Domain Premier Edition and Education Edition. Open source software distribution for these products is available in either binary or source for use with Linux or Windows. The binary software distribution zip file is available on the Downloads tab of this site. Source code is available on the Source tab in the svn/trunk/resources folder. Contents
OverviewPrivate Gadgets are XML files that you can use with Google Sites and the Google Visualization API to display information. The google-feedserver site provides the following tools for administering private gadgets:
This guide assumes an understanding of XML, Google Gadgets, and how to install a Java runtime environment to run Java programs from either a Linux or Windows command line. Feed Server Client ToolThe Feed Server Client Tool (FSCT) provides feed administrators with a set of management tools for managing and serving feeds. The FSCT provides the following:
The sections that follow enable you to install, configure, and use the FSCT. FSCT RequirementsTo use FSCT, you need the following:
FSCT TasksYou can use FSCT for the following tasks:
Installing and Configuring FSCTYou can download the FSCT from a zip file that creates subordinate folders when extracted. FSCT provides a setup file that you edit and then run to configure your operating environment. To install and configure FSCT:
In setupEnv.sh for Linux or in setupEnv.bat for Windows, the following parameters are configurable:
FSCT CommandsTo use each command:
FSCT provides the following commands for Linux (file type of .sh) or Windows (file type of .bat). The Syntax column lists Windows batch command syntax. For Linux, preface commands with ./ and specify the .sh file extension, for example ./getFeed PrivateGadgetSpec:
The commands above are generic and works for any feed. The commands below are optimized for private gadget and directory operation.
Note:
Troubleshooting FSCTThe following issues can occur while using FSCT commands. Bad RequestThe bad request error occurs if you try to add a gadget that already exists or if you specify an FSCT command with the incorrect parameters. Exception in thread "main" com.google.feedserver.util.FeedServerClientException: com.google.gdata.util.InvalidEntryException: Bad Request invalid_input You may need to scroll down through the list of gadgets in the Domain Gadget Directory Manager to find a gadget. Gadget Already ExistsIf a gadget has already been published and you attempt to publish the gadget more than once, the following error occurs: Exception in thread "main" com.google.feedserver.util.FeedServerClientException: com.google.gdata.util.InvalidEntryException: Bad Request Gadget already exists Gadget Specified Could Not Be FetchedIf a command specifies an incorrect feed or gadget name, the following error occurs: Exception in thread "main" com.google.feedserver.util.FeedServerClientException: com.google.gdata.util.ServiceException: Internal Server Error Gadget specified could not be fetched Ensure that you specified the correct feed name and that the gadget name exists. This error occurs for the 'getEntry' command. Invalid CredentialsThe invalid credentials error occurs when the FSCT is not correctly configured: Exception in thread "main" com.google.gdata.client.GoogleService$InvalidCredentialsException: Invalid credentials Ensure that you have edited setupEnv.sh for Linux or setupEnv.bat for Windows and have set the following values:
Not Found ExceptionThe resource not found error occurs if you enter incorrect command line information: Exception in thread "main" com.google.feedserver.util.FeedServerClientException: com.google.gdata.util.ResourceNotFoundException: Not Found This error can occur if the domain is not correct, or the entry or feed name is misspelled (feed and entry names are case sensitive in Linux and in Windows). Unauthorized ExceptionThe forbidden service error occurs when an access control list (ACL) check fails: Exception in thread "main" com.google.feedserver.util.FeedServerClientException: com.google.gdata.util.ServiceForbiddenException: Forbidden Unauthorized Feeds that have ACLs set may prevent reading or writing by the account provided. You may be able to change the ACL for the resource by editing the ACL feed. For information on ACLs, see the Acl feed in the "Schemas of Hosted Feeds" section. Using FSCT to Manage Private GadgetsThe FSCT commands enable you to perform the following tasks to manage private gadgets:
Note: The commands shown in the sections that follow are for Linux. Windows users can enter the command itself without a file type. For example, to run the equivalent Windows command for ./insertEntry.sh, enter insertentry (Windows commands are not case sensitive). In the syntax statements that follow, the parameters are:
Add a Private Gadget
To add a private gadget to your domain:
After inserting the gadget, FSCT echoes back the inserted entity. For example: <?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Sample Enterprise Gadget" author="phedra" category="finance" />
<Content type="html">
<![CDATA[
<a href="javascript:getData()">Get Data</a>
<script type="text/javascript">
function getData() {
var params = {};
...View Private Gadget Entry
To display the XML code for a single gadget:
The gadget entity displays in the console. (An entity refers to the contents of the gadget spec, which is defined with the <entity> element block.) View All Gadgets
To display the XML code for all gadgets:
Gadget entities display in the console. Note:
An example getFeed listing of the PrivateGadget feed starts as follows: <entities>
<entity>
<screenshot></screenshot>
<submit_date>1237487950081</submit_date>
<url>http://www.google.com/a/feeds/server/g/domain/example.com/PrivateGadgetSpec/hello.xml</url>
<country>all</country>
<id>http://feedserver-enterprise.googleusercontent.com/a/example.com/g/PrivateGadget/03655085350586526872</id>
<author_email>developer@example.com</author_email>
<title>hello world example</title>
<thumbnail></thumbnail>
<description></description>
<localmetadata repeatable="true">
<title>hello world example</title>
<screenshot></screenshot>
<thumbnail></thumbnail>
<description></description>
<language>all</language>
<country>all</country>
</localmetadata>
<view repeatable="true">
<name>default</name>
<type>html</type>
</view>
<language>all</language>
<item_type>gadget</item_type>
</entity>
...
Update a Private Gadget
To update a gadget in the PrivateGadgetSpec feed source:
The updated gadget entity displays in the console. This command enables you to change the XML code content in the for gadgetSpecFile the gadget. Any part of the gadget spec can be changed as well as the functionality for the gadget.
Delete a Private Gadget
Publish a Private Gadget to the Private Directory
Publishing a gadget is required for the gadget to appear in the Private Directory. Published gadgets can then be added to a Google Sites page by users in a domain within Google Apps for Your Domain Premier Edition or Education Edition. Unpublish a Gadget
You can unpublish a gadget to remove it from domain's private gadget directory. Note: To find the gadget you want to unpublish, you need to find its gadget ID value. To unpublish a gadget:
Create a Private Gadget Category
Note: For a gadget to appear in a category, the gadget spec must contain the category attribute in the <ModulePref> element. For example: <ModulePrefs title="Sample Enterprise Gadget" author="phedra" category="Finance" /> To create a gadget category:
Delete a Private Gadget Category
Deletes a gadget category. For example: ./deleteEntry.sh PrivateGadgetCategory Finance Using FSCT to Manage Feed AccessUsing High Level ToolFor Per Domain FeedsTo set the ACLs of a resource, you execute a command like this: ./setAcl.sh PrivateGadgetSpec crud+john.doe@example.com which adds create, retrieve, update and delete access to user john.doe@example.com to the per domain feed PrivateGadgetSpec. To remove access, you use minus as opposed to plus. For example: ./setAcl.sh PrivateGadgetSpec d-john.doe@example.com which removes delete access from user john.doe@example.com on per domain feed PrivateGadgetSpec. You can verify the current ACLs by doing: ./getAcl.sh PrivateGadgetSpec ./getEntry.sh acl PrivateGadgetSpec To set the ACLs for an entry, you would use <feedName>/<entryName> as the resource. For example, ./setAcl.sh PrivateGadgetSpec/hello.xml crud-john.doe@example.com which removes all access from user john.doe@example.com on a specific private gadget call hello.xml. For Per User FeedsTo set ACLs on per user resources, do exact the same as the above except use getUserAcl.sh and setUserAcl.sh. For example, ./setUserAcl.sh PrivateGadgetSpec r+jane.doe@example.com adds read access to user jane.doe@example.com to current user's PrivateGadgetSpec feed. There is also a specific tool for sharing user's own private gadget with other users. For example, ./shareUserGadget.sh hello.xml friend@example.com colleague@example.com makes current user's own gadget hello.xml readable by friend@example.com and colleague@example.com. To verify the ACLs on a specific user gadget, do the following: ./getUserEntry.sh acl PrivateGadgetSpec%2Fhello.xml where "%2F" is "/" URL encoded. To remove sharing, just use unshareUserGadget.sh. General Command SyntaxgetAcl.sh <resource> getUserAcl.sh <resource> setAcl.sh <resource> <acl>{,<acl>}* setUserAcl.sh <resource> <acl>{,<acl>}* shareUserGadget.sh <gadgetName> <principal>{,<principal>}* unshareUserGadget.sh <gadgetName> <principal>{,<principal>}* where resource is either <feedName> or <feedName>/<entryName>, acl in the format of {c,r,u,d}{+|-}<principal> and principal the email address of an individual or group. For example, setUserAcl.sh PrivateGadgetSpec/hello.xml crud+project1@example.com,r+partner.guy@partner.com adds full access to users in group project1@example.com and read access to user partner.guy@partner.com to private gadget called hello.xml. Using Low Level ToolEvery hosted feed has an access control list (ACL) associated with it to control which users can do which operations on the feed and its entries. All hosted feeds have a default ACL that allows domain users to read from a feed and the domain's administrators to write to the feed. You can override a default ACL to suit the needs of your domain. The following is an example of setting the ACL for the PrivateGagetSpec feed, which is the aclEntity.xml listing: <entity xmlns="">
<name>PrivateGadgetSpec-acl</name>
<resourceInfo>
<resourceType>feed</resourceType>
<resourceRule>PrivateGadgetSpec</resourceRule>
</resourceInfo>
<authorizedEntities repeatable="true">
<operation>create</operation>
<entities repeatable="true">DOMAIN_ADMIN</entities>
<entities repeatable="true">gadget-dev@example.com</entities>
</authorizedEntities>
<authorizedEntities>
<operation>retrieve</operation>
<entities repeatable="true">DOMAIN_USERS</entities>
</authorizedEntities>
<authorizedEntities>
<operation>update</operation>
<entities repeatable="true">DOMAIN_ADMIN</entities>
<entities repeatable="true">gadget-dev@example.com</entities>
</authorizedEntities>
<authorizedEntities>
<operation>delete</operation>
<entities repeatable="true">DOMAIN_ADMIN</entities>
<entities repeatable="true">gadget-dev@example.com</entities>
</authorizedEntities>
</entity>Execute this command to create the ACL the first time: ./insertEntry.sh acl aclEntity.xml Then the PrivateGadgetSpec feed can be:
You can use the previous example as a template to produce an entity file specific to your needs. Here are the valid values you can use for the "entities" element:
To update an ACL, execute the following command: ./updateEntry.sh acl PrivateGagetSpec-acl aclEntity.xml If you want to change the ACL of another feed, for example, the PrivateGadgetCategory, create another ACL entity file and plug the feed name into the <resourceRule> element. Schemas of Hosted FeedsThe following feed sources are available with Google Apps.
Private Gadget EditorThe Private Gadget Editor (PGE) gadget enables you to create, change, and delete Google Gadgets. The PGE is a gadget that can be added only to a Google Sites page. Private gadgets are usable only by Google Apps for Your Domain Premier Edition or Education Edition. Private gadgets are gadgets that are available only to users in a domain. To add the PGE gadget to a Google Sites page:
After creating and saving a gadget in the PGE, use the Domain Gadget Directory Manager to publish the gadget to the domain's private gadget directory so that users can access it in Google Apps. Domain Gadget Directory ManagerThe Domain Gadget Directory Manager (DGDM) gadget enables domain administrators to manage a domain's public and private gadget directory. The DGDM is itself a gadget that you add to a Google Sites page. The DGDM gadget only works with Google Sites. Add the DGDM Gadget to Google SitesTo add the DGDM gadget to a Google Sites page:
Using DGDMThe Domain Gadget Directory Manager provides the following tabs:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
These instructions don't match reality as of 8/23/2009.
E.g.
1. In the install section, there are two links to download FSCT. - http://code.google.com/p/google-feedserver/downloads/list - http://google-feedserver.googlecode.com/files/google-feedserver-clienttool-2.0.4.zip
The two zip files have totally different contents and don't quite match any of the instructions in this tutorial.
2. None of the zip files mentioned in the Install section contain the ACL scripts. Where are the ACL scripts?
Creating Private Category example doesn't work as documented. The error is not helpful at all. Has anyone tested these instruction?
For this file: # cat ../../specs/FooCategory?.xml <entity xmlns="">
</entity>I get: # ./insertEntry.sh PrivateGadgetCategory? ../../specs/FooCategory?.xml The password cannot be null or blank Password: Exception in thread "main" com.google.feedserver.util.FeedServerClientException?: com.google.gdata.util.InvalidEntryException?: Bad Request invalid_input
Caused by: com.google.gdata.util.InvalidEntryException?: Bad Request invalid_input
#
Is it possible to create a private gadget for my community that can make xmlhttp requests to external sites? What are limitations on functionality for private gadgets? Are there plans to make it extensible the way that sharepoint is with an App Engine backend?
This page should be updated. Please, at least include a link to
Administering Gadgets in Google Sites http://www.google.com/support/a/bin/answer.py?hl=en&answer=168329
Does the Domain Gadget Directory Manager Gadget still work? We have been using it in our company for a year, and it seems that it has stopped working properly. However, recently, it seems this gadget is not working. The good news is that our domain seems to still recognize the selected gadgets because we still have our whitelisted gadgets available to users when they try to The gadget itself is no longer allowing us to whitelist or blacklist. The "Directory Preview" tab correctly shows the gadgets we have whitelisted. But the "Public Directory" tab's Add Gadgets button is greyed out. I have owner rights to the site it is in, and I have tried removing and re-adding the gadget, with the same outcome. Has something changed recently?