Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
collapsetrue
public class LayoutTag extends TagSupport
{
...
    /** scriptaculous flag */
    private String scriptaculous;

    public String getScriptaculous()
    {
        return scriptaculous;
    }

    public void setScriptaculous(String scriptaculous)
    {
        this.scriptaculous = scriptaculous;
    }

    /** jquery flag **/
    private String jquery;

    public String getJquery()
    {
        return jquery;
    }

    public void setJquery(String jquery)
    {
        this.jquery = jquery;
    }
...

    public int doStartTag() throws JspException
    {

        ServletRequest request = pageContext.getRequest();
        ...
        if (scriptaculous != null)
        {
            request.setAttribute("dspace.layout.scriptaculous", scriptaculous);
        }
        if (jquery != null)
        {
            request.setAttribute("dspace.layout.jquery", jquery);
        }
        ...
    }
...
}

...

With this code all .jsp pages that use <dspace:layout> (majority in DSpace) will load only scriptaculous libraries. In other words will behave as previous modifications. 

Modifying *.jsp files

Now all we have to do is  change <dspace:layout> tag to include our new variables.