Examples of HtmlEntityEncoder


Examples of org.exoplatform.commons.utils.HTMLEntityEncoder

        UIFormInputSet uiInputSet;
        UICheckBoxInput checkBoxInput;
        UIFormInputInfo uiInfo;

        HTMLEntityEncoder encoder = HTMLEntityEncoder.getInstance();

        //
        ApplicationRegistryService appRegService = getApplicationComponent(ApplicationRegistryService.class);
        List<ApplicationCategory> categories = getAllCategories();
        List<UIFormInputSet> uiInputSetList = new ArrayList<UIFormInputSet>();
        for (ApplicationCategory category : categories) {
            uiInputSet = new UIFormInputSet(category.getName());
            boolean defaultValue = false;
            if (application != null) {
                String definitionName = application.getDisplayName().replace(' ', '_');
                defaultValue = appRegService.getApplication(category.getName(), definitionName) != null;
            }
            checkBoxInput = new UICheckBoxInput("category_" + category.getName(), null, defaultValue);
            checkBoxInput.setOnChange("SelectBox");
            uiInfo = new UIFormInputInfo("categoryName", null, encoder.encode(category.getDisplayName(true)));
            uiInputSet.addChild(checkBoxInput);
            uiInputSet.addChild(uiInfo);
            uiTableInputSet.addChild(uiInputSet);
            uiInputSetList.add(uiInputSet);
        }
View Full Code Here

Examples of org.glassfish.web.util.HtmlEntityEncoder

     *
     */
    protected void printServletEnvironment(ServletOutputStream out,
        HttpServletRequest req, HttpServletResponse res) throws IOException {

        printServletEnvironment(out, req, res, new HtmlEntityEncoder());
    }
View Full Code Here

Examples of org.glassfish.web.util.HtmlEntityEncoder

        if (!cgiEnv.isValid()) {
            res.setStatus(404);
        }
        if (debug >= 10) {
            HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
            ServletOutputStream out = res.getOutputStream();
            out.println("<HTML><HEAD><TITLE>$Name:  $</TITLE></HEAD>");
            out.println("<BODY>$Header$<p>");

            if (cgiEnv.isValid()) {
View Full Code Here

Examples of org.glassfish.web.util.HtmlEntityEncoder

         *
         * @return  HTML string containing CGI environment info
         *
         */
        public String toString() {
            return toString(new HtmlEntityEncoder());
        }
View Full Code Here

Examples of org.glassfish.web.util.HtmlEntityEncoder

     *
     */
    protected void printServletEnvironment(ServletOutputStream out,
        HttpServletRequest req, HttpServletResponse res) throws IOException {

        printServletEnvironment(out, req, res, new HtmlEntityEncoder());
    }
View Full Code Here

Examples of org.glassfish.web.util.HtmlEntityEncoder

        if (!cgiEnv.isValid()) {
            res.setStatus(404);
        }
        if (debug >= 10) {
            HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
            ServletOutputStream out = res.getOutputStream();
            out.println("<HTML><HEAD><TITLE>$Name:  $</TITLE></HEAD>");
            out.println("<BODY>$Header$<p>");

            if (cgiEnv.isValid()) {
View Full Code Here

Examples of org.glassfish.web.util.HtmlEntityEncoder

         *
         * @return  HTML string containing CGI environment info
         *
         */
        public String toString() {
            return toString(new HtmlEntityEncoder());
        }
View Full Code Here

Examples of org.glassfish.web.util.HtmlEntityEncoder

                enumeration = Collections.enumeration(list);
            }

            // rewriteUrl(contextPath) is expensive. cache result for later reuse
            String rewrittenContextPath =  rewriteUrl(contextPath);
            HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();

            while (enumeration.hasMoreElements()) {

                NameClassPair ncPair = enumeration.nextElement();
                String resourceName = ncPair.getName();
                String trimmed = resourceName/*.substring(trim)*/;
                if (trimmed.equalsIgnoreCase("WEB-INF") ||
                    trimmed.equalsIgnoreCase("META-INF") ||
                    trimmed.equalsIgnoreCase(localXsltFile))
                    continue;

                CacheEntry childCacheEntry =
                    proxyDirContext.lookupCache(cacheEntry.name + resourceName);
                if (!childCacheEntry.exists) {
                    continue;
                }

                sb.append("<entry");
                sb.append(" type='")
                  .append((childCacheEntry.context != null)?"dir":"file")
                  .append("'");
                sb.append(" urlPath='")
                  .append(rewrittenContextPath)
                  .append(rewriteUrl(cacheEntry.name + resourceName))
                  .append((childCacheEntry.context != null)?"/":"")
                  .append("'");
                if (childCacheEntry.resource != null) {
                    sb.append(" size='")
                      .append(renderSize(childCacheEntry.attributes.getContentLength()))
                      .append("'");
                }
                sb.append(" date='")
                  .append(childCacheEntry.attributes.getLastModifiedHttp())
                  .append("'");

                sb.append(">");
                sb.append(htmlEntityEncoder.encode(trimmed));
                if (childCacheEntry.context != null)
                    sb.append("/");
                sb.append("</entry>");

            }
View Full Code Here

Examples of org.glassfish.web.util.HtmlEntityEncoder

                Collections.sort(list, c);
                enumeration = Collections.enumeration(list);
            }

            boolean shade = false;
            HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
            while (enumeration.hasMoreElements()) {

                NameClassPair ncPair = enumeration.nextElement();
                String resourceName = ncPair.getName();
                String trimmed = resourceName/*.substring(trim)*/;
                if (trimmed.equalsIgnoreCase("WEB-INF") ||
                    trimmed.equalsIgnoreCase("META-INF"))
                    continue;

                CacheEntry childCacheEntry =
                    proxyDirContext.lookupCache(cacheEntry.name + resourceName);
                if (!childCacheEntry.exists) {
                    continue;
                }

                sb.append("<tr");
                if (shade)
                    sb.append(" bgcolor=\"#eeeeee\"");
                sb.append(">\r\n");
                shade = !shade;

                sb.append("<td align=\"left\">&nbsp;&nbsp;\r\n");
                sb.append("<a href=\"");
                sb.append(rewrittenContextPath);
                resourceName = rewriteUrl(name + resourceName);
                sb.append(resourceName);
                if (childCacheEntry.context != null)
                    sb.append("/");
                sb.append("\"><tt>");
                sb.append(htmlEntityEncoder.encode(trimmed));
                if (childCacheEntry.context != null)
                    sb.append("/");
                sb.append("</tt></a></td>\r\n");

                sb.append("<td align=\"right\"><tt>");
View Full Code Here

Examples of org.glassfish.web.util.HtmlEntityEncoder

            // the response SHOULD contain a short hypertext note with
            // a hyperlink to the new URI.
            setContentType("text/html");
            setLocale(Locale.getDefault());

            HtmlEntityEncoder htmlEntityEncoder = new HtmlEntityEncoder();
            String href = htmlEntityEncoder.encode(absolute);
            StringBuilder sb = new StringBuilder(150 + href.length());

            sb.append("<html>\r\n");
            sb.append("<head><title>Document moved</title></head>\r\n");
            sb.append("<body><h1>Document moved</h1>\r\n");
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.