(Jump to other KnowledgeBases)
DSpace Resources
DSpace Website
DSpace Documentation
DSpace Wiki
DSpace Demo Site
Contribute to KnowledgBase
...
Code Block | ||||
---|---|---|---|---|
| ||||
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.
Now all we have to do is change <dspace:layout> tag to include our new variables.