Hello,
Using the VCM API, I wish to retrieve a channel by its ID or ContentManagementID. I can see know way of doing what should be a very simple task.
Please can anyone help?
Thanks in advance,
Eoin.
You can try Class com.vignette.as.client.javabean.Channel, methods findByContentManagementId or findById. If you are developing a delivery application using Dynamic Portal/site, I'd recommend using Dynamic cache API, with com.vignette.ext.templating.util.ContentUtil.getManagedObject.
Hope it helps.
Pedro.
From: eLink Entry: OpenText Portal Forum [mailto:vignetteportal@elinkkc.opentext.com]Sent: viernes, 27 de julio de 2012 11:31To: eLink RecipientSubject: Retrieve Channel By ID
Retrieve Channel By ID
Posted byeoh@qad.com (Hartnett, Eoin) On 07-27-2012 05:28
[To post a comment, use the normal reply function]
Forum:
OpenText Portal Forum
Content Server:
Knowledge Center
Hi Pedro,
Thanks for your reply. I have seen the findById() and findByContentManagementId() methods but they are executed against a channel object. This doesn't make sense to me as I'm unsure what channel to execute these methods against. The Root/Home channel?
Anyway, I found a way to retrieve the channel using the following:
Channel ch = (Channel)ContentUtil.getManagedObject(new ManagedObjectVCMRef([MyChannelContentManagementID]));
I hope this helps someone else.
Thanks again,
Hi Eoin,
Please note that the ContentUtil class is part of the Dynamic cached API mentioned by Pedro. This is perfectly ok (actually preferred) if you are running this in the context of a Dynamic enabled web application (a clone of the vgn-ext-templating.war), otherwise it will lead to problems.
Cheers,
Tomás