public String toString() { return library.getPath() + "[cat:" + StringUtils.join(library.getCategories()) + ", embed:"+ isEmbed +", type: "+ library.getTypes() +"]"; } }
private List<Resource> getCategoryResourceList(@Nonnull SlingHttpServletRequest request, LibraryType libraryType) { List<Resource> categoryResourceList = new ArrayList<>(); HashSet<String> clientLibraryCategories = new HashSet<String>(); for (ClientLibrary library: htmlLibraryManager.getLibraries().values()) { for (String category: library.getCategories()) { clientLibraryCategories.add(category); } } if (libraryType != null) { Collection<ClientLibrary> clientLibraries = htmlLibraryManager .getLibraries(clientLibraryCategories.toArray(new String[clientLibraryCategories.size()]), libraryType, true, true); clientLibraryCategories.clear(); for (ClientLibrary library: clientLibraries) { for (String category: library.getCategories()) { clientLibraryCategories.add(category); } } } for (String category: clientLibraryCategories) { categoryResourceList.add(new CategoryResource(category, request.getResourceResolver())); } return categoryResourceList; }
public ClientLibraryDependency(ClientLibraryDependency parent, ClientLibrary library, Set<String> requestedCategories, boolean isEmbed, LibraryType type) { this.library = library; this.parent = parent; if (isDependencyLoop(parent, library.getPath())) { throw new DependencyLoopException("Dependency loop detected: " + getStackTrace(parent, library.getPath())); } this.type = type; this.isEmbed = isEmbed; this.requestedCategories = new TreeSet<String>(java.util.Collections.reverseOrder()); // only the requested categories are relevant (from all the categories of this library) for (String category : library.getCategories()) { if (requestedCategories.contains(category)) { this.requestedCategories.add(category); } } }
DumplibsClientLibrary(ClientLibrary lib) { this.path = lib.getPath(); this.types = lib.getTypes(); this.categories = lib.getCategories(); this.channels = lib.getChannels(); }
for (ClientLibrary library : libraries.values()) { if (library.getTypes() != null && library.getTypes().contains(libraryType)) { String[] libraryCats = library.getCategories(); if (libraryCats != null) { for (String cat : libraryCats) {
for (ClientLibrary library : libraries.values()) { if (library.getTypes() != null && library.getTypes().contains(libraryType)) { String[] libraryCats = library.getCategories(); if (libraryCats != null) { for (String cat : libraryCats) {