<div dir="ltr">I'm sorry I did not explain my needs clearly.<div><br><div>In my case,I want to redesign the WebAdmin login GUI and add some javascript in my WebAdmin login page to do many own logic.At present I don't know how to add javascript in gwt framework,so I have to make a servlet to alternative the original WebAdmin login GUI.</div><div><br></div><div>After admin user log in the WebAdmin Portal through my servlet,UIPlugin which use restapi to get data in the portal cannot automate get the user's certificate,the uiplugin show me a prompt to input the username and password.</div><div><br></div><div>I am looking forward to your guide!</div><div><br></div><div> Thanks!</div><div><br></div><div>Best regards!</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-03 1:04 GMT+08:00 Vojtech Szocs <span dir="ltr"><<a href="mailto:vszocs@redhat.com" target="_blank">vszocs@redhat.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span><br>
<br>
----- Original Message -----<br>
> From: "Alexander Wels" <<a href="mailto:awels@redhat.com" target="_blank">awels@redhat.com</a>><br>
> To: "王成俊" <<a href="mailto:wcj2007@gmail.com" target="_blank">wcj2007@gmail.com</a>><br>
> Cc: <a href="mailto:devel@ovirt.org" target="_blank">devel@ovirt.org</a><br>
> Sent: Tuesday, December 2, 2014 1:59:21 PM<br>
> Subject: Re: [ovirt-devel] How To Auto Set oVirt RESTApi Session?<br>
><br>
> On Tuesday, December 02, 2014 09:45:49 AM 王成俊 wrote:<br>
> > Hi,awels:<br>
> ><br>
> > Thanks for your reply!<br>
> ><br>
> > I make this servlet to run the backend action which<br>
> > names "LoginAdminUser", because I want to check admin log in with it,so<br>
> > that my engine no need to log in through engine's loginpopupview.<br>
<br>
</span>Hm, so you're trying to automate WebAdmin GUI login? Can you please<br>
explain your use case without any technical (servlet etc.) details?<br>
<div><div><br>
> ><br>
> > But when I log in through my servlet,the restapi can not get the<br>
> > user's certificate.<br>
> ><br>
> > Can you tell me how to set and resume the restapi session in my case?<br>
> ><br>
> > Thanks!<br>
> ><br>
> > Best Regards!<br>
> ><br>
><br>
> You can login to the REST api using standard http connection techniques. For<br>
> instance basic auth you can login doing the following:<br>
><br>
> http://<user>%40<domain>:<password>@<engine_host>/ovirt-engine/api<br>
><br>
> Will list the available REST api.<br>
><br>
> But I am still not clear on what you are trying to do. Are you trying to<br>
> write<br>
> your own external servlet, that calls the REST api to do things for you? Or<br>
> are you trying to write a servlet that lives inside the context of the engine<br>
> and implements a new action?<br>
><br>
> Also please reply all, so we can keep the discussion on the mailing list so<br>
> other people can find it in the future.<br>
><br>
> Alexander<br>
><br>
><br>
> > 2014-12-02 5:42 GMT+08:00 Alexander Wels <<a href="mailto:awels@redhat.com" target="_blank">awels@redhat.com</a>>:<br>
> > > On Monday, December 01, 2014 04:56:04 PM 王成俊 wrote:<br>
> > > > Dear Sir:<br>
> > > ><br>
> > > > I am a new one in studing ovirt engine.Now,I have a Servlet in<br>
> > > ><br>
> > > > org.ovirt.engine.ui.frontend.server.gwt package.<br>
> > > ><br>
> > > > I want to call<br>
> > > ><br>
> > > > *Frontend.getInstance().getLoginHandler().**onLoginSuccess(userName,<br>
> > > > password, domain)* to set session for restapi in this servlet.<br>
> > > ><br>
> > > > But when I visit this servlet,it occur to show me an error<br>
> > > > which<br>
> > > ><br>
> > > > just like "*JBWEB000071: root cause java.lang.ClassNotFoundException:<br>
> > > > org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback from [Module<br>
> > > > &quot;deployment.engine.ear.webadmin.war:main&quot; from Service Module<br>
> > > > Loader]*". I found that this error is occured by calling*<br>
> > > > Frontend.getInstance()*.<br>
> > > ><br>
> > > > Can you tell me how to resolve this problem or a new way to<br>
> > > > set<br>
> > > ><br>
> > > > and resume restapi session in a servlet package of<br>
> > > > org.ovirt.engine.ui.front.server.gwt like the RestApiSessionManager in<br>
> > > > org.ovirt.engine.ui.webadmin.plugin.restapi package?<br>
> > > ><br>
> > > > thanks!<br>
> > > ><br>
> > > > Best Regards!<br>
> > ><br>
> > > Hi,<br>
> > ><br>
> > > The problem you are experiencing is the fact the Frontend.getInstance()<br>
> > > is<br>
> > > a<br>
> > > frontend (client, which get compiled to javascript) class, and the<br>
> > > servlet<br>
> > > is<br>
> > > on the server side where this class is not defined (as it is frontend<br>
> > > only).<br>
> > > Maybe if you could explain what you are trying to do we could assist<br>
> > > better.<br>
> > ><br>
> > > We have a mechanism of getting the REST api session on the front end when<br>
> > > you<br>
> > > log in. On the backend you don't really need that, since you are on the<br>
> > > backend. So your question sort of confuses me at this point.<br>
> > ><br>
> > > Alexander<br>
><br>
</div></div>> _______________________________________________<br>
> Devel mailing list<br>
> <a href="mailto:Devel@ovirt.org" target="_blank">Devel@ovirt.org</a><br>
> <a href="http://lists.ovirt.org/mailman/listinfo/devel" target="_blank">http://lists.ovirt.org/mailman/listinfo/devel</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div><strong><font color="#009900">用心体会,生活本来有滋有味!</font></strong></div>
</div></div></div>