Package com.adito.properties.impl.profile

Examples of com.adito.properties.impl.profile.ProfilePropertyKey


       
        // BPS to LDP - We have to wait for the serversocket on the agent end to startup
        // as it is in a thread. Is there a better way of doing this?
        Thread.sleep(1000);
       
        return new ActionForward(url.getProtocol() + "://" + Property.getProperty(new ProfilePropertyKey("client.localhostAddress", launchSession.getSession())) + ":" + port + url.getFile(), true);
    }
View Full Code Here


        buf.append(dateTimeId);
        buf.append("','");
        String datePattern = pattern;
        if(datePattern == null) {
          datePattern = Property.getProperty(
            new ProfilePropertyKey("ui.dateFormat",
                LogonControllerFactory.getInstance().getSessionInfo(
                    (HttpServletRequest)pageContext.getRequest())));
          if(datePattern.contains("-")) {
            dateSeparator = "-";
          }
View Full Code Here

     */
    public static String getThemePath(HttpSession session) {
        try {
            SessionInfo info = LogonControllerFactory.getInstance().getSessionInfo(session);
            if (info == null) {
                return Property.getProperty(new ProfilePropertyKey(0, null, "ui.theme", UserDatabaseManager.getInstance()
                                .getDefaultUserDatabase().getRealm().getResourceId()));
            } else {
                return Property.getProperty(new ProfilePropertyKey(getCurrentPropertyProfileId(session), info.getUser().getPrincipalName(),
                                "ui.theme", info.getUser().getRealm().getResourceId()));
            }
        } catch (Exception e) {
        }
        return "/theme/default";
View Full Code Here

     */
    public static boolean getToolTipsEnabled(HttpSession session) {
        try {
            SessionInfo info = LogonControllerFactory.getInstance().getSessionInfo(session);
            if (info == null) {
                return Property.getPropertyBoolean(new ProfilePropertyKey(0, null, "ui.toolTips", UserDatabaseManager.getInstance()
                                .getDefaultUserDatabase().getRealm().getResourceId()));
            } else {
                return Property.getPropertyBoolean(new ProfilePropertyKey(getCurrentPropertyProfileId(session), info.getUser().getPrincipalName(),
                                "ui.toolTips", info.getUser().getRealm().getResourceId()));
            }
        } catch (Exception e) {
        }
        return true;
View Full Code Here

     * @param propertyProfile property profile ID (0 for default / global)
     * @return String
     * @throws Exception
     */
    public static String getProxyURL(User user, int propertyProfile) throws Exception {
        String type = Property.getProperty(new ProfilePropertyKey(propertyProfile, user.getPrincipalName(), "clientProxy.type", user.getRealm().getResourceId()));
        if (type.equals("http") || type.equals("https")) {
            String hostname = Property.getProperty(new ProfilePropertyKey(propertyProfile, user.getPrincipalName(), "clientProxy.hostname", user.getRealm().getResourceId()));
            if (!hostname.equals("")) {
                StringBuffer url = new StringBuffer();
                url.append(type);
                url.append("://");
               
                String username = Property.getProperty(new ProfilePropertyKey(propertyProfile, user.getPrincipalName(), "clientProxy.username", user.getRealm().getResourceId()));
                String domain = Property.getProperty(new ProfilePropertyKey(propertyProfile, user.getPrincipalName(), "clientProxy.ntlmDomain", user.getRealm().getResourceId()));
                String auth = Property.getProperty(new ProfilePropertyKey(propertyProfile, user.getPrincipalName(), "clientProxy.preferredAuthentication", user.getRealm().getResourceId()));

                if (!username.equals("")) {

                    if (!domain.equals("")) {
                        url.append(DAVUtilities.encodeURIUserInfo(domain + "\\"));
                    }

                    url.append(DAVUtilities.encodeURIUserInfo(username));
                    String password = Property.getProperty(new ProfilePropertyKey(propertyProfile, user.getPrincipalName(), "clientProxy.password", user.getRealm().getResourceId()));
                    if (!password.equals("")) {
                        url.append(":");
                        url.append(DAVUtilities.encodeURIUserInfo(password));
                    }
                    url.append("@");
                }
                url.append(hostname);
                int port = Property.getPropertyInt(new ProfilePropertyKey(propertyProfile, user.getPrincipalName(), "clientProxy.port", user.getRealm().getResourceId()));
                if (port != 0) {
                    url.append(":");
                    url.append(port);
                }
                url.append("?");
                url.append(auth);
                return url.toString();
            }
        } else if (type.equals("browser")) {
            String auth = Property.getProperty(new ProfilePropertyKey(propertyProfile, user.getPrincipalName(), "clientProxy.preferredAuthentication", user.getRealm().getResourceId()));
            return "browser://" + auth;
        }
        return null;
    }
View Full Code Here

    private static ProfilePropertyKey getPropertyProfileKey(HttpSession session, String propertyName, User user) {
        int currentPropertyProfileId = getCurrentPropertyProfileId(session);
        String username = user == null ? null : user.getPrincipalName();
        UserDatabase defaultUserDatabase = UserDatabaseManager.getInstance().getDefaultUserDatabase();
        int realmId = user == null ? defaultUserDatabase.getRealm().getResourceId() : user.getRealm().getResourceId();
        return new ProfilePropertyKey(currentPropertyProfileId, username, propertyName, realmId);
    }
View Full Code Here

   * @param sessionInfo sessionInfo
   * @param timeFormat time format
   * @return date formatter
   */
  public static DateFormat getDateFormat(SessionInfo sessionInfo, String timeFormat) {
      return new SimpleDateFormat(Property.getProperty(new ProfilePropertyKey("ui.dateFormat", sessionInfo))
                        + (timeFormat == null ? "" : (" " + timeFormat)));
  }
View Full Code Here

                } else {
                    originalRequest = "/showHome.do";
                }
                request.getSession().removeAttribute(Constants.ORIGINAL_REQUEST);
            }
            if (Property.getPropertyBoolean(new ProfilePropertyKey("client.autoStart", LogonControllerFactory.getInstance().getSessionInfo(request)))) {
                request.getSession().removeAttribute(Constants.ORIGINAL_REQUEST);
                request.getSession().setAttribute(Constants.REQ_ATTR_LAUNCH_AGENT_REFERER, originalRequest);
                forward = new ActionForward("/launchAgent.do", false);
            } else {
                forward = new ActionForward(originalRequest, true);
View Full Code Here

        LogonControllerFactory.getInstance().resetSessionTimeout(user, profile, request.getSession());

        // The new profile may have 'Automatically launch VPN client' enabled so
        // launch the VPN client
        if (!DefaultAgentManager.getInstance().hasActiveAgent(LogonControllerFactory.getInstance().getSessionInfo(request))
                        && Property.getPropertyBoolean(new ProfilePropertyKey(profile.getResourceId(), user.getPrincipalName(),
                                        "client.autoStart", user.getRealm().getResourceId()))) {
            request.getSession().removeAttribute(Constants.ORIGINAL_REQUEST);
            request.getSession().setAttribute(Constants.REQ_ATTR_LAUNCH_AGENT_REFERER, originalRequest);
            return mapping.findForward("launchAgent");
        }
View Full Code Here

  public String processReplacementVariable(Pattern pattern, Matcher matcher, String replacementPattern, String type, String key) throws Exception {
    if (type.equalsIgnoreCase("property")) {
            if (sessionInfo == null) {
                return null;
            }
            return Property.getProperty(new ProfilePropertyKey(CoreUtil.getCurrentPropertyProfileId(sessionInfo.getHttpSession()),
                            sessionInfo.getUser().getPrincipalName(),
                            key, sessionInfo.getUser().getRealm().getResourceId()));
        } else if (type.equalsIgnoreCase("session")) {
            if (sessionInfo == null) {
                return null;
View Full Code Here

TOP

Related Classes of com.adito.properties.impl.profile.ProfilePropertyKey

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.