brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjcorbett <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Improvements to the jsgui catalog...
Date Wed, 09 Jul 2014 13:16:39 GMT
Github user sjcorbett commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/51#discussion_r14708457
  
    --- Diff: usage/rest-server/src/main/java/brooklyn/rest/resources/CatalogResource.java
---
    @@ -134,9 +129,11 @@ public CatalogItemSummary getPolicy(
                 filters.add(CatalogPredicates.xml(StringPredicates.containsRegex(regex)));
             if (Strings.isNonEmpty(fragment))
                 filters.add(CatalogPredicates.xml(StringPredicates.containsLiteralCaseInsensitive(fragment)));
    -        return ImmutableList.copyOf(Iterables.transform(
    -                brooklyn().getCatalog().getCatalogItems(Predicates.and(filters)),
    -                TO_CATALOG_ITEM_SUMMARY));        
    +
    +        return FluentIterable.from(brooklyn().getCatalog().getCatalogItems())
    +                .filter(Predicates.and(filters))
    +                .transform(TO_CATALOG_ITEM_SUMMARY)
    +                .toSortedList(SummaryComparators.idComparator());
    --- End diff --
    
    I observe the ID of the items being set to the entry's type, e.g.:
    ```
    brooklyn.demo.CumulusRDFApplication
    brooklyn.demo.GlobalWebFabricExample
    brooklyn.demo.HighAvailabilityCassandraCluster
    brooklyn.demo.ResilientMongoDbApp
    brooklyn.demo.RiakClusterExample
    brooklyn.demo.SimpleCassandraCluster
    ...
    ```
    So it's predictable between runs of Brooklyn.
    
    That said, at the moment the jsgui catalogue page lists apps/entities by ID. It would
be better to do it by name, wouldn't it. Can I make the change in a subsequent pull request?
Got one for the addition of entities/locations to come shortly.



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message