@Override public FlavorDescriptor getFlavor(String flavorName) { if (flavorName == null) { return null; } return themeStylingService.getFlavor(flavorName); }
@Override public LogoDescriptor getLogo(String flavorName) { if (flavorName == null) { return null; } return themeStylingService.getLogo(flavorName); }
@Override public String getDefaultTheme() { if (defaultPage == null) { defaultPage = themeStylingService.negotiate("jsfDefaultPage", FacesContext.getCurrentInstance()); } return defaultPage; }
@Override public String getResult(String target, Object context) { FacesContext faces = null; if (context instanceof FacesContext) { faces = (FacesContext) context; } else { return null; } String theme = (String) faces.getExternalContext().getRequestMap().get(getProperty("negotiatedPageVariable")); if (theme != null) { ThemeStylingService service = Framework.getService(ThemeStylingService.class); return service.getDefaultFlavorName(theme); } return null; } }
if (flavorName != null) { ThemeStylingService s = Framework.getService(ThemeStylingService.class); presets = s.getPresetVariables(flavorName);
@Override public WroModel create() { WroModel model = new WroModel(); ThemeStylingService ts = Framework.getService(ThemeStylingService.class); WebResourceManager ws = Framework.getService(WebResourceManager.class); ResourceContextImpl rcontext = new ResourceContextImpl(); List<PageDescriptor> pages = ts.getPages(); for (PageDescriptor page : pages) { String groupName = page.getName(); Group group = new Group(groupName); List<String> bundleNames = page.getResourceBundles(); for (String bundleName : bundleNames) { List<Resource> resources = ws.getResources(rcontext, bundleName, ResourceType.any.name()); if (resources != null) { for (Resource resource : resources) { ro.isdc.wro.model.resource.Resource wr = toWroResource(bundleName, resource); if (wr != null) { group.addResource(wr); } } } } model.addGroup(group); } return model; }
PageDescriptor page = tss.getPage(pageName); if (page == null) {
/** * Returns favicons for current flavor. * * @since 7.4 */ public List<IconDescriptor> getFavicons() { if (currentFavicons == null) { String flavor = getCurrentFlavor(); FlavorDescriptor f = themeStylingService.getFlavor(flavor); currentFavicons = new ArrayList<IconDescriptor>(); if (f != null) { List<IconDescriptor> icons = f.getFavicons(); currentFavicons.addAll(icons); } } return currentFavicons; }
public String getCurrentPage() { if (currentPage == null) { currentPage = themeStylingService.negotiate("jsfPage", FacesContext.getCurrentInstance()); if (currentPage == null) { // BBB currentPage = getDefaultTheme(); } } return currentPage; }
if (flavorName != null) { ThemeStylingService s = Framework.getService(ThemeStylingService.class); FlavorDescriptor fd = s.getFlavor(flavorName); if (fd != null) { List<SassImport> sassVars = fd.getSassImports();
public String getCurrentFlavor() { if (currentFlavor == null) { // put current page name to request for flavor negotiation FacesContext faces = FacesContext.getCurrentInstance(); HttpServletRequest request = (HttpServletRequest) faces.getExternalContext().getRequest(); request.setAttribute("jsfPage", getCurrentPage()); currentFlavor = themeStylingService.negotiate("jsfFlavor", FacesContext.getCurrentInstance()); } return currentFlavor; }