<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>Hi guys,<br><br>an updated version of <span id="DWT4657" class="ZmSearchResult"><span id="DWT4661" class="ZmSearchResult"><span id="DWT3745" class="ZmSearchResult">UI</span></span></span> <span id="DWT4659" class="ZmSearchResult"><span id="DWT4663" class="ZmSearchResult"><span id="DWT3747" class="ZmSearchResult">Plugins</span></span></span> proof-of-c<span id="DWT4653" class="ZmSearchResult"><span id="DWT4665" class="ZmSearchResult">on</span></span>cept patch <span id="DWT3749" class="ZmSearchResult">is</span> now available for you to experiment with. It's basically revision 7 with new features, driven mostly by the feedback received so far.<br><br>You can download and apply latest <span id="DWT3757" class="ZmSearchResult">UI</span> <span id="DWT3759" class="ZmSearchResult">Plugins</span> patches from oVirt Gerrit code review system:<br><ul><li>rev<span id="DWT3761" class="ZmSearchResult">is</span>ion 6 - <span class="Object" id="OBJ_PREFIX_DWT3762_com_zimbra_url"><a target="_blank" href="http://gerrit.ovirt.org/#/c/8120/">http://gerrit.ovirt.org/#/c/8120/</a></span></li><li>rev<span id="DWT3764" class="ZmSearchResult">is</span>ion 7 update 2 - <span class="Object" id="OBJ_PREFIX_DWT3765_com_zimbra_url"><a target="_blank" href="http://gerrit.ovirt.org/#/c/9250/">http://gerrit.ovirt.org/#/c/9250/</a></span></li></ul>Please read <span id="DWT4669" class="ZmSearchResult"><span id="DWT4673" class="ZmSearchResult">on</span></span> to learn what's new. If you have any comments, questi<span id="DWT4677" class="ZmSearchResult"><span id="DWT4679" class="ZmSearchResult">on</span></span>s or ideas, please let me know!<br><br><hr style="width: 100%; height: 2px;"><br><strong>Engine REST API integration</strong><br style="font-weight: bold;"><br>UI plugin infrastructure no longer closes current REST API session upon WebAdmin user logout.<br><br>Since REST API session management uses JSESSIONID cookie to transmit session ID from client to server, the cookie will be present even after user signs out of WebAdmin. Upon subsequent login, this cookie will be sent as part of another "acquire REST API session" request, which means REST API will potentially reuse existing session based on JSESSIONID cookie value.<br><br><span style="text-decoration: underline; font-style: italic;">Known limitation:</span> due to REST API integration requiring WebAdmin user password when acquiring session, <em>RestApiSessionAcquired</em> function will NOT be called in case of auto login. This happens when the user signs into WebAdmin, closes the browser window (tab) without signing out, and opens it again - WebAdmin signs the user in automatically. In this case, there is no way (yet) to query for user password, which is required when acquiring REST API session. To work around this limitation, just sign out and sign in again. We're planning to address this limitation in future update.<br><br>Other than that, REST API integration works the same as before, calling <span style="font-style: italic;">RestApiSessionAcquired</span> function on plugins each time new or existing session is acquired, and keeping the session alive through heartbeat requests while the user stays authenticated. It is therefore guaranteed that <span style="font-style: italic;">RestApiSessionAcquired</span> function will be called each time the user signs into WebAdmin.<br><br><hr style="width: 100%; height: 2px;"><br><span style="font-weight: bold;">New API function: addSubTab</span><br style="font-weight: bold;"><br>It's now possible to add custom sub tabs under existing main tabs.<br><br>For example, to add custom sub tab under Host main tab:<br><br><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">api.addSubTab('Host', 'My Host Sub Tab', 'my-host-sub-tab', 'http://www.ovirt.org/');</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;"><br>The signature of <span style="font-style: italic;">addSubTab</span> function is following:<br><br><span style="font-style: italic;">addSubTab(entityTypeName, label, historyToken, contentUrl)</span><br style="font-style: italic;"><br><span style="font-style: italic;">entityTypeName</span> indicates the main tab entity type, i.e. under which main tab the sub tab should be added. See <span style="font-style: italic;">org.ovirt.engine.ui.webadmin.plugin.entity.EntityType</span> enum for supported values.<br><br><span style="font-style: italic;">label</span>, <span style="font-style: italic;">historyToken</span> and <span style="font-style: italic;">contentUrl</span> have same semantics as in <span style="font-style: italic;">addMainTab</span> function.<br><br><hr style="width: 100%; height: 2px;"><br><span style="font-weight: bold;">New API function: setTabContentUrl</span><br style="font-weight: bold;"><br>Use this function to update custom main or sub tab content URL, for example:<br><br><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">api.setTabContentUrl(</span><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">'my-host-sub-tab'</span><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">, </span><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">'http://www.example.org/'</span><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">);</span><br><br><hr style="width: 100%; height: 2px;"><br><span style="font-weight: bold;">New API function: setTabAccessible</span><br style="font-weight: bold;"><br>Use this function to control access to custom main or sub tab, for example:<br><br><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">api.setTabAccessible(</span><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">'my-host-sub-tab'</span><span style="font-family: courier new,courier,monaco,monospace,sans-serif;"></span><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">, false);</span><br><br>In the example above, the custom tab is set as not accessible. In practice, this means two things:<br><ul><li>corresponding tab header will be hidden on GUI</li><li>any attempt to navigate to this tab (e.g. by modifying URL with token
representing the tab) will be denied by the plugin infrastructure</li></ul><br><hr style="width: 100%; height: 2px;"><br><span style="font-weight: bold;">New events: UserLogin and UserLogout</span><br style="font-weight: bold;"><br>Plugins can now be notified when user logs into or out of WebAdmin GUI.<br><br>For example:<br><br style="font-family: courier new,courier,monaco,monospace,sans-serif;"><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">api.register({</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;"><span style="font-family: courier new,courier,monaco,monospace,sans-serif;"> UserLogin: function(userName, userId) {</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;"><span style="font-family: courier new,courier,monaco,monospace,sans-serif;"> ...</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;"><span style="font-family: courier new,courier,monaco,monospace,sans-serif;"> },</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;"><span style="font-family: courier new,courier,monaco,monospace,sans-serif;"> UserLogout: function() {</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;"><span style="font-family: courier new,courier,monaco,monospace,sans-serif;"> ...</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;"><span style="font-family: courier new,courier,monaco,monospace,sans-serif;"> }</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;"><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">});</span><br><br><hr style="width: 100%; height: 2px;"><br><span style="font-weight: bold;">New events: {EntityTypeName}SelectionChange</span><br style="font-weight: bold;"><br>Plugins can now be notified whenever existing main tab selection changes.<br><br>For example, a plugin could listen to Host main tab selection change like so:<br><br><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">api.register({</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;">
<span style="font-family: courier new,courier,monaco,monospace,sans-serif;"> HostSelectionChange: function() {</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;">
<span style="font-family: courier new,courier,monaco,monospace,sans-serif;"> var hostsSelected = arguments.length;<br> var firstHostId = arguments[0].entityId;<br style="font-family: courier new,courier,monaco,monospace,sans-serif;"></span>
<span style="font-family: courier new,courier,monaco,monospace,sans-serif;"> }</span><br style="font-family: courier new,courier,monaco,monospace,sans-serif;"><span style="font-family: courier new,courier,monaco,monospace,sans-serif;">});</span><br><br>For each supported entity type, <span style="font-style: italic;">{EntityTypeName}SelectionChange</span> event is defined: ClusterSelectionChange, DataCenterSelectionChange, DiskSelectionChange, HostSelectionChange, StorageSelectionChange, TemplateSelectionChange, VirtualMachineSelectionChange.<br><br>Note that each <span style="font-style: italic;">{EntityTypeName}SelectionChange </span>event handler function receives currently selected items as arguments.<br><br><hr style="width: 100%; height: 2px;"><br><span style="font-weight: bold;">Minor improvements</span><br style="font-weight: bold;"><br>Browser popup window triggered via <span style="font-style: italic;">showDialog</span> API function now shows scrollbars if the content doesn't fit the window.<br><br><span style="text-decoration: underline; font-style: italic;">Note on showDialog function implementation:</span> we're planning to replace the current (browser-based) popup implementation with one that properly integrates with WebAdmin dialog infrastructure. This is something that's still on my TODO list, planning to do this in near future.<br><br><hr style="width: 100%; height: 2px;"><br>Regards,<br>Vojtech<br><br></div></body></html>