How configuring the default page after the User Connexion?

I would like to choose the page displayed after the User is connected.

How I do that?

1 votes

2 answers

3062 views

ANSWER



After, connexion Nuxeo call this method StartupHelper#initDomainAndFindStartupPage. This method initialize the CoreSession on the Nuxeo Core and initialize the Seam Context (Used to create the view).

You can override this method to initialize the context according your need for that you need first override the startupHelper Seam Component. As we extract the repository initialization into a method you can only override this method.

For that create through Nuxeo IDE or by hand the Seam Component and set a higher precedence:

@Name("startupHelper")
@Scope(SESSION)
@Install(precedence = Install.APPLICATION)
public class MyStartupHelper extends StartupHelper {

    @Override
    public String initServerAndFindStartupPage() throws ClientException {
      super.initServerAndFindStartupPage();

      ... do your stuff to find the document on which you want to navigate ...
      return navigationContext.setCurrentDocument(doc);
      or
      return navigationContext.setCurrentDocument(doc, viewId);
    }
}

I'm not sure if Seam Annotations are transmit to inherit classes. If not, you have to also override this method like that:

@Override
@Begin(id = "#{conversationIdGenerator.nextMainConversationId}", join = true)
public String initDomainAndFindStartupPage(String domainTitle, String viewId) {
  super.initDomainAndFindStartupPage(domainTitle, viewId);
}

Hope this help…

2 votes



Hello, I think the @override annotation does not stand at its right place does it ? should be mentionned at the initServerAndFindStartupPage() level, not at class level, thanks by the way
05/08/2013

Yes, thanks, fixed.
05/13/2013


Hello. For the new nuxeo timeoff plugin, what would be the best method to redirect the user to …/nuxeo/timeoff url after login ?

0 votes