Examples of TemplateLink


Examples of com.cosmo.ui.templates.TemplateLink

    */
   @Override
   public String render(Workspace workspace, PageContext page, String uuid) throws TemplateUnavailableException, PageRenderException
   {
      TemplateScript script;
      TemplateLink link;
      TemplateControl tctrl;
      StringBuilder xhtml = new StringBuilder();

      Template template = workspace.getTemplate();

      try
      {
         // Confecciona la cabecera
         xhtml.append("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">").append("\n");
         xhtml.append("<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"es\" lang=\"es\">").append("\n");
         xhtml.append("<head>").append("\n");
         xhtml.append(TAB_SEPARATOR + "<title>").append(page.getTitle()).append("</title>").append("\n");
         xhtml.append(TAB_SEPARATOR + "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=").append(page.getCharset()).append("\"></meta>").append("\n");
         xhtml.append(TAB_SEPARATOR + "<meta name=\"generator\" content=\"" + Cosmo.COSMO_NAME + "\"></meta>").append("\n");
         xhtml.append(TAB_SEPARATOR + "<meta name=\"uuid\" content=\"" + uuid + "\"></meta>").append("\n");

         // Inserta Scripts y Links de la p�gina
         Iterator<TemplateLink> itl = template.getLinks();
         while (itl.hasNext())
         {
            link = itl.next();
            xhtml.append(TAB_SEPARATOR + link.render());
         }

         Iterator<TemplateScript> its = template.getScripts();
         while (its.hasNext())
         {
View Full Code Here

Examples of org.apache.turbine.services.pull.tools.TemplateLink

        //
        // This is a place where an Application Pull Tool is used
        // in a regular Java Context. We have no Pull Service with the
        // Jsp Paging stuff, but we can run our Application Tool by Hand:
        //
        ApplicationTool templateLink = new TemplateLink();
        templateLink.init(data);

        req.setAttribute(LINK, templateLink);
        req.setAttribute(RUNDATA, data);
    }
View Full Code Here

Examples of org.apache.turbine.services.pull.tools.TemplateLink

        //
        // This is a place where an Application Pull Tool is used
        // in a regular Java Context. We have no Pull Service with the
        // Jsp Paging stuff, but we can run our Application Tool by Hand:
        //
        ApplicationTool templateLink = new TemplateLink();
        templateLink.init(data);

        req.setAttribute(LINK, templateLink);
        req.setAttribute(RUNDATA, data);
    }
View Full Code Here

Examples of org.apache.turbine.services.pull.tools.TemplateLink

        //
        // This is a place where an Application Pull Tool is used
        // in a regular Java Context. We have no Pull Service with the
        // Jsp Paging stuff, but we can run our Application Tool by Hand:
        //
        ApplicationTool templateLink = new TemplateLink();
        templateLink.init(data);

        req.setAttribute(LINK, templateLink);
        req.setAttribute(RUNDATA, data);
    }
View Full Code Here

Examples of org.apache.turbine.services.pull.tools.TemplateLink

        //
        // This is a place where an Application Pull Tool is used
        // in a regular Java Context. We have no Pull Service with the
        // Jsp Paging stuff, but we can run our Application Tool by Hand:
        //
        ApplicationTool templateLink = new TemplateLink();
        templateLink.init(data);

        req.setAttribute(LINK, templateLink);
        req.setAttribute(RUNDATA, data);
    }
View Full Code Here

Examples of org.apache.turbine.services.pull.tools.TemplateLink

        //
        // This is a place where an Application Pull Tool is used
        // in a regular Java Context. We have no Pull Service with the
        // Jsp Paging stuff, but we can run our Application Tool by Hand:
        //
        ApplicationTool templateLink = new TemplateLink();
        templateLink.init(data);

        req.setAttribute(LINK, templateLink);
        req.setAttribute(RUNDATA, data);
    }
View Full Code Here

Examples of org.apache.turbine.services.pull.tools.TemplateLink

        //
        // This is a place where an Application Pull Tool is used
        // in a regular Java Context. We have no Pull Service with the
        // Jsp Paging stuff, but we can run our Application Tool by Hand:
        //
        ApplicationTool templateLink = new TemplateLink();
        templateLink.init(data);

        req.setAttribute(LINK, templateLink);
        req.setAttribute(RUNDATA, data);
    }
View Full Code Here

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

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

    {
        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

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

    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
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.