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
  • 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
  • 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
  • Ensure that the GUID you're providing is correct. The error message suggests that the object corresponding to that GUID does not exist, which might indicate a mismatch or incorrect GUID.
    Verify the version of the object (the version parameter).

    geometry dash lite

    If you are unsure about the version, you may want to ensure that you're using the correct version for the object. Since you've specified mapVersion = 2, ensure that the version exists for the document.

    emoji