------=_Part_15061948_104424654.1354837817204
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Hi guys,
an updated version of UI Plugins proof-of-c on cept patch is now available for you to
experiment with. It's basically revision 7 with new features, driven mostly by the
feedback received so far.
You can download and apply latest UI Plugins patches from oVirt Gerrit code review system:
* rev is ion 6 -
http://gerrit.ovirt.org/#/c/8120/
* rev is ion 7 update 2 -
http://gerrit.ovirt.org/#/c/9250/
Please read on to learn what's new. If you have any comments, questi on s or ideas,
please let me know!
Engine REST API integration
UI plugin infrastructure no longer closes current REST API session upon WebAdmin user
logout.
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.
Known limitation: due to REST API integration requiring WebAdmin user password when
acquiring session, RestApiSessionAcquired 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.
Other than that, REST API integration works the same as before, calling
RestApiSessionAcquired 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 RestApiSessionAcquired function will be
called each time the user signs into WebAdmin.
New API function: addSubTab
It's now possible to add custom sub tabs under existing main tabs.
For example, to add custom sub tab under Host main tab:
api.addSubTab('Host', 'My Host Sub Tab', 'my-host-sub-tab',
'http://www.ovirt.org/');
The signature of addSubTab function is following:
addSubTab(entityTypeName, label, historyToken, contentUrl)
entityTypeName indicates the main tab entity type, i.e. under which main tab the sub tab
should be added. See org.ovirt.engine.ui.webadmin.plugin.entity.EntityType enum for
supported values.
label , historyToken and contentUrl have same semantics as in addMainTab function.
New API function: setTabContentUrl
Use this function to update custom main or sub tab content URL, for example:
api.setTabContentUrl( 'my-host-sub-tab' , 'http://www.example.org/' );
New API function: setTabAccessible
Use this function to control access to custom main or sub tab, for example:
api.setTabAccessible( 'my-host-sub-tab' , false);
In the example above, the custom tab is set as not accessible. In practice, this means two
things:
* corresponding tab header will be hidden on GUI
* any attempt to navigate to this tab (e.g. by modifying URL with token representing
the tab) will be denied by the plugin infrastructure
New events: UserLogin and UserLogout
Plugins can now be notified when user logs into or out of WebAdmin GUI.
For example:
api.register({
UserLogin: function(userName, userId) {
...
},
UserLogout: function() {
...
}
});
New events: {EntityTypeName}SelectionChange
Plugins can now be notified whenever existing main tab selection changes .
For example, a plugin could listen to Host main tab selection change like so:
api.register({
HostSelectionChange: function() {
var hostsSelected = arguments.length;
var firstHostId = arguments[0].entityId;
}
});
For each supported entity type, {EntityTypeName}SelectionChange event is defined:
ClusterSelectionChange, DataCenterSelectionChange, DiskSelectionChange,
HostSelectionChange, StorageSelectionChange, TemplateSelectionChange,
VirtualMachineSelectionChange.
Note that each {EntityTypeName}SelectionChange event handler function receives currently
selected items as arguments.
Minor improvements
Browser popup window triggered via showDialog API function now shows scrollbars if the
content doesn't fit the window.
Note on showDialog function implementation: 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.
Regards,
Vojtech
------=_Part_15061948_104424654.1354837817204
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><head><style type=3D'text/css'>p { margin: 0;
}</style></head><body><=
div style=3D'font-family: times new roman,new york,times,serif; font-size: =
12pt; color: #000000'>Hi guys,<br><br>an updated version of <span
id=3D"DWT=
4657" class=3D"ZmSearchResult"><span id=3D"DWT4661"
class=3D"ZmSearchResult=
"><span id=3D"DWT3745"
class=3D"ZmSearchResult">UI</span></span></span> <sp=
an id=3D"DWT4659" class=3D"ZmSearchResult"><span
id=3D"DWT4663" class=3D"Zm=
SearchResult"><span id=3D"DWT3747"
class=3D"ZmSearchResult">Plugins</span><=
/span></span> proof-of-c<span id=3D"DWT4653"
class=3D"ZmSearchResult"><span=
id=3D"DWT4665"
class=3D"ZmSearchResult">on</span></span>cept patch <span i=
d=3D"DWT3749" class=3D"ZmSearchResult">is</span> now
available for you to e=
xperiment 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=3D"DWT3757" class=3D"ZmSearchResult">UI</span>
<span id=3D"DWT3759"=
class=3D"ZmSearchResult">Plugins</span> patches from oVirt Gerrit code
rev=
iew system:<br><ul><li>rev<span id=3D"DWT3761"
class=3D"ZmSearchResult">is<=
/span>ion 6 - <span class=3D"Object"
id=3D"OBJ_PREFIX_DWT3762_com_zimbra_ur=
l"><a target=3D"_blank"
href=3D"http://gerrit.ovirt.org/#/c/8120/">http://g=
errit.ovirt.org/#/c/8120/</a></span></li><li>rev&...
id=3D"DWT3764" class=
=3D"ZmSearchResult">is</span>ion 7 update 2 - <span
class=3D"Object" id=3D"=
OBJ_PREFIX_DWT3765_com_zimbra_url"><a target=3D"_blank"
href=3D"http://gerr=
it.ovirt.org/#/c/9250/">http://gerrit.ovirt.org/#/c/9250/</a&g...
ul>Please read <span id=3D"DWT4669"
class=3D"ZmSearchResult"><span id=3D"DW=
T4673" class=3D"ZmSearchResult">on</span></span> to learn
what's new. If yo=
u have any comments, questi<span id=3D"DWT4677"
class=3D"ZmSearchResult"><s=
pan id=3D"DWT4679"
class=3D"ZmSearchResult">on</span></span>s or ideas, ple=
ase let me know!<br><br><hr style=3D"width: 100%; height:
2px;"><br><strong=
Engine REST API integration</strong><br
style=3D"font-weight: bold;"><br>U=
I plugin infrastructure no
longer closes current REST API session upon WebA=
dmin user logout.<br><br>Since REST API session management uses JSESSIONID =
cookie to transmit session ID from client to server, the cookie will be pre=
sent even after user signs out of WebAdmin. Upon subsequent login, this coo=
kie will be sent as part of another "acquire REST API session" request, whi=
ch means REST API will potentially reuse existing session based on JSESSION=
ID cookie value.<br><br><span style=3D"text-decoration: underline;
font-sty=
le: 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 t=
he user signs into WebAdmin, closes the browser window (tab) without signin=
g out, and opens it again - WebAdmin signs the user in automatically. In th=
is case, there is no way (yet) to query for user password, which is require=
d when acquiring REST API session. To work around this limitation, just sig=
n out and sign in again. We're planning to address this limitation in futur=
e update.<br><br>Other than that, REST API integration works the same as be=
fore, calling <span style=3D"font-style:
italic;">RestApiSessionAcquired</s=
pan> 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=3D"font-style: i=
talic;">RestApiSessionAcquired</span> function will be called each time
the=
user signs into WebAdmin.<br><br><hr style=3D"width: 100%; height:
2px;"><=
br><span style=3D"font-weight: bold;">New API function:
addSubTab</span><br=
style=3D"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 H=
ost main tab:<br><br><span style=3D"font-family: courier
new,courier,monaco=
,monospace,sans-serif;">api.addSubTab('Host', 'My Host Sub Tab',
'my-host-s=
ub-tab', 'http://www.ovirt.org/');</span><br
style=3D"font-family: courier =
new,courier,monaco,monospace,sans-serif;"><br>The signature of <span
style=
=3D"font-style: italic;">addSubTab</span> function is
following:<br><br><sp=
an style=3D"font-style: italic;">addSubTab(entityTypeName, label, historyTo=
ken, contentUrl)</span><br style=3D"font-style:
italic;"><br><span style=3D=
"font-style: italic;">entityTypeName</span> indicates the main tab
entity t=
ype, i.e. under which main tab the sub tab should be added. See <span style=
=3D"font-style: italic;">org.ovirt.engine.ui.webadmin.plugin.entity.EntityT=
ype</span> enum for supported values.<br><br><span
style=3D"font-style: ita=
lic;">label</span>, <span style=3D"font-style:
italic;">historyToken</span>=
and <span style=3D"font-style: italic;">contentUrl</span> have same
semant=
ics as in <span style=3D"font-style: italic;">addMainTab</span>
function.<b=
r><br><hr style=3D"width: 100%; height: 2px;"><br><span
style=3D"font-weigh=
t: bold;">New API function: setTabContentUrl</span><br
style=3D"font-weight=
: bold;"><br>Use this function to update custom main or sub tab content
URL=
, for example:<br><br><span style=3D"font-family: courier
new,courier,monac=
o,monospace,sans-serif;">api.setTabContentUrl(</span><span
style=3D"font-fa=
mily: courier
new,courier,monaco,monospace,sans-serif;">'my-host-sub-tab'</=
span><span style=3D"font-family: courier new,courier,monaco,monospace,sans-=
serif;">, </span><span style=3D"font-family: courier
new,courier,monaco,mon=
ospace,sans-serif;">'http://www.example.org/'</span>...
style=3D"font-fam=
ily: courier
new,courier,monaco,monospace,sans-serif;">);</span><br><br><hr=
style=3D"width: 100%; height: 2px;"><br><span
style=3D"font-weight: bold;"=
New API function: setTabAccessible</span><br
style=3D"font-weight: bold;">=
<br>Use this function to control
access to custom main or sub tab, for exam=
ple:<br><br><span style=3D"font-family: courier
new,courier,monaco,monospac=
e,sans-serif;">api.setTabAccessible(</span><span
style=3D"font-family: cour=
ier
new,courier,monaco,monospace,sans-serif;">'my-host-sub-tab'</span><span=
style=3D"font-family: courier
new,courier,monaco,monospace,sans-serif;"></=
span><span style=3D"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>correspo=
nding tab header will be hidden on GUI</li><li>any attempt to navigate to t=
his tab (e.g. by modifying URL with token=20
representing the tab) will be denied by the plugin infrastructure</li></ul>=
<br><hr style=3D"width: 100%; height: 2px;"><br><span
style=3D"font-weight:=
bold;">New events: UserLogin and UserLogout</span><br
style=3D"font-weight=
: bold;"><br>Plugins can now be notified when user logs into or out of
WebA=
dmin GUI.<br><br>For example:<br><br style=3D"font-family:
courier new,cour=
ier,monaco,monospace,sans-serif;"><span style=3D"font-family: courier
new,c=
ourier,monaco,monospace,sans-serif;">api.register({</span><br
style=3D"font=
-family: courier new,courier,monaco,monospace,sans-serif;"><span
style=3D"f=
ont-family: courier new,courier,monaco,monospace,sans-serif;"> UserLo=
gin: function(userName, userId) {</span><br style=3D"font-family: courier
n=
ew,courier,monaco,monospace,sans-serif;"><span style=3D"font-family:
courie=
r new,courier,monaco,monospace,sans-serif;">
...</span><b=
r style=3D"font-family: courier
new,courier,monaco,monospace,sans-serif;"><=
span style=3D"font-family: courier new,courier,monaco,monospace,sans-serif;=
"> },</span><br style=3D"font-family: courier
new,courier,monaco,mono=
space,sans-serif;"><span style=3D"font-family: courier
new,courier,monaco,m=
onospace,sans-serif;"> UserLogout: function() {</span><br
style=3D"fo=
nt-family: courier new,courier,monaco,monospace,sans-serif;"><span style=3D=
"font-family: courier
new,courier,monaco,monospace,sans-serif;">  =
; ...</span><br style=3D"font-family: courier
new,courier,monaco,mono=
space,sans-serif;"><span style=3D"font-family: courier
new,courier,monaco,m=
onospace,sans-serif;"> }</span><br style=3D"font-family:
courier new,=
courier,monaco,monospace,sans-serif;"><span style=3D"font-family: courier
n=
ew,courier,monaco,monospace,sans-serif;">});</span><br><br><hr
style=3D"wid=
th: 100%; height: 2px;"><br><span style=3D"font-weight:
bold;">New events: =
{EntityTypeName}SelectionChange</span><br style=3D"font-weight:
bold;"><br>=
Plugins can now be notified whenever existing main tab selection changes.<b=
r><br>For example, a plugin could listen to Host main tab selection change =
like so:<br><br><span style=3D"font-family: courier
new,courier,monaco,mono=
space,sans-serif;">api.register({</span><br style=3D"font-family:
courier n=
ew,courier,monaco,monospace,sans-serif;">
<span style=3D"font-family: courier new,courier,monaco,monospace,sans-serif=
;"> HostSelectionChange: function() {</span><br
style=3D"font-family:=
courier new,courier,monaco,monospace,sans-serif;">
<span style=3D"font-family: courier new,courier,monaco,monospace,sans-serif=
;"> var hostsSelected =3D
arguments.length;<br> &nbs=
p; var firstHostId =3D arguments[0].entityId;<br style=3D"font-family=
: courier new,courier,monaco,monospace,sans-serif;"></span>
<span style=3D"font-family: courier new,courier,monaco,monospace,sans-serif=
;"> }</span><br style=3D"font-family: courier
new,courier,monaco,mono=
space,sans-serif;"><span style=3D"font-family: courier
new,courier,monaco,m=
onospace,sans-serif;">});</span><br><br>For each supported
entity type, <sp=
an style=3D"font-style: italic;">{EntityTypeName}SelectionChange</span>
eve=
nt is defined: ClusterSelectionChange, DataCenterSelectionChange, DiskSelec=
tionChange, HostSelectionChange, StorageSelectionChange, TemplateSelectionC=
hange, VirtualMachineSelectionChange.<br><br>Note that each <span
style=3D"=
font-style: italic;">{EntityTypeName}SelectionChange </span>event handler
f=
unction receives currently selected items as arguments.<br><br><hr
style=3D=
"width: 100%; height: 2px;"><br><span style=3D"font-weight:
bold;">Minor im=
provements</span><br style=3D"font-weight: bold;"><br>Browser
popup window =
triggered via <span style=3D"font-style: italic;">showDialog</span>
API fun=
ction now shows scrollbars if the content doesn't fit the
window.<br><br><s=
pan style=3D"text-decoration: underline; font-style: italic;">Note on showD=
ialog function implementation:</span> we're planning to replace the current=
(browser-based) popup implementation with one that properly integrates wit=
h WebAdmin dialog infrastructure. This is something that's still on my TODO=
list, planning to do this in near future.<br><br><hr style=3D"width:
100%;=
height:
2px;"><br>Regards,<br>Vojtech<br><br></div></body></html>
------=_Part_15061948_104424654.1354837817204--