Properties in PublishTransactionFilterData to narrow down the search using Tridion Core Services

StackOverflow https://stackoverflow.com/questions/15340256

  •  23-03-2022
  •  | 
  •  

Pregunta

I am using Tridion Core Service to get all the Components published from a publication on a specific target. The code is as below.Since there can be lot of components and the result obtained using this code contains all items, Is there any way to narrow down the results (like providing ItemType and recursive as false).

var filter = new PublishTransactionsFilterData
            {
                PublicationTarget = new LinkToPublicationTargetData { IdRef = targetId },
                ForRepository = new LinkToRepositoryData { IdRef = GetPublication(publicationId)},
                BaseColumns = ListBaseColumns.IdAndTitle,
            };

XElement t= Instance.GetSystemWideListXml(filter);
var v = t.Elements().Where(k => k.Attribute("ItemType").Value == "16");
¿Fue útil?

Solución

First of all your code will always return null, as because of ListBaseColumns.IdAndTitle there will be no ItemType attribute. The only way to narrow down the results are properties you can find on PublishTransactionsFilterData, which are:

  • EndDate, StartDate to search only inside this timestamp

  • Priority, if you know it

  • PublishedBy, if you know who published it

All the rest is post filtering, which is also ok. You can filter on everything you have in XML. Sample XML looks like this:

  <tcm:Item ID="tcm:0-241-66560" Title="page" Allow="24576" Deny="67108864" Icon="T64L0P0" ItemType="64" ItemID="tcm:2-72-64" State="4" StateChangeDate="2013-03-11T14:53:55" Publication="Test" PublicationTarget="Local" ItemPath="\Test\New Structure Group" Action="0" ScheduleDate="" UserId="tcm:0-11-65552" User="domain\user" Priority="4" Managed="0" />

You can postfilter on any of the attributes

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top