No início havia muitas dúvidas se o Grails iria ser útil para aplicações grandes, ou de grande porte. Mas peraí, o que é uma aplicação grande? eBay é gigante. Se considerarmos uma medida, aí acho que podemos definir grande. Page-views por mês, por exemplo, pode ser uma medida, já que é fácil de saber, de monitorar, etc.
Um eBay tem algo em torno de 15 bilhões de page-views por mês. A globo.com tem uns 2 bilhões de page-views/mês. Um Peladeiro.com.br tem 1,2 milhão de page-views/mês. O Peladeiro é pequeno, Globo.com é grande, eBay é gigante. Pelo menos na minha opinião, sem muito exercício científico.
Além da medida de grande número de acessos, há também: grande volume de dados, necessidade de alta disponibilidade e redundância, escalabilidade, hot swap, cluster failover, etc, etc....
Aí voltamos a pergunta original: o Grails é bom para isso? Dá pra confiar que uma aplicação grails serve para uma demanda de uma aplicação de grande porte?
Grails e Cloud: desenvolvimento, deploy, execução e monitoramento. Ciclo completo com Grails na Nuvem.
Enviando emails formatados com Html e CSS - será que vai certinho?
Muito bom esta tabela que mostra o que cada cliente de email consegue mostrar corretamente em termos de CSS nos emails Html que vc envia.
http://www.campaignmonitor.com/css/
Ou seja, não adianta referenciar um arquivo CSS na tag link lá no header, pois nem todos os clientes levam isso em consideração. E nem tag style no header, e nem..... olhe o link acima.
Abcs
Felipe
Serviços do Grails, Transações e Rollback automático
Comprei o livro recente que saiu do Glen Smith, o Grails in Action. E, claro, comecei a ler. Ainda não terminei. Mas já valeu a compra e a dedicação de ler só pelo fato que eu descobri e não sabia:
Manubia.com.br - Controle Financeiro com Grails e, agora, com jQuery
É pessoal....
- jQuery tem um mundo plugins que resolvem diversos problemas que a gente precisa ficar catando pela web quando usamos Prototype + Scriptaculous.
- o jQuery tem um projeto inteiro dedicado a interface gráfica: jQuery UI
- formatação de campos de um formulário (formatar valor numérico com pontos e vírgulas, de forma internacionalizada): Masked Input Plugin
- Calendário tipo Date Picker para campos de datas: jQuery UI DatePicker
- Plugin para manipulação de comboboxes (select boxes).
- No final das contas, a gente escreve menos código JavaScript do que com Prototype. Parece que fica mais limpo o código.
- Tem um site dedicado aos plugins
- De acordo com alguns benchmarks (um aqui, outro aqui), o jQuery tem uma performance melhor do que o Prototype (ou seja, os usuários é que ganham).
- Eu tenho tudo que preciso em uma biblioteca só, não preciso usar parte de uma, parte de outra, etc... (pelo menos por enquanto, vamos ver até quando).
Filtro do Grails para impor SSL (https) a determinadas páginas
Olá pessoal,
/**
* Created by IntelliJ IDEA.
* User: danielhonig
* Date: Jan 23, 2009
* Time: 4:27:10 PM
* To change this template use File | Settings | File Templates.
*/
import org.codehaus.groovy.grails.commons.ConfigurationHolder
class SSLFilters {
// Set these to your HTTP/HTTPS ports
def defaultPortHTTP = 80
def defaultPortHTTPS = 443
static def SSLRequiredMap = ConfigurationHolder.config.SSLRequiredMap
def shouldUseSSL(controllerName, actionName) {
// User actions use SSL
if (SSLRequiredMap[controllerName]!=null) {
//If * then all actions are secured
if (SSLRequiredMap[controllerName][0] == '*')
return true
//else look for specific action
if (SSLRequiredMap[controllerName].contains(actionName))
return true
}
false
}
def filters = {
sslFilter(controller: "*", action: "*"){
before = {
def controller = controllerName
def action = actionName
log.debug("SSLFilter: ${params?.controller}.${params?.action}")
def url = null
// SSL off by default
def useSSL = shouldUseSSL(controllerName,actionName)
log.debug("${controller}.${action}, useSSL:$useSSL")
// Get redirected url
url = getRedirectURL(request, params, useSSL);
// If redirect url returned, redirect to it
if (url) {
redirect(url: url)
return false;
}
return true;
}
}
}
def getRedirectURL = {request, params, ssl ->
log.debug("getRedirectURL: $ssl")
// Are we there already?
if (request.isSecure() == ssl)
return null;
def protocol
def port
// Otherwise we need to flip
if (ssl) {
protocol = 'https'
// If using the standard ports, don't include them on the URL
port = defaultPortHTTPS
if (port == "443")
port = ""
else
port = ":${port}"
}
else {
protocol = 'http'
// If using the standard ports, don't include them on the URL
port = defaultPortHTTP
if (port == "80")
port = ""
else
port = ":${port}"
}
log.debug("Flip protocol to $protocol")
def url = request.forwardURI
def server = request.serverName
def args = paramsAsUrl(params)
url = "$protocol://$server$port$url$args"
log.debug("getRedirectURL - redirect to $url")
return url;
}
def paramsAsUrl = {params ->
int ii = 0
String args = ""
params.each
{k, v ->
if (['controller', 'action', 'id'].find {k == it})
return;
if (ii)
args += "&"
else
args += "?"
args += "$k=$v"
ii++
}
return args
}
}
Controle Financeiro e Planejamento Financeiro com Grails e Prototype
Mês passado eu e um grande amigo, e meu sócio neste projeto, lançamos um site para controle financeiro pessoal: www.manubia.com.br
Instalador para Mac de uma aplicação Java
ShowTime.java MainClass.txtExcelente artigo de como criar um installer para Mac de uma aplicação Java. Como esse artigo me salvou legal, copio ele aqui, só pra não perder.
How to Create a Mac OS X Installer for a Java Application
(Updated for Mac OS X 10.5 — Leopard)
With some simple steps you can turn your Java Swing program (.jar) into a proper Mac OS X application with a native installer. The instructions below step you through the process from scratch with a sample program called
ICONS
↓ 1) Install Xcode
Apple's Xcode suite includes development tools you'll need to bundle and package a Java program. First, download Xcode for Mac Development (version 3.1.1 or later) and open the downloaded .dmgfile. Now run the "XcodeTools.mpkg" file and complete the Xcode installation with all the default options.
Before continuing to the next step, it's a good idea to perform a "Software Update..." to make sure your OS files are current.2) Launch Unix Terminal
Using "Finder" go into "Applications" and then open the "Utilities" folder. Scroll down until you see "Terminal". Open "Terminal" and you're now at the Unix prompt.3) Make Project Folder
At the Unix prompt, enter these two commands:
cd ItsShowtime4) Write Some Java Code
Mac OS X comes with a simple but effective text editor called Pico. Use the following command to create and edit a new Java file:
Use 5) Compile Java Program
Back at the Unix prompt, compile your Java program into a class file:
ls -la6) Make Executable JAR
Before we make an executable JAR file, we need a manifest file to indicate which class contains the "main" function. We'll use Pico again:
Exit Pico and use the following "jar" command to create the "ShowTime.jar" file:
ls -la
While the manual commands for steps #5 and #6 above work fine, you can automate them using Ant with this build.xml file.7) Create Application Icon
The default icon for an executable JAR is a coffee cup. To add a custom icon, we need to use the "Icon Composer".
Download and save (
Then move the file into the "ItsShowtime" folder with the following command:
Steps:
Next we'll create a Mac application (with your new icon).8) Bundle the JAR
Using "Finder", navigate into the "Developer:Applications:Utilities" folder and double-click "Jar Bundler".
Steps:
You now have a proper Mac application. Next we'll create an installer for your application.9) Create Mac Installer
Using "Finder", navigate into the "Developer:Applications:Utilities" folder and double-click "PackageMaker".
Steps:
Your installer is done, but it's not yet download friendly.10) Put Installer on a Web Page
Before putting the installer on the web, we need to zip it up into a single file. Use "Finder" to navigate to the "ItsShowtime" folder. Create a zip of "ShowTimeInstaller.pkg" using the "Compress" option on the