Package org.apache.ecs

Examples of org.apache.ecs.ConcreteElement


    @return the content to be displayed to the user-agent
    */
    public ConcreteElement getContent( RunData data ) {
        CapabilityMap map = ((JetspeedRunData)data).getCapability();
        String type = map.getPreferredType().toString();
        ConcreteElement content = new JetspeedClearElement(INVALID_TYPE);
        String stylesheet = (String)stylesheets.get(type);

        if (stylesheet != null) {
            content = getContent( data, map );
            if ( content == null ) {
View Full Code Here


        try
       
            pageContext.getOut().flush();

            ConcreteElement screenElement = ScreenLoader.getInstance().eval( data, screenName );

            // Check whether this is an "old" screen (that returns a ConcreteElement)
            // or a "new" one that returns null.
            if ( screenElement != null )
            {
                //The ECS element must serialize in the character encoding
                // of the response
                screenElement.setCodeSet( data.getResponse().getCharacterEncoding() );

                screenElement.output( data.getResponse().getWriter() );
            }

        }
        catch (Exception e)
        {
View Full Code Here

    {
        JetspeedRunData data = (JetspeedRunData) pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);
       
        try
        {
            ConcreteElement result = null;
            DynamicURI uri = null;
            ForwardService service = (ForwardService) ServiceUtil.getServiceByName(ForwardService.SERVICE_NAME);

            if (this.name != null && this.target != null)
            {
View Full Code Here

     * @param name the name of the pane to render
     * @return the rendered content of the pane
     */
    public ConcreteElement getPane(String name)
    {
        ConcreteElement result = null;
        String msg = "";
       
        if (null != rundata)
        {
            Profile profile = rundata.getProfile();
View Full Code Here

     *
     * @deprecated Use getPortletById()
     */
    public ConcreteElement getPortlet(String name)
    {
        ConcreteElement result = null;
        Portlet found = null;
        Stack sets = new Stack();
        sets.push(rundata.getProfile().getRootSet());
       
        while ((sets.size() > 0) && (found==null))
        {
            PortletSet set = (PortletSet)sets.pop();
           
            if (set.getName().equals(name))
            {
                found = set;
            }
            else
            {
                Enumeration en = set.getPortlets();
                while((found==null) && en.hasMoreElements())
                {
                    Portlet p = (Portlet)en.nextElement();
                       
                    // unstack the controls to find the real PortletSets
                    Portlet real = p;
                    while (real instanceof PortletControl)
                    {
                        real = ((PortletControl)p).getPortlet();
                    }
                       
                    if (real instanceof PortletSet)
                    {
                        // we'll explore this set afterwards
                        sets.push(real);
                    }
                    else if (p.getName().equals(name))
                    {                       
                        found = p;
                    }
                }
            }
        }
       
        if (found!=null)
        {
            result = found.getContent(rundata);
        }
       
        if (result==null)
        {
            //the customizer already streamed its content, return a stub
            result = new ConcreteElement();
        }

        return result;
    }
View Full Code Here

     * @param id The portlet id
     * @return the rendered content of the portlet
     */
    public ConcreteElement getPortalElement(String id)
    {
        ConcreteElement result = null;
       
        if (null != rundata)
        {
            Profile profile = rundata.getProfile();
            try
View Full Code Here

     * @param peid the peid of the portlet to render
     * @return the rendered content of the portlet
     */
    public ConcreteElement getPortletById(String peid)
    {
        ConcreteElement result = null;
        Portlet found = null;
        Stack sets = new Stack();
        sets.push(rundata.getProfile().getRootSet());
       
        while ((sets.size() > 0) && (found==null))
        {
            PortletSet set = (PortletSet)sets.pop();
           
            if (set.getID().equals(peid))
            {
                found = set;
            }
            else
            {
                Enumeration en = set.getPortlets();
                while((found==null) && en.hasMoreElements())
                {
                    Portlet p = (Portlet)en.nextElement();
                       
                    // unstack the controls to find the real PortletSets
                    Portlet real = p;
                    while (real instanceof PortletControl)
                    {
                        real = ((PortletControl)p).getPortlet();
                    }
                       
                    if (real instanceof PortletSet)
                    {
                        // we'll explore this set afterwards
                        sets.push(real);
                    }
                    else if (p.getID().equals(peid))
                    {                       
                        found = p;
                    }
                }
            }
        }
       
        if (found!=null)
        {
            // Return portlet's content checking the security first
            result = PortletWrapper.wrap(found).getContent(rundata);
        }
       
        if (result==null)
        {
            //the customizer already streamed its content, return a stub
            result = new ConcreteElement();
        }

        return result;
    }
View Full Code Here

     * @return the rendered content of the portlet
     */
    public ConcreteElement getPortletFromRegistry(String portletName, String controlName)
    {

        ConcreteElement result = null;
        Portlet p = null;
       
        try
        {
            // Always set portlet id to "preview" so each preview request gets it from the cache.
            // At least, I think that's how it works.
            p = PortletFactory.getPortlet(portletName, "preview");
            PortletControl control = controlName == null ? PortalToolkit.getControl((String) null)
                                                         : PortalToolkit.getControl(controlName);
            if (control != null)
            {
                JetspeedRunData jdata = (JetspeedRunData) rundata;
                // Use the profile's skin
                p.getPortletConfig().setPortletSkin(PortalToolkit.getSkin(jdata.getProfile().getDocument().getPortlets().getSkin()));
                control.setPortlet(p);
                control.init();
                result = control.getContent(rundata);
            }
            else if (p != null)
            {
                result = p.getContent(rundata);
            }
        }
        catch (Exception e)
        {
            Log.error(e);
            result = new ConcreteElement();
        }
               
        if (result == null)
        {
            //the customizer already streamed its content, return a stub
            result = new ConcreteElement();
        }

        return result;
    }
View Full Code Here

        // Process View
        // call processView method
        Log.info("GenericMVCPortlet - calling processView on processor");

        ConcreteElement result = (ConcreteElement) processor.processView(context);
        Log.info("GenericMVCPortlet - setting this portlet's content");
        clearContent();
        setContent(result); // only needed when caching is true I believe

        // return result
View Full Code Here

          }

        RunData data = (RunData) context.get("data");
        CapabilityMap map = ((JetspeedRunData) data).getCapability();
        String type = map.getPreferredType().toString();
        ConcreteElement content = new JetspeedClearElement(INVALID_TYPE);
        String stylesheet = (String) stylesheets.get(type);

        if (stylesheet != null)
          {
View Full Code Here

TOP

Related Classes of org.apache.ecs.ConcreteElement

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.