[JBoss Portal] - management API issue
by marimuthub
We are using following block of code to manage the roles,users and relationships beetween users and roles. The following code is written inside filterand the following block of code is called when user login into our portal application. Access previlleges portalnodes are generated based on following block codes.
We are having following issue when portal nodes generates for the user.
The user belongs admin role will get the all the portal nodes or tabs navigations.
The user belongs to normal user will get the few portal nodes
or tabs navigations.
The scenario is first time admin user login into our portal application then logout close browser. it works fine
open new browser login as normal user. but still the access previlleges(portal nodes or tabs navigations) generated for admin role instead of normal user role.
Please help us to resolve the issue
import org.jboss.portal.identity.UserModule;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.identity.MembershipModule;
[...]
UserModule userModule = (UserModule)new InitialContext().lookup("java:portal/UserModule");
RoleModule roleModule = (RoleModule)new InitialContext().lookup("java:portal/RoleModule");
MembershipModule memModule = (MembershipModule)new InitialContext().lookup("java:portal/MembershipModule");
User user = userModule.findUserByUserName(...);
Role role = roleModule.findRoleByName(...)
Set roleSet = new HashSet();
roleSet.add(role);
memModule.assignRoles(user,roleSet);
Regards
Marimuthu
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115424#4115424
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115424
18 years, 4 months
[JBoss Seam] - Catch-22 with Seam2 and converterId in page parameter - bug?
by terryb
Im having a kind of catch-22 problem since upgrading to Seam 2.
I have date/time fields on xhtml form, and corresponding Seam page parameter in .page.xml file. If I don't assign converterId to date/time page param then
it throws error (javax.el.ELException: java.lang.IllegalArgumentException: argument type mismatch) and Seam Debug page..
However, if I give page parameter a convertId then xhtml page works but I get error in log (...Cannot instantiate converter of type org.jboss.seam.ui.converter.DateTimeConverter...).
I have jboss-seam-ui.jar in my .war\WEB-INF\lib folder. jboss-seam-ui.jar contains class org.jboss.seam.ui.converter.DateTimeConverter.
I think solution to my problem is to have a converterId - can anyone tell how to get rid of error (JSF1006: Cannot instantiate converter of type...)?
Seam2+JSF RI+Facelets+Richfaces, JBoss EAP 4.2.
| without converterId in page param of .page.xml
| <!DOCTYPE page PUBLIC
| "-//JBoss/Seam Pages Configuration DTD 2.0//EN"
| "http://jboss.com/products/seam/pages-2.0.dtd">
|
| <page>
| <param name="settlementDateFrom" value="#{paymentReconciliation.settlementDateFrom}"/>
| </page>
|
| ...
| ERROR [SeamPhaseListener] uncaught exception
| javax.el.ELException: java.lang.IllegalArgumentException: argument type mismatch
| at javax.el.BeanELResolver.setValue(BeanELResolver.java:116)
| at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:68)
| at com.sun.faces.el.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:93)
| at org.jboss.el.parser.AstPropertySuffix.setValue(AstPropertySuffix.java:73)
| at org.jboss.el.parser.AstValue.setValue(AstValue.java:84)
| at org.jboss.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
| at org.jboss.seam.core.Expressions$1.setValue(Expressions.java:117)
| at org.jboss.seam.navigation.Pages.applyConvertedValidatedValuesToModel(Pages.java:779)
| ...
|
|
|
| with converterId in page param
| <param name="settlementDateFrom" converterId="org.jboss.seam.ui.converter.DateTimeConverter" value="#{paymentReconciliation.settlementDateFrom}"/>
|
| (Similar error is thrown is I use converterId="javax.faces.convert.DateTimeConverter").
|
| FATAL [application] JSF1006: Cannot instantiate converter of type org.jboss.seam.ui.converter.DateTimeConverter
| WARN [Param] could not create converter for: settlementDateFrom
| javax.faces.FacesException: Expression Error: Named Object: org.jboss.seam.ui.converter.DateTimeConverter not found.
| at com.sun.faces.application.ApplicationImpl.createConverter(ApplicationImpl.java:726)
| at org.jboss.seam.jsf.SeamApplication.createConverter(SeamApplication.java:112)
| at org.jboss.seam.navigation.Param.getConverter(Param.java:52)
| at org.jboss.seam.navigation.Param.getStringValueFromModel(Param.java:142)
| at org.jboss.seam.navigation.Pages.updateStringValuesInPageContextUsingModel(Pages.java:820)
| at org.jboss.seam.jsf.SeamStateManager.saveSerializedView(SeamStateManager.java:61)
| at org.ajax4jsf.application.AjaxStateManager.saveSerializedView(AjaxStateManager.java:317)
| at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:615)
| at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
| at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
| at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
| at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
| at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
| at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
| at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
| at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
| at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:543)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
| at java.lang.Thread.run(Thread.java:619)
|
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115419#4115419
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115419
18 years, 4 months
[Persistence, JBoss/CMP, Hibernate, Database] - ManyToMany, sort by field in mapping table
by dkane
Dear colleagues,
I have Termnal and Firmware entities , with Terminal_Firmware table that defines many-to-many relationship.
Terminal has a collection of bound Firmwares :
@ManyToMany(cascade = {CascadeType.PERSIST})
| @JoinTable(
| name="Terminal_Firmware",
| joinColumns=@JoinColumn(name="tId", referencedColumnName="tId"),
| inverseJoinColumns=@JoinColumn(name="fId", referencedColumnName="Id")
| )
|
| public List<Firmware> getFirmwares()
| {
| return firmwares;
| }
Terminal_Firmware also contains integer column "position", which I want firmwares to be sorted by.
Problem can be solved by adding a separate entity for Terminal_Firmware and making a query to all 3 tables, but I'd like to avoid that .
@OrderBy annotation does not work for fields in mapping table.
Do you know the way ?
Many thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115412#4115412
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115412
18 years, 4 months