This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ext.define('Bookmarks.model.Category', { | |
| extend : 'Ext.data.Model', | |
| fields : [{ | |
| name : 'name', | |
| type : 'string' | |
| }, { | |
| name : 'description', | |
| type : 'string' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class JavaScriptController { | |
| def i18NService | |
| /** | |
| * Render dynamic JavaScript to the browser. It can be used in a GSP as: | |
| * | |
| * <script type='text/javascript' src='${createLink(controller: "javaScript", action: "scripts")}'></script> | |
| * | |
| * You can access i18n messages in javascript with window.messages variable. Example: | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.wordpress.sergiosmind.i18n | |
| import java.util.List; | |
| import java.util.Locale; | |
| import java.util.Map; | |
| import java.util.Properties; | |
| import java.util.concurrent.ConcurrentHashMap; | |
| import org.codehaus.groovy.grails.context.support.PluginAwareResourceBundleMessageSource | |
| import org.codehaus.groovy.grails.plugins.BinaryGrailsPlugin; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.wordpress.sergiosmind.lang | |
| import grails.converters.JSON | |
| import org.springframework.context.support.ReloadableResourceBundleMessageSource.PropertiesHolder | |
| class I18NService { | |
| /** Dependency Injection for ExposedKeysMessageSource */ | |
| def messageSource | |
| /** | |
| * Get's all messages for the Locale and encode to a JSON String. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.codehaus.groovy.grails.context.support.PluginAwareResourceBundleMessageSource | |
| import com.wordpress.sergiosmind.i18n.ExposedKeysMessageSource | |
| class MyGrailsPlugin { | |
| ... | |
| def doWithSpring = { | |
| def beanconf = springConfig.getBeanConfig('messageSource') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.wordpress.sergiosmind.i18n.ExposedKeysMessageSource | |
| class MyGrailsPlugin { | |
| ... | |
| def doWithSpring = { | |
| messageSource(ExposedKeysMessageSource) | |
| } | |
| ... | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // src/groovy folder | |
| package com.wordpress.sergiosmind.i18n | |
| import org.codehaus.groovy.grails.context.support.PluginAwareResourceBundleMessageSource | |
| class ExposedKeysMessageSource extends PluginAwareResourceBundleMessageSource { | |
| Set getAllKeys(Locale locale) { | |
| Set applicationKeys = getMergedProperties(locale).getProperties().keySet() | |
| Set pluginsKeys = getMergedPluginProperties(locale).getProperties().keySet() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.springframework.security.core.Authentication | |
| import org.springframework.security.core.context.SecurityContextHolder | |
| class AuthFilters { | |
| def springSecurityService | |
| def dataSource | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //<your-app>/grails-app/vaadin/app/AppWidgetSet.gwt.xml | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE module PUBLIC | |
| "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN" | |
| "http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd"> | |
| <module> | |
| <inherits name="com.vaadin.DefaultWidgetSet" /> | |
| <inherits name="org.vaadin.cssinject.Cssinject_addonWidgetset" /> | |
| </module> |