Rest Template setter used in CloudFoundry client lib - cloud-foundry

We are trying to use the CloudFoundryClient (org.cloudfoundry.client.lib) to utilize the REST interface to add applications, create services etc
We see an issue in the getToken method of org.cloudfoundry.client.lib.oauth2.OauthClient where it tries to access the setRestTemplate method of the org.springramework.security.oauth2.client.token.grant.implicit.ImplicitAccessTokenProvider.
On looking up the source, we see that the setter for RestTemplate in the ImplicitAccessTokenProvider has been removed on 29th Aug, which is what is causing this inconsistency.
Could you please advise and let us know if we should try with a version of spring-security-oauth prior to this change and a link where we could find this?

The cloudfoundry-client-lib uses 1.0.0.RC1 of spring-security-oauth where this method is available. Please refer to SPRING SECURITY OAUTH 1.0.0.RC1 IS RELEASED

Related

How can I access another extension's greeting using RingCentral?

I am having trouble referencing one extension's custom greeting to another extension. Is the only way to set custom greetings (including HoldMusic and ConnectingAudio) via the Update Greeting API:
POST /restapi/v1.0/account/~/extension/{extensionId}/greeting/{greetingId}
RingCentral doesn't support shared greetings right now, so you will need to update the greeting for each extension. If this is a big issue, please let us know and we can consider it as an enhancement.

Using UniqueEntity outside of Symfony stack

I have an app built on top of Silex and I'm using Doctrine as my ORM.
I have a problem where I'm trying to get a clean error for when a user tries to reuse an email, I found the validator UniqueEntity but it seems to be designed for the full stack version of Symfony.
My question is, is this true? I'm going a limb and assuming it as I haven't found anyone who successfully used it outside of Symfony.
My second question is, if I'm not able to use UniqueEntity, whats my next best option? I'm using the Symfony Validator component and would like to use something that's plugged into that to keep it all in the same block of code.
You can use UniqueEntity with Silex.
Here's the service provider package with the Doctrine ManagerRegistry implementation - saxulum/saxulum-doctrine-orm-manager-registry-provider. Also you can find the instructions how to use it with the UniqueEntity validator in README.
But you may want to implement you own UniqueEntity validator.
For example, if you want to validate DTO object (or any non-entity object), because it's not supported by Symfony's UniqueEntity validator (see issue on GitHub).

CookieAuthenticator restlet

I have built some RESTful api's with REstlet 2.3.4. I've been using HTTP_BASIC which let the browser prompt for credentials but it's time for a proper login form. I figure the easiest way to implement this is CookieAuthenticator. I can't find full working examples on github/google. I am sure i'm over looking them can someone provide a working example implementing CookieAuthenticator in Restlet?
I did get this to work after all. I have a longer answer here with some code examples. First, i was missing the fact that CookieAuthenticator is a filter and HAS the logic to handle login and logout. You need to create EMPTY ServerResources with a method annotated with #Post that has nothing in the body. Second, extend CookieAuthenticator and overwrite isLoggingIn(..) and isLoggingOut(..) with the code found in the link.
Cheers,
-ray

How to enable Code Assist for ColdFusion builder 2.0.1?

I tried my best to enable the code assist in ColdFusion builder 2.0.1 but no luck.
I found two helping pages:
http://help.adobe.com/en_US/ColdFusionBuilder/2.0/Using/WS0ef8c004658c1089-554789f8121af8f0c8c-7ffb.html
and
http://help.adobe.com/en_US/ColdFusionBuilder/2.0/Using/WSf01dbd23413dda0e1736ebc1213a528ab0-7ffb.html#WS0ef8c004658c1089794dbeb6124c7814753-8000
what I am looking for is to let the coldFusion Builder assist me by auto-completing the REQUEST, SESSION, & APPLICATIONS variables. I tried the follow the instructions in the second link but it didn't work, maybe I wrote some incorrect data?
If any one managed to let it work, please help me.
Assuming you have set up the server correctly in CF Builder, it will talk to the server and cache the respond of what methods does a CFC have. (Console Tab: "Server is available. Getting server settings.")
E.g. If Person.cfc has property Name and Age with accessors=true, and you type p = new Person(), then "p." (Ctrl+Space) should see getAge(), getName(), setAge(), setName(). If you got that to work, you have set it up correctly.
As for variables in REQUEST, SESSION, & APPLICATIONS scopes, I think CFB would see if you have referenced them before on the same .cfm and may give you autocomplete, but don't count on it to be smart enough to know exactly what variables are there in the scopes.

ie useragent wxWidgets

Im currently using ie as an active x com thing on wxWidgets and was wanting to know if there is any easy way to change the user agent that will always work.
Atm im changing the header but this only works when i manually load the link (i.e. call setUrl)
The only way that will "always work," so far as I've been able to find, is changing the user-agent string in the registry. That will, of course, affect every web browser instance running on that machine.
You might also try a Google search on DISPID_AMBIENT_USERAGENT. From this Microsoft page:
MSHTML will also ask for a new user
agent via DISPID_AMBIENT_USERAGENT
when navigating to clicked hyperlinks.
This ambient property can be
overridden, but it is not used when
programmatically calling the Navigate
method; it will also not cause the
userAgent property of the DOM's
navigator object or clientInformation
behavior to be altered - this property
will always reflect Internet
Explorer's own UserAgent string.
I'm not familiar with the MSHTML component, so I'm not certain that's helpful.
I hope that at least gives you a place to start. :-)
I did a bit of googling today with the hint you provided head geek and i worked out how to do it.
wxWidgets uses an activex rapper class called FrameSite that handles the invoke requests. What i did was make a new class that inherits from this, handles the DISPID_AMBIENT_USERAGENT event and passes all others on. Thus now i can return a different user agent.
Thanks for the help.
Head Geek already told you where in the registy IE will look by default.
This is just a default, though. If you implement [IDocHostUIHandler::GetOptionKeyPath](http://msdn.microsoft.com/en-us/library/aa753258(VS.85%29.aspx) or [IDocHostUIHandler2::GetOverrideKeyPath](http://msdn.microsoft.com/en-us/library/aa753274(VS.85%29.aspx), IE will use that registry entry instead.
You'll probably want to use SysInternal's RegMon to debug this.