[Engine-devel] UI Plugins: PoC patch revision 7 is here
by Vojtech Szocs
------=_Part_6244399_613158090.1352995860557
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Hi guys,
the latest revisi on of UI Plugins proof-of-c on cept patch is now available for you to experiment with. I've split revision 7 changes apart from revision 6 to make it easier to review new features that were added into revision 7.
You can download and apply UI Plugins patches from oVirt Gerrit code review system:
1. revision 6 - http://gerrit.ovirt.org/#/c/8120/
2. revision 7 - http://gerrit.ovirt.org/#/c/9250/
Please read on to learn what's new in this revisi on . If you have any comments, questi on s or ideas, please let me know!
Engine REST API integration
UiInit is not the only event handler function anymore! :)
UI plugin infrastructure now integrates with Engine REST API by acquiring new REST API session [1] upon successful user authentication.
REST API session ID is provided to plugins via RestApiSessionAcquired event handler function. For example:
api.register({
RestApiSessionAcquired: function(sessionId) {
// Do something with newly acquired session ID
}
});
Note that UiInit function is still the first function to be invoked on the given plugin. Plugins can therefore expect RestApiSessionAcquired function to be called shortly after UiInit function.
For now, UI plugin infrastructure guarantees that acquired Engine REST API session will be valid while the user stays authenticated in WebAdmin. This is done by keeping REST API session alive via periodic heartbeats (HTTP requests) in the background. This also means that it's safe to store and use REST API session ID until RestApiSessionAcquired function is called again with new value. In future, we might consider dropping this kind of guarantee to avoid the keep-alive heartbeat, and use some kind of "is session valid" query to determine if the REST API session is still valid.
After the user signs out of WebAdmin, Engine REST API session will be closed, as per [1]. After signing in again, the process of acquiring new REST API session and calling RestApiSessionAcquired function repeats with new session ID value.
Engine REST API integration also works seamlessly with auto login - if the user is already logged in on the backend, running WebAdmin in new window (tab) will take him directly to the main (authenticated) section of the application. In this case, UI plugin infrastructure remembers the currently valid REST API session ID using HTML5 local storage (or cookie if the browser doesn't support it).
New API function: showDialog
It's now possible to open custom dialogs using showDialog function. For example:
api.register({
UiInit: function() {
api.addMainTabActionButton('Host', 'Show Test Dialog', {
onClick: function() {
api.showDialog('Test Dialog', 'http://www.ovirt.org/', 600, 400);
}
});
}
});
The signature of showDialog function is following:
showDialog (title, contentUrl, width, height)
For now, dialogs are shown using window.open API (non-modal browser popups ). This will be changed in future, providing close integration with GWTP / WebAdmin dialog infrastructure.
New API function: setMainTabContentUrl
It's now possible to update content URL of the given custom main tab using setMainTabContentUrl function. For example:
api.register({
UiInit: function() {
// Use 'about:blank' URL to display empty content
api.addMainTab('Custom Tab', 'custom-tab', 'about:blank');
},
RestApiSessionAcquired: function(sessionId) {
var url = 'http://www.ovirt.org/?s=' + encodeURIComponent(sessionId);
api.setMainTabContentUrl('custom-tab', url);
}
});
In the above example, we first add an empty custom main tab. We do this in UiInit event handler function because we know that it's the best place for one-time UI initialization :) As soon as we receive REST API session ID, we update the URL of the custom main tab. This is just an example how REST API session ID can be sent over to your server as part of main tab content URL.
The signature of setMainTabContentUrl function is following:
setMainTabContentUrl(historyToken, contentUrl)
Note that historyToken essentially identifies the custom main tab.
That's it for now, let me know what you think!
Regards,
Vojtech
[1] http://wiki.ovirt.org/wiki/Features/RESTSessionManagement
------=_Part_6244399_613158090.1352995860557
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>the latest revisi<span id=3D"DWT4651"=
class=3D"ZmSearchResult"><span id=3D"DWT4655" class=3D"ZmSearchResult">on<=
/span></span> of <span id=3D"DWT4657" class=3D"ZmSearchResult"><span id=3D"=
DWT4661" class=3D"ZmSearchResult">UI</span></span> <span id=3D"DWT4659" cla=
ss=3D"ZmSearchResult"><span id=3D"DWT4663" class=3D"ZmSearchResult">Plugins=
</span></span> proof-of-c<span id=3D"DWT4653" class=3D"ZmSearchResult"><spa=
n id=3D"DWT4665" class=3D"ZmSearchResult">on</span></span>cept patch is now=
available for you to experiment with. I've split revision 7 changes apart =
from revision 6 to make it easier to review new features that were added in=
to revision 7.<br><br>You can download and apply UI Plugins patches from oV=
irt Gerrit code review system:<br><ol><li>revision 6 - http://gerrit.ovirt.=
org/#/c/8120/</li><li>revision 7 - http://gerrit.ovirt.org/#/c/9250/<br></l=
i></ol>Please read <span id=3D"DWT4669" class=3D"ZmSearchResult"><span id=
=3D"DWT4673" class=3D"ZmSearchResult">on</span></span> to learn what's new =
in this revisi<span id=3D"DWT4671" class=3D"ZmSearchResult"><span id=3D"DWT=
4675" class=3D"ZmSearchResult">on</span></span>. If you have any comments, =
questi<span id=3D"DWT4677" class=3D"ZmSearchResult"><span id=3D"DWT4679" cl=
ass=3D"ZmSearchResult">on</span></span>s or ideas, please let me know!<br><=
br><hr style=3D"width: 100%; height: 2px;"><br><strong>Engine REST API inte=
gration</strong><br style=3D"font-weight: bold;"><br><em>UiInit</em> is not=
the only event handler function anymore! :)<br><br>UI plugin infrastructur=
e now integrates with Engine REST API by acquiring new REST API session [1]=
upon successful user authentication.<br><br>REST API session ID is provide=
d to plugins via <span style=3D"font-style: italic;">RestApiSessionAcquired=
</span> event handler function. For example:<br><br><span style=3D"font-fam=
ily: courier new,courier,monaco,monospace,sans-serif;">api.register({</span=
><br style=3D"font-family: courier new,courier,monaco,monospace,sans-serif;=
"><span style=3D"font-family: courier new,courier,monaco,monospace,sans-ser=
if;"> RestApiSessionAcquired: function(sessionId) {</span><br style=
=3D"font-family: courier new,courier,monaco,monospace,sans-serif;"><span st=
yle=3D"font-family: courier new,courier,monaco,monospace,sans-serif;"> =
; // Do something with newly acquired session ID</span><br styl=
e=3D"font-family: courier new,courier,monaco,monospace,sans-serif;"><span s=
tyle=3D"font-family: courier new,courier,monaco,monospace,sans-serif;">&nbs=
p; }</span><br style=3D"font-family: courier new,courier,monaco,monospace,s=
ans-serif;"><span style=3D"font-family: courier new,courier,monaco,monospac=
e,sans-serif;">});</span><br><br>Note that <span style=3D"font-style: itali=
c;">UiInit</span> function is still the first function to be invoked on the=
given plugin. Plugins can therefore expect <span style=3D"font-style: ital=
ic;">RestApiSessionAcquired</span> function to be called shortly after <spa=
n style=3D"font-style: italic;">UiInit</span> function.<br><br>For now, UI =
plugin infrastructure guarantees that acquired Engine REST API session will=
be valid while the user stays authenticated in WebAdmin. This is done by k=
eeping REST API session alive via periodic heartbeats (HTTP requests) in th=
e background. This also means that it's safe to store and use REST API sess=
ion ID until <span style=3D"font-style: italic;">RestApiSessionAcquired</sp=
an> function is called again with new value. In future, we might consider d=
ropping this kind of guarantee to avoid the keep-alive heartbeat, and use s=
ome kind of "is session valid" query to determine if the REST API session i=
s still valid.<br><br>After the user signs out of WebAdmin, Engine REST API=
session will be closed, as per [1]. After signing in again, the process of=
acquiring new REST API session and calling <span style=3D"font-style: ital=
ic;">RestApiSessionAcquired</span> function repeats with new session ID val=
ue.<br><br>Engine REST API integration also works seamlessly with auto logi=
n - if the user is already logged in on the backend, running WebAdmin in ne=
w window (tab) will take him directly to the main (authenticated) section o=
f the application. In this case, UI plugin infrastructure remembers the cur=
rently valid REST API session ID using HTML5 local storage (or cookie if th=
e browser doesn't support it).<br><br><hr style=3D"width: 100%; height: 2px=
;"><br><span style=3D"font-weight: bold;">New API function: showDialog</spa=
n><br style=3D"font-weight: bold;"><br>It's now possible to open custom dia=
logs using <span style=3D"font-style: italic;">showDialog</span> function. =
For example:<br><br><span style=3D"font-family: courier new,courier,monaco,=
monospace,sans-serif;">api.register({</span><br style=3D"font-family: couri=
er new,courier,monaco,monospace,sans-serif;"><span style=3D"font-family: co=
urier new,courier,monaco,monospace,sans-serif;"> UiInit: function() {=
</span><br style=3D"font-family: courier new,courier,monaco,monospace,sans-=
serif;"><span style=3D"font-family: courier new,courier,monaco,monospace,sa=
ns-serif;"> api.addMainTabActionButton('Host', 'Show Test=
Dialog', {</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;"> onClick: function() {<=
/span><br style=3D"font-family: courier new,courier,monaco,monospace,sans-s=
erif;"><span style=3D"font-family: courier new,courier,monaco,monospace,san=
s-serif;"> api.showDialog('Test D=
ialog', 'http://www.ovirt.org/', 600, 400);<br> &nbs=
p; }</span><br style=3D"font-family: courier new,courier,monaco,monospace,s=
ans-serif;"><span style=3D"font-family: courier new,courier,monaco,monospac=
e,sans-serif;"> });</span><br style=3D"font-family: couri=
er new,courier,monaco,monospace,sans-serif;"><span style=3D"font-family: co=
urier new,courier,monaco,monospace,sans-serif;"> }</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;">});</spa=
n><br style=3D"font-family: courier new,courier,monaco,monospace,sans-serif=
;"><br>The signature of <span style=3D"font-style: italic;">showDialog</spa=
n> function is following:<br><br><div style=3D"margin-left: 40px;"><span st=
yle=3D"font-style: italic;">showDialog(title, contentUrl, width, height)</s=
pan><br></div><br>For now, dialogs are shown using <span style=3D"font-styl=
e: italic;">window.open</span> API (non-modal browser popups). This will be=
changed in future, providing close integration with GWTP / WebAdmin dialog=
infrastructure.<br><br><hr style=3D"width: 100%; height: 2px;"><br><span s=
tyle=3D"font-weight: bold;">New API function: setMainTabContentUrl</span><b=
r style=3D"font-weight: bold;"><br>It's now possible to update content URL =
of the given custom main tab using <span style=3D"font-style: italic;">setM=
ainTabContentUrl</span> function. For example:<br><br><span style=3D"font-f=
amily: courier new,courier,monaco,monospace,sans-serif;">api.register({</sp=
an><br style=3D"font-family: courier new,courier,monaco,monospace,sans-seri=
f;"><span style=3D"font-family: courier new,courier,monaco,monospace,sans-s=
erif;"> UiInit: function() {</span><br style=3D"font-family: courier =
new,courier,monaco,monospace,sans-serif;"><span style=3D"font-family: couri=
er new,courier,monaco,monospace,sans-serif;"> // Use 'abo=
ut:blank' URL to display empty content</span><br style=3D"font-family: cour=
ier new,courier,monaco,monospace,sans-serif;"><span style=3D"font-family: c=
ourier new,courier,monaco,monospace,sans-serif;"> api.add=
MainTab('Custom Tab', 'custom-tab', 'about:blank');</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;"> },</sp=
an><br style=3D"font-family: courier new,courier,monaco,monospace,sans-seri=
f;"><span style=3D"font-family: courier new,courier,monaco,monospace,sans-s=
erif;"> RestApiSessionAcquired: function(sessionId) {</span><br style=
=3D"font-family: courier new,courier,monaco,monospace,sans-serif;"><span st=
yle=3D"font-family: courier new,courier,monaco,monospace,sans-serif;"> =
; var url =3D 'http://www.ovirt.org/?s=3D' + encodeURIComponent=
(sessionId);</span><br style=3D"font-family: courier new,courier,monaco,mon=
ospace,sans-serif;"><span style=3D"font-family: courier new,courier,monaco,=
monospace,sans-serif;"> api.setMainTabContentUrl('custom-=
tab', url);</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 style=3D"font-family=
: courier new,courier,monaco,monospace,sans-serif;"><br>In the above exampl=
e, we first add an empty custom main tab. We do this in <span style=3D"font=
-style: italic;">UiInit</span> event handler function because we know that =
it's the best place for one-time UI initialization :) As soon as we receive=
REST API session ID, we update the URL of the custom main tab. This is jus=
t an example how REST API session ID can be sent over to your server as par=
t of main tab content URL.<br><br>The signature of <span style=3D"font-styl=
e: italic;">setMainTabContentUrl</span> function is following:<br><br><div =
style=3D"margin-left: 40px;"><span style=3D"font-style: italic;">setMainTab=
ContentUrl(historyToken, contentUrl)</span><br></div><br>Note that <span st=
yle=3D"font-style: italic;">historyToken</span> essentially identifies the =
custom main tab.<br><br><hr style=3D"width: 100%; height: 2px;"><br>That's =
it for now, let me know what you think!<br><br>Regards,<br>Vojtech<br><br><=
span style=3D"font-weight: bold;"></span><br>[1] http://wiki.ovirt.org/wiki=
/Features/RESTSessionManagement<br><br></div></body></html>
------=_Part_6244399_613158090.1352995860557--
12 years
[Engine-devel] Failed to start service jboss.deployment.subunit."engine.ear"
by Michael Pasternak
any clue what it might be? (latest sources + db)
2012-12-12 12:51:27,658 INFO [org.ovirt.engine.core.bll.Backend] (MSC service thread 1-7) Start time: 12/12/12 12:51 PM
2012-12-12 12:51:27,685 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service
jboss.deployment.subunit."engine.ear"."engine-bll.jar".component.Backend.START: org.jboss.msc.service.StartException in service
jboss.deployment.subunit."engine.ear"."engine-bll.jar".component.Backend.START: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.6.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.6.0_20]
at java.lang.Thread.run(Thread.java:636) [rt.jar:1.6.0_20]
Caused by: java.lang.IllegalStateException: JBAS011048: Failed to construct component instance
at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85)
at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:116)
at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:130)
at org.jboss.as.ee.component.ComponentStartService.start(ComponentStartService.java:44)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
... 3 more
Caused by: javax.ejb.EJBException: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select * from get_all_commands()]; nested
exception is org.postgresql.util.PSQLException: ERROR: function get_all_commands() does not exist
Hint: No function matches the given name and argument types. You might need to add explicit type casts.
Position: 16
...
--
Michael Pasternak
RedHat, ENG-Virtualization R&D
12 years
[Engine-devel] upgrade script
by Yair Zaslavsky
Hi all,
Please pay attention - when you send patches with upgrade script the prefix should be
03_02_XXXX_
and not
03_01_XXXX_
For example - this script was originally 03_01_XXXX once, and it's in correct
backend/manager/dbscripts/upgrade/03_02_0020_add_libvirt_version_col.sql
Yair
12 years
[Engine-devel] compatibility version
by Laszlo Hornyak
Hi,
When I install an ovirt engine from scratch, the Default DC is set to Compatibility version 3.1, but when I create a new DC, it's Compatibility version is set to 3.2 by default. Is this intentional? Why?
Laszlo
12 years
[Engine-devel] UI Plugins: PoC patch revision 7 update 3 is now available
by Vojtech Szocs
------=_Part_16659810_2134251194.1355163009146
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Hi everyone,
just a quick update on UI Plugins proof-of-c on cept patch - new patch for revision 7 (update 3) is now available.
You can download and apply latest patches from oVirt Gerrit code review system:
* rev is ion 6 - http://gerrit.ovirt.org/#/c/8120/
* rev is ion 7 update 3 - http://gerrit.ovirt.org/#/c/9250/
* REST API session patch: http://gerrit.ovirt.org/#/c/9820/
Please read on to learn what's new.
Engine REST API integration
REST API session patch (see above) now ensures that new session is acquired each time the user logs into WebAdmin, despite the fact that UI plugin infrastructure doesn't close existing REST API session on server after user logout. This means each user login equals new REST API session, based on provided login credentials. This fixes the problem of reusing existing (un-closed) session from previous user login. Many thanks to Michael Pasternak and Oved Ourfalli for the patch!
Additionally, known limitation with regard to auto login has been fixed - UI plugin infrastructure now remembers REST API session ID on client (using HTML5 storage / cookie fallback) and uses it for auto login process. UI plugin infrastructure assumes that for auto login, REST API session has already been acquired (via classic login) and is still active at the time of auto login.
Updated API function: register
To make it clear that api.register function should be called exactly once , the function behavior has been changed in the following way:
* previously, you could call api.register multiple times, last call would "win" with regard to passed event handler object
* now, you can call api.register only once, subsequent calls will have no effect (the event handler object has already been set )
Regards,
Vojtech
------=_Part_16659810_2134251194.1355163009146
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 everyone,<br><br>just a quick update on <span id=
=3D"DWT4657" class=3D"ZmSearchResult"><span id=3D"DWT4661" class=3D"ZmSearc=
hResult"><span id=3D"DWT3745" class=3D"ZmSearchResult">UI</span></span></sp=
an> <span id=3D"DWT4659" class=3D"ZmSearchResult"><span id=3D"DWT4663" clas=
s=3D"ZmSearchResult"><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 =
- new patch for revision 7 (update 3) is now available.<br><br>You can down=
load and apply latest <span id=3D"DWT3757" class=3D"ZmSearchResult"></span>=
patches from oVirt Gerrit code review system:<br><ul><li>rev<span id=3D"DWT=
3761" class=3D"ZmSearchResult">is</span>ion 6 - <span class=3D"Object" id=
=3D"OBJ_PREFIX_DWT3762_com_zimbra_url"><span class=3D"Object" id=3D"OBJ_PRE=
FIX_DWT6991_com_zimbra_url"><a target=3D"_blank" href=3D"http://gerrit.ovir=
t.org/#/c/8120/">http://gerrit.ovirt.org/#/c/8120/</a></span></span></li><l=
i>rev<span id=3D"DWT3764" class=3D"ZmSearchResult">is</span>ion 7 update 3 =
- <span class=3D"Object" id=3D"OBJ_PREFIX_DWT3765_com_zimbra_url"><span cla=
ss=3D"Object" id=3D"OBJ_PREFIX_DWT6992_com_zimbra_url"><a target=3D"_blank"=
href=3D"http://gerrit.ovirt.org/#/c/9250/">http://gerrit.ovirt.org/#/c/925=
0/</a></span></span></li><li><span class=3D"Object" id=3D"OBJ_PREFIX_DWT376=
5_com_zimbra_url"><span class=3D"Object" id=3D"OBJ_PREFIX_DWT6992_com_zimbr=
a_url">REST API session patch: http://gerrit.ovirt.org/#/c/9820/</span></sp=
an></li></ul><p>Please read on to learn what's new.</p><p><br></p><hr style=
=3D"width: 100%; height: 2px;"><br><p><strong>Engine REST API integration</=
strong></p><p><br><strong></strong></p><p><strong><span style=3D"font-weigh=
t: normal;">REST API session patch (see above) now ensures that new session=
is acquired each time the user logs into WebAdmin, despite the fact that <=
/span></strong>UI plugin infrastructure doesn't close existing REST API ses=
sion on server after user logout. This means each user login equals new RES=
T API session, based on provided login credentials. This fixes the problem =
of reusing existing (un-closed) session from previous user login. Many than=
ks to Michael Pasternak and Oved Ourfalli for the patch!<br></p><p><br></p>=
<p>Additionally, known limitation with regard to auto login has been fixed =
- <strong><span style=3D"font-weight: normal;"></span></strong>UI plugin in=
frastructure now remembers REST API session ID on client (using HTML5 stora=
ge / cookie fallback) and uses it for auto login process. <strong><span sty=
le=3D"font-weight: normal;"></span></strong>UI plugin infrastructure assume=
s that for auto login, REST API session has already been acquired (via clas=
sic login) and is still active at the time of auto login.<br><strong><span =
style=3D"font-weight: normal;"></span></strong></p><p><br><strong><span sty=
le=3D"font-weight: normal;"></span></strong></p><p><strong><span style=3D"f=
ont-weight: normal;"></span></strong></p><hr style=3D"width: 100%; height: =
2px;"><br><strong>Updated API function: register</strong><br style=3D"font-=
weight: bold;"><br>To make it clear that <em>api.register</em> function sho=
uld be called <u>exactly once</u>, the function behavior has been changed i=
n the following way:<br><ul><li>previously, you could call <span style=3D"f=
ont-style: italic;">api.register</span> multiple times, last call would "wi=
n" with regard to passed event handler object</li><li>now, you can call <sp=
an style=3D"font-style: italic;">api.register</span> only once, subsequent =
calls will have no effect (the event handler object has already been set)<b=
r></li></ul><p><br></p><hr style=3D"width: 100%; height: 2px;"><p><br></p>R=
egards,<br>Vojtech<br><br><p><strong></strong></p></div></body></html>
------=_Part_16659810_2134251194.1355163009146--
12 years