Uploaded image for project: 'Nuxeo Documentation'
  1. Nuxeo Documentation
  2. NXDOC-2484

Fix code to obtain a core session from a JAX-RS resource

    XMLWordPrintable

    Details

    • Tags:
    • Backlog priority:
      100

      Description

      In https://doc.nuxeo.com/nxdoc/session-and-transaction-management/#session-management the following code is provided to get a core session

      UserSession userSession = WebEngine.getActiveContext().getUserSession();
      Principal principal = userSession.getPrincipal();
      CoreSession session1 = userSession.getCoreSession();
      CoreSession session2 = userSession.getCoreSession("myrepo"); 

      But the method "getCoreSession" does not exist on the class UserSession.

      The correct code is

       CoreSession session =WebEngine.getActiveContext().getCoreSession();

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tmartins Thierry Martins
                Reporter:
                tmartins Thierry Martins
                Participants:
                Reviewers:
                Kevin Leturc, Manon Lumeau
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: