Content Delivery does not expose all of the component's properties. So, the Content Delivery frameworks, DD4T and DXA, would not contain all of the component's properties that you would normally see in the Content Manager. Using DD4T, we would be able to get the component's publication information. Something like this:
var componentFactory = DependencyResolver.Current.GetService<IComponentFactory>();
IComponent component = componentFactory.GetComponent("tcm:xx-xxx");
string owningPublicationTitle = component.OwningPublication.Title;
string contextPublicationTitle = component.Publication.Title;
To get the other component properties, the best approach would be to expose a REST endpoint that uses the Core Service API to get the component properties. And in the DD4T application, just consume the REST endpoint to grab the component properties. Something like this should work:
[HttpGet]
[Route("GetComponentInfo")]
public async Task<ActionResult<object>> GetComponentInfo()
{
try
{
CoreServiceClient client = new CoreServiceClient();
ComponentData componentData = (ComponentData) await client.ReadAsync("tcm:xx-xxx", null);
FullVersionInfo fullVersionInfo = (FullVersionInfo)componentData.VersionInfo;
string lastEditedDate = fullVersionInfo.RevisionDate.Value.Date.ToLongDateString();
string lastEditedBy = fullVersionInfo.Revisor.Title;
return new
{
LastEditedDate = lastEditedDate,
LastEditedBy = lastEditedBy
};
}
catch (Exception)
{
return this.StatusCode(StatusCodes.Status500InternalServerError, "Issues connecting to Tridion");
}
}
It would be interesting to see the use case for this.