// if (request.getPortalContext().getProperty(PortalContext.MARKUP_HEAD_ELEMENT_SUPPORT) == null) { // logger.warn("The Portal Server does not support adding markup to the header. This may lead to portlets that do not work properly."); // } else { for (String cssFile : styles) { Element htmlHeader = response.createElement("link"); htmlHeader.setAttribute("rel", "stylesheet"); htmlHeader.setAttribute("type", "text/css"); htmlHeader.setAttribute("href", response.encodeURL(request.getContextPath() + cssFile));
response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, htmlHeader); logger.debug("Added {} CSS file to the portal header.", cssFile); }
for (String javascriptFile : scripts) { Element htmlHeader = response.createElement("script"); htmlHeader.setAttribute("src", response.encodeURL(request.getContextPath() + javascriptFile)); htmlHeader.setAttribute("type", "text/javascript");
// if (request.getPortalContext().getProperty(PortalContext.MARKUP_HEAD_ELEMENT_SUPPORT) == null) { // logger.warn("The Portal Server does not support adding markup to the header. This may lead to portlets that do not work properly."); // } else { for (String cssFile : styles) { Element htmlHeader = response.createElement("link"); htmlHeader.setAttribute("rel", "stylesheet"); htmlHeader.setAttribute("type", "text/css"); htmlHeader.setAttribute("href", response.encodeURL(request.getContextPath() + cssFile));
response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, htmlHeader); logger.debug("Added {} CSS file to the portal header.", cssFile); }
for (String javascriptFile : scripts) { Element htmlHeader = response.createElement("script"); htmlHeader.setAttribute("src", response.encodeURL(request.getContextPath() + javascriptFile)); htmlHeader.setAttribute("type", "text/javascript");
response.addProperty(MimeResponse.MARKUP_HEAD_ELEMENT, htmlHeader); logger.debug("Added {} Javascript file to the portal header.", javascriptFile); } // } } }
<!-- The view mode namespace. Maps to a namespace in the Struts 2 config file. --> <init-param> <name>viewNamespace</name> <value>/presentation</value> </init-param>
<!-- The default action to invoke in view mode. --> <init-param> <name>defaultViewAction</name> <value>analysis-presentation</value> </init-param>
<!-- The edit mode namespace. Maps to a namespace in the Struts 2 config file. --> <init-param> <name>editNamespace</name> <value>/presentation</value> </init-param>
<!-- The default action to invoke in edit mode. --> <init-param> <name>defaultEditAction</name> <value>analysis-presentation-edit</value> </init-param> ... </portlet>
Copyright 2001-2010, www.comprg.com.cn, All Rights Reserved 京ICP备14022230号-1,电话/传真:010-82561037 82561614 ,Mail:gaojian@comprg.com.cn
地址:北京市海淀区远大路20号宝蓝大厦E座704,邮编:100089