Package org.apache.turbine.util.template

Examples of org.apache.turbine.util.template.TemplateLink


     {
         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) {
View Full Code Here


    {
        String newURI = null;

        String propertiesParameter = "URILookup.";

        TemplateLink uri = new TemplateLink( rundata );

        if (aType==TYPE_HOME)
        {
            propertiesParameter += "home.";
           
            if (aSubType==SUBTYPE_RESTORE)
            {
                propertiesParameter += "restore.";

                newURI = getMarkedPage( rundata );
            }
            else if (aSubType==SUBTYPE_MAXIMIZE)
            {
                propertiesParameter += "maximize.";
               
                if (aPortletName==null)
                {
                    throw new JetspeedException( "A portlet is required to return an URI." );
                }
                uri.setAction( ACTION_MARKPAGE );
                uri.addPathInfo( "portlet", aPortletName );
            }
            else if (aSubType==SUBTYPE_LOGOUT)
            {
                propertiesParameter += "logout.";

                uri.setAction( ACTION_LOGOUT );
            }
            else if (aSubType==SUBTYPE_ACCEPT_LOGIN)
            {
                propertiesParameter += "acceptlogin.";

                uri.setAction( ACTION_ACCEPT_LOGIN );
            }
            else if (aSubType!=SUBTYPE_NONE)
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_INFO)
        {
            propertiesParameter += "info.";
           
            if (aPortletName==null)
            {
                throw new JetspeedException( "A portlet is required to return an URI." );
            }
           
            uri.setPage( SCREEN_INFO );
            uri.addPathInfo( "portlet", aPortletName );

            if (aSubType==SUBTYPE_MARK)
            {
                propertiesParameter += "mark.";

                uri.setAction( ACTION_MARKPAGE );
            }
            else if (aSubType!=SUBTYPE_NONE)
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_EDIT_ACCOUNT)
        {
            propertiesParameter += "editaccount.";
           
            uri.setPage( SCREEN_EDIT_ACCOUNT );

            if (aSubType==SUBTYPE_NONE)
            {
                uri.setAction( ACTION_PREPARE_SCREEN_EDIT_ACCOUNT );
            }
            else if (aSubType==SUBTYPE_MARK)
            {
                propertiesParameter += "mark.";
               
                if (aPortletName==null)
                {
                    throw new JetspeedException( "A portlet is required to return an URI." );
                }

                // FIX ME: how can we add a prepare action and a mark action at the same time?
                //         But I think this branch is never used anyway. (?)
                uri.setAction( ACTION_MARKPAGE );
                uri.addPathInfo( "portlet", aPortletName );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_CUSTOMIZE)
        {
            propertiesParameter += "customize.";
           
            uri.setPage( SCREEN_CUSTOMIZE );
           
            if( aPortletName != null )
            {
                uri.addPathInfo( "portlet", aPortletName );
            }
            if (aSubType==SUBTYPE_NONE)
            {
                if (ACTION_CUSTOMIZER!=null) uri.setAction( ACTION_CUSTOMIZER );
            }
            else if (aSubType==SUBTYPE_SAVE)
            {
                propertiesParameter += "save.";
               
                uri.setAction( ACTION_CUSTOMIZER_SAVE );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_LOGIN)
        {
            propertiesParameter += "login.";
           
            if (aSubType==SUBTYPE_NONE)
            {
                uri.setPage( SCREEN_LOGIN );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_BACK)
        {
            propertiesParameter += "back.";
           
            if (aSubType==SUBTYPE_NONE)
            {
                newURI = getMarkedPage( rundata );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_ENROLLMENT)
        {
            propertiesParameter += "enrollment.";
            uri.setPage( SCREEN_NEWACCOUNT );
        }
        else
        {
            throw new JetspeedException( "Incorrect Type / Subtype combination." );
        }

        if (newURI==null)
        {
            newURI = uri.toString();
        }

        propertiesParameter += "uri";
        String propertiesParameterValue = JetspeedResources.getString( propertiesParameter, null );
View Full Code Here

    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 +"'";
View Full Code Here

    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) {
View Full Code Here

    {
        String newURI = null;

        String propertiesParameter = "URILookup.";

        TemplateLink uri = new TemplateLink( rundata );

        if (aType==TYPE_HOME)
        {
            propertiesParameter += "home.";
           
            if (aSubType==SUBTYPE_RESTORE)
            {
                propertiesParameter += "restore.";

                newURI = getMarkedPage( rundata );
            }
            else if (aSubType==SUBTYPE_MAXIMIZE)
            {
                propertiesParameter += "maximize.";
               
                if (aPortletName==null)
                {
                    throw new JetspeedException( "A portlet is required to return an URI." );
                }
                uri.setAction( ACTION_MARKPAGE );
                uri.addPathInfo( "portlet", aPortletName );
            }
            else if (aSubType==SUBTYPE_LOGOUT)
            {
                propertiesParameter += "logout.";

                uri.setAction( ACTION_LOGOUT );
            }
            else if (aSubType==SUBTYPE_ACCEPT_LOGIN)
            {
                propertiesParameter += "acceptlogin.";

                uri.setAction( ACTION_ACCEPT_LOGIN );
            }
            else if (aSubType!=SUBTYPE_NONE)
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_INFO)
        {
            propertiesParameter += "info.";
           
            if (aPortletName==null)
            {
                throw new JetspeedException( "A portlet is required to return an URI." );
            }
           
            uri.setPage( SCREEN_INFO );
            uri.addPathInfo( "portlet", aPortletName );

            if (aSubType==SUBTYPE_MARK)
            {
                propertiesParameter += "mark.";

                uri.setAction( ACTION_MARKPAGE );
            }
            else if (aSubType!=SUBTYPE_NONE)
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_EDIT_ACCOUNT)
        {
            propertiesParameter += "editaccount.";
           
            uri.setPage( SCREEN_EDIT_ACCOUNT );

            if (aSubType==SUBTYPE_NONE)
            {
                uri.setAction( ACTION_PREPARE_SCREEN_EDIT_ACCOUNT );
            }
            else if (aSubType==SUBTYPE_MARK)
            {
                propertiesParameter += "mark.";
               
                if (aPortletName==null)
                {
                    throw new JetspeedException( "A portlet is required to return an URI." );
                }

                // FIX ME: how can we add a prepare action and a mark action at the same time?
                //         But I think this branch is never used anyway. (?)
                uri.setAction( ACTION_MARKPAGE );
                uri.addPathInfo( "portlet", aPortletName );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_CUSTOMIZE)
        {
            propertiesParameter += "customize.";
           
            uri.setPage( SCREEN_CUSTOMIZE );
           
            if( aPortletName != null )
            {
                uri.addPathInfo( "portlet", aPortletName );
            }
            if (aSubType==SUBTYPE_NONE)
            {
                if (ACTION_CUSTOMIZER!=null) uri.setAction( ACTION_CUSTOMIZER );
            }
            else if (aSubType==SUBTYPE_SAVE)
            {
                propertiesParameter += "save.";
               
                uri.setAction( ACTION_CUSTOMIZER_SAVE );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_LOGIN)
        {
            propertiesParameter += "login.";
           
            if (aSubType==SUBTYPE_NONE)
            {
                uri.setPage( SCREEN_LOGIN );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_BACK)
        {
            propertiesParameter += "back.";
           
            if (aSubType==SUBTYPE_NONE)
            {
                newURI = getMarkedPage( rundata );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_ENROLLMENT)
        {
            propertiesParameter += "enrollment.";
            uri.setPage( SCREEN_NEWACCOUNT );
        }
        else
        {
            throw new JetspeedException( "Incorrect Type / Subtype combination." );
        }

        if (newURI==null)
        {
            newURI = uri.toString();
        }

        propertiesParameter += "uri";
        String propertiesParameterValue = JetspeedResources.getString( propertiesParameter, null );
View Full Code Here

    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) {
View Full Code Here

    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 +"'";
View Full Code Here

    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 +"'";
View Full Code Here

    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) {
View Full Code Here

    {
        String newURI = null;

        String propertiesParameter = "URILookup.";

        TemplateLink uri = new TemplateLink( rundata );

        if (aType==TYPE_HOME)
        {
            propertiesParameter += "home.";
           
            if (aSubType==SUBTYPE_RESTORE)
            {
                propertiesParameter += "restore.";

                newURI = getMarkedPage( rundata );
            }
            else if (aSubType==SUBTYPE_MAXIMIZE)
            {
                propertiesParameter += "maximize.";
               
                if (aPortletName==null)
                {
                    throw new JetspeedException( "A portlet is required to return an URI." );
                }
                uri.setAction( ACTION_MARKPAGE );
                uri.addPathInfo( "portlet", aPortletName );
            }
            else if (aSubType==SUBTYPE_LOGOUT)
            {
                propertiesParameter += "logout.";

                uri.setAction( ACTION_LOGOUT );
            }
            else if (aSubType==SUBTYPE_ACCEPT_LOGIN)
            {
                propertiesParameter += "acceptlogin.";

                uri.setAction( ACTION_ACCEPT_LOGIN );
            }
            else if (aSubType!=SUBTYPE_NONE)
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_INFO)
        {
            propertiesParameter += "info.";
           
            if (aPortletName==null)
            {
                throw new JetspeedException( "A portlet is required to return an URI." );
            }
           
            uri.setPage( SCREEN_INFO );
            uri.addPathInfo( "portlet", aPortletName );

            if (aSubType==SUBTYPE_MARK)
            {
                propertiesParameter += "mark.";

                uri.setAction( ACTION_MARKPAGE );
            }
            else if (aSubType!=SUBTYPE_NONE)
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_EDIT_ACCOUNT)
        {
            propertiesParameter += "editaccount.";
           
            uri.setPage( SCREEN_EDIT_ACCOUNT );

            if (aSubType==SUBTYPE_NONE)
            {
                uri.setAction( ACTION_PREPARE_SCREEN_EDIT_ACCOUNT );
            }
            else if (aSubType==SUBTYPE_MARK)
            {
                propertiesParameter += "mark.";
               
                if (aPortletName==null)
                {
                    throw new JetspeedException( "A portlet is required to return an URI." );
                }

                // FIX ME: how can we add a prepare action and a mark action at the same time?
                //         But I think this branch is never used anyway. (?)
                uri.setAction( ACTION_MARKPAGE );
                uri.addPathInfo( "portlet", aPortletName );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_CUSTOMIZE)
        {
            propertiesParameter += "customize.";
           
            uri.setPage( SCREEN_CUSTOMIZE );
           
            if( aPortletName != null )
            {
                uri.addPathInfo( "portlet", aPortletName );
            }
            if (aSubType==SUBTYPE_NONE)
            {
                if (ACTION_CUSTOMIZER!=null) uri.setAction( ACTION_CUSTOMIZER );
            }
            else if (aSubType==SUBTYPE_SAVE)
            {
                propertiesParameter += "save.";
               
                uri.setAction( ACTION_CUSTOMIZER_SAVE );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_LOGIN)
        {
            propertiesParameter += "login.";
           
            if (aSubType==SUBTYPE_NONE)
            {
                uri.setPage( SCREEN_LOGIN );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_BACK)
        {
            propertiesParameter += "back.";
           
            if (aSubType==SUBTYPE_NONE)
            {
                newURI = getMarkedPage( rundata );
            }
            else
            {
                throw new JetspeedException( "Incorrect Type / Subtype combination." );
            }
        }
        else if (aType==TYPE_ENROLLMENT)
        {
            propertiesParameter += "enrollment.";
            uri.setPage( SCREEN_NEWACCOUNT );
        }
        else
        {
            throw new JetspeedException( "Incorrect Type / Subtype combination." );
        }

        if (newURI==null)
        {
            newURI = uri.toString();
        }

        propertiesParameter += "uri";
        String propertiesParameterValue = JetspeedResources.getString( propertiesParameter, null );
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.template.TemplateLink

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.