Package org.apache.turbine.util

Examples of org.apache.turbine.util.ContentURI


     * method would probably be enough, but I'm not
     * absolutely positive.
     */
    public String image(String imageId, RunData data)
    {
        ContentURI cu = new ContentURI(data);
        StringBuffer sb = new StringBuffer();
       
        sb.append(resourcesDirectory).
           append(SKINS_DIRECTORY).
           append("/").
           append(getSkin()).
           append(IMAGES_DIRECTORY).
           append("/").
           append(imageId);
       
        return cu.getURI(sb.toString());
    }
View Full Code Here


     * method would probably be enough, but I'm not
     * absolutely positive.
     */
    public String getStylecss(RunData data)
    {
      ContentURI cu = new ContentURI(data);
        StringBuffer sb = new StringBuffer();
       
        sb.append(resourcesDirectory).
           append(SKINS_DIRECTORY).
           append("/").
           append(getSkin()).
           append("/").
           append(SKIN_CSS_FILE);

        return cu.getURI(sb.toString());
    }
View Full Code Here

       Get the options for this portlet.
    */
    private ConcreteElement[] getPortletOptions( RunData rundata ) {

        Vector v = new Vector();
        ContentURI content = new ContentURI( rundata );

        int type = URILookup.getURIType(this.getPortlet(),
                                        rundata);
        int subtype = URILookup.SUBTYPE_NONE;
        try {
            subtype = URILookup.getURISubType(this.getPortlet(),
                                              rundata);
        }
        catch (JetspeedException e) {
            logger.error("Exception", e);
        }

        if ( type != URILookup.TYPE_EDIT_ACCOUNT) {
            if ( ( rundata.getUser() != null ) &&
                 ( rundata.getUser().hasLoggedIn()) ) {
                if ( this.getPortlet().getAllowEdit( rundata ) ) {
                    if (type!=URILookup.TYPE_INFO) {
                        try {
                            org.apache.ecs.html.A edit =
                                new org.apache.ecs.html.A(
                                                          URILookup.getURI( URILookup.TYPE_INFO,
                                                                            URILookup.SUBTYPE_MARK,
                                                                            this.getPortlet(),
                                                                            rundata ) )
                                    .addElement( new IMG( content.getURI( JetspeedResources.INFO_IMAGE ) )
                                        .setBorder( 0 ) );

                            v.addElement( edit );
                        }
                        catch (JetspeedException e) {
                            logger.error("Exception", e);
                        }
                    }
                }
               
            }

            if ( this.getPortlet().getAllowMaximize( rundata ) ) {
                try {
                    if ( subtype != URILookup.SUBTYPE_MAXIMIZE ) {
                        org.apache.ecs.html.A max =
                            new org.apache.ecs.html.A(
                                                      URILookup.getURI( URILookup.TYPE_HOME,
                                                                        URILookup.SUBTYPE_MAXIMIZE,
                                                                        this.getPortlet(),
                                                                        rundata ) )
                                .addElement( new IMG( content.getURI( JetspeedResources.MAX_IMAGE ) )
                                    .setBorder( 0 ) );

                        v.addElement( max );
                    }
                }
View Full Code Here

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

       Get the options for this portlet.
    */
    private ConcreteElement[] getPortletOptions( RunData rundata ) {

        Vector v = new Vector();
        ContentURI content = new ContentURI( rundata );

        int type = URILookup.getURIType(this.getPortlet(),
                                        rundata);
        int subtype = URILookup.SUBTYPE_NONE;
        try {
            subtype = URILookup.getURISubType(this.getPortlet(),
                                              rundata);
        }
        catch (JetspeedException e) {
            logger.error("Exception", e);
        }

        if ( type != URILookup.TYPE_EDIT_ACCOUNT) {
            if ( ( rundata.getUser() != null ) &&
                 ( rundata.getUser().hasLoggedIn()) ) {
                if ( this.getPortlet().getAllowEdit( rundata ) ) {
                    if (type!=URILookup.TYPE_INFO) {
                        try {
                            org.apache.ecs.html.A edit =
                                new org.apache.ecs.html.A(
                                                          URILookup.getURI( URILookup.TYPE_INFO,
                                                                            URILookup.SUBTYPE_MARK,
                                                                            this.getPortlet(),
                                                                            rundata ) )
                                    .addElement( new IMG( content.getURI( JetspeedResources.INFO_IMAGE ) )
                                        .setBorder( 0 ) );

                            v.addElement( edit );
                        }
                        catch (JetspeedException e) {
                            logger.error("Exception", e);
                        }
                    }
                }
               
            }

            if ( this.getPortlet().getAllowMaximize( rundata ) ) {
                try {
                    if ( subtype != URILookup.SUBTYPE_MAXIMIZE ) {
                        org.apache.ecs.html.A max =
                            new org.apache.ecs.html.A(
                                                      URILookup.getURI( URILookup.TYPE_HOME,
                                                                        URILookup.SUBTYPE_MAXIMIZE,
                                                                        this.getPortlet(),
                                                                        rundata ) )
                                .addElement( new IMG( content.getURI( JetspeedResources.MAX_IMAGE ) )
                                    .setBorder( 0 ) );

                        v.addElement( max );
                    }
                }
View Full Code Here

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

                                                   data.getResponse());
        newWC.put( "data", data );
        newWC.put( "link", new TemplateLink(data) );
        newWC.put( "page", new TemplatePageAttributes(data) );
        newWC.put( "formatter", new WebMacroFormatter(newWC) );
        newWC.put( "content", new ContentURI(data) );
        return newWC;
    }
View Full Code Here

                                                   data.getResponse());
        newWC.put( "data", data );
        newWC.put( "link", new TemplateLink(data) );
        newWC.put( "page", new TemplatePageAttributes(data) );
        newWC.put( "formatter", new WebMacroFormatter(newWC) );
        newWC.put( "content", new ContentURI(data) );
        return newWC;
    }
View Full Code Here

     * method would probably be enough, but I'm not
     * absolutely positive.
     */
    public String image(String imageId, RunData data)
    {
        ContentURI cu = new ContentURI(data);
        StringBuffer sb = new StringBuffer();
       
        sb.append(resourcesDirectory).
           append(SKINS_DIRECTORY).
           append("/").
           append(skinName).
           append(IMAGES_DIRECTORY).
           append("/").
           append(imageId);
       
        return cu.getURI(sb.toString());
    }
View Full Code Here

     * method would probably be enough, but I'm not
     * absolutely positive.
     */
    public String getStylecss(RunData data)
    {
        ContentURI cu = new ContentURI(data);
        StringBuffer sb = new StringBuffer();
       
        sb.append(resourcesDirectory).
           append(SKINS_DIRECTORY).
           append("/").
           append(skinName).
           append("/").
           append(SKIN_CSS_FILE);

        return cu.getURI(sb.toString());
    }
View Full Code Here

TOP

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

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.