Examples of UserPreferencesManager


Examples of com.svanloon.game.wizard.human.dialog.UserPreferencesManager

    }
    return -1;
  }

  private String getIp() {
    UserPreferences up = new UserPreferencesManager().load();
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.ip), LanguageFactory.getInstance().getString(MessageId.whatIpDoYouWantToConnectTo), up.getIp(), false, 0, 255, -1);

    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));

    dialog.prompt();
    String ip = dialog.getValue();
    up.setIp(ip);
    new UserPreferencesManager().persist(up);
    return ip;
  }
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.UserPreferencesManager

    new UserPreferencesManager().persist(up);
    return ip;
  }

  private String getName() {
    UserPreferences up = new UserPreferencesManager().load();
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.name), LanguageFactory.getInstance().getString(MessageId.whatsYourName), up.getName(), false, 0, 255, -1);
    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    String name = dialog.getValue();
    up.setName(name);
    new UserPreferencesManager().persist(up);
    return name;
  }
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.UserPreferencesManager

    return player;
  }

  private String getLocalName() {
    UserPreferences up = new UserPreferencesManager().load();
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.name), LanguageFactory.getInstance().getString(MessageId.whatsYourName), up.getName(), false, 0, 255, -1);
    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    String name = dialog.getValue();
    up.setName(name);
    new UserPreferencesManager().persist(up);
    return name;
  }
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.UserPreferencesManager

    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));

    dialog.prompt();
    String ip = dialog.getValue();
    up.setIp(ip);
    new UserPreferencesManager().persist(up);
    return ip;
  }
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.UserPreferencesManager

    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    String name = dialog.getValue();
    up.setName(name);
    new UserPreferencesManager().persist(up);
    return name;
  }
View Full Code Here

Examples of org.jasig.portal.UserPreferencesManager

      throws ServletException, IOException {

      IUserInstanceManager userInstanceManager = null;
      IUserInstance ui = null;
    IPerson per = null;
    UserPreferencesManager upm = null;
    IUserLayoutManager ulm = null;

    // make sure the user has a current session
    if (request.getSession(false) == null) {
      log.warn("Attempting to use AJAX preferences as GUEST user");
      printError(response, "Your session has timed out.  Please log in again to make changes to your layout.");
      return;
    }

    try {
            final WebApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());
            userInstanceManager = (IUserInstanceManager) applicationContext.getBean("userInstanceManager", IUserInstanceManager.class);

           
      // Retrieve the user's UserInstance object
      ui = userInstanceManager.getUserInstance(request);

      // Retrieve the user's IPerson object
      per = ui.getPerson();

      // ensure that the user is currently logged in
      if (per.isGuest()) {
        log.warn("Attempting to use AJAX preferences as GUEST user");
        printError(response, "Your session has timed out.  Please log in again to make changes to your layout.");
        return;
      }

      // Retrieve the preferences manager
      upm = (UserPreferencesManager) ui.getPreferencesManager();

      // Retrieve the layout manager
      ulm = upm.getUserLayoutManager();

    } catch (RuntimeException e) {
      log.error(e, e);
      printError(response, "An unknown error occurred.");
      return;
View Full Code Here

Examples of org.jasig.portal.UserPreferencesManager

            throws IOException {

        IUserInstance ui = userInstanceManager.getUserInstance(request);
        IPerson per = getPerson(ui, response);

        UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();
        IUserLayoutManager ulm = upm.getUserLayoutManager();

        try {

            // if the element ID starts with the fragment prefix and is a folder,
            // attempt first to treat it as a pulled fragment subscription
View Full Code Here

Examples of org.jasig.portal.UserPreferencesManager

            HttpServletResponse response) throws IOException {

        IUserInstance ui = userInstanceManager.getUserInstance(request);
        IPerson per = getPerson(ui, response);

        UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();
        IUserLayoutManager ulm = upm.getUserLayoutManager();

        // Get the fragment owner's name from the request and construct
        // an IPerson object representing that user
        String fragmentOwnerName = request.getParameter("sourceID");
        if (StringUtils.isBlank(fragmentOwnerName)) {
            log.warn("Attempted to subscribe to tab with null owner ID");
            response.sendError(HttpServletResponse.SC_BAD_REQUEST);
            return null;
        }
        RestrictedPerson fragmentOwner = PersonFactory.createRestrictedPerson();
        fragmentOwner.setUserName(fragmentOwnerName);

        // Mark the currently-authenticated user as subscribed to this fragment.
        // If an inactivated fragment registration already exists, update it
        // as an active subscription.  Otherwise, create a new fragment
        // subscription.
        IUserFragmentSubscription userFragmentInfo = userFragmentInfoDao
            .getUserFragmentInfo(per, fragmentOwner);
        if (userFragmentInfo == null) {
            userFragmentInfo = userFragmentInfoDao.createUserFragmentInfo(per,
                    fragmentOwner);
        } else {
            userFragmentInfo.setActive(true);
            userFragmentInfoDao.updateUserFragmentInfo(userFragmentInfo);
        }

        try {
            // reload user layout and stylesheet to incorporate new DLM fragment
            ulm.loadUserLayout(true);

            // get the target node this new tab should be moved after
            String destinationId = request.getParameter("elementID");

            // get the user layout for the currently-authenticated user
            int uid = userIdentityStore.getPortalUID(fragmentOwner, false);
            final DistributedUserLayout userLayout = userLayoutStore.getUserLayout(per, upm.getUserProfile());
            Document layoutDocument = userLayout.getLayout();

            // attempt to find the new subscribed tab in the layout so we can
            // move it
            StringBuilder expression = new StringBuilder("//folder[@type='root']/folder[starts-with(@ID,'")
View Full Code Here

Examples of org.jasig.portal.UserPreferencesManager

        IUserInstance ui = userInstanceManager.getUserInstance(request);
        IPerson per = getPerson(ui, response);
        final Locale locale = RequestContextUtils.getLocale(request);

        UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();
        IUserLayoutManager ulm = upm.getUserLayoutManager();

    // portlet to be moved
    String sourceId = request.getParameter("sourceID");

    // Either "insertBefore" or "appendAfter".
View Full Code Here

Examples of org.jasig.portal.UserPreferencesManager

      @RequestParam(value = "acceptor", required = false) String acceptor) throws IOException, PortalException {

        IUserInstance ui = userInstanceManager.getUserInstance(request);
        IPerson per = getPerson(ui, response);

        UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager();
        IUserLayoutManager ulm = upm.getUserLayoutManager();

    int newColumnCount = widths.length;

    // build a list of the current columns for this tab
        @SuppressWarnings("unchecked")
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.