[ 
https://jira.nuxeo.com/browse/NXP-7434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=100841#comment-100841
 ] 

Anahide Tchertchian commented on NXP-7434:
------------------------------------------

First test consisted in using a "generic" view id, and link it to a seam action 
returning the accurate view for the current document using Seam pages (the page 
for this view id does not need to hold data).
This was not successful as the page action is called before navigation (and 
restoring of context) is done => the seam action does not yet know what is the 
current document.

Second test is successful: it still consists in using a generic view, but this 
time not using Seam pages. This generic view holds the following code:

{code}
<html>
#{facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext,
 null, restHelper.navigateToDefaultView())}
</html>
{code}

With restHelper#navigateToDefaultView code:

{code}
public String navigateToDefaultView() {
    DocumentModel currentDocument = navigationContext.getCurrentDocument();
    if (currentDocument != null) {
        TypeInfo typeInfo = currentDocument.getAdapter(TypeInfo.class);
        return typeInfo.getDefaultView();
    }
    return null;
}
{code}

This is working ok, the only drawback is that it performs a seconf redirection 
(so navigation context is setup twice).

The url is then rewritten after the redirect so it holds the actual document 
default view id.

Attached a diff to make the view id optional on the doc path codec (but it 
breaks tests as doc path can hold the '@' character is some circumstances => 
waiting for a solution to detect the last '@' parameter in the regexp).

> Remove view id from document custom urls
> ----------------------------------------
>
>                 Key: NXP-7434
>                 URL: https://jira.nuxeo.com/browse/NXP-7434
>             Project: Nuxeo Enterprise Platform
>          Issue Type: Bug
>          Components: Web UI
>    Affects Versions: 5.4.2
>            Reporter: Anahide Tchertchian
>             Fix For: 5.4.3
>
>
> The documents default urls all hold the view id because the dispatch is done 
> at the filter level (=> no way to get the document, its type, and retrieve 
> its default view in this context).
> To remove it from the url, a new system is needed so that:
> - the context is iniailized correctly (action attached to the url pattern is 
> called)
> - a redirection to the document default view id is done

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets

Reply via email to