Package org.primefaces.util

Examples of org.primefaces.util.StringEncrypter


   
    public void handle(FacesContext context) throws IOException {
        Map<String,String> params = context.getExternalContext().getRequestParameterMap();
        String library = params.get("ln");
        String dynamicContentId = (String) params.get(Constants.DYNAMIC_CONTENT_PARAM);
        StringEncrypter strEn = RequestContext.getCurrentInstance().getEncrypter();
       
        if(dynamicContentId != null && library != null && library.equals(Constants.LIBRARY)) {
            StreamedContent streamedContent = null;
            boolean cache = Boolean.valueOf(params.get(Constants.DYNAMIC_CONTENT_CACHE_PARAM));
           
            try {
                String dynamicContentEL = strEn.decrypt(dynamicContentId);               
                ExternalContext externalContext = context.getExternalContext();
                
                if(dynamicContentEL != null) {
                    ELContext eLContext = context.getELContext();
                    ValueExpression ve = context.getApplication().getExpressionFactory().createValueExpression(context.getELContext(), dynamicContentEL, StreamedContent.class);
View Full Code Here


            try {
                BarcodeGenerator generator = generators.get(params.get("gen"));
                String format = params.get("fmt");
                int orientation = Integer.parseInt(params.get("ori"));
                boolean cache = Boolean.valueOf(params.get(Constants.DYNAMIC_CONTENT_CACHE_PARAM));
                StringEncrypter strEn = RequestContext.getCurrentInstance().getEncrypter();
                String value = strEn.decrypt(encryptedValue);
               
                if(AgentUtils.isLessThanIE(context, 9)) {
                    format = "png";
                }
               
View Full Code Here

        Map<String,String> params = context.getExternalContext().getRequestParameterMap();
        String encryptedValue = (String) params.get(Constants.DYNAMIC_CONTENT_PARAM);
       
        if(encryptedValue != null) {
            boolean cache = Boolean.valueOf(params.get(Constants.DYNAMIC_CONTENT_CACHE_PARAM));
            StringEncrypter strEn = RequestContext.getCurrentInstance().getEncrypter();
            String value = strEn.decrypt(encryptedValue);               
            ExternalContext externalContext = context.getExternalContext();

            externalContext.setResponseStatus(200);
            externalContext.setResponseContentType("image/png");
           
View Full Code Here

  @Override
  public StringEncrypter getEncrypter() {
    // lazy init, it's not required for all pages
      if (encrypter == null) {
        // we can't store it in the ApplicationMap, as Cipher isn't thread safe
        encrypter = new StringEncrypter(getApplicationContext().getConfig().getSecretKey());
      }

    return encrypter;
  }
View Full Code Here

        }
       
        try {
            Resource resource = context.getApplication().getResourceHandler().createResource("dynamiccontent.properties", "primefaces", "image/png");
            String resourcePath = resource.getRequestPath();
            StringEncrypter encrypter = RequestContext.getCurrentInstance().getEncrypter();
            String rid = encrypter.encrypt((String) barcode.getValue());
            StringBuilder builder = SharedStringBuilder.get(context, SB_BUILD);

            src = builder.append(resourcePath).append("&").append(Constants.DYNAMIC_CONTENT_PARAM).append("=").append(URLEncoder.encode(rid, "UTF-8"))
                    .append("&").append(Constants.DYNAMIC_CONTENT_TYPE_PARAM).append("=").append(handlerType)
                    .append("&gen=").append(type)
View Full Code Here

    @Override
    public void handleResourceRequest(FacesContext context) throws IOException {
        Map<String,String> params = context.getExternalContext().getRequestParameterMap();
        String library = params.get("ln");
        String dynamicContentId = (String) params.get(Constants.DYNAMIC_CONTENT_PARAM);
        StringEncrypter strEn = RequestContext.getCurrentInstance().getEncrypter();
       
        if(dynamicContentId != null && library != null && library.equals(Constants.LIBRARY)) {
            StreamedContent streamedContent = null;
            boolean cache = Boolean.valueOf(params.get(Constants.DYNAMIC_CONTENT_CACHE_PARAM));
           
            try {
                String dynamicContentEL = strEn.decrypt(dynamicContentId);               
                ExternalContext externalContext = context.getExternalContext();
                
                if(dynamicContentEL != null) {
                    ELContext eLContext = context.getELContext();
                    ValueExpression ve = context.getApplication().getExpressionFactory().createValueExpression(context.getELContext(), dynamicContentEL, StreamedContent.class);
View Full Code Here

TOP

Related Classes of org.primefaces.util.StringEncrypter

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.