cancel
Showing results for 
Search instead for 
Did you mean: 

What am I missing?

rich_weiskopf
Champ in-the-making
Champ in-the-making
1.  Created a new type by extending cm:folder

  <type name="com-drjb-prjSmiley Tonguerojects-group">
  <title>Container for a group of Projects</title> 
    <parent>cm:folder</parent>
    <mandatory-aspects>
     <aspect>com-drjb-dd:node_type</aspect>
    </mandatory-aspects>
  </type>

2.  Created a new page: /jsp/project/projects-group.jsp

3.  Added the following navigation override:

<config evaluator="node-type" condition="com-drjb-prjSmiley Tonguerojects-group">
  <navigation>
    <override from-view-id="/jsp/browse/browse.jsp"
           to-view-id="/jsp/project/projects-group.jsp" />                  
  </navigation>
</config>

4.  Created a new space of node-type: com-drjb-prjSmiley Tonguerojects-group

5.  Signed on as admin

6.  From Company Home, when I selected my newly created space, I was transferred to /jsp/project/projects-group.jsp

7.  Life is GOOD!

8.  While on /jsp/project/projects-group.jsp, changed view to details view

9.  Instead of getting /jsp/project/projects-group.jsp, went back to standard browse.jsp view

10. Reviewed BrowseBean.viewModeChanged() and noticed it sets the outcome to "browse"

11. Added from-outcome to navigation override

<config evaluator="node-type" condition="com-drjb-prjSmiley Tonguerojects-group">
  <navigation>
    <override from-view-id="/jsp/browse/browse.jsp"
           to-view-id="/jsp/project/projects-group.jsp" />
    <override from-outcome="browse" to-view-id="/jsp/project/projects-group.jsp" />                               
  </navigation>
</config>

12.  Repeated step 8 with same result as noted in 9

13.  Added a second config evaluator:

<config evaluator="node-type" condition="com-drjb-prjSmiley Tonguerojects-group">
  <navigation>
    <override from-view-id="/jsp/browse/browse.jsp"
           to-view-id="/jsp/project/projects-group.jsp" />                              
  </navigation>
</config>
 
<config evaluator="node-type" condition="com-drjb-prjSmiley Tonguerojects-group">
  <navigation>
    <override from-outcome="browse" to-view-id="/jsp/project/projects-group.jsp" />                    
  </navigation>
</config>

13.  Repeated step 8 with same result as noted in 9 and 12

Any suggestions/direction will appreciated.

TIA
Rich
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
This will be because the dispatch context is not being setup when the view is changed, you've found a bug!

I've added this to JIRA so it gets fixed for 1.4, in the meantime you can try adding the following line to BrowseBean.viewModeChanged() just before the call to navigateBrowseScreen().


this.navigator.setupDispatchContext(this.navigator.getCurrentNode());

I think you will also need to have the navigation rule you added in step 11 i.e.  <override from-outcome="browse" to-view-id="/jsp/project/projects-group.jsp" />

The bug, so you can keep track of it, can be found here: http://www.alfresco.org/jira/browse/AWC-774

rich_weiskopf
Champ in-the-making
Champ in-the-making
It worked perfectly!

PS: I did have to add the <override from-outcome=browse…  statement

Rich

rich_weiskopf
Champ in-the-making
Champ in-the-making
1.  Am trying to incorporate following (copied out of browse.jsp) into my actionitem.jsp

<%– Quick upload action –%>
<nobr>
<rSmiley TongueermissionEvaluator
value="#{NavigationBean.currentNode}" allow="CreateChildren"
id="eval2">
<a:actionLink value="#{msg.add_content}"
image="/images/icons/add.gif" padding="2"
action="addContent"
actionListener="#{AddContentDialog.start}"
style="white-space:nowrap" id="link3" />
</rSmiley TongueermissionEvaluator>
</nobr>

2.  Defined the following

<config evaluator="node-type" condition="com-drjb-ai:actionitem">
<navigation>
<override from-view-id="/jsp/actionitems/actionitems-group.jsp" to-view-id="/jsp/actionitems/actionitem.jsp" />
<override from-outcome="browse" to-view-id="/jsp/actionitems/actionitem.jsp" />
        
<override from-view-id="/jsp/actionitems/actionitem.jsp" />
<override from-outcome="addContent" to-view-id="/jsp/content/add-content-dialogz.jsp" />             
</navigation>
</config>

3.  First 2 overrides have already worked fine.
    Trying to go from the current displayed page(actionitem.jsp) when an outcome of "addContent" is received.
    Screen blinked but remained on same page. Nothing added to log file.

4.  Changed config statement to:
<config evaluator="node-type" condition="com-drjb-ai:actionitem">
<navigation>
<override from-view-id="/jsp/actionitems/actionitems-group.jsp" to-view-id="/jsp/actionitems/actionitem.jsp" />
<override from-outcome="browse" to-view-id="/jsp/actionitems/actionitem.jsp" />
<override from-outcome="addContent" to-view-id="/jsp/content/add-content-dialog.jsp" />
</navigation>
</config>

5.  Same results as step #3
Expected the system to use the from-outcome of "addContent" and navigate to the add-content-dialog.jsp

6.  Extended AddContentDialog.java overriding start method
public void start(ActionEvent event)
{
logger.error("Name: " + this.navigator.getCurrentNode().getName());
logger.error("Type: " + this.navigator.getCurrentNode().getType());
init(null);
}

7.  Execution resulted in the following which validates that the evaluator node condition is correct

Name: AI-3
Type: {http://www.drjb.com/model/actionitem/1.0}actionitem


8.  Split the config statement into two parts:
<config evaluator="node-type" condition="com-drjb-ai:actionitem">
<navigation>
<override from-view-id="/jsp/actionitems/actionitems-group.jsp" to-view-id="/jsp/actionitems/actionitem.jsp" />
<override from-outcome="browse" to-view-id="/jsp/actionitems/actionitem.jsp" />
</navigation>
</config>

<config evaluator="node-type" condition="com-drjb-ai:actionitem">
<navigation>
<override from-outcome="addContent" to-view-id="/jsp/content/add-content-dialog.jsp" />
</navigation>
</config>

9.  Same results as step #3

10. Modified the MyAddContentDialog.start to be as follows:
logger.error("Name: " + this.navigator.getCurrentNode().getName());
logger.error("Type: " + this.navigator.getCurrentNode().getType());
init(null);
/* Changes from previous fix */
this.navigator.setupDispatchContext(this.navigator.getCurrentNode());
FacesContext fc = FacesContext.getCurrentInstance();
String outcome = "addContent";
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, outcome);

11. It navigated to the add-content-dialog.jsp but did not return as expected.

12. Set my config to follows:
<config evaluator="node-type" condition="com-drjb-ai:actionitem">
<navigation>
<override from-view-id="/jsp/actionitems/actionitems-group.jsp" to-view-id="/jsp/actionitems/actionitem.jsp" />
<override from-outcome="browse" to-view-id="/jsp/actionitems/actionitem.jsp" />
<override from-outcome="addContent" to-view-id="/jsp/content/add-content-dialog.jsp" />
<override from-view-id="/jsp/content/add-content-dialog.jsp" to-view-id="/jsp/actionitems/actionitem.jsp" />
<override from-outcome="browse" to-view-id="/jsp/actionitems/actionitem.jsp" />
</navigation>
</config>

13.  Although it now navigates to the add-content-dialog.jsp as needed (from the changes in step #10), return navigation is a problem.
It returns to the correct node but with the standard browse.jsp format as opposed to the actionitem.jsp format.

14.  Even attempted to put fix in doPostCommitProcessing.
    logger.error("Incoming outcome: " + outcome);
     // as we were successful, go to the set properties dialog if asked
     // to otherwise just return
     if (this.showOtherProperties)
     {
        // we are going to immediately edit the properties so we need
        // to setup the BrowseBean context appropriately
        this.browseBean.setDocument(new Node(this.createdNode));
    
        return "dialog:setContentProperties";
     }
     else
     {
       logger.error("Outgoing outcome: " + outcome);
      FacesContext fc = FacesContext.getCurrentInstance();
      fc.getApplication().getNavigationHandler().handleNavigation(fc, null, outcome);       
      return outcome;
     }

15.  Excution resulted in following (unchecked show other properties):
Name: AI-3
Type: {http://www.drjb.com/model/actionitem/1.0}actionitem
Incoming outcome: browse
Outgoing outcome: browse   

16.  Same result as #13

17.  The browser URL is showing 'jsp/content/add-content-dialog.jsp' after returning from addContent, which is expected.

gavinc
Champ in-the-making
Champ in-the-making
It may well be the same problem as before i.e. the dispatchContext not being setup.

Have you tried adding the code to set it up in doPostCommitProcessing()?
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.