Search Results

Search found 595 results on 24 pages for 'groovy'.

Page 11/24 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • is it possible to change the query parameters in REST API from script editor in SOAPUI?

    - by user1518659
    i am doing load test on this REST API using SOAPUI. http://maps.googleapis.com/maps/api/geocode/xml?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false i ve successfully setup the testsuite and all. my doubt is is it possible to change the query parameters in the REST API url by passing values from the script editor(either javascript or groovy) for the test suite when i perform test? if so, how should i write the script? Hope I am clear with my ques.

    Read the article

  • How do I get all the calendar entries for a particular time range using Google Calendar API

    - by BeWarned
    I want to view events over specific time range for a specific calendar, but am having trouble using the API, It is a generic API, and it reminds me of using the DOM. The problem is that it seems difficult to work with because much of the information is in generic base classes. How do I get the events for a calendar using Groovy or Java? Does anybody have an example of passing credentials using curl? Example code would be appreciated.

    Read the article

  • HTML parsing - fetch and update data from the .html file

    - by Amit Jain
    I have a form in a .html files where input/select box looks like this <input type="text" id="txtName" name="txtName" value="##myName##" /> <select id="cbGender" name="cbGender"> <option>Select</option> <option selected="selected">Male</option> <option>Female</option> </select> I would need to remove '##' value textbox and also update them with different values if needed be in the textbox/checkbox/ selectbox. I would know the id of the input types. The code is to be written in groovy. Any ideas?

    Read the article

  • Conversion of bytes into a type without changing the application (ie storing the conversion method i

    - by geoaxis
    Is there a way to store a conversion strategy (for converting some bytes) into a database and then execute it on the run time. If one were to store a complete java file, you would need to compile it, store the class and some how inject into the already running system. I am not sure how this would be possible. But using some kind of dynamic language on JVM would be nice. I see an example of execution of groovy from within spring context here http://www.devx.com/tips/Tip/42789 but this is still static in nature as application context contains the reference to the implementation and cannot be changed by database. Perhaps with JavaConfig of context it is possible. I am exploring options now, specifically with Spring 3.0. Your suggestions in any direction would be welcome.

    Read the article

  • How to configure iReports to use grails domain class ?

    - by fabien-barbier
    I'm using JasperGrails plugins (http://www.grails.org/Jasper+Plugin) to generate reports. When I configure iReports dataSource with Database JDBC connection everything works well. But how to configure iReports with grails and Jasper plugin ? I try to configure my dataSource by selecting "JavaBeans set data source", but I have this error message : ClassNotFoundError ! (I try to add my domain in classpath by pointing to my IDEA project folder, but I have always same message). What is the best way to configure iReports with grails/groovy ?

    Read the article

  • How to mock/stub calls to message taglib in Grails controller

    - by Dave
    I've got a Grails controller which relies on the message taglib to resolve an i18n message: class TokenController { def passwordReset = { def token = DatedToken.findById(params.id); if (!isValidToken(token, params)) { flash.message = message(code: "forgotPassword.reset.invalidToken") redirect controller: 'forgotPassword', action: 'index' return } render view:'/forgotPassword/reset', model: [token: token.token] } } I've written a unit test for the controller: class TokenControllerTests extends ControllerUnitTestCase { void testPasswordResetInvalidTokenRedirect() { controller.passwordReset() assert... } } Since the message taglib is called in the controller I get a MissingMethodException: groovy.lang.MissingMethodException: No signature of method: TokenController.message() is applicable for argument types: (java.util.LinkedHashMap) values: [[code:forgotPassword.reset.invalidToken]] Does anyone know the best way to get around this issue in a unit test? Ideally I would like to perform assertions on the message but right now I'd be happy if the test just ran! Thanks

    Read the article

  • populate a comboBox in Griffon App dynamically

    - by kulkarni
    I have 2 comboBoxes in my View of Griffon App (or groovy swingBuilder) country = comboBox(items:country(), selectedItem: bind(target:model, 'country', value:model.country), actionPerformed: controller.getStates) state = comboBox(items:bind(source:model, sourceProperty:'states'), selectedItem: bind(target:model, 'state', value:model.state)) The getStates() in the controller, populates @Bindable List states = [] in the model based on the country selected. The above code doesn't give any errors, but the states are never populated. I changed the states from being List to a range object(dummy), it gives me an error MissingPropertyException No such property items for class java.swing.JComboBox. Am I missing something here? There are a couple of entries related to this on Nabble but nothing is clear. The above code works if I had a label instead of a second comboBox.

    Read the article

  • grails metaprogramming

    - by Don
    Hi, My understanding is that there are two obvious places in a Grails app where one can do meta-programming: The init closure of Bootstrap.groovy The doWithDynamicMethods closure of a plugin The meta-programming I'm referring to here should be visible throughout the metaprogramming, typical examples include adding (or replacing) methods of 3rd party classes. String.metaClass.myCustomMethod = { /* implementation omitted */ } The disadvantage of (1), is that the metaprogramming won't be applied when the application is dynamically reloaded. The disadvantage of (2) is that I need to create and maintain an entire plugin just for the sake of a little metaprogramming. Is there a better place to do this kind of metaprogramming? Thanks, Don

    Read the article

  • Persist url parameter throughout grails app

    - by avelis
    Essentially I am looking to have a url query parameter persist throughout the life of the grails application (POST or GET). ex. http://localhost:8080/demo/controller/action/?myParam=foobar I have tried a couple routes. Dynamic method overriding redirect and customizing application tags for createLink. However, since I also use grails webflows it doesn't quite get every single URL. I also tried using a groovy servlet (groovlet) to capture every URL and append the query parameter. The last attempt hasn't been very successful. Am I missing an obvious component to grails? Am I on the right track? Is there another avenue I haven't explored yet? Thanks in advance

    Read the article

  • Simple cross platform GUI app

    - by Joe Cannatti
    I would like to know if there is any way that I could build a very simple GUI app (it doesn't even have to look good) that will run on a fresh install of Windows Vista and OS X with no other installations needed by the user. I would perfer not to use Java (just out of personal programming preference). I will use it though, if it is the only way. Specically, I am wondering if I can write a swing app with Scala or Groovy and run in on windows without them having to install anything. Sorry if this is a silly question, I am a Obj-C developer by trade.

    Read the article

  • org.hibernate.HibernateException: Error while accessing enum.values(): class com.mksoft.fbautomate.d

    - by Misha Koshelev
    This error is driving me nuts!!! Caused by: java.lang.NoSuchMethodException: com.mksoft.fbautomate.domain.Account$Type.values() The same exact class works fine in a separate Groovy file. Any ideas/help much appreciated. Most confusing... http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Enum.html has no values() method! Here is my class: @Entity class Account { @Id @GeneratedValue(strategy=GenerationType.AUTO) public Long id enum Type {MYVALUE} @Enumerated(EnumType.STRING) public Type type public String email // @org.hibernate.annotations.Type(type="encryptedString") public String pass public String fullName String toString() { "type:\""+type+"\",email:\""+email+"\""+",fullName=\""+fullName+"\"" } } Thank you! Misha

    Read the article

  • How to get generate WSDL using GroovyWS

    - by James Black
    I am implementing SOAP web services for a commercial application, and I am using GroovyWS to speed up the development. But, when I deploy it on Tomcat, I am not using Grails, as the software has it's own J2EE framework, so how I do I get it to react to wsdl requests? Do I need to write a groovy-based servlet? Ideally I would like the WSDL generated upon request, so I can easily change the interface and see the change. It seems I will miss the annotations that JAX-WS provides for, though, to help fine-tune the WSDL.

    Read the article

  • Grails Runtime Exception with Audit Logging Plugin

    - by Paul
    I've deployed my app to tomcat running on EC2 via Cloud Foundry. The application uses the Grails Audit Logging Plugin I'm getting the following runtime error: Error 500: Executing action [save] of controller [com.questern.aoms.CompanyController] caused exception: groovy.lang.MissingPropertyException: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent Servlet: grails URI: /aoms/grails/company/save.dispatch Exception Message: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent Caused by: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent Class: CompanyController At Line: [30] The exception is: groovy.lang.MissingPropertyException: No such property: errors for class: org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent at $Proxy10.saveOrUpdate(Unknown Source) at com.questern.aoms.CompanyController$_closure4.doCall(CompanyController.groovy:30) at com.questern.aoms.CompanyController$_closure4.doCall(CompanyController.groovy) I have added the import statement to the controller CompanyController, but to no avail. import org.codehaus.groovy.grails.plugins.orm.auditable.AuditLogEvent I checked the war file and the AuditLogEvent is include in: aoms-0.1.war\WEB-INF\classes\org\codehaus\groovy\grails\plugins\orm\auditable\ Any suggestions as to what the problem could be?

    Read the article

  • Grails domain class initialization

    - by Don
    Hi, My Grails app has the following Spring bean defined in spring/resources.groovy calendarService(CalendarService) { bean -> bean.initMethod = "init" } This method looks something like: class CalendarService { void init() { User.findByEmail("[email protected]") } } When I call the dynamic finder findByEmail I get a MissingMethodException. My guess is that I'm trying to call this method too early, i.e. before the domain classes have had the dynamic finders added to their metaclass. One solution would be to call CalendarService.init() myself from Bootstrap.init, rather than instructing Spring to call it, but is there a better solution? Thanks, Don

    Read the article

  • Why don't Domain class static methods work from inside a grails "service"?

    - by ?????
    I want a grails service to be able to access Domain static methods, for queries, etc. For example, in a controller, I can call IncomingCall.count() to get the number of records in table "IncomingCall" but if I try to do this from inside a service, I get the error: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'incomingStatusService': Invocation of init method failed; nested exception is groovy.lang.MissingMethodException: No signature of method: static ms.wdw.tropocontrol.IncomingCall.count() is applicable for argument types: () values: [] How do these methods get injected? There's no magic def statement in a controller that appears to do this. Or is the problem that Hibernate isn't available from my Service class?

    Read the article

  • Ajax / GroovyGrails Post data coming over with unexpected leading character. Who is encoding/decod

    - by ?????
    I'm having an encoding issue, and I'm not sure where to look for the problem. I have this Ajax.Request function (prototype library) sending data to a Groovy/Grails encoder var myAjax = new Ajax.Request(url, {method:'post', encoding:'UTF-8', contentType:'application/x-www-form-urlencoded', parameters:{'content':new_content}, onSuccess:success, onFailure:failure}); The data is coming in with an unexpected %A0 at the beginning: I have this simple controller that just echos the content back: def titlechange = { def content = URLDecoder.decode(params['content']) printf("Content: %s; DecodedContent = %s\n", params['content'], content) response.characterEncoding='UTF-8' render content } the debug print statement shows: Content: %A0Hello%2C%20world%21; DecodedContent = †Hello, world! Where is that %A0 coming from? My grails configuration has this: // The default codec used to encode data with ${} grails.views.default.codec="none" // none, html, base64 grails.views.gsp.encoding="UTF-8" grails.converters.encoding="UTF-8 Is the issue on the grails side or on the JavaScript side?

    Read the article

  • Grails unit testing domain classes with Set properties - is this safe?

    - by Ali G
    I've created a domain class in Grails like this: class MyObject { static hasMany = [tags: String] // Have to declare this here, as nullable constraint does not seem to be honoured Set tags = new HashSet() static constraints = { tags(nullable: false) } } Writing unit tests to check the size and content of the MyObject.tags property, I found I had to do the following: assertLength(x, myObject.tags as Object[]) assertEquals(new HashSet([...]), myObject.tags) To make the syntax nicer for writing the tests, I implemented the following methods: void assertEquals(List expected, Set actual) { assertEquals(new HashSet(expected), actual) } void assertLength(int expected, Set set) { assertLength(expected, set as Object[]) } I can now call the assertLength() and assertEquals() methods directly on an instance of Set, e.g. assertLength(x, myObject.tags) assertEquals([...], myObject.tags) I'm new to Groovy and Grails, so unaware how dangerous method overloading like this is. Is it safe? If so, I'm slightly* surprised that these methods (or similar) aren't already available - please let me know if they are. * I can see how these methods could also introduce ambiguity if people weren't expecting them. E.g. assertLength(1, set) always passes, no matter what the content of set

    Read the article

  • Google Calendar title displayed incorrectly

    - by Don
    Hi, I'm creating 2 Google calendars via the Java client API using the following Groovy method: private CalendarEntry createGoogleCalendar(User user) throws ServiceException { new CalendarEntry().with {calendar -> title = new PlainTextConstruct(user.email) summary = new PlainTextConstruct("Collection calendar for $user.email") timeZone = new TimeZoneProperty("America/Montreal") hidden = HiddenProperty.FALSE def savedCalendar = googleCalendar.insert(CALENDAR_URL, calendar) log.debug "Created calendar with title '$savedCalendar.title.plainText' for '$user.email'" return savedCalendar } } The logs show: CalendarService - Created calendar with title '[email protected]' for '[email protected]' CalendarService - Created calendar with title '[email protected]' for '[email protected]' so it appears that all is well. However when I look at the 1st calendar on the Google website, the title is shown as [email protected], though the summary is correctly shown as Collection calendar for [email protected]. Strangely, the title and summary are both shown correctly tor the 2nd calendar. This only started happening today, and I'm pretty sure the relevant code has not changed. I'm totally stumped....

    Read the article

  • Grails external Jms broker (active mq)

    - by TheBigS
    I have what will become an 'external' activemq server I'd like grails to be able to talk to. Right now I am just running it on my dev box. Here is what I have setup right now: 1) Run activemq server 2) Run activemq/examples using ant to produce messages 3) View ActiveMQ admin site: http://localhost:8161/admin/queues.jsp verify that messages are in the queue. 4) Follow Mini Tutorial to create the Service and Controller: http://www.grails.org/ActiveMQ+Plugin 5) Configured my Grails resources.groovy file as follows: beans = { jmsConnectionFactory(SingleConnectionFactory){ targetConnectionFactory = { ActiveMQConnectionFactory cf -> brokerURL = 'tcp://localhost:61616' } } } When I run the grails app I get a BindException saying port 61616 is already in use. How do I configure this to use my server that is already running? I've tried changing 'localhost' to '127.0.0.1' and to my LAN ip, but no luck, it keeps trying to setup its own embedded activemq server. Any ideas?

    Read the article

  • Weird NodeBuilder and GPath behaviour in Grails

    - by yogiebiz
    Hi, I am quite new with Grails and now I have a problem while using NodeBuilder and GPath. Here is the code snippet def builder = new NodeBuilder() def menu = builder.menu { header(title: "header 1") { submenu(title: "submenu 1.1") submenu(title: "submenu 1.2") } header(title: "header 2") } menu.grep { println it.'@title' When I executed it with Groovy 1.7.2, the result was: header 1 header 2 which just like I expected. But when I executed the code in Grails 1.3.1, the result was different. The result was: submenu 1.1 submenu 1.2 any idea why this happened?

    Read the article

  • Grails - Development advice - Where do I find Plugin APIs / Troubleshoot errors / Make life easy for

    - by gav
    Hello fellow Grails Developers! I was wondering if you could help me with what must be a very common issue. I have come from a world of Java and eclipse where JavaDocs and APIs are at your fingertips. Grails has some great features and plugins but I find their inner workings completely undescoverable and that makes me sad. Take for example the excellent authentication plugin, I set this up using the brief but accurate doc. Now I'm in eclipse with STS and I'm staring at a method; applicationContext.authenticationService.filterRequest( request, response, "${request.contextPath}/authentication/index" ) Which is throwing an exception; 2010-05-01 01:17:07,292 [http-8080-1] ERROR [/grailsapp].[default] - Servlet.service() for servlet default threw exception java.lang.IllegalStateException at org.apache.catalina.connector.ResponseFacade.sendError(ResponseFacade.java:407) at javax.servlet.http.HttpServletResponseWrapper.sendError(HttpServletResponseWrapper.java:118) at org.codehaus.groovy.grails.web.sitemesh.GrailsPageResponseWrapper.sendError(GrailsPageResponseWrapper.java:91) And I have no idea where to start. I would love to have eclipse link to the source but there must be other manageable alternatives too as I know some people use TextMate or vim for development, they can't all have discovered the APIs for the plugins through trial and error!?! Is there any way of making the core Grails API more accessible / searchable? Autocomplete also doesn't seem to work for me in eclipse so if anyone has this working that would be ideal (It's an extension of the same question really). What's your approach? (Please don't say intelliJ, I can't afford it) I'm sure it's obvious and I'm just missing it, please put me out of my misery! Thanks in advance, Gav

    Read the article

  • Grails bean-fields plugin

    - by Don
    Hi, I'm having problems using the Grails bean-fields plugin with a class this is annotated Validateable, but is not a domain/command class. The root cause of the problem appears to be in this method of BeanTagLib.groovy private def getBeanConstraints(bean) { if (bean?.metaClass?.hasProperty(bean, 'constraints')) { def cons = bean.constraints if (cons != null) { if (log.debugEnabled) { log.debug "Bean is of type ${bean.class} - the constraints property was a [${cons.class}]" } // Safety check for the case where bean is no a proper domain/command object // This avoids confusing errors where constraints comes back as a Closure if (!(cons instanceof Map)) { if (log.warnEnabled) { log.warn "Bean of type ${bean.class} is not a domain class, command object or other validateable object - the constraints property was a [${cons.class}]" } } } else { if (log.warnEnabled) { log.warn "Bean of type ${bean.class} has no constraints" } } return cons } else return null } I tested out this method above in the grails console and when I pass an instance of MyBean into this method, it logs: Bean of type ${bean.class} is not a domain class, command object or other validateable object - the constraints property was a [${cons.class}] Because the constraints are returned as an instance of Closure instead of a Map. If I could figue out how to get a Map reference to the constraints of a @Validateable class (that is not a domain/command class), I guess I could resolve the problem. Thanks, Don

    Read the article

  • Standardizing a Release/Tools group on a specific language

    - by grahzny
    I'm part of a six-member build and release team for an embedded software company. We also support a lot of developer tools, such as Atlassian's Fisheye, Jira, etc., Perforce, Bugzilla, AnthillPro, and a couple of homebrew tools (like my Django release notes generator). Most of the time, our team just writes little plugins for larger apps (ex: customize workflows in Anthill), long-term utility scripts (package up a release for QA), or things like Perforce triggers (don't let people check into a specific branch unless their change description includes a bug number; authenticate against Active Directory instead of Perforce's internal passwords). That's about the scale of our problems, although we sometimes tackle something slightly more sizable. My boss, who is reasonably technical, has asked us to standardize on one or two languages so we can more easily substitute for each other. He's advocating bash scripts and Perl, due to their universality and simplicity. I can see his point--we mostly do "glue", so why not use "glue" languages rather than saddle ourselves with something designed for much larger projects? Since some of the tools we work with are Java-based, we do need to use something that speaks JVM sometimes. (The path of least resistance for these projects is BeanShell and Groovy.) I feel a tremendous itch toward language advocacy, but I'm trying to avoid saying "We should use Python 'cause I like it and Perl is gross." Instead, I'm trying to come up with a good approach to defining our problem set: what problems do we solve with scripts? Would we benefit from a library of common functions by our team, or are most of our projects more isolated? What is it reasonable to expect my co-workers to learn? What languages give us the most ease of development and ease of modification? Can you folks suggest some useful ways to approach this problem, both for my own thinking process and to help me facilitate some brainstorming among my coworkers?

    Read the article

  • Grails UrlMappings with .html

    - by Glennn
    I'm developing a Grails web application (mainly as a learning exercise). I have previously written some standard Grails apps, but in this case I wanted to try creating a controller that would intercept all requests (including static html) of the form: <a href="/testApp/testJsp.jsp">test 1</a> <a href="/testApp/testGsp.gsp">test 2</a> <a href="/testApp/testHtm.htm">test 3</a> <a href="/testApp/testHtml.html">test 4</a> The intent is to do some simple business logic (auditing) each time a user clicks a link. I know I could do this using a Filter (or a range of other methods), however I thought this should work too and wanted to do this using a Grails framework. I set up the Grail UrlMappings.groovy file to map all URLs of that form (/$myPathParam?) to a single controller: class UrlMappings { static mappings = { "/$controller/$action?/$id?"{ constraints { } } "/$path?" (controller: 'auditRecord', action: 'showPage') "500"(view:'/error') } } In that controller (in the appropriate "showPage" action) I've been printing out the path information, for example: def showPage = { println "params.path = " + params.path ... render(view: resultingView) } The results of the println in the showPage action for each of my four links are testJsp.jsp testGsp.gsp testHtm.htm testHtml Why is the last one "testHtml", not "testHtml.html"? In a previous (Stack Overflow query) Olexandr encountered this issue and was advised to simply concatenate the value of request.format - which, indeed, does return "html". However request.format also returns "html" for all four links. I'm interested in gaining an understanding of what Grails is doing and why. Is there some way to configure Grails so the params.path variable in the controller shows "testHtml.html" rather than stripping off the "html" extension? It doesn't seem to remove the extension for any other file type (including .htm). Is there a good reason it's doing this? I know that it is a bit unusual to use a controller for static html, but still would like to understand what's going on.

    Read the article

  • Scala and Java BigDecimal

    - by geejay
    I want to switch from Java to a scripting language for the Math based modules in my app. This is due to the readability, and functional limitations of mathy Java. For e.g, in Java I have this: BigDecimal x = new BigDecimal("1.1"); BigDecimal y = new BigDecimal("1.1"); BigDecimal z = x.multiply(y.exp(new BigDecimal("2")); As you can see, without BigDecimal operator overloading, simple formulas get complicated real quick. With doubles, this looks fine, but I need the precision. I was hoping in Scala I could do this: var x = 1.1; var y = 0.1; print(x + y); And by default I would get decimal-like behaviour, alas Scala doesn't use decimal calculation by default. Then I do this in Scala: var x = BigDecimal(1.1); var y = BigDecimal(0.1); println(x + y); And I still get an imprecise result. Is there something I am not doing right in Scala? Maybe I should use Groovy to maximise readability (it uses decimals by default)?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >