Search Results

Search found 7727 results on 310 pages for 'grails plugin'.

Page 33/310 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • Adding business logic to a domain class using a getter style method name

    - by Richard Paul
    I'm attempting to add a method to a grails domain class, e.g. class Item { String name String getReversedName() { name.reverse() } } When I attempt to load the application using grails console I get the following error: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory':Invocation of init method failed; nested exception is org.hibernate.PropertyNotFoundException: Could not find a setter for property reversedName in class Item ... 18 more It looks like Hibernate is interpreting getReversedName() as a getter for a property, however in this case it is a derived field and hence should not be persisted. Obviously in my actual code the business logic I'm exposing is more complex but it isn't relevant to this question. I want to be able to call item.reversedName in my code/gsps. How can I provide property (getter) access to a method in a Grails domain class without Grails attempting to map it with Hibernate?

    Read the article

  • How to generate real UTF-8 XML with grails without the escape characters?

    - by AngeDeLaMort
    I have been wondering why when I set the encoding to UTF-8 and rendering the XML it replace the extended characters by escape characters (or character reference) like &#x2019; instead of '? I'm using the Render method render(contentType:"text/xml", encoding:"UTF-8") {...} with a proper header render(contentType:"text/xml", encoding:"UTF-8", text:"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n") Any idea if there is a way to write it properly? Thanks.

    Read the article

  • How to programmatically logout in acegi plugin in Grails?

    - by firnnauriel
    Is there a similar logic for logout using this login code: // login account def autht = new AuthToken(username, password) def authtoken = daoAuthenticationProvider.authenticate(autht) SecurityContextHolder.context.authentication = authtoken I checked LogoutController and this is the only logic for logout: redirect(uri: '/j_spring_security_logout') Any idea? Thanks

    Read the article

  • why when I delete a parent on a one to many relationship on grails the beforeInsert event is called

    - by nico
    hello, I have a one to many relationship and when I try to delete a parent that haves more than one child the berforeInsert event gets called on the frst child. I have some code in this event that I mean to call before inserting a child, not when i'm deleting the parent! any ideas on what might be wrong? the entities: class MenuItem { static constraints = { name(blank:false,maxSize:200) category() subCategory(nullable:true, validator:{ val, obj -> if(val == null){ return true }else{ return obj.category.subCategories.contains(val)? true : ['invalid.category.no.subcategory'] } }) price(nullable:true) servedAtSantaMonica() servedAtWestHollywood() highLight() servedAllDay() dateCreated(display:false) lastUpdated(display:false) } static mapping = { extras lazy:false } static belongsTo = [category:MenuCategory,subCategory:MenuSubCategory] static hasMany = [extras:MenuItemExtra] static searchable = { extras component: true } String name BigDecimal price Boolean highLight = false Boolean servedAtSantaMonica = false Boolean servedAtWestHollywood = false Boolean servedAllDay = false Date dateCreated Date lastUpdated int displayPosition void moveUpDisplayPos(){ def oldDisplayPos = MenuItem.get(id).displayPosition if(oldDisplayPos == 0){ return }else{ def previousItem = MenuItem.findByCategoryAndDisplayPosition(category,oldDisplayPos - 1) previousItem.displayPosition += 1 this.displayPosition = oldDisplayPos - 1 this.save(flush:true) previousItem.save(flush:true) } } void moveDownDisplayPos(){ def oldDisplayPos = MenuItem.get(id).displayPosition if(oldDisplayPos == MenuItem.countByCategory(category) - 1){ return }else{ def nextItem = MenuItem.findByCategoryAndDisplayPosition(category,oldDisplayPos + 1) nextItem.displayPosition -= 1 this.displayPosition = oldDisplayPos + 1 this.save(flush:true) nextItem.save(flush:true) } } String toString(){ name } def beforeInsert = { displayPosition = MenuItem.countByCategory(category) } def afterDelete = { def otherItems = MenuItem.findAllByCategoryAndDisplayPositionGreaterThan(category,displayPosition) otherItems.each{ it.displayPosition -= 1 it.save() } } } class MenuItemExtra { static constraints = { extraOption(blank:false, maxSize:200) extraOptionPrice(nullable:true) } static searchable = true static belongsTo = [menuItem:MenuItem] BigDecimal extraOptionPrice String extraOption int displayPosition void moveUpDisplayPos(){ def oldDisplayPos = MenuItemExtra.get(id).displayPosition if(oldDisplayPos == 0){ return }else{ def previousExtra = MenuItemExtra.findByMenuItemAndDisplayPosition(menuItem,oldDisplayPos - 1) previousExtra.displayPosition += 1 this.displayPosition = oldDisplayPos - 1 this.save(flush:true) previousExtra.save(flush:true) } } void moveDownDisplayPos(){ def oldDisplayPos = MenuItemExtra.get(id).displayPosition if(oldDisplayPos == MenuItemExtra.countByMenuItem(menuItem) - 1){ return }else{ def nextExtra = MenuItemExtra.findByMenuItemAndDisplayPosition(menuItem,oldDisplayPos + 1) nextExtra.displayPosition -= 1 this.displayPosition = oldDisplayPos + 1 this.save(flush:true) nextExtra.save(flush:true) } } String toString(){ extraOption } def beforeInsert = { if(menuItem){ displayPosition = MenuItemExtra.countByMenuItem(menuItem) } } def afterDelete = { def otherExtras = MenuItemExtra.findAllByMenuItemAndDisplayPositionGreaterThan(menuItem,displayPosition) otherExtras.each{ it.displayPosition -= 1 it.save() } } }

    Read the article

  • Is it possible for a Grails Domain to have no 'id'?

    - by firnnauriel
    Is it possible to create a table that has no 'id'? For example, this is my domain: class SnbrActVector { int nid String term double weight static mapping = { version false id generator: 'identity' } static constraints = { } } When I run this SQL statement, it fails: insert into snbr_act_vector values (5, 'term', 0.5) I checked the table and 'id' is already set to autoincrement. I'm thinking that another option is to remove the 'id' itself. Or is there another workaround for this? Please assume that it is not an option to change the givent SQL statement.

    Read the article

  • is there a less bloated way to test constraints in grails?

    - by egervari
    Is there a less bloated way to test constraints? It seems to me that this is too much code to test constraints. class BlogPostTests extends GrailsUnitTestCase { protected void setUp() { super.setUp() mockDomain BlogPost } void testConstraints() { BlogPost blogPost = new BlogPost(title: "", text: "") assertFalse blogPost.validate() assertEquals 2, blogPost.errors.getErrorCount() assertEquals "blank", blogPost.errors.getFieldError("title").getCode() assertEquals "blank", blogPost.errors.getFieldError("text").getCode() blogPost = new BlogPost(title: "title", text: ObjectMother.bigText(2001)) assertFalse blogPost.validate() assertEquals 1, blogPost.errors.getErrorCount() assertEquals "maxSize.exceeded", blogPost.errors.getFieldError("text").getCode() } }

    Read the article

  • In Grails, How can I create a domain model to link two of another model?

    - by gerges
    Hey all, I'm currently trying to create a Friendship domain object to link two User objects (with a bit of additional data: createDate, confirmedStatus). My domain model looks as follows class Friendship { User userOne User userTwo Boolean confirmed Date createDate Date lastModifiedDate static belongsTo = [userOne:User , userTwo:User] static constraints = { userOne() userTwo() confirmed() createDate() lastModifiedDate() } } I've also added the following entries to the user class static hasMany = [ friendships:Friendship ] static mappedBy = [ friendships:'userOne' , friendships:'userTwo' ] When I do this, the result is a new friendship created (and viewable through the controller) with both users listed in their respective places. When I view the details of userOne, I see the friedship listed. When I view the details of userTwo, no friendship is listed. This is not the behavior I expected. What am I doing incorrectly? Why can't I see the friendship listed under both users?

    Read the article

  • Is it possible for a Grails Domain to have no 'id'?

    - by firnnauriel
    Is it possible to create a table that has no 'id'? For example, this is my domain: class SnbrActVector { int nid String term double weight static mapping = { version false id generator: 'identity' } static constraints = { } } When I run this SQL statement, it fails: insert into snbr_act_vector values (5, 'term', 0.5) I checked the table and 'id' is already set to autoincrement. I'm thinking that another option is to remove the 'id' itself. Or is there another workaround for this? Please assume that it is not an option to change the givent SQL statement.

    Read the article

  • How to query a collection of inherited object for a particular object type in grails ?

    - by quilovnic
    Hi, I have a this model : class Question{ Set components static hasMany = [components: QuestionComponent] } class QuestionComponent{ static belongsTo = Question } class QuestionComponentStatus extends QuestionComponent{ } class QuestionComponentOther extends QuestionComponent{ } I want to get only QuestionComponentStatus from Set components : questionInstance.components. ? Thanks a lot

    Read the article

  • Any easy way to delete a user (having many to many relation with role) in acegi, grails?

    - by john
    Hi, In default acegi setting, person and authority have many to many relations. Thus, in addtion to people and authorities, there is a table authotiries-people. To delete a person (a user) I have to delete the related record in authotiries-people first....then come back to delete the record... the problem is: other people are still using this authority (ROLE) could some one enlighten me how to delete the user without deleting the authority? thanks.

    Read the article

  • Flash player stops working in Firefox

    - by Alin
    First of all please be merciful as I am a 2 days ubuntu user. I've only used Windows OSs before. Hardware configuration -Quad Core Q6600 CPU -4 GB RAM -Geforce 8800GT 512 MB RAM -Seagate 320GB Harddisk I installed ubuntu x64 and everything went smooth. I had Adoble flash player installed from Ubuntu Software Center. The problem is that the flash videos on youtube (basically on all pages) looked pixelate. I use Firefox 3.6 that came with ubuntu by default. After reading around here I saw something about overriding hardware acceleration but that didn't work either. Or maybe I just didn't do it correctly. The problem was that if I opened 2-3 youtube tabs, when closing one of them, in 95% of the cases, the flash plugin would crash in remaining tabs and a black screen was instead of the video. After doing some more search I discovered the FlashAid extension for Firefox. I installed it and it made an update of flash plugin. Now the videos look good but now each time I watch a video, when switching to another one the flash plugin crashes and I can see insead of the vide the firefox message with Plugin has crasshed, refresh the page. Basically this is what I miss to have a complete pleasant ubuntu experience. Any ideas how to fix this? Thank you

    Read the article

  • Has anyone got a simple step by step Mozilla plugin tutorial.

    - by s1mm0t
    I'm trying to create a Mozilla browser plugin for the sole purpose of detecting with javascript whether or not an application that I have written is installed. This was inspired by another stackoverflow question and answer on a similar subject. All I want really is a HelloWorld type example as what I need to write will be even simpler than that. There is a lot of information on the Mozilla website, but as a plugin noob and a C++ novice I'm experiencing information overload. I just need a step by step "this is how to create your first simple plugin". I have already written the IE equivalent by following this ATL tutorial. This is the kind of level of guide that I would ideally like to find. Please note, this is specifically about Mozilla plugins and not extensions - Googling this subject brings up a lot of information about extensions in addition to plugins.

    Read the article

  • How to detect if google chrome rss plugin is installed-php?

    - by zeina
    I'm working on a word press project. I noticed that rss is not working fine on google chrome. After I googled about it, it turned out that I need to install a plugin for google chrome so rss works. I want to know how to detect if the plugin is installed or not in case the user is using chrome browser. Currently I'm doing the following: function is_chrome() { return(eregi("chrome", $_SERVER['HTTP_USER_AGENT'])); } if(is_chrome()) { // I want to check if plugin installed or not here. }

    Read the article

  • Can you use Win32 GUI in a browser plugin?

    - by John
    Of course it would mean you're plugin is not cross-platform but let's focus on the technical side... Is a browser plugin (like done in NPAPI) restricted in what it can do? Or do you get fairly free reign to access the PC and the render-window you're given? For instance can you create Win32/MFC controls in your browser this way? A side question - is your browser plugin conceptually akin to a .DLL, which is therefore just arbitrary compiled code implementing a specific interface for browser control/communication?

    Read the article

  • Eclipse Plugin does not work in FlashBuilder/FlexBuilder Standalone

    - by Janosch
    Hi, created an Eclipse plugin that contributes to the UI by a new project wizard a new menu in the context menu of projects in the Package Explorer a new project nature + builder a new preference page for the plugin The plugin works fine when installed in a normal Eclipse instance with Flex/Flashbuilder as plugin. The problem now is, that the plugin never gets activated when i install it in a Flex/Flashbuilder Standalone instance. Neither of the features described above is available. I even have no idea how to debug this, error-log (workspace/.metadata/.log) the following message appears, (but i dont think it is related to the problem) !ENTRY org.eclipse.ui.workbench 2 0 2009-07-20 17:51:17.984 !MESSAGE A handler conflict occurred. This may disable some commands. !SUBENTRY 1 org.eclipse.ui.workbench 2 0 2009-07-20 17:51:17.984 !MESSAGE Conflict for 'org.eclipse.ui.navigate.openResource': HandlerActivation(commandId=org.eclipse.ui.navigate.openResource, handler=ActionDelegateHandlerProxy(null,org.eclipse.ui.internal.ide.handlers.OpenResourceHandler), expression=AndExpression(ActionSetExpression(org.eclipse.ui.NavigateActionSet,org.eclipse.ui.internal.WorkbenchWindow@1c45731),WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@1c45731)),sourcePriority=16640) HandlerActivation(commandId=org.eclipse.ui.navigate.openResource, handler=ActionDelegateHandlerProxy(null,org.eclipse.ui.internal.ide.handlers.OpenResourceHandler), expression=AndExpression(ActionSetExpression(com.adobe.flexbuilder.standalone.navigate,org.eclipse.ui.internal.WorkbenchWindow@1c45731),WorkbenchWindowExpression(org.eclipse.ui.internal.WorkbenchWindow@1c45731)),sourcePriority=16640) In the "Configuration Details" my feature doesn't show up in the *** Features: section and my plugin doesn't show up in the *** Plugin-in Registry: section. But they appear under Configured features and Configured plug-ins. Starting FlashBuilder with -clean didn't solve the problem. (the start command is now "C:\Programme\Adobe\Flash Builder Beta\Gumbo.exe" -clean) My plugin depends on org.eclipse.ui, org.eclipse.core.runtime, org.eclipse.core.resources, com.adobe.flexbuilder.project com.adobe.flexbuilder.project.ui com.adobe.flexbuilder.ui All of these should be available, as i see it. (and an error should be generated if they were not, i hope)

    Read the article

  • Joomla get plugin id

    - by Christian Sciberras
    I wrote a Joomla plugin which will eventually load a library. The path to library is a plugin parameter, as such when the path is incorrect, a message pops up in the backend, together with a link to edit the plugin parameters: /administrator/index.php?option=com_plugins&view=plugin&client=site&task=edit&cid[]=36 See the 36 at the end? That's my plugin's id in the database (table jos_plugins). My issue is that this id changes on installation, ie, on different installs, it would be something else. So I need to find this id programmatically. The problem is that I couldn't find this id from the plugin object itself (as to why not, that would be joomla's arguably short-sighted design decision). So unless you know about some neat trick, (I've checked and double checked JPlugin and JPluginHelper classes), I'll be using the DB. Edit; Some useful links: http://docs.joomla.org/Plugin_Developer_Overview http://api.joomla.org/Joomla-Framework/Plugin/JPlugin.html http://api.joomla.org/Joomla-Framework/Plugin/JPluginHelper.html http://forum.joomla.org/viewtopic.php?p=2227737 Guess I'll be using the wisdom from that last link...

    Read the article

  • Dartisans ep. 10: Dart Plugin for IntelliJ

    Dartisans ep. 10: Dart Plugin for IntelliJ Ask and vote for questions at: goo.gl Edit and debug your Dart apps with IntelliJ and WebStorm! In this episode of Dartisans, we'll talk to the engineers working on this exciting project. Join hosts Seth Ladd and JJ Behrens to learn more about writing Dart apps with JetBrain's powerful editors. From: GoogleDevelopers Views: 1279 35 ratings Time: 35:25 More in Science & Technology

    Read the article

  • rhythmbox plugin code for hot key not working

    - by Bunny Rabbit
    def activate(self,shell): self.shell = shell self.copy_selected() self.action = gtk.Action ('foo','bar','baz',None) self.activate_id = self.action.connect ('activate', self.call_bk_fn,self.shell) self.action_group = gtk.ActionGroup ('hot_key_action_group') self.action_group.add_action_with_accel (self.action, "<control>E") uim = shell.get_ui_manager () uim.insert_action_group (self.action_group, 0) uim.ensure_update () def call_bk_fn(): print('hello world') i am using the above code in a plugin for rhythmbox ,and here i am trying to register the key ctr+e so that the call_bk_fn gets called whenever the key combination is pressed , but its not working why is that so ?

    Read the article

  • Getting Adobe Flash plugin on PowerBook G4 running Lubuntu

    - by mylottd
    I am running Lubuntu on my PowerBook G4 with a PowerPC processor. If I want to install any file, should I be looking for the Linux version or the PowerPC version? I specifically want to get a Adobe Flash Player 11 or newer plugin for Firefox, but it would be nice to know what to look for when I'm getting other files. You might have already been able to tell, but I don't know a lot at all about this stuff, sorry.

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >