Package org.apache.turbine.util

Examples of org.apache.turbine.util.RunData


        this.href = href;
    }

    public int doStartTag() throws JspException
    {
        RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);   
       
        String result = new ContentURI(data).getURI(this.href);

        try
        {
            if (result != null) {
                pageContext.getOut().print(result);
            }
        }
        catch (Exception e)
        {
            String message = "Error processing contentUri-tag, parameter: "+ href;
            logger.error(message, e);
            try
            {
                data.getOut().print( message );
            }
            catch(java.io.IOException ioe) {}   
        }
      
        return EVAL_BODY_INCLUDE;
View Full Code Here


        this.action = action;
    }

    public int doStartTag() throws JspException
    {
        RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);   
       
        TemplateLink link = new TemplateLink( data );
        DynamicURI uri = link.setPage( template );
        if ( action != null ) uri = uri.setAction( action );

        try
        {
            if (uri != null) {
                pageContext.getOut().print(uri.toString());
            }
        }
        catch (Exception e)
        {
            String message = "Error processing TemplateLink-tag, parameter: template='"+ template + "', action='" +action +"'";
            logger.error(message, e);
            try
            {
                data.getOut().print( message );
            }
            catch(java.io.IOException ioe) {}   
        }
      
        return EVAL_BODY_INCLUDE;
View Full Code Here

    }


    public int doStartTag() throws JspException
    {
        RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);   
       
        try
        {          
            String result = "jetspeed-InfoTag: unknown parameter >" + requestedInfo +"<";

            /* Server Date */
            if (requestedInfo.equalsIgnoreCase("ServerDate")) {
                result = DateFormat.getDateTimeInstance().format( new Date());
           

            /* User Name */
            if (requestedInfo.equalsIgnoreCase("UserName")) {
              result = data.getUser().getUserName();
           

            /* First Name */
            if (requestedInfo.equalsIgnoreCase("FirstName")) {
              result = data.getUser().getFirstName();
           

            /* Last Name */
            if (requestedInfo.equalsIgnoreCase("LastName")) {
              result = data.getUser().getLastName();
           

            /* EMail */
            if (requestedInfo.equalsIgnoreCase("EMail")) {
              result = data.getUser().getEmail();
           
            pageContext.getOut().print(result);
        }
        catch (Exception e)
        {
            String message = "Error processing info-tag, parameter: "+ requestedInfo;
            logger.error(message, e);
            try
            {
                data.getOut().print("Error processing info-tag, parameter: "+ requestedInfo);
            }
            catch(java.io.IOException ioe) {}   
        }
        return EVAL_BODY_INCLUDE;
    }
View Full Code Here

     * @return code
     * @exception JspException
     */
    public int doEndTag() throws JspException
    {
        RunData data = (RunData) pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);   
        String result = null;

        try
        {

            // See if body contains any parameter options
            String body = this.getBodyContent() == null ? null : this.getBodyContent().getString();
            Hashtable options = new Hashtable();

            if (body != null && !body.trim().equalsIgnoreCase(""))
            {
                StringTokenizer st = new StringTokenizer(body, ";");
                String prefix = this.name + ".style.";
                while (st.hasMoreTokens())
                {
                    StringTokenizer pair = new StringTokenizer(st.nextToken(), "=");
                    if (pair.countTokens() == 2)
                    {
                        options.put(prefix + pair.nextToken().trim(), pair.nextToken().trim());
                    }
                }
            }

            boolean canAccess = true;

            // If portlet name is specified, it will be used to check security for the parameter
            if (this.portlet != null)
            {
                // Retrieve registry entry and its parameter
                PortletEntry entry = (PortletEntry) Registry.getEntry(Registry.PORTLET, this.portlet);
                Parameter param = entry.getParameter(this.name);

                // Verify security for the parameter
                canAccess = JetspeedSecurity.checkPermission((JetspeedUser) data.getUser(),
                                                             new PortalResource(entry, param),
                                                             JetspeedSecurity.PERMISSION_CUSTOMIZE);
            }

            if (canAccess)
View Full Code Here

     *
     * @return SKIP_BODY, as it is intended to be a single tag.
     */
    public int doStartTag() throws JspException
    {
        RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);
        String screenName = data.getScreen();

        // make sure that not the BaseJspScreen is called
        // as this would result in an endless loop...
        if ( screenName.equals( "BaseJspScreen" ) )
        {
            screenName = TurbineResources.getString("screen.homepage");
        }

        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)
        {
            String message = "Error processing ecs screen '" + screenName + "'.";
            logger.error(message, e);
            try
            {
                data.getOut().print("Error processing ecs screen '" + screenName + "'. See log for more information.");
            }
            catch(java.io.IOException ioe) {}   
        }
        return SKIP_BODY;
    }
View Full Code Here

        this.action = action;
    }

    public int doStartTag() throws JspException
    {
        RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);   
       
        TemplateLink link = new TemplateLink( data );
        DynamicURI uri = link.setPage( template );
        if ( action != null ) uri = uri.setAction( action );

        try
        {
            if (uri != null) {
                pageContext.getOut().print(uri.toString());
            }
        }
        catch (Exception e)
        {
            String message = "Error processing TemplateLink-tag, parameter: template='"+ template + "', action='" +action +"'";
            logger.error(message, e);
            try
            {
                data.getOut().print( message );
            }
            catch(java.io.IOException ioe) {}   
        }
      
        return EVAL_BODY_INCLUDE;
View Full Code Here

    }


    public int doStartTag() throws JspException
    {
        RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);   
       
        try
        {          
            String result = "jetspeed-InfoTag: unknown parameter >" + requestedInfo +"<";

            /* Server Date */
            if (requestedInfo.equalsIgnoreCase("ServerDate")) {
                result = DateFormat.getDateTimeInstance().format( new Date());
           

            /* User Name */
            if (requestedInfo.equalsIgnoreCase("UserName")) {
              result = data.getUser().getUserName();
           

            /* First Name */
            if (requestedInfo.equalsIgnoreCase("FirstName")) {
              result = data.getUser().getFirstName();
           

            /* Last Name */
            if (requestedInfo.equalsIgnoreCase("LastName")) {
              result = data.getUser().getLastName();
           

            /* EMail */
            if (requestedInfo.equalsIgnoreCase("EMail")) {
              result = data.getUser().getEmail();
           
            pageContext.getOut().print(result);
        }
        catch (Exception e)
        {
            String message = "Error processing info-tag, parameter: "+ requestedInfo;
            logger.error(message, e);
            try
            {
                data.getOut().print("Error processing info-tag, parameter: "+ requestedInfo);
            }
            catch(java.io.IOException ioe) {}   
        }
        return EVAL_BODY_INCLUDE;
    }
View Full Code Here

     *
     * @return SKIP_BODY, as it is intended to be a single tag.
     */
    public int doStartTag() throws JspException
    {
        RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);
        String screenName = data.getScreen();

        // make sure that not the BaseJspScreen is called
        // as this would result in an endless loop...
        if ( screenName.equals( "BaseJspScreen" ) )
        {
            screenName = TurbineResources.getString("screen.homepage");
        }

        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)
        {
            String message = "Error processing ecs screen '" + screenName + "'.";
            logger.error(message, e);
            try
            {
                data.getOut().print("Error processing ecs screen '" + screenName + "'. See log for more information.");
            }
            catch(java.io.IOException ioe) {}   
        }
        return SKIP_BODY;
    }
View Full Code Here

    public int doStartTag() throws JspException
    {
        String template = defaultTemplate;
        String module   = null;

        RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);
        try
       
            /* LOGGED_IN */
            if ( (data != null) && (data.getUser() != null) && data.getUser().hasLoggedIn() && (loggedInTemplate != null) )
              template = loggedInTemplate;

            data.getTemplateInfo().setNavigationTemplate(
                        TemplateLocator.locateNavigationTemplate(data,template));

            pageContext.getOut().flush();
            module = ((TemplateService)TurbineServices.getInstance().getService(
            TemplateService.SERVICE_NAME)).getNavigationName(template);
            NavigationLoader.getInstance().exec(data, module);
        }
        catch (Exception e)
        {
            String message = "Error processing navigation template:" + template + " using module: " + module;
            logger.error(message, e);
            try
            {
                data.getOut().print("Error processing navigation template: " + template + " using module: " + module);
            }
            catch(java.io.IOException ioe) {}   
        }
        return SKIP_BODY;
    }
View Full Code Here

        this.action = action;
    }

    public int doStartTag() throws JspException
    {
        RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);   
       
        TemplateLink uri = new TemplateLink( data );
        if ( template != null ) uri.setPage( template );
        if ( screen != null ) uri.setScreen( screen );
        if ( action != null ) uri.setAction( action );

        try
        {
            if (uri != null) {
                pageContext.getOut().print(uri.toString());
            }
        }
        catch (Exception e)
        {
            String message = "Error processing DynamicUriTag, parameter: screen='"+ screen + "', action='" +action +"'";
            logger.error(message, e);
            try
            {
                data.getOut().print( message );
            }
            catch(java.io.IOException ioe) {}   
        }
      
        return EVAL_BODY_INCLUDE;
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.RunData

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.