Skip to content

Instantly share code, notes, and snippets.

AndrewShitsko

View GitHub Profile
View UserServiceSpec.groovy
service.roleService.transactionManager = transactionManager
View UserServiceSpec.groovy
package mock.transaction.manager
import grails.test.mixin.Mock
import grails.test.mixin.TestFor
import spock.lang.Specification
/**
* See the API for {@link grails.test.mixin.services.ServiceUnitTestMixin} for usage instructions
*/
@TestFor(UserService)
View RoleService.groovy
package mock.transaction.manager
import grails.transaction.Transactional
@Transactional
class RoleService {
def grantRole(User user, Role role) {
def userRoleInstance = new UserRole(user: user, role: role)
userRoleInstance.save()
View UserService.groovy
package mock.transaction.manager
import grails.transaction.Transactional
@Transactional
class UserService {
def roleService
def createUser(Map params) {
View Language.groovy
package com.example
class Language {
private Integer position
private String language
public Language(Integer position, String language) {
this.position = position
this.language = language
}
View HomeController.groovy
package org.example
import griffon.core.artifact.GriffonController
import griffon.inject.MVCMember
import griffon.metadata.ArtifactProviderFor
import griffon.transform.Threading
import javax.annotation.Nonnull
@ArtifactProviderFor(GriffonController)
class HomeController {
View HomeView.groovy
package com.example
import griffon.core.artifact.GriffonView
import griffon.inject.MVCMember
import griffon.metadata.ArtifactProviderFor
import javafx.collections.FXCollections
import javafx.fxml.FXML
import javafx.scene.control.Button
import javafx.scene.control.Label
import javafx.scene.control.TableView
View home.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import griffon.javafx.support.*?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
View HomeController.groovy
package org.example
import griffon.core.artifact.GriffonController
import griffon.inject.MVCMember
import griffon.metadata.ArtifactProviderFor
import griffon.transform.Threading
import javax.annotation.Nonnull
@ArtifactProviderFor(GriffonController)
class HomeController {
View HomeView.groovy
package org.example
import griffon.core.artifact.GriffonView
import griffon.inject.MVCMember
import griffon.metadata.ArtifactProviderFor
import javax.annotation.Nonnull
@ArtifactProviderFor(GriffonView)
class HomeView {
@MVCMember @Nonnull
You can’t perform that action at this time.