[JBoss Seam] - Re: roles redirecting methods
by zhamdi
Hi Shane,
Sorry if my last mail wasn't clear. I'll explain the idea by the mean of a frequent example:
Let's imagine we have an application with 3 rules: client, commercial and administrator : the client can see only its orders, the commercial can only see the orders of his clients and the administrator can see all orders:
This example can only be developed like this :
| doCommonCode();
| if( rule="commercial" ) {
| doCommercial();
| } else if( rule="client" ) {
| doClient();
| } else if( rule="administrator" ) {
| doAdministrator();
| }
The new seam authorization mecanism cant' do this simply beacuse the @Restricted annotation is binary (not a switch). These if else blocks become very frequent and reduce code readability.
The solution I sent is just a proposition: It attempts to add to the annotations the responsibility to redirect to the business rule case method. Here's how I imagine it:
@RuleSensible comes as the @Override annotation : it just enforces readability and code changes safety : it informs this method is a rule switch. (inside the method body comes the common code to all cases)
@RuleCase( method="switchMethodName ) is there to say : this is a switch case for the given method
and finally @Restricted comes to say which rule case must be handled by the annotated method.
So here was my idea, I hope you'll like it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121738#4121738
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121738
18 years, 6 months
[JBoss Seam] - Re: Conversations doing my head in - help
by mail.micke@gmail.com
I'm having the problem I thought I had, second click on the command button calling an action with @Begin(join=true) gets a new conversation id.
And I was wrong about the action not getting invoked with the seam ui components, they just don't seem to go through the usual jsf lifecycle (don't get the printouts from my timer phase listener).
Here is some more code, can you guys see anything wrong?
| @Name("dataSearch")
| @Scope(ScopeType.CONVERSATION)
| public class DataSearch {
|
| private String pattern;
|
| @In("#{DataService}")
| private DataService dataService;
|
| boolean onlyColl = false;
| boolean withPrivate= false;
| List<Data> results;
|
|
| @Begin(join=true)
| public String search(){
| System.out.println("Conversation id in action: " +Conversation.instance().getId());
| if(results == null){
| System.out.println("results is NULL");
| results = dataService.getData(pattern, onlyColl, withPrivate);
| }
|
| return null;
| }
| //cut
|
|
And here is the XHTML body content :
|
| #{conversation.id}
|
| <h:form>
| Search pattern:
| <h:inputText value="#{dataSearch.pattern}"/>
| <s:link value="SeamLinkSearch" action="#{dataSearch.search}"/>
| <s:button value="SeamButtonSearch" action="#{dataSearch.search}"/>
| <h:commandButton action="#{dataSearch.search}" value="search"/>
| <a4j:commandButton action="#{dataSearch.search}" value="ajax search" reRender="searchResult"/>
| <a4j:status startText="Working..." stopText=""/>
|
|
| <rich:dataTable
| id="searchResult"
| rendered="#{not empty dataSearch.results}"
| value="#{dataSearch.results}"
| var="row"
| rows="10">
| <f:facet name="header">
| <rich:datascroller for="searchResult"/>
| </f:facet>
| <rich:column>
| <f:facet name="header">
| Code
| </f:facet>
| #{row.code}
| </rich:column>
| <rich:column>
| <f:facet name="header">
| Name
| </f:facet>
| #{row.name}
| </rich:column>
| </rich:dataTable>
|
| <rich:messages showDetail="true"/>
| </h:form>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121736#4121736
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121736
18 years, 6 months
[JBossWS] - Re: WSSE UsernameToken without HTTP basic auth?
by mikaeljl
Hi Alessio!
Thank you for investigating this, much appreciated !
Unfortunately I do not have an EJB3 endpoint, I'm starting with a WSDL file so I have a POJO endpoint (using wsconsume to do wsdl -2-java).
I do not think WSSE UsernameToken authentication is working for POJO endpoints without enabling some form of http level authentication like basic auth? Can you confirm this?
I will look into converting my pojo endpoints into ejb3 endpoints because that seems to be the easiest solution right now. I guess it is just a matter of adding @Stateless to my pojo class and packaging/deploying the thing as a jar instead of a war... kind of...
Are there any plans for supporting WSSE UsernameToken based authentication for POJO endpoints (without the requirement of any additional http level authentication?
/MIkael
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4121726#4121726
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4121726
18 years, 6 months