How do I find Metadata for a publication through its GUID using the API?

How do I find Metadata for a publication through its GUID using the API?

I have the GUID, but I am not able to get Metadata for it. I am able to get it for Maps. 

I used  (Maybe I am using the wrong function. If so, what is the right one?):

var ext = new Trisoft.InfoShare.API25.DocumentObj();

string requestedMetadata = "<ishfields>" +
"<ishfield name='VERSION' level='version'/>" +
"<ishfield name='FTITLE' level='logical'/>" +
"<ishfield name='FSTATUS' level='lng'/>" +
"</ishfields>";

var version = mapVersion; // it is 2 in this case

var guid = "GUID-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";

var objectList = ext.GetMetadata(guid, ref version, "en", "", requestedMetadata); 

Error I get:

Trisoft.InfoShare.Business.ObjectNotFoundException: The object GUID-11111111-2222-3333-4444-555555555555=2=en= does not exist. [co:"GUID-11111111-2222-3333-4444-555555555555=2=en="]
at Trisoft.InfoShare.Business.DocumentObject.GetComponentObject(String logicalId, CardTypes cardTypes, IshVersion& ishVersion, IshLovValue language, IshLovValue resolution, Boolean writable, Boolean throwIfNotFound, ComponentInformationSet& informationSet)
at Trisoft.InfoShare.Business.DocumentObject.GetMetadata(String logicalId, IshVersion& ishVersion, IshLovValue language, IshLovValue resolution, IshRequestedFields ishFieldsRequestedMetadata)
at Trisoft.InfoShare.API25.DocumentObj.GetMetadata(String logicalId, String& version, String language, String resolution, String xmlRequestedMetadata)

emoji
Parents
  • Hi,

    In short, the class DocumentObj25 covers content objects like OASIS Dita Maps, Topics, Library Topics, Images and Other. Because of business logic differences, publicaitons and publication outputs are handled over PublicationOutput25 class... Much of your code is good but the initial new is different.

    I see you make assembly bound linking, do note that this requires a full Tridion Docs applicaiton server is involved. If possible I would suggest more soft linking by using the Public SOAP API calls.

    A variation of your questions and some more background is on  RE: Need to use the API or IshRemote to create publication objects 

    Best wishes,
    Dave

    emoji
Reply
  • Hi,

    In short, the class DocumentObj25 covers content objects like OASIS Dita Maps, Topics, Library Topics, Images and Other. Because of business logic differences, publicaitons and publication outputs are handled over PublicationOutput25 class... Much of your code is good but the initial new is different.

    I see you make assembly bound linking, do note that this requires a full Tridion Docs applicaiton server is involved. If possible I would suggest more soft linking by using the Public SOAP API calls.

    A variation of your questions and some more background is on  RE: Need to use the API or IshRemote to create publication objects 

    Best wishes,
    Dave

    emoji
Children
  • Thank you, Dave!!! That was very helpful... I have used PublicationOutput25 class and for sure I got my results. That was very helpful... I do have access to a full Tridion Docs application server. I deploy my code to the dev environment and test there. For now, that's how we do it on our side when we make changes to our plugins. Hopefully we are able to get a sandbox in the future to do a bit more aggressive testing. Smiley

    Thanks again,

    Sirisha Akella

    emoji