private String getAddSkinScript(Set<UIComponent> updateComponents) { if (updateComponents == null) return null; List<UIPortlet> uiportlets = new ArrayList<UIPortlet>(); for (UIComponent uicomponent : updateComponents) { if (uicomponent instanceof UIContainer) { UIContainer uiContainer = (UIContainer) uicomponent; uiContainer.findComponentOfType(uiportlets, UIPortlet.class); } } List<SkinConfig> skins = new ArrayList<SkinConfig>(); SkinService skinService = getApplicationComponent(SkinService.class); for (UIPortlet uiPortlet : uiportlets) { String module = uiPortlet.getExoWindowID().getPortletApplicationName() + "/" + uiPortlet.getExoWindowID().getPortletName(); SkinConfig skinConfig = skinService.getSkin(module, skin_); if (skinConfig != null) skins.add(skinConfig); } StringBuilder b = new StringBuilder(1000); for (SkinConfig ele : skins) { SkinURL url = ele.createURL(); url.setOrientation(orientation_); b.append("eXo.core.Skin.addSkin('") .append(ele.getId()) .append("','") .append(url) .append("');\n"); } return b.toString(); }
public Collection<Skin> getPortalSkins() { SkinService skinService = getApplicationComponent(SkinService.class); // Collection<Skin> skins = new ArrayList<Skin>(skinService.getPortalSkins(skin_)); // SkinConfig skinConfig = skinService.getSkin(Util.getUIPortal().getName(), skin_); if (skinConfig != null) { skins.add(skinConfig); } // Set<SkinConfig> portletConfigs = getPortalPortletSkins(); // don't merge portlet if portlet not available if (!portletConfigs.isEmpty()) { skins.add(skinService.merge(portletConfigs)); } // return skins; }
private SkinConfig getSkin(String module) { SkinService skinService = getApplicationComponent(SkinService.class); return skinService.getSkin(module, skin_); }