cancel
Showing results for 
Search instead for 
Did you mean: 

URL Addressability - Wizard inviteSpaceUsers

lgilles
Champ in-the-making
Champ in-the-making
Hi everyone,

I'm using Alfresco 2.2 Entreprise edition and cannot make the "inviteSpaceUsers" wizard work correctly by URL Addressability.

I'm currently trying to create a link pointing to the Space's "inviteSpaceUsers" wizard. After some research, it's comes out to me that the right way of passing the NodeID is to remove "workspace://SpacesStore/" part of the nodeRef, so an URL with the following format :

http://hostSmiley Tongueort/alfresco/navigate/wizard/inviteSpaceUsers/08f98467-4369-11dd-8cd5-21e4e38e183a

The Wizard page then shows up, but if I click on next after inviting some users, it gaves me a NullPointerException.
The nullpointer is the concequences of the

org.alfresco.web.bean.wizard.InviteSpaceUsersWizard.getNode() ==> return this.browseBean.getActionSpace(); where ActionSpace is NULL.

I looked in org.alfresco.web.app.servlet.ExternalAccessServlet, where I founded out that :


257 else if (OUTCOME_DIALOG.equals(outcome) || OUTCOME_WIZARD.equals(outcome))
258      {
259         if (args.length != 0)
260         {
261            if (args.length > 1)
262            {
263               // if a GUID was passed, use it to init the NavigationBean current context
264               NavigationBean navigator = (NavigationBean)FacesHelper.getManagedBean(fc, NavigationBean.BEAN_NAME);
265               navigator.setCurrentNodeId(args[1]);
266            }
267           
268            // set the external container session flag so that a plain container gets used
269            fc.getExternalContext().getSessionMap().put(
270                     AlfrescoNavigationHandler.EXTERNAL_CONTAINER_SESSION, Boolean.TRUE);
271           
272            NavigationHandler navigationHandler = fc.getApplication().getNavigationHandler();
273            navigationHandler.handleNavigation(fc, null, outcome + ':' + args[0]);
274         }
275      }

Now, in debug mode @ line 265, I've evaluated the current code, in order to setup the SpaceAction.

browseBean.setupSpaceAction(args[1], true);

And then the wizard worked OK !

Now, is it a org.alfresco.web.app.servlet.ExternalAccessServlet bug and this is a fix, or I am doing something wrong here ? because I really cannot made the wizard worked until doing this trick and I thinking redefining org.alfresco.web.app.servlet.ExternalAccessServlet in order to fix the problem in this way.

Has any of you already been faced with this issue ? Is there any other solution ? Thanks in advance !!!


Here is the server stack trace

java.lang.NullPointerException
   at org.alfresco.web.bean.wizard.InviteUsersWizard.next(InviteUsersWizard.java:560)
   at org.alfresco.web.bean.wizard.WizardManager.next(WizardManager.java:501)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
   at java.lang.Thread.run(Unknown Source)
3 REPLIES 3

zaizi
Champ in-the-making
Champ in-the-making
This is a really good question.

The current node is set up in the browse bean using an action listener. The action definition in web-client-config-actions.xml is

<action id="manage_space_users">
            <permissions>
               <permission allow="true">ChangePermissions</permission>
            </permissions>
            <label-id>manage_invited_users</label-id>
            <image>/images/icons/invite.gif</image>
            <action>dialog:manageInvitedUsers</action>
            <action-listener>#{BrowseBean.setupSpaceAction}</action-listener>
            <params>
               <param name="id">#{actionContext.id}</param>
            </params>
         </action>

The org.alfresco.web.bean.wizard.InviteSpaceUsersWizard gets the current node by

this.browseBean.getActionSpace();

org.alfresco.web.app.servlet.ExternalAccessServlet uses the NavigationBean to set the current node. Use it in custom wizards / dialogs to get the current node.

this.navigationBean.getCurrentNode();

Question is which one to use? The quick and easy fix would be to do what you've done and ensure the browsebean action space is also set up in the ExternalAccessServlet.

lgilles
Champ in-the-making
Champ in-the-making
Thanks Zaizi for your reply,

I didn't noticed the action configuration of the dialog, and in fact, it's seems to be the actionListener that setup the spaceAction before calling the servlet.

Question is which one to use? The quick and easy fix would be to do what you've done and ensure the browsebean action space is also set up in the ExternalAccessServlet.

But since i'm calling the wizard from URL and not from a standard alfersco Action button, how should I tell him to first setup the spaceaction ? I've actually redefined the servlet and added the line of code I was talking about, but I dont feel good …  Smiley Surprisedops: There must be another solution ..

Thank again,
laurent

jharrop
Champ in-the-making
Champ in-the-making
Thanks Laurent for this thread; I'm also using your solution. Smiley Surprisedops:
.. Jason
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.