Skip to content

Instantly share code, notes, and snippets.

View pauldijou's full-sized avatar

Paul Dijou pauldijou

View GitHub Profile
@pauldijou
pauldijou / deltaspike-security-whatiwant
Created March 7, 2012 23:41
DeltaSpike Security API : what I want to write
// Inside a JSF page :
<h:commandButton action="create" rendered="#{identity.can('create','user')}">Create User</h:commandButton>
// Inside Java code :
// (would be better with annotations of course)
public class UserAction
{
@Inject
private Identity identity;
Realm : a space where user can be authenticated (database, LDAP, file, ...)
User : a subject that can be authenticated in, at least, one realm
Identity : bean in session scope that manage the current authenticated user
Authenticator : stateless bean that can try to authenticate Credentials (have to specify in which realm)
Identity should not be informed about how the application manage what a user is or is not allowed to do. Identity should only say "Yes" or "No" when asked about a User trying to do something. Which mean only one method like "boolean can(...)" with eventually different combinations of parameters (see Identity interface).
@pauldijou
pauldijou / gist:2346037
Created April 9, 2012 19:40
Awestruct error
paul@fury:~/workspace/arquillian.github.com$ awestruct -d --force
can't convert nil into String
/home/paul/workspace/arquillian.github.com/_ext/arquillian.rb:411:in `join'
/home/paul/workspace/arquillian.github.com/_ext/arquillian.rb:411:in `handles'
/home/paul/workspace/arquillian.github.com/_ext/repository.rb:141:in `execute'
/home/paul/workspace/arquillian.github.com/_ext/repository.rb:140:in `each_value'
/home/paul/workspace/arquillian.github.com/_ext/repository.rb:140:in `execute'
/home/paul/workspace/arquillian.github.com/_ext/repository.rb:132:in `each'
/home/paul/workspace/arquillian.github.com/_ext/repository.rb:132:in `execute'
/var/lib/gems/1.8/gems/awestruct-0.2.15/lib/awestruct/extensions/pipeline.rb:33:in `execute'
@pauldijou
pauldijou / gist:2361478
Created April 11, 2012 19:07
Facebool Error
21:05:39,464 WARN [org.jboss.solder.exception.control.log] (http-localhost-127.0.0.1-8080-1) No handlers found for exception javax.servlet.ServletException: Must provide a valid string as verifier
21:05:39,465 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/socializer].[FacesServlet]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet FacesServlet threw exception: javax.enterprise.event.ObserverException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_24]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.6.0_24]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.6.0_24]
at java.lang.reflect.Constructor.newInstance(Constructor.java:532) [rt.jar:1.6.0_24]
at java.lang.Class.newInstance0(Class.java:372) [rt.jar:1.6.0_24]
at java.lang.Class.newInstance(Class.java:325) [rt.jar:1.6.0_24]
at org.jboss.weld.util.re
21:29:23,498 WARN [org.jboss.solder.exception.control.log] (http-localhost-127.0.0.1-8080-1) No handlers found for exception javax.servlet.ServletException
21:29:23,499 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/socializer].[FacesServlet]] (http-localhost-127.0.0.1-8080-1) Servlet.service() for servlet FacesServlet threw exception: javax.enterprise.event.ObserverException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_24]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.6.0_24]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.6.0_24]
at java.lang.reflect.Constructor.newInstance(Constructor.java:532) [rt.jar:1.6.0_24]
at java.lang.Class.newInstance0(Class.java:372) [rt.jar:1.6.0_24]
at java.lang.Class.newInstance(Class.java:325) [rt.jar:1.6.0_24]
at org.jboss.weld.util.reflection.SecureReflections$16.work(Secure
@pauldijou
pauldijou / mvn install for bootstrap-ui
Created April 23, 2012 19:56
mvn install for bootstrap-ui
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.richfaces.sandbox.ui.bootstrap:bootstrap-ui:jar:4.2.1-SNAPSHOT
[WARNING] 'parent.relativePath' of POM org.richfaces.sandbox.ui.bootstrap:bootstrap-parent:4.2.1-SNAPSHOT (/home/paul/workspace/richfaces-sandbox/bootstrap/pom.xml) points at org.richfaces.sandbox:richfaces-sandbox-aggregator instead of org.richfaces.ui:richfaces-ui-parent, please verify your project structure @ org.richfaces.sandbox.ui.bootstrap:bootstrap-parent:4.2.1-SNAPSHOT, /home/paul/workspace/richfaces-sandbox/bootstrap/pom.xml, line 28, column 13
[WARNING] 'build.plugins.plugin.version' for org.zeroturnaround:jrebel-maven-plugin is missing. @ org.richfaces.ui:richfaces-ui-parent:4.2.1-SNAPSHOT, /home/paul/.m2/repository/org/richfaces/ui/richfaces-ui-parent/4.2.1-SNAPSHOT/richfaces-ui-parent-4.2.1-SNAPSHOT.pom, line 183, column 29
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threa
<?xml version="1.0" encoding="UTF-8"?>
<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite">
<cc:interface>
<cdk:class>org.richfaces.bootstrap.renderkit.NavbarRenderer</cdk:class>
<cdk:superclass>org.richfaces.bootstrap.renderkit.NavbarRendererBase</cdk:superclass>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:b="http://richfaces.org/sandbox/bootstrap">
<b:navbar brand="Group" collapsible="true">
<h:link outcome="/index.xhtml" value="Default1"/>
<b:group type="dropdown" value="Default2">
<h:link outcome="/index.xhtml" value="Default2.1"/>
<h:link outcome="/index.xhtml" value="Default2.2"/>
<b:group type="dropdown" value="Default2.3">
@pauldijou
pauldijou / cb.template.xml
Created June 14, 2012 17:04
CommandButtonTemplate
<?xml version="1.0" encoding="UTF-8"?>
<cdk:root xmlns="http://jboss.org/schema/richfaces/cdk/xhtml-el"
xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core"
xmlns:c="http://jboss.org/schema/richfaces/cdk/jstl/core"
xmlns:cc="http://jboss.org/schema/richfaces/cdk/jsf/composite">
<cc:interface>
<cdk:class>org.richfaces.bootstrap.renderkit.CommandButtonRenderer</cdk:class>
<cdk:superclass>org.richfaces.bootstrap.renderkit.CommandButtonRendererBase</cdk:superclass>
@pauldijou
pauldijou / RichFunction.java
Created June 19, 2012 13:36
New jQuery & cie functions
public final class RichFunction {
private static final int DEFAULT_ESCAPING_LENGTH = 4;
/**
* The rich:jQuerySelector('id') function is a shortcut for the equivalent rich:jQuerySelectorExt('id',4)
* since 4 is the default escaping length for usage inside a JSF component.
*/
@Function
public static String jQuerySelector(String id) {
return jQuerySelectorExt(id, DEFAULT_ESCAPING_LENGTH);