Package com.sun.jsftemplating.util

Examples of com.sun.jsftemplating.util.MessageUtil


        if ((key == null) || (key.trim().length() == 0)) {
            return null;
        }

        if ((handlerContext == null) || (key.indexOf(".") == -1)) {
            MessageUtil msgUtil = MessageUtil.getInstance();
            return msgUtil.getMessage(SIP_RESOURCE_BUNDLE, key, args);
        } else {
            String resourceKey = key.substring(0, key.indexOf("."));
            key = key.substring(key.indexOf(".") + 1);
            Object obj = handlerContext.getFacesContext().getExternalContext().getRequestMap().get(resourceKey);
            if ((obj == null) || (!(obj instanceof ResourceBundle))) {
                MessageUtil msgUtil = MessageUtil.getInstance();
                return msgUtil.getMessage(SIP_RESOURCE_BUNDLE, key, args);
            }

            ResourceBundle bundle = (ResourceBundle) obj;
            String message = bundle.getString(key);
            if ((args != null) && (args.length > 0)) {
View Full Code Here


    public static String getMessage(String key, Object args[]) {
        if ((key == null) || (key.trim().length() == 0)) {
            return null;
        }

        MessageUtil msgUtil = MessageUtil.getInstance();
        return msgUtil.getMessage(SIP_RESOURCE_BUNDLE, key, args);
    }
View Full Code Here

        Object initialized = sessionMap.get("_SIP_INFO_SESSION_INITIALIZED");
        if (initialized != null) {
            return;
        }

        MessageUtil msgUtil = MessageUtil.getInstance();

        // Initialize Product Specific Attributes
        sessionMap.put("productImageURL", msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "productImage.URL"));
        int prodImageHeight = 23;
        int prodImageWidth = 422;
        try {
            prodImageWidth = Integer.parseInt(msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "productImage.width"));
            prodImageHeight = Integer.parseInt(msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "productImage.height"));
        } catch (Exception ex) {
            //use the preset values.
        }
        sessionMap.put("productImageWidth", prodImageWidth);
        sessionMap.put("productImageHeight", prodImageHeight);

        sessionMap.put("loginProductImageURL", msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "login.productImage.URL"));
        int loginProdImageHeight = 40;
        int loginProdImageWidth = 455;
        try {
            loginProdImageWidth = Integer.parseInt(msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "login.productImage.width"));
            loginProdImageHeight = Integer.parseInt(msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "login.productImage.height"));
        } catch (Exception ex) {
            //use preset values.
        }
        sessionMap.put("loginProductImageWidth", loginProdImageWidth);
        sessionMap.put("loginProductImageHeight", loginProdImageHeight);


        sessionMap.put("fullProductName", msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "productName.full"));
        sessionMap.put("productVersion", msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "product.version"));
        sessionMap.put("loginButtonTooltip", msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "loginButton.tooltip"));
        sessionMap.put("mastHeadDescription", msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "mastHeadDescription"));

        sessionMap.put("showLoadBalancer", false);
        sessionMap.put("logoutConfirmMsg", msgUtil.getMessage(SIP_RESOURCE_BUNDLE,
                "logoutConfirmMsg"));
        sessionMap.put("upsellingURLPE", msgUtil.getMessage(SIP_RESOURCE_BUNDLE,
                "upselling.comms.url.pe"));
        sessionMap.put("upsellingURLEE", msgUtil.getMessage(SIP_RESOURCE_BUNDLE,
                "upselling.comms.url.ee"));

        // Set the URN for Communications Server
        String productURN = "urn:uuid:555af591-db3b-11dc-ac55-080020a9ed93";
        String installRoot = System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY);
View Full Code Here

        @HandlerOutput(name = "filterListValue", type = List.class),
        @HandlerOutput(name = "filterListLabel", type = List.class)
    })
    public static void updateCallFlowFiltersForSip(HandlerContext handlerContext) {
        ArrayList label = new ArrayList((List) handlerContext.getInputValue("filterLabels"));
        MessageUtil msgUtil = MessageUtil.getInstance();
        label.add(msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "callFlow.remoteSip.label"));

        ArrayList value = new ArrayList((List) handlerContext.getInputValue("filterValues"));
        value.add("REMOTE_SIP");
        handlerContext.setOutputValue("filterListValue", value);
        handlerContext.setOutputValue("filterListLabel", label);
View Full Code Here

    })
    public static void updateSipAppFilterValues(HandlerContext handlerContext) {
        List labels = (ArrayList) handlerContext.getInputValue("labels");
        List values = (ArrayList) handlerContext.getInputValue("values");

        MessageUtil msgUtil = MessageUtil.getInstance();
        labels.add(msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "sipModules.label"));
        labels.add(msgUtil.getMessage(SIP_RESOURCE_BUNDLE, "convergedSipModules.label"));

        values.add("sipModule");
        values.add("convergedSipModule");

        handlerContext.setOutputValue("labels", labels);
View Full Code Here

        String requestId = (String) handlerCtx.getInputValue("requestId");
        String instanceName = (String) handlerCtx.getInputValue("instanceName");

        CallFlowMonitor cfm = CallFlowHandlers.getCallFlowMonitor(instanceName);
        float total = 0;
        MessageUtil msgUtil = MessageUtil.getInstance();
        Map<String, String> timeSpendMap = null;
        timeSpendMap = (Map<String,String>) cfm.queryPieInformation(requestId);

        for(String key : timeSpendMap.keySet()){
            total += Float.parseFloat(timeSpendMap.get(key));
        }

        NumberFormat nf = NumberFormat.getInstance(GuiUtil.getLocale());
        nf.setMinimumFractionDigits(1);

        String ms = null;
        float percent = 0;
        String percentStr = "";

        List valueList = new ArrayList();
        List labels = new ArrayList();
        Set set = infoMap.keySet();
        Iterator iter = set.iterator();
        while(iter.hasNext())
        {
            if(iter.next().equals("xLabels"))
            {
               labels = (ArrayList) infoMap.get("xLabels");
            }
        }

        if (timeSpendMap.containsKey("SIP_APPLICATION")){
            infoMap.put("hasSipApp", true);
            ms = timeSpendMap.get("SIP_APPLICATION");
            percent =  Float.parseFloat(ms)/total * 100;
            percentStr = nf.format(percent);
            infoMap.put("sipApp", CallFlowHandlers.formatStr("callFlowDetail.percentMs", percentStr, ms));
            labels.add(sipChartLabelMap(msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "callFlowDetail.chart.sipApp"), percent, percentStr, ms)
);
        }else{
            infoMap.put("hasSipApp", false);
            labels.add(CallFlowHandlers.emptyMap(msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "callFlowDetail.chart.sipApp")));
        }

        Collections.sort(labels, new CallFlowHandlers.TimeSpentComparator());

        infoMap.put("xLabels", labels);
View Full Code Here

    }

    public static Map sipChartLabelMap(String key, float percent, String percentStr, String ms ){
        Map aMap = new HashMap();
        MessageUtil msgUtil = MessageUtil.getInstance();
        aMap.put("label", msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "callFlowDetail.chart.sipApp"));
        String formattedString = msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "callFlowDetail.chart.sipApp"+"DD", new Object[]{percent, CallFlowHandlers.convertNanoToMs(ms)});

        aMap.put("title", formattedString);
        aMap.put("compValue", Float.valueOf(percent));
        return aMap;
    }
View Full Code Here

  boolean edit = ((Boolean) handlerContext.getInputValue("Edit")).booleanValue();
 
  HashMap attrMap = new HashMap();
  try {
      ObjectName trustConfig = SipSecurityHelper.getTrustConfig(configName, trustConfigName);
            MessageUtil msgUtil = MessageUtil.getInstance();
            String resString = null;
      if (edit) {
    String entityName = (String) handlerContext.getInputValue("TrustedEntityName");
    if (entityName == null || (entityName.trim().length() == 0)) {
        throw new Exception("Trusted Entity Name is required");
    }
    attrMap = SipSecurityHelper.getTrustedEntityInfo(trustConfig, entityName);
                resString = msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "trustedEntity.edit");
    attrMap.put("pageTitle", resString);
                resString = msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "trustedEntity.edit.help");
    attrMap.put("pageTitleHelp", resString);
    attrMap.put("showNewProps", false);
    attrMap.put("showEditProps", true);
      } else {
                resString = msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "trustedEntity.create");
    attrMap.put("pageTitle", resString);
                resString = msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "trustedEntity.create.help");
    attrMap.put("pageTitleHelp", resString);
    attrMap.put("showNewProps", true);
    attrMap.put("showEditProps", false);
      }
  } catch (Exception ex) {
View Full Code Here

  String type = getTrustConfigType(trustConfig);
        if (trustConfig == null) {
            return map;
        }
  map.put("type", type);
        MessageUtil msgUtil = MessageUtil.getInstance();
        String resString = null;
  if (type.equals("Trust Entities")) {
      map.put("showEntitySection", true);
      map.put("showHandlerSection", false);
            resString = msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "trustedEntities.edit");
      map.put("pageTitle", resString);
            resString = msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "trustedEntities.edit.help");
      map.put("pageTitleHelp", resString);
      ArrayList entities = (ArrayList) getTrustConfigEntityInfo(trustConfig);
      map.put("trustedEntities", entities);
  } else {
      map.put("showEntitySection", false);
      map.put("showHandlerSection", true);
            resString = msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "trustHandler.edit");
      map.put("pageTitle", resString);
            resString = msgUtil.getMessage(SipUtil.SIP_RESOURCE_BUNDLE, "trustHandler.edit.help");
      map.put("pageTitleHelp", resString);
      getTrustHandlerInfo(trustConfig, map);
  }
 
  // add attributes for trust config
View Full Code Here

TOP

Related Classes of com.sun.jsftemplating.util.MessageUtil

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.