Package org.apache.isis.runtimes.dflt.runtime.authentication.exploration

Examples of org.apache.isis.runtimes.dflt.runtime.authentication.exploration.MultiUserExplorationSession


public class SetUser implements Action {

    @Override
    public void execute(final Request request, final Context context, final Page page) {
        final String name = request.getName();
        final MultiUserExplorationSession session = (MultiUserExplorationSession) IsisContext.getAuthenticationSession();
        session.setCurrentSession(name);

        final ViewPane content = page.getViewPane();
        content.setTitle("Exploration User changed to " + name, null);

    }
View Full Code Here


    private void menuForChangingUsers(final UserActionSet options) {
        // TODO pick out users from the perspectives, but only show when in
        // exploration mode
        if (getAuthenticationSession() instanceof MultiUserExplorationSession) {
            final MultiUserExplorationSession session = (MultiUserExplorationSession) getAuthenticationSession();

            final Set<String> users = session.getUserNames();
            final UserActionSet set = options.addNewActionSet("Change user", ActionType.EXPLORATION);
            for (final String user : users) {
                menuOptionForChangingUser(set, user, session.getUserName());
            }
        }
    }
View Full Code Here

    private void menuOptionForChangingUser(final UserActionSet set, final String user, final String currentUser) {
        set.add(new UserActionAbstract(user) {
            @Override
            public void execute(final Workspace workspace, final View view, final Location at) {
                final MultiUserExplorationSession session = (MultiUserExplorationSession) getAuthenticationSession();
                session.setCurrentSession(user);
            }

            @Override
            public Consent disabled(final View view) {
                return user.equals(currentUser) ? new Veto("Current user") : Allow.DEFAULT;
View Full Code Here

    }

    private void menuForChangingUsers(final UserActionSet options) {
        // TODO pick out users from the perspectives, but only show when in exploration mode
        if (getAuthenticationSession() instanceof MultiUserExplorationSession) {
            final MultiUserExplorationSession session = (MultiUserExplorationSession) getAuthenticationSession();

            final Set<String> users = session.getUserNames();
            final UserActionSet set = options.addNewActionSet("Change user", ActionType.EXPLORATION);
            for (final String user : users) {
                menuOptionForChangingUser(set, user, session.getUserName());
            }
        }
    }
View Full Code Here

    private void menuOptionForChangingUser(final UserActionSet set, final String user, final String currentUser) {
        set.add(new UserActionAbstract(user) {
            @Override
            public void execute(final Workspace workspace, final View view, final Location at) {
                final MultiUserExplorationSession session = (MultiUserExplorationSession) getAuthenticationSession();
                session.setCurrentSession(user);
            }

            @Override
            public Consent disabled(final View view) {
                return user.equals(currentUser) ? new Veto("Current user") : Allow.DEFAULT;
View Full Code Here

public class SetUser implements Action {

    @Override
    public void execute(final Request request, final Context context, final Page page) {
        final String name = request.getName();
        final MultiUserExplorationSession session =
            (MultiUserExplorationSession) IsisContext.getAuthenticationSession();
        session.setCurrentSession(name);

        final ViewPane content = page.getViewPane();
        content.setTitle("Exploration User changed to " + name, null);

    }
View Full Code Here

TOP

Related Classes of org.apache.isis.runtimes.dflt.runtime.authentication.exploration.MultiUserExplorationSession

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.