6

I used the code sample below to return a list of recently-modified items from the Core Service. GetSearchResults() returns an array of IdentifiableObjectData's.

Can I include extra columns in the search results?

For the moment I'm looking for ItemType & WebDAV folder.

        LinkToIdentifiableObjectData folder = new LinkToIdentifiableObjectData();
        folder.IdRef="tcm:1-1-2";
        filter.SearchIn = folder;
        filter.ModifiedAfter = Convert.ToDateTime("03/01/13");
        var results = client.GetSearchResults(filter);

1 Answer 1

8

The WebDavURL is available in the LocationInfo property. You must cast the item to RepositoryLocalObject first, e.g.:

string webdavUrl = ((RepositoryLocalObjectData) item).LocationInfo.WebDavUrl;

However, I'm not sure if this property is filled when you search. It could be that you need to read the IdentifiableObjectData separately for each item in the results.

To get to the item type, you can either parse the Id yourself (it is a TcmUri presented as a string), or check if the item is of a certain type, e.g.:

if (item is ComponentData) { // action goes here }
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.