0

One of the client have following request Implement DCP, notify user and unpublish Page automatically - VB Legacy Template Tridion Version : SDL Tridion 2011 SP1 Templating - VBScript Legacy (ASP) , We also have few template (ASP.NET)

Assume content editor creates a offers content and publish the Page. The Page which contains the offers should be unpublished automatically and before un publishing the Page it needs to send notification to the product owner.

  1. we need to implement DCP on VB Legacy ASP, the Component published will have metadata (expiry date, to email address, from email address)
  2. Write a Server Side Code (ASP.NET) code using Tridion API to read the published Content and check for the expiry date metadata and compare it with the current system date and notify the product owner before the expiry date)
  3. get the Page based on the published Component id and unpublish the Page based on the expiry date.

Please let me know if this is possible.

  • The simple answer would be yes. It's all possible, assuming that you could fill in some of the missing details. The problem is, that without knowing what is possible, your technical approach is all guesswork. It's quite likely that if you can share some details of your functional requirements, you will get better answers. – Dominic Cronin Aug 29 '16 at 12:13
1

Your requirememts don't make a lot of sense as presented, you are mentioning a DCP (Dynamic Component Presentation) as a requirement but you want to unpublish the Page which it is on after the expiry date.

A reason for using DCPs would be to to have them available through a Broker query and not having to deal with publishing/unpublishing Pages. So I wonder if you have your requirements clear.

To implement your notification and unpublish code, you could do several things. Indeed if using DCPs, you could write a "service" using the Broker API that queries for the expiry dates and unpublish both the DCP and the Page (note unpublishing a DCP won't unpublish the Page, and unpublishing the Page won't unpublish the DCP, so you'll have to do both separate when unpublishing). But this service

With the limited information you gave around your requirements, I would be tempted to change them and interpret it as follows:

  1. Ignore the DCP requirement, handle it from the CM server

  2. In your template code (at publish time), store the Page URI in an external database, together with the Component metadata (expiry date and user to notify)

  3. Build a service around your external database and have it send the notifications and use the Core Service to unpublish the Page(s)

This keeps the responsibility at a clear location, and the code simple. Optionally you could use an event handler if you don't want the code in the template, but then you would need to trigger on a successful Page Publish and check out what was published and if you need to store information, which makes the code more complicated I would say.

If it wasn't for the notification you could have used an event handler to simple schedule an unpublish of the Page in the Tridion CM itself. Although that has no guarantee since the publishing queue could be cleared or the unpublish task could be deleted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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