Import
This action makes it easy for administrators to create widget documents from widget xml files. If the widget is an OpenSocial widget type, the Import action can import proxy data and OAuth data for the widget. Separate files are used to store widget definition, proxy rules and OAuth information, as follows:
- Widget xml is included in a file named widget_name.extension.xml.
- Proxy rules are included in a file named widget_name.proxy.xml.
- OAuth information is included in a file named widget_name.oauth.xml.
When selecting the Import action, administrators need to browse for the widget xml file to import. The Import action will automatically locate the proxy and OAuth files in the same directory. If importing an OpenSocial widget, after importing the widget, the Administrator will need to approve the widget.
The following is a sample of a proxy definition file. You can specify gadget proxy rules as well as content proxy rules. The ContentProxy attribute of gadget element is used to identify whether it is a gadget proxy rule or content proxy rule.
<proxyrules>
<gadget url="http://server.com/directory/GadgetFile.xml">
<allow ip="9.6.1.0/255.255.255.0,9.6.1.1/255.255.255.0" /><!-- Multiple values are separated by comma -->
<deny ip="9.6.0.0/255.255.0.0,9.6.1.4" /><!-- Multiple values are separated by comma -->
<ProxyRule url="*" actions="GET,POST,PUT,HEAD,DELETE" headers="*" mime_types="" cookies=""></ProxyRule><!-- can be multiple-->
</gadget>
<gadget ContentProxy="true" url="http://server.com/directory/GadgetFile.xml">
<allow ip="9.6.1.0/255.255.255.0,9.6.1.1/255.255.255.0" /><!-- Multiple values are separated by comma -->
<deny ip="9.6.0.0/255.255.0.0,9.6.1.4" /><!-- Multiple values are separated by comma -->
<ProxyRule url="*" actions="GET,POST,PUT,HEAD,DELETE" headers="*" mime_types="" cookies=""></ProxyRule><!-- can be multiple-->
</gadget>
</proxyrules>
The following is a sample of an OAuth definition file. All OAuth2 information is defined under the OAuth2 element. All OAuth1.0a information is defined under the OAuth1a element. Multiple OAuth services can be defined in the same OAuth definition file.
<App ID="http://server.com/directory/GadgetFile.xml">
<OAuth2 ServiceName="OAuth2ServiceName"
AllowModuleOverides="false"
OAuth_Authorization_URI="http://server.com/oauth2/endpoint/provider/authorize"
OAuth_Access_Token_URI="http://server.com/oauth2/endpoint/provider/token"
Consumer_Key="key"
Consumer_Secret="secret"
Client_Type="CONFIDENTIAL"
Grant_Type="AUTHORIZATION_CODE"
Client_Auth_Type="STANDARD"
Use_Authorization_Header="false"
Use_Url_Parameter="true"
Shared="true"
/>
<OAuth1a ServiceName="OAuthServiceName"
OAuth_Request_Token_URI="request token"
OAuth_Authorization_URI="http://server.com/oauth/endpoint/authorize"
OAuth_Access_Token_URI="http://server.com/oauth/endpoint/token"
Consumer_Key="key"
Signature_Method="RSA-SHA1"
Consumer_Secret="secret"
Include_Body_Hash="true"
/>
</App>
Add Widget to Catalog
Use this action to add a widget, content type, or recognizer to the catalog. This action opens a dialog in which you can attach your .XML file and add a title, category name (optional), type designation, short description, and detailed description.
Note: For Notes clients, to automatically create a new document in the catalog for a specific widget in the My Widgets sidebar panel, if policies or preferences allow you to do so, you can right-click the widget in the My Widgets sidebar panel and select Publish to Catalog.
When you are running the catalog as an XPages application, the views contains the Add Widget action button. Use this action to add a widget, content type, or recognizer to the catalog.