[JBoss Portal] New message: "Re: Portlet that lists all available portals for a user"
by Eli Galicia
User development,
A new message was posted in the thread "Portlet that lists all available portals for a user":
http://community.jboss.org/message/522521#522521
Author : Eli Galicia
Profile : http://community.jboss.org/people/superdepor
Message:
--------------------------------------------------------------
I'm right now able to list and display all the roles a user are member of and also all my portal urls.
this is the code
{code}
MembershipModule membershipModule = (MembershipModule) new InitialContext().lookup("java:portal/MembershipModule
Iterator iterator = membershipModule.getRoles(request.getUser()).iterator();
//displays all roles the user are member of
while (iterator.hasNext()) {
html.write("these are your roles, " + iterator.next().toString() + "<br />");
}
//this code part will display links for all the portals
PortalNode pn= request.getPortalNode().getRoot();
for(Object objPage : pn.getChildren()){
if(objPage instanceof PortalNode){
PortalNode page = (PortalNode)objPage;
if(page.getType() == PortalNode.TYPE_PORTAL){
PortalNode childPN= page.getChild("default");
PortalNodeURL pURL = response.createRenderURL(childPN);
html.write("<a href=\"" + pURL + "\">" +page.getDisplayName(request.getLocale()) + "</a><br/>");
}
}
}
{code}
I have tried the bellow code but got Null pointer exception at authorizationDomainRegistry.getDomain(); any idead?{code}
AuthorizationDomain authorizationDomain= authorizationDomainRegistry.getDomain(pnu.toString());// also tried with pURL.toString()
PermissionRepository pr= authorizationDomain.getPermissionRepository();
Iterator i= membershipModule.getRoles(request.getUser()).iterator();
while (i.hasNext()) {
PortalPermission portalPermission = pr.getPermission(iterator.next().toString(), pURL.toString());
//haven't started to code this part..
{code}
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522521#522521
16 years, 2 months
[JBoss Web Services] New message: "Re: How can I force a particular WS implementation? How to ensure Metro over Native?"
by Jan Uhlir
User development,
A new message was posted in the thread "How can I force a particular WS implementation? How to ensure Metro over Native?":
http://community.jboss.org/message/522508#522508
Author : Jan Uhlir
Profile : http://community.jboss.org/people/espinosa_cz
Message:
--------------------------------------------------------------
Yes it is definitively possible to deploy a Metro based web service to a JBoss with Native stack or without any WS support at all.
Yes it is definitively possible to deploy a project using two or more WS stack implementations.
I have just finished this example project proving it. You are more then welcome to test it:
http://gitorious.org/esp-home/wsarena3/trees/version1
Steps to deploy Metro based web service to a hosting AS in a target implementation agnostic way:
* Package libraries to WAR: sun-jaxws:jaxws-rt, sun-jaxws:streambuffer, sun-jaxws:stax-ex (Maven naming)
* Generate WSDL and server Java stubs (hosting AS will not do it for you) and bundle them. Use CLI, Ant or Maven tools: wsgen.
* In web.xml define FooService servlet as a com.sun.xml.ws.transport.http.servlet.WSServlet class. Also set servlet/service URL pattern.
* In sun-jaxws.xml define a real implementation class for FooService, it is esp.home.wsarena.service.FooService in my case, and define service URL pattern (t is already defined in web.xml!? Rather keem them same)
There are 2 modules in my project - *webservice-metro* and *webservice-native*. One using SUN Metro stack (bundled in), other JBoss native stack (expected to be provided by server). Both deploy on the server at the same time successfully. I did not put them in one EAR, there should be no difference. Service implementation is in separate JAR module, the same identical JAR is included into both native and metro WAR packages. There is aslo a simple test client to prove functionality of both modules.
You are welcome to try them as:
http://localhost:8080/wsarena3-*metro*/FooService?wsdl
http://localhost:8080/wsarena3-*native*/FooService?wsdl
The question remains – how JBoss recognized that FooService in my webservice-metro module is intended to be run as Metro and not a Native? Why JBoss reacted on annotated FooService in webservice-metro modue and not on the very same class in my webservice-native module?
Possible answers:
A) it detects presence of jaxws libraries (how? Some specific class or a Jar name?)
B) it detects presence of jaxws configuration file the sun-jaxws.xml (is it a simple file detection? Or it does deepr context analysis looking for present class names?)
C) both above
I am very keen to know the answer.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522508#522508
16 years, 2 months
[jBPM] New message: "Re: JBPM 4.3 and JPA/Hibernate integration question"
by christian garderes
User development,
A new message was posted in the thread "JBPM 4.3 and JPA/Hibernate integration question":
http://community.jboss.org/message/522492#522492
Author : christian garderes
Profile : http://community.jboss.org/people/chrigar
Message:
--------------------------------------------------------------
In SpringProcessEngine, the ApplicationContext loading fails on these lines with an ugly NullPointerException:
LocalSessionFactoryBean localSessionFactoryBean = springProcessEngine.get(LocalSessionFactoryBean.class);
Configuration hibernateConfiguration = localSessionFactoryBean.getConfiguration();
We can't imagine a way to get back the hibernateConfiguration from a LocalContainerEntityManagerFactoryBean
Ok we are doomed to stick on JBPM 3.x or JBPM 4.2 version... in wait of a native support of JPA (?); but there is no entry in jira.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/522492#522492
16 years, 2 months