cancel
Showing results for 
Search instead for 
Did you mean: 

How configuring the default page after the User Connexion?

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

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

How I do that?

1 ACCEPTED ANSWER

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

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...

View answer in original post

4 REPLIES 4

Benjamin_Jalon1
Elite Collaborator
Elite Collaborator

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...

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

Yes, thanks, fixed.

nicolas_chaillo
Champ on-the-rise
Champ on-the-rise

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

Getting started

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.