Publishing Content

I am currently looking at a way to see if the content has already been published once, I am in need of automating something, but I don’t want it to resend if it has already been published before. For example it was published pulled back to draft and the republished or if it was published and edited and re-published.

Is this possible or do I need to put some form of tracking in place?

Never mind I found the solution I needed.

Share it

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
www.ortussolutions.com
Twitter: @lmajano, @ortussolutions

Luis, you are cracking me up…

But I assume this is what I was after

/**

  • Bit that denotes if the content has been published or not
    */
    boolean function isContentPublished(){
    return ( getIsPublished() AND getPublishedDate() LTE now() ) ? true : false;
    }

Which is found in the BaseContent.

Doh I just realised that wont be in, damn must have been tired when I looked at this.

Ok how about this

if publishedDate() < createdDate()

It looks like when you first do drafting the published date is set without the seconds, now it could mean that if you do save this at the exact moment the seconds is at zero then you might be in trouble but that could work as a temp solution.

But I will ask this, why is the published date set when creating some content, and it is never published only saved?

Is this a bug?

Have you checked the versions. You can track the entire content history.

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
www.ortussolutions.com
Twitter: @lmajano, @ortussolutions

Luis,

That doesn’t help and here is why and how to duplicate.

  1. Create new Blog Content and then save it. Exit ContentBox
  2. Go to database and inside the database content table published date is set to createdDate with no seconds.

My question is why is publishedDate set when it has never been published?

It is a combination of things that makes a piece of content be published not a single column.

But your question was how to know the history of a content piece, right?

signature0.jpg

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Yes it was, but technically the publishedDate should be null if it has never been published.

Because if it was then I can just check if it is null, then I would know if it has ever been published before.

signature0.jpg