Jahia Template Forum > Access time based...

0 (0 Good)
0 (0 Bad)

Access time based publishing expiration date

by  avantia »  2011/06/07 19:58

I'm trying to display the time based publishing expiration date of a container and haven't been successful. Is this information accessed the same way as other metadata? Here's the code I've been trying. It returns null.

Date expirationDate = container.getContentObject().getMetadataAsDate(org.jahia.query.qom.JahiaQueryObjectModelConstants.EXPIRATION_DATE, jParams);

I've successfully accessed the last modified date with similar code, so I was hoping this would work. No dice.

Any ideas? Thanks.

  (avantia)

Number of messages  3
Registration date
0 (0 Good)
0 (0 Bad)

Re: Access time based publishing expiration date

by  shuber »  2014/01/21 16:05

Actually for time-based publishing in Jahia 6.1 you need to access the information through the TimeBasedPublishingService.

So something like this :

RetentionRule rule = ServicesRegistry.getInstance().getTimeBasedPublishingService().getRetentionRule(contentObject.getObjectKey());

and then the rule will contain the time-based publishing information.

For Jahia 6.5+ this has been completely changed, and is now part of the visiblity service. You can find additional documentation here : http://www.jahia.com/community/documentation/jahia-modules/visibility/visibility.html

Best regards

  Serge Huber.

Serge Huber (shuber)

Number of messages  271
Registration date
Contact
Share
Feedback

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page