3

We are trying to get the information regarding which version was last published in the component\page java script. Is it really possible?

Edit: We have a developed a web app which gets the published version using core services and are calling it in item's java script. It is working fine but is there any other better way which would would be more performant?

2 Answers 2

10

One IMPORTANT thing you'll need to think of is that a component can be published in different states on different pages, so there can be a scenario where multiple versions are published.

Technically it's possible, actually there's probably a lot of ways to achieve this. Here's some topics I'd look into:

1) GUI Extensions - you'll need to show the version published in the user interface

2) Storage extensions - to write the data of the published version somewhere

3) Template building blocks - at rendering time even obtain the version rendered

(option 2 is likely better than option 3 - if you wish to guarantee the item is published)

Let me know if you need more help :)

Thanks

John

2
  • 1
    Great points John... just to add a little more... - GUI Extensions - consider the differences between the CME and UXM views - Storage extensions - perhaps this would allow to compensate for the difference 'versions' of the content that may be published in different states/on different pages Commented Sep 27, 2013 at 9:12
  • performance wise which would be the best option?
    – Guest19876
    Commented Sep 30, 2013 at 10:19
5

If what you are looking is a supported GUI Extension, I would say that a Data Extender would be the right option for it, it will be performance expensive though.

In your Data Extender you will need to intercept the Request for a GetList command, the idea behind extending that command is to add a new attribute including the Publishing Info. Using Core Services in your Data Extender you can do the following thing.

IEnumerable<PublishInfoData> lstPublishInfo = channel.GetListPublishInfo("[ItemId]");

A PublishInfoData object will give you a RenderedWith property which is a LinkToVersionedItemData. You can get the VersionedItemData as following.

VersionedItemData item = (VersionedItemData)channel.Read(publishInfo.RenderedWith.IdRef,
                                                         new ReadOptions());

From there you can get the published version or list of published versions.

The next step would be to create a GUI Editor that will read the extra XML Node you have added to the Response and use it to create a new column.

You can find documentation about how to add a new column via a Data Extender here.

Adding a Column Login information will be required to access it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.