[JBoss Seam] - SEAM + jBPM question
by alex_enache
Hi guys!
I have to create a application using SEAM and jBPM. In short, the application needs to create workflows and run them using jBPM. Supposing I have the xml that describes the workflow, I need to deploy it somewhere and somehow, and of course start it. You can find a demo here: http://docs.jboss.com/jbpm/v3/demos/movies/jbpm-overview.htm. I need to be able to deploy the xml as a result of a client action. The xml resides of course on the server side. In the example, after deploy, the task that reflects the workflow is started, and runed. I want to be able to also do the same thing, start the new deployed task. Can this be done in a SEAM web app ? If you have some ideas, i would be more than greatfull. Of course, any links to what I should read to be able to do a thing like that is also welcomed.
Any idea, even the smallest one, is more than welcomed.
Thanks,
Alex
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070666#4070666
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070666
18Â years, 8Â months
[JBoss Portal] - Re: Access UserModule from a portlet when not authenticated
by indyJones
ok...got it to work...here is how I did it using JSF...
Get the userModule through JNDI
|
| userModule = (UserModule) new InitialContext().lookup("java:portal/UserModule");
|
|
Get the user by using its user id....NOT user name....
DO THIS
|
| User test = userModule.findUserById(id);
|
|
DO NOT DO THIS
|
| User test = userModule.findUserByUserName("admin");
|
|
I basically wrote a simple Hibernate service layer to get the user id after a email is given and the answer to the secret question is correct.
Then, create a new password and change it
|
| test.updatePassword(newpassword);
|
|
Then fire an email off to the user with their new password. I used ...
|
| Session session = (Session) new InitialContext().lookup("java:Mail");
|
|
That is configured through the deploy/mail-service.xml file. The Forums Portlet uses the same service
POOF! I now have a self managed user password system...AKA..."Forgot My Password" link
Indy
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070663#4070663
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070663
18Â years, 8Â months
[JBoss Seam] - Re: not redirecting to security_error.xhtml
by lowecg2004
I just came across this issue and managed to figure out a workaround.
I had a class level @Restrict defined for a bean. The bean had two functions: 1) to provide a @DataModel with its associated @Factory; and 2) to define an action method for my persistence logic. From the JIRA reference above it seams that exception trapping does not work if the exception occurs during the RENDER_RESPONSE phase. The button action should be fine since the action would be called as part of the INVOKE_APPLICATION phase.
However, the problem comes from the @DataModel (or any other data binding for that matter) which will only be called during the RENDER_RESPONSE phase. Therefore when the page that uses the data model is first accessed, it is the point when the bindings/data model are first accessed that cause the problem. The workaround comes from the fact that we need to somehow get the bean to be accessed during an earlier phase. Fortunately for us, this is really easy to do in Seam using a page action:
Add a dummy method to your bean...
|
| @Name("permissionsHome")
| @Scope(ScopeType.CONVERSATION)
| @Restrict("#{s:hasRole('administration')}")
| public class PermissionsHome {
|
| ...
|
| public void forceEarlySecurityCheck() {
| // this page action ensures that the class level @Restrict() rules are run before RENDER_RESPONSE
| }
| }
|
|
| ...and invoke from your XXX.pages.xml
|
| <page ... action="#{permissionsHome.forceEarlySecurityCheck}" >
| </page>
This results in an invocation attempt against the action before RENDER_RESPONSE thus allows the AuthorizationException be handled correctly by Seam.
I'm sure you lot had already figured this out, but I thought I'd post my solution just in case it's useful to someone else.
Cheers,
Chris.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4070650#4070650
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4070650
18Â years, 8Â months