Sample HubPolicy File
The HubPolicy file defines the URL the gadget is loaded from and the topics associated with either Managed Events or PageBusMessages the gadget is allowed to publish and subscribe to.
The HubPolicy Administrator does not allow you to add a HubPolicy if the domain URI value is a duplicate of one that already exists. However, a new domain URI value may have the same Origin value even though the domain URI is different. If you contribute a Gadget with a HubPolicy (or a HubPolicy is added) that contains an Origin value that is a duplicate of one that exists in the current global HubPolicy, then:
- Any permissions granted to this Gadget's domain URI is granted to all Gadgets with the same Origin.
- Any permissions granted to the other Gadgets with the same Origin are also granted to this Gadget.
For example, the following domain URIs have the same Origin value (http://host).
- http://host:port/apath?param1=example. The HubPolicy allows publish a, subscribe A.
- http://host:port/apath?param1=example¶m2=anotherExample. The HubPolicy allows publish b, subscribe B.
- http://host:anotherPort/anotherPath. The HubPolicy allows publish c, subscribe C.
Each of these can be added with its own domain element in the HubPolicy. Whatever permissions are given are accumulated for the same Origin. In other words, each one of the three has all of the combined permissions. For example, for all the domain URIs beginning http://host, the HubPolicy allows publish a,b,c, subscribe A,B,C.
The URI value must be URI encoded. See HubPolicy schema notes.
This example shows subscribe elements for each of the Openspace ManagedEvents that are currently fired to the ManagedHub.
<hubPolicy orderBy="DOMAIN"> <domain id="com.tibco.openspace.demo.Iframe1" uri="http%3A%2F%2Faliasappone%3A9090%2FManagedHubDemo%2FManagedHubDemo.html%3Fapp%3D1%26iframeTemplate%3Dhorizontal" > <publish> <topic grant="1" required="1" category="OpenspaceApp" name="com.tibco.bpm.web.client.model.managedevents.WebviewChangedEvent_Ext_ManagedEvent" /> <topic grant="1" required="1" category="iframe1" name="com.tibco.openspace.ManagedHubDemo.msg.iframe1" /> <topic grant="1" required="1" category="iframe1" name="com.tibco.bpm.web.client.model.managedevents.TemplateManagedEvent_Ext_ManagedEvent.iframe1" /> </publish> <subscribe> <topic grant="1" required="1" category="OpenspaceApp" name="com.tibco.bpm.web.client.model.managedevents.BusinessServiceEvent_Ext_ManagedEvent" /> <topic grant="1" required="1" category="OpenspaceApp" name="com.tibco.bpm.web.client.model.managedevents.LocaleChangedEvent_Ext_ManagedEvent" /> <topic grant="1" required="1" category="OpenspaceApp" name="com.tibco.bpm.web.client.model.managedevents.LoginEvent_Ext_ManagedEvent" /> <topic grant="1" required="1" category="OpenspaceApp" name="com.tibco.bpm.web.client.model.managedevents.LogoutEvent_Ext_ManagedEvent" /> <topic grant="1" required="1" category="OpenspaceApp" name="com.tibco.bpm.web.client.model.managedevents.PersistenceEvent_Ext_ManagedEvent" /> <topic grant="1" required="1" category="OpenspaceApp" name="com.tibco.bpm.web.client.model.managedevents.ProcessInstanceEvent_Ext_ManagedEvent" /> <topic grant="1" required="1" category="OpenspaceApp" name="com.tibco.bpm.web.client.model.managedevents.WorkItemDataEvent_Ext_ManagedEvent" /> <topic grant="1" required="1" category="OpenspaceApp" name="com.tibco.bpm.web.client.model.managedevents.WorkItemEvent_Ext_ManagedEvent" /> <topic grant="1" required="1" category="managerApp" name="com.tibco.openspace.ManagedHubDemo.msg.managerApp" /> <topic grant="1" required="1" category="" name="com.tibco.openspace.ManagedHubDemo.msg.scheduled" /> <topic grant="1" required="1" category="iframe2" name="com.tibco.openspace.ManagedHubDemo.msg.iframe2" /> <topic grant="1" required="1" category="managerApp" name="com.tibco.bpm.web.client.model.managedevents.TemplateManagedEvent_Ext_ManagedEvent.managerApp" /> <topic grant="1" required="1" category="iframe2" name="com.tibco.bpm.web.client.model.managedevents.TemplateManagedEvent_Ext_ManagedEvent.iframe2" /> </subscribe> </domain> </hubPolicy>