apps-infra

    Forum Stats

  • 3,873,986 Users
  • 2,266,658 Discussions
  • 7,911,684 Comments

Discussions

Condition to retrieve all assets from a site

3349974
3349974 Member Posts: 10
edited Mar 24, 2020 6:53PM in WebCenter Sites

Hello,

Is it possible to retrieve all assets of type "Product_C" from a specific site say "FirstSiteII" using create condition method.

Like,

Condition c = ConditionFactory.createCondition( "Site", OpTypeEnum.EQUALS, "FirstSiteII" );

Query query = new SimpleQuery( "Product_C", "FSII Product", c, Collections.singletonList( "name" ) );

Answers

  • Nirav Varma
    Nirav Varma Member Posts: 484 Gold Badge
    edited Mar 24, 2020 6:53PM

    QueryExpression q = SearchUtils.newQuery("siteid", Operation.CONTAINS, idOfFirstsitesII);

    q = q.and("AssetType", Operation.EQUALS, "Product_C");

    This should find you all the Product_C of a particular site

apps-infra