Package org.apache.ecs

Examples of org.apache.ecs.StringElement


        StringBuffer text = new StringBuffer();

        if (getSource() == null || getSource().trim().length() == 0)
        {
            text.append(NO_SOURCE_MSG);
            return (new StringElement(text.toString()));
        }

        text.append("<IFRAME ");

        text.append("src = \"" + getSource() + "\" ");
        if (getWidth() != null)
        {
            text.append("width = \"" + getWidth() + "\" ");
        }

        if (getHeight() != null)
        {
            text.append("height = \"" + getHeight() + "\" ");
        }

        if (getFrameName() != null)
        {
            text.append("name = \"" + getFrameName() + "\" ");
        }

        if (getStyle() != null)
        {
            text.append("style = \"" + getStyle() + "\" ");
        }

        if (getMarginWidth() != null)
        {
            text.append("marginwidth = \"" + getMarginWidth() + "\" ");
        }

        if (getMarginHeight() != null)
        {
            text.append("marginheight = \"" + getMarginHeight() + "\" ");
        }

        if (getAlign() != null)
        {
            text.append("align = \"" + getAlign() + "\" ");
        }

        text.append("scrolling = \"" + getScrolling() + "\" ");
        text.append("frameborder = \"" + getFrameBorder() + "\" ");
        text.append(">");

        text.append("</IFRAME>");
        return (new StringElement(text.toString()));
    }
View Full Code Here


    return new EcsServletElement(rundata, servletURL);
  } catch (Exception e) {
    String message = "ServletInvokerPortlet: Error invoking "
             + servletURL + ": " + e.getMessage();
    Log.error(message, e);
    return new StringElement(message);
  }
  }    }
View Full Code Here

        // If parsing is OK, wraps content in ECS element
        if (myContent!=null) {
            content = new ElementContainer();

            content.addElement( new Comment( "BEGIN PORTLET" ) );
            content.addElement( new StringElement( myContent ) );
            content.addElement( new Comment( "END PORTLET" ) );
        }

        return content;
    }
View Full Code Here

            String message = "JSPViewProcessor: Could not include the following JSP Page:  [" + template + "] :\n\t"
                             + e.getMessage();
            Log.error(message, e);

            return new StringElement(message);
        }

        return new ElementContainer();
    }
View Full Code Here

            String def = this.alt != null && this.alt.trim().length() > 0 ? this.alt : this.key;
            try
            {
                CustomLocalizationService locService = (CustomLocalizationService) ServiceUtil.getServiceByName(
                    LocalizationService.SERVICE_NAME);
                result = new StringElement(locService.getString(this.key, locService.getLocale(data), def));           
            }
            catch (MissingResourceException mre)
            {
                result = new StringElement(def);
            }
            catch (Exception oe)
            {
                result = new StringElement(def);
                Log.error(oe);
            }

            // Output the result
            if (result != null)
View Full Code Here

                                              this.action == null ? "controls.Maximize" : this.action,
                                              null,
                                              baseLocator.getMediaType(),
                                              baseLocator.getLanguage(),
                                              baseLocator.getCountry());
                result = new StringElement(uri.toString());
                JetspeedLinkFactory.putInstance(link);
            }

            // Output the result
            if (result != null)
View Full Code Here

    public ConcreteElement getContent(RunData rundata)
    {
        String servletURL = processURL(rundata);
    if(servletURL == null)
    {
      return new StringElement("ServletInvokerPortlet:  Must specify a URL using the URL parameter");
    }
        String content;

        //  This is probably not robust for large content returns, but should work okay within an application context with small amounts of content.
        try
        {

            URL url = new URL(servletURL);
            URLConnection connection = url.openConnection();
            InputStream stream = connection.getInputStream();
            BufferedInputStream in = new BufferedInputStream(stream);
            int length = 0;
            byte[] buf = new byte[BUFFER_SIZE];
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            while ((in != null) && ((length = in.read(buf)) != -1))
            {
                // the data has already been read into buf
                out.write(buf, 0, length);
            }
            content = out.toString();
            return new StringElement(content);
        }
        catch (Exception e)
        {
            String message = "ServletInvokerPortlet: Error invoking " + servletURL + ": " + e.getMessage();
            return new StringElement(message);
        }

    }
View Full Code Here

            // Clear any portlets that exist in this set
            if (this.portlets != null)
            {
                this.portlets.clear();
            }
            return new StringElement(Localization.getString("SECURITY_NO_ACCESS"));
        }
        else
        {
            Log.debug("User \"" + rundata.getUser().getUserName() + "\" is authorized to portlet set " + getID());
        }
View Full Code Here

            {
                uri = service.forward(data, this.name);
            }
            if (uri != null)
            {
                result = new StringElement(uri.toString());
            }

            // Output the result
            if (result != null)
            {
View Full Code Here

            s= e.toString();
        }
       
        TurbineVelocity.requestFinished(context);

        return new StringElement( s );
    }
View Full Code Here

TOP

Related Classes of org.apache.ecs.StringElement

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.