Did you know that in Tridion 2011SP1 it is now possible to retrieve all items that have a particular Application Data ID associated? This method basically allows you to search for a given Application Data ID and it returns the TCMURIs of all items that have that AppData ID associated.
This topic would have been very useful when I developed the AppDataInspector Powertool. At that time, in Tridion 2011GA, this functionality was not available. I would have liked to be able to search for a given Application Data ID. Instead, the tool only reads AppData on the 'current' item. [Note to self: add "search by id" functionality to AppDataInspector]
Core Service
You can use Core Service method: ICoreService2011.GetSubjectIdsWithApplicationData
The sample below is taken from my Core Service Client blog post:
TOM.NET
You can use the following method: SystemManager.GetSubjectIdsWithApplicationData(string id)
This topic would have been very useful when I developed the AppDataInspector Powertool. At that time, in Tridion 2011GA, this functionality was not available. I would have liked to be able to search for a given Application Data ID. Instead, the tool only reads AppData on the 'current' item. [Note to self: add "search by id" functionality to AppDataInspector]
Core Service
You can use Core Service method: ICoreService2011.GetSubjectIdsWithApplicationData
Gets a list of TcmUri of subjects
which have application data of the specified applicationId associated.
Namespace: Tridion.ContentManager.CoreServiceThe sample below is taken from my Core Service Client blog post:
public string
GetSubjects(string appDataId)
{
var result = "";
foreach (var
uri in
_client.GetSubjectIdsWithApplicationData(appDataId))
{
result += uri + ", ";
}
return result;
}
TOM.NET
You can use the following method: SystemManager.GetSubjectIdsWithApplicationData(string id)
Gets a list of TcmUri of subjects which have
application data of the specified applicationId
associated.
Namespace: Tridion.ContentManager
var result = "";
var systemManager =
session.SystemManager;
foreach (var
uri in systemManager.GetSubjectIdsWithApplicationData("ugc:ComponentAndPage"))
{
result += uri + "; ";
}
Comments